Allwinner H3/H2+ dts question - regression?

Jedi Tek'Unum jedi at jeditekunum.com
Mon Nov 27 19:17:10 UTC 2017


I have a NanoPi NEO (very similar to Orange Pi) working except for I2C with an older revision (325705). I haven’t been able to get it to boot without doing a “load -t dtb /boot/dtb/nanopi-neo.dtb” first. Not as lucky with current revisions.

I started with https://framkant.org/2017/07/running-freebsd-on-nanopi-neo-or-orangepi-zero/ <https://framkant.org/2017/07/running-freebsd-on-nanopi-neo-or-orangepi-zero/> and made the following changes:

	u-boot-nanopi-neo/Makefile MODEL needs to be nanopi_neo (underscore instead of dash)

	crochet/board/NanoPi-NEO/setup.sh SUNXIO_UBOOT needs to also be underscore instead of dash (u-boot-nanopi_neo).

Built on FreeBSD 11.1 (amd64) release.

Using current ports, these two patches were needed to get u-boot to build:

*** work/u-boot-ports-v2017.09.00/scripts/config_whitelist.txt.orig	Sun Nov 26 06:58:51 2017
--- work/u-boot-ports-v2017.09.00/scripts/config_whitelist.txt	Sun Nov 26 07:06:33 2017
*************** CONFIG_SYS_USBCTRL
*** 4770,4775 ****
--- 4770,4776 ----
  CONFIG_SYS_USBD_BASE
  CONFIG_SYS_USB_EHCI_CPU_INIT
  CONFIG_SYS_USB_EHCI_REGS_BASE
+ CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
  CONFIG_SYS_USB_FAT_BOOT_PARTITION
  CONFIG_SYS_USB_HOST
  CONFIG_SYS_USB_OHCI_BOARD_INIT

*** work/u-boot-ports-v2017.09.00/scripts/Makefile.lib.orig	Sun Nov 26 06:15:10 2017
--- work/u-boot-ports-v2017.09.00/scripts/Makefile.lib	Sun Nov 26 06:15:34 2017
*************** quiet_cmd_dtc = DTC     $@
*** 308,315 ****
  # Modified for U-Boot
  # Bring in any U-Boot-specific include at the end of the file
  cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
! 	cat $< $(if $(u_boot_dtsi),\
! 		| sed "$$ a\#include \"$(u_boot_dtsi)\"") | \
  		$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \
  	$(DTC) -O dtb -o $@ -b 0 \
  		-i $(dir $<) $(DTC_FLAGS) \
--- 308,315 ----
  # Modified for U-Boot
  # Bring in any U-Boot-specific include at the end of the file
  cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
! 	echo "\#include \"$(u_boot_dtsi)\"" | \
! 	cat $< - | \
  		$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \
  	$(DTC) -O dtb -o $@ -b 0 \
  		-i $(dir $<) $(DTC_FLAGS) \


I also want to use I2C so I added this to the bottom of sys/boot/fdt/dts/arm/nanopi-neo.dts:

&i2c0 {
        status = "okay";
};

&i2c1 {
        status = "okay";
};


It looks ok at boot but I don’t see any I2C devices when I scan. Same hardware is showing 2 devices on Friendlyarm (manufacturer) linux. I see sys/boot/fdt/dts/arm/orangepi-plus-2e.dts has &r_i2c as well and perhaps I need that. (this stuff is definitely not my area of expertise)


U-Boot SPL 2017.09 (Nov 26 2017 - 07:07:31)
DRAM: 512 MiB
Trying to boot from MMC1


U-Boot 2017.09 (Nov 26 2017 - 07:07:31 -0600) Allwinner Technology

CPU:   Allwinner H3 (SUN8I 1680)
Model: FriendlyARM NanoPi NEO
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   phy interface0
eth0: ethernet at 1c30000
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found FreeBSD U-Boot Loader (bin)
reading ubldr.bin
239260 bytes read in 34 ms (6.7 MiB/s)
## Starting application at 0x42000000 ...
Consoles: U-Boot console  
Compatible U-Boot API signature found @0x5bf3f3c0

FreeBSD/armv6 U-Boot loader, Revision 1.2
(Mon Nov 27 09:55:39 CST 2017 root at corellia)

