четверг, 8 декабря 2011 г.

at91rm9200 & linux

Начал постепенное портирование нового окружения под at91rm9200(atmel, amr9, v4t, 920t-core)

Из удачного - запуск на плате linux с рамдиском. Пока только в рам, остальное надо отлаживать. Внизу дан консольшот на весь процесс. Загрузчик самописный, ядро ванильное с собственными модификациями под плату(Ranbow v1.1, 128 MB SDRAM, чуть позднее будет полное описание платы)



CCCCCCCCCCCCCCCCCCCCCCCCCC
Start on 48MHz clock
Switching to main clock

Running on 16MHz clock
Setup plla_value
Multiplay: 200
Divide: 16
Output clock: 200MHz
Initing PLLA
PLLA inited, switching to PLLA clock

Running on 100MHz clock
Uploading kernel
CCCCCCCCCC

Transfer complete
Byte's sended: 0x17ed00
Uploading kernel finaly
Uploading initrd
CCCCCCCCCCC

Transfer complete
Byte's sended: 0x26a480
Uploading initrd finaly
Upload success
Configuring
Jump to the kernel image

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.38.4 (nis@jane) (gcc version 4.4.5 (Gentoo 4.4.5 p1.3, pie-0.4.5) ) #5 PREEMPT Sat Nov 26 10:09:10 OMST 2011
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91RM9200-DK
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 200 MHz, master 100 MHz, main 16.000 MHz
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: mem=128M root=/dev/ram rw initrd=0x24000000,0x500000 init=/sbin/init ramdisk_size=5000 
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: 128MB = 128MB total
Memory: 120552k/120552k available, 10520k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc8800000 - 0xfee00000   ( 870 MB)
    lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0026000   ( 120 kB)
      .text : 0xc0026000 - 0xc03de340   (3809 kB)
      .data : 0xc03e0000 - 0xc0405080   ( 149 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptable hierarchical RCU implementation.
    RCU-based detection of stalled CPUs is disabled.
    Verbose stalled-CPUs detection is disabled.
NR_IRQS:192
AT91: 96 gpio irqs in 3 banks
Console: colour dummy device 80x30
console [tty0] enabled
console [ttyS0] enabled
Calibrating delay loop... 99.73 BogoMIPS (lpj=498688)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
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
Switching to clocksource 32k_counter
Switched to NOHz mode on CPU #0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
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
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (no cpio magic); looks like an initrd
Freeing initrd memory: 5120K
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 245
io scheduler noop registered
io scheduler deadline registered (default)
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
atmel_usart.1: ttyS1 at MMIO 0xfffc4000 (irq = 7) is a ATMEL_SERIAL
at91_spi: Baud rate set to 5555555
brd: module loaded
loop: module loaded
nbd: registered device at major 43
physmap platform flash device: 00200000 at 10000000
physmap-flash physmap-flash.0: map_probe failed
Generic platform RAM MTD, (c) 2004 Simtec Electronics
No SmartMedia card inserted.
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
PPP BSD Compression module registered
at91_ether: Your bootloader did not configure a MAC address.
eth0: Link down.
eth0: AT91 ethernet at 0xfefbc000 int=24 10-HalfDuplex (00:00:00:00:00:00)
eth0: Micrel KS8721 PHY
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 23, io mem 0x00300000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
USB Serial support registered for Keyspan - (without firmware)
USB Serial support registered for Keyspan 1 port adapter
USB Serial support registered for Keyspan 2 port adapter
USB Serial support registered for Keyspan 4 port adapter
usbcore: registered new interface driver keyspan
keyspan: v1.1.5:Keyspan USB to Serial Converter Driver
USB Serial support registered for MCT U232
usbcore: registered new interface driver mct_u232
mct_u232: z2.1:Magic Control Technology USB-RS232 converter driver
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
at91_udc: probe of at91_udc failed with error -22
mousedev: PS/2 mouse device common for all mice
at91_rtc at91_rtc: rtc core: registered at91_rtc as rtc0
AT91 Real Time Clock driver.
i2c /dev entries driver
AT91 Watchdog Timer enabled (5 seconds, nowayout)
at91_mci at91_mci: 4 wire bus mode not supported - using 1 wire
TCP cubic registered
NET: Registered protocol family 17
Registering the dns_resolver key type
RAMDISK: gzip image found at block 0
usb 1-2: new low speed USB device using at91_ohci and address 2
usb 1-2: device descriptor read/64, error -62
usb 1-2: device descriptor read/64, error -62
usb 1-2: new low speed USB device using at91_ohci and address 3
usb 1-2: device descriptor read/64, error -62
usb 1-2: device descriptor read/64, error -62
usb 1-2: new low speed USB device using at91_ohci and address 4
VFS: Mounted root (ext2 filesystem) on device 1:0.
Freeing init memory: 120K


(none) login: usb 1-2: device not accepting address 4, error -62
usb 1-2: new low speed USB device using at91_ohci and address 5
usb 1-2: device not accepting address 5, error -62
hub 1-0:1.0: unable to enumerate USB device on port 2


(none) login: root
login[526]: root login on 'UNKNOWN'

~ # mount -a
~ # l [Jmount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw,relatime,errors=continue)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /dev type tmpfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
tmpfs on /var type tmpfs (rw,relatime)
~ # mdev -s
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 5
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 6
mdev: unknown user/group root:tty on line 7
mdev: unknown user/group root:tty on line 7
~ # free
             total         used         free       shared      buffers
Mem:        125792        10180       115612            0           52
-/+ buffers:              10128       115664
Swap:            0            0            0
~ # df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 4.7M      1.9M      2.5M  43% /
tmpfs                    61.4M         0     61.4M   0% /dev
tmpfs                    61.4M         0     61.4M   0% /tmp
tmpfs                    61.4M         0     61.4M   0% /var
~ # mount [J [J [J [J [Jifconf
~ # ifconfig [Je [Jlo up
~ # ping [J [J [J [Jin [Jfo [Jcofig [J [J [Jngi lo 127.0.0.1
-sh: ifcongi: not found
~ #
~ # ifcongi lo 127.0.0.1 [J i lo 127.0.0.1 [J [13D lo 127.0.0.1 [J [13Df lo 127.0.0.1 [13D
~ # ifconfig  lo 127.0.0.1 [J [13Dlo 127.0.0.1 [J [12Dlo 127.0.0.1
~ # ifcon
~ # ifconfig [J
lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

~ # ping 19 [J27.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: seq=0 ttl=64 time=1.495 ms
64 bytes from 127.0.0.1: seq=1 ttl=64 time=0.641 ms
64 bytes from 127.0.0.1: seq=2 ttl=64 time=0.641 ms
64 bytes from 127.0.0.1: seq=3 ttl=64 time=0.641 ms
64 bytes from 127.0.0.1: seq=4 ttl=64 time=0.640 ms
64 bytes from 127.0.0.1: seq=5 ttl=64 time=0.855 ms
64 bytes from 127.0.0.1: seq=6 ttl=64 time=0.641 ms

--- 127.0.0.1 ping statistics ---
7 packets transmitted, 7 packets received, 0% packet loss
round-trip min/avg/max = 0.640/0.793/1.495 ms
~ # ls /
[1;34mbin [0m         [1;34metc [0m         [1;34mlost+found [0m  [1;34mroot [0m        [1;34msys [0m         [1;34musr [0m
[1;34mdev [0m         [1;32mlinuxrc [0m     [1;34mproc [0m        [1;34msbin [0m        [1;34mtmp [0m         [1;34mvar [0m
~ # top
[H [JMem: 10216K used, 115576K free, 0K shrd, 52K buff, 1864K cached
CPU:  0.0% usr  9.0% sys  0.0% nic 90.9% idle  0.0% io  0.0% irq  0.0% sirq
Load average: 0.00 0.01 0.01 1/20 539
[7m  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND [0m
  539   526 root     R     2220  1.7   0  9.0 top
  526     1 root     S     2224  1.7   0  0.0 -sh
    1     0 root     S     2220  1.7   0  0.0 init
    5     2 root     SW       0  0.0   0  0.0 [kworker/u:0]
    3     2 root     SW       0  0.0   0  0.0 [ksoftirqd/0]
    2     0 root     SW       0  0.0   0  0.0 [kthreadd]
    4     2 root     SW       0  0.0   0  0.0 [kworker/0:0]
    6     2 root     SW<      0  0.0   0  0.0 [khelper]
   10     2 root     SW<      0  0.0   0  0.0 [netns]
  100     2 root     SW       0  0.0   0  0.0 [sync_supers]
  102     2 root     SW       0  0.0   0  0.0 [bdi-default]
  104     2 root     SW<      0  0.0   0  0.0 [kblockd]
  115     2 root     SW       0  0.0   0  0.0 [khubd]
  215     2 root     SW       0  0.0   0  0.0 [kswapd0]
  266     2 root     SW       0  0.0   0  0.0 [fsnotify_mark]
  268     2 root     SW<      0  0.0   0  0.0 [aio]
  285     2 root     SW<      0  0.0   0  0.0 [crypto]
  478     2 root     SW       0  0.0   0  0.0 [kworker/0:1]
  517     2 root     SW       0  0.0   0  0.0 [kworker/u:2]
  527     2 root     SW       0  0.0   0  0.0 [flush-1:0]
[H [JMem: 10216K used, 115576K free, 0K shrd, 52K buff, 1864K cached
CPU:  0.0% usr  0.3% sys  0.0% nic 99.0% idle  0.0% io  0.1% irq  0.3% sirq
Load average: 0.00 0.01 0.01 1/20 539
[7m  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND [0m
  539   526 root     R     2224  1.7   0  0.5 top
    3     2 root     SW       0  0.0   0  0.2 [ksoftirqd/0]
  526     1 root     S     2224  1.7   0  0.0 -sh
    1     0 root     S     2220  1.7   0  0.0 init
    5     2 root     SW       0  0.0   0  0.0 [kworker/u:0]
    2     0 root     SW       0  0.0   0  0.0 [kthreadd]
    4     2 root     SW       0  0.0   0  0.0 [kworker/0:0]
    6     2 root     SW<      0  0.0   0  0.0 [khelper]
   10     2 root     SW<      0  0.0   0  0.0 [netns]
  100     2 root     SW       0  0.0   0  0.0 [sync_supers]
  102     2 root     SW       0  0.0   0  0.0 [bdi-default]
  104     2 root     SW<      0  0.0   0  0.0 [kblockd]
  115     2 root     SW       0  0.0   0  0.0 [khubd]
  215     2 root     SW       0  0.0   0  0.0 [kswapd0]
  266     2 root     SW       0  0.0   0  0.0 [fsnotify_mark]
  268     2 root     SW<      0  0.0   0  0.0 [aio]
  285     2 root     SW<      0  0.0   0  0.0 [crypto]
  4527     2 root     SW       0  0.0   0  0.0 [flush-1:0]
[H 78     2 root     SW       0  0.0   0  0.0 [kworker/0:1]
  517     2 root     SW       0  0.0   0  0.0 [kworker/u:2]
  [JMem: 10216K used, 115576K free, 0K shrd, 52K buff, 1864K cached
CPU:  0.3% usr  0.1% sys  0.0% nic 99.4% idle  0.0% io  0.0% irq  0.0% sirq
Load average: 0.00 0.01 0.01 1/20 539
[7m  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND [0m
  539   526 root     R     2224  1.7   0  0.4 top
    3     2 root     SW       0  0.0   0  0.1 [ksoftirqd/0]
  526     1 root     S     2224  1.7   0  0.0 -sh
    1     0 root     S     2220  1.7   0  0.0 init
    5     2 root     SW       0  0.0   0  0.0 [kworker/u:0]
    2     0 root     SW       0  0.0   0  0.0 [kthreadd]
    4     2 root     SW       0  0.0   0  0.0 [kworker/0:0]
    6     2 root     SW<      0  0.0   0  0.0 [khelper]
   10     2 root     SW<      0  0.0   0  0.0 [netns]
  100     2 root     SW       0  0.0   0  0.0 [sync_supers]
  102     2 root     SW       0  0.0   0  0.0 [bdi-default]
  104     2 root     SW<      0  0.0   0  0.0 [kblockd]
  115     2 root     SW       0  0.0   0  0.0 [khubd]
  215     2 root     SW       0  0.0   0  0.0 [kswapd0]
  266     2 root     SW       0  0.0   0  0.0 [fsnotify_mark]
  268     2 root     SW<      0  0.0   0  0.0 [aio]
  285     2 root     SW<      0  0.0   0  0.0 [crypto]
  478     2 root     SW       0  0.0   0  0.0 [kworker/0:1]
  517     2 root     SW       0  0.0   0  0.0 [kworker/u:2]
  527     2 root     SW       0  0.0   0  0.0 [flush-1:0]

~ # uptime
 00:06:35 up 6 min,  0 users,  load average: 0.00, 0.01, 0.00
~ # last
last: can't open '/var/log/wtmp': No such file or directory
~ #