in Embedded, Linux

Embedded Linux S3C2440 Environment Startup


Summarize the Embedded Linux S3C2440 board startup, for the environment setup, can refer to another blog entry.

Powering Up The Board

S3C2440 board
Use the Xshell to login the Fedora, connect the serial port, and use minicom command to start the minicom,

[root@localhost ~]# minicom

Result is as,

Welcome to minicom 2.5

Compiled on Jan 14 2012, 12:40:43.
Port /dev/ttyUSB0

Press CTRL-A Z for help on special keys

If it is using USB convert to serial port, it is showing /dev/ttyUSB0
Put the power switch to “on” position to apply power, below menu of bootloader will display,

##### FriendlyARM BIOS 2.0 for 2440 #####
[x] format NAND FLASH for Linux
[v] Download vivi 
[k] Download linux kernel 
[y] Download root_yaffs image 
[a] Absolute User Application
[n] Download Nboot for WinCE 
[l] Download WinCE boot-logo
[w] Download WinCE NK.bin 
[d] Download & Run 
[z] Download zImage into RAM 
[g] Boot linux from RAM 
[f] Format the nand flash 
[b] Boot the system 
[s] Set the boot parameters 
[u] Backup NAND Flash to HOST through USB(upload) 
[r] Restore NAND Flash from HOST through USB 
[q] Goto shell of vivi 
[i] Version: 1026-2K
Enter your selection: 

Key in ‘b’ to boot the S3C2440 board with pre-installed Linux Kernel, the Linux boot process is as below,

Enter your selection: b
Copy linux kernel from 0x00060000 to 0x30008000, size = 0x00600000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: \"noinitrd init=/init console=ttySAC0,115200\"
MACH_TYPE = 1999
NOW, Booting Linux......
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 3.8.7-FriendlyARM (root@localhost.localdomain) (gcc version 4.7.2 (Buildroot 2013.02) ) #10 Wed Jun 1 00:42:59 SGT 2016
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: MINI2440
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, Copyright 2004 Simtec Electronics
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: noinitrd init=/init console=ttySAC0,115200
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
__ex_table already sorted, skipping sort
Memory: 64MB = 64MB total
Memory: 52664k/52664k available, 12872k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xc4800000 - 0xff000000   ( 936 MB)
    lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc0472ee4   (4524 kB)
      .init : 0xc0473000 - 0xc0b8072c   (7222 kB)
      .data : 0xc0b82000 - 0xc0bbe868   ( 243 kB)
       .bss : 0xc0bbe868 - 0xc0bfaa00   ( 241 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
sched_clock: 32 bits at 200 Hz, resolution 5000000ns, wraps every 4294967291ms
Console: colour dummy device 80x30
Calibrating delay loop... 201.52 BogoMIPS (lpj=503808)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x30341670 - 0x303416ac
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
MINI2440: Option string mini2440=0tb
MINI2440: \'t\' ignored, touchscreen not compiled in
MINI2440: LCD [0:240x320] 1:800x480 2:1024x768 3:320x240
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C244X: Clock Support, DVS off
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
Linux video capture interface: v2.00
NET: Registered protocol family 2
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
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)
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 102
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)
Console: switching to colour frame buffer device 30x20
s3c2410-lcd s3c2410-lcd: fb0: s3c2410fb frame buffer device
s3c2440-uart.0: ttySAC0 at MMIO 0x50000000 (irq = 70) is a S3C2440
console [ttySAC0] enabled
s3c2440-uart.1: ttySAC1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: ttySAC2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
loop: module loaded
Loading iSCSI transport class v2.0-870.
s3c24xx-nand s3c2440-nand: Tacls=1, 9ns Twrph0=3 29ns, Twrph1=2 19ns
s3c24xx-nand s3c2440-nand: NAND soft ECC
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit), 256MiB, page size: 2048, OOB size: 64
Creating 4 MTD partitions on \"nand\":
0x000000000000-0x000000040000 : \"u-boot\"
0x000000040000-0x000000060000 : \"u-boot-env\"
0x000000060000-0x000000560000 : \"kernel\"
0x000000560000-0x000010000000 : \"root\"
dm9000 Ethernet Driver, V1.31
dm9000_probe Set bwscon and bankcon4
dm9000 dm9000: read wrong id 0x01010101
dm9000 dm9000: eth%d: Invalid ethernet MAC address. Please set using ifconfig
Now use the default MAC address: 08:90:90:90:90:90
eth0: dm9000e at c48bc300,c48be304 IRQ 51 MAC: 08:90:90:90:90:90 (chip)
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver rndis_host
ohci_hcd: USB 1.1 \'Open\' Host Controller (OHCI) Driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mousedev: PS/2 mouse device common for all mice
s3c-rtc s3c2410-rtc: rtc disabled, re-enabling
s3c-rtc s3c2410-rtc: rtc core: registered s3c as rtc0
oprofile: no performance counters
oprofile: using timer interrupt.
TCP: cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 17
Key type dns_resolver registered
console [netcon0] enabled
netconsole: network logging started
s3c-rtc s3c2410-rtc: setting system clock to 2165-04-20 22:25:28 UTC (1868198232)
Freeing init memory: 7220K
starting pid 451, tty \'\': \'/etc/init.d/rcS\'
* Mounting /proc...
* Mounting /dev...
* Mounting /sys...
* Mounting /dev/pts...
* Mounting /dev/shm...
* Starting system loggers...
* Creating devices...
* Configuring loopback interface...
* Setting hostname...
eth0 up
dm9000 dm9000 eth0: link down
starting pid 467, tty \'\': \'/usr/sbin/telnetd -l /bin/login\'
starting pid 468, tty \'\': \'-/bin/login\'

