Linux Kernel 3.16.3 for HDL-GXR

ダウンロード

注意

  1. 自己責任で使用してください。サポートなどは一切ありません。
  2. 2.6.39.4用カーネルパッチに基づいて、内容を3.16.3用にしたものです。
  3. クロスコンパイルの環境整備については、日記/2014-03-28/debian wheezy 上でのクロスコンパイラのビルド – BAK を参考に。

使い方

1.3.16.3 のカーネルソース、上記カーネルパッチ をダウンロードして、適当な場所に置きます。
2.カーネルソースを展開し、パッチを当てます。

# wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.16.3.tar.gz
# tar xvfj linux-3.16.3.tar.bz2
# cd linux-3.16.3/
# patch -p1 < ../hdl-gxr-kernel-3.16.3.patch
patching file arch/arm/boot/compressed/head.S
patching file arch/arm/kernel/head.S
patching file arch/arm/mach-orion5x/Kconfig
patching file arch/arm/mach-orion5x/Makefile
patching file arch/arm/mach-orion5x/hdl_gxr-setup.c
patching file arch/arm/tools/mach-types

3..config を整備します

# mv ../hdl-gxr-config-3.16.3.txt .config
# ARCH=arm make menuconfig

特に変更なければ、終了します。

4.makeします

# ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make uImage modules

できあがったら、カーネルとモジュールを配置して、リブートします。

  • arch/arm/boot/uImage をHDL-GXRのsda1にコピーし、名前を uImage.gxr に変更する。
  • # ARCH=arm INSTALL_MOD_PATH=(どこか) make modules_install

等として、(どこか)/lib以下を、HDL-GXRのsda2にコピーする。

5.コンパイル済みのカーネルを使う場合、

# mkdir /mnt/wheezy-sdb1 /mnt/wheezy-sdb2
# mount /dev/sdb1 /mnt/wheezy-sdb1
# mount /dev/sdb2 /mnt/wheezy-sdb2
# tar xzvf kernel-3.16.3-hdl_gxr.tar.gz
# cd kernel-3.16.3-hdl_gxr
# cp boot-3.16.3-hdl_gxr/* /mnt/wheezy-sdb1/boot
# cp lib-3.16.3-hdl_gxr/lib/* /mnt/wheezy-sdb2/lib

起動ログ

=========================================
    HDL-GXR series Initial boot loader

 Copyright (C) 2006 I-O DATA DEVICE,INC.
========================================= ** LOADER **
 ** MARVELL BOARD: DB_MV88F5182_HDL_GT LE 

U-Boot 1.1.1 (Oct  5 2006 - 13:58:33) MV : 1.7.3 (I-O DATA 0.9(GX))

DRAM CS[0] base 0x00000000   size 128MB 
DRAM Total size 128MB 
MX AM29LV400B (4 Mbit, bottom boot sect)
Size: 512 kB,Bus Width: 2, device Width: 2.
Flash base: 0xfff80000,Number of Sectors: 11 Type: BOTTOM.
[512kB@fff80000] Flash: 512 kB
Addresses 20M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (20M - 16M): Done

Soc: MV88F5182 Rev 2
CPU: ARM926 (Rev 0) running @ 400Mhz 
SysClock = 200Mhz , TClock = 166Mhz 


USB 0: host mode
USB 1: host mode
PCI 0: PCI Express Root Complex Interface
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0 

Reset IDE: 
Marvell Serial ATA Adapter
Intergrated Sata device found
 0 0: waitting for SRSTStatus=0x80
 0 0: waitting for SRSTStatus=0x80
  Device 0: OK
Model: SAMSUNG SP2504C                          Firm: VT100-33 Ser#: S09QJ1HLB35902      
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 238419.5 MB = 232.8 GB (488283264 x 512)


Marvell Serial ATA Adapter
Intergrated Sata device found
  Device 0: OK
Model: SAMSUNG SP2504C                          Firm: VT100-33 Ser#: S09QJ1HLB35902      
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 238419.5 MB = 232.8 GB (488283264 x 512)

Using device ide 0:1, directory: /
<DIR>       1024 .
<DIR>       1024 ..
<DIR>      12288 lost+found
<SYM>         17 uImage.gxr
           65743 hdl-gxr-config-2.6.39.4.txt
             128 initrd.gxr
         3045028 uImage.gxr.2.6.39.4
         1415576 uImage.gxr.UBoot-2.6.12.6
           36299 hdl-gxr-config-2.6.28.10.txt
         4256072 uImage.gxr.3.16.3
           84143 hdl-gxr-config-3.16.3.txt
         2509544 uImage.gxr.2.6.28.10
Using device ide0, partition 1

Loading from block device ide device 0, partition 1: Name: hda1
  Type: U-Boot  File:/initrd.gxr

128 bytes read
Using device ide0, partition 1

Loading from block device ide device 0, partition 1: Name: hda1
  Type: U-Boot  File:/uImage.gxr

