Linux-2.6.31 内核移植

内核版本2.6.31

arm-linux-gcc 4.1.2

开发板 天祥电子 TX2440

 

下载内核源码官网http://www.kernel.org/

解压

修改文件主目录下Makefile第183行

ARCH ?= arm <—指定系统硬件架构
CROSS_COMPILE ?= arm-linux- <—指定交叉编译器

 

修改arch/arm/mach-smdk2440.c第163行修改时钟

static void __init smdk2440_map_io(void)
{
s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
s3c24xx_init_clocks(12000000); <—输入时钟为12MHz
s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));
}

 

修改机器码 和bootloader匹配 arch/arm/tools/mach-types第379行

 s3c2440 ……………………… XXX <—后面那个数就是机器码


配置menuconfig

在配置菜单中选择这一项:"Load an Alternate Configuration File" ,输入2440的默认
配置文件:arch/arm/configs/s3c2410_defconfig

进入"System Type"选项单, 里面的选项保持默认在"S3C24XX Machine"选项中只配置这几
项(其他的选项取消):
S3C2410 Machine --->
[*] SMDK2410/A9M2410
S3C2440 Machine --->
[*] SMDK2440
[*] SMDK2440 with S3C2440 cpu moudle

配置完后,回到主菜单,选择这一项"Save an Alternate Configuration File" ,输入要保存的
配置文件名称:.config (默认)或自己取名:TX2440A_config ,退出


修改arch/arm/boot下Makefile,在第57行添加

@cp -f arch/arm/boot/zImage zImage
@echo ' Kernel: $@ is ready '

使zImage输出到内核根目录


如果希望在在执行make distclean时,也同时把zImage删除,可以修改内核根目录下Makefile的第1247行,在后面加上:
-type f -print | xargs rm -f rm zImage


支持NANDFlash

这里我们要使NandFlash驱动同时支持 64M,256M 或更高容量,并且修改Nand读写匹配时间。修改arch/arm/plat-s3c24xx/common-smdk.c 文件

修改 Kconfig 文件,在配置时选择NAND类型,修改driver/mtd/nand/Kconfig,在172行

#make menuconfig 配置内核,支持 NandFlash

启动时输出:
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c24xx-nand s3c2440-nand: Tacls=1, 10ns Twrph0=3 30ns, Twrph1=1 10ns
s3c24xx-nand s3c2440-nand: NAND hardware ECC
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 256MiB 3,3V 8-bit":
8
0x000000000000-0x000000100000 : "boot"
0x000000120000-0x000000520000 : "kernel"
0x000000520000-0x000010000000 : "yaffs2"


下面都是一些make menuconfig配置

支持 yaffs2 文件系统

File systems --->
DOS/FAT/NT Filesystems --->
<*> MSDOS fs support
<*> VFAT (Windows95) fs support
Miscellaneous filesystems --->
<*> YAFFS2 file system support
[*] Autoselect yaffs2 format
配置语言选项:
Native Language support --->
(iso8859-1) Default NLS Option
<*> Codepage 437(United States, Canada)
<*> Simplified Chinese charset(CP936, GB2312)
<*> NLS ISO8859-1 (Latin 1; Western European Language)
<*> NLS UTF-8


LCD 驱动移植

Device Drivers:
Graphics Support --->
<*>support for frame buffer devices --->
[*] Enable frameware EDID
[*] Enable Vidoe Mode Handling Helpers
<*> S3C24X0 LCD framebuffer support
Console display driver support --->
<*> Framebuffer Console Support
11
[*] Bootup Logo --->
<*> Standard 224-color Linux logo


DM9000  驱动的移植

Device Drivers --->
[*] Network device support --->
[*] Ethernet(10 or 100 Mbit) --->
<*> DM9000 support
(4)DM9000 maximum debug level


UDA1341 声卡驱动移植

Device Drivers:
* Sound card support --->
* Advanced Linux Sound Architecture--->
* CCS Mixer API
* CSS PCM(digital audio) API
* Verbose procfs contents
* ALSA for SoC audio support--->
* SoC audio for the Samsung S3C24XX chips
* SoC I2S Audio support for UDA134X wired to a S3C24XX


SD卡驱动移植

Device Drivers --->
<*> MMC/SD/SDIO card support --->
<*> MMC block device driver
<*> Use bounce buffer for simple hosts
<*> Sumsung S3C SD/MMC Card Interface support


RTC驱动移植

Device Drivers --->
<*>Real Time Clock --->
[*]Set system time from RTC on startup and resume
(rtc0) rtc used to set the system time
[*]/sys/class/rtc/rtcN(sysfs)
[*]/proc/driver/rtc(procfs for rtc0)
[*]/dev/rtcN(character drivers)
<*>Samsung S3C series SoC RTC


触摸屏驱动移植

Device Drivers --->
Character devices --->
[*] ADC driver for S3C2440 development boards
Input devices support --->
<*> Event interface
[*] Touchscreens --->
<*> Samsung S3C2410 touchscreen input driver


USB设备驱动移植

Device drivers --->
SCSI Device support --->
<*> SCSI device support
[*] legacy /proc/scsi/ support
<*> SCSI disk support
[*] HID Devices --->
<*> USB Human Interface Device (full HID) support
[*] /dev/hiddev raw HID device support
[*] USB support --->
<*> Support for Host-side USB
[*] USB device filesystem
[*] USB device class-devices (DEPRECATED)
<*> USB Monitor
<*> OHCI HCD support
<*> USB Mass Storage support


USB 摄像头驱动移植
Device Drivers --->
<*> Multimedia support --->
<*> Video For Linux
[*] Enable Video For Linux API 1 (DEPRECATED)
[*] Video capture adapters --->
[*] V4L USB devices --->
<*> USB Video Class (UVC)
[*] UVC input events device support
[*] GSPCA based webcams --->


CMOS摄像头驱动移植

Device Drivers --->
<*> Multimedia support --->
<*> OV9650 on the S3C2440 driver


LCD  背光驱动移植

Device Drivers --->
Graphics support --->
<*> Support for frame buffer devices --->
<*> Backlight support for TX2440A
系统启动时,自动加载背光驱动,设备名为:TX2440-backlight

你可能感兴趣的:(嵌入式C语言)