On Sun, 2020-02-02 at 23:01 +0100, Sebastian Reitenbach wrote:
> Hi,
> 
> got a Pine64 Rock64_V2.0 2017-0713, which is stuck booting miniroot66.fs.
> 
> This is how I prepared the miniroot66.fs to boot on it, following 
> INSTALL.arm64:
> 
> ftp https://ftp.hostserver.de/pub/OpenBSD/snapshots/arm64/miniroot66.fs
> dd if=miniroot66.fs of=/dev/rsd2c
> mount /dev/sd2i /mnt
> mkdir /mnt/rockchip
> cp /usr/local/share/dtb/arm64/rockchip/rk3328-rock64.dtb /mnt/rockchip
> umount /mnt
> dd if=/usr/local/share/u-boot/rock64-rk3328/idbloader.img of=/dev/sd2c seek=64
> dd if=/usr/local/share/u-boot/rock64-rk3328/u-boot.itb of=/dev/sd2c seek=16384
> 
> the device itself boots the u-boot-erase-spi-rock64.img from 
> ayufan-rock64/linux-u-boot
> as well as NetBSD-evbarm-aarch64-202001141930Z-rock64.img. 
> However, booting the prepared miniroot66.fs I'm stuck at:
> 
>  cu -l /dev/cuaU0 -s 115200  
> Connected to /dev/cuaU0 (speed 115200)
> 
> U-Boot TPL 2020.01 (Jan 12 2020 - 02:16:54)
> data training error
> col error
> data training error
> LPDDR3, 800MHz
> BW=16 Col=12 Bk=8 CS0 Row=16 CS=1 Die BW=8 Size=4096MB
> 

The 'col error' appears to be fixed after u-boot 2020.01 was
released.

I've backported the fix for it in the attached diff to our u-boot
port. I've uploaded the rock64-rk3328 subdir with the fix here:

http://www.intricatesoftware.com/distfiles/u-boot-2020.01p2.rock64-rk3328.tar.gz

Could you test idbloader.img and u-boot.itb from it on both of your
boards to see if it corrects the TPL memory training error you
are seeing?

-Kurt

