Bug 156814

Summary: OpenRD Ultimate does not boot on DB-88F6XXX or SHEEVAPLUG kernel configurations
Product: Base System Reporter: Arnaud <vancorte>
Component: armAssignee: freebsd-arm (Nobody) <freebsd-arm>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: thj
Priority: Normal    
Version: 9.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
openrd-cl.patch
none
openrd-cl.patch none

Description Arnaud 2011-05-04 14:30:10 UTC
Hi,

I was not able to boot my OpenRD Ultimate using DB-88F6XXX or SHEEVAPLUG kernels which are designed for device configurations close to mine.

Here is the solution I found, notably based on N.Shigemura work.

Two problems have been solved:

- boot by modifying the FDT
- use the two mge network interfaces

Fix: Referring to an almost 1 year old thread (http://markmail.org/message/4vjllpvhotkshg6n), I have been able to have a working configuration with those modifications :

- create an OPENRD kernel config based on DB-88F6XXX
- using the openrd.dts file (written by N.Shigemura) 
- applying the patch of N.shigemura on mge driver
- patching mgevar headers

I send you a diff of my modifications.

I am aware that some of these modifications could be a step back in developments that have been made during last months. I hope it will help developers.


Regards.

Patch attached with submission follows:
How-To-Repeat: Load one of these kernels, it should freeze the openrd box
Comment 1 Freddy DISSAUX 2011-05-17 18:40:08 UTC
Hello,

My dmesg:

KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2011 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 9.0-CURRENT #0: Thu May  5 08:17:13 UTC 2011
    root@openrd.bsdsx.fr:/usr/obj/usr/src/sys/OPENRD arm
WARNING: WITNESS option enabled, expect reduced performance.
WARNING: DIAGNOSTIC option enabled, expect reduced performance.
module mvs already present!
CPU: Feroceon 88FR131 rev 1 (Marvell core)
  DC enabled IC enabled WB enabled EABT branch prediction enabled
  16KB/32B 4-way Instruction cache
  16KB/32B 4-way write-back-locking-C Data cache
real memory  = 536870912 (512 MB)
avail memory = 518627328 (494 MB)
SOC: Marvell 88F6281 rev A0, TClock 200MHz
simplebus0: <Flattened device tree simple bus> on fdtbus0
ic0: <Marvell Integrated Interrupt Controller> mem 0xf1020200-0xf102023b on simplebus0
timer0: <Marvell CPU Timer> mem 0xf1020300-0xf102032f irq 1 on simplebus0
Event timer "CPUTimer0" frequency 200000000 Hz quality 1000
Timecounter "CPUTimer1" frequency 200000000 Hz quality 1000
gpio0: <Marvell Integrated GPIO Controller> mem 0xf1010100-0xf101011f irq 35,36,37,38,39,40,41 on simplebus0
rtc0: <Marvell Integrated RTC> mem 0xf1010300-0xf1010307 on simplebus0
twsi0: <Marvell Integrated I2C Bus Controller> mem 0xf1011000-0xf101101f irq 43 on simplebus0
iicbus0: <Philips I2C bus> on twsi0
iic0: <I2C generic I/O> on iicbus0
mge0: <Marvell Gigabit Ethernet controller> mem 0xf1072000-0xf1073fff irq 12,13,14,11,46 on simplebus0
mge0: Ethernet address: 00:50:43:01:db:4d
miibus0: <MII bus> on mge0
e1000phy0: <Marvell 88E1116R Gigabit PHY> PHY 8 on miibus0
e1000phy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto
mge1: <Marvell Gigabit Ethernet controller> mem 0xf1076000-0xf1077fff irq 16,17,18,15,47 on simplebus0
mge1: Ethernet address: 00:50:43:01:db:4e
miibus1: <MII bus> on mge1
e1000phy1: <Marvell 88E1116R Gigabit PHY> PHY 24 on miibus1
e1000phy1:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto
uart0: <16550 or compatible> mem 0xf1012000-0xf101201f irq 33 on simplebus0
uart0: console (1066,n,8,1)
uart1: <16550 or compatible> mem 0xf1012100-0xf101211f irq 34 on simplebus0
ehci0: <Marvell Integrated USB 2.0 controller> mem 0xf1050000-0xf1050fff irq 48,19 on simplebus0
usbus0: EHCI version 1.0
usbus0: set host controller mode
usbus0: <Marvell Integrated USB 2.0 controller> on ehci0
sata0: <Marvell Integrated SATA Controller> mem 0xf1080000-0xf1085fff irq 21 on simplebus0
ata0: <Marvell Integrated SATA Channel> on sata0
ata1: <Marvell Integrated SATA Channel> on sata0
pcib0: <Marvell Integrated PCI/PCI-E Controller> mem 0xf1040000-0xf1041fff irq 44 on fdtbus0
pcib0: PCI IO/Memory space exhausted
device_attach: pcib0 attach returned 12
Timecounters tick every 10.000 msec
usbus0: 480Mbps High Speed USB v2.0
ad0: 238475MB <SAMSUNG HM250HI 2AC101C4> at ata0-master UDMA100 SATA 3Gb/s
WARNING: WITNESS option enabled, expect reduced performance.
WARNING: DIAGNOSTIC option enabled, expect reduced performance.
ugen0.1: <Marvell> at usbus0
uhub0: <Marvell EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
uhub0: 1 port with 1 removable, self powered
Root mount waiting for: usbus0
ugen0.2: <vendor 0x0424> at usbus0
uhub1: <vendor 0x0424 product 0x2517, class 9/0, rev 2.00/0.01, addr 2> on usbus0
Root mount waiting for: usbus0
uhub1: 7 ports with 7 removable, self powered
ugen0.3: <Kingston> at usbus0
umass0: <Kingston DataTraveler 2.00000000184, class 0/0, rev 2.00/2.00, addr 3> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x0000
Root mount waiting for: usbus0
Root mount waiting for: usbus0
umass0:0:0:-1: Attached to scbus0
Trying to mount root from ufs:/dev/ad0s1g []...
da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
da0: <Kingston DataTraveler 2.0 1.00> Removable Direct Access SCSI-2 device 
da0: 40.000MB/s transfers
da0: 953MB (1952256 512 byte sectors: 64H 32S/T 953C)
GEOM: da0: geometry does not match label (255h,63s != 64h,32s).
lock order reversal:
 1st 0xc35b10b0 pmap (pmap) @ /usr/src/sys/arm/arm/pmap.c:922
 2nd 0xc0d76dc0 vm page queue mutex (vm page queue mutex) @ /usr/src/sys/arm/arm/pmap.c:1618
KDB: stack backtrace:
db_md_set_watchpoint() at db_md_set_watchpoint+0x18
scp=0xc0b2d4ec rlv=0xc0924d20 (X_db_sym_numargs+0x178)
	rsp=0xcf7917dc rfp=0xcf7918f8
	r10=0xc356a318 r9=0x00000652
	r8=0xc0d46184 r7=0xc356a110 r6=0xffffffff r5=0xc0b5994c
	r4=0xcf7917e4
X_db_sym_numargs() at X_db_sym_numargs+0x154
scp=0xc0924cfc rlv=0xc0a186f8 (kdb_backtrace+0x3c)
	rsp=0xcf7918fc rfp=0xcf79190c
	r4=0xc0c16ec0
kdb_backtrace() at kdb_backtrace+0x10
scp=0xc0a186cc rlv=0xc0a2945c (witness_display_spinlock+0xac)
	rsp=0xcf791910 rfp=0xcf791924
	r4=0x00000001
witness_display_spinlock() at witness_display_spinlock+0x64
scp=0xc0a29414 rlv=0xc0a29f84 (witness_checkorder+0x5f4)
	rsp=0xcf791928 rfp=0xcf791970
	r5=0xc0d76dc0 r4=0x00000000
witness_checkorder() at witness_checkorder+0x10
scp=0xc0a299a0 rlv=0xc09e18a4 (_mtx_lock_flags+0x34)
	rsp=0xcf791974 rfp=0xcf79199c
	r10=0xc0d82680 r9=0x00008000
	r8=0x00000652 r7=0xc0b95f68 r6=0x00000000 r5=0x00000000
	r4=0xc0d76dc0
_mtx_lock_flags() at _mtx_lock_flags+0x10
scp=0xc09e1880 rlv=0xc0b32db4 (pmap_extract+0x2c0)
	rsp=0xcf7919a0 rfp=0xcf7919c8
	r10=0x00000012 r8=0x00000000
	r7=0xc0f3aa6c r6=0xc35b10b0 r5=0xc0f3aa3c r4=0xc183d01c
pmap_extract() at pmap_extract+0x1ac
scp=0xc0b32ca0 rlv=0xc0b37674 (pmap_release+0xdc8)
	rsp=0xcf7919cc rfp=0xcf791a48
	r10=0x00000000 r9=0x00000000
	r8=0xc38a6800 r7=0xc35b10b0 r6=0x00000000 r5=0xc38a4e90
	r4=0x01f1500e
pmap_release() at pmap_release+0x298
scp=0xc0b36b44 rlv=0xc0b37c48 (pmap_enter_object+0xa0)
	rsp=0xcf791a4c rfp=0xcf791a80
	r10=0xc35b10b0 r9=0x00000005
	r8=0xc0f3aa3c r7=0x00000000 r6=0x0000006b r5=0xc0f3aa3c
	r4=0x00000001
pmap_enter_object() at pmap_enter_object+0x10
scp=0xc0b37bb8 rlv=0xc0b1581c (vm_map_pmap_enter+0x220)
	rsp=0xcf791a84 rfp=0xcf791ad0
	r10=0x00000000 r9=0x00000000
	r8=0x00000000 r7=0x0000006b r6=0x00000000 r5=0x00000000
	r4=0x0000000f
vm_map_pmap_enter() at vm_map_pmap_enter+0x14
scp=0xc0b15610 rlv=0xc0b15e50 (vm_map_insert+0x298)
	rsp=0xcf791ad4 rfp=0xcf791b20
	r10=0xc0e90b28 r9=0xc35b1000
	r8=0x00000000 r7=0x00000000 r6=0x00000000 r5=0x00000000
	r4=0x00000000
vm_map_insert() at vm_map_insert+0x10
scp=0xc0b15bc8 rlv=0xc09b07d4 (elf32_remove_brand_entry+0x510)
	rsp=0xcf791b24 rfp=0xcf791b68
	r10=0x00073000 r9=0x00008000
	r8=0xc35b1000 r7=0x00000000 r6=0x00000000 r5=0x00000005
	r4=0x00000000
elf32_remove_brand_entry() at elf32_remove_brand_entry+0x2c8
scp=0xc09b058c rlv=0xc09b08e8 (elf32_remove_brand_entry+0x624)
	rsp=0xcf791b6c rfp=0xcf791bac
	r10=0x0006ae00 r9=0x00008000
	r8=0xc0e90b28 r7=0x00000000 r6=0x0006ae00 r5=0xfffff000
	r4=0x00073000
elf32_remove_brand_entry() at elf32_remove_brand_entry+0x554
scp=0xc09b0818 rlv=0xc09b1f28 (elf32_brand_inuse+0x61c)
	rsp=0xcf791bb0 rfp=0xcf791c4c
	r10=0xcf795034 r9=0x00000000
	r8=0xc0bff9a8 r7=0xcf795000 r6=0xcf791cec r5=0x00000000
	r4=0x00008000
elf32_brand_inuse() at elf32_brand_inuse+0xb4
scp=0xc09b19c0 rlv=0xc09c83d8 (kern_execve+0x278)
	rsp=0xcf791c50 rfp=0xcf791de4
	r10=0x00000000 r9=0xc35af000
	r8=0xcf791cec r7=0x00000000 r6=0xc0c08070 r5=0x00000000
	r4=0x00000001
kern_execve() at kern_execve+0x10
scp=0xc09c8170 rlv=0xc09c8fac (execve+0x48)
	rsp=0xcf791de8 rfp=0xcf791e28
	r10=0xbffffffd r9=0xc35ac000
	r8=0xc0be7070 r7=0xc0be707a r6=0xbffffff2 r5=0xcf791dec
	r4=0xc35af000
execve() at execve+0x10
scp=0xc09c8f74 rlv=0xc09b2dac (exec_shell_imgact+0x914)
	rsp=0xcf791e2c rfp=0xcf791e80
	r5=0xbfffffe4 r4=0xbfffffe8
exec_shell_imgact() at exec_shell_imgact+0x738
scp=0xc09b2bd0 rlv=0xc09cb3b8 (fork_exit+0x64)
	rsp=0xcf791e84 rfp=0xcf791ea8
	r10=0xc09b2bc0 r9=0x00000000
	r8=0x00000000 r7=0xcf791eac r6=0xc35ac000 r5=0xc0d82680
	r4=0xc35af000
fork_exit() at fork_exit+0x10
scp=0xc09cb364 rlv=0xc0b3c25c (fork_trampoline+0x14)
	rsp=0xcf791eac rfp=0x00000000
	r10=0x00000000 r8=0x00000000
	r7=0x00000000 r6=0x00000000 r5=0x00000000 r4=0xc09b2bc0
lock order reversal:
 1st 0xc35b0a78 pmap (pmap) @ /usr/src/sys/arm/arm/pmap.c:922
 2nd 0xc0d815a4 vm object (uma object) @ /usr/src/sys/vm/uma_core.c:1026
KDB: stack backtrace:
db_md_set_watchpoint() at db_md_set_watchpoint+0x18
scp=0xc0b2d4ec rlv=0xc0924d20 (X_db_sym_numargs+0x178)
	rsp=0xd2001964 rfp=0xd2001a80
	r10=0xc356a318 r9=0x00000402
	r8=0xc0d46184 r7=0xc356aa68 r6=0xffffffff r5=0xc0b5994c
	r4=0xd200196c
X_db_sym_numargs() at X_db_sym_numargs+0x154
scp=0xc0924cfc rlv=0xc0a186f8 (kdb_backtrace+0x3c)
	rsp=0xd2001a84 rfp=0xd2001a94
	r4=0xc0c16ec0
kdb_backtrace() at kdb_backtrace+0x10
scp=0xc0a186cc rlv=0xc0a2945c (witness_display_spinlock+0xac)
	rsp=0xd2001a98 rfp=0xd2001aac
	r4=0x00000001
witness_display_spinlock() at witness_display_spinlock+0x64
scp=0xc0a29414 rlv=0xc0a29f84 (witness_checkorder+0x5f4)
	rsp=0xd2001ab0 rfp=0xd2001af8
	r5=0xc0d815a4 r4=0x00000000
witness_checkorder() at witness_checkorder+0x10
scp=0xc0a299a0 rlv=0xc09e18a4 (_mtx_lock_flags+0x34)
	rsp=0xd2001afc rfp=0xd2001b24
	r10=0xc0d82680 r9=0xc0ea06e0
	r8=0x00000402 r7=0xc0b92c14 r6=0x00000000 r5=0x00000000
	r4=0xc0d815a4
_mtx_lock_flags() at _mtx_lock_flags+0x10
scp=0xc09e1880 rlv=0xc0b0be24 (uma_print_zone+0x2a0)
	rsp=0xd2001b28 rfp=0xd2001b64
	r10=0x00001000 r8=0x00000101
	r7=0x00000000 r6=0xc0ea06e0 r5=0xc0ea1600 r4=0xc0ea1600
uma_print_zone() at uma_print_zone+0x274
scp=0xc0b0bdf8 rlv=0xc0b0d7ec (uma_zcreate+0xd0)
	rsp=0xd2001b68 rfp=0xd2001ba4
	r10=0xc0b0bde8 r9=0xc0ea06e0
	r8=0x00000101 r7=0x00000000 r6=0xc0ea06e0 r5=0x00000001
	r4=0xc0ea1600
uma_zcreate() at uma_zcreate+0x70
scp=0xc0b0d78c rlv=0xc0b0dd64 (uma_prealloc+0x198)
	rsp=0xd2001ba8 rfp=0xd2001bc8
	r10=0xc0e97c48 r9=0x00000080
	r8=0xc0ea06e0 r7=0x00000000 r6=0xc0ea06e0 r5=0x00000201
	r4=0xc0ea1600
uma_prealloc() at uma_prealloc+0xd4
scp=0xc0b0dca0 rlv=0xc0b0de14 (uma_prealloc+0x248)
	rsp=0xd2001bcc rfp=0xd2001be4
	r7=0x00000069 r6=0xc0ea06e0
	r5=0x00000001 r4=0xc0ea1600
uma_prealloc() at uma_prealloc+0x21c
scp=0xc0b0dde8 rlv=0xc0b0f094 (uma_zalloc_arg+0x32c)
	rsp=0xd2001be8 rfp=0xd2001c2c
	r6=0xc183dde8 r5=0x00000069
	r4=0x00000069
uma_zalloc_arg() at uma_zalloc_arg+0x10
scp=0xc0b0ed78 rlv=0xc0b37578 (pmap_release+0xccc)
	rsp=0xd2001c30 rfp=0xd2001cac
	r10=0x00000000 r9=0x00000000
	r8=0xc38a7000 r7=0xc35b0a78 r6=0x00000000 r5=0xc38a4c44
	r4=0x01f3b00e
pmap_release() at pmap_release+0x298
scp=0xc0b36b44 rlv=0xc0b37d3c (pmap_enter+0x70)
	rsp=0xd2001cb0 rfp=0xd2001ce0
	r10=0x00000005 r9=0xc0d76dc0
	r8=0xc0f3b584 r7=0x00023000 r6=0x00000000 r5=0xc35b0a78
	r4=0xc0b95f68
pmap_enter() at pmap_enter+0x10
scp=0xc0b37cdc rlv=0xc0b12070 (vm_fault_hold+0x159c)
	rsp=0xd2001ce4 rfp=0xd2001e0c
	r10=0xd2001eac r9=0xc3854870
	r8=0xc0e90b28 r7=0xc0f3b584 r6=0x00023000 r5=0xc35b09c8
	r4=0x00000000
vm_fault_hold() at vm_fault_hold+0x10
scp=0xc0b10ae4 rlv=0xc0b1274c (vm_fault+0x20)
	rsp=0xd2001e10 rfp=0xd2001e20
	r10=0xd2001eac r9=0xc3854870
	r8=0xc3853000 r7=0x00000000 r6=0x00023000 r5=0xc35b09c8
	r4=0xc38548f8
vm_fault() at vm_fault+0x10
scp=0xc0b1273c rlv=0xc0b3c788 (prefetch_abort_handler+0x140)
	rsp=0xd2001e24 rfp=0xd2001ea8
prefetch_abort_handler() at prefetch_abort_handler+0x10
scp=0xc0b3c658 rlv=0xc0b2ef78 (address_exception_entry+0x50)
	rsp=0xd2001eac rfp=0xbfffe86c
	r10=0x00000019 r9=0x00000012
	r8=0x0006ad28 r7=0x0006a848 r6=0x00000001 r5=0xffff1004
	r4=0x0007ae28
mge0: link state changed to UP
Comment 2 Kristof Provost 2012-04-09 11:41:03 UTC
Hi,

I've updated the config and device tree. 
With the attached patch both MGE interfaces work, as does the crypto 
accelerator.

(Against current r234000)

Regards,
Kristof
Comment 3 Hiroki Sato freebsd_committer 2012-08-03 06:58:30 UTC
Responsible Changed
From-To: freebsd-arm->hrs

I'll take this.
Comment 4 Kristof Provost 2012-10-27 11:26:42 UTC
Hi,

Here's my latest config/dts for for the OpenRD board.

In this version both ethernet interfaces, the CESA crypto
accelerator and NAND work.

Regards,
Kristof Provost
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:15 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 6 Tom Jones freebsd_committer 2020-07-11 18:14:35 UTC
FreeBSD dropped support for ARMv5 on the 2020/01/02 this commit is a good place to start reading from:

https://lists.freebsd.org/pipermail/svn-src-all/2020-January/191927.html