DRAM: 512MB
MMC Device 1 not found
MMC Device 2 not found
MMC Device 3 not found
Number of U-Boot devices: 1
U-Boot env: loaderdev not set, will probe all devices.
Found U-Boot device: disk
  Probing all disk devices...
  Checking unit=0 slice=<auto> partition=<auto>... good.
Booting from disk0s2a:
Loading /boot/defaults/loader.conf
/boot/kernel/kernel data=0x8246dc+0x1df924 syms=[0x4+0x95040+0x4+0xd980b]
/
Hit [Enter] to boot immediately, or any other key for command prompt.
Booting [/boot/kernel/kernel]...               
No valid device tree blob found!

Type '?' for a list of commands, 'help' for more detailed help.
loader> 
loader> load -t dtb /boot/dtb/nanopi-neo.dtb
/boot/dtb/nanopi-neo.dtb size=0x6459
loader> 
loader> boot
Booting...
Using DTB from loaded file '/boot/dtb/nanopi-neo.dtb'.
Kernel entry at 0x42200100...
Kernel args: (null)
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2017 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 12.0-CURRENT #0 r325705M: Mon Nov 27 09:55:30 CST 2017
    root at corellia:/scratch/builds/crochet/work/obj/scratch/src/freebsd/arm.armv6/sys/GENERIC arm
FreeBSD clang version 5.0.0 (tags/RELEASE_500/final 312559) (based on LLVM 5.0.0svn)
WARNING: WITNESS option enabled, expect reduced performance.
VT: init without driver.
module_register: cannot register simplebus/ahci from kernel; already loaded from kernel
Module simplebus/ahci failed to register: 17
module_register: cannot register simplebus/ehci from kernel; already loaded from kernel
Module simplebus/ehci failed to register: 17
module_register: cannot register simplebus/pcib from kernel; already loaded from kernel
Module simplebus/pcib failed to register: 17
module_register: cannot register simplebus/ehci from kernel; already loaded from kernel
Module simplebus/ehci failed to register: 17
CPU: ARM Cortex-A7 r0p5 (ECO: 0x00000000)
CPU Features: 
  Multiprocessing, Thumb2, Security, Virtualization, Generic Timer, VMSAv7,
  PXN, LPAE, Coherent Walk
Optional instructions: 
  SDIV/UDIV, UMULL, SMULL, SIMD(ext)
LoUU:2 LoC:3 LoUIS:2 
Cache level 1:
 32KB/64B 4-way data cache WB Read-Alloc Write-Alloc
 32KB/32B 2-way instruction cache Read-Alloc
Cache level 2:
 512KB/64B 8-way unified cache WB Read-Alloc Write-Alloc
