2012/10/21

Kernel 3.6 on Dreamplug

なんかやり方がわからなかったんだけどできたのでメモ

いつからかはわからないけどDreamplugのパッチがメインラインに取り込まれてました
でもFDTってやつで今まで通りブートさせようとしてもうまく動かない模様

調べてみるとFDT対応のDas u-bootを使わないとダメだよって書いてある
Stefan’s Blog: DreamPlug support in Linux 3.4
で、ここがDas u-boot
WebHome < U-Boot < DENX
UBoot < DULG < DENX (ドキュメント)

というわけで、まずu-bootを置き換えてみる
ちなみに実機でビルドしない場合は例によってクロスコンパイル環境が必要
ちょうどこの前作ったばかりなのでそれを使用する

$ wget ftp://ftp.denx.de/pub/u-boot/u-boot-latest.tar.bz2
$ tar jxvf u-boot-latest.tar.bz2
$ cd u-boot-2012.10
$ xmake distclean && xmake dreamplug_config && xmake u-boot.kwb (xmakeはラッパースクリプト)

以上でカレントディレクトリに u-boot.kwb が作成されるのでu-bootかOpenOCDを使用して更新する

次にカーネルをビルドする
ここでもクロスコンパイル環境を使用する(のでxmakeを使っています)

$ wget https://github.com/torvalds/linux/tarball/v3.6
$ tar zxvf v3.6
$ cd torvalds-linux-255595e/
$ xmake mrproper && xmake kirkwood_defconfig
$ xmake menuconfig

ここで注意が必要なのがいくつか変更しなければいけない設定があること
最低限必要と思われるものを以下にあげておく
General setup -> Embedded system [*]
System Type -> Marvell Kirkwood Implementations -> Marvell DreamPlug (Flattened Device Tree) [*]
Device Drivers -> Character devices -> Serial drivers -> Serial port on Open Firmware platform bus [*]

あとは好きなように設定してビルドをする
ビルドする際にFDTの動作に必要なファイルもビルドする
$ xmake uImage && xmake modules && xmake kirkwood-dreamplug.dtb

これで必要なものが揃ったので arch/arm/boot/uImage と
arch/arm/boot/kirkwood-dreamplug.dtb をDreamplugへコピーする

次にu-bootでの起動は以下のようにする
initramfsを使用している場合は "-" の部分にアドレスを指定する
7.5 Device Tree Blob (Flat Device Tree) | Bootloaders in Embedded Linux Systems | InformIT

>> fatload usb 0 0x6400000 uImage
>> fatload usb 0 0x6800000 kirkwood-dreamplug.dtb
>> bootm 0x6400000 - 0x6800000

以上でうまく起動するはず
net.eth0 を rc-update で追加しても起動時に立ち上がってくれなくて
何度もカーネルリビルドしたりシステムいじったりしたんだけど
rc-update --update を実行することで解決した
ここに書いてあったんだけど --update でサービスの依存関係を強制的に更新してくれるらしい

U-Boot 2012.10 (Oct 21 2012 - 01:45:22)
Marvell-DreamPlug

SoC:   Kirkwood 88F6281_A1
DRAM:  512 MiB
WARNING: Caches not enabled
SF: Detected MX25L1605D with page size 64 KiB, total 2 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0, egiga1
88E1116 Initialized on egiga0
88E1116 Initialized on egiga1
Hit any key to stop autoboot:  0 
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 4 USB Device(s) found
       scanning bus for storage devices... Device NOT ready
   Request Sense returned 02 3A 00
2 Storage Device(s) found
reading uImage

2614504 bytes read
reading kirkwood-dreamplug.dtb

3000 bytes read
## Booting kernel from Legacy Image at 06400000 ...
   Image Name:   Linux-3.6.0
   Created:      2012-10-21  16:00:45 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2614440 Bytes = 2.5 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 06800000
   Booting using the fdt blob at 0x06800000
   Loading Kernel Image ... OK