4256072 bytes read
## Booting image at 00200000 ...
   Image Name:   Linux-3.16.3
   Created:      2014-09-20  14:05:48 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4256008 Bytes =  4.1 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Initializing cgroup subsys cpu
Initializing cgroup subsys cpuacct
Linux version 3.16.3 (root@debian) (gcc version 4.7.2 (Debian 4.7.2-5) ) #3 Sat Sep 20 23:05:34 JST 2014
CPU: Feroceon [41069260] revision 0 (ARMv5TEJ), cr=a005317f
CPU: VIVT data cache, VIVT instruction cache
Machine: I-O DATA HDL-GXR NAS
Clearing invalid memory bank 0KB@0xffffffff
Clearing invalid memory bank 0KB@0xffffffff
Clearing invalid memory bank 0KB@0xffffffff
Ignoring unrecognised tag 0x00000000
Ignoring unrecognised tag 0x00000000
Ignoring unrecognised tag 0x00000000
Ignoring tag cmdline (using the default kernel command line)
Ignoring unrecognised tag 0x41000403
Memory policy: Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: console=ttyS0,115200 root=/dev/sda2 ro mem=128M
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 121260K/131072K available (5718K kernel code, 372K rwdata, 1992K rodata, 275K init, 255K bss, 9812K reserved)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xffe00000   (2048 kB)
    vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
    lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc078fd30   (7712 kB)
      .init : 0xc0790000 - 0xc07d4e04   ( 276 kB)
      .data : 0xc07d6000 - 0xc0833138   ( 373 kB)
       .bss : 0xc0833138 - 0xc0872f04   ( 256 kB)