real memory  = 536870912 (512 MB)
avail memory = 507846656 (484 MB)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
arc4random: no preloaded entropy cache
random: entropy device external interface
kbd0 at kbdmux0
ofwbus0: <Open Firmware Device Tree>
aw_ccu0: <Allwinner Clock Control Unit> on ofwbus0
clk_fixed0: <Fixed clock> on aw_ccu0
clk_fixed1: <Fixed clock> on aw_ccu0
clk_fixed2: <Fixed clock> on aw_ccu0
simplebus0: <Flattened device tree simple bus> on ofwbus0
aw_ccung0: <Allwinner Clock Control Unit NG> mem 0x1c20000-0x1c203ff on simplebus0
iichb0: <Allwinner Integrated I2C Bus Controller> mem 0x1c2ac00-0x1c2afff irq 30 on simplebus0
iicbus0: <OFW I2C bus> on iichb0
iichb1: <Allwinner Integrated I2C Bus Controller> mem 0x1c2b000-0x1c2b3ff irq 31 on simplebus0
iicbus1: <OFW I2C bus> on iichb1
aw_ccung1: <Allwinner Clock Control Unit NG> mem 0x1f01400-0x1f014ff on simplebus0
regfix0: <Fixed Regulator> on ofwbus0
regfix1: <Fixed Regulator> on ofwbus0
regfix2: <Fixed Regulator> on ofwbus0
aw_sid0: <Allwinner Secure ID Controller> mem 0x1c14000-0x1c143ff on simplebus0
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803,0x1c1c800-0x1c1c803,0x1c1d800-0x1c1d803 on simplebus0
gic0: <ARM Generic Interrupt Controller> mem 0x1c81000-0x1c81fff,0x1c82000-0x1c83fff,0x1c84000-0x1c85fff,0x1c86000-0x1c87fff irq 33 on simplebus0
gic0: pn 0x1, arch 0x2, rev 0x1, implementer 0x43b irqs 160
gpio0: <Allwinner GPIO/Pinmux controller> mem 0x1c20800-0x1c20bff irq 17,18 on simplebus0
gpiobus0: <OFW GPIO bus> on gpio0
gpio1: <Allwinner GPIO/Pinmux controller> mem 0x1f02c00-0x1f02fff irq 37 on simplebus0
gpiobus1: <OFW GPIO bus> on gpio1
gpioregulator0: <GPIO controlled regulator> on ofwbus0
rtc0: <Allwinner RTC> mem 0x1f00000-0x1f00053 irq 34,35 on simplebus0
rtc0: registered as a time-of-day clock, resolution 1.000000s
generic_timer0: <ARMv7 Generic Timer> irq 0,1,2,3 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 24000000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 24000000 Hz quality 1000
a31dmac0: <Allwinner DMA controller> mem 0x1c02000-0x1c02fff irq 4 on simplebus0
a10_mmc0: <Allwinner Integrated MMC/SD controller> mem 0x1c0f000-0x1c0ffff irq 5 on simplebus0
mmc0: <MMC/SD bus> on a10_mmc0
ehci0: <Allwinner Integrated USB 2.0 controller> mem 0x1c1d000-0x1c1d0ff irq 15 on simplebus0
usbus0: EHCI version 1.0
usbus0 on ehci0
ohci0: <Generic OHCI Controller> mem 0x1c1d400-0x1c1d4ff irq 16 on simplebus0
usbus1 on ohci0
gpioc0: <GPIO controller> on gpio0
aw_wdog0: <Allwinner A31 Watchdog> mem 0x1c20ca0-0x1c20cbf irq 23 on simplebus0
uart0: <16750 or compatible> mem 0x1c28000-0x1c283ff irq 26 on simplebus0
uart0: console (115384,n,8,1)
iic0: <I2C generic I/O> on iicbus0
iic1: <I2C generic I/O> on iicbus1
gpioc1: <GPIO controller> on gpio1
awg0: <Allwinner Gigabit Ethernet> mem 0x1c30000-0x1c30103,0x1c00030-0x1c00033 irq 38 on simplebus0
miibus0: <MII bus> on awg0
ukphy0: <Generic IEEE 802.3u media interface> PHY 0 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto, auto-flow
ukphy1: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy1:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto, auto-flow
awg0: Ethernet address: 02:81:5f:3d:9d:3c
aw_thermal0: <Allwinner Thermal Sensor Controller> mem 0x1c25000-0x1c253ff irq 40 on simplebus0
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
cpufreq_dt0: <Generic cpufreq driver> on cpu0
cpu1: <Open Firmware CPU> on cpulist0
cpu2: <Open Firmware CPU> on cpulist0
cpu3: <Open Firmware CPU> on cpulist0
gpioled0: <GPIO LEDs> on ofwbus0
cryptosoft0: <software crypto>
Timecounters tick every 1.000 msec
usbus0: 480Mbps High Speed USB v2.0
usbus1: 12Mbps Full Speed USB v1.0
ugen0.1: <Allwinner EHCI root HUB> at usbus0
uhub0: <Allwinner EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
ugen1.1: <Generic OHCI root HUB> at usbus1
uhub1: <Generic OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
mmcsd0: 32GB <SDHC AGGCD 8.0 SN AD0A3534 MFG 05/2017 by 3 SD> at mmc0 50.0MHz/4bit/65535-block
Release APs
WARNING: WITNESS option enabled, expect reduced performance.
arc4random: no preloaded entropy cache
Trying to mount root from ufs:/dev/mmcsd0s2a [rw,noatime]...
uhub1: 1 port with 1 removable, self powered
arc4random: no preloaded entropy cache
arc4random: no preloaded entropy cache
uhub0: 1 port with 1 removable, self powered
Growing root partition to fill device
GEOM_PART: mmcsd0s2 was automatically resized.
  Use `gpart commit mmcsd0s2` to save changes or `gpart undo mmcsd0s2` to revert them.