OK
   Loading Device Tree to 0fffc000, end 0ffffbb7 ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Linux version 3.6.0 (alice@wonderland) (gcc version 4.5.4 (Gentoo 4.5.4 p1.0, pie-0.4.7) ) #1 PREEMPT Mon Oct 22 01:00:41 JST 2012
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
CPU: VIVT data cache, VIVT instruction cache
Machine: Marvell Kirkwood (Flattened Device Tree), model: Globalscale Technologies Dreamplug
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: console=ttyS0,115200 root=/dev/sda2 rootdelay=5
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 512MB = 512MB total
Memory: 514112k/514112k available, 10176k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)
    lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc04982c4   (4673 kB)
      .init : 0xc0499000 - 0xc04b84d0   ( 126 kB)
      .data : 0xc04ba000 - 0xc04eb1a0   ( 197 kB)
       .bss : 0xc04eb1c4 - 0xc057cba0   ( 583 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:114
sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 21474ms
Console: colour dummy device 80x30
Calibrating delay loop... 1191.11 BogoMIPS (lpj=5955584)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x3871d8 - 0x387214
NET: Registered protocol family 16
DMA: preallocated 1024 KiB pool for atomic coherent allocations
Kirkwood: MV88F6281-A1, TCLK=200000000.
Feroceon L2: Enabling L2
Feroceon L2: Cache support initialised.
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
cfg80211: Calling CRDA to update world regulatory domain
Switching to clocksource orion_clocksource
NET: Registered protocol family 2
TCP established hash table entries: 16384 (order: 5, 131072 bytes)
TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
msgmni has been set to 1004
io scheduler noop registered
io scheduler cfq registered (default)
mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver
mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver
mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )
mv_xor mv_xor.2: Marvell XOR: ( xor cpy )
mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
console [ttyS0] enabled
loop: module loaded
sata_mv sata_mv.0: cannot get optional clkdev
sata_mv sata_mv.0: slots 32 ports 1
scsi0 : sata_mv
ata1: SATA max UDMA/133 irq 21
orion_spi orion_spi.0: master is unqueued, this is deprecated
m25p80 spi0.0: mx25l1606e (2048 Kbytes)
3 ofpart partitions found on MTD device spi0.0
Creating 3 MTD partitions on "spi0.0":
0x000000000000-0x000000080000 : "u-boot"
0x000000100000-0x000000110000 : "u-boot env"
0x000000180000-0x000000190000 : "dtb"
mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
libphy: mv643xx_eth smi: probed
mv643xx_eth_port mv643xx_eth_port.0: eth0: port 0 with MAC address xx:xx:xx:xx:xx:xx
mv643xx_eth_port mv643xx_eth_port.1: eth1: port 0 with MAC address xx:xx:xx:xx:xx:xx
libertas_sdio: Libertas SDIO driver
libertas_sdio: Copyright Pierre Ossman
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
orion-ehci orion-ehci.0: Marvell Orion EHCI
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000
orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
rtc-mv f1010300.rtc: rtc core: registered f1010300.rtc as rtc0
i2c /dev entries driver
cpuidle: using governor ladder
cpuidle: using governor menu
mmc0: mvsdio driver initialized, lacking card detect (fall back to polling)
oprofile: hardware counters not available
oprofile: using timer interrupt.
TCP: cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
rtc-mv f1010300.rtc: setting system clock to 2012-10-22 01:01:40 UTC (1350867700)
Waiting 5sec before mounting root device...
mmc0: new high speed SDIO card at address 0001
ata1: SATA link down (SStatus 0 SControl F300)
usb 1-1: new high-speed USB device number 2 using orion-ehci
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usb 1-1.1: new high-speed USB device number 3 using orion-ehci
scsi1 : usb-storage 1-1.1:1.0
usb 1-1.4: new full-speed USB device number 4 using orion-ehci
scsi 1:0:0:0: Direct-Access     Generic  STORAGE DEVICE   9910 PQ: 0 ANSI: 0
sd 1:0:0:0: [sda] 62333952 512-byte logical blocks: (31.9 GB/29.7 GiB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] No Caching mode page present
sd 1:0:0:0: [sda] Assuming drive cache: write through
sd 1:0:0:0: [sda] No Caching mode page present
sd 1:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1 sda2 sda3
sd 1:0:0:0: [sda] No Caching mode page present
sd 1:0:0:0: [sda] Assuming drive cache: write through
sd 1:0:0:0: [sda] Attached SCSI removable disk
EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) readonly on device 8:2.
Freeing init memory: 124K
INIT: version 2.88 booting

   OpenRC 0.9.8.4 is starting up Gentoo Linux (armv5tel)

 * Mounting /proc ...
 [ ok ]
 * Mounting /run ...
 [ ok ]
 * /run/lock: creating directory
 * /run/lock: correcting owner
 * Mounting /sys ...
 [ ok ]
 * Mounting debug filesystem ...
 [ ok ]
 * Mounting /dev ...
 [ ok ]
 * Starting udev ...
 [ ok ]
 * Populating /dev with existing devices through uevents ...
 [ ok ]
 * Waiting for uevents to be processed ...
 [ ok ]
 * Mounting /dev/pts ...
 [ ok ]
 * Mounting /dev/shm ...
 [ ok ]
 * Setting system clock using the hardware clock [Local Time] ...
 [ ok ]
 * Autoloaded 0 module(s)
 * Checking local filesystems  ...
/dev/sda2: clean, 237401/1880480 files, 791619/7512960 blocks
 [ ok ]
 * Remounting root filesystem read/write ...
 [ ok ]
 * Updating /etc/mtab ...
 [ ok ]
 * Mounting local filesystems ...
 [ ok ]
 * Configuring kernel parameters ...
 [ ok ]
 * Creating user login records ...
 [ ok ]
 * Cleaning /var/run ...
 [ ok ]
 * Wiping /tmp directory ...
 [ ok ]
 * Setting hostname to rabbithole ...
 [ ok ]
 * Setting terminal encoding [UTF-8] ...
 [ ok ]
 * Setting keyboard mode [UTF-8] ...
 [ ok ]
 * Loading key mappings [us] ...
 [ ok ]
 * Bringing up interface lo
 *   127.0.0.1/8 ...
 [ ok ]
 *   Adding routes
 *     127.0.0.0/8 via 127.0.0.1 ...
 [ ok ]
 * Activating swap devices ...
 [ ok ]
 * Initializing random number generator ...
 [ ok ]
INIT: Entering runlevel: 3
 * Bringing up interface eth0
 *   dhcp ...
 *     Running dhcpcd ...
dhcpcd[1136]: version 5.2.12 starting
dhcpcd[1136]: eth0: rebinding lease of 10.0.0.110
dhcpcd[1136]: eth0: acknowledged 10.0.0.110 from 10.0.0.254
dhcpcd[1136]: eth0: checking for 10.0.0.110
dhcpcd[1136]: eth0: leased 10.0.0.110 for 43200 seconds
dhcpcd[1136]: forked to background, child pid 1162
 [ ok ]
 *     received address 10.0.0.110/24
 [ ok ]
 * Mounting network filesystems ...
 [ ok ]
 * Starting sshd ...
 [ ok ]
 * Doing udev cleanups
 * Starting local
 [ ok ]


This is rabbithole.lan (Linux armv5tel 3.6.0) 01:02:03

rabbithole login:

1 件のコメント:

  1. Are you trying to make cash from your visitors by using popup advertisments?
    If so, have you tried using Clickadu?

    返信削除