From patchwork Thu May 16 00:17:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Craig Setera X-Patchwork-Id: 7785 Return-Path: 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 4VfrJN65s3z3wdf for ; Thu, 16 May 2024 00:17:24 +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 4VfrJM0cBQzbq; Thu, 16 May 2024 00:17:23 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4VfrJL6kzmz2xfm; Thu, 16 May 2024 00:17:22 +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) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4VfrJH4TRpz2xfm for ; Thu, 16 May 2024 00:17:19 +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)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4VfrJG2lzxzbq for ; Thu, 16 May 2024 00:17:18 +0000 (UTC) Authentication-Results: mail01.ipfire.org; dkim=pass header.d=setera.org header.s=zmail header.b=fj5Xl5WO; 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=1715818638; a=rsa-sha256; cv=pass; b=s4pmXh0HPRk4OPR24HMXJTIaevNd3HxNTa8U8OJqtqWxzFf6MsiHbeLXRQmVR7c806EZvB jD5EJP6CCbLtkLFpsnUM5pjdedW8/YT/N3jKkry4tq1e9VPTBkOudh24UGqgqra8jl0+n5 ZtMVckaQA+ym3k7NkWkwNwP0QLESjXxP5I7KPo2/3pGluq5z0Tm6zLDH+S84/vQ6XhbgZT juaNE71OtQ/0jDY3rMO2blqy/L0DKzogmbFHE1kPJ9k5MpwBADoAsS0wtRivmdOYxenJC8 /3WWGxN7EZAhi5C3kFS+c64oDV5AybVt8ggHO8+eX/nT8od27yZQmN+P0k3phw== ARC-Authentication-Results: i=2; mail01.ipfire.org; dkim=pass header.d=setera.org header.s=zmail header.b=fj5Xl5WO; 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=1715818638; 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=miCdOy19Y6yYvSQP2EAtmw/O9f1wtVUwJniStLRy9eo=; b=gQioD9LIH/NvkmF33UbDSiNMrhspQpHR3vAG2Dd6XwUlOLzdF4vofOYvZYnwM75IFgsy2n mlcYdhMjSfRDR0oWQDe4fPZm//OC/oLan9kBRd+F4jBBFdNbrEXl1MiKig29kjhM/gAPL5 2o7jGx2vn+h15CbF6yRcH4yTE8g8hU7QQdq49Mmu5OfQriGNIxwyiggUUCLOtF4Ickdbpi 1gm0Woopf3+HIdL//5B6GoG0EGTZmaxbTAxPb4iMjFnrCeJFTl/FgrfFRSwfsrtctqLGQF STURMc+1RU4mxfyMmE66pu76oZe2Hwd/uUQZWKf/3jjip08UJjvlmYM+9CWv0A== ARC-Seal: i=1; a=rsa-sha256; t=1715818635; cv=none; d=zohomail.com; s=zohoarc; b=hk57aLt8A0Js4gzcBHfmDJV0ebww3LMrvdSpooQ0BW1qEyJX6tfFWUBlG+pg7apDm7rt4NXhz+h0iDq1YBJFUTE4T5hWrJee5LzkQ4SyEhFI7+znMyggcAJwDYV+Caa2BdEkwHxVMO4vX7MCQyFKk9qmPv5wM61IRI1aq+RkZYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715818635; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=miCdOy19Y6yYvSQP2EAtmw/O9f1wtVUwJniStLRy9eo=; b=UmQeo+ST9578SpmMx5qWCt1vc5XyADGXenBrYOuK8FzeKAE0zU/1xBXDSd1prBBZ0PTPMWgCTvFxdt9rEG6RzZzIWnTls6t04AvtsYt0Ti7WUPchxXlJ5oK9fZlJdKKO26K6fmiGDH6kSUsjZyLKpLFacCTM57dEp2XJstqHWZc= 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= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1715818635; 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=miCdOy19Y6yYvSQP2EAtmw/O9f1wtVUwJniStLRy9eo=; b=fj5Xl5WOLdY8gW400yXdUMb9vUTOLZUjZy5d2qjODqT1+q8oUgKryh6fpe31zHZn NXkEnyquu8Y0cfMXvqsoEiFOuhxRANRd0g0GBJcYrBUOJhuAwFcEfOK3W9MGBaMIQwO R5NQ20msv1KNUNqVOtobMduCNlxVLU7D5nNESDV4= Received: by mx.zohomail.com with SMTPS id 1715818633658139.94237197121686; Wed, 15 May 2024 17:17:13 -0700 (PDT) Message-ID: <9170af89-a308-429a-a56a-f0db65dd7ae4@setera.org> Date: Wed, 15 May 2024 19:17:12 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: development@lists.ipfire.org From: Craig Setera Subject: Updates to u-boot script for Raspberry Pi 4b devices X-ZohoMailClient: External X-Rspamd-Queue-Id: 4VfrJG2lzxzbq X-Spamd-Result: default: False [-5.89 / 11.00]; BAYES_HAM(-3.00)[99.99%]; ARC_ALLOW(-1.00)[zohomail.com:s=zohoarc:i=1]; NEURAL_HAM(-1.00)[-0.999]; 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:c]; R_DKIM_ALLOW(-0.20)[setera.org:s=zmail]; RWL_MAILSPIKE_GOOD(-0.10)[136.143.188.15:from]; ONCE_RECEIVED(0.10)[]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; XM_UA_NO_VERSION(0.01)[]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[setera.org]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=2]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ASN(0.00)[asn:2639, ipnet:136.143.188.0/23, country:US]; DKIM_REPUTATION(0.00)[0]; RCVD_COUNT_ONE(0.00)[1]; DKIM_TRACE(0.00)[setera.org:+]; 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: YHCTBM24K3ZXRECEWAQJ7JEHVUEP2YEX X-Message-ID-Hash: YHCTBM24K3ZXRECEWAQJ7JEHVUEP2YEX 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 Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 Signed-off-by: Craig Setera --- config/u-boot/boot.cmd | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) +++ 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 diff --git a/config/u-boot/boot.cmd b/config/u-boot/boot.cmd index a27996780..eedd5776d 100644 --- a/config/u-boot/boot.cmd