From owner-freebsd-arm@freebsd.org Thu Aug 4 03:04:20 2016 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 58D65BAE827 for ; Thu, 4 Aug 2016 03:04:20 +0000 (UTC) (envelope-from e.moe@rcn.com) Received: from smtp.rcn.com (smtp.rcn.com [69.168.97.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 078651CC1 for ; Thu, 4 Aug 2016 03:04:19 +0000 (UTC) (envelope-from e.moe@rcn.com) X_CMAE_Category: , , X-CNFS-Analysis: v=2.2 cv=UPOfJ2Xy c=1 sm=1 tr=0 a=dx250bZxW1HngxdpQMIA3g==:117 a=dx250bZxW1HngxdpQMIA3g==:17 a=IkcTkHD0fZMA:10 a=OA2lqS22AAAA:8 a=YfCOm-DyAAAA:8 a=i5rowgypW5fFHoL2NJMA:9 a=z74lWWcead9heiOj:21 a=A1HTwXzq2kNMgf4y:21 a=dlp_2DpfmD4A:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 a=NWVoK91CQySWRX1oVYDe:22 a=QDc1yJBve2YiRQBk1mDn:22 a=047cQLXTEfCjWPUe_kQW:22 a=zQLMK8awuJ6_Hvp-_9Ux:22 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine X-Authed-Username: ZS5tb2VAcmNuLmNvbQ== Authentication-Results: smtp02.rcn.cmh.synacor.com header.from=e.moe@rcn.com; sender-id=neutral Authentication-Results: smtp02.rcn.cmh.synacor.com smtp.mail=e.moe@rcn.com; spf=neutral; sender-id=neutral Authentication-Results: smtp02.rcn.cmh.synacor.com smtp.user=e.moe; auth=pass (PLAIN) Received-SPF: neutral (smtp02.rcn.cmh.synacor.com: 24.148.20.233 is neither permitted nor denied by domain of rcn.com) Received: from [24.148.20.233] ([24.148.20.233:26733] helo=[192.168.3.100]) by smtp.rcn.com (envelope-from ) (ecelerity 3.6.23.54417 r(Core:3.6.23.0)) with ESMTPSA (cipher=DHE-RSA-AES256-SHA) id B6/89-61435-9FBA2A75; Wed, 03 Aug 2016 22:44:09 -0400 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: U-boot issues on Banana Pi M2 From: Erik Moe In-Reply-To: <0403B533-40BC-4674-84CC-2CC3F732B45E@rcn.com> Date: Wed, 3 Aug 2016 21:44:09 -0500 Cc: manu@FreeBSD.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <0403B533-40BC-4674-84CC-2CC3F732B45E@rcn.com> To: freebsd-arm X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2016 03:04:20 -0000 I spent some time looking into this issue. I believe that the = u-boot-bananapim2 port is broken because the underlining u-boot code is = broken, at least for the BPI M2. I built u-boot directly from source = trying both the v2016.07 and v2016.09-rc1 releases and saw the same = failure: "Net: data abort". I built u-boot from HEAD as of 26fb8db = since there were a number of commits for sunxi. I=E2=80=99m not sure = which one resolved the issue, but by checking out the latest sources and = applying the freebsd patches I was able to get my BPI M2 to boot: U-Boot SPL 2016.09-rc1-00211-g26fb8db-dirty (Aug 02 2016 - 04:43:10) DRAM: 1024 MiB Trying to boot from MMC1 U-Boot 2016.09-rc1-00211-g26fb8db-dirty (Aug 02 2016 - 04:43:10 -0500) = Allwinner Technology CPU: Allwinner A31s (SUN6I) Model: Sinovoip BPI-M2 DRAM: 1 GiB WARNING: Caches not enabled MMC: SUNXI SD/MMC: 0 reading u-boot.env ** Unable to read "u-boot.env" from mmc0:1 ** Using default environment In: serial Out: serial Err: serial Net: eth0: ethernet@01c30000 starting USB... USB0: USB EHCI 1.00 USB1: USB OHCI 1.0 scanning bus 0 for devices... 2 USB Device(s) found Hit any key to stop autoboot: 0 Booting from: mmc 0 ubldr.bin reading ubldr.bin 224660 bytes read in 51 ms (4.2 MiB/s) ## No elf image at address 0x42000000 ## Starting application at 0x42000000 ... Consoles: U-Boot console Compatible U-Boot API signature found @0x7af3f4e8 FreeBSD/armv6 U-Boot loader, Revision 1.2 (root@dora, Sat Jul 16 04:11:42 CDT 2016) DRAM: 1024MB MMC Device 1 not found Number of U-Boot devices: 1 U-Boot env: loaderdev=3D'mmc 0' Found U-Boot device: disk Checking unit=3D0 slice=3D partition=3D... good. Booting from disk0s2a: /boot/kernel/kernel data=3D0x65cd64+0x12729c = syms=3D[0x4+0x8e630+0x4+0xa3375] Hit [Enter] to boot immediately, or any other key for command prompt. Booting [/boot/kernel/kernel]... /boot/dtb/bananapim2.dtb size=3D0x6151 Loaded DTB from file 'bananapim2.dtb'. Kernel entry at 0x42200100... Kernel args: (null) KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2016 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 24eff34(master): Sat Jul 16 04:23:13 CDT 2016 = root@dora:/usr/home/emoe/Projects/ARM/bannapi-m2/obj/arm.armv6/usr/home/em= oe/Projects/ARM/src/sys/ALLWINNER arm FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on = LLVM 3.8.0) WARNING: WITNESS option enabled, expect reduced performance. VT: init without driver. CPU: Cortex A7 rev 3 (Cortex-A core) Supported features: ARM_ISA THUMB2 JAZELLE THUMBEE ARMv4 Security_Ext WB enabled LABT branch prediction disabled 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: 1024KB/64B 8-way unified cache WB Read-Alloc Write-Alloc real memory =3D 1073741824 (1024 MB) avail memory =3D 1035898880 (987 MB) FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs random: entropy device external interface kbd0 at kbdmux0 ofwbus0: aw_ccu0: on ofwbus0 . . . Thanks, Erik > On Jul 28, 2016, at 6:49 PM, Erik Moe wrote: >=20 > I=E2=80=99m having some issues with the u-boot-bananapim2 in ports. = It looks like a data abort exception. Does anybody else have a BPI M2 = that this port is working for them? If I read this right it=E2=80=99s = dying in the following function: >=20 > 4a00218c g F .text 00000038 sunxi_gpio_set_cfgpin >=20 > I think someone reported a similar but not the same issue upstream: = http://lists.denx.de/pipermail/u-boot/2016-June/258837.html >=20 > Thanks, > Erik >=20 >=20 > U-Boot SPL 2016.07 (Jul 16 2016 - 02:40:04) > DRAM: 1024 MiB > Trying to boot from MMC1 >=20 >=20 > U-Boot 2016.07 (Jul 16 2016 - 02:40:04 -0500) Allwinner Technology >=20 > CPU: Allwinner A31s (SUN6I) > Model: Sinovoip BPI-M2 > DRAM: 1 GiB > WARNING: Caches not enabled > MMC: SUNXI SD/MMC: 0 > reading u-boot.env >=20 > ** Unable to read "u-boot.env" from mmc0:1 ** > Using default environment >=20 > In: serial > Out: serial > Err: serial > Net: data abort > pc : [<7ef5f180>] lr : [<00000000>] > reloc pc : [<4a002180>] lr : [] > sp : 7af35f84 ip : 7efab502 fp : 00000017 > r10: 7efaaefe r9 : 7af3cee8 r8 : 000040a0 > r7 : 7ef9ee14 r6 : 00000000 r5 : 00000001 r4 : 00000000 > r3 : 0000000f r2 : 00000001 r1 : 00000000 r0 : ea00000e > Flags: nzCv IRQs off FIQs off Mode SVC_32 > Resetting CPU ... >=20 > resetting ... >=20