From owner-freebsd-arm@freebsd.org Mon Sep 16 06:47:06 2019 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 736A8F591D for ; Mon, 16 Sep 2019 06:47:06 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46WxcT43R0z4Dk5 for ; Mon, 16 Sep 2019 06:47:05 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id x8G6kfvM036814 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 15 Sep 2019 23:46:41 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id x8G6keYY036813; Sun, 15 Sep 2019 23:46:40 -0700 (PDT) (envelope-from jmg) Date: Sun, 15 Sep 2019 23:46:40 -0700 From: John-Mark Gurney To: freebsd-arm@FreeBSD.org Subject: RockPro64 booting w/ u-boot v2019-rc3 Message-ID: <20190916064640.GN96402@funkthat.com> Mail-Followup-To: freebsd-arm@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 11.0-RELEASE-p7 amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Sun, 15 Sep 2019 23:46:41 -0700 (PDT) X-Rspamd-Queue-Id: 46WxcT43R0z4Dk5 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of jmg@gold.funkthat.com has no SPF policy when checking 208.87.223.18) smtp.mailfrom=jmg@gold.funkthat.com X-Spamd-Result: default: False [-1.42 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.955,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.95)[-0.950,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[funkthat.com]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-0.71)[ip: (-1.85), ipnet: 208.87.216.0/21(-0.92), asn: 32354(-0.74), country: US(-0.05)]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[jmg@funkthat.com,jmg@gold.funkthat.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:32354, ipnet:208.87.216.0/21, country:US]; FROM_NEQ_ENVFROM(0.00)[jmg@funkthat.com,jmg@gold.funkthat.com]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 06:47:06 -0000 I recently received my RockPro64, and w/ a bit of help from manu, I built a new u-boot firmware and get it booting from SD card. The u-boot port firmware will boot, but receives an Unhandled System Error shortly after going to multiuser mode. It doesn't yet set the PCIe slot. Is anyone working on this? If so, can you point me to code? I'd like to get this working. Building u-boot isn't hard, but finding the correct part to build took some help. Possibly imcomplete list of packages used: aarch64-none-elf-binutils-2.32_1,1 GNU binutils for bare metal AArch64 cross-development aarch64-none-elf-gcc-6.4.0_6 Cross GNU Compiler Collection for aarch64noneelf atf-rk3399-v2.1 ARM TF-A for platform rk3399 bison-3.4.1,1 Parser generator from FSF, (mostly) compatible with Yacc dtc-1.4.7 Device Tree Compiler gmake-4.2.1_3 GNU version of 'make' utility gsed-4.7 GNU stream editor python3-3_3 The "meta-port" for version 3 of the Python interpreter The default sed fails at one point, so used this patch: diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index ef116e0e0a..e0dedf8943 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -302,7 +302,7 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ -i $(dir $<) $(DTC_FLAGS) \ -d $(depfile).dtc.tmp $(dtc-tmp) ; \ cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) ; \ - sed -i "s:$(pre-tmp):$(<):" $(depfile) + gsed -i "s:$(pre-tmp):$(<):" $(depfile) $(obj)/%.dtb: $(src)/%.dts FORCE $(call if_changed_dep,dtc) There is also a failure on the config step, and needs this patch as well: diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index b18eab1707..3260c472b9 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -3100,6 +3100,7 @@ CONFIG_SYS_MACB2_BASE CONFIG_SYS_MACB3_BASE CONFIG_SYS_MAIN_PWR_ON CONFIG_SYS_MALLOC_BASE +CONFIG_SYS_MALLOC_CLEAR_ON_INIT CONFIG_SYS_MALLOC_SIMPLE CONFIG_SYS_MAMR CONFIG_SYS_MAPLE And then built using the following commands: export BL31=/usr/local/share/atf-rk3399/bl31.elf gmake clean gmake rockpro64-rk3399_defconfig CROSS_COMPILE=aarch64-none-elf- gmake -j 4 I may have forgotten to include some steps. After building, I installed the parts via: dd if=idbloader.img of=/dev/disk4 oseek=64 bs=512 dd if=u-boot.itb of=/dev/disk4 oseek=16384 bs=512 I used FreeBSD-13.0-CURRENT-arm64-aarch64-20190906-r351901-memstick.img as a base, but it has the UEFI boot partition in this area, so I used mdconfig to extract the parts, and then expanded the image, created a new freebsd-boot partition to cover the space for the above, and then replaced the images... => 3 2111549 mmcsd0 GPT (30G) [CORRUPT] 3 32765 2 freebsd-boot (16M) 32768 67584 1 efi (33M) 100352 2011200 3 freebsd (982M) The corrupt tag is because I haven't expanded the gpt to cover the full SD card yet. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."