NR_IRQS:64
sched_clock: 32 bits at 166MHz, resolution 6ns, wraps every 25769803770ns
Console: colour dummy device 80x30
Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
Initializing cgroup subsys devices
Initializing cgroup subsys net_cls
Initializing cgroup subsys blkio
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x56db40 - 0x56db98
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
Orion ID: MV88F5182-A2. TCLK=166666667.
vgaarb: loaded
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
Switched to clocksource orion_clocksource
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
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.
NetWinder Floating Point Emulator V0.97 (double precision)
futex hash table entries: 256 (order: -1, 3072 bytes)
audit: initializing netlink subsys (disabled)
audit: type=2000 audit(0.190:1): initialized
VFS: Disk quotas dquot_6.5.2
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
Key type cifs.spnego registered
fuse init (API version 7.23)
SGI XFS with security attributes, large block/inode numbers, no debug enabled
msgmni has been set to 236
alg: No test for stdrng (krng)
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
crc32: CRC_LE_BITS = 64, CRC_BE BITS = 64
crc32: self tests passed, processed 225944 bytes in 3541662 nsec
crc32c: CRC_LE_BITS = 64
crc32c: self tests passed, processed 225944 bytes in 2598810 nsec
crc32_combine: 8373 self tests passed
crc32c_combine: 8373 self tests passed
mv_xor mv_xor.0: Marvell shared XOR driver
mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
console [ttyS0] disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 3, base_baud = 10416666) is a 16550A
console [ttyS0] enabled
serial8250.1: ttyS1 at MMIO 0xf1012100 (irq = 4, base_baud = 10416666) is a 16550A
brd: module loaded
loop: module loaded
rbd: loaded
sata_mv sata_mv.0: cannot get optional clkdev
sata_mv sata_mv.0: slots 32 ports 2
scsi0 : sata_mv
scsi1 : sata_mv
ata1: SATA max UDMA/133 irq 29
ata2: SATA max UDMA/133 irq 29
libphy: orion_mdio_bus: probed
mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:a0:b0:8d:4f:ff
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
ehci-orion: EHCI orion driver
orion-ehci orion-ehci.0: EHCI Host Controller
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
orion-ehci orion-ehci.0: irq 17, io mem 0xf1050000
orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 3.16.3 ehci_hcd
usb usb1: SerialNumber: orion-ehci.0
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
orion-ehci orion-ehci.1: EHCI Host Controller
orion-ehci orion-ehci.1: new USB bus registered, assigned bus number 2
orion-ehci orion-ehci.1: irq 12, io mem 0xf10a0000
orion-ehci orion-ehci.1: USB 2.0 started, EHCI 1.00
usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: EHCI Host Controller
usb usb2: Manufacturer: Linux 3.16.3 ehci_hcd
usb usb2: SerialNumber: orion-ehci.1
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver ums-alauda
usbcore: registered new interface driver ums-cypress
usbcore: registered new interface driver ums-datafab
usbcore: registered new interface driver ums-freecom
usbcore: registered new interface driver ums-isd200
usbcore: registered new interface driver ums-jumpshot
usbcore: registered new interface driver ums-karma
usbcore: registered new interface driver ums-onetouch
usbcore: registered new interface driver ums-sddr09
usbcore: registered new interface driver ums-sddr55
usbcore: registered new interface driver ums-usbat
usbcore: registered new interface driver usb_ehset_test
usbcore: registered new interface driver sisusb
mousedev: PS/2 mouse device common for all mice
TCP: cubic registered
NET: Registered protocol family 10
NET: Registered protocol family 17
Key type dns_resolver registered
Key type ceph registered
libceph: loaded (mon/osd proto 15/24)
registered taskstats version 1
input: gpio-keys as /devices/platform/gpio-keys/input/input0
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata1.00: HPA detected: current 488283264, native 488397168
ata1.00: ATA-7: SAMSUNG SP2504C, VT100-33, max UDMA7
ata1.00: 488283264 sectors, multi 0: LBA48 NCQ (depth 31/32)
ata1.00: configured for UDMA/133
scsi 0:0:0:0: Direct-Access     ATA      SAMSUNG SP2504C  0-33 PQ: 0 ANSI: 5
sd 0:0:0:0: Attached scsi generic sg0 type 0
sd 0:0:0:0: [sda] 488283264 512-byte logical blocks: (250 GB/232 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2 sda3
sd 0:0:0:0: [sda] Attached SCSI disk
ata2: SATA link down (SStatus 0 SControl 300)
kjournald starting.  Commit interval 5 seconds
EXT3-fs (sda2): mounted filesystem with ordered data mode
VFS: Mounted root (ext3 filesystem) readonly on device 8:2.
Freeing unused kernel memory: 272K (c0790000 - c07d4000)
INIT: version 2.88 booting
[info] Using makefile-style concurrent boot in runlevel S.
[ ok ] Starting the hotplug events dispatcher: udevd.
[ ok ] Synthesizing the initial hotplug events...done.
[ ok ] Waiting for /dev to be fully populated...done.
random: nonblocking pool is initialized
[....] Activating swap...Adding 2837052k swap on /dev/sda3.  Priority:-1 extents:1 across:2837052k 
done.
[....] Checking root file system...fsck from util-linux 2.20.1
/dev/sda2: clean, 57339/15073280 files, 2455390/60293120 blocks
done.
EXT3-fs (sda2): using internal journal
[ ok ] Cleaning up temporary files... /tmp.
[ ok ] Activating lvm and md swap...done.
[....] Checking file systems...fsck from util-linux 2.20.1
/dev/sda1: clean, 20/32768 files, 16893/131072 blocks
done.
[ ok ] Mounting local filesystems...done.
[ ok ] Activating swapfile swap...done.
[ ok ] Cleaning up temporary files....
[ ok ] Setting kernel variables ...done.
[....] Configuring network interfaces...Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Listening on LPF/eth0/00:a0:b0:8d:4f:ff
Sending on   LPF/eth0/00:a0:b0:8d:4f:ff
Sending on   Socket/fallback
DHCPREQUEST on eth0 to 255.255.255.255 port 67
mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.3.1
bound to 192.168.3.21 -- renewal in 34069 seconds.
done.
[ ok ] Cleaning up temporary files....
INIT: Entering runlevel: 2
[info] Using makefile-style concurrent boot in runlevel 2.
[ ok ] Network Interface Plugging Daemon...start eth0...done.
[ ok ] Starting enhanced syslogd: rsyslogd.
[ ok ] Starting periodic command scheduler: cron.
[ ok ] Starting system message bus: dbus.
[ ok ] Starting OpenBSD Secure Shell server: sshd.

Debian GNU/Linux 7 landiskgxr ttyS0

landiskgxr login: 

ハマったポイント

arch/arm/mach-orion5x/hdl_gxr-setup.c は全面的に書き直した。
rd88f5182-setup.c と、ls_hgl-setup.c を参考にしましたが、エラーが出てなかなかコンパイルが通らなかった。
結局、

#include <linux/gpio_keys.h>
#include <linux/input.h>

を書くのを忘れていたことが、最大の原因。
また、menuconfig は、過去のものを参考にしたけど、
Userspace binary formats —>
Kernel support for scripts starting with #!
をオンにしなかったため、ifup 等が使えずネットワークにつながらない状態になった。
シリアルコンソールあってよかったー。
なんか要らないモジュールとかいっぱい入ってる気がするし、電源ボタン長押ししても電源が切れないとか、不具合たくさんありそう。
でもまあ、自分で作り上げたカーネルは愛着あります。2.6系とどう違うんだろう。

“Linux Kernel 3.16.3 for HDL-GXR” への1件のコメント

  1. なかおちゃん より:

    # HDL-GXRをまだ開発している人がいて、ちょっとうれしいです。

    HDL4-Gのポーティングを行ってます。
    参考にとパッチを拝見しましたが、やはりmachine IDが固定でしたね。
    I-O DATAのU-BootソースはHDL4-GもHDL-GXRも固定値なので、識別方法を思案中です。

    あと、シャットダウンはマイコンで制御かなぁ、と思ったのですが、GPIOで実現できましたか?

    HDL4-Gの方が落ち着いたら、HDL-GXRのポーティングをする予定なので、できたらおすそ分けしますね(笑)

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です