1 (edited by dusk 2012-02-27 07:41:04)

Topic: Silvermoon system documentation?

I'm looking for a few key bits of documentation for Silvermoon. Specifically the Infocast 8, but possibly also applicable to Chumby 8:

1. There seem to be some components of the boot process that run before uboot, including one bit early on that spits out a slightly worrisome message ("Hello world, I'm the most incredibly annoying boot process you'll ever meet!"). I'm assuming this code lives on the boot flash on the back of the board; is the source available, and is the flash accessible from the running system at all? I'm perfectly happy to treat it like the imx233's boot ROM too if it's inaccessible.

2. Is there any documentation available on the crypto coprocessor on the Infocast 8? It seems to have some weird non-crypto-related duties, such as powering the device on/off (poweroff/reboot don't work until I run cpi at least once!), so I'd like to know if the interface is documented. Relatedly, where is the source to cpi?

3. Is anyone else delving into the device internals like I am? smile

Since you're probably wondering why I care -- I'm working on a custom firmware for my Infocast devices. I've got a buildroot up and running on a 3.5, but am running into some issues with the 8.

Re: Silvermoon system documentation?

First off, good luck with your project!  I use primarily Infocasts (since Chumbies seem to be so hard to get a hold of these days sad) so I'm interested in your work.  I'm doing some tweaking on my Infocasts, but not at the level you are -- just basically replacing the control panel and such.

Unfortunately I can't really assist with your questions, but I'm reaching out to see if we can't find someone who can.  I'd love to see what you can pull out of these little wonder boxen!

Re: Silvermoon system documentation?

There is a first stage boot - it's a signed bootloader for which (I think) there is no source code available (you might be able to ask Marvell for it).  We use it just to boot as quickly as we can to something open rather than use it as intended, whcih was to lock down the device.

I'll see if I can figure out where the source to cpi is.

Re: Silvermoon system documentation?

cpid source can be found at https://github.com/sutajiokousagi/cpid/ … r/src/cpid

cpid is a full userspace-emulation of the cryptoprocessor.

The first stage boot is contained inside a serial EEPROM, and is not accessible nor reprogrammable from the OS. The point at which user-modifiable code takes over is where the console says "levelling up".

7BAA 2E53 01C1 DCFF 497B  E7F0 9699 A303 78F0 D9B9

5 (edited by dusk 2012-02-27 14:43:38)

Re: Silvermoon system documentation?

Thanks for the pointer, bunnie -- I also found the cpi source nearby at https://github.com/sutajiokousagi/cpi, which is exactly what I was after.

6 (edited by dusk 2012-02-28 22:11:23)

Re: Silvermoon system documentation?

OK, I've got the system booting off a custom image now, and I'm running into some new and exciting problems. The system boots up properly, but starts misbehaving severely a few seconds after everything appears settled. Here's the kernel log:

[    0.000000] Linux version 2.6.28-M2.1.8.12 (builder@stormbuild) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #1 Thu Dec 9 13:04:27 PST 2010
[    0.000000] CPU: Marvell Mohawk [56158400] revision 0 (ARMv5TE), cr=04053977
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine: PXA168-based Chumby Silvermoon platform
[    0.000000] Ignoring unrecognised tag 0x54410008
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 32512
[    0.000000] Kernel command line: root=/dev/mmcblk0p3 rootfstype=ext3 rootwait console=ttyS0,115200 mem=128M uart_dma sysrq_always_enabled ro
[    0.000000] debug: sysrq always enabled.
[    0.000000] PID hash table entries: 512 (order: 9, 2048 bytes)
[    0.000088] Console: colour dummy device 80x30
[    0.000106] ram_console: buffer 00000000, invalid size 0, datasize -12
[    0.000185] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000480] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.006779] Memory: 128MB = 128MB total
[    0.006802] Memory: 123904KB available (3852K code, 934K data, 1060K init)
[    0.006894] SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.006917] Calibrating delay loop... 796.26 BogoMIPS (lpj=3981312)
[    0.220326] Mount-cache hash table entries: 512
[    0.220657] CPU: Testing write buffer coherency: ok
[    0.223463] net_namespace: 292 bytes
[    0.223663] NET: Registered protocol family 16
[    0.224156] silvermoon.c - silvermoon_init():701 - Just so you know, the CPU type is 0x56158400
[    0.224269] pxa168_mfp_set_fastio_drive config changed to 2000
[    0.224521] silvermoon_init() - attempting to add SSP2 for touchscreen
[    0.224536] silvermoon_ssp_init() adding ssp2
[    0.224587] silvermoon_ssp_init() exit
[    0.224637] silvermoon_init() - adding u2h ehci usb hub
[    0.224808] silvermoon_init() - adding MMC3 init[2], wifi MMC1
[    0.225198] platform_driver_register
[    0.228064] SCSI subsystem initialized
[    0.228192] usbcore: registered new interface driver usbfs
[    0.228291] usbcore: registered new interface driver hub
[    0.228438] usbcore: registered new device driver usb
[    0.251046] NET: Registered protocol family 2
[    0.340433] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.340630] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[    0.340720] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[    0.340789] TCP: Hash tables configured (established 4096 bind 4096)
[    0.340805] TCP reno registered
[    0.370443] NET: Registered protocol family 1
[    0.381516] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    0.382606] NTFS driver 2.1.29 [Flags: R/W].
[    0.383053] fuse init (API version 7.10)
[    0.383663] msgmni has been set to 242
[    0.384723] alg: No test for stdrng (krng)
[    0.384784] io scheduler noop registered
[    0.384797] io scheduler anticipatory registered
[    0.384810] io scheduler deadline registered
[    0.384929] io scheduler cfq registered (default)
[    0.392852] pxa168fb_ovly.c - pxa168fb_probe():2075 - Just pointed fb0 at 0112b000
[    0.396325] pxa168fb_set_par() warning: viewport x/y zoom were 0
[    0.411260] Console: switching to colour frame buffer device 100x75
[    0.424037] pxa168fb_ovly: frame buffer device was loaded to /dev/fb0 <Ovly-silvermoon>.
[    0.428864] pxa2xx-uart.0: ttyS0 at MMIO 0xd4017000 (irq = 27) is a FFUART
[    0.428897] console [ttyS0] enabled
[    0.747069] pxa2xx-uart.2: ttyS2 at MMIO 0xd4026000 (irq = 29) is a STUART
[    0.754366] brd: module loaded
[    0.758669] loop: module loaded
[    0.761927] logger: created 64K log 'log_main'
[    0.766424] logger: created 256K log 'log_events'
[    0.771218] logger: created 64K log 'log_radio'
[    0.775821] usbcore: registered new interface driver cdc_ether
[    0.781755] Driver 'sd' needs updating - please use bus_type methods
[    0.788213] usbmon: debugfs is not available
[    0.792515] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.799205] u2h regbase 0xc883a000 phybase 0xc883e000 irq 51
[    0.806684] pxau2h-ehci pxau2h-ehci: Marvell PXA SOC EHCI Host Controller
[    0.813679] pxau2h-ehci pxau2h-ehci: new USB bus registered, assigned bus number 1
[    0.821488] pxau2h-ehci pxau2h-ehci: irq 51, io base 0x0883a000
[    0.840384] pxau2h-ehci pxau2h-ehci: USB 2.0 started, EHCI 1.00
[    0.846638] usb usb1: configuration #1 chosen from 1 choice
[    0.852426] hub 1-0:1.0: USB hub found
[    0.856208] hub 1-0:1.0: 1 port detected
[    0.860721] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    0.867514] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.874785] usb usb1: Product: Marvell PXA SOC EHCI Host Controller
[    0.881083] usb usb1: Manufacturer: Linux 2.6.28-M2.1.8.12 ehci_hcd
[    0.887346] usb usb1: SerialNumber: pxau2h-ehci
[    0.891917] [ehci-pxau2h.c] Silvermoon media insertion / removal detection enabled
[    0.899577] Initializing USB Mass Storage driver...
[    0.904589] usbcore: registered new interface driver usb-storage
[    0.910632] USB Mass Storage support registered.
[    0.915327] usbcore: registered new interface driver libusual
[    0.921244] u2o regbase 0xc8842000 phybase 0xc8846000 irq 44
[    0.928018] mice: PS/2 mouse device common for all mice
[    0.933745] mmp-rtc mmp-rtc: rtc core: registered mmp-rtc as rtc0
[    0.940143] mmc0: SDHCI controller on MMC [pxa-sdh.0] using ADMA
[    0.946363] mmc1: SDHCI controller on MMC [pxa-sdh.1] using ADMA
[    0.952567] mmc2: SDHCI controller on MMC [pxa-sdh.2] using ADMA
[    0.958621] pxa-sdh: Secure Digital Host Controller Interface driver
[    0.965014] pxa-sdh: Copyright(c) Pierre Ossman
[    0.970462] usbcore: registered new interface driver usbhid
[    0.976042] usbhid: v2.6:USB HID core driver
[    0.980446] Advanced Linux Sound Architecture Driver Version 1.0.18rc3.
[    0.987063] ALSA device list:
[    0.990027]   No soundcards found.
[    0.993457] oprofile: using timer interrupt.
[    0.998071] TCP cubic registered
[    1.001348] NET: Registered protocol family 17
[    1.006411] RPC: Registered udp transport module.
[    1.011161] RPC: Registered tcp transport module.
[    1.015863] XScale iWMMXt coprocessor detected.
[    1.020824] pxa168fb.c - pxa168fb_probe():1268 - Changing LCD_SPU_DMA_CTRL1 from 0x20020081 -> 0x2002ff81
[    1.042912] pxa168fb.c - pxa168fb_probe():1328 - Changing LCD_SPU_DMA_CTRL0 from 0x08401111 -> 0x08441111
[    1.052520] pxa168fb.c - pxa168fb_probe():1331 - Changing LCD_SPU_DMA_CTRL1 from 0x2002ff81 -> 0x2002ff81
[    1.062335] pxa168fb: frame buffer device was loaded to /dev/fb1 <Base-silvermoon>.
[    1.069994] silvermoon_lcd_power() ON
[    1.073837] mmp-rtc mmp-rtc: setting system clock to 1970-01-01 00:00:00 UTC (0)
[    1.081448] Waiting for root device /dev/mmcblk0p3...
[    1.275752] usb 1-1: new high speed USB device using pxau2h-ehci and address 2
[    1.681514] usb 1-1: configuration #1 chosen from 1 choice
[    1.731239] hub 1-1:1.0: USB hub found
[    1.779046] hub 1-1:1.0: 4 ports detected
[    1.872137] usb 1-1: New USB device found, idVendor=058f, idProduct=6254
[    1.878843] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    1.886028] usb 1-1: Product: USB2.0Hub
[    2.465019] usb 1-1.3: new high speed USB device using pxau2h-ehci and address 3
[    3.003575] usb 1-1.3: configuration #1 chosen from 1 choice
[    3.054193] usb 1-1.3: New USB device found, idVendor=0846, idProduct=1040
[    3.061117] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.068425] usb 1-1.3: Product: NETGEAR FA120 Adapter
[    3.073546] usb 1-1.3: Manufacturer: NETGEAR
[    3.299017] usb 1-1.4: new high speed USB device using pxau2h-ehci and address 4
[    3.881826] usb 1-1.4: configuration #1 chosen from 1 choice
[    3.932895] mmc1: new SDIO card at address 0001
[    3.937753] scsi0 : SCSI emulation for USB Mass Storage devices
[    3.944745] usb 1-1.4: New USB device found, idVendor=058f, idProduct=6366
[    3.951734] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.959049] usb 1-1.4: Product: Mass Storage Device
[    3.963958] usb 1-1.4: Manufacturer: Generic
[    3.968222] usb 1-1.4: SerialNumber: 058F0O1111B1
[    4.944017] mmc2: new SD card at address d3ba
[    4.948700] mmcblk0: mmc2:d3ba SU01G 942 MiB 
[    4.953263]  mmcblk0: p1 p2 p3 p4
[    5.055612] kjournald starting.  Commit interval 5 seconds
[    5.061185] EXT3-fs: mounted filesystem with ordered data mode.
[    5.067138] VFS: Mounted root (ext3 filesystem) readonly.
[    5.072854] Freeing init memory: 1060K