Logging In and Exploring

Login with user ‘root’ without password,

mini2440 login: root
-sh: can\'t access tty; job control turned off
[root@mini2440 /root]# 

Test some command, list the supported command,

[root@mini2440 /root]# ls /bin
ash            dnsdomainname  ln             mv             setserial
busybox        echo           login          netstat        sh
cat            egrep          ls             nice           sleep
chgrp          false          makemime       pidof          stty
chmod          fgrep          mkdir          ping           su
chown          fsync          mknod          ps             touch
conspy         grep           more           pwd            umount
cp             hostname       mount          reformime      uname
date           iostat         mountpoint     rm             vi
df             kill           mpstat         rmdir
[root@mini2440 /root]# 

Explore the /proc directory, it is the virtual directory that provides a window into the kernel,
/proc/cpuinfo returns detail about CPU.

[root@mini2440 /root]# cat /proc/cpuinfo 
processor       : 0
model name      : ARM920T rev 0 (v4l)
BogoMIPS        : 201.52
Features        : swp half 
CPU implementer : 0x41
CPU architecture: 4T
CPU variant     : 0x1
CPU part        : 0x920
CPU revision    : 0

Hardware        : MINI2440
Revision        : 0000
Serial          : 0000000000000000
[root@mini2440 /root]# 

/proc/interrupts returns interrupt statistics,

[root@mini2440 /root]# cat /proc/interrupts 
 24:          0       s3c  s3c2410-rtc tick
 30:     112084       s3c  S3C2410 Timer Tick
 32:          0       s3c  s3c2410-lcd
 46:          0       s3c  s3c2410-rtc alarm
 51:          0   s3c-ext  eth0
 70:         67  s3c-uart0  s3c2440-uart
 71:        192  s3c-uart0  s3c2440-uart
Err:          0
[root@mini2440 /root]# 
[root@mini2440 /root]# cat /proc/version 
Linux version 3.8.7-FriendlyARM (root@localhost.localdomain) (gcc version 4.7.2 (Buildroot 2013.02) ) #10 Wed Jun 1 00:42:59 SGT 2016
[root@mini2440 /root]# 

Write a Comment


14 − 5 =