From owner-freebsd-arm@freebsd.org Mon Nov 27 19:17:10 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85273DE3478 for ; Mon, 27 Nov 2017 19:17:10 +0000 (UTC) (envelope-from jedi@jeditekunum.com) Received: from a1i475.smtp2go.com (a1i475.smtp2go.com [43.228.185.219]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4361680FFB for ; Mon, 27 Nov 2017 19:17:09 +0000 (UTC) (envelope-from jedi@jeditekunum.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=m4fue0.a1-4.dyn; x=1511811130; h=Feedback-ID: X-Smtpcorp-Track:To:Date:Subject:Message-Id:From:Reply-To:Sender: List-Unsubscribe; bh=MzfS4zSaCnkBeYSWYrpJk3EF6O05T7XDMOWkoes2Ss8=; b=SjjfemQK 4yzQSTJxrsab18rs6LxGAM6s6lvvyEH9kjCeTZGz9AGPxfEfe8HbafxOW8X71u5HdCtLjdAAFCKWF iSUBM3gRA9njfLnPvR9zuJwcF2cThFoTN6QQQ9i9T9emnZEI6AFujQ25ipxCINTpDCEHx+YoWcG0j vH/1UFBxO0YMBDrcOc01ziv+XExq5EtwsyQdPAGZZF6h981RWSna/vQ4Ds8b5dRwPKkBbkZqRAtis VDvtZoqgSpfFVSrIDuSVXix9DkOgTMfHr/OBGOujfZkmIqcHI4vr93fSNMGrwIj15iGCbJc3oc9dI zoX3CnZ8rPtNASc3DtnCOVINuQ==; From: Jedi Tek'Unum Message-Id: <5624E144-42E7-48F5-95F7-FF9F980E7855@jeditekunum.com> Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Allwinner H3/H2+ dts question - regression? Date: Mon, 27 Nov 2017 13:14:04 -0600 In-Reply-To: <20171127112702.7b945be0138484b05e517d49@iptk.ru> Cc: Milan Obuch , freebsd-arm@freebsd.org To: eval@iptk.ru References: <20171126124217.2a512392@zeta.dino.sk> <20171127084355.1dabd642748f25cb87c16b44@iptk.ru> <20171127075903.1ce9c40e@zeta.dino.sk> <20171127112702.7b945be0138484b05e517d49@iptk.ru> X-Mailer: Apple Mail (2.3273) X-Smtpcorp-Track: 1-JOr2r_ZUbtHe.HCQCCtJIv Feedback-ID: 207158m:207158azGM_-I:207158sgr5CmUg23:SMTPCORP X-Report-Abuse: Please forward a copy of this message, including all headers, to Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Nov 2017 19:17:10 -0000 I have a NanoPi NEO (very similar to Orange Pi) working except for I2C = with an older revision (325705). I haven=E2=80=99t been able to get it = to boot without doing a =E2=80=9Cload -t dtb /boot/dtb/nanopi-neo.dtb=E2=80= =9D first. Not as lucky with current revisions. I started with = https://framkant.org/2017/07/running-freebsd-on-nanopi-neo-or-orangepi-zer= o/ = 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 =3D DTC $@ *** 308,315 **** # Modified for U-Boot # Bring in any U-Boot-specific include at the end of the file cmd_dtc =3D 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 =3D 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 =3D "okay"; }; &i2c1 { status =3D "okay"; }; It looks ok at boot but I don=E2=80=99t 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@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=20 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 =20 Compatible U-Boot API signature found @0x5bf3f3c0 FreeBSD/armv6 U-Boot loader, Revision 1.2 (Mon Nov 27 09:55:39 CST 2017 root@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=3D0 slice=3D partition=3D... good. Booting from disk0s2a: Loading /boot/defaults/loader.conf /boot/kernel/kernel data=3D0x8246dc+0x1df924 = syms=3D[0x4+0x95040+0x4+0xd980b] / Hit [Enter] to boot immediately, or any other key for command prompt. Booting [/boot/kernel/kernel]... =20 No valid device tree blob found! Type '?' for a list of commands, 'help' for more detailed help. loader>=20 loader> load -t dtb /boot/dtb/nanopi-neo.dtb /boot/dtb/nanopi-neo.dtb size=3D0x6459 loader>=20 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@corellia:/scratch/builds/crochet/work/obj/scratch/src/freebsd/arm.arm= v6/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:=20 Multiprocessing, Thumb2, Security, Virtualization, Generic Timer, = VMSAv7, PXN, LPAE, Coherent Walk Optional instructions:=20 SDIV/UDIV, UMULL, SMULL, SIMD(ext) LoUU:2 LoC:3 LoUIS:2=20 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 =3D 536870912 (512 MB) avail memory =3D 507846656 (484 MB) FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs arc4random: no preloaded entropy cache random: entropy device external interface kbd0 at kbdmux0 ofwbus0: aw_ccu0: on ofwbus0 clk_fixed0: on aw_ccu0 clk_fixed1: on aw_ccu0 clk_fixed2: on aw_ccu0 simplebus0: on ofwbus0 aw_ccung0: mem 0x1c20000-0x1c203ff on = simplebus0 iichb0: mem = 0x1c2ac00-0x1c2afff irq 30 on simplebus0 iicbus0: on iichb0 iichb1: mem = 0x1c2b000-0x1c2b3ff irq 31 on simplebus0 iicbus1: on iichb1 aw_ccung1: mem 0x1f01400-0x1f014ff on = simplebus0 regfix0: on ofwbus0 regfix1: on ofwbus0 regfix2: on ofwbus0 aw_sid0: mem 0x1c14000-0x1c143ff on = simplebus0 awusbphy0: mem = 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803,0x1c1c800-0x1c= 1c803,0x1c1d800-0x1c1d803 on simplebus0 gic0: mem = 0x1c81000-0x1c81fff,0x1c82000-0x1c83fff,0x1c84000-0x1c85fff,0x1c86000-0x1c= 87fff irq 33 on simplebus0 gic0: pn 0x1, arch 0x2, rev 0x1, implementer 0x43b irqs 160 gpio0: mem 0x1c20800-0x1c20bff irq = 17,18 on simplebus0 gpiobus0: on gpio0 gpio1: mem 0x1f02c00-0x1f02fff irq 37 = on simplebus0 gpiobus1: on gpio1 gpioregulator0: on ofwbus0 rtc0: mem 0x1f00000-0x1f00053 irq 34,35 on simplebus0 rtc0: registered as a time-of-day clock, resolution 1.000000s generic_timer0: 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: mem 0x1c02000-0x1c02fff irq 4 on = simplebus0 a10_mmc0: mem = 0x1c0f000-0x1c0ffff irq 5 on simplebus0 mmc0: on a10_mmc0 ehci0: mem 0x1c1d000-0x1c1d0ff = irq 15 on simplebus0 usbus0: EHCI version 1.0 usbus0 on ehci0 ohci0: mem 0x1c1d400-0x1c1d4ff irq 16 on = simplebus0 usbus1 on ohci0 gpioc0: on gpio0 aw_wdog0: 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: on iicbus0 iic1: on iicbus1 gpioc1: on gpio1 awg0: mem = 0x1c30000-0x1c30103,0x1c00030-0x1c00033 irq 38 on simplebus0 miibus0: on awg0 ukphy0: PHY 0 on miibus0 ukphy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto, = auto-flow ukphy1: 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: mem = 0x1c25000-0x1c253ff irq 40 on simplebus0 cpulist0: on ofwbus0 cpu0: on cpulist0 cpufreq_dt0: on cpu0 cpu1: on cpulist0 cpu2: on cpulist0 cpu3: on cpulist0 gpioled0: on ofwbus0 cryptosoft0: Timecounters tick every 1.000 msec usbus0: 480Mbps High Speed USB v2.0 usbus1: 12Mbps Full Speed USB v1.0 ugen0.1: at usbus0 uhub0: on = usbus0 ugen1.1: at usbus1 uhub1: on = usbus1 mmcsd0: 32GB 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=3Dufsid/5a1c3599c0dd5263, = error=3D17) /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=3Dufsid/5a1c3599c0dd5263, = error=3D17) 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,ATT= ACH,CACHED Feeding entropy: . awg0: link state changed to DOWN Starting Network: lo0 awg0. lo0: flags=3D8049 metric 0 mtu 16384 options=3D600003 inet6 ::1 prefixlen 128=20 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2=20 inet 127.0.0.1 netmask 0xff000000=20 groups: lo=20 nd6 options=3D21 awg0: flags=3D8843 metric 0 mtu = 1500 options=3D8000b ether 02:81:5f:3d:9d:3c media: Ethernet autoselect (none) status: no carrier nd6 options=3D29 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@nanopineo = (RSA) Generating ECDSA host key. 256 SHA256:Ujovz8Tzkky2HfTUoBmCa48GCL+PFhEkd0A8X9g8YzM root@nanopineo = (ECDSA) Generating ED25519 host key. 256 SHA256:4ZYDaObSrmQijPjIGFZC9eKpLz9Th/ZYCy7P/OO7//A root@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: =20 > On Nov 27, 2017, at 1:27 AM, Eugene Sevastyanov wrote: >=20 > 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,=20