Message ID | ccbdf33c-440e-4a85-8d92-f1be75380464@setera.org |
---|---|
State | New |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Vjc6D0wp7z3wxG for <patchwork@web04.haj.ipfire.org>; Mon, 20 May 2024 12:18:12 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Vjc691p4kz5d; Mon, 20 May 2024 12:18:09 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Vjc690YQqz2y2N; Mon, 20 May 2024 12:18:09 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Vjc660b2yz2y2N for <development@lists.ipfire.org>; Mon, 20 May 2024 12:18:06 +0000 (UTC) Received: from sender4-op-o15.zoho.com (sender4-op-o15.zoho.com [136.143.188.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4Vjc641V9fz5d for <development@lists.ipfire.org>; Mon, 20 May 2024 12:18:04 +0000 (UTC) Authentication-Results: mail01.ipfire.org; dkim=pass header.d=setera.org header.s=zmail header.b=K2vocovg; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (mail01.ipfire.org: domain of craigjunk@setera.org designates 136.143.188.15 as permitted sender) smtp.mailfrom=craigjunk@setera.org; dmarc=none ARC-Seal: i=2; s=202003rsa; d=lists.ipfire.org; t=1716207485; a=rsa-sha256; cv=pass; b=mOl5VO+qtGf0dsaZKAN1ilB44P3Q4QVmRunNBiJhUaD/sApIz30DVQfsA7/VY6SchSPl5x Shb9Slo+INzm8P3qa0L5M6tYKq5adx5+kk95otps6ptr5jm8HQnXdRZqSNFu08BEnbtIcY hDSdDNX+JCnbysPUS/En/g9tyS2U0ClRmctaSV1YaPYbOuFWS9XgBNc3Q6w3hfD527AavP E0fxW3B/dNZejKHhtYOsp4QKT3Yl0wYflky8upZf70q2iEbq+xr4EhVdrIy618jcYP0uH1 Fq46E7aQTIyEprb+fN2Z3XGnu++ijwbnHOqODoF4fjXpw2kmaWRKVUQ+yZwFtQ== ARC-Authentication-Results: i=2; mail01.ipfire.org; dkim=pass header.d=setera.org header.s=zmail header.b=K2vocovg; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (mail01.ipfire.org: domain of craigjunk@setera.org designates 136.143.188.15 as permitted sender) smtp.mailfrom=craigjunk@setera.org; dmarc=none ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1716207485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=7JKz/fBMbnZMXeR0kRqYpL0KpqNEP4JO8VsYF8IHl2M=; b=AIBCfVYKbwM58jtqCZ+tSgvFSkDnCdtkH889Im49VZMfEp6SKZs+jfrioiKkpldi2h8EZM yHg/Vju8WfgOO+Z2DOpA7NOMQUBO8EquZ9ytarSxmZrRmzkxK1Ewvw+a9F+9ZxMIXGit9x qeRS4Fw7SSC5BQ7/ZBUNqsIY2JqLY3gXVBTh2CEtKXKpkDdYwX+gN2bnFNObPbSJq5BwH/ CoMruoIa28xkSzKxnU8VquqRW2pLlRbcvxyZsIWFnxRU3VQF6lRGR6o49GScfjrdyzs1jj Tncrpx1B7Ta5asTJfLCZNOa97Y5GtxjRnXLYwtMDrf+ggef1Z5vZU7JVoyo3yg== ARC-Seal: i=1; a=rsa-sha256; t=1716207479; cv=none; d=zohomail.com; s=zohoarc; b=T9c7M6CwDtLycaB3b3A/DmBJ2zQxjcGYEKLCwomPZZLwU7uOeJzkQVQHW+EBjxhVwGQig8NKiiefJ0PiUNi5yqnePeqhpXcumA1QmTuHlz6XfpYpmw2Qy1oIHHeWR/F/R89kaLL1hSUhR52iMHsowhtldMS7Oc1vqputaORPtRc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716207479; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=7JKz/fBMbnZMXeR0kRqYpL0KpqNEP4JO8VsYF8IHl2M=; b=RLvL3kZXHQ0qIdztnC80jX/SVKwsz63wtOHoB7IO/eOO2lLsbOlqv0sUvVUnuS6Nl2bTFULSIbpDYDXQDEsYVn6UW2+6hSQk/DcBvWTnRmp3IcfAn5CdbWDybgRW/seFK0liFuKUzJNQUVSo9QGp+n45QeCBR7TikKJZK2K4xzs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=setera.org; spf=pass smtp.mailfrom=craigjunk@setera.org; dmarc=pass header.from=<craigjunk@setera.org> DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1716207479; s=zmail; d=setera.org; i=craigjunk@setera.org; h=Message-ID:Date:Date:MIME-Version:To:To:From:From:Subject:Subject:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=7JKz/fBMbnZMXeR0kRqYpL0KpqNEP4JO8VsYF8IHl2M=; b=K2vocovgYG6hsJ2J9GzNoPiSSeBkv7d4EXN8yhVh/nVVFxiL/yo1AD9JrpzQSCyt 99Z0DrbL2bcHUALc+3Dxq11LO0Pwsiu7ybRmPhrbGOXL2WkFOhqjRssq3hruj3u33Es Ay+hcHXjqqRdiIX+dJuzbU0WLlhZhz36medqNbq4= Received: by mx.zohomail.com with SMTPS id 1716207476670886.9834213152808; Mon, 20 May 2024 05:17:56 -0700 (PDT) Message-ID: <ccbdf33c-440e-4a85-8d92-f1be75380464@setera.org> Date: Mon, 20 May 2024 07:17:54 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: development@lists.ipfire.org From: Craig Setera <craigjunk@setera.org> Subject: [PATCH] Updates to u-boot script for Raspberry Pi 4b devices Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ZohoMailClient: External X-Rspamd-Queue-Id: 4Vjc641V9fz5d X-Spamd-Result: default: False [-9.15 / 11.00]; BAYES_HAM(-3.00)[99.99%]; R_DKIM_ALLOW(-1.64)[setera.org:s=zmail]; ARC_ALLOW(-1.00)[zohomail.com:s=zohoarc:i=1]; NEURAL_HAM(-1.00)[-0.999]; DKIM_REPUTATION(-0.91)[-0.90941247948238]; SPF_REPUTATION_HAM(-0.91)[-0.90941247948238]; IP_REPUTATION_HAM(-0.39)[asn: 2639(-0.38), country: US(-0.01), ip: 136.143.188.15(0.00)]; R_SPF_ALLOW(-0.20)[+ip4:136.143.188.0/24]; RWL_MAILSPIKE_GOOD(-0.10)[136.143.188.15:from]; MIME_GOOD(-0.10)[text/plain]; ONCE_RECEIVED(0.10)[]; XM_UA_NO_VERSION(0.01)[]; MX_GOOD(-0.01)[]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[setera.org]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[setera.org:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:2639, ipnet:136.143.188.0/23, country:US]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=2]; RCVD_IN_DNSWL_NONE(0.00)[136.143.188.15:from] X-Rspamd-Server: mail01.haj.ipfire.org X-Rspamd-Action: no action Message-ID-Hash: FCQ6QA6YUHSIIOGGAEFAO5PA2SBKGJ6O X-Message-ID-Hash: FCQ6QA6YUHSIIOGGAEFAO5PA2SBKGJ6O X-MailFrom: craigjunk@setera.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> Archived-At: <https://lists.ipfire.org/hyperkitty/list/development@lists.ipfire.org/message/FCQ6QA6YUHSIIOGGAEFAO5PA2SBKGJ6O/> List-Archive: <https://lists.ipfire.org/hyperkitty/list/development@lists.ipfire.org/> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Owner: <mailto:development-owner@lists.ipfire.org> List-Post: <mailto:development@lists.ipfire.org> List-Subscribe: <mailto:development-join@lists.ipfire.org> List-Unsubscribe: <mailto:development-leave@lists.ipfire.org> |
Series |
Updates to u-boot script for Raspberry Pi 4b devices
|
|
Commit Message
Craig Setera
May 20, 2024, 12:17 p.m. UTC
Updates to u-boot script for Raspberry Pi 4b devices to properly configure the serial console and to choose the proper boot address to be used on newer board revisions. With these changes in place, I'm able to fully boot into a serial console in u-boot. The serial console configuration was derived from the Grub 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-pi/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@setera.org> Signed-off-by: Craig Setera <craigjunk@setera.org> --- config/u-boot/boot.cmd | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) 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 "${fdtfile}" -eq "broadcom/bcm2711-rpi-4-b.dtb"; then + # Hardware revision 1.4 + if test ${board_revision} -eq 0xB03114 -o ${board_revision} -eq 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 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
Comments
Hello Craig, Thank you very much for this patch. This is perfectly readable :) It looks logical to me, however I am not an expert when it comes to SBCs, so I will leave this for Arne to review and merge. Best, -Michael > On 20 May 2024, at 13:17, Craig Setera <craigjunk@setera.org> wrote: > > Updates to u-boot script for Raspberry Pi 4b devices to > properly configure the serial console and to choose the proper boot address > to be used on newer board revisions. With these changes in place, I'm able > to fully boot into a serial console in u-boot. > > The serial console configuration was derived from the Grub 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-pi/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@setera.org> > Signed-off-by: Craig Setera <craigjunk@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}" = "ON"; then > if test "${fdtfile}" = "broadcom/bcm2837-rpi-3-b.dtb"; then > setenv console ttyS1,115200n8; > else > - setenv console ttyAMA0,115200n8; > + if test "${fdtfile}" = "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 "${fdtfile}" -eq "broadcom/bcm2711-rpi-4-b.dtb"; then > + # Hardware revision 1.4 > + if test ${board_revision} -eq 0xB03114 -o ${board_revision} -eq 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 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 > -- > 2.40.1 > >
Thanks Michael, Is there anything more you need me to do? I assume most of the current effort is currently focused on the test release. Thanks, Craig On 5/23/24 12:01 PM, Michael Tremer wrote: > Hello Craig, > > Thank you very much for this patch. This is perfectly readable :) > > It looks logical to me, however I am not an expert when it comes to SBCs, so I will leave this for Arne to review and merge. > > Best, > -Michael > >> On 20 May 2024, at 13:17, Craig Setera <craigjunk@setera.org> wrote: >> >> Updates to u-boot script for Raspberry Pi 4b devices to >> properly configure the serial console and to choose the proper boot address >> to be used on newer board revisions. With these changes in place, I'm able >> to fully boot into a serial console in u-boot. >> >> The serial console configuration was derived from the Grub 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-pi/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@setera.org> >> Signed-off-by: Craig Setera <craigjunk@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}" = "ON"; then >> if test "${fdtfile}" = "broadcom/bcm2837-rpi-3-b.dtb"; then >> setenv console ttyS1,115200n8; >> else >> - setenv console ttyAMA0,115200n8; >> + if test "${fdtfile}" = "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 "${fdtfile}" -eq "broadcom/bcm2711-rpi-4-b.dtb"; then >> + # Hardware revision 1.4 >> + if test ${board_revision} -eq 0xB03114 -o ${board_revision} -eq 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 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 >> -- >> 2.40.1 >> >>
Hello Craig, Hmm, I am not the right person to talk to about this, but it looks this has all been discussed here already: https://community.ipfire.org/t/hang-with-kernel-starting-on-raspberry-pi/11558 -Michael > On 4 Jun 2024, at 13:40, Craig Setera <craigjunk@setera.org> wrote: > > Thanks Michael, > > Is there anything more you need me to do? I assume most of the current effort is currently focused on the test release. > > Thanks, > Craig > > On 5/23/24 12:01 PM, Michael Tremer wrote: >> Hello Craig, >> >> Thank you very much for this patch. This is perfectly readable :) >> >> It looks logical to me, however I am not an expert when it comes to SBCs, so I will leave this for Arne to review and merge. >> >> Best, >> -Michael >> >>> On 20 May 2024, at 13:17, Craig Setera <craigjunk@setera.org> wrote: >>> >>> Updates to u-boot script for Raspberry Pi 4b devices to >>> properly configure the serial console and to choose the proper boot address >>> to be used on newer board revisions. With these changes in place, I'm able >>> to fully boot into a serial console in u-boot. >>> >>> The serial console configuration was derived from the Grub 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-pi/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@setera.org> >>> Signed-off-by: Craig Setera <craigjunk@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}" = "ON"; then >>> if test "${fdtfile}" = "broadcom/bcm2837-rpi-3-b.dtb"; then >>> setenv console ttyS1,115200n8; >>> else >>> - setenv console ttyAMA0,115200n8; >>> + if test "${fdtfile}" = "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 "${fdtfile}" -eq "broadcom/bcm2711-rpi-4-b.dtb"; then >>> + # Hardware revision 1.4 >>> + if test ${board_revision} -eq 0xB03114 -o ${board_revision} -eq 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 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 >>> -- >>> 2.40.1 >>> >>>
Thanks. That was my original conversation! :-) I will just wait for Arne to find some time. On 6/10/24 11:42 AM, Michael Tremer wrote: > Hello Craig, > > Hmm, I am not the right person to talk to about this, but it looks this has all been discussed here already: > > https://community.ipfire.org/t/hang-with-kernel-starting-on-raspberry-pi/11558 > > -Michael > >> On 4 Jun 2024, at 13:40, Craig Setera <craigjunk@setera.org> wrote: >> >> Thanks Michael, >> >> Is there anything more you need me to do? I assume most of the current effort is currently focused on the test release. >> >> Thanks, >> Craig >> >> On 5/23/24 12:01 PM, Michael Tremer wrote: >>> Hello Craig, >>> >>> Thank you very much for this patch. This is perfectly readable :) >>> >>> It looks logical to me, however I am not an expert when it comes to SBCs, so I will leave this for Arne to review and merge. >>> >>> Best, >>> -Michael >>> >>>> On 20 May 2024, at 13:17, Craig Setera <craigjunk@setera.org> wrote: >>>> >>>> Updates to u-boot script for Raspberry Pi 4b devices to >>>> properly configure the serial console and to choose the proper boot address >>>> to be used on newer board revisions. With these changes in place, I'm able >>>> to fully boot into a serial console in u-boot. >>>> >>>> The serial console configuration was derived from the Grub 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-pi/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@setera.org> >>>> Signed-off-by: Craig Setera <craigjunk@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}" = "ON"; then >>>> if test "${fdtfile}" = "broadcom/bcm2837-rpi-3-b.dtb"; then >>>> setenv console ttyS1,115200n8; >>>> else >>>> - setenv console ttyAMA0,115200n8; >>>> + if test "${fdtfile}" = "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 "${fdtfile}" -eq "broadcom/bcm2711-rpi-4-b.dtb"; then >>>> + # Hardware revision 1.4 >>>> + if test ${board_revision} -eq 0xB03114 -o ${board_revision} -eq 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 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 >>>> -- >>>> 2.40.1 >>>> >>>>
FWIW... I just used my updated u-boot script to update the image for 186 and went through the setup process using serial console for my Raspberry Pi. My process: * Download backup from IPFire * Flash new image to SD Card * Update u-boot script * Make new image using script * Boot and do initial setup via serial console * Login to web admin and restore backup Even though this is a few more steps than just doing an "in place" upgrade, I actually like that I am keeping the previous SD card and can swap back if something goes wrong. Craig On 6/10/24 7:10 PM, Craig Setera wrote: > Thanks. That was my original conversation! :-) I will just wait for > Arne to find some time. > > On 6/10/24 11:42 AM, Michael Tremer wrote: >> Hello Craig, >> >> Hmm, I am not the right person to talk to about this, but it looks >> this has all been discussed here already: >> >> https://community.ipfire.org/t/hang-with-kernel-starting-on-raspberry-pi/11558 >> >> -Michael >> >>> On 4 Jun 2024, at 13:40, Craig Setera <craigjunk@setera.org> wrote: >>> >>> Thanks Michael, >>> >>> Is there anything more you need me to do? I assume most of the >>> current effort is currently focused on the test release. >>> >>> Thanks, >>> Craig >>> >>> On 5/23/24 12:01 PM, Michael Tremer wrote: >>>> Hello Craig, >>>> >>>> Thank you very much for this patch. This is perfectly readable :) >>>> >>>> It looks logical to me, however I am not an expert when it comes to >>>> SBCs, so I will leave this for Arne to review and merge. >>>> >>>> Best, >>>> -Michael >>>> >>>>> On 20 May 2024, at 13:17, Craig Setera <craigjunk@setera.org> wrote: >>>>> >>>>> Updates to u-boot script for Raspberry Pi 4b devices to >>>>> properly configure the serial console and to choose the proper >>>>> boot address >>>>> to be used on newer board revisions. With these changes in place, >>>>> I'm able >>>>> to fully boot into a serial console in u-boot. >>>>> >>>>> The serial console configuration was derived from the Grub >>>>> 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-pi/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@setera.org> >>>>> Signed-off-by: Craig Setera <craigjunk@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}" = "ON"; then >>>>> if test "${fdtfile}" = >>>>> "broadcom/bcm2837-rpi-3-b.dtb"; then >>>>> setenv console ttyS1,115200n8; >>>>> else >>>>> - setenv console ttyAMA0,115200n8; >>>>> + if test "${fdtfile}" = >>>>> "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 >>>>> "${fdtfile}" -eq "broadcom/bcm2711-rpi-4-b.dtb"; then >>>>> + # Hardware revision 1.4 >>>>> + if test ${board_revision} -eq 0xB03114 -o ${board_revision} >>>>> -eq 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 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 >>>>> -- >>>>> 2.40.1 >>>>> >>>>>
Today I tried to use this process to upgrade to latest core version (188) and the resulting card is not properly working, despite this process working for the last couple of releases. Looking in Git, it doesn't seem like there were other boot.cmd changes that might have caused issues, so thought I'd check here to see if anyone knew what might have changed in the most recent release relative to u-boot on RPi? Thanks for any insights. Craig On 6/16/24 10:28 AM, Craig Setera wrote: > FWIW... I just used my updated u-boot script to update the image for > 186 and went through the setup process using serial console for my > Raspberry Pi. My process: > > * Download backup from IPFire > * Flash new image to SD Card > * Update u-boot script > * Make new image using script > * Boot and do initial setup via serial console > * Login to web admin and restore backup > > Even though this is a few more steps than just doing an "in place" > upgrade, I actually like that I am keeping the previous SD card and > can swap back if something goes wrong. > > Craig >
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}" = "ON"; then if test "${fdtfile}" = "broadcom/bcm2837-rpi-3-b.dtb"; then setenv console ttyS1,115200n8; else - setenv console ttyAMA0,115200n8; + if test "${fdtfile}" = "broadcom/bcm2711-rpi-4-b.dtb"; then + setenv console ttyS0,115200n8; + else + setenv console ttyAMA0,115200n8; + fi; fi;