> U-Boot TPL 2020.01 (Jan 12 2020 - 02:16:54)
> data training error
> col error
> data training error
> LPDDR3, 800MHz
> BW=16 Col=12 Bk=8 CS0 Row=16 CS=1 Die BW=8 Size=4096MB
> 
> I have another rock64 with 2GB memory, same V2.0 from 2017-0713 
> taking the SD card from there and place it into this 1GB device, 
> I get the same, stuck in U-Boot, same output.
> 
> When I put the miniroot66.fs into the 2GB memory booting device, I 
> get output alike:
> 
> U-Boot TPL 2020.01 (Jan 12 2020 - 02:16:54)
> LPDDR3, 800MHz
> BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
> Trying to boot from BOOTROM
> Returning to boot ROM...
> 
> U-Boot SPL 2020.01 (Jan 12 2020 - 02:16:54 -0700)
> Trying to boot from MMC1
> NOTICE:  BL31: v2.2(debug):2.2
> NOTICE:  BL31: Built : 02:07:28, Jan 12 2020
> ERROR:   over or zero region, nr=4187432, max=10
> NOTICE:  BL31:Rockchip release version: v1.2
> INFO:    ARM GICv2 driver initialized
> INFO:    plat_rockchip_pmu_init: pd status 0xe
> INFO:    BL31: Initializing runtime services
> WARNING: BL31: cortex_a53: CPU workaround for 855873 was missing!
> INFO:    BL31: Preparing for EL3 exit to normal world
> INFO:    Entry point address = 0x200000
> INFO:    SPSR = 0x3c9
> 
> 
> U-Boot 2020.01 (Jan 12 2020 - 02:16:54 -0700)
> 
> Model: Pine64 Rock64
> DRAM:  2 GiB
> PMIC:  RK8050 (on=0x40, off=0x00)
> MMC:   rksdmmc@ff500000: 1, rksdmmc@ff520000: 0
> Loading Environment from MMC... *** Warning - bad CRC, using default 
> environment
> ...
> 
> any idea what could be the problem?
> I don't know what the values in that line should tell me:
> BW=16 Col=12 Bk=8 CS0 Row=16 CS=1 Die BW=8 Size=4096MB
> is the Size=4096MB the memory it detected and is trying to use?
> 
> 
> Sebastian
> 
> below the NetBSD dmesg from the non-booting device.
> 
> > 
> > > 
> > > NetBSD/evbarm EFI Boot (aarch64), Revision 1.12 (Thu Jan  9 17:18:43 UTC 
> > > 2020) (from NetBSD 9.0_RC1)
> Press return to boot now, any other key for boot prompt
> booting netbsd - starting in 0 seconds.     
> 5377304+2473216+2732660+1927828 [515353+700224+490565]=0x1012fb8
> [   1.0000000] NetBSD/evbarm (fdt) booting ...
> [   1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 
> 2004, 2005,
> [   1.0000000]     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 
> 2015, 2016, 2017,
> [   1.0000000]     2018, 2019, 2020 The NetBSD Foundation, Inc.  All rights 
> reserved.
> [   1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
> [   1.0000000]     The Regents of the University of California.  All rights 
> reserved.
> 
> [   1.0000000] NetBSD 9.0_RC1 (GENERIC64) #0: Thu Jan  9 17:18:43 UTC 2020
> [   1.0000000]  
> mkre...@mkrepro.netbsd.org:/usr/src/sys/arch/evbarm/compile/GENERIC[   
> 1.0000000] total memory = 1007
> MB
> [   1.0000000] avail memory = 971 MB
> [   1.0000000] armfdt0 (root)
> [   1.0000000] simplebus0 at armfdt0: Pine64 Rock64
> [   1.0000000] cpus0 at simplebus0
> [   1.0000000] simplebus1 at simplebus0
> [   1.0000000] simplebus2 at simplebus0
> [   1.0000000] cpu0 at cpus0: Cortex-A53 r0p4 (Cortex V8-A core)
> [   1.0000000] cpu0: package 0, core 0, smt 0
> [   1.0000000] cpu0: IC enabled, DC enabled, EL0/EL1 stack Alignment check 
> enabled
> [   1.0000000] cpu0: Cache Writeback Granule 16B, Exclusives Reservation 
> Granule 16B
> [   1.0000000] cpu0: Dcache line 64, line 64
> [   1.0000000] cpu0: L1 32KB/64B 2-way read-allocate VIPT Instruction cache
> [   1.0000000] cpu0: L1 32KB/64B 4-way write-back read-allocate 
> write-allocate PIPT Data cache
> [   1.0000000] cpu0: L2 256KB/64B 16-way write-back read-allocate write-alte 
> PIPT Unified cache
> [   1.0000000] cpu0: revID=0x180, PMCv3, 4k table, 64k table, 16bit ASID
> [   1.0000000] cpu0: auxID=0x11120, FP, CRC32, SHA1, SHA256, AES+PMULL, NEON, 
> rounding, NaN propagation, denormals,
> 32x64bitRegs, Fused Multiply-Add
> [   1.0000000] cpufreqdt0 at cpu0
> [   1.0000000] cpu1 at cpus0: Cortex-A53 r0p4 (Cortex V8-A core)
> [   1.0000000] cpu1: package 0, core 1, smt 0
> [   1.0000000] cpufreqdt1 at cpu1
> [   1.0000000] cpu2 at cpus0: Cortex-A53 r0p4 (Cortex V8-A core)
> [   1.0000000] cpu2: package 0, core 2, smt 0
> [   1.0000000] cpufreqdt2 at cpu2
> [   1.0000000] cpu3 at cpus0: Cortex-A53 r0p4 (Cortex V8-A core)
> [   1.0000000] cpu3: package 0, core 3, smt 0
> [   1.0000000] cpufreqdt3 at cpu3
> [   1.0000000] gic0 at simplebus0: GIC
> [   1.0000000] armgic0 at gic0: Generic Interrupt Controller, 160 sources 
> (149 valid)
> [   1.0000000] armgic0: 16 Priorities, 128 SPIs, 6 PPIs, 15 SGIs
> [   1.0000000] syscon0 at simplebus0: System Controller Registers
> [   1.0000000] fclock0 at simplebus0: 24000000 Hz fixed clock (xin24m)
> [   1.0000000] syscon1 at simplebus0: System Controller Registers
> [   1.0000000] fclock1 at simplebus0: 125000000 Hz fixed clock (gmac_clkin)
> [   1.0000000] gtmr0 at simplebus0: Generic Timer
> [   1.0000000] gtmr0: interrupting on GIC irq 27
> [   1.0000000] armgtmr0 at gtmr0: Generic Timer (24000 kHz, virtual)
> [   1.0000060] rkcru0 at simplebus0: RK3328 CRU
> [   1.0000060] rkiomux0 at simplebus0: RK3328 IOMUX control
> [   1.0000060] rkgpio0 at rkiomux0: GPIO (gpio0@ff210000)
> [   1.0000060] gpio0 at rkgpio0: 32 pins
> [   1.0000060] rkgpio1 at rkiomux0: GPIO (gpio1@ff220000)
> [   1.0000060] gpio1 at rkgpio1: 32 pins
> [   1.0000060] rkgpio2 at rkiomux0: GPIO (gpio2@ff230000)
> [   1.0000060] gpio2 at rkgpio2: 32 pins
> [   1.0000060] rkgpio3 at rkiomux0: GPIO (gpio3@ff240000)
> [   1.0000060] gpio3 at rkgpio3: 32 pins
> [   1.0000060] rkiic0 at simplebus0: Rockchip I2C (100000 Hz)
> [   1.0000060] iic0 at rkiic0: I2C bus
> [   1.0000060] rkpmic0 at iic0 addr 0x18: RK805 Power Management IC
> [   1.0000060] rkreg0 at rkpmic0: vdd_logic
> [   1.0000060] rkreg1 at rkpmic0: vdd_arm
> [   1.0000060] rkreg2 at rkpmic0: vcc_ddr
> [   1.0000060] rkreg3 at rkpmic0: vcc_io
> [   1.0000060] rkreg4 at rkpmic0: vdd_18
> [   1.0000060] rkreg5 at rkpmic0: vcc_18emmc
> [   1.0000060] rkreg6 at rkpmic0: vdd_10
> [   1.0000060] fregulator0 at simplebus0: vcc_sys
> [   1.0000060] fregulator1 at simplebus0: vcc_sd
> [   1.0000060] com0 at simplebus0: ns16550a, working fifo
> [   1.0000060] com0: console
> [   1.0000060] com0: interrupting on GIC irq 89
> [   1.0000060] fregulator2 at simplebus0: vcc_host_5v
> [   1.0000060] fregulator3 at simplebus0: vcc_host1_5v
> [   1.0000060] rkdrm0 at simplebus0
> [   1.0000060] rkusb0 at syscon1: USB2 PHY
> [   1.0000060] rkusbphy0 at rkusb0: USB2 OTG port
> [   1.0000060] rkusbphy1 at rkusb0: USB2 host port
> [   1.0000060] /opp_table0 at simplebus0 not configured
> [   1.0000060] /vop@ff370000 at simplebus0 not configured
> [   1.0000060] /amba/dmac@ff1f0000 at simplebus1 not configured
> [   1.0000060] /codec@ff410000 at simplebus0 not configured
> [   1.0000060] spdiftx0 at simplebus0: SPDIF transmitter
> [   1.0000060] rktsadc0 at simplebus0: RK3328/3399 Temperature Sensor ADC
> [   1.0000060] rktsadc0: interrupting on GIC irq 90
> [   1.0000060] /iommu@ff373f00 at simplebus0 not configured
> [   1.0000060] /hdmi@ff3c0000 at simplebus0 not configured
> [   1.0000060] /phy@ff430000 at simplebus0 not configured
> [   1.0000060] /i2s@ff010000 at simplebus0 not configured
> [   1.0000060] /efuse@ff260000 at simplebus0 not configured
> [   1.0000060] /spdif@ff030000 at simplebus0 not configured
> [   1.0000060] /syscon@ff100000/io-domains at syscon0 not configured
> [   1.0000060] /syscon@ff100000/grf-gpio at syscon0 not configured
> [   1.0000060] /syscon@ff100000/power-controller at syscon0 not configured
> [   1.0000060] /spi@ff190000 at simplebus0 not configured
> [   1.0000060] /watchdog@ff1a0000 at simplebus0 not configured
> [   1.0000060] /gpu@ff300000 at simplebus0 not configured
> [   1.0000060] dwcmmc0 at simplebus0: DesignWare SD/MMC
> [   1.0000060] dwcmmc0: interrupting on GIC irq 44
> [   1.0000060] dwcmmc1 at simplebus0: DesignWare SD/MMC
> [   1.0000060] dwcmmc1: interrupting on GIC irq 46
> [   1.0000060] awge0 at simplebus0: GMAC
> [   1.0000060] awge0: Core version: 00001035
> [   1.0000060] awge0: Ethernet address 2a:35:9f:29:d4:45
> [   1.0000060] awge0: HW feature mask: d0f17
> [   1.0000060] rgephy0 at awge0 phy 0: RTL8211F 1000BASE-T media interface
> [   1.0000060] rgephy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 
> 1000baseT-FDX, auto
> [   1.0000060] rgephy1 at awge0 phy 1: RTL8211F 1000BASE-T media interface
> [   1.0000060] rgephy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 
> 1000baseT-FDX, auto
> [   1.0000060] awge0: interrupting on GIC irq 56
> [   1.0000060] dwctwo0 at simplebus0: DesignWare USB2 OTG
> [   1.0000060] dwctwo0: interrupting on GIC irq 55
> [   1.0000060] ehci0 at simplebus0: EHCI
> [   1.0000060] ehci0: interrupting on GIC irq 48
> [   1.0000060] ehci0: 1 companion controller, 1 port
> [   1.0000060] usb0 at ehci0: USB revision 2.0
> [   1.0000060] ohci0 at simplebus0: OHCI
> [   1.0000060] ohci0: interrupting on GIC irq 49
> [   1.0000060] ohci0: OHCI version 1.0
> [   1.0000060] usb1 at ohci0: USB revision 1.0
> [   1.0000060] xhci0 at simplebus0: DesignWare USB3 XHCI (rev. 3.00a)
> [   1.0000060] xhci0: interrupting on GIC irq 99
> [   1.0000060] usb2 at xhci0: USB revision 3.0
> [   1.0000060] usb3 at xhci0: USB revision 2.0
> [   1.0000060] armpmu0 at simplebus0: Performance Monitor Unit
> [   1.0000060] psci0 at simplebus0: PSCI 1.0
> [   1.0000060] /sound at simplebus0 not configured
> [   1.0000060] /syscon@ff100000/reboot-mode at syscon0 not configured
> [   1.0000060] rkdrm0: no display interface ports configured
> [   1.0000060] rkdrm0: couldn't register DRM device: -6
> [   1.0000060] cpu1: IC enabled, DC enabled, EL0/EL1 stack Alignment check 
> enabled
> [   1.0000060] cpu1: Cache Writeback Granule 16B, Exclusives Reservation 
> Granule 16B
> [   1.0000060] cpu1: Dcache line 64, Icache line 64
> [   1.0000060] cpu1: L1 32KB/64B 2-way read-allocate VIPT Instruction cache
> [   1.0000060] cpu1: L1 32KB/64B 4-way write-back read-allocate 
> write-allocate PIPT Da
> [   1.0000060] cpu1: L2 256KB/64B 16-way write-back read-allocate 
> write-allocate PIPT Unified cache
> [   1.0000060] cpu1: revID=0x180, PMCv3, 4k table, 64k table, 16bit ASID
> [   1.0000060] cpu1: auxID=0x11120, FP, CRC32, SHA1, SHA256, AES+PMULL, NEON, 
> raN propagation, denormals,
> 32x64bitRegs, Fused Multiply-Add
> [   1.0000060] cpu2: IC enabled, DC enabled, EL0/EL1 stack Alignment check 
> enabled
> [   1.0000060] cpu2: Cache Writeback Granule 16B, Exclusives Reservation 
> Granule 16B
> [   1.0000060] cpu2: Dcac Icache line 64
> [   1.0000060] cpu2: L1 32KB/64B 2-way read-allocate VIPT Instruction cache
> [   1.0000060] cpu2: L1 32KB/64B 4-way write-back read-allocate 
> write-allocate PIPT Data cache
> [   1.0000060] cpu2: L2 256KB/64B 16-way write-back read-allocate allocate 
> PIPT Unified cache
> [   1.0000060] cpu2: revID=0x180, PMCv3, 4k table, 64k table, 16bit ASID
> [   1.0000060] cpu2: auxID=0x11120, FP, CRC32, SHA1, SHA256, AES+PMULL, NEON, 
> rounding, NaN propagation, denormals,
> 32x64bitRegs, Fused Multiply-Add
> [   1.6856784] cpu3: IC enabled, DC enabled, EL0/EL1 stack Alignment check 
> enabled
> [   1.6856784] cpu3: Cache Writeback Granule 16B, Exclusives Reservation 
> Granule 16B
> [   1.6856784] cpu3: Dcache line 64, Icache line 64
> [   1.6856784] cpu3: L1 32KB/64B 2-way read-allocate VIPT Instruction cache
> [   1.6856784] cpu3: L1 32KB/64B 4-way write-back read-allocate 
> write-allocate PIPT Data cache
> [   1.6856784] cpu3: L2 256KB/64B 16-way write-back read-allocate 
> write-allocate PIPT Unified cache
> [   1.6856784] cpu3: revID=0x180, PMCv3, 4k table, 64k table, 16bit ASID
> [   1.6856784] cpu3: auxID=0x11120, FP, CRC32, SHA1, SHA256, AES+PMULL, NEON, 
> rounding, NaN propagation, denormals,
> 32x64bitRegs, Fused Multiply-Add
> [   1.6956732] sdmmc0 at dwcmmc0
> [   1.6956732] sdmmc1 at dwcmmc1
> [   1.6956732] uhub0 at usb2: NetBSD (0000) xHCI root hub (0000), class 9/0, 
> rev 3.00/1.00, addr 0
> [   1.8056753] uhub1 at usb3: NetBSD (0000) xHCI root hub (0000), class 9/0, 
> rev 2.00/1.00, addr 0
> [   1.9056785] uhub2 at usb1: NetBSD (0000) OHCI root hub (0000), class 9/0, 
> rev 1.00/1.00, addr 1
> [   1.9056785] uhub3 at usb0: NetBSD (0000) EHCI root hub (0000), class 9/0, 
> rev 2.00/1.00, addr 1
> [   1.9156803] armpmu0: interrupting on GIC irq 132
> [   1.9156803] armpmu0: interrupting on GIC irq 133
> [   1.9156803] armpmu0: interrupting on GIC irq 134
> [   1.9256795] armpmu0: interrupting on GIC irq 135
> [   1.9256795] usb4 at dwctwo0: USB revision 2.0
> [   1.9356813] sdmmc1: sdmmc_mem_enable failed with error 60
> [   1.9456802] sdmmc1: couldn't enable card: 60
> [   1.9456802] uhub4 at usb4: NetBSD (0000) DWC2 root hub (0000), class 9/0, 
> rev 2.00/1.00, addr 1
> [   1.9456802] sdmmc0: SD card status: 4-bit, C10, U1
> [   1.9456802] ld0 at sdmmc0: <0x1b:0x534d:EB1QT:0x30:0x480353fe:0x141>
> [   1.9556824] ld0: 30528 MB, 7753 cyl, 128 head, 63 sec, 512 bytes/sect x 
> 62521344 sectors
> [   1.9556824] ld0: 4-bit width, High-Speed/SDR25, 50.000 MHz
> [   2.6656965] WARNING: 3 errors while detecting hardware; check system log.
> [   2.6656965] boot device: ld0
> [   2.6656965] root on ld0a dumps on ld0b
> [   2.6756992] root file system type: ffs
> [   2.6756992] kern.module.path=/stand/evbarm/9.0/modules
> [   2.6756992] WARNING: no TOD clock present
> [   2.6756992] WARNING: using filesystem time
> [   2.6807132] WARNING: CHECK AND RESET THE DATE!
> 
Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/u-boot/Makefile,v
retrieving revision 1.64
diff -u -p -u -r1.64 Makefile
--- Makefile	17 Jan 2020 14:24:42 -0000	1.64
+++ Makefile	3 Feb 2020 18:57:03 -0000
@@ -7,7 +7,7 @@ FLAVOR?=	arm
 
 COMMENT=	U-Boot firmware
 VERSION=	2020.01
-REVISION=	1
+REVISION=	2
 DISTNAME=	u-boot-${VERSION}
 PKGNAME=	u-boot-${FLAVOR}-${VERSION:S/-//}
 FULLPKGNAME=	${PKGNAME}
Index: patches/patch-arch_arm_dts_rk3328-sdram-lpddr3-666_dtsi
===================================================================
RCS file: patches/patch-arch_arm_dts_rk3328-sdram-lpddr3-666_dtsi
diff -N patches/patch-arch_arm_dts_rk3328-sdram-lpddr3-666_dtsi
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_rk3328-sdram-lpddr3-666_dtsi	3 Feb 2020 18:57:03 -0000
@@ -0,0 +1,44 @@
+$OpenBSD$
+
+Upstream for rk3328 TPL "col error":
+https://github.com/u-boot/u-boot/commit/4082a6814235d81a21a1bfe9bfa8ca99c69d8fa8
+
+Index: arch/arm/dts/rk3328-sdram-lpddr3-666.dtsi
+--- arch/arm/dts/rk3328-sdram-lpddr3-666.dtsi.orig
++++ arch/arm/dts/rk3328-sdram-lpddr3-666.dtsi
+@@ -18,7 +18,7 @@
+ 		0x10
+ 		0
+ 
+-		0x0c48a18a
++		0x8c48a18a
+ 		0x00000000
+ 		0x00000021
+ 		0x00000482
+@@ -33,7 +33,7 @@
+ 		0
+ 
+ 		0x00000000
+-		0xc3040008
++		0x43041008
+ 		0x00000064
+ 		0x00140023
+ 		0x000000d0
+@@ -48,6 +48,8 @@
+ 		0x00010000
+ 		0x000000e4
+ 		0x00070003
++		0x000000f4
++		0x000f011f
+ 		0x00000100
+ 		0x06090b07
+ 		0x00000104
+@@ -84,8 +86,6 @@
+ 		0x00000f00
+ 		0x00000490
+ 		0x00000001
+-		0xffffffff
+-		0xffffffff
+ 		0xffffffff
+ 		0xffffffff
+ 		0xffffffff

Reply via email to