TQ2440内核linux2.6.28移植
转自:http://blog.sina.com.cn/s/blog_95268f5001013ibg.html
内核的移植,是在u-boot的基础上进行的,所以u-boot在这之前一定要先弄好才好
怎样下载源码就不说了,下载后进入内核根目录/linux-2.6.28,修改根目录下Makefile大概193行改成下面这样:
193 ARCH ?= arm
194 CROSS_COMPILE ?=arm-linux-
接着进入这个目录linux-2.6.28/arch/arm/configs(如果没有就从网上下载补丁),在该目录下面可以看到
s3c2410_defconfig这个文件,这个就是我们要用到的默认配置文件,这是在内核根目录下执行
linux-2.6.28# make s3c2410_defconfig
#
# configuration written to .config
#
这样我们就建立起默认.config文件
接下来
linux-2.6.28#make menuconfig进入配置界面
┌────────────────────────────────────── System Type ───────────────────────────────────────┐
│ Arrow keys navigate the menu. <Enter> selects submenus --->. Highlighted letters are │
│ hotkeys. Pressing <Y> includes, <N> excludes, <M> modularizes features. Press │
│ <Esc><Esc> to exit, <?> for Help, </> for Search. Legend: [*] built-in [ ] excluded │
│ <M> module < > module capable │
│ ┌──────────────────────────────────────────────────────────────────────────────────────┐ │
│ │ ARM system type (Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2│ │
│ │ [*] PWM device support │ │
│ │ -*- S3C2410 DMA support │ │
│ │ [ ] S3C2410 DMA support debug │ │
│ │ [*] ADC common driver support │ │
│ │ *** Boot options *** │ │
│ │ [ ] S3C Initialisation watchdog │ │
│ │ [*] S3C Reboot on decompression error │ │
│ │ [*] Force UART FIFO on during boot process │ │
│ │ *** Power management *** │ │
│ │ [ ] S3C2410 PM Suspend debug │ │
│ │ [ ] S3C2410 PM Suspend Memory CRC │ │
│ │ (0) S3C UART to use for low-level messages │ │
│ │ (0) Space between gpio banks │ │
│ │ S3C2400 Machines ---> │ │
接下来
(1)
System Type --->
S3C2410 Machines --->
[*] SMDK2410/A9M2410
[ ] IPAQ H1940
[ ] Acer N30
[ ] Simtec Electronics BAST (EB2410ITX)
[ ] NexVision OTOM Board
[ ] AML M5900 Series
[ ] Thorcom VR1000
[ ] QT2410
S3C2412 Machines --->
[ ] SMDK2413
[ ] SMDK2412
[ ] VMSTMS
S3C2440 Machines --->
[ ] Simtec Electronics ANUBIS
[ ] Simtec IM2440D20 (OSIRIS) module
[ ] HP iPAQ rx3715
[*] SMDK2440
[ ] NexVision NEXCODER 2440 Light Board
[*] SMDK2440 with S3C2440 CPU module
S3C2442 Machines --->
[ ] SMDM2440 with S3C2442 CPU module
S3C2443 Machines --->
[ ] SMDK2443
(2)在配置菜单中添加自己信息
General setup --->
(-EmbedSky) Local version - append to kernel releas
[*] System V IPC
(17) Kernel log buffer size (16 => 64KB, 17 => 128KB)
(3)选择是否支持EABI
Kernel Features --->
[ ] Preemptible Kernel (EXPERIMENTAL)
[ ] Dynamic tick timer
[*] Use the ARM EABI to compile the kernel
[*] Allow old ABI binaries to run with this kernel (EXPERIMENTA)
[*] Allow old ABI binaries to run with this kernel (EXPERIMENTA)
Memory model (Flat Memory) --->
[ ] 64 bit Memory and IO resources (EXPERIMENTAL)
196 static void __init smdk2440_map_io(void)
197 {
198 s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
上面红色部分如果是使用4.3.3(也就是支持EABI)编译链就选它,3.4.5以下就不用选
到了这里就差不多配置完了,要改动的不是很多,还要配置的下面再配,这时保存推出就可以了。
由于我们2440的晶振是12M的,而默认中不是这样,所以下面要改晶振,在arch/arm/mach-s3c2440/mach-smdk2440.c这个文件里改,如下:
199 s3c24xx_init_clocks(12000000);
200 s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));
201 }
接下来修改机器码,在U-boot中用了168,所以这里也要改
在arch/arm/tools/mach-types文件里,改成如下:
379 s3c2440 ARCH_S3C2440 S3C2440 168
到了这里,就差不多了,这时make uImage生成uImage镜像
没有错的话会在arch/arm/boot生成uImage和zzimage
顺利的话如下:
Created: 2012-05-08 10:53:36 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1767580 Bytes = 1.7 MB
Load Address: 30008000
Entry Point: 30008000
Verifying Checksum ... OK
OK
Starting kernel ...
Uncompressing Linux................................................................................................................. done, booting the kernel.
Linux version 2.6.28-EmbedSky (root@www) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #17 Tue May 8 18:53:22 CST 2012
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: TQ2440
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C244X: core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
S3C24XX Clocks, (c) 2004 Simtec Electronics
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 root=/dev/mtdblock3 init=/linuxrc console=ttySAC0
irq: clearing pending ext status 00080000
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
timer tcon=00500000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8
Console: colour dummy device 80x30
console [ttySAC0] enabled
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: 61108KB available (3248K code, 363K data, 124K init)
Calibrating delay loop... 199.47 BogoMIPS (lpj=498688)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 484 bytes
NET: Registered protocol family 16
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4808000, irq 33
DMA channel 1 at c4808040, irq 34
DMA channel 2 at c4808080, irq 35
DMA channel 3 at c48080c0, irq 36
S3C244X: Clock Support, DVS off
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
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
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (extended precision)
JFFS2 version 2.2. (NAND) (SUMMARY) 漏 2001-2006 Red Hat, Inc.
yaffs May 5 2012 13:02:57 Installing.
msgmni has been set to 119
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 60x34
fb0: s3c2410fb frame buffer device
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
Serial: 8250/16550 driver4 ports, IRQ sharing enabled
s3c2440-uart.0: tq2440_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: tq2440_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: tq2440_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
loop: module loaded
dm9000 Ethernet Driver, V1.31
Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18
ide-cd driver 5.00
Driver 'sd' needs updating - please use bus_type methods
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=3, 30ns Twrph0=7 70ns, Twrph1=3 30ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 1785 at 0x0df20000
Bad eraseblock 1811 at 0x0e260000
Creating 4 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x00000000-0x00040000 : "u-boot" (原来不是这样,要改了分区才行可以按照你喜欢的改,下面说)
0x00200000-0x00400000 : "krenel"
0x00400000-0x00c00000 : "jffs2"
0x00c00000-0x10000000 : "yaffs2"
usbmon: debugfs is not available
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver libusual
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.4.3:USB FTDI Serial Converters Driver
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 390 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
yaffs: dev is 32505859 name is "mtdblock3"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.3, "mtdblock3"
yaffs: auto selecting yaffs2
block 1690 is bad
block 1716 is bad
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem).(由于我的yaffs2已近弄好了(下面会说),所以会这样它会挂载yaffs2不过这个分区没有yaffs2系统所以文件系统没起来)
Freeing init memory: 124K
Warning: unable to open an initial console.
Failed to execute /linuxrc. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option to kernel.
下面来建立flash分区,这里的分区最好与我们在u-boot时分区对应,当然也可以不一样的,只是为了方便
在vim arch/arm/plat-s3c24xx/common-smdk.c文件里就可以修改自己喜欢的分区,如下:
109 static struct mtd_partition smdk_default_nand_part[] = {
110 [0] = {
111 .name = "u-boot",
112 .size = 0x40000,
113 .offset = 0x00000000,
114 },
115 [1] = {
116 .name = "krenel",
117 .offset = 0x200000,
118 .size = 0x200000,
119 },
120 [2] = {
121 .name = "jffs2",
122 .offset = 0x400000,
123 .size = SZ_8M,
124 },
125 [3] = {
126 .name ="yaffs2",
127 .offset = MTDPART_OFS_APPEND,
128 .size = MTDPART_SIZ_FULL,
129 }
然后还要修改nand flash读写匹配时间,在同一个文件里改
145 static struct s3c2410_platform_nand smdk_nand_info = {
146 .tacls = 10,
147 .twrph0 = 25,
148 .twrph1 = 10,
149 .nr_sets = ARRAY_SIZE(smdk_nand_sets),
150 .sets = smdk_nand_sets,
151 };
152
接下来还要修改 drivers/mtd/nand/Kconfig 增加对各种nand flash支持,如下
165 choice
166 prompt"Nand Flash Capacity select"
167 depends on MTD
168 help
169 EmbedSKy Board Nand Flash Capacity select
170 config EmbeddSky_64MB_NAND
171 boolean "64MB Nand for EmbedSky Board"
172 depends on MTD
173 help
174 Set 64MB Nand parts
175 config EmbeddSky_128MB_NAND
176 boolean "128MB Nand for EmbedSky Board"
177 depends on MTD
178 help
179 Set 128MB Nand parts
180 config EmbeddSky_more_than_256MB__NAND
181 boolean "256MB~1GB Nand for EmbedSky Board"
182 depends on MTD
183 help
184 Set 256MB~1GB Nand parts
185 endchoice
增加对应驱动配置,再次执行make menucofig进入配置界面
Device Drivers --->
<*> Memory Technology Device (MTD)support
<*> NAND Device Support --->
[*] S3C2410 NAND HardwareECC
Nand Flash Capacity select (256MB~1GB Nand for EmbedSky Board) --->
这时从新编译就好了
Creating 4 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x00000000-0x00040000 : "u-boot"
0x00200000-0x00400000 : "krenel"
0x00400000-0x00c00000 : "jffs2"
0x00c00000-0x10000000 : "yaffs2"
usbmon: debugfs is not available
接下来移植yaffs文件系统
(1)可以从www.alephl.co.uk/cgi-bin/viewcvs.cgi/获得源码
(2)将yaffs代码加进内核(打补丁就行)
首先进入你下载yaffs2所在目录,我的是#/work/cvs/yaffs2,然后执行如下命令
#./patch-ker.sh c /work/linux-2.6.28
这样就行了
(3)接下来就是配置增加对yaffs2的支持了
#make menuconfig
File systems --->
Miscellaneous filesystems --->
<*> YAFFS2 file system support
要打上补丁才会有这个选择的。
到了这里yaffs2文件系统移植完了。。。。。。。
接下来就是yaffs2文件系统的制作了。。。。。。。。。
TQ2440内核linux2.6.28移植相关推荐
- 移植基于linux-2.6.26.5内核s3c2410触摸屏驱动移植
移植基于linux-2.6.26.5内核s3c2410触摸屏驱动移植的过程记录下来: (1)首先打一个补丁:s3c2410_touchscreen.patch, 在内核解压的根目录下 patch -N ...
- android移植 开发板,Android在TQ2440开发板上的移植
原标题:Android在TQ2440开发板上的移植 一.目前进展 1.已经可以通过NFS在开发板上运行 最近自己编译了android的文件系统,并在TQ上运行了,比熊猫版的bin程序多些,基本功能已经 ...
- davinci DM365-DM368开发攻略—linux-2.6.32移植
本文最始出自http://www.360doc.com/content/12/0318/16/532901_195392228.shtml 一.介绍linux-2.6.32: Linux-2.6.32 ...
- linux内核的队列实现移植
linux内核的队列实现移植 [!TOC] 在c编程中有时会使用一些常用的数据结构,如队列.每次都手写一遍有些麻烦,写一个通用的比较好,而内核有实现队列,直接移植出来就好了. 内核的队列实现 内核的队 ...
- Linux内核的裁剪和移植
linux内核的裁剪和移植具体都在这个网址里面. https://blog.csdn.net/xie0812/article/details/10816059 https://blog.csdn.ne ...
- 话说linux内核-uboot和系统移植第14部分-朱有鹏-专题视频课程
话说linux内核-uboot和系统移植第14部分-5304人已学习 课程介绍 本课程为linux kernel移植的第1部分,主要内容是对linux内核有关的知识和概念的补充.认识清 ...
- 基于ARM的嵌入式linux 内核的裁剪与移植
0 引言 微处理器的产生为价格低廉.结构小巧的CPU和外设的连 接提供了稳定可靠的硬件架构,这样,限制嵌入式系统发展的瓶颈就突出表现在了软件方面.尽管从八十年代末开始,已经陆续出现了一些嵌入式 ...
- S3C6410的AVIN支持(Linux2.6.28)
Topic:S3C6410支持AVIN模块(作者:Sturtle) //---------------------------------------------------------------- ...
- 天嵌TQ2440 ARM开发板Uboot移植
TQ2440 ARM开发板Uboot移植 移植环境 主 机:VMWare--Fedora 10 Kernel:2.6.34 开发板:TQ2440--256MB Nand 编译器:arm-lin ...
- 创维 linux内核,Linux2.6内核在创维特jx2410平台上的移植一
我参考网上的资料做了linux2.6.14内核的移植.创维特jx2410的配置:cpu:s3c2410, 32M Nor Flash(Intel 28F128), 64M SDRAM.Nor Flas ...
最新文章
- 360浏览器打不开qq空间_浏览器变慢有救了!只要2秒,重回新安装一样爽快!
- 如何在 Knative 中部署 WebSocket 和 gRPC 服务?
- DDD:一个朋友对领域驱动的小结
- 沃尔沃汽车与高德合作:首款纯电动汽车XC40 RECHARGE采用高德方案
- REPERTOIRE: CD
- 1、深入理解 Laravel Eloquent(一)——基本概念及用法
- 解决vue2.0路由 TypeError: Cannot read property ‘matched‘ of undefined 的错误问题
- 天气太热业绩差,除了设坛求雨外,数据分析师还能干啥?
- fiddle下载安装教程
- Morris 中序遍历
- cadence SPB17.4 - orcad - 层次原理图
- 使用python读写灰度图像
- wireshark官方文档第 8 章数据包捕获
- php在线图片签名,ElementUi+Vue+Php+fpdf+fpdi 实现文档在线签订(图片水印、手写签名)...
- 兄弟1218无线打印服务器错误,兄弟无线打印机无法打印怎么办?
- Web性能测试工具大全
- sql统计某字段出现次数
- 使用向日葵进行远程办公,手机电脑都可以时时刻刻使用远端电脑
- spring框架的优势
- linux rt patch 强实时,Linux RT(2)-硬实时Linux(RT-Preempt Patch)的中断线程化
热门文章
- 汇编语言期末不挂科必备复习知识点
- Windows Defender怎么添加排除项?
- windows开发机做路由器映射大坑
- 适配器模式的三种形式
- AiHi+翼次元学院儿童自然感知实践“几米小甜田”+中韧开智“优慧码”| Wit++
- linux创建虚拟声卡,修改服务器版linux系统上的dummy虚拟声卡最大声道数
- springBoot做后台实现微信小程序图片上传和下载
- 这些那些非代码之罪的坑
- 快速实现中文翻译多国语言
- 远程重启h3c路由器_H3C路由器远程登陆命令 -192.168.0.1 路由器怎么设置|192.168.1.1登陆|路由器设置密码-路由器网...