<system boots up...>

[    8.894964] Internal error: Oops: 0 [#1]
[    8.898885] Modules linked in: asix
[    8.902370] CPU: 0    Not tainted  (2.6.28-M2.1.8.12 #1)
[    8.907680] PC is at 0x0
[    8.910215] LR is at enqueue_task+0x1c/0x28
[    8.914404] pc : [<00000000>]    lr : [<c0120598>]    psr: 20000093
[    8.914415] sp : c7fdfeb8  ip : c7fdfed0  fp : c7fdfecc
[    8.925892] r10: 00000000  r9 : 00000003  r8 : c04d5d90
[    8.931119] r7 : 00000000  r6 : c04d78d8  r5 : c0500e60  r4 : c04d78d8
[    8.937647] r3 : c03ecac8  r2 : 00000001  r1 : c04d78d8  r0 : c0500e60
[    8.944175] Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[    8.951571] Control: 0405397f  Table: 07c3c018  DAC: 00000017
[    8.957315] Process khelper (pid: 6, stack limit = 0xc7fde270)
[    8.963149] Stack: (0xc7fdfeb8 to 0xc7fe0000)
[    8.967504] fea0:                                                       c0500e60 c0500e60 
[    8.975760] fec0: c7fdfee4 c7fdfed0 c0120690 c012058c 00000001 c0500e60 c7fdff0c c7fdfee8 
[    8.984015] fee0: c0121a74 c0120678 c7fdff6c 20000093 c04d5d3c c04d5d84 00000001 00000001 
[    8.992270] ff00: c7fdff1c c7fdff10 c0121ad8 c0121a1c c7fdff4c c7fdff20 c0120c20 c0121ad4 
[    9.000525] ff20: 00000000 60000013 c7c9c240 c0135164 c7ff40a0 00000000 00000000 00000000 
[    9.008780] ff40: c7fdff6c c7fdff50 c0120d4c c0120bf8 00000000 c0135164 c7ff40a0 00000000 
[    9.017036] ff60: c7fdff84 c7fdff70 c01351c0 c0120d1c c7ff40a0 c7fde000 c7fdffa4 c7fdff88 
[    9.025291] ff80: c0135740 c0135174 c7ff40a8 c7fdffb8 c7fccfa0 c7ff40a0 c7fdffdc c7fdffa8 
[    9.033546] ffa0: c0135e10 c0135698 c7fdffdc 00000000 c7fccfa0 c0139644 c7fdffb8 c7fdffb8 
[    9.041801] ffc0: c7ff40a0 c0135d64 00000000 00000000 c7fdfff4 c7fdffe0 c01391e0 c0135d74 
[    9.050056] ffe0: 00000000 00000000 00000000 c7fdfff8 c0128834 c013919c 00000000 00000000 
[    9.058311] Backtrace: 
[    9.060753] [<c012057c>] (enqueue_task+0x0/0x28) from [<c0120690>] (activate_task+0x28/0x34)
[    9.069207]  r5:c0500e60 r4:c0500e60
[    9.072773] [<c0120668>] (activate_task+0x0/0x34) from [<c0121a74>] (try_to_wake_up+0x68/0xb8)
[    9.081403]  r5:c0500e60 r4:00000001
[    9.084969] [<c0121a0c>] (try_to_wake_up+0x0/0xb8) from [<c0121ad8>] (default_wake_function+0x14/0x18)
[    9.094294]  r7:00000001 r6:00000001 r5:c04d5d84 r4:c04d5d3c
[    9.099952] [<c0121ac4>] (default_wake_function+0x0/0x18) from [<c0120c20>] (__wake_up_common+0x38/0x7c)
[    9.109449] [<c0120be8>] (__wake_up_common+0x0/0x7c) from [<c0120d4c>] (complete+0x40/0x4c)
[    9.117818] [<c0120d0c>] (complete+0x0/0x4c) from [<c01351c0>] (__call_usermodehelper+0x5c/0x70)
[    9.126628]  r4:00000000
[    9.129154] [<c0135164>] (__call_usermodehelper+0x0/0x70) from [<c0135740>] (run_workqueue+0xb8/0x144)
[    9.138477]  r5:c7fde000 r4:c7ff40a0
[    9.142053] [<c0135688>] (run_workqueue+0x0/0x144) from [<c0135e10>] (worker_thread+0xac/0xc0)
[    9.150673]  r7:c7ff40a0 r6:c7fccfa0 r5:c7fdffb8 r4:c7ff40a8
[    9.156342] [<c0135d64>] (worker_thread+0x0/0xc0) from [<c01391e0>] (kthread+0x54/0x80)
[    9.164362]  r7:00000000 r6:00000000 r5:c0135d64 r4:c7ff40a0
[    9.170030] [<c013918c>] (kthread+0x0/0x80) from [<c0128834>] (do_exit+0x0/0x6bc)
[    9.177530]  r5:00000000 r4:00000000
[    9.181097] Code: bad PC value.
[    9.184507] ---[ end trace 2509e2451b9817e6 ]---
[    9.198853] bad: scheduling from the idle thread!
[    9.203638] [<c03e9840>] (dump_stack+0x0/0x14) from [<c01225fc>] (dequeue_task_idle+0x24/0x38)
[    9.212325] [<c01225d8>] (dequeue_task_idle+0x0/0x38) from [<c0120620>] (dequeue_task+0x7c/0x88)
[    9.221170] [<c01205a4>] (dequeue_task+0x0/0x88) from [<c01206c4>] (deactivate_task+0x28/0x38)
[    9.229805]  r7:c04d8560 r6:c04d78d8 r5:c04d7a48 r4:c0500e60
[    9.235498] [<c012069c>] (deactivate_task+0x0/0x38) from [<c03e9ea0>] (schedule+0x10c/0x328)
[    9.244024]  r5:c04d7a48 r4:c01133bc
[    9.247626] [<c03e9d94>] (schedule+0x0/0x328) from [<c01133b0>] (cpu_idle+0x50/0x5c)
[    9.255420] [<c0113360>] (cpu_idle+0x0/0x5c) from [<c03e86e0>] (rest_init+0x58/0x6c)
[    9.263208]  r5:c04ff9cc r4:c0544d60
[    9.266783] [<c03e8688>] (rest_init+0x0/0x6c) from [<c0008b10>] (start_kernel+0x280/0x2d8)
[    9.275091] [<c0008890>] (start_kernel+0x0/0x2d8) from [<00008034>] (0x8034)
[    9.284743] bad: scheduling from the idle thread!
[    9.289459] [<c03e9840>] (dump_stack+0x0/0x14) from [<c01225fc>] (dequeue_task_idle+0x24/0x38)
[    9.298156] [<c01225d8>] (dequeue_task_idle+0x0/0x38) from [<c0120620>] (dequeue_task+0x7c/0x88)
[    9.306993] [<c01205a4>] (dequeue_task+0x0/0x88) from [<c01206c4>] (deactivate_task+0x28/0x38)
[    9.315651]  r7:c0724000 r6:c04d78d8 r5:c04d7a48 r4:c0500e60
[    9.321358] [<c012069c>] (deactivate_task+0x0/0x38) from [<c03e9ea0>] (schedule+0x10c/0x328)
[    9.329814]  r5:c04d7a48 r4:c0102300
[    9.333416] [<c03e9d94>] (schedule+0x0/0x328) from [<c01133b0>] (cpu_idle+0x50/0x5c)
[    9.341204] [<c0113360>] (cpu_idle+0x0/0x5c) from [<c03e86e0>] (rest_init+0x58/0x6c)
[    9.348972]  r5:c04ff9cc r4:c0544d60
[    9.352573] [<c03e8688>] (rest_init+0x0/0x6c) from [<c0008b10>] (start_kernel+0x280/0x2d8)

It goes on line this indefinitely... behind the constant spew on the serial console, the system is running, but performs poorly. The issue is intermittent; sometimes it won't happen, booting up with init=/bin/sh doesn't trigger it, but subsequently exec'ing /sbin/init does unless you wait a few seconds, which has me wondering if it's some sort of hardware race condition...

Any ideas?

Re: Silvermoon system documentation?

I've been poking around a little more on this, and it definitely seems to be a race condition of some sort. I've been experimenting with various "sleep"s inserted into my boot script, and I got this new exciting oops as well:

[    8.890426] BUG: scheduling while atomic: mdev/49/0x00000100
[    8.896100] Modules linked in: chumby_sense1 chumby_timer bmm snd_soc_silvermoon snd_soc_pxa3xx_ssp snd_soc_pxa3xx snd_soc_wm8961 snd_soc_core snd_pcm snd_page_alloc snd_timer silvermoon_tsb i2c_pxa i2c_dev i2c_core
[    8.915318] 
[    8.916804] Pid: 49, comm:                 mdev
[    8.921368] CPU: 0    Not tainted  (2.6.28-M2.1.8.12 #1)
[    8.926679] PC is at 0x40076b68
[    8.929820] LR is at 0x40075ec4
[    8.932994] pc : [<40076b68>]    lr : [<40075ec4>]    psr: 20000010
[    8.933005] sp : be9317d8  ip : 400899e4  fp : 400899d0
[    8.944507] r10: 00000030  r9 : 00000000  r8 : 000a8958
[    8.949731] r7 : 000a88d8  r6 : 400899e4  r5 : 00000041  r4 : 400899b0
[    8.956288] r3 : 000a8908  r2 : 00000040  r1 : 00000010  r0 : 400899b4
[    8.962842] Flags: nzCv  IRQs on  FIQs on  Mode USER_32  ISA ARM  Segment user
[    8.970073] Control: 0405397f  Table: 07c3c018  DAC: 00000015
[    8.975843] [<c0113310>] (show_regs+0x0/0x50) from [<c01234d0>] (__schedule_bug+0x4c/0x60)
[    8.984166]  r5:c0720170 r4:c7c21fb0
[    8.987741] [<c0123484>] (__schedule_bug+0x0/0x60) from [<c03e9de8>] (schedule+0x54/0x328)
[    8.996049]  r5:c0720170 r4:c7c21da8
[    8.999625] [<c03e9d94>] (schedule+0x0/0x328) from [<c03ea248>] (schedule_timeout+0x20/0xb8)
[    9.008105] [<c03ea228>] (schedule_timeout+0x0/0xb8) from [<c03e9c64>] (wait_for_common+0xd4/0x170)
[    9.017185]  r8:c7c20000 r7:7fffffff r6:c7c21dec r5:c0720000 r4:c7c21da8
[    9.023938] [<c03e9b90>] (wait_for_common+0x0/0x170) from [<c03e9d90>] (wait_for_completion+0x18/0x1c)
[    9.033291] [<c03e9d78>] (wait_for_completion+0x0/0x1c) from [<c0135380>] (call_usermodehelper_exec+0x7c/0x98)
[    9.043352] [<c0135304>] (call_usermodehelper_exec+0x0/0x98) from [<c02c0fec>] (kobject_uevent_env+0x314/0x37c)
[    9.053488]  r7:c7fc2000 r6:00000008 r5:00000000 r4:0000001c
[    9.059147] [<c02c0cd8>] (kobject_uevent_env+0x0/0x37c) from [<c0333444>] (insertion_alert+0x1b8/0x1ec)
[    9.068594] [<c033328c>] (insertion_alert+0x0/0x1ec) from [<c012ec74>] (run_timer_softirq+0x164/0x1f4)
[    9.077959]  r8:c0543188 r7:c7c20000 r6:c033328c r5:00000100 r4:c0542380
[    9.084701] [<c012eb10>] (run_timer_softirq+0x0/0x1f4) from [<c012a790>] (__do_softirq+0x6c/0x104)
[    9.093695] [<c012a724>] (__do_softirq+0x0/0x104) from [<c012a870>] (irq_exit+0x48/0x50)
[    9.101831] [<c012a828>] (irq_exit+0x0/0x50) from [<c0111068>] (__exception_text_start+0x68/0x84)
[    9.110756] [<c0111000>] (__exception_text_start+0x0/0x84) from [<c0111be4>] (__irq_usr+0x44/0x80)
[    9.119739] Exception stack(0xc7c21fb0 to 0xc7c21ff8)
[    9.124817] 1fa0:                                     400899b4 00000010 00000040 000a8908 
[    9.133105] 1fc0: 400899b0 00000041 400899e4 000a88d8 000a8958 00000000 00000030 400899d0 
[    9.141403] 1fe0: 400899e4 be9317d8 40075ec4 40076b68 20000010 ffffffff                   
[    9.149659]  r5:fe28210c r4:ffffffff

What seems to have gotten it under control is inserting a "sleep 5" after loading modules and before starting mdev, and a "sleep 2" between setting "kernel.hotplug=/sbin/mdev" and running "mdev -s". The only significant-looking kernel message during the first sleep is the initialization of sda (the internal flash reader).

Any ideas on this, or am I just going to have to live with a slightly slower-than-necessary startup?

Re: Silvermoon system documentation?

Hey Dusk - you get any farther with this? I want to build a disk image using EmDebian or Debian and I am not sure where to start.

I have went through the process of installing Debian Squeeze with chroot off of an SD card so I think if I can get a bootable system with ssh or the screen with a keyboard I may be able to get somewhere.

Re: Silvermoon system documentation?

You know, I actually haven't tried a Debian install. I probably should, though!

Re: Silvermoon system documentation?

I got Open Embedded working on the Infocast 8.  It's not perfect, but it works.

11

Re: Silvermoon system documentation?

@mwalimu - thanks - I have read some of that but in my experience the Angstrom packages tend to lag behind Debian. I may try that route at some point

12 (edited by dusk 2012-05-29 22:47:46)

Re: Silvermoon system documentation?

I've gone ahead and installed a Debian system on my Infocast 8. Ran a cross-architecture debootstrap from one of my other systems — it wasn't half hard.

This fixed (or, at least, worked around) the boot-time race conditions I was running into. So now I get to run into new and exciting issues! Like this one:

cacheflush(0x40eb3000, 0x40ed1000, 0, 0x15, 0x40022578 <unfinished ...>
+++ killed by SIGSEGV +++

[   48.553217] Unable to handle kernel paging request at virtual address 40ec1fe0
[   48.560523] pgd = c6730000
[   48.563224] [40ec1fe0] *pgd=06792031, *pte=00000000, *ppte=00000000
[   48.569486] Internal error: Oops: 817 [#1]
[   48.573578] Modules linked in: ipv6 chumby_sense1 chumby_timer snd_soc_silvermoon snd_soc_pxa3xx snd_soc_pxa3xx_ssp silvermoon_tsb i2c_dev snd_soc_wm8961 snd_soc_core snd_pcm snd_timer snd_page_alloc asix chumby_silvermoon_bl i2c_pxa backlight i2c_core
[   48.595926] CPU: 0    Not tainted  (2.6.28-20120516-223647 #29)
[   48.601852] PC is at mohawk_coherent_kern_range+0x30/0x44
[   48.607260] LR is at arm_syscall+0x1fc/0x34c
[   48.611527] pc : [<c0200c98>]    lr : [<c01fc360>]    psr: 80000013
[   48.611538] sp : c671be80  ip : c671be80  fp : c671bfa4
[   48.623007] r10: 00000000  r9 : c671a000  r8 : 00000000
[   48.628234] r7 : 000f0002  r6 : 40eb3000  r5 : 00000000  r4 : 40ed1000
[   48.634762] r3 : 40eb3000  r2 : 40eb3000  r1 : 40ed1000  r0 : 40ec1fe0
[   48.641290] Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   48.648426] Control: 0405397f  Table: 06730018  DAC: 00000015
[   48.654171] Process a.out (pid: 572, stack limit = 0xc671a270)
<snip>
[   48.763508] Backtrace:
[   48.765950] [<c01fc164>] (arm_syscall+0x0/0x34c) from [<c01f7da0>] (ret_fast_syscall+0x0/0x2c)
[   48.774569]  r6:40eb3000 r5:bef37378 r4:40022578
[   48.779194] Code: e1a00002 e2800efe e1500001 ca000002 (ee270f3b)
[   48.785417] ---[ end trace 808b0fd16d14b69e ]---

I really have no idea what to make of this. It's happening 100% consistently when I try to launch a particular binary I just compiled, during the loading process. I'm going to pass this on to an ARM guru I know; in the meantime, though, does anyone have any clues?

13

Re: Silvermoon system documentation?

could you be running out of memory? I would run top in a second terminal and launch your binary

Re: Silvermoon system documentation?

Nope, plenty of memory — the binary I'm running hardly allocates anything, and it hasn't even hit main() yet when the oops occurs.

I know what running out of memory looks like, anyway; it looks totally different.

Re: Silvermoon system documentation?

I'm going over this with my ARM guru friend. It looks as though the L2 cache support in the Silvermoon kernel is incomplete — the L2 cache flush in mohawk_coherent_user_range needs to handle translation errors. There's a patch for a similar issue on armv6+ in this patch file, but it doesn't apply directly to proc-mohawk because the upstream kernel code doesn't support the L2 cache at all.

We're working on a patch. I'll post it up once I've got it written and working.

Re: Silvermoon system documentation?

Success! This tiny patch appears to solve the problem.

--- arch/arm/mm/proc-mohawk.S~      2012-05-31 00:54:04.000000000 -0700
+++ arch/arm/mm/proc-mohawk.S       2012-05-31 08:37:47.000000000 -0700
@@ -229,7 +229,8 @@
        add             r0, #BAD_CACHE_LINE_OFFSET
 1:     cmp             r0, r1
        bgt             2f
-       mcr     p15, 1, r0, c7, c11, 1          @ l2 clean single entry
+USER(  mcr     p15, 1, r0, c7, c11, 1 )        @ l2 clean single entry
+9001: /* just skip the page if it faulted */
        add             r0, #PAGE_SZ
        b               1b
 2:

Due to the nature of the bug, you're unlikely to encounter it unless you're using non-PIC libraries (which are uncommon — the exception, which I was using, was libav), or if you're using applications which generate code at runtime (such as Java).

Re: Silvermoon system documentation?

Anyone willing to document a howto for a Debian install on silvermoon?