Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CBF1BC001DE for ; Tue, 25 Jul 2023 15:42:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 38D55867E8; Tue, 25 Jul 2023 17:41:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=bfs.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=bfs.de header.i=@bfs.de header.b="C7NfJOTp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EB2F886378; Tue, 25 Jul 2023 17:35:33 +0200 (CEST) Received: from mx01-muc.bfs.de (mx01-muc.bfs.de [193.174.230.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 07FA785837 for ; Tue, 25 Jul 2023 17:35:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=bfs.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=RWenisch@bfs.de Received: from SRVEX01-MUC.bfs.intern (unknown [10.161.90.31]) by mx01-muc.bfs.de (Postfix) with ESMTPS id 5845C201D5 for ; Tue, 25 Jul 2023 17:35:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bfs.de; s=dkim201901; t=1690299330; 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; bh=uy5T7YbHvs6vtAptOE7OMkl8yF1mzpp6WcMzrx/37oE=; b=C7NfJOTpyzB2NYmdv+/iIM0+f3cEcCxlHQGKtA9BLtsFxAttd8q5zoRNzLyM0/qDwuXWP1 bAU1JseEpuOQMtOlttPLIhNRpbnpTkXxbSCASOGDNW/0LTvAxkjr+bPAE9ffy8S+sn7w4t OI15fFcqNkHq3uRUYn0O2dOUzw4pxvip/yw1ycGjCwR0xXZjfuVSVkfssPDqRwPG2masVD thCnDSmPijHqNsgAEmgg3W6gt6xsXW6A2z/SoCuiBW5g40THVwU0fP7+LxeqOaTJRiR7Jr 4vCd9kSIWieHsWZb2jKBMsl09gtM4XBUghZXxWn5IDKLoFWDUvMRPh1kbqvzBg== Authentication-Results: mx01-muc.bfs.de; none Received: from SRVEX01-MUC.bfs.intern (10.161.90.31) by SRVEX01-MUC.bfs.intern (10.161.90.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Tue, 25 Jul 2023 17:35:29 +0200 Received: from SRVEX01-MUC.bfs.intern ([fe80::e8ba:5ab1:557f:4aad]) by SRVEX01-MUC.bfs.intern ([fe80::e8ba:5ab1:557f:4aad%12]) with mapi id 15.01.2507.027; Tue, 25 Jul 2023 17:35:29 +0200 From: Robert Wenisch To: "u-boot@lists.denx.de" Subject: getting u-boot to work on raspi 3b (32bit) Thread-Topic: getting u-boot to work on raspi 3b (32bit) Thread-Index: Adm/DaNr7Sj+KFj8S32g8CA9a6PZ9g== Date: Tue, 25 Jul 2023 15:35:29 +0000 Message-ID: Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.177.128.64] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spamd-Result: default: False [-15.00 / 7.00]; WHITELIST_LOCAL_IP(-15.00)[10.161.90.31]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; NEURAL_HAM(-0.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_EQ_ADDR_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; HAS_XOIP(0.00)[]; DKIM_SIGNED(0.00)[bfs.de:s=dkim201901]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Mailman-Approved-At: Tue, 25 Jul 2023 17:40:30 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Hello, in order to study the boot process of embedded ARM systems, I decided to st= art with something well documented: booting as raspi 3b using u-boot. I downloaded kernel sources and u-boot sources. I built the kernel with CROSS_COMPILE=3Darm-linux-gnueabihf- ARCH=3Darm make bcmrpi_defconfig CROSS_COMPILE=3Darm-linux-gnueabihf- ARCH=3Darm make -j6 zImage dtbs module= s cp arch/arm/boot/zImage /path/to/sdcard-boot-partition cp arch/arm/boot/dts/bcm2710-rpi-3-b.dtb /path/to/sdcard-boot-partition CROSS_COMPILE=3Darm-linux-gnueabihf- ARCH=3Darm INSTALL_MOD_PATH make modul= es_install Further I compiled and setup u-boot: CROSS_COMPILE=3Darm-linux-gnueabihf- ARCH=3Darm make rpi_3_32b_defconfig CROSS_COMPILE=3Darm-linux-gnueabihf- ARCH=3Darm make -j6 cp u-boot.bin /path/to/ sdcard-boot-partition I then went on to edit the config.txt: kernel=3Du-boot-bin enable_uart=3D1 arm_64bit=3D0 device_tree=3Dbcm2710-rpi-3-b.dtb and boot.txt goes fatload mmc 0:1 ${fdt_addr_r} bcm2710-rpi-3-b.dtb fatload mmc 0:1 $kernel_addr_r} zImage setenv bootargs console=3DttyS0,115200 root=3D/dev/mmcblk0p2 rootfstype=3De= xt4 rootwait rw earlyprintk bootz ${kernel_addr_r} - {fdt_addr_r} I produced an image of boot.txt mkimage -A arm -O linux -T script -d boot.txt boot.scr Frustratingly, it didn't go as smoothly as expected. With these setting I got up to state "Starting Kernel ..." over the serial = port, then it freezes (or at least doesn't log anything on the tty). I can't post the whole log as I only have it on my dev-machine. However some interesting bits for now: I'm booting on u-boot 2023-07-0967-g94e7cb181a 1 - Pretty much at the beginning it says "Loading Environment from FAT... *= ** warning - bad CRC, using default environment" I suppose this only means we're not providing a .env file? 2 - Upon "Scanning bus usb@7e980000 for devices... it's logging a lot of ga= rbage (as in misinterpreted character codes), what might be going on there? 3 - A bit further down it states "Found U-Boot script /boot.scr" [...] "## Executing script at 02400000" As this changes when I edit around the boot.txt and mkimage, I infer u-boot= is indeed loading my boot instructions not just some default values. Then follow some info on kernel image flatted device tree blob and their re= spective memory addresses. It the tries to load the kernel to little apparent success :/ This procedure is what I gathered from a plethora of tutorial and howtos. M= ost of these are quite old, have there been breaking changes in u-boot's de= velopment in the meanwhile? For example some sources state the kernel is launched via booti ${kernel_ad= dr_r} - {fdt_addr_r}, however the booti command seem to be absent in my u-b= oot version. Is there anything else I#m doing wrong? I'll be grateful for any hints at this point... Cheers Robert