g_access(931): provider ufsid/5a1c3599c0dd5263 has error 6 set
g_access(931): provider ufsid/5a1c3599c0dd5263 has error 6 set
mmcsd0s2 resized
mmcsd0s2a resized
super-block backups (for fsck_ffs -b #) at:
 7693632, 8975872, 10258112, 11540352, 12822592, 14104832, 15387072, 16669312,
 17951552, 19233792, 20516032, 21798272, 23080512, 24362752, 25644992,
 26927232, 28209472, 29491712, 30773952, 32056192, 33338432, 34620672,
 35902912, 37185152, 38467392, 39749632, 41031872, 42314112, 43596352,
 44878592, 46160832, 47443072, 48725312, 50007552, 51289792, 52572032,
 53854272, 55136512, 56418752, 57700992, 58983232, 60265472, 61547712
g_dev_taste: make_dev_p() failed (gp->name=ufsid/5a1c3599c0dd5263, error=17)
/etc/rc: WARNING: hostid: unable to figure out a UUID from DMI data, generating a new one
Setting hostuuid: ada99681-f668-11de-892d-0f28dbe4086e.
Setting hostid: 0x1318234b.
No suitable dump device was found.
Starting file system checks:
/dev/mmcsd0s2a: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/mmcsd0s2a: clean, 7163697 free (457 frags, 895405 blocks, 0.0% fragmentation)
g_dev_taste: make_dev_p() failed (gp->name=ufsid/5a1c3599c0dd5263, error=17)
Mounting local filesystems:random: unblocking device.
.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
Setting hostname: nanopineo.
Setting up harvesting: [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED
Feeding entropy: .
awg0: link state changed to DOWN
Starting Network: lo0 awg0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
	inet 127.0.0.1 netmask 0xff000000 
	groups: lo 
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
awg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
	ether 02:81:5f:3d:9d:3c
	media: Ethernet autoselect (none)
	status: no carrier
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Starting devd.
awg0: link state changed to UP
Starting dhclient.
DHCPDISCOVER on awg0 to 255.255.255.255 port 67 interval 6
ip length 328 disagrees with bytes received 332.
accepting packet with data after udp payload.
DHCPOFFER from 10.0.1.3
DHCPREQUEST on awg0 to 255.255.255.255 port 67
ip length 328 disagrees with bytes received 332.
accepting packet with data after udp payload.
DHCPACK from 10.0.1.3
bound to 10.0.100.75 -- renewal in 7200 seconds.
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Generating host.conf.
lock order reversal:
 1st 0xcd32e0c0 bufwait (bufwait) @ /scratch/src/freebsd/sys/kern/vfs_bio.c:3553
 2nd 0xc34bba00 dirhash (dirhash) @ /scratch/src/freebsd/sys/ufs/ufs/ufs_dirhash.c:281
stack backtrace:
Creating and/or trimming log files.
Starting syslogd.
Clearing /tmp (X related).
Updating motd:.
Mounting late filesystems:.
Starting powerd.
Generating RSA host key.
2048 SHA256:eNEyFA6HtGcUtyagsPPIZoNyO/qNhvl4hz3pNOXTZwI root at nanopineo (RSA)
Generating ECDSA host key.
256 SHA256:Ujovz8Tzkky2HfTUoBmCa48GCL+PFhEkd0A8X9g8YzM root at nanopineo (ECDSA)
Generating ED25519 host key.
256 SHA256:4ZYDaObSrmQijPjIGFZC9eKpLz9Th/ZYCy7P/OO7//A root at nanopineo (ED25519)
Performing sanity check on sshd configuration.
Starting sshd.
Starting cron.
Starting background file system checks in 60 seconds.
lock order reversal:
 1st 0xc35055d4 ufs (ufs) @ /scratch/src/freebsd/sys/kern/vfs_subr.c:2606
 2nd 0xcd32e0c0 bufwait (bufwait) @ /scratch/src/freebsd/sys/ufs/ffs/ffs_vnops.c:280
 3rd 0xc331d934 ufs (ufs) @ /scratch/src/freebsd/sys/kern/vfs_subr.c:2606
stack backtrace:
mount: /dev/mmcsd0s2a: Device busy

Fri Jan  1 00:00:56 UTC 2010

FreeBSD/arm (nanopineo) (ttyu0)

login:

 
> On Nov 27, 2017, at 1:27 AM, Eugene Sevastyanov <eval at iptk.ru> wrote:
> 
> Currently, I'm trying to run a DS3231 real-time controller board. There are problems with I2C, but I'm still looking for a reason. At the moment, 



More information about the freebsd-arm mailing list