armv7: banana pi, Allwinner A20 board

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

armv7: banana pi, Allwinner A20 board

SASANO Takayoshi
Hello,

I tried bsd.rd.SUNXI.umg snapshot on Banana Pi, cheap Allwinner A20
board like Raspberry Pi (see http://www.lemaker.org/).

It booted but something wrong. Arch Linux (for Banana Pi) works fine
so I think the board is not broken.

This is my first OpenBSD/armv7 experience and I don't know what is
happening. What can I do for solving this problem?

--
SASANO Takayoshi <[hidden email]>

[uEnv.txt]
mmcboot=mmc rescan; fatload mmc 0 0x60000000 bsd.umg && bootm 0x60000000;
bootargs=sd0a:/bsd;
uenvcmd=run mmcboot;


[1st try - hang up] ----------------------------------------------------
U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
Board: Bananapi
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600


U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Board: Bananapi
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   dwmac.1c50000
Hit any key to stop autoboot:  0
reading uEnv.txt
116 bytes read in 16 ms (6.8 KiB/s)
Loaded environment from uEnv.txt
Running uenvcmd ...
reading bsd.umg
7387788 bytes read in 367 ms (19.2 MiB/s)
## Booting kernel from Legacy Image at 60000000 ...
   Image Name:   boot
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    7387724 Bytes = 7 MiB
   Load Address: 40800000
   Entry Point:  40800000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...


OpenBSD/sunxi booting ...
arg0 0x0 arg1 0x10bb arg2 0x40000100
atag core flags 0 pagesize 0 rootdev 0
atag cmdline [sd0a:/bsd;]
atag mem start 0x40000000 size 0x40000000
bootfile: sd0a:/bsd;
bootargs:
memory size derived from u-boot
bootconf.mem[0].address = 40000000 pages 262144/0x40000000
Allocating page tables
freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
IRQ stack: p0x40f3a000 v0xc0f3a000
ABT stack: p0x40f3b000 v0xc0f3b000
UND stack: p0x40f3c000 v0xc0f3c000
SVC stack: p0x40f3d000 v0xc0f3d000
Creating L1 page table at 0x40f0c000
Mapping kernel
Constructing L2 page tables
undefined page pmap [ using 169296 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 5.6 (RAMDISK-SUNXI) #3: Sun Aug 31 18:46:49 EDT 2014
    [hidden email]:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
real mem  = 1073741824 (1024MB)
avail mem = 1036165120 (988MB)
warning: no entropy supplied by boot loader
mainbus0 at root
cortex0 at mainbus0
ampintc0 at cortex0 nirq 160
cpu0 at mainbus0: ARM Cortex A7 rev 4 (ARMv7 core)
cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu0: 32KB(32b/l,2way) I-cache, 32KB(64b/l,4way) wr-back D-cache
sunxi0 at mainbus0: A20
sxipio0 at sunxi0
sxiccmu0 at sunxi0
sxitimer0 at sunxi0: ticktimer 100hz @ 32KHz
sxitimer1 at sunxi0: stattimer 128hz @ 32KHz
sxitimer2 at sunxi0: cntrtimer @ 32KHz
sxidog0 at sunxi0
sxirtc0 at sunxi0
sxiuart0 at sunxi0: console
sxiuart1 at sunxi0
sxiuart2 at sunxi0
sxiuart3 at sunxi0
sxiuart4 at sunxi0
sxiuart5 at sunxi0
sxiuart6 at sunxi0
sxiuart7 at sunxi0
sxie0 at sunxi0, address 02:99:03:c2:d2:6e
ukphy0 at sxie0 phy 0: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
ukphy1 at sxie0 phy 1: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
ahci0 at sunxi0 AHCI 1.1
scsibus0 at ahci0: 32 targets
ehci0 at sunxi0
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
ehci1 at sunxi0
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
(hang up here)


[2nd try - ddb invoked] ------------------------------------------------
U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
Board: Bananapi
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600


U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Board: Bananapi
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   dwmac.1c50000
Hit any key to stop autoboot:  0
reading uEnv.txt
116 bytes read in 16 ms (6.8 KiB/s)
Loaded environment from uEnv.txt
Running uenvcmd ...
reading bsd.umg
7387788 bytes read in 370 ms (19 MiB/s)
## Booting kernel from Legacy Image at 60000000 ...
   Image Name:   boot
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    7387724 Bytes = 7 MiB
   Load Address: 40800000
   Entry Point:  40800000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...


OpenBSD/sunxi booting ...
arg0 0x0 arg1 0x10bb arg2 0x40000100
atag core flags 0 pagesize 0 rootdev 0
atag cmdline [sd0a:/bsd;]
atag mem start 0x40000000 size 0x40000000
bootfile: sd0a:/bsd;
bootargs:
memory size derived from u-boot
bootconf.mem[0].address = 40000000 pages 262144/0x40000000
Allocating page tables
freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
IRQ stack: p0x40f3a000 v0xc0f3a000
ABT stack: p0x40f3b000 v0xc0f3b000
UND stack: p0x40f3c000 v0xc0f3c000
SVC stack: p0x40f3d000 v0xc0f3d000
Creating L1 page table at 0x40f0c000
Mapping kernel
Constructing L2 page tables
undefined page pmap [ using 169296 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 5.6 (RAMDISK-SUNXI) #3: Sun Aug 31 18:46:49 EDT 2014
    [hidden email]:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
real mem  = 1073741824 (1024MB)
avail mem = 1036165120 (988MB)
warning: no entropy supplied by boot loader
mainbus0 at root
cortex0 at mainbus0
ampintc0 at cortex0 nirq 160
cpu0 at mainbus0: ARM Cortex A7 rev 4 (ARMv7 core)
cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu0: 32KB(32b/l,2way) I-cache, 32KB(64b/l,4way) wr-back D-cache
sunxi0 at mainbus0: A20
sxipio0 at sunxi0
sxiccmu0 at sunxi0
sxitimer0 at sunxi0: ticktimer 100hz @ 32KHz
sxitimer1 at sunxi0: stattimer 128hz @ 32KHz
sxitimer2 at sunxi0: cntrtimer @ 32KHz
sxidog0 at sunxi0
sxirtc0 at sunxi0
sxiuart0 at sunxi0: console
sxiuart1 at sunxi0
sxiuart2 at sunxi0
sxiuart3 at sunxi0
sxiuart4 at sunxi0
sxiuart5 at sunxi0
sxiuart6 at sunxi0
sxiuart7 at sunxi0
sxie0 at sunxi0, address 02:99:03:c2:d2:6e
ukphy0 at sxie0 phy 0: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
ukphy1 at sxie0 phy 1: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
ahci0 at sunxi0 AHCI 1.1
scsibus0 at ahci0: 32 targets
ehci0 at sunxi0
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
ehci1 at sunxi0
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
pmap_fault_fixup: va ca57c000 ftype 2 s pte 7ff7701e

uvm_fault(0xc0e9f724, ca57c000, 2, 0) -> e
Fatal kernel mode data abort: 'Translation Fault (P)'
trapframe: 0xc0f3ee88
DFSR=000008f7, DFAR=ca57cfc8, spsr=60000153
r0 =c0ec0038, r1 =ca57c000, r2 =ca57cfc8, r3 =00000000
r4 =ca57c000, r5 =c0ec0038, r6 =00000000, r7 =c0ec0038
r8 =c0ebc90c, r9 =00000000, r10=00000004, r11=c0f3ef00
r12=c0f3ef04, ssp=c0f3eed4, slr=c0838250, pc =c08374e0

Stopped at      pool_prime_page+0x24:   str     r3, [r2]
ddb> trace
pool_prime_page+0xc
        scp=0xc08374c8 rlv=0xc0838250 (pool_do_get+0x120)
        rsp=0xc0f3ef04 rfp=0xc0f3ef38
        r10=0xc0ebc774 r9=0xc0ebd5dc r8=0xc0ebc90c r7=0x00000002
        r6=0x00000000 r5=0xc0ec0038 r4=0xca57c000
pool_do_get+0x10
        scp=0xc0838140 rlv=0xc0837e10 (pool_get+0x3c)
        rsp=0xc0f3ef3c rfp=0xc0f3ef58
        r7=0x00001202 r6=0xc08325ac r5=0x00000002 r4=0xc0ec0038
pool_get+0x10
        scp=0xc0837de4 rlv=0xc082e894 (workq_add_task+0x34)
        rsp=0xc0f3ef5c rfp=0xc0f3ef84
        r6=0xc08325ac r5=0x00000000 r4=0x00000000
workq_add_task+0x10
        scp=0xc082e870 rlv=0xc08327cc (disk_attach+0xf0)
        rsp=0xc0f3ef88 rfp=0xc0f3efa8
        r7=0xc0ebc5f8 r6=0x00000000 r5=0xc5573500 r4=0xc5573530
disk_attach+0xc
        scp=0xc08326e8 rlv=0xc0815470 (main+0x374)
        rsp=0xc0f3efac rfp=0xc0f3efec
        r6=0x00000000 r5=0xc0ebc574 r4=0xc0970714
main+0x10
--db_more--
        scp=0xc081510c rlv=0xc080017c (kernel_text+0x4c)
        rsp=0xc0f3eff0 rfp=0xc0f3effc
        r10=0x7ffb9eac r9=0x7fb65f0c r8=0x40000100 r7=0x000010bb
        r6=0x40000100 r5=0x000010bb r4=0x40800120
kernel_text+0x48
        scp=0xc0800178 rlv=0xc090655c (initarm+0x820)
        rsp=0xc0f3f000 rfp=0x00000000
ddb> ps
   PID   PPID   PGRP    UID  S       FLAGS  WAIT          COMMAND
*    0     -1      0      0  7     0x10200                swapper
ddb> boot reboot
boot: howto=00004804 curproc=0xc0ebc774
rebooting...


[3rd try - hangs up at ddb]
U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
Board: Bananapi
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600


U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Board: Bananapi
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   dwmac.1c50000
Hit any key to stop autoboot:  0
reading uEnv.txt
116 bytes read in 16 ms (6.8 KiB/s)
Loaded environment from uEnv.txt
Running uenvcmd ...
reading bsd.umg
7387788 bytes read in 367 ms (19.2 MiB/s)
## Booting kernel from Legacy Image at 60000000 ...
   Image Name:   boot
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    7387724 Bytes = 7 MiB
   Load Address: 40800000
   Entry Point:  40800000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...


OpenBSD/sunxi booting ...
arg0 0x0 arg1 0x10bb arg2 0x40000100
atag core flags 0 pagesize 0 rootdev 0
atag cmdline [sd0a:/bsd;]
atag mem start 0x40000000 size 0x40000000
bootfile: sd0a:/bsd;
bootargs:
memory size derived from u-boot
bootconf.mem[0].address = 40000000 pages 262144/0x40000000
Allocating page tables
freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
IRQ stack: p0x40f3a000 v0xc0f3a000
ABT stack: p0x40f3b000 v0xc0f3b000
UND stack: p0x40f3c000 v0xc0f3c000
SVC stack: p0x40f3d000 v0xc0f3d000
Creating L1 page table at 0x40f0c000
Mapping kernel
Constructing L2 page tables
undefined page pmap [ using 169296 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 5.6 (RAMDISK-SUNXI) #3: Sun Aug 31 18:46:49 EDT 2014
    [hidden email]:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
real mem  = 1073741824 (1024MB)
avail mem = 1036165120 (988MB)
warning: no entropy supplied by boot loader
pmap_fault_fixup: va ca580000 ftype 2 s pte 7ffa001e

uvm_fault(0xc0e9f724, ca580000, 2, 0) -> e
Fatal kernel mode data abort: 'Translation Fault (P)'
trapframe: 0xc0f3ee58
DFSR=000008f7, DFAR=ca580fc8, spsr=600001d3
r0 =c0ed5cf4, r1 =ca580000, r2 =ca580fc8, r3 =00000000
r4 =ca580000, r5 =c0ed5cf4, r6 =00000000, r7 =c0ed5cf4
r8 =c0ebc90c, r9 =00000000, r10=00000004, r11=c0f3eed0
r12=c0f3eed4, ssp=c0f3eea4, slr=c0838250, pc =c08374e0

Stopped at      pool_prime_page+0x24:   str     r3, [r2]
pool_prime_page+0xc
        scp=0xc08374c8 rlv=0xc0838250 (pool_do_get+0x120)
        rsp=0xc0f3eed4 rfp=0xc0f3ef08
        r10=0xc0ebc774 r9=0xc0ebd5dc r8=0xc0ebc90c r7=0x00000001
        r6=0x00000000 r5=0xc0ed5cf4 r4=0xca580000
pool_do_get+0x10
        scp=0xc0838140 rlv=0xc0837e10 (pool_get+0x3c)
        rsp=0xc0f3ef0c rfp=0xc0f3ef28
        r7=0xc0000000 r6=0xc0000000 r5=0x00000001 r4=0xc0ed5cf4
pool_get+0x10
        scp=0xc0837de4 rlv=0xc08bbc64 (uaddr_rnd_create+0x24)
        rsp=0xc0f3ef2c rfp=0xc0f3ef44
        r6=0xc0000000 r5=0xc0000000 r4=0x00001000
uaddr_rnd_create+0xc
        scp=0xc08bbc4c rlv=0xc08c5b90 (uvm_map_setup_md+0x30)
        rsp=0xc0f3ef48 rfp=0xc0f3ef64
        r5=0x00001000 r4=0xc0ebc574
uvm_map_setup_md+0xc
        scp=0xc08c5b6c rlv=0xc08c86d0 (uvm_map_setup+0x120)
        rsp=0xc0f3ef68 rfp=0xc0f3ef84
        r6=0x00000041 r5=0xc0ebc578 r4=0xc0ebc574
--db_more--
(hang up here)

Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

Patrick Wildt-2
Hi,

I remember that there has been an issue, only seen on Cortex-A7/A15, like the Allwinner A20.

The fix for that issue is somewhere here[0].

Try this[1] kernel and have a look if it has the same issue or not.

I do not have an A20, so I can’t test it, sorry. But I’ll probably buy this[2][3] one once it’s available.

\Patrick

[0] https://github.com/bitrig/bitrig/commit/f1932308435a4b2c3daf0e880dc0adc829f5803d
[1] https://www.blueri.se/bitrig/armv7/20140925/bsd.rd.SUNXI.umg
[2] http://www.allnet.de/at/allnet-brand/produkte/neuheiten/p/banana-pi-router-board/
[3] http://www.sinovoip.com.cn/ecp_view.asp?id=554

> Am 02.10.2014 um 20:56 schrieb SASANO Takayoshi <[hidden email]>:
>
> Hello,
>
> I tried bsd.rd.SUNXI.umg snapshot on Banana Pi, cheap Allwinner A20
> board like Raspberry Pi (see http://www.lemaker.org/).
>
> It booted but something wrong. Arch Linux (for Banana Pi) works fine
> so I think the board is not broken.
>
> This is my first OpenBSD/armv7 experience and I don't know what is
> happening. What can I do for solving this problem?
>
> --
> SASANO Takayoshi <[hidden email]>
>
> [uEnv.txt]
> mmcboot=mmc rescan; fatload mmc 0 0x60000000 bsd.umg && bootm 0x60000000;
> bootargs=sd0a:/bsd;
> uenvcmd=run mmcboot;
>
>
> [1st try - hang up] ----------------------------------------------------
> U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
> Board: Bananapi
> DRAM: 1024 MiB
> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
> spl: not an uImage at 1600
>
>
> U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology
>
> CPU:   Allwinner A20 (SUN7I)
> Board: Bananapi
> I2C:   ready
> DRAM:  1 GiB
> MMC:   SUNXI SD/MMC: 0
> *** Warning - bad CRC, using default environment
>
> In:    serial
> Out:   serial
> Err:   serial
> Net:   dwmac.1c50000
> Hit any key to stop autoboot:  0
> reading uEnv.txt
> 116 bytes read in 16 ms (6.8 KiB/s)
> Loaded environment from uEnv.txt
> Running uenvcmd ...
> reading bsd.umg
> 7387788 bytes read in 367 ms (19.2 MiB/s)
> ## Booting kernel from Legacy Image at 60000000 ...
>   Image Name:   boot
>   Image Type:   ARM Linux Kernel Image (uncompressed)
>   Data Size:    7387724 Bytes = 7 MiB
>   Load Address: 40800000
>   Entry Point:  40800000
>   Verifying Checksum ... OK
>   Loading Kernel Image ... OK
>
> Starting kernel ...
>
>
> OpenBSD/sunxi booting ...
> arg0 0x0 arg1 0x10bb arg2 0x40000100
> atag core flags 0 pagesize 0 rootdev 0
> atag cmdline [sd0a:/bsd;]
> atag mem start 0x40000000 size 0x40000000
> bootfile: sd0a:/bsd;
> bootargs:
> memory size derived from u-boot
> bootconf.mem[0].address = 40000000 pages 262144/0x40000000
> Allocating page tables
> freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
> IRQ stack: p0x40f3a000 v0xc0f3a000
> ABT stack: p0x40f3b000 v0xc0f3b000
> UND stack: p0x40f3c000 v0xc0f3c000
> SVC stack: p0x40f3d000 v0xc0f3d000
> Creating L1 page table at 0x40f0c000
> Mapping kernel
> Constructing L2 page tables
> undefined page pmap [ using 169296 bytes of bsd ELF symbol table ]
> Copyright (c) 1982, 1986, 1989, 1991, 1993
> The Regents of the University of California.  All rights reserved.
> Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org
>
> OpenBSD 5.6 (RAMDISK-SUNXI) #3: Sun Aug 31 18:46:49 EDT 2014
>    [hidden email]:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
> real mem  = 1073741824 (1024MB)
> avail mem = 1036165120 (988MB)
> warning: no entropy supplied by boot loader
> mainbus0 at root
> cortex0 at mainbus0
> ampintc0 at cortex0 nirq 160
> cpu0 at mainbus0: ARM Cortex A7 rev 4 (ARMv7 core)
> cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
> cpu0: 32KB(32b/l,2way) I-cache, 32KB(64b/l,4way) wr-back D-cache
> sunxi0 at mainbus0: A20
> sxipio0 at sunxi0
> sxiccmu0 at sunxi0
> sxitimer0 at sunxi0: ticktimer 100hz @ 32KHz
> sxitimer1 at sunxi0: stattimer 128hz @ 32KHz
> sxitimer2 at sunxi0: cntrtimer @ 32KHz
> sxidog0 at sunxi0
> sxirtc0 at sunxi0
> sxiuart0 at sunxi0: console
> sxiuart1 at sunxi0
> sxiuart2 at sunxi0
> sxiuart3 at sunxi0
> sxiuart4 at sunxi0
> sxiuart5 at sunxi0
> sxiuart6 at sunxi0
> sxiuart7 at sunxi0
> sxie0 at sunxi0, address 02:99:03:c2:d2:6e
> ukphy0 at sxie0 phy 0: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
> ukphy1 at sxie0 phy 1: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
> ahci0 at sunxi0 AHCI 1.1
> scsibus0 at ahci0: 32 targets
> ehci0 at sunxi0
> usb0 at ehci0: USB revision 2.0
> uhub0 at usb0 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
> ehci1 at sunxi0
> usb1 at ehci1: USB revision 2.0
> uhub1 at usb1 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
> (hang up here)
>
>
> [2nd try - ddb invoked] ------------------------------------------------
> U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
> Board: Bananapi
> DRAM: 1024 MiB
> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
> spl: not an uImage at 1600
>
>
> U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology
>
> CPU:   Allwinner A20 (SUN7I)
> Board: Bananapi
> I2C:   ready
> DRAM:  1 GiB
> MMC:   SUNXI SD/MMC: 0
> *** Warning - bad CRC, using default environment
>
> In:    serial
> Out:   serial
> Err:   serial
> Net:   dwmac.1c50000
> Hit any key to stop autoboot:  0
> reading uEnv.txt
> 116 bytes read in 16 ms (6.8 KiB/s)
> Loaded environment from uEnv.txt
> Running uenvcmd ...
> reading bsd.umg
> 7387788 bytes read in 370 ms (19 MiB/s)
> ## Booting kernel from Legacy Image at 60000000 ...
>   Image Name:   boot
>   Image Type:   ARM Linux Kernel Image (uncompressed)
>   Data Size:    7387724 Bytes = 7 MiB
>   Load Address: 40800000
>   Entry Point:  40800000
>   Verifying Checksum ... OK
>   Loading Kernel Image ... OK
>
> Starting kernel ...
>
>
> OpenBSD/sunxi booting ...
> arg0 0x0 arg1 0x10bb arg2 0x40000100
> atag core flags 0 pagesize 0 rootdev 0
> atag cmdline [sd0a:/bsd;]
> atag mem start 0x40000000 size 0x40000000
> bootfile: sd0a:/bsd;
> bootargs:
> memory size derived from u-boot
> bootconf.mem[0].address = 40000000 pages 262144/0x40000000
> Allocating page tables
> freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
> IRQ stack: p0x40f3a000 v0xc0f3a000
> ABT stack: p0x40f3b000 v0xc0f3b000
> UND stack: p0x40f3c000 v0xc0f3c000
> SVC stack: p0x40f3d000 v0xc0f3d000
> Creating L1 page table at 0x40f0c000
> Mapping kernel
> Constructing L2 page tables
> undefined page pmap [ using 169296 bytes of bsd ELF symbol table ]
> Copyright (c) 1982, 1986, 1989, 1991, 1993
> The Regents of the University of California.  All rights reserved.
> Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org
>
> OpenBSD 5.6 (RAMDISK-SUNXI) #3: Sun Aug 31 18:46:49 EDT 2014
>    [hidden email]:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
> real mem  = 1073741824 (1024MB)
> avail mem = 1036165120 (988MB)
> warning: no entropy supplied by boot loader
> mainbus0 at root
> cortex0 at mainbus0
> ampintc0 at cortex0 nirq 160
> cpu0 at mainbus0: ARM Cortex A7 rev 4 (ARMv7 core)
> cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
> cpu0: 32KB(32b/l,2way) I-cache, 32KB(64b/l,4way) wr-back D-cache
> sunxi0 at mainbus0: A20
> sxipio0 at sunxi0
> sxiccmu0 at sunxi0
> sxitimer0 at sunxi0: ticktimer 100hz @ 32KHz
> sxitimer1 at sunxi0: stattimer 128hz @ 32KHz
> sxitimer2 at sunxi0: cntrtimer @ 32KHz
> sxidog0 at sunxi0
> sxirtc0 at sunxi0
> sxiuart0 at sunxi0: console
> sxiuart1 at sunxi0
> sxiuart2 at sunxi0
> sxiuart3 at sunxi0
> sxiuart4 at sunxi0
> sxiuart5 at sunxi0
> sxiuart6 at sunxi0
> sxiuart7 at sunxi0
> sxie0 at sunxi0, address 02:99:03:c2:d2:6e
> ukphy0 at sxie0 phy 0: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
> ukphy1 at sxie0 phy 1: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
> ahci0 at sunxi0 AHCI 1.1
> scsibus0 at ahci0: 32 targets
> ehci0 at sunxi0
> usb0 at ehci0: USB revision 2.0
> uhub0 at usb0 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
> ehci1 at sunxi0
> usb1 at ehci1: USB revision 2.0
> uhub1 at usb1 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
> pmap_fault_fixup: va ca57c000 ftype 2 s pte 7ff7701e
>
> uvm_fault(0xc0e9f724, ca57c000, 2, 0) -> e
> Fatal kernel mode data abort: 'Translation Fault (P)'
> trapframe: 0xc0f3ee88
> DFSR=000008f7, DFAR=ca57cfc8, spsr=60000153
> r0 =c0ec0038, r1 =ca57c000, r2 =ca57cfc8, r3 =00000000
> r4 =ca57c000, r5 =c0ec0038, r6 =00000000, r7 =c0ec0038
> r8 =c0ebc90c, r9 =00000000, r10=00000004, r11=c0f3ef00
> r12=c0f3ef04, ssp=c0f3eed4, slr=c0838250, pc =c08374e0
>
> Stopped at      pool_prime_page+0x24:   str     r3, [r2]
> ddb> trace
> pool_prime_page+0xc
>        scp=0xc08374c8 rlv=0xc0838250 (pool_do_get+0x120)
>        rsp=0xc0f3ef04 rfp=0xc0f3ef38
>        r10=0xc0ebc774 r9=0xc0ebd5dc r8=0xc0ebc90c r7=0x00000002
>        r6=0x00000000 r5=0xc0ec0038 r4=0xca57c000
> pool_do_get+0x10
>        scp=0xc0838140 rlv=0xc0837e10 (pool_get+0x3c)
>        rsp=0xc0f3ef3c rfp=0xc0f3ef58
>        r7=0x00001202 r6=0xc08325ac r5=0x00000002 r4=0xc0ec0038
> pool_get+0x10
>        scp=0xc0837de4 rlv=0xc082e894 (workq_add_task+0x34)
>        rsp=0xc0f3ef5c rfp=0xc0f3ef84
>        r6=0xc08325ac r5=0x00000000 r4=0x00000000
> workq_add_task+0x10
>        scp=0xc082e870 rlv=0xc08327cc (disk_attach+0xf0)
>        rsp=0xc0f3ef88 rfp=0xc0f3efa8
>        r7=0xc0ebc5f8 r6=0x00000000 r5=0xc5573500 r4=0xc5573530
> disk_attach+0xc
>        scp=0xc08326e8 rlv=0xc0815470 (main+0x374)
>        rsp=0xc0f3efac rfp=0xc0f3efec
>        r6=0x00000000 r5=0xc0ebc574 r4=0xc0970714
> main+0x10
> --db_more--
>        scp=0xc081510c rlv=0xc080017c (kernel_text+0x4c)
>        rsp=0xc0f3eff0 rfp=0xc0f3effc
>        r10=0x7ffb9eac r9=0x7fb65f0c r8=0x40000100 r7=0x000010bb
>        r6=0x40000100 r5=0x000010bb r4=0x40800120
> kernel_text+0x48
>        scp=0xc0800178 rlv=0xc090655c (initarm+0x820)
>        rsp=0xc0f3f000 rfp=0x00000000
> ddb> ps
>   PID   PPID   PGRP    UID  S       FLAGS  WAIT          COMMAND
> *    0     -1      0      0  7     0x10200                swapper
> ddb> boot reboot
> boot: howto=00004804 curproc=0xc0ebc774
> rebooting...
>
>
> [3rd try - hangs up at ddb]
> U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
> Board: Bananapi
> DRAM: 1024 MiB
> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
> spl: not an uImage at 1600
>
>
> U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology
>
> CPU:   Allwinner A20 (SUN7I)
> Board: Bananapi
> I2C:   ready
> DRAM:  1 GiB
> MMC:   SUNXI SD/MMC: 0
> *** Warning - bad CRC, using default environment
>
> In:    serial
> Out:   serial
> Err:   serial
> Net:   dwmac.1c50000
> Hit any key to stop autoboot:  0
> reading uEnv.txt
> 116 bytes read in 16 ms (6.8 KiB/s)
> Loaded environment from uEnv.txt
> Running uenvcmd ...
> reading bsd.umg
> 7387788 bytes read in 367 ms (19.2 MiB/s)
> ## Booting kernel from Legacy Image at 60000000 ...
>   Image Name:   boot
>   Image Type:   ARM Linux Kernel Image (uncompressed)
>   Data Size:    7387724 Bytes = 7 MiB
>   Load Address: 40800000
>   Entry Point:  40800000
>   Verifying Checksum ... OK
>   Loading Kernel Image ... OK
>
> Starting kernel ...
>
>
> OpenBSD/sunxi booting ...
> arg0 0x0 arg1 0x10bb arg2 0x40000100
> atag core flags 0 pagesize 0 rootdev 0
> atag cmdline [sd0a:/bsd;]
> atag mem start 0x40000000 size 0x40000000
> bootfile: sd0a:/bsd;
> bootargs:
> memory size derived from u-boot
> bootconf.mem[0].address = 40000000 pages 262144/0x40000000
> Allocating page tables
> freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
> IRQ stack: p0x40f3a000 v0xc0f3a000
> ABT stack: p0x40f3b000 v0xc0f3b000
> UND stack: p0x40f3c000 v0xc0f3c000
> SVC stack: p0x40f3d000 v0xc0f3d000
> Creating L1 page table at 0x40f0c000
> Mapping kernel
> Constructing L2 page tables
> undefined page pmap [ using 169296 bytes of bsd ELF symbol table ]
> Copyright (c) 1982, 1986, 1989, 1991, 1993
> The Regents of the University of California.  All rights reserved.
> Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org
>
> OpenBSD 5.6 (RAMDISK-SUNXI) #3: Sun Aug 31 18:46:49 EDT 2014
>    [hidden email]:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
> real mem  = 1073741824 (1024MB)
> avail mem = 1036165120 (988MB)
> warning: no entropy supplied by boot loader
> pmap_fault_fixup: va ca580000 ftype 2 s pte 7ffa001e
>
> uvm_fault(0xc0e9f724, ca580000, 2, 0) -> e
> Fatal kernel mode data abort: 'Translation Fault (P)'
> trapframe: 0xc0f3ee58
> DFSR=000008f7, DFAR=ca580fc8, spsr=600001d3
> r0 =c0ed5cf4, r1 =ca580000, r2 =ca580fc8, r3 =00000000
> r4 =ca580000, r5 =c0ed5cf4, r6 =00000000, r7 =c0ed5cf4
> r8 =c0ebc90c, r9 =00000000, r10=00000004, r11=c0f3eed0
> r12=c0f3eed4, ssp=c0f3eea4, slr=c0838250, pc =c08374e0
>
> Stopped at      pool_prime_page+0x24:   str     r3, [r2]
> pool_prime_page+0xc
>        scp=0xc08374c8 rlv=0xc0838250 (pool_do_get+0x120)
>        rsp=0xc0f3eed4 rfp=0xc0f3ef08
>        r10=0xc0ebc774 r9=0xc0ebd5dc r8=0xc0ebc90c r7=0x00000001
>        r6=0x00000000 r5=0xc0ed5cf4 r4=0xca580000
> pool_do_get+0x10
>        scp=0xc0838140 rlv=0xc0837e10 (pool_get+0x3c)
>        rsp=0xc0f3ef0c rfp=0xc0f3ef28
>        r7=0xc0000000 r6=0xc0000000 r5=0x00000001 r4=0xc0ed5cf4
> pool_get+0x10
>        scp=0xc0837de4 rlv=0xc08bbc64 (uaddr_rnd_create+0x24)
>        rsp=0xc0f3ef2c rfp=0xc0f3ef44
>        r6=0xc0000000 r5=0xc0000000 r4=0x00001000
> uaddr_rnd_create+0xc
>        scp=0xc08bbc4c rlv=0xc08c5b90 (uvm_map_setup_md+0x30)
>        rsp=0xc0f3ef48 rfp=0xc0f3ef64
>        r5=0x00001000 r4=0xc0ebc574
> uvm_map_setup_md+0xc
>        scp=0xc08c5b6c rlv=0xc08c86d0 (uvm_map_setup+0x120)
>        rsp=0xc0f3ef68 rfp=0xc0f3ef84
>        r6=0x00000041 r5=0xc0ebc578 r4=0xc0ebc574
> --db_more--
> (hang up here)
>


Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

Patrick Wildt-2
iirc this is the core of the issue: The L1 Section descriptors access permissions are still the old ones, not the v7 versions.

arm/include/pmap.h:
#define L1_S_PROT_U             (L1_S_AP(AP_U))
#define L1_S_PROT_W             (L1_S_AP(AP_W))
#define L1_S_PROT_MASK          (L1_S_PROT_U|L1_S_PROT_W)

#define L1_S_PROT(ku, pr)       ((((ku) == PTE_USER) ? L1_S_PROT_U : 0) | \
                                 (((pr) & VM_PROT_WRITE) ? L1_S_PROT_W : 0))

arm/include/pte.h:
#define L1_S_AP(x)      ((x) << 10)     /* access permissions */
#define L1_S_V7_AP(x)   ((((x) & 0x4) << 13) | (((x) & 3) << 10))       /* AP */

\Patrick

> Am 02.10.2014 um 21:16 schrieb Patrick Wildt <[hidden email]>:
>
> Hi,
>
> I remember that there has been an issue, only seen on Cortex-A7/A15, like the Allwinner A20.
>
> The fix for that issue is somewhere here[0].
>
> Try this[1] kernel and have a look if it has the same issue or not.
>
> I do not have an A20, so I can’t test it, sorry. But I’ll probably buy this[2][3] one once it’s available.
>
> \Patrick
>
> [0] https://github.com/bitrig/bitrig/commit/f1932308435a4b2c3daf0e880dc0adc829f5803d
> [1] https://www.blueri.se/bitrig/armv7/20140925/bsd.rd.SUNXI.umg
> [2] http://www.allnet.de/at/allnet-brand/produkte/neuheiten/p/banana-pi-router-board/
> [3] http://www.sinovoip.com.cn/ecp_view.asp?id=554
>
>> Am 02.10.2014 um 20:56 schrieb SASANO Takayoshi <[hidden email]>:
>>
>> Hello,
>>
>> I tried bsd.rd.SUNXI.umg snapshot on Banana Pi, cheap Allwinner A20
>> board like Raspberry Pi (see http://www.lemaker.org/).
>>
>> It booted but something wrong. Arch Linux (for Banana Pi) works fine
>> so I think the board is not broken.
>>
>> This is my first OpenBSD/armv7 experience and I don't know what is
>> happening. What can I do for solving this problem?
>>
>> --
>> SASANO Takayoshi <[hidden email]>
>>
>> [uEnv.txt]
>> mmcboot=mmc rescan; fatload mmc 0 0x60000000 bsd.umg && bootm 0x60000000;
>> bootargs=sd0a:/bsd;
>> uenvcmd=run mmcboot;
>>
>>
>> [1st try - hang up] ----------------------------------------------------
>> U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
>> Board: Bananapi
>> DRAM: 1024 MiB
>> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
>> spl: not an uImage at 1600
>>
>>
>> U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology
>>
>> CPU:   Allwinner A20 (SUN7I)
>> Board: Bananapi
>> I2C:   ready
>> DRAM:  1 GiB
>> MMC:   SUNXI SD/MMC: 0
>> *** Warning - bad CRC, using default environment
>>
>> In:    serial
>> Out:   serial
>> Err:   serial
>> Net:   dwmac.1c50000
>> Hit any key to stop autoboot:  0
>> reading uEnv.txt
>> 116 bytes read in 16 ms (6.8 KiB/s)
>> Loaded environment from uEnv.txt
>> Running uenvcmd ...
>> reading bsd.umg
>> 7387788 bytes read in 367 ms (19.2 MiB/s)
>> ## Booting kernel from Legacy Image at 60000000 ...
>>  Image Name:   boot
>>  Image Type:   ARM Linux Kernel Image (uncompressed)
>>  Data Size:    7387724 Bytes = 7 MiB
>>  Load Address: 40800000
>>  Entry Point:  40800000
>>  Verifying Checksum ... OK
>>  Loading Kernel Image ... OK
>>
>> Starting kernel ...
>>
>>
>> OpenBSD/sunxi booting ...
>> arg0 0x0 arg1 0x10bb arg2 0x40000100
>> atag core flags 0 pagesize 0 rootdev 0
>> atag cmdline [sd0a:/bsd;]
>> atag mem start 0x40000000 size 0x40000000
>> bootfile: sd0a:/bsd;
>> bootargs:
>> memory size derived from u-boot
>> bootconf.mem[0].address = 40000000 pages 262144/0x40000000
>> Allocating page tables
>> freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
>> IRQ stack: p0x40f3a000 v0xc0f3a000
>> ABT stack: p0x40f3b000 v0xc0f3b000
>> UND stack: p0x40f3c000 v0xc0f3c000
>> SVC stack: p0x40f3d000 v0xc0f3d000
>> Creating L1 page table at 0x40f0c000
>> Mapping kernel
>> Constructing L2 page tables
>> undefined page pmap [ using 169296 bytes of bsd ELF symbol table ]
>> Copyright (c) 1982, 1986, 1989, 1991, 1993
>> The Regents of the University of California.  All rights reserved.
>> Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org
>>
>> OpenBSD 5.6 (RAMDISK-SUNXI) #3: Sun Aug 31 18:46:49 EDT 2014
>>   [hidden email]:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
>> real mem  = 1073741824 (1024MB)
>> avail mem = 1036165120 (988MB)
>> warning: no entropy supplied by boot loader
>> mainbus0 at root
>> cortex0 at mainbus0
>> ampintc0 at cortex0 nirq 160
>> cpu0 at mainbus0: ARM Cortex A7 rev 4 (ARMv7 core)
>> cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
>> cpu0: 32KB(32b/l,2way) I-cache, 32KB(64b/l,4way) wr-back D-cache
>> sunxi0 at mainbus0: A20
>> sxipio0 at sunxi0
>> sxiccmu0 at sunxi0
>> sxitimer0 at sunxi0: ticktimer 100hz @ 32KHz
>> sxitimer1 at sunxi0: stattimer 128hz @ 32KHz
>> sxitimer2 at sunxi0: cntrtimer @ 32KHz
>> sxidog0 at sunxi0
>> sxirtc0 at sunxi0
>> sxiuart0 at sunxi0: console
>> sxiuart1 at sunxi0
>> sxiuart2 at sunxi0
>> sxiuart3 at sunxi0
>> sxiuart4 at sunxi0
>> sxiuart5 at sunxi0
>> sxiuart6 at sunxi0
>> sxiuart7 at sunxi0
>> sxie0 at sunxi0, address 02:99:03:c2:d2:6e
>> ukphy0 at sxie0 phy 0: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
>> ukphy1 at sxie0 phy 1: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
>> ahci0 at sunxi0 AHCI 1.1
>> scsibus0 at ahci0: 32 targets
>> ehci0 at sunxi0
>> usb0 at ehci0: USB revision 2.0
>> uhub0 at usb0 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
>> ehci1 at sunxi0
>> usb1 at ehci1: USB revision 2.0
>> uhub1 at usb1 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
>> (hang up here)
>>
>>
>> [2nd try - ddb invoked] ------------------------------------------------
>> U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
>> Board: Bananapi
>> DRAM: 1024 MiB
>> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
>> spl: not an uImage at 1600
>>
>>
>> U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology
>>
>> CPU:   Allwinner A20 (SUN7I)
>> Board: Bananapi
>> I2C:   ready
>> DRAM:  1 GiB
>> MMC:   SUNXI SD/MMC: 0
>> *** Warning - bad CRC, using default environment
>>
>> In:    serial
>> Out:   serial
>> Err:   serial
>> Net:   dwmac.1c50000
>> Hit any key to stop autoboot:  0
>> reading uEnv.txt
>> 116 bytes read in 16 ms (6.8 KiB/s)
>> Loaded environment from uEnv.txt
>> Running uenvcmd ...
>> reading bsd.umg
>> 7387788 bytes read in 370 ms (19 MiB/s)
>> ## Booting kernel from Legacy Image at 60000000 ...
>>  Image Name:   boot
>>  Image Type:   ARM Linux Kernel Image (uncompressed)
>>  Data Size:    7387724 Bytes = 7 MiB
>>  Load Address: 40800000
>>  Entry Point:  40800000
>>  Verifying Checksum ... OK
>>  Loading Kernel Image ... OK
>>
>> Starting kernel ...
>>
>>
>> OpenBSD/sunxi booting ...
>> arg0 0x0 arg1 0x10bb arg2 0x40000100
>> atag core flags 0 pagesize 0 rootdev 0
>> atag cmdline [sd0a:/bsd;]
>> atag mem start 0x40000000 size 0x40000000
>> bootfile: sd0a:/bsd;
>> bootargs:
>> memory size derived from u-boot
>> bootconf.mem[0].address = 40000000 pages 262144/0x40000000
>> Allocating page tables
>> freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
>> IRQ stack: p0x40f3a000 v0xc0f3a000
>> ABT stack: p0x40f3b000 v0xc0f3b000
>> UND stack: p0x40f3c000 v0xc0f3c000
>> SVC stack: p0x40f3d000 v0xc0f3d000
>> Creating L1 page table at 0x40f0c000
>> Mapping kernel
>> Constructing L2 page tables
>> undefined page pmap [ using 169296 bytes of bsd ELF symbol table ]
>> Copyright (c) 1982, 1986, 1989, 1991, 1993
>> The Regents of the University of California.  All rights reserved.
>> Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org
>>
>> OpenBSD 5.6 (RAMDISK-SUNXI) #3: Sun Aug 31 18:46:49 EDT 2014
>>   [hidden email]:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
>> real mem  = 1073741824 (1024MB)
>> avail mem = 1036165120 (988MB)
>> warning: no entropy supplied by boot loader
>> mainbus0 at root
>> cortex0 at mainbus0
>> ampintc0 at cortex0 nirq 160
>> cpu0 at mainbus0: ARM Cortex A7 rev 4 (ARMv7 core)
>> cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
>> cpu0: 32KB(32b/l,2way) I-cache, 32KB(64b/l,4way) wr-back D-cache
>> sunxi0 at mainbus0: A20
>> sxipio0 at sunxi0
>> sxiccmu0 at sunxi0
>> sxitimer0 at sunxi0: ticktimer 100hz @ 32KHz
>> sxitimer1 at sunxi0: stattimer 128hz @ 32KHz
>> sxitimer2 at sunxi0: cntrtimer @ 32KHz
>> sxidog0 at sunxi0
>> sxirtc0 at sunxi0
>> sxiuart0 at sunxi0: console
>> sxiuart1 at sunxi0
>> sxiuart2 at sunxi0
>> sxiuart3 at sunxi0
>> sxiuart4 at sunxi0
>> sxiuart5 at sunxi0
>> sxiuart6 at sunxi0
>> sxiuart7 at sunxi0
>> sxie0 at sunxi0, address 02:99:03:c2:d2:6e
>> ukphy0 at sxie0 phy 0: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
>> ukphy1 at sxie0 phy 1: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
>> ahci0 at sunxi0 AHCI 1.1
>> scsibus0 at ahci0: 32 targets
>> ehci0 at sunxi0
>> usb0 at ehci0: USB revision 2.0
>> uhub0 at usb0 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
>> ehci1 at sunxi0
>> usb1 at ehci1: USB revision 2.0
>> uhub1 at usb1 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
>> pmap_fault_fixup: va ca57c000 ftype 2 s pte 7ff7701e
>>
>> uvm_fault(0xc0e9f724, ca57c000, 2, 0) -> e
>> Fatal kernel mode data abort: 'Translation Fault (P)'
>> trapframe: 0xc0f3ee88
>> DFSR=000008f7, DFAR=ca57cfc8, spsr=60000153
>> r0 =c0ec0038, r1 =ca57c000, r2 =ca57cfc8, r3 =00000000
>> r4 =ca57c000, r5 =c0ec0038, r6 =00000000, r7 =c0ec0038
>> r8 =c0ebc90c, r9 =00000000, r10=00000004, r11=c0f3ef00
>> r12=c0f3ef04, ssp=c0f3eed4, slr=c0838250, pc =c08374e0
>>
>> Stopped at      pool_prime_page+0x24:   str     r3, [r2]
>> ddb> trace
>> pool_prime_page+0xc
>>       scp=0xc08374c8 rlv=0xc0838250 (pool_do_get+0x120)
>>       rsp=0xc0f3ef04 rfp=0xc0f3ef38
>>       r10=0xc0ebc774 r9=0xc0ebd5dc r8=0xc0ebc90c r7=0x00000002
>>       r6=0x00000000 r5=0xc0ec0038 r4=0xca57c000
>> pool_do_get+0x10
>>       scp=0xc0838140 rlv=0xc0837e10 (pool_get+0x3c)
>>       rsp=0xc0f3ef3c rfp=0xc0f3ef58
>>       r7=0x00001202 r6=0xc08325ac r5=0x00000002 r4=0xc0ec0038
>> pool_get+0x10
>>       scp=0xc0837de4 rlv=0xc082e894 (workq_add_task+0x34)
>>       rsp=0xc0f3ef5c rfp=0xc0f3ef84
>>       r6=0xc08325ac r5=0x00000000 r4=0x00000000
>> workq_add_task+0x10
>>       scp=0xc082e870 rlv=0xc08327cc (disk_attach+0xf0)
>>       rsp=0xc0f3ef88 rfp=0xc0f3efa8
>>       r7=0xc0ebc5f8 r6=0x00000000 r5=0xc5573500 r4=0xc5573530
>> disk_attach+0xc
>>       scp=0xc08326e8 rlv=0xc0815470 (main+0x374)
>>       rsp=0xc0f3efac rfp=0xc0f3efec
>>       r6=0x00000000 r5=0xc0ebc574 r4=0xc0970714
>> main+0x10
>> --db_more--
>>       scp=0xc081510c rlv=0xc080017c (kernel_text+0x4c)
>>       rsp=0xc0f3eff0 rfp=0xc0f3effc
>>       r10=0x7ffb9eac r9=0x7fb65f0c r8=0x40000100 r7=0x000010bb
>>       r6=0x40000100 r5=0x000010bb r4=0x40800120
>> kernel_text+0x48
>>       scp=0xc0800178 rlv=0xc090655c (initarm+0x820)
>>       rsp=0xc0f3f000 rfp=0x00000000
>> ddb> ps
>>  PID   PPID   PGRP    UID  S       FLAGS  WAIT          COMMAND
>> *    0     -1      0      0  7     0x10200                swapper
>> ddb> boot reboot
>> boot: howto=00004804 curproc=0xc0ebc774
>> rebooting...
>>
>>
>> [3rd try - hangs up at ddb]
>> U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
>> Board: Bananapi
>> DRAM: 1024 MiB
>> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
>> spl: not an uImage at 1600
>>
>>
>> U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology
>>
>> CPU:   Allwinner A20 (SUN7I)
>> Board: Bananapi
>> I2C:   ready
>> DRAM:  1 GiB
>> MMC:   SUNXI SD/MMC: 0
>> *** Warning - bad CRC, using default environment
>>
>> In:    serial
>> Out:   serial
>> Err:   serial
>> Net:   dwmac.1c50000
>> Hit any key to stop autoboot:  0
>> reading uEnv.txt
>> 116 bytes read in 16 ms (6.8 KiB/s)
>> Loaded environment from uEnv.txt
>> Running uenvcmd ...
>> reading bsd.umg
>> 7387788 bytes read in 367 ms (19.2 MiB/s)
>> ## Booting kernel from Legacy Image at 60000000 ...
>>  Image Name:   boot
>>  Image Type:   ARM Linux Kernel Image (uncompressed)
>>  Data Size:    7387724 Bytes = 7 MiB
>>  Load Address: 40800000
>>  Entry Point:  40800000
>>  Verifying Checksum ... OK
>>  Loading Kernel Image ... OK
>>
>> Starting kernel ...
>>
>>
>> OpenBSD/sunxi booting ...
>> arg0 0x0 arg1 0x10bb arg2 0x40000100
>> atag core flags 0 pagesize 0 rootdev 0
>> atag cmdline [sd0a:/bsd;]
>> atag mem start 0x40000000 size 0x40000000
>> bootfile: sd0a:/bsd;
>> bootargs:
>> memory size derived from u-boot
>> bootconf.mem[0].address = 40000000 pages 262144/0x40000000
>> Allocating page tables
>> freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
>> IRQ stack: p0x40f3a000 v0xc0f3a000
>> ABT stack: p0x40f3b000 v0xc0f3b000
>> UND stack: p0x40f3c000 v0xc0f3c000
>> SVC stack: p0x40f3d000 v0xc0f3d000
>> Creating L1 page table at 0x40f0c000
>> Mapping kernel
>> Constructing L2 page tables
>> undefined page pmap [ using 169296 bytes of bsd ELF symbol table ]
>> Copyright (c) 1982, 1986, 1989, 1991, 1993
>> The Regents of the University of California.  All rights reserved.
>> Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org
>>
>> OpenBSD 5.6 (RAMDISK-SUNXI) #3: Sun Aug 31 18:46:49 EDT 2014
>>   [hidden email]:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
>> real mem  = 1073741824 (1024MB)
>> avail mem = 1036165120 (988MB)
>> warning: no entropy supplied by boot loader
>> pmap_fault_fixup: va ca580000 ftype 2 s pte 7ffa001e
>>
>> uvm_fault(0xc0e9f724, ca580000, 2, 0) -> e
>> Fatal kernel mode data abort: 'Translation Fault (P)'
>> trapframe: 0xc0f3ee58
>> DFSR=000008f7, DFAR=ca580fc8, spsr=600001d3
>> r0 =c0ed5cf4, r1 =ca580000, r2 =ca580fc8, r3 =00000000
>> r4 =ca580000, r5 =c0ed5cf4, r6 =00000000, r7 =c0ed5cf4
>> r8 =c0ebc90c, r9 =00000000, r10=00000004, r11=c0f3eed0
>> r12=c0f3eed4, ssp=c0f3eea4, slr=c0838250, pc =c08374e0
>>
>> Stopped at      pool_prime_page+0x24:   str     r3, [r2]
>> pool_prime_page+0xc
>>       scp=0xc08374c8 rlv=0xc0838250 (pool_do_get+0x120)
>>       rsp=0xc0f3eed4 rfp=0xc0f3ef08
>>       r10=0xc0ebc774 r9=0xc0ebd5dc r8=0xc0ebc90c r7=0x00000001
>>       r6=0x00000000 r5=0xc0ed5cf4 r4=0xca580000
>> pool_do_get+0x10
>>       scp=0xc0838140 rlv=0xc0837e10 (pool_get+0x3c)
>>       rsp=0xc0f3ef0c rfp=0xc0f3ef28
>>       r7=0xc0000000 r6=0xc0000000 r5=0x00000001 r4=0xc0ed5cf4
>> pool_get+0x10
>>       scp=0xc0837de4 rlv=0xc08bbc64 (uaddr_rnd_create+0x24)
>>       rsp=0xc0f3ef2c rfp=0xc0f3ef44
>>       r6=0xc0000000 r5=0xc0000000 r4=0x00001000
>> uaddr_rnd_create+0xc
>>       scp=0xc08bbc4c rlv=0xc08c5b90 (uvm_map_setup_md+0x30)
>>       rsp=0xc0f3ef48 rfp=0xc0f3ef64
>>       r5=0x00001000 r4=0xc0ebc574
>> uvm_map_setup_md+0xc
>>       scp=0xc08c5b6c rlv=0xc08c86d0 (uvm_map_setup+0x120)
>>       rsp=0xc0f3ef68 rfp=0xc0f3ef84
>>       r6=0x00000041 r5=0xc0ebc578 r4=0xc0ebc574
>> --db_more--
>> (hang up here)
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

SASANO Takayoshi
In reply to this post by Patrick Wildt-2
Hi,

> Try this[1] kernel and have a look if it has the same issue or not.

Kernel did not started... U-Boot says checksum is ok, so maybe
.umg file is not corrupted.

Regards,

--
SASANO Takayoshi <[hidden email]>


U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
Board: Bananapi
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600


U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Board: Bananapi
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   dwmac.1c50000
Hit any key to stop autoboot:  0
reading uEnv.txt
116 bytes read in 16 ms (6.8 KiB/s)
Loaded environment from uEnv.txt
Running uenvcmd ...
reading bsd.umg
9584704 bytes read in 473 ms (19.3 MiB/s)
## Booting kernel from Legacy Image at 60000000 ...
   Image Name:   boot
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    9584640 Bytes = 9.1 MiB
   Load Address: 40800000
   Entry Point:  40800000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

(halt here)

Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

Alexey Suslikov
SASANO Takayoshi <uaa <at> mx5.nisiq.net> writes:

> > Try this[1] kernel and have a look if it has the same issue or not.
>
> Kernel did not started... U-Boot says checksum is ok, so maybe
> .umg file is not corrupted.

When using

OpenBSD 5.6 (RAMDISK-SUNXI) #3: Sun Aug 31 18:46:49 EDT 2014

could you drop into config (pass -c to boot) and try to "disable echi"?

Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

Landry Breuil-6
On Thu, Oct 02, 2014 at 10:01:59PM +0000, Alexey Suslikov wrote:

> SASANO Takayoshi <uaa <at> mx5.nisiq.net> writes:
>
> > > Try this[1] kernel and have a look if it has the same issue or not.
> >
> > Kernel did not started... U-Boot says checksum is ok, so maybe
> > .umg file is not corrupted.
>
> When using
>
> OpenBSD 5.6 (RAMDISK-SUNXI) #3: Sun Aug 31 18:46:49 EDT 2014
>
> could you drop into config (pass -c to boot) and try to "disable echi"?

ITYM 'disable ehci' there..

Landry

Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

Jonathan Gray-11
In reply to this post by Patrick Wildt-2
On Thu, Oct 02, 2014 at 09:16:43PM +0200, Patrick Wildt wrote:

> Hi,
>
> I remember that there has been an issue, only seen on Cortex-A7/A15, like the Allwinner A20.
>
> The fix for that issue is somewhere here[0].
>
> Try this[1] kernel and have a look if it has the same issue or not.
>
> I do not have an A20, so I can’t test it, sorry. But I’ll probably buy this[2][3] one once it’s available.
>
> \Patrick
>
> [0] https://github.com/bitrig/bitrig/commit/f1932308435a4b2c3daf0e880dc0adc829f5803d
> [1] https://www.blueri.se/bitrig/armv7/20140925/bsd.rd.SUNXI.umg
> [2] http://www.allnet.de/at/allnet-brand/produkte/neuheiten/p/banana-pi-router-board/
> [3] http://www.sinovoip.com.cn/ecp_view.asp?id=554

Here is a diff against -current that handles the L1 pte bits for v7
in the same manner as L2 as suggested by Patrick.

Note that the armv7 snapshot won't install correctly at the
moment as it is missing etc56.tgz

Index: arm/pmap.c
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/pmap.c,v
retrieving revision 1.46
diff -u -p -r1.46 pmap.c
--- arm/pmap.c 29 Mar 2014 18:09:28 -0000 1.46
+++ arm/pmap.c 3 Oct 2014 06:54:02 -0000
@@ -4585,6 +4585,12 @@ pt_entry_t pte_l1_s_coherent;
 pt_entry_t pte_l2_l_coherent;
 pt_entry_t pte_l2_s_coherent;
 
+pt_entry_t pte_l1_s_prot_ur;
+pt_entry_t pte_l1_s_prot_uw;
+pt_entry_t pte_l1_s_prot_kr;
+pt_entry_t pte_l1_s_prot_kw;
+pt_entry_t pte_l1_s_prot_mask;
+
 pt_entry_t pte_l2_s_prot_ur;
 pt_entry_t pte_l2_s_prot_uw;
 pt_entry_t pte_l2_s_prot_kr;
@@ -4631,6 +4637,12 @@ pmap_pte_init_generic(void)
  pte_l2_l_coherent = L2_L_COHERENT_generic;
  pte_l2_s_coherent = L2_S_COHERENT_generic;
 
+ pte_l1_s_prot_ur = L1_S_PROT_UR_generic;
+ pte_l1_s_prot_uw = L1_S_PROT_UW_generic;
+ pte_l1_s_prot_kr = L1_S_PROT_KR_generic;
+ pte_l1_s_prot_kw = L1_S_PROT_KW_generic;
+ pte_l1_s_prot_mask = L1_S_PROT_MASK_generic;
+
  pte_l2_s_prot_ur = L2_S_PROT_UR_generic;
  pte_l2_s_prot_uw = L2_S_PROT_UW_generic;
  pte_l2_s_prot_kr = L2_S_PROT_KR_generic;
@@ -4754,6 +4766,12 @@ pmap_pte_init_armv7(void)
  pte_l2_l_coherent = L2_L_COHERENT_v7;
  pte_l2_s_coherent = L2_S_COHERENT_v7;
 
+ pte_l1_s_prot_ur = L1_S_PROT_UR_v7;
+ pte_l1_s_prot_uw = L1_S_PROT_UW_v7;
+ pte_l1_s_prot_kr = L1_S_PROT_KR_v7;
+ pte_l1_s_prot_kw = L1_S_PROT_KW_v7;
+ pte_l1_s_prot_mask = L1_S_PROT_MASK_v7;
+
  pte_l2_s_prot_ur = L2_S_PROT_UR_v7;
  pte_l2_s_prot_uw = L2_S_PROT_UW_v7;
  pte_l2_s_prot_kr = L2_S_PROT_KR_v7;
@@ -4885,6 +4903,12 @@ pmap_pte_init_xscale(void)
  pte_l1_s_coherent = L1_S_COHERENT_xscale;
  pte_l2_l_coherent = L2_L_COHERENT_xscale;
  pte_l2_s_coherent = L2_S_COHERENT_xscale;
+
+ pte_l1_s_prot_ur = L1_S_PROT_UR_xscale;
+ pte_l1_s_prot_uw = L1_S_PROT_UW_xscale;
+ pte_l1_s_prot_kr = L1_S_PROT_KR_xscale;
+ pte_l1_s_prot_kw = L1_S_PROT_KW_xscale;
+ pte_l1_s_prot_mask = L1_S_PROT_MASK_xscale;
 
  pte_l2_s_prot_ur = L2_S_PROT_UR_xscale;
  pte_l2_s_prot_uw = L2_S_PROT_UW_xscale;
Index: arm/pmap7.c
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/pmap7.c,v
retrieving revision 1.15
diff -u -p -r1.15 pmap7.c
--- arm/pmap7.c 12 Jul 2014 18:44:41 -0000 1.15
+++ arm/pmap7.c 3 Oct 2014 06:19:40 -0000
@@ -3418,6 +3418,12 @@ pt_entry_t pte_l1_s_coherent;
 pt_entry_t pte_l2_l_coherent;
 pt_entry_t pte_l2_s_coherent;
 
+pt_entry_t pte_l1_s_prot_ur;
+pt_entry_t pte_l1_s_prot_uw;
+pt_entry_t pte_l1_s_prot_kr;
+pt_entry_t pte_l1_s_prot_kw;
+pt_entry_t pte_l1_s_prot_mask;
+
 pt_entry_t pte_l2_s_prot_ur;
 pt_entry_t pte_l2_s_prot_uw;
 pt_entry_t pte_l2_s_prot_kr;
@@ -3463,6 +3469,12 @@ pmap_pte_init_generic(void)
  pte_l2_l_coherent = L2_L_COHERENT_generic;
  pte_l2_s_coherent = L2_S_COHERENT_generic;
 
+ pte_l1_s_prot_ur = L1_S_PROT_UR_generic;
+ pte_l1_s_prot_uw = L1_S_PROT_UW_generic;
+ pte_l1_s_prot_kr = L1_S_PROT_KR_generic;
+ pte_l1_s_prot_kw = L1_S_PROT_KW_generic;
+ pte_l1_s_prot_mask = L1_S_PROT_MASK_generic;
+
  pte_l2_s_prot_ur = L2_S_PROT_UR_generic;
  pte_l2_s_prot_uw = L2_S_PROT_UW_generic;
  pte_l2_s_prot_kr = L2_S_PROT_KR_generic;
@@ -3505,6 +3517,12 @@ pmap_pte_init_armv7(void)
  pte_l1_s_coherent = L1_S_COHERENT_v7;
  pte_l2_l_coherent = L2_L_COHERENT_v7;
  pte_l2_s_coherent = L2_S_COHERENT_v7;
+
+ pte_l1_s_prot_ur = L1_S_PROT_UR_v7;
+ pte_l1_s_prot_uw = L1_S_PROT_UW_v7;
+ pte_l1_s_prot_kr = L1_S_PROT_KR_v7;
+ pte_l1_s_prot_kw = L1_S_PROT_KW_v7;
+ pte_l1_s_prot_mask = L1_S_PROT_MASK_v7;
 
  pte_l2_s_prot_ur = L2_S_PROT_UR_v7;
  pte_l2_s_prot_uw = L2_S_PROT_UW_v7;
Index: include/pmap.h
===================================================================
RCS file: /cvs/src/sys/arch/arm/include/pmap.h,v
retrieving revision 1.25
diff -u -p -r1.25 pmap.h
--- include/pmap.h 30 Jan 2014 18:16:41 -0000 1.25
+++ include/pmap.h 3 Oct 2014 07:25:50 -0000
@@ -440,6 +440,12 @@ extern pt_entry_t pte_l1_s_coherent;
 extern pt_entry_t pte_l2_l_coherent;
 extern pt_entry_t pte_l2_s_coherent;
 
+extern pt_entry_t pte_l1_s_prot_ur;
+extern pt_entry_t pte_l1_s_prot_uw;
+extern pt_entry_t pte_l1_s_prot_kr;
+extern pt_entry_t pte_l1_s_prot_kw;
+extern pt_entry_t pte_l1_s_prot_mask;
+
 extern pt_entry_t pte_l2_s_prot_ur;
 extern pt_entry_t pte_l2_s_prot_uw;
 extern pt_entry_t pte_l2_s_prot_kr;
@@ -470,9 +476,23 @@ extern void (*pmap_zero_page_func)(struc
  * We use these macros since we use different bits on different processor
  * models.
  */
-#define L1_S_PROT_U (L1_S_AP(AP_U))
-#define L1_S_PROT_W (L1_S_AP(AP_W))
-#define L1_S_PROT_MASK (L1_S_PROT_U|L1_S_PROT_W)
+#define L1_S_PROT_UR_generic (L1_S_AP(AP_U))
+#define L1_S_PROT_UW_generic (L1_S_AP(AP_U|AP_W))
+#define L1_S_PROT_KR_generic (L1_S_AP(0))
+#define L1_S_PROT_KW_generic (L1_S_AP(AP_W))
+#define L1_S_PROT_MASK_generic (L1_S_AP(0x03))
+
+#define L1_S_PROT_UR_xscale (L1_S_AP(AP_U))
+#define L1_S_PROT_UW_xscale (L1_S_AP(AP_U|AP_W))
+#define L1_S_PROT_KR_xscale (L1_S_AP(0))
+#define L1_S_PROT_KW_xscale (L1_S_AP(AP_W))
+#define L1_S_PROT_MASK_xscale (L1_S_AP(0x03))
+
+#define L1_S_PROT_UR_v7 (L1_S_AP(AP_KRWUR))
+#define L1_S_PROT_UW_v7 (L1_S_AP(AP_KRWURW))
+#define L1_S_PROT_KR_v7 (L1_S_AP(AP_V7_KR))
+#define L1_S_PROT_KW_v7 (L1_S_AP(AP_KRW))
+#define L1_S_PROT_MASK_v7 (L1_S_AP(0x07))
 
 #define L1_S_CACHE_MASK_generic (L1_S_B|L1_S_C)
 #define L1_S_CACHE_MASK_xscale (L1_S_B|L1_S_C|L1_S_XSCALE_TEX(TEX_XSCALE_X))
@@ -542,6 +562,12 @@ extern void (*pmap_zero_page_func)(struc
 
 #if ARM_NMMUS > 1
 /* More than one MMU class configured; use variables. */
+#define L1_S_PROT_UR pte_l1_s_prot_ur
+#define L1_S_PROT_UW pte_l1_s_prot_uw
+#define L1_S_PROT_KR pte_l1_s_prot_kr
+#define L1_S_PROT_KW pte_l1_s_prot_kw
+#define L1_S_PROT_MASK pte_l1_s_prot_mask
+
 #define L2_S_PROT_UR pte_l2_s_prot_ur
 #define L2_S_PROT_UW pte_l2_s_prot_uw
 #define L2_S_PROT_KR pte_l2_s_prot_kr
@@ -563,6 +589,12 @@ extern void (*pmap_zero_page_func)(struc
 #define pmap_copy_page(s, d) (*pmap_copy_page_func)((s), (d))
 #define pmap_zero_page(d) (*pmap_zero_page_func)((d))
 #elif (ARM_MMU_GENERIC + ARM_MMU_SA1) != 0
+#define L1_S_PROT_UR L1_S_PROT_UR_generic
+#define L1_S_PROT_UW L1_S_PROT_UW_generic
+#define L1_S_PROT_KR L1_S_PROT_KR_generic
+#define L1_S_PROT_KW L1_S_PROT_KW_generic
+#define L1_S_PROT_MASK L1_S_PROT_MASK_generic
+
 #define L2_S_PROT_UR L2_S_PROT_UR_generic
 #define L2_S_PROT_UW L2_S_PROT_UW_generic
 #define L2_S_PROT_KR L2_S_PROT_KR_generic
@@ -584,6 +616,12 @@ extern void (*pmap_zero_page_func)(struc
 #define pmap_copy_page(s, d) pmap_copy_page_generic((s), (d))
 #define pmap_zero_page(d) pmap_zero_page_generic((d))
 #elif ARM_MMU_XSCALE == 1
+#define L1_S_PROT_UR L1_S_PROT_UR_xscale
+#define L1_S_PROT_UW L1_S_PROT_UW_xscale
+#define L1_S_PROT_KR L1_S_PROT_KR_xscale
+#define L1_S_PROT_KW L1_S_PROT_KW_xscale
+#define L1_S_PROT_MASK L1_S_PROT_MASK_xscale
+
 #define L2_S_PROT_UR L2_S_PROT_UR_xscale
 #define L2_S_PROT_UW L2_S_PROT_UW_xscale
 #define L2_S_PROT_KR L2_S_PROT_KR_xscale
@@ -605,6 +643,12 @@ extern void (*pmap_zero_page_func)(struc
 #define pmap_copy_page(s, d) pmap_copy_page_xscale((s), (d))
 #define pmap_zero_page(d) pmap_zero_page_xscale((d))
 #elif ARM_MMU_V7 == 1
+#define L1_S_PROT_UR L1_S_PROT_UR_v7
+#define L1_S_PROT_UW L1_S_PROT_UW_v7
+#define L1_S_PROT_KR L1_S_PROT_KR_v7
+#define L1_S_PROT_KW L1_S_PROT_KW_v7
+#define L1_S_PROT_MASK L1_S_PROT_MASK_v7
+
 #define L2_S_PROT_UR L2_S_PROT_UR_v7
 #define L2_S_PROT_UW L2_S_PROT_UW_v7
 #define L2_S_PROT_KR L2_S_PROT_KR_v7
@@ -631,10 +675,27 @@ extern void (*pmap_zero_page_func)(struc
  * These macros return various bits based on kernel/user and protection.
  * Note that the compiler will usually fold these at compile time.
  */
-#define L1_S_PROT(ku, pr) ((((ku) == PTE_USER) ? L1_S_PROT_U : 0) | \
- (((pr) & VM_PROT_WRITE) ? L1_S_PROT_W : 0))
-
 #ifndef _LOCORE
+static __inline pt_entry_t
+L1_S_PROT(int ku, vm_prot_t pr)
+{
+ pt_entry_t pte;
+
+ if (ku == PTE_USER)
+ pte = (pr & VM_PROT_WRITE) ? L1_S_PROT_UW : L1_S_PROT_UR;
+ else
+ pte = (pr & VM_PROT_WRITE) ? L1_S_PROT_KW : L1_S_PROT_KR;
+ /*
+ * If we set the XN bit, the abort handlers or the vector page
+ * might be marked as such. Needs Debugging.
+ */
+ /*
+ if ((pr & VM_PROT_EXECUTE) == 0)
+ pte |= L1_S_V7_XN;
+ */
+
+ return pte;
+}
 static __inline pt_entry_t
 L2_L_PROT(int ku, vm_prot_t pr)
 {

Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

SASANO Takayoshi
In reply to this post by Alexey Suslikov
Hi,

> When using
>
> OpenBSD 5.6 (RAMDISK-SUNXI) #3: Sun Aug 31 18:46:49 EDT 2014
>
> could you drop into config (pass -c to boot) and try to "disable echi"?

What shoud I do pass "boot -c" string to armv7 kernel?
On i386/amd64 bootloader simply type it but armv7 uses U-Boot.

Tweak uEnv.txt?

--
SASANO Takayoshi <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

Jonathan Gray-11
On Sat, Oct 04, 2014 at 06:26:29AM +0900, SASANO Takayoshi wrote:

> Hi,
>
> > When using
> >
> > OpenBSD 5.6 (RAMDISK-SUNXI) #3: Sun Aug 31 18:46:49 EDT 2014
> >
> > could you drop into config (pass -c to boot) and try to "disable echi"?
>
> What shoud I do pass "boot -c" string to armv7 kernel?
> On i386/amd64 bootloader simply type it but armv7 uses U-Boot.
>
> Tweak uEnv.txt?

setenv bootargs "sd0i:/bsd -c"

Note the kernel part in the above isn't used as there isn't a second
stage bootloader as you point out.

I've put up a recently built ramdisk with the l1 pte change here:
http://jsg.id.au/openbsd/bsd.rd.SUNXI.umg

Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

SASANO Takayoshi
Hi,

> I've put up a recently built ramdisk with the l1 pte change here:
> http://jsg.id.au/openbsd/bsd.rd.SUNXI.umg

Thanks but not worked...

And, Ethernet PHY(RTL8211E) is recognized as ukphy.
I heard that the power of PHY is controlled by GPIO PH23.
(see http://www.srchack.org/article.php?story=20140501232036142
it is written in Japanese but maybe good hint)

Regards,
--
SASANO Takayoshi <[hidden email]>


[case 1]
U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
Board: Bananapi
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600


U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Board: Bananapi
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   dwmac.1c50000
Hit any key to stop autoboot:  0
reading uEnv.txt
116 bytes read in 16 ms (6.8 KiB/s)
Loaded environment from uEnv.txt
Running uenvcmd ...
reading bsd.umg
7386496 bytes read in 365 ms (19.3 MiB/s)
## Booting kernel from Legacy Image at 60000000 ...
   Image Name:   boot
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    7386432 Bytes = 7 MiB
   Load Address: 40800000
   Entry Point:  40800000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...


OpenBSD/sunxi booting ...
arg0 0x0 arg1 0x10bb arg2 0x40000100
atag core flags 0 pagesize 0 rootdev 0
atag cmdline [sd0i:/bsd;]
atag mem start 0x40000000 size 0x40000000
bootfile: sd0i:/bsd;
bootargs:
memory size derived from u-boot
bootconf.mem[0].address = 40000000 pages 262144/0x40000000
Allocating page tables
freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
IRQ stack: p0x40f3a000 v0xc0f3a000
ABT stack: p0x40f3b000 v0xc0f3b000
UND stack: p0x40f3c000 v0xc0f3c000
SVC stack: p0x40f3d000 v0xc0f3d000
Creating L1 page table at 0x40f0c000
Mapping kernel
Constructing L2 page tables
undefined page pmap [ using 170664 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 5.6-current (RAMDISK-SUNXI) #0: Sun Oct  5 13:50:18 AEDT 2014
    [hidden email]:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
real mem  = 1073741824 (1024MB)
avail mem = 1036165120 (988MB)
warning: no entropy supplied by boot loader
mainbus0 at root
cortex0 at mainbus0
ampintc0 at cortex0 nirq 160
cpu0 at mainbus0: ARM Cortex A7 rev 4 (ARMv7 core)
cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu0: 32KB(32b/l,2way) I-cache, 32KB(64b/l,4way) wr-back D-cache
sunxi0 at mainbus0: A20
sxipio0 at sunxi0
sxiccmu0 at sunxi0
sxitimer0 at sunxi0: ticktimer 100hz @ 32KHz
sxitimer1 at sunxi0: stattimer 128hz @ 32KHz
sxitimer2 at sunxi0: cntrtimer @ 32KHz
sxidog0 at sunxi0
sxirtc0 at sunxi0
sxiuart0 at sunxi0: console
sxiuart1 at sunxi0
sxiuart2 at sunxi0
sxiuart3 at sunxi0
sxiuart4 at sunxi0
sxiuart5 at sunxi0
sxiuart6 at sunxi0
sxiuart7 at sunxi0
sxie0 at sunxi0, address 02:99:03:c2:d2:6e
ukphy0 at sxie0 phy 0: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
ukphy1 at sxie0 phy 1: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
ahci0 at sunxi0 AHCI 1.1
scsibus0 at ahci0: 32 targets
ehci0 at sunxi0
pmap_fault_fixup: va c5549000 ftype 2 s pte 7ff8f01e
panic: uvm_fault: fault on non-pageable map (0xc0e7f28c, 0xc5549000)
Stopped at      Debugger+0x4:   ldrb    r15, [r15, r15, ror r15]!
panic+0x18
        scp=0xc083a2e8 rlv=0xc08c2ea4 (uvm_fault+0xca8)
        rsp=0xc0f3eb6c rfp=0xc0f3ec8c
uvm_fault+0xc
        scp=0xc08c2208 rlv=0xc08fe258 (data_abort_handler+0x248)
        rsp=0xc0f3ec90 rfp=0xc0f3ece4
        r10=0xc0f3ece8 r9=0xc0f3d000 r8=0x00000000 r7=0xc0e9f764
        r6=0x00000002 r5=0xc0ebc7b4 r4=0xc5549000
data_abort_handler+0xc
        scp=0xc08fe01c rlv=0xc08fda24 (address_exception_entry+0x50)
        rsp=0xc0f3ece8 rfp=0xc0f3ed4c
        r10=0xc0ebd268 r9=0x00001000 r8=0x00001000 r7=0x0000000a
        r6=0x0000000c r5=0xc5549000 r4=0x00000010
poison_mem+0xc
        scp=0xc0835b04 rlv=0xc081de6c (malloc+0x2ec)
        rsp=0xc0f3ed50 rfp=0xc0f3edb8
        r5=0xc5549000 r4=0xc5549000
malloc+0x10
        scp=0xc081db90 rlv=0xc0808a98 (ehci_init+0x184)
        rsp=0xc0f3edbc rfp=0xc0f3edf4
        r10=0xc5548294 r9=0xc5548000 r8=0x00000000 r7=0xc553d0c0
        r6=0xc5548014 r5=0xc5548000 r4=0xc0eb9ebc
ehci_init+0x10
        scp=0xc0808924 rlv=0xc0931f94 (sxiehci_attach+0x110)
        rsp=0xc0f3edf8 rfp=0xc0f3ee18
        r10=0x00000000 r9=0xc0f3ee5c r8=0xc0ec0290 r7=0xc553d0c0
        r6=0xc5548014 r5=0xc5548000 r4=0x00000000
sxiehci_attach+0x10
        scp=0xc0931e94 rlv=0xc083092c (config_attach+0x1d4)
        rsp=0xc0f3ee1c rfp=0xc0f3ee54
        r6=0xc0970778 r5=0xc5548014 r4=0xc5548000
config_attach+0xc
        scp=0xc0830764 rlv=0xc0906a6c (armv7_attach+0x144)
        rsp=0xc0f3ee58 rfp=0xc0f3ee90
        r10=0x00000000 r9=0xc0f3eed0 r8=0xc0e74534 r7=0xc553d0c0
        r6=0xc0e79ac4 r5=0xc0e76b2c r4=0xc0e76628
armv7_attach+0x10
        scp=0xc0906938 rlv=0xc083092c (config_attach+0x1d4)
        rsp=0xc0f3ee94 rfp=0xc0f3eecc
        r8=0xc0ec0290 r7=0xc553d000 r6=0xc0e78c40 r5=0xc553d0d4
        r4=0xc553d0c0
config_attach+0xc
        scp=0xc0830764 rlv=0xc08f80fc (mainbussearch+0x54)
        rsp=0xc0f3eed0 rfp=0xc0f3eef4
        r10=0x00000000 r9=0x00000000 r8=0xc0e727e4 r7=0xc0f3eed0
        r6=0xc553d000 r5=0xc0970468 r4=0xc0e78c2c
RUN AT LEAST 'trace' AND 'ps' AND INCLUDE OUTPUT WHEN REPORTING THIS PANIC!
DO NOT EVEN BOTHER REPORTING THIS WITHOUT INCLUDING THAT INFORMATION!
ddb> trace
panic+0x18
        scp=0xc083a2e8 rlv=0xc08c2ea4 (uvm_fault+0xca8)
        rsp=0xc0f3eb6c rfp=0xc0f3ec8c
uvm_fault+0xc
        scp=0xc08c2208 rlv=0xc08fe258 (data_abort_handler+0x248)
        rsp=0xc0f3ec90 rfp=0xc0f3ece4
        r10=0xc0f3ece8 r9=0xc0f3d000 r8=0x00000000 r7=0xc0e9f764
        r6=0x00000002 r5=0xc0ebc7b4 r4=0xc5549000
data_abort_handler+0xc
        scp=0xc08fe01c rlv=0xc08fda24 (address_exception_entry+0x50)
        rsp=0xc0f3ece8 rfp=0xc0f3ed4c
        r10=0xc0ebd268 r9=0x00001000 r8=0x00001000 r7=0x0000000a
        r6=0x0000000c r5=0xc5549000 r4=0x00000010
poison_mem+0xc
        scp=0xc0835b04 rlv=0xc081de6c (malloc+0x2ec)
        rsp=0xc0f3ed50 rfp=0xc0f3edb8
        r5=0xc5549000 r4=0xc5549000
malloc+0x10
        scp=0xc081db90 rlv=0xc0808a98 (ehci_init+0x184)
        rsp=0xc0f3edbc rfp=0xc0f3edf4
        r10=0xc5548294 r9=0xc5548000 r8=0x00000000 r7=0xc553d0c0
        r6=0xc5548014 r5=0xc5548000 r4=0xc0eb9ebc
ehci_init+0x10
        scp=0xc0808924 rlv=0xc0931f94 (sxiehci_attach+0x110)
        rsp=0xc0f3edf8 rfp=0xc0f3ee18
        r10=0x00000000 r9=0xc0f3ee5c r8=0xc0ec0290 r7=0xc553d0c0
        r6=0xc5548014 r5=0xc5548000 r4=0x00000000
sxiehci_attach+0x10
        scp=0xc0931e94 rlv=0xc083092c (config_attach+0x1d4)
        rsp=0xc0f3ee1c rfp=0xc0f3ee54
        r6=0xc0970778 r5=0xc5548014 r4=0xc5548000
config_attach+0xc
        scp=0xc0830764 rlv=0xc0906a6c (armv7_attach+0x144)
        rsp=0xc0f3ee58 rfp=0xc0f3ee90
        r10=0x00000000 r9=0xc0f3eed0 r8=0xc0e74534 r7=0xc553d0c0
        r6=0xc0e79ac4 r5=0xc0e76b2c r4=0xc0e76628
armv7_attach+0x10
        scp=0xc0906938 rlv=0xc083092c (config_attach+0x1d4)
        rsp=0xc0f3ee94 rfp=0xc0f3eecc
        r8=0xc0ec0290 r7=0xc553d000 r6=0xc0e78c40 r5=0xc553d0d4
        r4=0xc553d0c0
config_attach+0xc
        scp=0xc0830764 rlv=0xc08f80fc (mainbussearch+0x54)
        rsp=0xc0f3eed0 rfp=0xc0f3eef4
        r10=0x00000000 r9=0x00000000 r8=0xc0e727e4 r7=0xc0f3eed0
        r6=0xc553d000 r5=0xc0970468 r4=0xc0e78c2c
mainbussearch+0xc
        scp=0xc08f80b4 rlv=0xc0830518 (config_scan+0x13c)
        rsp=0xc0f3eef8 rfp=0xc0f3ef1c
        r7=0xc0970468 r6=0xc0970468 r5=0xc553d000 r4=0xc0f3ef20
config_scan+0xf4
        scp=0xc08304d0 rlv=0xc0830738 (config_search+0x11c)
        rsp=0xc0f3ef20 rfp=0xc0f3ef58
        r8=0xc0ec0290 r7=0xc0970168 r6=0xc0970468 r5=0xc553d000
        r4=0xc0970154
config_search+0x10
        scp=0xc083062c rlv=0xc083092c (config_attach+0x1d4)
        rsp=0xc0f3ef5c rfp=0xc0f3ef94
        r7=0x00000000 r6=0xc0e74388 r5=0xc553d014 r4=0xc553d000
config_attach+0xc
        scp=0xc0830764 rlv=0xc0907aec (cpu_configure+0x20)
        rsp=0xc0f3ef98 rfp=0xc0f3efa8
        r10=0xc0ebc7b4 r9=0xc0ebd6cc r8=0xc0ebc94c r7=0xc0ebc638
        r6=0x00000000 r5=0xc0ebc5b4 r4=0xc0edfe9c
cpu_configure+0xc
        scp=0xc0907ad8 rlv=0xc0815408 (main+0x340)
        rsp=0xc0f3efac rfp=0xc0f3efec
main+0x10
        scp=0xc08150d8 rlv=0xc080017c (kernel_text+0x4c)
        rsp=0xc0f3eff0 rfp=0xc0f3effc
        r10=0x7ffb9eac r9=0x7fb65f0c r8=0x40000100 r7=0x000010bb
        r6=0x40000100 r5=0x000010bb r4=0x40800120
kernel_text+0x48
        scp=0xc0800178 rlv=0xc09076c0 (initarm+0x820)
        rsp=0xc0f3f000 rfp=0x00000000
ddb> ps
   PID   PPID   PGRP    UID  S       FLAGS  WAIT          COMMAND
*    0     -1      0      0  7     0x10200                swapper
ddb>


[case 2]
U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
Board: Bananapi
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600


U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Board: Bananapi
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   dwmac.1c50000
Hit any key to stop autoboot:  0
reading uEnv.txt
116 bytes read in 16 ms (6.8 KiB/s)
Loaded environment from uEnv.txt
Running uenvcmd ...
reading bsd.umg
7386496 bytes read in 364 ms (19.4 MiB/s)
## Booting kernel from Legacy Image at 60000000 ...
   Image Name:   boot
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    7386432 Bytes = 7 MiB
   Load Address: 40800000
   Entry Point:  40800000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...


OpenBSD/sunxi booting ...
arg0 0x0 arg1 0x10bb arg2 0x40000100
atag core flags 0 pagesize 0 rootdev 0
atag cmdline [sd0i:/bsd;]
atag mem start 0x40000000 size 0x40000000
bootfile: sd0i:/bsd;
bootargs:
memory size derived from u-boot
bootconf.mem[0].address = 40000000 pages 262144/0x40000000
Allocating page tables
freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
IRQ stack: p0x40f3a000 v0xc0f3a000
ABT stack: p0x40f3b000 v0xc0f3b000
UND stack: p0x40f3c000 v0xc0f3c000
SVC stack: p0x40f3d000 v0xc0f3d000
Creating L1 page table at 0x40f0c000
Mapping kernel
Constructing L2 page tables
undefined page pmap [ using 170664 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 5.6-current (RAMDISK-SUNXI) #0: Sun Oct  5 13:50:18 AEDT 2014
    [hidden email]:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
real mem  = 1073741824 (1024MB)
avail mem = 1036165120 (988MB)
warning: no entropy supplied by boot loader
mainbus0 at root
cortex0 at mainbus0
ampintc0 at cortex0 nirq 160
cpu0 at mainbus0: ARM Cortex A7 rev 4 (ARMv7 core)
cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu0: 32KB(32b/l,2way) I-cache, 32KB(64b/l,4way) wr-back D-cache
sunxi0 at mainbus0: A20
sxipio0 at sunxi0
sxiccmu0 at sunxi0
sxitimer0 at sunxi0: ticktimer 100hz @ 32KHz
sxitimer1 at sunxi0: stattimer 128hz @ 32KHz
sxitimer2 at sunxi0: cntrtimer @ 32KHz
sxidog0 at sunxi0
sxirtc0 at sunxi0
sxiuart0 at sunxi0: console
sxiuart1 at sunxi0
sxiuart2 at sunxi0
sxiuart3 at sunxi0
sxiuart4 at sunxi0
sxiuart5 at sunxi0
sxiuart6 at sunxi0
sxiuart7 at sunxi0
sxie0 at sunxi0, address 02:99:03:c2:d2:6e
ukphy0 at sxie0 phy 0: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
ukphy1 at sxie0 phy 1: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
ahci0 at sunxi0 AHCI 1.1
scsibus0 at ahci0: 32 targets
ehci0 at sunxi0
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
ehci1 at sunxi0
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
(hang up here)

Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

Jonathan Gray-11
On Mon, Oct 06, 2014 at 05:10:58AM +0900, SASANO Takayoshi wrote:

> Hi,
>
> > I've put up a recently built ramdisk with the l1 pte change here:
> > http://jsg.id.au/openbsd/bsd.rd.SUNXI.umg
>
> Thanks but not worked...
>
> And, Ethernet PHY(RTL8211E) is recognized as ukphy.
> I heard that the power of PHY is controlled by GPIO PH23.
> (see http://www.srchack.org/article.php?story=20140501232036142
> it is written in Japanese but maybe good hint)

The phy would be recognised as rgephy(4) if the driver
were compiled in.

The GPIO phy enable quirk aside it isn't clear if the 'gmac'
style ethernet needs a different driver to 'emac'.

The sxie(4) driver does not have a match routine it just
blindly attaches...

Did you try disabling ehci to see if that makes a difference?

Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

SASANO Takayoshi
Hi,

> Did you try disabling ehci to see if that makes a difference?

Curiously, -c option in bootargs seems to be ignored.
I tried it both uEnv.txt and U-Boot console. Here is the log.
There is no problem to pass "-c" string to kernel.
What is happening?

Regards,

----
U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
Board: Bananapi
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600


U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Board: Bananapi
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   dwmac.1c50000
Hit any key to stop autoboot:  0
sun7i# setenv bootargs "sd0i:/bsd -c"
sun7i# printenv
autoboot=run loadkernel && run setargs && true && bootm 0x48000000
baudrate=115200
boot_ram=saved_stdout=$stdout;setenv stdout nc;if iminfo 0x41000000; then true; setenv stdout $saved_stdout; source 0x41000000;else setenv stdout $saved_stdout;fi
bootargs=sd0i:/bsd -c
bootcmd=if run loadbootenv; then echo Loaded environment from ${bootenv};env import -t ${scriptaddr} ${filesize};fi;if test -n "${uenvcmd}"; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadbootscr; then echo Jumping to ${bootscr};source ${scriptaddr};fi;run autoboot;
bootdelay=2
bootenv=uEnv.txt
bootm_size=0x10000000
bootscr=boot.scr
console=ttyS0,115200
device=mmc
ethact=dwmac.1c50000
ethaddr=02:99:03:c2:d2:6e
kernel=uImage
loadbootenv=fatload $device $partition $scriptaddr ${bootenv} || ext2load $device $partition $scriptaddr boot/${bootenv} || ext2load $device $partition $scriptaddr ${bootenv}
loadbootscr=fatload $device $partition $scriptaddr ${bootscr} || ext2load $device $partition $scriptaddr boot/${bootscr} ||ext2load $device $partition $scriptaddr ${bootscr}
loadkernel=if bootpath=/boot/ && ext2load $device $partition 0x43000000 ${bootpath}${script} && ext2load $device $partition 0x48000000 ${bootpath}${kernel};then true; elif bootpath=/ && fatload $device $partition 0x43000000 ${script} && fatload $device $partition 0x48000000 ${kernel};then true; elif bootpath=/ && ext2load $device $partition 0x43000000 ${bootpath}${script} && ext2load $device $partition 0x48000000 ${bootpath}${kernel};then true; else false;fi
loglevel=8
panicarg=panic=10
partition=0:1
script=script.bin
scriptaddr=0x44000000
setargs=if test -z \\"$root\\"; then if test \\"$bootpath\\" = "/boot/"; then root="/dev/mmcblk0p1 rootwait"; else root="/dev/mmcblk0p2 rootwait"; fi; fi; setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extraargs}
stderr=serial
stdin=serial
stdout=serial

Environment size: 1943/131068 bytes
sun7i# mmc rescan
sun7i# fatload mmc 0 0x60000000 bsd.umg
reading bsd.umg
7386496 bytes read in 364 ms (19.4 MiB/s)
sun7i# bootm 0x60000000
## Booting kernel from Legacy Image at 60000000 ...
   Image Name:   boot
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    7386432 Bytes = 7 MiB
   Load Address: 40800000
   Entry Point:  40800000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...


OpenBSD/sunxi booting ...
arg0 0x0 arg1 0x10bb arg2 0x40000100
atag core flags 0 pagesize 0 rootdev 0
atag cmdline [sd0i:/bsd -c]
atag mem start 0x40000000 size 0x40000000
bootfile: sd0i:/bsd
bootargs: -c
memory size derived from u-boot
bootconf.mem[0].address = 40000000 pages 262144/0x40000000
Allocating page tables
freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
IRQ stack: p0x40f3a000 v0xc0f3a000
ABT stack: p0x40f3b000 v0xc0f3b000
UND stack: p0x40f3c000 v0xc0f3c000
SVC stack: p0x40f3d000 v0xc0f3d000
Creating L1 page table at 0x40f0c000
Mapping kernel
Constructing L2 page tables
undefined page pmap [ using 170664 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org

kernel does not support -c; continuing..
OpenBSD 5.6-current (RAMDISK-SUNXI) #0: Sun Oct  5 13:50:18 AEDT 2014
    [hidden email]:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
real mem  = 1073741824 (1024MB)
avail mem = 1036165120 (988MB)
warning: no entropy supplied by boot loader
mainbus0 at root
cortex0 at mainbus0
ampintc0 at cortex0 nirq 160
cpu0 at mainbus0: ARM Cortex A7 rev 4 (ARMv7 core)
cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu0: 32KB(32b/l,2way) I-cache, 32KB(64b/l,4way) wr-back D-cache
sunxi0 at mainbus0: A20
sxipio0 at sunxi0
sxiccmu0 at sunxi0
sxitimer0 at sunxi0: ticktimer 100hz @ 32KHz
sxitimer1 at sunxi0: stattimer 128hz @ 32KHz
sxitimer2 at sunxi0: cntrtimer @ 32KHz
sxidog0 at sunxi0
sxirtc0 at sunxi0
sxiuart0 at sunxi0: console
sxiuart1 at sunxi0
sxiuart2 at sunxi0
sxiuart3 at sunxi0
sxiuart4 at sunxi0
sxiuart5 at sunxi0
sxiuart6 at sunxi0
sxiuart7 at sunxi0
sxie0 at sunxi0, address 02:99:03:c2:d2:6e
ukphy0 at sxie0 phy 0: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
ukphy1 at sxie0 phy 1: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
ahci0 at sunxi0 AHCI 1.1
scsibus0 at ahci0: 32 targets
ehci0 at sunxi0
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
ehci1 at sunxi0
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
(hang-up)

--
SASANO Takayoshi <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

SASANO Takayoshi
In reply to this post by Jonathan Gray-11
Hi, here is the log using bsd.SUNXI.umg instead of bsd.rd.SUNXI.img.
(thanks to Theo)

"-c" invokes UKC, but hangs up at there.

--
OpenBSD/sunxi booting ...
arg0 0x0 arg1 0x10bb arg2 0x40000100
atag core flags 0 pagesize 0 rootdev 0
atag cmdline [sd0i:/bsd -c]
atag mem start 0x40000000 size 0x40000000
bootfile: sd0i:/bsd
bootargs: -c
memory size derived from u-boot
bootconf.mem[0].address = 40000000 pages 262144/0x40000000
Allocating page tables
freestart = 0x40b9a000, free_pages = 259174 (0x0003f466)
IRQ stack: p0x40bc8000 v0xc0bc8000
ABT stack: p0x40bc9000 v0xc0bc9000
UND stack: p0x40bca000 v0xc0bca000
SVC stack: p0x40bcb000 v0xc0bcb000
Creating L1 page table at 0x40b9c000
Mapping kernel
Constructing L2 page tables
undefined page pmap [ using 300196 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org

User Kernel Config
UKC>

--
SASANO Takayoshi <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

Jonathan Gray-11
Here are some updated images with the fix
for the interrupt controller on cortex a7/15.
http://marc.info/?l=openbsd-cvs&m=141278003609690&w=2

http://jsg.id.au/openbsd/armv7/bsd.SUNXI.umg
http://jsg.id.au/openbsd/armv7/bsd.rd.SUNXI.umg

Though it sounds like A20/sun7i handles the
timer in a different way to A10/sun4i, and there
is no driver in the tree for the 'gmac' Ethernet.

On Wed, Oct 08, 2014 at 11:11:48AM +0900, SASANO Takayoshi wrote:

> Hi, here is the log using bsd.SUNXI.umg instead of bsd.rd.SUNXI.img.
> (thanks to Theo)
>
> "-c" invokes UKC, but hangs up at there.
>
> --
> OpenBSD/sunxi booting ...
> arg0 0x0 arg1 0x10bb arg2 0x40000100
> atag core flags 0 pagesize 0 rootdev 0
> atag cmdline [sd0i:/bsd -c]
> atag mem start 0x40000000 size 0x40000000
> bootfile: sd0i:/bsd
> bootargs: -c
> memory size derived from u-boot
> bootconf.mem[0].address = 40000000 pages 262144/0x40000000
> Allocating page tables
> freestart = 0x40b9a000, free_pages = 259174 (0x0003f466)
> IRQ stack: p0x40bc8000 v0xc0bc8000
> ABT stack: p0x40bc9000 v0xc0bc9000
> UND stack: p0x40bca000 v0xc0bca000
> SVC stack: p0x40bcb000 v0xc0bcb000
> Creating L1 page table at 0x40b9c000
> Mapping kernel
> Constructing L2 page tables
> undefined page pmap [ using 300196 bytes of bsd ELF symbol table ]
> Copyright (c) 1982, 1986, 1989, 1991, 1993
> The Regents of the University of California.  All rights reserved.
> Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org
>
> User Kernel Config
> UKC>
>
> --
> SASANO Takayoshi <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

SASANO Takayoshi
Hello,

Here is the log of new image.
Booting with "-c" option, UKC still hangs up.

I hope the log helps debugging.

Regards,

--
SASANO Takayoshi <[hidden email]>

U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
Board: Bananapi
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600


U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Board: Bananapi
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   dwmac.1c50000
Hit any key to stop autoboot:  0
reading uEnv.txt
118 bytes read in 16 ms (6.8 KiB/s)
Loaded environment from uEnv.txt
Running uenvcmd ...
reading bsd.umg
7386560 bytes read in 364 ms (19.4 MiB/s)
## Booting kernel from Legacy Image at 60000000 ...
   Image Name:   boot
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    7386496 Bytes = 7 MiB
   Load Address: 40800000
   Entry Point:  40800000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...


OpenBSD/sunxi booting ...
arg0 0x0 arg1 0x10bb arg2 0x40000100
atag core flags 0 pagesize 0 rootdev 0
atag cmdline [sd0i:/bsd -c]
atag mem start 0x40000000 size 0x40000000
bootfile: sd0i:/bsd
bootargs: -c
memory size derived from u-boot
bootconf.mem[0].address = 40000000 pages 262144/0x40000000
Allocating page tables
freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
IRQ stack: p0x40f3a000 v0xc0f3a000
ABT stack: p0x40f3b000 v0xc0f3b000
UND stack: p0x40f3c000 v0xc0f3c000
SVC stack: p0x40f3d000 v0xc0f3d000
Creating L1 page table at 0x40f0c000
Mapping kernel
Constructing L2 page tables
undefined page pmap [ using 170728 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org

kernel does not support -c; continuing..
OpenBSD 5.6-current (RAMDISK-SUNXI) #1: Thu Oct  9 21:03:32 AEDT 2014
    [hidden email]:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
real mem  = 1073741824 (1024MB)
avail mem = 1036165120 (988MB)
warning: no entropy supplied by boot loader
mainbus0 at root
cortex0 at mainbus0
ampintc0 at cortex0 nirq 160
cpu0 at mainbus0: ARM Cortex A7 rev 4 (ARMv7 core)
cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu0: 32KB(32b/l,2way) I-cache, 32KB(64b/l,4way) wr-back D-cache
sunxi0 at mainbus0: A20
sxipio0 at sunxi0
sxiccmu0 at sunxi0
sxitimer0 at sunxi0: ticktimer 100hz @ 32KHz
sxitimer1 at sunxi0: stattimer 128hz @ 32KHz
sxitimer2 at sunxi0: cntrtimer @ 32KHz
sxidog0 at sunxi0
sxirtc0 at sunxi0
sxiuart0 at sunxi0: console
sxiuart1 at sunxi0
sxiuart2 at sunxi0
sxiuart3 at sunxi0
sxiuart4 at sunxi0
sxiuart5 at sunxi0
sxiuart6 at sunxi0
sxiuart7 at sunxi0
sxie0 at sunxi0, address 02:99:03:c2:d2:6e
ukphy0 at sxie0 phy 0: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
ukphy1 at sxie0 phy 1: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
ahci0 at sunxi0 AHCI 1.1
pmap_fault_fixup: va c5544000 ftype 2 s pte 7ff9301e
panic: uvm_fault: fault on non-pageable map (0xc0e7f28c, 0xc5544000)
Stopped at      Debugger+0x4:   ldrb    r15, [r15, r15, ror r15]!
panic+0x18
        scp=0xc083a39c rlv=0xc08c2f54 (uvm_fault+0xca8)
        rsp=0xc0f3eaec rfp=0xc0f3ec0c
uvm_fault+0xc
        scp=0xc08c22b8 rlv=0xc08fe588 (data_abort_handler+0x248)
        rsp=0xc0f3ec10 rfp=0xc0f3ec64
        r10=0xc0f3ec68 r9=0xc0f3d000 r8=0x00000000 r7=0xc0e9f764
        r6=0x00000002 r5=0xc0ebc7b4 r4=0xc5544000
data_abort_handler+0xc
        scp=0xc08fe34c rlv=0xc08fdd54 (address_exception_entry+0x50)
        rsp=0xc0f3ec68 rfp=0xc0f3eccc
        r10=0xc0ebd1b4 r9=0x00000200 r8=0x0000014c r7=0x0000000a
        r6=0x00000009 r5=0xc5544e00 r4=0x00000010
poison_mem+0xc
        scp=0xc0835bb8 rlv=0xc081df20 (malloc+0x2ec)
        rsp=0xc0f3ecd0 rfp=0xc0f3ed38
        r5=0xc5544000 r4=0xc5544e00
malloc+0x10
        scp=0xc081dc44 rlv=0xc08fcee8 (_bus_dmamap_create+0x40)
        rsp=0xc0f3ed3c rfp=0xc0f3ed5c
        r10=0x00000000 r9=0x7ff97000 r8=0x00000000 r7=0x00000003
        r6=0x00010000 r5=0x00400000 r4=0x00000018
_bus_dmamap_create+0x10
        scp=0xc08fceb8 rlv=0xc0804384 (ahci_port_alloc+0x34c)
        rsp=0xc0f3ed60 rfp=0xc0f3edb0
        r7=0xc553b300 r6=0xc548a200 r5=0xc5542000 r4=0x00000000
ahci_port_alloc+0x10
        scp=0xc0804048 rlv=0xc0804814 (ahci_attach+0x80)
        rsp=0xc0f3edb4 rfp=0xc0f3ede8
        r10=0xc0f3ee5c r9=0xc0f3ee5c r8=0x00000000 r7=0xc553b300
        r6=0xc553b300 r5=0x00000001 r4=0x00000000
ahci_attach+0xc
        scp=0xc08047a0 rlv=0xc0931fb0 (sxiahci_attach+0x480)
        rsp=0xc0f3edec rfp=0xc0f3ee18
        r6=0xc0904420 r5=0x00000000 r4=0xd1135000
sxiahci_attach+0x10
        scp=0xc0931b40 rlv=0xc08309e0 (config_attach+0x1d4)
        rsp=0xc0f3ee1c rfp=0xc0f3ee54
        r10=0x00000000 r8=0xc0ec0290 r7=0xc553d0c0 r6=0xc0970750
        r5=0xc553b314 r4=0xc553b300
config_attach+0xc
        scp=0xc0830818 rlv=0xc0906d9c (armv7_attach+0x144)
        rsp=0xc0f3ee58 rfp=0xc0f3ee90
        r10=0x00000000 r9=0xc0f3eed0 r8=0xc0e74534 r7=0xc553d0c0
        r6=0xc0e79a6c r5=0xc0e76b24 r4=0xc0e76628
RUN AT LEAST 'trace' AND 'ps' AND INCLUDE OUTPUT WHEN REPORTING THIS PANIC!
DO NOT EVEN BOTHER REPORTING THIS WITHOUT INCLUDING THAT INFORMATION!
ddb> trace
panic+0x18
        scp=0xc083a39c rlv=0xc08c2f54 (uvm_fault+0xca8)
        rsp=0xc0f3eaec rfp=0xc0f3ec0c
uvm_fault+0xc
        scp=0xc08c22b8 rlv=0xc08fe588 (data_abort_handler+0x248)
        rsp=0xc0f3ec10 rfp=0xc0f3ec64
        r10=0xc0f3ec68 r9=0xc0f3d000 r8=0x00000000 r7=0xc0e9f764
        r6=0x00000002 r5=0xc0ebc7b4 r4=0xc5544000
data_abort_handler+0xc
        scp=0xc08fe34c rlv=0xc08fdd54 (address_exception_entry+0x50)
        rsp=0xc0f3ec68 rfp=0xc0f3eccc
        r10=0xc0ebd1b4 r9=0x00000200 r8=0x0000014c r7=0x0000000a
        r6=0x00000009 r5=0xc5544e00 r4=0x00000010
poison_mem+0xc
        scp=0xc0835bb8 rlv=0xc081df20 (malloc+0x2ec)
        rsp=0xc0f3ecd0 rfp=0xc0f3ed38
        r5=0xc5544000 r4=0xc5544e00
malloc+0x10
        scp=0xc081dc44 rlv=0xc08fcee8 (_bus_dmamap_create+0x40)
        rsp=0xc0f3ed3c rfp=0xc0f3ed5c
        r10=0x00000000 r9=0x7ff97000 r8=0x00000000 r7=0x00000003
        r6=0x00010000 r5=0x00400000 r4=0x00000018
_bus_dmamap_create+0x10
        scp=0xc08fceb8 rlv=0xc0804384 (ahci_port_alloc+0x34c)
        rsp=0xc0f3ed60 rfp=0xc0f3edb0
        r7=0xc553b300 r6=0xc548a200 r5=0xc5542000 r4=0x00000000
ahci_port_alloc+0x10
        scp=0xc0804048 rlv=0xc0804814 (ahci_attach+0x80)
        rsp=0xc0f3edb4 rfp=0xc0f3ede8
        r10=0xc0f3ee5c r9=0xc0f3ee5c r8=0x00000000 r7=0xc553b300
        r6=0xc553b300 r5=0x00000001 r4=0x00000000
ahci_attach+0xc
        scp=0xc08047a0 rlv=0xc0931fb0 (sxiahci_attach+0x480)
        rsp=0xc0f3edec rfp=0xc0f3ee18
        r6=0xc0904420 r5=0x00000000 r4=0xd1135000
sxiahci_attach+0x10
        scp=0xc0931b40 rlv=0xc08309e0 (config_attach+0x1d4)
        rsp=0xc0f3ee1c rfp=0xc0f3ee54
        r10=0x00000000 r8=0xc0ec0290 r7=0xc553d0c0 r6=0xc0970750
        r5=0xc553b314 r4=0xc553b300
config_attach+0xc
        scp=0xc0830818 rlv=0xc0906d9c (armv7_attach+0x144)
        rsp=0xc0f3ee58 rfp=0xc0f3ee90
        r10=0x00000000 r9=0xc0f3eed0 r8=0xc0e74534 r7=0xc553d0c0
        r6=0xc0e79a6c r5=0xc0e76b24 r4=0xc0e76628
armv7_attach+0x10
        scp=0xc0906c68 rlv=0xc08309e0 (config_attach+0x1d4)
        rsp=0xc0f3ee94 rfp=0xc0f3eecc
        r8=0xc0ec0290 r7=0xc553d000 r6=0xc0e78c40 r5=0xc553d0d4
        r4=0xc553d0c0
config_attach+0xc
        scp=0xc0830818 rlv=0xc08f83fc (mainbussearch+0x54)
        rsp=0xc0f3eed0 rfp=0xc0f3eef4
        r10=0x00000000 r9=0x00000000 r8=0xc0e727e4 r7=0xc0f3eed0
        r6=0xc553d000 r5=0xc0970468 r4=0xc0e78c2c
mainbussearch+0xc
        scp=0xc08f83b4 rlv=0xc08305cc (config_scan+0x13c)
        rsp=0xc0f3eef8 rfp=0xc0f3ef1c
        r7=0xc0970468 r6=0xc0970468 r5=0xc553d000 r4=0xc0f3ef20
config_scan+0xf4
        scp=0xc0830584 rlv=0xc08307ec (config_search+0x11c)
        rsp=0xc0f3ef20 rfp=0xc0f3ef58
        r8=0xc0ec0290 r7=0xc0970168 r6=0xc0970468 r5=0xc553d000
        r4=0xc0970154
config_search+0x10
        scp=0xc08306e0 rlv=0xc08309e0 (config_attach+0x1d4)
        rsp=0xc0f3ef5c rfp=0xc0f3ef94
        r7=0x00000000 r6=0xc0e74388 r5=0xc553d014 r4=0xc553d000
config_attach+0xc
        scp=0xc0830818 rlv=0xc0907e1c (cpu_configure+0x20)
        rsp=0xc0f3ef98 rfp=0xc0f3efa8
        r10=0xc0ebc7b4 r9=0xc0ebd6cc r8=0xc0ebc94c r7=0xc0ebc638
        r6=0x00000000 r5=0xc0ebc5b4 r4=0xc0edfe9c
cpu_configure+0xc
        scp=0xc0907e08 rlv=0xc081548c (main+0x340)
        rsp=0xc0f3efac rfp=0xc0f3efec
main+0x10
        scp=0xc081515c rlv=0xc080017c (kernel_text+0x4c)
        rsp=0xc0f3eff0 rfp=0xc0f3effc
        r10=0x7ffb9eac r9=0x7fb65f0c r8=0x40000100 r7=0x000010bb
        r6=0x40000100 r5=0x000010bb r4=0x40800120
kernel_text+0x48
        scp=0xc0800178 rlv=0xc09079f0 (initarm+0x820)
        rsp=0xc0f3f000 rfp=0x00000000
ddb> ps
   PID   PPID   PGRP    UID  S       FLAGS  WAIT          COMMAND
*    0     -1      0      0  7     0x10200                swapper
ddb>


--------
U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
Board: Bananapi
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600


U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Board: Bananapi
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   dwmac.1c50000
Hit any key to stop autoboot:  0
reading uEnv.txt
118 bytes read in 16 ms (6.8 KiB/s)
Loaded environment from uEnv.txt
Running uenvcmd ...
reading bsd.umg
3772616 bytes read in 203 ms (17.7 MiB/s)
## Booting kernel from Legacy Image at 60000000 ...
   Image Name:   boot
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3772552 Bytes = 3.6 MiB
   Load Address: 40800000
   Entry Point:  40800000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...


OpenBSD/sunxi booting ...
arg0 0x0 arg1 0x10bb arg2 0x40000100
atag core flags 0 pagesize 0 rootdev 0
atag cmdline [sd0i:/bsd -c]
atag mem start 0x40000000 size 0x40000000
bootfile: sd0i:/bsd
bootargs: -c
memory size derived from u-boot
bootconf.mem[0].address = 40000000 pages 262144/0x40000000
Allocating page tables
freestart = 0x40b9a000, free_pages = 259174 (0x0003f466)
IRQ stack: p0x40bc8000 v0xc0bc8000
ABT stack: p0x40bc9000 v0xc0bc9000
UND stack: p0x40bca000 v0xc0bca000
SVC stack: p0x40bcb000 v0xc0bcb000
Creating L1 page table at 0x40b9c000
Mapping kernel
Constructing L2 page tables
undefined page pmap [ using 300260 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org

User Kernel Config
UKC>
(hang-up here)

Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

Patrick Wildt-2
I do believe that this is a pmap issue.

I just got hands on an Allwinner A20 and suffered the same issues:
pool_setlowat crashing randomly, same for ahci and so on.

I believe we are not syncing the PTEs correctly.

Here’s the snippet from PTE_SYNC(), but PTE_SYNC_RANGE() has
the same issue:

#define PTE_SYNC(pte) \
do { \
        if (PMAP_NEEDS_PTE_SYNC) { \
                paddr_t pa; \
                cpu_drain_writebuf(); \
                cpu_dcache_wb_range((vaddr_t)(pte), sizeof(pt_entry_t));\
                if (cpu_sdcache_enabled()) { \
                (void)pmap_extract(pmap_kernel(), (vaddr_t)(pte), &pa); \
                cpu_sdcache_wb_range((vaddr_t)(pte), (paddr_t)(pa), \
                    sizeof(pt_entry_t)); \
                }; \
                cpu_drain_writebuf(); \
        } \
} while (/*CONSTCOND*/0)

I believe that when we change things in the pagetables, we need to make
sure the tables are synced before we’re going to use them.  In our case
we believe that we are using uncached pagetables, which means that
every write will directly hit the tables.

But that does not have an affect on the write buffer.  The write buffer is still
there and has to be cleared manually.  If it isn’t, and something accesses
an area which was just mapped, then we’re fucked.

Therefore I firmly believe that the cpu_drain_writebuf() call has to be made
regardless of PMAP_NEEDS_PTE_SYNC and that it has to be called before
that if-clause.

Doing that fixes my issues.

\Patrick

> Am 09.10.2014 um 22:55 schrieb SASANO Takayoshi <[hidden email]>:
>
> Hello,
>
> Here is the log of new image.
> Booting with "-c" option, UKC still hangs up.
>
> I hope the log helps debugging.
>
> Regards,
>
> --
> SASANO Takayoshi <[hidden email]>
>
> U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
> Board: Bananapi
> DRAM: 1024 MiB
> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
> spl: not an uImage at 1600
>
>
> U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology
>
> CPU:   Allwinner A20 (SUN7I)
> Board: Bananapi
> I2C:   ready
> DRAM:  1 GiB
> MMC:   SUNXI SD/MMC: 0
> *** Warning - bad CRC, using default environment
>
> In:    serial
> Out:   serial
> Err:   serial
> Net:   dwmac.1c50000
> Hit any key to stop autoboot:  0
> reading uEnv.txt
> 118 bytes read in 16 ms (6.8 KiB/s)
> Loaded environment from uEnv.txt
> Running uenvcmd ...
> reading bsd.umg
> 7386560 bytes read in 364 ms (19.4 MiB/s)
> ## Booting kernel from Legacy Image at 60000000 ...
>   Image Name:   boot
>   Image Type:   ARM Linux Kernel Image (uncompressed)
>   Data Size:    7386496 Bytes = 7 MiB
>   Load Address: 40800000
>   Entry Point:  40800000
>   Verifying Checksum ... OK
>   Loading Kernel Image ... OK
>
> Starting kernel ...
>
>
> OpenBSD/sunxi booting ...
> arg0 0x0 arg1 0x10bb arg2 0x40000100
> atag core flags 0 pagesize 0 rootdev 0
> atag cmdline [sd0i:/bsd -c]
> atag mem start 0x40000000 size 0x40000000
> bootfile: sd0i:/bsd
> bootargs: -c
> memory size derived from u-boot
> bootconf.mem[0].address = 40000000 pages 262144/0x40000000
> Allocating page tables
> freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
> IRQ stack: p0x40f3a000 v0xc0f3a000
> ABT stack: p0x40f3b000 v0xc0f3b000
> UND stack: p0x40f3c000 v0xc0f3c000
> SVC stack: p0x40f3d000 v0xc0f3d000
> Creating L1 page table at 0x40f0c000
> Mapping kernel
> Constructing L2 page tables
> undefined page pmap [ using 170728 bytes of bsd ELF symbol table ]
> Copyright (c) 1982, 1986, 1989, 1991, 1993
> The Regents of the University of California.  All rights reserved.
> Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org
>
> kernel does not support -c; continuing..
> OpenBSD 5.6-current (RAMDISK-SUNXI) #1: Thu Oct  9 21:03:32 AEDT 2014
>    [hidden email]:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
> real mem  = 1073741824 (1024MB)
> avail mem = 1036165120 (988MB)
> warning: no entropy supplied by boot loader
> mainbus0 at root
> cortex0 at mainbus0
> ampintc0 at cortex0 nirq 160
> cpu0 at mainbus0: ARM Cortex A7 rev 4 (ARMv7 core)
> cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
> cpu0: 32KB(32b/l,2way) I-cache, 32KB(64b/l,4way) wr-back D-cache
> sunxi0 at mainbus0: A20
> sxipio0 at sunxi0
> sxiccmu0 at sunxi0
> sxitimer0 at sunxi0: ticktimer 100hz @ 32KHz
> sxitimer1 at sunxi0: stattimer 128hz @ 32KHz
> sxitimer2 at sunxi0: cntrtimer @ 32KHz
> sxidog0 at sunxi0
> sxirtc0 at sunxi0
> sxiuart0 at sunxi0: console
> sxiuart1 at sunxi0
> sxiuart2 at sunxi0
> sxiuart3 at sunxi0
> sxiuart4 at sunxi0
> sxiuart5 at sunxi0
> sxiuart6 at sunxi0
> sxiuart7 at sunxi0
> sxie0 at sunxi0, address 02:99:03:c2:d2:6e
> ukphy0 at sxie0 phy 0: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
> ukphy1 at sxie0 phy 1: Generic IEEE 802.3u media interface, rev. 5: OUI 0x000732, model 0x0011
> ahci0 at sunxi0 AHCI 1.1
> pmap_fault_fixup: va c5544000 ftype 2 s pte 7ff9301e
> panic: uvm_fault: fault on non-pageable map (0xc0e7f28c, 0xc5544000)
> Stopped at      Debugger+0x4:   ldrb    r15, [r15, r15, ror r15]!
> panic+0x18
>        scp=0xc083a39c rlv=0xc08c2f54 (uvm_fault+0xca8)
>        rsp=0xc0f3eaec rfp=0xc0f3ec0c
> uvm_fault+0xc
>        scp=0xc08c22b8 rlv=0xc08fe588 (data_abort_handler+0x248)
>        rsp=0xc0f3ec10 rfp=0xc0f3ec64
>        r10=0xc0f3ec68 r9=0xc0f3d000 r8=0x00000000 r7=0xc0e9f764
>        r6=0x00000002 r5=0xc0ebc7b4 r4=0xc5544000
> data_abort_handler+0xc
>        scp=0xc08fe34c rlv=0xc08fdd54 (address_exception_entry+0x50)
>        rsp=0xc0f3ec68 rfp=0xc0f3eccc
>        r10=0xc0ebd1b4 r9=0x00000200 r8=0x0000014c r7=0x0000000a
>        r6=0x00000009 r5=0xc5544e00 r4=0x00000010
> poison_mem+0xc
>        scp=0xc0835bb8 rlv=0xc081df20 (malloc+0x2ec)
>        rsp=0xc0f3ecd0 rfp=0xc0f3ed38
>        r5=0xc5544000 r4=0xc5544e00
> malloc+0x10
>        scp=0xc081dc44 rlv=0xc08fcee8 (_bus_dmamap_create+0x40)
>        rsp=0xc0f3ed3c rfp=0xc0f3ed5c
>        r10=0x00000000 r9=0x7ff97000 r8=0x00000000 r7=0x00000003
>        r6=0x00010000 r5=0x00400000 r4=0x00000018
> _bus_dmamap_create+0x10
>        scp=0xc08fceb8 rlv=0xc0804384 (ahci_port_alloc+0x34c)
>        rsp=0xc0f3ed60 rfp=0xc0f3edb0
>        r7=0xc553b300 r6=0xc548a200 r5=0xc5542000 r4=0x00000000
> ahci_port_alloc+0x10
>        scp=0xc0804048 rlv=0xc0804814 (ahci_attach+0x80)
>        rsp=0xc0f3edb4 rfp=0xc0f3ede8
>        r10=0xc0f3ee5c r9=0xc0f3ee5c r8=0x00000000 r7=0xc553b300
>        r6=0xc553b300 r5=0x00000001 r4=0x00000000
> ahci_attach+0xc
>        scp=0xc08047a0 rlv=0xc0931fb0 (sxiahci_attach+0x480)
>        rsp=0xc0f3edec rfp=0xc0f3ee18
>        r6=0xc0904420 r5=0x00000000 r4=0xd1135000
> sxiahci_attach+0x10
>        scp=0xc0931b40 rlv=0xc08309e0 (config_attach+0x1d4)
>        rsp=0xc0f3ee1c rfp=0xc0f3ee54
>        r10=0x00000000 r8=0xc0ec0290 r7=0xc553d0c0 r6=0xc0970750
>        r5=0xc553b314 r4=0xc553b300
> config_attach+0xc
>        scp=0xc0830818 rlv=0xc0906d9c (armv7_attach+0x144)
>        rsp=0xc0f3ee58 rfp=0xc0f3ee90
>        r10=0x00000000 r9=0xc0f3eed0 r8=0xc0e74534 r7=0xc553d0c0
>        r6=0xc0e79a6c r5=0xc0e76b24 r4=0xc0e76628
> RUN AT LEAST 'trace' AND 'ps' AND INCLUDE OUTPUT WHEN REPORTING THIS PANIC!
> DO NOT EVEN BOTHER REPORTING THIS WITHOUT INCLUDING THAT INFORMATION!
> ddb> trace
> panic+0x18
>        scp=0xc083a39c rlv=0xc08c2f54 (uvm_fault+0xca8)
>        rsp=0xc0f3eaec rfp=0xc0f3ec0c
> uvm_fault+0xc
>        scp=0xc08c22b8 rlv=0xc08fe588 (data_abort_handler+0x248)
>        rsp=0xc0f3ec10 rfp=0xc0f3ec64
>        r10=0xc0f3ec68 r9=0xc0f3d000 r8=0x00000000 r7=0xc0e9f764
>        r6=0x00000002 r5=0xc0ebc7b4 r4=0xc5544000
> data_abort_handler+0xc
>        scp=0xc08fe34c rlv=0xc08fdd54 (address_exception_entry+0x50)
>        rsp=0xc0f3ec68 rfp=0xc0f3eccc
>        r10=0xc0ebd1b4 r9=0x00000200 r8=0x0000014c r7=0x0000000a
>        r6=0x00000009 r5=0xc5544e00 r4=0x00000010
> poison_mem+0xc
>        scp=0xc0835bb8 rlv=0xc081df20 (malloc+0x2ec)
>        rsp=0xc0f3ecd0 rfp=0xc0f3ed38
>        r5=0xc5544000 r4=0xc5544e00
> malloc+0x10
>        scp=0xc081dc44 rlv=0xc08fcee8 (_bus_dmamap_create+0x40)
>        rsp=0xc0f3ed3c rfp=0xc0f3ed5c
>        r10=0x00000000 r9=0x7ff97000 r8=0x00000000 r7=0x00000003
>        r6=0x00010000 r5=0x00400000 r4=0x00000018
> _bus_dmamap_create+0x10
>        scp=0xc08fceb8 rlv=0xc0804384 (ahci_port_alloc+0x34c)
>        rsp=0xc0f3ed60 rfp=0xc0f3edb0
>        r7=0xc553b300 r6=0xc548a200 r5=0xc5542000 r4=0x00000000
> ahci_port_alloc+0x10
>        scp=0xc0804048 rlv=0xc0804814 (ahci_attach+0x80)
>        rsp=0xc0f3edb4 rfp=0xc0f3ede8
>        r10=0xc0f3ee5c r9=0xc0f3ee5c r8=0x00000000 r7=0xc553b300
>        r6=0xc553b300 r5=0x00000001 r4=0x00000000
> ahci_attach+0xc
>        scp=0xc08047a0 rlv=0xc0931fb0 (sxiahci_attach+0x480)
>        rsp=0xc0f3edec rfp=0xc0f3ee18
>        r6=0xc0904420 r5=0x00000000 r4=0xd1135000
> sxiahci_attach+0x10
>        scp=0xc0931b40 rlv=0xc08309e0 (config_attach+0x1d4)
>        rsp=0xc0f3ee1c rfp=0xc0f3ee54
>        r10=0x00000000 r8=0xc0ec0290 r7=0xc553d0c0 r6=0xc0970750
>        r5=0xc553b314 r4=0xc553b300
> config_attach+0xc
>        scp=0xc0830818 rlv=0xc0906d9c (armv7_attach+0x144)
>        rsp=0xc0f3ee58 rfp=0xc0f3ee90
>        r10=0x00000000 r9=0xc0f3eed0 r8=0xc0e74534 r7=0xc553d0c0
>        r6=0xc0e79a6c r5=0xc0e76b24 r4=0xc0e76628
> armv7_attach+0x10
>        scp=0xc0906c68 rlv=0xc08309e0 (config_attach+0x1d4)
>        rsp=0xc0f3ee94 rfp=0xc0f3eecc
>        r8=0xc0ec0290 r7=0xc553d000 r6=0xc0e78c40 r5=0xc553d0d4
>        r4=0xc553d0c0
> config_attach+0xc
>        scp=0xc0830818 rlv=0xc08f83fc (mainbussearch+0x54)
>        rsp=0xc0f3eed0 rfp=0xc0f3eef4
>        r10=0x00000000 r9=0x00000000 r8=0xc0e727e4 r7=0xc0f3eed0
>        r6=0xc553d000 r5=0xc0970468 r4=0xc0e78c2c
> mainbussearch+0xc
>        scp=0xc08f83b4 rlv=0xc08305cc (config_scan+0x13c)
>        rsp=0xc0f3eef8 rfp=0xc0f3ef1c
>        r7=0xc0970468 r6=0xc0970468 r5=0xc553d000 r4=0xc0f3ef20
> config_scan+0xf4
>        scp=0xc0830584 rlv=0xc08307ec (config_search+0x11c)
>        rsp=0xc0f3ef20 rfp=0xc0f3ef58
>        r8=0xc0ec0290 r7=0xc0970168 r6=0xc0970468 r5=0xc553d000
>        r4=0xc0970154
> config_search+0x10
>        scp=0xc08306e0 rlv=0xc08309e0 (config_attach+0x1d4)
>        rsp=0xc0f3ef5c rfp=0xc0f3ef94
>        r7=0x00000000 r6=0xc0e74388 r5=0xc553d014 r4=0xc553d000
> config_attach+0xc
>        scp=0xc0830818 rlv=0xc0907e1c (cpu_configure+0x20)
>        rsp=0xc0f3ef98 rfp=0xc0f3efa8
>        r10=0xc0ebc7b4 r9=0xc0ebd6cc r8=0xc0ebc94c r7=0xc0ebc638
>        r6=0x00000000 r5=0xc0ebc5b4 r4=0xc0edfe9c
> cpu_configure+0xc
>        scp=0xc0907e08 rlv=0xc081548c (main+0x340)
>        rsp=0xc0f3efac rfp=0xc0f3efec
> main+0x10
>        scp=0xc081515c rlv=0xc080017c (kernel_text+0x4c)
>        rsp=0xc0f3eff0 rfp=0xc0f3effc
>        r10=0x7ffb9eac r9=0x7fb65f0c r8=0x40000100 r7=0x000010bb
>        r6=0x40000100 r5=0x000010bb r4=0x40800120
> kernel_text+0x48
>        scp=0xc0800178 rlv=0xc09079f0 (initarm+0x820)
>        rsp=0xc0f3f000 rfp=0x00000000
> ddb> ps
>   PID   PPID   PGRP    UID  S       FLAGS  WAIT          COMMAND
> *    0     -1      0      0  7     0x10200                swapper
> ddb>
>
>
> --------
> U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
> Board: Bananapi
> DRAM: 1024 MiB
> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
> spl: not an uImage at 1600
>
>
> U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner Technology
>
> CPU:   Allwinner A20 (SUN7I)
> Board: Bananapi
> I2C:   ready
> DRAM:  1 GiB
> MMC:   SUNXI SD/MMC: 0
> *** Warning - bad CRC, using default environment
>
> In:    serial
> Out:   serial
> Err:   serial
> Net:   dwmac.1c50000
> Hit any key to stop autoboot:  0
> reading uEnv.txt
> 118 bytes read in 16 ms (6.8 KiB/s)
> Loaded environment from uEnv.txt
> Running uenvcmd ...
> reading bsd.umg
> 3772616 bytes read in 203 ms (17.7 MiB/s)
> ## Booting kernel from Legacy Image at 60000000 ...
>   Image Name:   boot
>   Image Type:   ARM Linux Kernel Image (uncompressed)
>   Data Size:    3772552 Bytes = 3.6 MiB
>   Load Address: 40800000
>   Entry Point:  40800000
>   Verifying Checksum ... OK
>   Loading Kernel Image ... OK
>
> Starting kernel ...
>
>
> OpenBSD/sunxi booting ...
> arg0 0x0 arg1 0x10bb arg2 0x40000100
> atag core flags 0 pagesize 0 rootdev 0
> atag cmdline [sd0i:/bsd -c]
> atag mem start 0x40000000 size 0x40000000
> bootfile: sd0i:/bsd
> bootargs: -c
> memory size derived from u-boot
> bootconf.mem[0].address = 40000000 pages 262144/0x40000000
> Allocating page tables
> freestart = 0x40b9a000, free_pages = 259174 (0x0003f466)
> IRQ stack: p0x40bc8000 v0xc0bc8000
> ABT stack: p0x40bc9000 v0xc0bc9000
> UND stack: p0x40bca000 v0xc0bca000
> SVC stack: p0x40bcb000 v0xc0bcb000
> Creating L1 page table at 0x40b9c000
> Mapping kernel
> Constructing L2 page tables
> undefined page pmap [ using 300260 bytes of bsd ELF symbol table ]
> Copyright (c) 1982, 1986, 1989, 1991, 1993
> The Regents of the University of California.  All rights reserved.
> Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org
>
> User Kernel Config
> UKC>
> (hang-up here)
>


Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

SASANO Takayoshi
Hello,

Theo gave a hint to check early console code and I found something curious.
Here is a diff to printf debug...

Index: sxiuart.c
===================================================================
RCS file: /cvs/src/sys/arch/armv7/sunxi/sxiuart.c,v
retrieving revision 1.3
diff -u -p -r1.3 sxiuart.c
--- sxiuart.c 6 Nov 2013 19:03:07 -0000 1.3
+++ sxiuart.c 18 Oct 2014 20:39:38 -0000
@@ -971,15 +971,18 @@ sxiuartcngetc(dev_t dev)
  uint8_t c;
 
  s = splhigh();
-
+bus_space_write_1(sxiuartconsiot, sxiuartconsioh, SXIUART_THR, 'a');
  while (!ISSET(bus_space_read_1(sxiuartconsiot, sxiuartconsioh,
     SXIUART_LSR), LSR_RXRDY))
  continue;
+bus_space_write_1(sxiuartconsiot, sxiuartconsioh, SXIUART_THR, 'b');
  c = bus_space_read_1(sxiuartconsiot, sxiuartconsioh, SXIUART_RBR);
 
  /* clear any pending interrupts */
+bus_space_write_1(sxiuartconsiot, sxiuartconsioh, SXIUART_THR, 'c');
  (void)bus_space_read_1(sxiuartconsiot, sxiuartconsioh, SXIUART_IIR);
 
+bus_space_write_1(sxiuartconsiot, sxiuartconsioh, SXIUART_THR, 'd');
  splx(s);
  return (c);
 }


UKC stalls at polling LSR_RXRDY flag.

  User Kernel Config
  UKC> a

but ddb works no problem.

  panic: uvm_fault: fault on non-pageable map (0xc0af328c, 0xc55aa000)
  Stopped at      0xc0a1d4ac:     ldrb    r15, [r15, r15, ror r15]!
  RUN AT LEAST 'trace' AND 'ps' AND INCLUDE OUTPUT WHEN REPORTING THIS PANIC!
  DO NOT EVEN BOTHER REPORTING THIS WITHOUT INCLUDING THAT INFORMATION!
  ddb>abd

I think sxiuartcngetc() have no problem and something makes worse.
Do I have to check page table (memory attribute of ARMv7 MMU)
when running UKC?

--
SASANO Takayoshi <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

Raphael Graf-2
In reply to this post by Patrick Wildt-2
On Thu, October 16, 2014 11:40 pm, Patrick Wildt wrote:

> I do believe that this is a pmap issue.
>
> I just got hands on an Allwinner A20 and suffered the same issues:
> pool_setlowat crashing randomly, same for ahci and so on.
>
> I believe we are not syncing the PTEs correctly.
>
> Here?s the snippet from PTE_SYNC(), but PTE_SYNC_RANGE() has
> the same issue:
>
> #define PTE_SYNC(pte) \
> do { \
> if (PMAP_NEEDS_PTE_SYNC) { \
> paddr_t pa; \
> cpu_drain_writebuf(); \
> cpu_dcache_wb_range((vaddr_t)(pte), sizeof(pt_entry_t));\
> if (cpu_sdcache_enabled()) { \
> (void)pmap_extract(pmap_kernel(), (vaddr_t)(pte), &pa); \
> cpu_sdcache_wb_range((vaddr_t)(pte), (paddr_t)(pa), \
>    sizeof(pt_entry_t)); \
> }; \
> cpu_drain_writebuf(); \
> } \
> } while (/*CONSTCOND*/0)
>
> I believe that when we change things in the pagetables, we need to make
> sure the tables are synced before we?re going to use them.  In our case
> we believe that we are using uncached pagetables, which means that
> every write will directly hit the tables.
>
> But that does not have an affect on the write buffer.  The write buffer is still
> there and has to be cleared manually.  If it isn?t, and something accesses
> an area which was just mapped, then we?re fucked.
>
> Therefore I firmly believe that the cpu_drain_writebuf() call has to be made
> regardless of PMAP_NEEDS_PTE_SYNC and that it has to be called before
> that if-clause.
>
> Doing that fixes my issues.
>
> \Patrick
>

I think this is correct. With the diff below, my A20 board doesn't panic anymore.

I still get a lot of messages like the following though:
pmap_fault_fixup: va 00008000 ftype 1 u pte 7f24f02e



Index: sys/arch/arm/include/pmap.h
===================================================================
RCS file: /cvs/src/sys/arch/arm/include/pmap.h,v
retrieving revision 1.27
diff -u -p -u -p -r1.27 pmap.h
--- sys/arch/arm/include/pmap.h 7 Oct 2014 10:10:58 -0000 1.27
+++ sys/arch/arm/include/pmap.h 20 Oct 2014 09:33:14 -0000
@@ -328,9 +328,9 @@ extern int pmap_needs_pte_sync;

 #define PTE_SYNC(pte) \
 do { \
+ cpu_drain_writebuf(); \
  if (PMAP_NEEDS_PTE_SYNC) { \
  paddr_t pa; \
- cpu_drain_writebuf(); \
  cpu_dcache_wb_range((vaddr_t)(pte), sizeof(pt_entry_t));\
  if (cpu_sdcache_enabled()) { \
  (void)pmap_extract(pmap_kernel(), (vaddr_t)(pte), &pa); \
@@ -343,9 +343,9 @@ do { \

 #define PTE_SYNC_RANGE(pte, cnt) \
 do { \
+ cpu_drain_writebuf(); \
  if (PMAP_NEEDS_PTE_SYNC) { \
  paddr_t pa; \
- cpu_drain_writebuf(); \
  cpu_dcache_wb_range((vaddr_t)(pte), \
     (cnt) << 2); /* * sizeof(pt_entry_t) */ \
  if (cpu_sdcache_enabled()) { \


Reply | Threaded
Open this post in threaded view
|

Re: armv7: banana pi, Allwinner A20 board

Jonathan Gray-11
On Mon, Oct 20, 2014 at 12:15:42PM +0200, Raphael Graf wrote:

> On Thu, October 16, 2014 11:40 pm, Patrick Wildt wrote:
> > I do believe that this is a pmap issue.
> >
> > I just got hands on an Allwinner A20 and suffered the same issues:
> > pool_setlowat crashing randomly, same for ahci and so on.
> >
> > I believe we are not syncing the PTEs correctly.
> >
> > Here?s the snippet from PTE_SYNC(), but PTE_SYNC_RANGE() has
> > the same issue:
> >
> > #define PTE_SYNC(pte) \
> > do { \
> > if (PMAP_NEEDS_PTE_SYNC) { \
> > paddr_t pa; \
> > cpu_drain_writebuf(); \
> > cpu_dcache_wb_range((vaddr_t)(pte), sizeof(pt_entry_t));\
> > if (cpu_sdcache_enabled()) { \
> > (void)pmap_extract(pmap_kernel(), (vaddr_t)(pte), &pa); \
> > cpu_sdcache_wb_range((vaddr_t)(pte), (paddr_t)(pa), \
> >    sizeof(pt_entry_t)); \
> > }; \
> > cpu_drain_writebuf(); \
> > } \
> > } while (/*CONSTCOND*/0)
> >
> > I believe that when we change things in the pagetables, we need to make
> > sure the tables are synced before we?re going to use them.  In our case
> > we believe that we are using uncached pagetables, which means that
> > every write will directly hit the tables.
> >
> > But that does not have an affect on the write buffer.  The write buffer is still
> > there and has to be cleared manually.  If it isn?t, and something accesses
> > an area which was just mapped, then we?re fucked.
> >
> > Therefore I firmly believe that the cpu_drain_writebuf() call has to be made
> > regardless of PMAP_NEEDS_PTE_SYNC and that it has to be called before
> > that if-clause.
> >
> > Doing that fixes my issues.
> >
> > \Patrick
> >
>
> I think this is correct. With the diff below, my A20 board doesn't panic anymore.
>
> I still get a lot of messages like the following though:
> pmap_fault_fixup: va 00008000 ftype 1 u pte 7f24f02e

http://permalink.gmane.org/gmane.comp.hardware.netbook.arm.sunxi/3342
It seems Cortex A8/Allwinner A10 allocates cache lines on read and
Cortex A7/Allwinner A20 allocates on write.

Or rather the A7/A15 have "inner shareable" L2 unlike the
A9/A8 which have external "outer shareable" L2 that affects the coherency.

The current snapshot has this diff included, and was built on
a kernel running it.

>
>
>
> Index: sys/arch/arm/include/pmap.h
> ===================================================================
> RCS file: /cvs/src/sys/arch/arm/include/pmap.h,v
> retrieving revision 1.27
> diff -u -p -u -p -r1.27 pmap.h
> --- sys/arch/arm/include/pmap.h 7 Oct 2014 10:10:58 -0000 1.27
> +++ sys/arch/arm/include/pmap.h 20 Oct 2014 09:33:14 -0000
> @@ -328,9 +328,9 @@ extern int pmap_needs_pte_sync;
>
>  #define PTE_SYNC(pte) \
>  do { \
> + cpu_drain_writebuf(); \
>   if (PMAP_NEEDS_PTE_SYNC) { \
>   paddr_t pa; \
> - cpu_drain_writebuf(); \
>   cpu_dcache_wb_range((vaddr_t)(pte), sizeof(pt_entry_t));\
>   if (cpu_sdcache_enabled()) { \
>   (void)pmap_extract(pmap_kernel(), (vaddr_t)(pte), &pa); \
> @@ -343,9 +343,9 @@ do { \
>
>  #define PTE_SYNC_RANGE(pte, cnt) \
>  do { \
> + cpu_drain_writebuf(); \
>   if (PMAP_NEEDS_PTE_SYNC) { \
>   paddr_t pa; \
> - cpu_drain_writebuf(); \
>   cpu_dcache_wb_range((vaddr_t)(pte), \
>      (cnt) << 2); /* * sizeof(pt_entry_t) */ \
>   if (cpu_sdcache_enabled()) { \
>