因为前段时间做成程序老是有死机的现象,程序主要在QT多串口通信。开始以为是linux下串口黑洞引起因为死机的时候内核也死掉了。所以就想法吧内核给升级一下,看到网上周立功的技术支持在移植过 linux2.6.31但是 我想其索要人家不给,没办法就得自己动手。其中走了不少弯路。先介绍一下如何将linux2.6.39.2移植到smartar3250上运行。
1.首先在lpc官网上下载 lpc3250的提供的内核以及补丁。
2.直接用phy3250的配置文件编译,不要用2010-09-2的uboot引导,编译后的内核将直接能被解压执行。MACHINE_START(LPC3XXX, "Phytec 3250 board with the LPC3250 Microcontroller")。
3.Nandflash 配置 2.6.39.2内核nandflash 驱动是带ecc验证,而SarmtArm3250是没有的所以要修改Nandflash驱动 linux-2.6.39.2\drivers\mtd\nand\lpc32xx_nand.c中chip->ecc.mode = NAND_ECC_HW_SYNDROME;改成chip->ecc.mode = NAND_ECC_NONE;这样完成 flash驱动。
4.Flash分区,用smart3250原有的分区进行分区,将来还用zlg给提供文件系统。
5.屏幕驱动 修改 这是我的屏幕649 480的,自己的屏幕按说明书配置。
.name = "QVGA TFT-6862",
.refresh = 60,
.xres = 640,
.yres = 480,
.pixclock = 91828,//191828,
.left_margin = 200,
.right_margin = 65,
.upper_margin = 35,
.lower_margin = 12,
.hsync_len = 1,
.vsync_len = 1,
.sync = 0,
如果你的smart3250屏不是QVGA TFT-6862那注意自己去设一下低电平输出有效的问题。再启动内核将能在屏幕上看到小企鹅了。但是系统还是起不来。
6.文件系统移植因为内核中支持cramfs同时zlg提供了cramfs文件系统所以直接在内核配置选中cramfs文件系统,在uboot中运行 run safemode 系统就能成功的运行起来了。
7.系统启动后内核中的网卡还是不能启用.需要在内核中更改网卡驱动程序,设置网卡的MAC地址。
8.内核系统中没有yaffs驱动,需要打补丁。
9.系统启动但是系统还有一些驱动没有设置,对系统启动已经没有问题了。
5KS ok!
Autoboot in progress, press any key to stop
U-Boot 1.3.3 (May 5 2009 - 13:04:13)
DRAM: 64 MB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Hit any key to stop autoboot: 0
NAND read: device 0 offset 0x200000, size 0x1e38dc
Reading data from 0x3e3800 -- 100% complete.
1980636 bytes read: OK
## Booting kernel from Legacy Image at 81000000 ...
Image Name: Linux-2.6.39.2
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1980572 Bytes = 1.9 MB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
€0 €?Linux version 2.6.39.2 ([email protected]) (gcc version 4.3.2 (crosstool-NG-1.3.1) ) #8 PREEMPT Thu Mar 22 11:56:19 CST 2012
CPU: ARM926EJ-S [41069264] revision 4 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Phytec 3250 board with the LPC3250 Microcontroller
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: root=/dev/mtdblock4 console=ttyS0,115200 mem=64M rootfstype=yaffs2
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)
Memory: 64MB = 64MB total
Memory: 60740k/60740k available, 4796k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
DMA : 0xffc00000 - 0xffe00000 ( 2 MB)
vmalloc : 0xc4800000 - 0xf0000000 ( 696 MB)
lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.init : 0xc0008000 - 0xc002a000 ( 136 kB)
.text : 0xc002a000 - 0xc03d5000 (3756 kB)
.data : 0xc03d6000 - 0xc03f7d00 ( 136 kB)
Preemptable hierarchical RCU implementation.
RCU-based detection of stalled CPUs is disabled.
Verbose stalled-CPUs detection is disabled.
NR_IRQS:96
Console: colour dummy device 80x30
Calibrating delay loop... 103.83 BogoMIPS (lpj=519168)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
LPC32XX unique ID: 00000000000000000000000000000000
bio: create slab
SCSI subsystem initialized
ssp-pl022 dev:ssp0: ARM PL022 driver, device ID: 0x00041022
pl022: mapped registers from 0x20084000 to c4814000
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Advanced Linux Sound Architecture Driver Version 1.0.24.
Switching to clocksource lpc32xx_clksrc
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: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
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 udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
msgmni has been set to 118
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
clcd-pl11x dev:clcd: PL111 rev1 at 0x31040000
clcd-pl11x dev:clcd: Phytec LCD hardware, QVGA TFT-6862 display
Console: switching to colour frame buffer device 80x30
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x40090000 (irq = 9) is a 16550A
console [ttyS0] enabled
serial8250.0: ttyS1 at MMIO 0x40080000 (irq = 7) is a U6_16550A
serial8250.0: ttyS2 at MMIO 0x40098000 (irq = 10) is a U6_16550A
lpc32xx_hsuart.0: ttyTX0 at MMIO 0x40014000 (irq = 26) is a lpc32xx_hsuart
lpc32xx_hsuart.0: ttyTX1 at MMIO 0x40018000 (irq = 25) is a lpc32xx_hsuart
lpc32xx_hsuart.0: ttyTX2 at MMIO 0x4001c000 (irq = 24) is a lpc32xx_hsuart
brd: module loaded
loop: module loaded
at25 spi0.0: 32 KByte at25256a eeprom, pagesize 64
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Bad eraseblock 0 at 0x000000000000
Bad eraseblock 1 at 0x000000020000
Bad eraseblock 2 at 0x000000040000
Bad eraseblock 184 at 0x000001700000
Creating 5 MTD partitions on "lpc32xx-nand":
0x000000000000-0x000000180000 : "smartarm3250-boot"
0x000000180000-0x0000001c0000 : "smartarm3250-ubt-prms"
0x000000200000-0x000000600000 : "smartarm3250-kernel"
0x000000600000-0x000001600000 : "smartarm3250-safefs"
0x000001600000-0x000010000000 : "smartarm3250-rootfs"
lpc_mii_bus: probed
eth0: using RMII interface
eth0: LPC mac at 0x31060000 irq 29
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:00, irq=-1)
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ISP1301 Vendor ID : 0x04cc
ISP1301 Product ID : 0x1301
ISP1301 Version ID : 0x0210
usb-ohci usb-ohci: at 0xf3120000, irq 0
usb-ohci usb-ohci: pnx4008 OHCI
usb-ohci usb-ohci: new USB bus registered, assigned bus number 1
usb-ohci usb-ohci: irq 59, io mem 0xf3120000
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 libusual
mousedev: PS/2 mouse device common for all mice
input: lpc32xx-ts as /devices/platform/lpc32xx-ts/input/input0
rtc-lpc32xx rtc-lpc32xx: rtc core: registered rtc-lpc32xx as rtc0
i2c /dev entries driver
PNX4008-WDT: PNX4008 Watchdog Timer: heartbeat 19 sec
cpuidle: using governor ladder
cpuidle: using governor menu
mmci-pl18x dev:mmc0: DMA buffer: phy:83960000, virt:ffdd0000
mmci-pl18x dev:mmc0: mmc0: PL180 manf 41 rev0 at 0x20098000 irq 15,13 (pio)
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0x0 failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0x1 failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0x2 failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0x3 failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0x4 failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0x5 failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0x6 failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0x7 failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0x8 failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0x9 failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0xa failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0xb failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0xc failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0xd failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0xe failed
uda1380-codec 0-0018: uda1380_sync_cache: write to reg 0xf failed
asoc: uda1380-hifi <-> lpc3xxx-i2s1 mapping ok
ALSA device list:
#0: LPC32XX
TCP cubic registered
NET: Registered protocol family 17
VFP support v0.3: implementor 41 architecture 1 part 10 variant 9 rev 1
rtc-lpc32xx rtc-lpc32xx: setting system clock to 1970-01-05 06:14:29 UTC (368069)
yaffs: dev is 32505860 name is "mtdblock4" rw
yaffs: passed flags ""
VFS: Mounted root (yaffs2 filesystem) on device 31:4.
Freeing init memory: 136K
init started: BusyBox v1.11.2 ()
starting pid 409, tty '': '/etc/rc.d/rcS'
Mounting /proc and /sys
Starting the hotplug events dispatcher udevd
udevd (418): /proc/418/oom_adj is deprecated, please use /proc/418/oom_score_adj instead.
Synthesizing initial hotplug events
Setting the hostname to zlg
Mounting filesystems
mount: mounting usbfs on /proc/bus/usb failed: No such file or directory
Running sysctl
Setting up networking on loopback device:
Setting up networking on eth0:
Adding static route for default gateway to 192.168.7.1:
Setting nameserver to 192.168.7.1 in /etc/resolv.conf:
Starting inetd:
Starting the port mapper:
Starting the ssh server:
starting pid 763, tty '': '-/bin/sh'
[root@zlg /]#