From mboxrd@z Thu Jan  1 00:00:00 1970
From: Craig Setera <craigjunk@setera.org>
To: development@lists.ipfire.org
Subject: Re: Updates to u-boot script for Raspberry Pi 4b devices
Date: Fri, 17 May 2024 12:39:13 -0500
Message-ID: <4cb12bbe-69f7-4a95-af4f-cf08f64883a6@setera.org>
In-Reply-To: <5F118462-5C51-4FB6-859B-07221500EF45@ipfire.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2139700046908238805=="
List-Id: <development.lists.ipfire.org>

--===============2139700046908238805==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Makes sense.=C2=A0 Not sure how it ended up that way because I definitely had=
=20
it formatted correctly in my local source.=C2=A0 I will need to try to get a =

better patch out of Git.

Thanks for the clarification!

On 5/17/24 10:54 AM, jon wrote:
> Craig,
>
> I believe Michael is referring to the leading white space or the indents.
>
> Take a look at the existing code and that is easy to read with the=20
> indents.
>
> Here is the existing code below:
>
>
> I am guessing he has not looked at the content yet because the patch=20
> is difficult to read.
>
> Jon
>
>
>
>> On May 17, 2024, at 6:48 AM, Craig Setera <craigjunk(a)setera.org> wrote:
>>
>> Thanks Michael
>>
>> I will try to find time this weekend to try again.=C2=A0 I may have to see=
=20
>> if I can get this done outside of Thunderbird.
>>
>> To make sure I'm understanding the issue.=C2=A0 It seems like the patch=20
>> contents are probably ok, but everything up to the contents of the=20
>> patch are smashed together?
>>
>> Craig
>>
>> On 5/17/24 4:27 AM, Michael Tremer wrote:
>>> Hello Craig,
>>>
>>> Thanks again for the patch. The tag in the subject line isn=E2=80=99t tha=
t=20
>>> important, but the email you sent has again removed all whitespace=20
>>> which makes it impossible to read or apply the patch.
>>>
>>> -Michael
>>>
>>>> On 16 May 2024, at 18:38, Craig Setera <craigjunk(a)setera.org> wrote:
>>>>
>>>> Apologies. =C2=A0I just realized that I forgot to prefix the subject=20
>>>> with [Patch]. =C2=A0Should I resend with a new subject or can this be=20
>>>> considered without that step?
>>>>
>>>> On 5/15/24 7:17 PM, Craig Setera wrote:
>>>>> Updates to u-boot script for Raspberry Pi 4b devices to
>>>>> properly configure the serial console and to choose the proper=20
>>>>> boot address
>>>>> to be used on newer board revisions. With these changes in place,=20
>>>>> I'm ablemay
>>>>> to fully boot into a serial console in u-boot.
>>>>> The serial console configuration was derived from the Grub=20
>>>>> configuration,
>>>>> while the boot address changes were taken from the IPFire Raspberry 4b
>>>>> documentation page: https://www.ipfire.org/docs/hardware/arm/rpi/four
>>>>> Per the conversation in the forums, I don't know why the boot
>>>>> address changes are required. I was simply trying to automate those
>>>>> changes such that downloaded builds will work out of the box.
>>>>> https://community.ipfire.org/t/hang-with-kernel-starting-on-raspberry-p=
i/11558/37
>>>>> NOTE: The use of the different parameter options to the test
>>>>> command to minimize the need for deeply nested conditionals. I did
>>>>> try more bash-shell like syntax, but u-boot didn't seem to like that.
>>>>> The operators used here were found in the u-boot source.
>>>>> Tested-by: Craig Setera <craigjunk(a)setera.org>
>>>>> Signed-off-by: Craig Setera <craigjunk(a)setera.org>
>>>>> ---
>>>>> config/u-boot/boot.cmd | 27 ++++++++++++++++++++++++---
>>>>> 1 file changed, 24 insertions(+), 3 deletions(-)
>>>>> diff --git a/config/u-boot/boot.cmd b/config/u-boot/boot.cmd
>>>>> index a27996780..eedd5776d 100644
>>>>> --- a/config/u-boot/boot.cmd
>>>>> +++ b/config/u-boot/boot.cmd
>>>>> @@-51,7 +51,11 @@if test "${SERIAL-CONSOLE}" =3D "ON"; then
>>>>> if test "${fdtfile}" =3D "broadcom/bcm2837-rpi-3-b.dtb"; then
>>>>> setenv console ttyS1,115200n8;
>>>>> else
>>>>> -setenv console ttyAMA0,115200n8;
>>>>> +if test "${fdtfile}" =3D "broadcom/bcm2711-rpi-4-b.dtb"; then
>>>>> +setenv console ttyS0,115200n8;
>>>>> +else
>>>>> +setenv console ttyAMA0,115200n8;
>>>>> +fi;
>>>>> fi;
>>>>> fi;
>>>>> else
>>>>> @@-95,11 +99,28 @@else
>>>>> setenv ramdisk_addr -;
>>>>> fi;
>>>>> +#
>>>>> +# Handle Raspberry Pi 4 address differences
>>>>> +# https://www.ipfire.org/docs/hardware/arm/rpi/four
>>>>> +#
>>>>> +setenv booti_fdt_addr ${fdt_addr_r};
>>>>> +if test "${board}" -eq "rpi" -a ${cpu} -eq "armv8" -a=20
>>>>> "${fdtfile}" -eq "broadcom/bcm2711-rpi-4-b.dtb"; then
>>>>> +# Hardware revision 1.4
>>>>> +if test ${board_revision} -eq 0xB03114 -o ${board_revision} -eq=20
>>>>> 0xC03114 -o ${board_revision} -eq 0xD03114; then
>>>>> +setenv booti_fdt_addr ${fdt_addr};
>>>>> +fi
>>>>> +
>>>>> +# Hardware revision 1.5
>>>>> +if test ${board_revision} -eq 0xB03115 -o ${board_revision} -eq=20
>>>>> 0xC03115 -o ${board_revision} -eq 0xD03115; then
>>>>> +setenv booti_fdt_addr ${fdt_addr};
>>>>> +fi
>>>>> +fi;
>>>>> +
>>>>> bootz ${kernel_addr_r} ${ramdisk_addr} ${fdt_addr_r};
>>>>> -booti ${kernel_addr_r} ${ramdisk_addr} ${fdt_addr_r};
>>>>> +booti ${kernel_addr_r} ${ramdisk_addr} ${booti_fdt_addr};
>>>>> bootz ${kernel_addr_r} - ${fdt_addr_r};
>>>>> -booti ${kernel_addr_r} - ${fdt_addr_r};
>>>>> +booti ${kernel_addr_r} - ${booti_fdt_addr};
>>>>> # Recompile with:
>>>>> # mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
>

--===============2139700046908238805==--