linux-3.x 添加单板

本文详细介绍了如何将Linux内核移植到智能设备Smart210上,包括拷贝基本文件、修改Makefile和Kconfig、添加配置文件及编译等关键步骤。
version : linux-3.10.79
gcc : arm-linux-gcc-4.5.1
board : smart210

目录

 

 

1.拷贝基本文件

2.修改对应目录下Makfile和Kconfig

3.修改单板文件

4.添加xxx_defconfig文件

5.添加mach-types

6.编译


 

1.拷贝基本文件

cp arch/arm/mach-s5pv210/mach-smdkv210.c arch/arm/mach-s5pv210/mach-smart210.c

2.修改对应目录下Makfile和Kconfig

vim arch/arm/mach-s5pv210/Makefile
+obj-$(CONFIG_MACH_SMART210)     += mach-smart210.o

vim arch/arm/mach-s5pv210/Kconfig

+...

config MACH_SMART210
        bool "Smart210"
        select CPU_S5PV210
        select S3C_DEV_FB
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC1
        select S3C_DEV_HSMMC2
        select S3C_DEV_HSMMC3
        select S3C_DEV_I2C1
        select S3C_DEV_I2C2
        select S3C_DEV_RTC
        select S3C_DEV_USB_HSOTG
        select S3C_DEV_WDT
        select S5PV210_SETUP_FB_24BPP
        select S5PV210_SETUP_I2C1
        select S5PV210_SETUP_I2C2
        select S5PV210_SETUP_IDE
        select S5PV210_SETUP_KEYPAD
        select S5PV210_SETUP_SDHCI
        select S5PV210_SETUP_USB_PHY
        select S5P_DEV_FIMC0
        select S5P_DEV_FIMC1
        select S5P_DEV_FIMC2
        select S5P_DEV_JPEG
        select S5P_DEV_MFC
        select SAMSUNG_DEV_ADC
        select SAMSUNG_DEV_BACKLIGHT    
        select SAMSUNG_DEV_IDE
        select SAMSUNG_DEV_KEYPAD
        select SAMSUNG_DEV_PWM
        select SAMSUNG_DEV_TS
        select S3C_DEV_NAND
        help
          Machine support for Samsung Smart210
...+
 

3.修改单板文件

vim arch/arm/mach-s5pv210/mach-smart210.c		  
+MACHINE_START(SMART210, "SMART210")
...
MACHINE_END

4.添加xxx_defconfig文件

cp arch/arm/configs/s5pv210_defconfig arch/arm/configs/smart210_defconfig

vim arch/arm/configs/smart210_defconfig		  
+CONFIG_MACH_SMART210=y
+CONFIG_S3C_LOWLEVEL_UART_PORT=0
+CONFIG_DEBUG_S3C_UART=0

5.添加mach-types

vim arch/arm/tools/mach-types

+smart210                MACH_SMART210           SMART210                4448

6.编译

make smart210_defconfig
make uImage -j4

 

This bundle contains a modified CP210x driver for the 4.10.0 kernel (Ubuntu 17.04). It contains: - Support for the CP2102N NOTE: This driver is an example of how to perform GPIO operations within the CP210x driver since the driver on kernel.org does not support GPIO at this time. This driver has only been written and tested on the Linux 3.13.0 kernel on Ubuntu 14.04. This driver is a modified version of the existing driver in the Linux 3.13.0 kernel, which is maintained at kernel.org. It is recommened to use the driver there that matches your specific kernel version: www.kernel.org Build instrutions: Ubuntu: 1. make ( your cp210x driver ) 2. cp cp210x.ko to /lib/modules//kernel/drivers/usb/serial 3. insmod /lib/modules/<kernel-version/kernel/drivers/usb/serial/usbserial.ko 4. insmod cp210x.ko RedHat: 1. yum update kernel* //need to update the kernel first otherwise your header won&#39;t match 2. yum install kernel-devel kernel-headers //get the devel and header packages. 3. reboot //your build link should be fixed after your system come back 4. make ( your cp210x driver ) // should be able to build successfully at this point 5. cp cp210x.ko to /lib/modules//kernel/drivers/usb/serial 6a. insmod /lib/modules/<kernel-version/kernel/drivers/usb/serial/usbserial.ko 6. insmod cp210x.ko 7. sudo chmod 666 /dev/ttyUSB0 8. sudo chmod 666 /dev/ttyUSB1 GPIO example: This shows how to use the two IOCTLs to set GPIO state. Build instructions: 1. g++ cp210x_gpio_example.c -o cp210x_gpio_example 2. ./cp210x_gpio_example
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值