fl2440内核移植(五)——USB驱动移植
来源:互联网 发布:学java前要学什么 编辑:程序博客网 时间:2024/05/15 05:38
--------------------------------------------------------------------------------------------------------------------------------
系统环境:Centos 6.5
板子芯片:s3c2440
内核版本:linux 3.0
编译器:arm-linux-gcc 4.5.4
作者:Lu Zengmeng <1540999272@qq.com>
--------------------------------------------------------------------------------------------------------------------------------
1、修改drivers/usb/serial/Kconfig
找到config USB_SERIAL_WWAN
将下一行的tristate删除,并添加以下两行
boolean
default y if USB_SERIAL_OPTION
2、修改drivers/usb/serial/option.c
添加以下代码
static int vendor = 0;
static int product = 0;
#define OPTION_VENDOR_RESERVED 0XFFFF
#define OPTION_RESERVED_DEVICE 0XFFFF
将static const struct usb_device_id option_ids[]
改为static struct usb_device_id option_ids[]
并在该结构体中添加下面一行
{ USB_DEVICE(OPTION_VENDOR_RESERVED, OPTION_RESERVED_DEVICE) },
找到static int __init option_init(void)
在该函数中int retval;的下一行添加以下几行
if ((vendor>0) && (product>0))
{
option_ids[0].match_flags = USB_DEVICE_ID_MATCH_DEVICE;
option_ids[0].idVendor = vendor;
option_ids[0].idProduct = product;
printk("Register option drvier for modem vendor=0x%04x product=0x%04x\n", vendor, product);
}
找到MODULE_AUTHOR(DRIVER_AUTHOR);
在这行上面添加以下代码
module_param(vendor, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(vendor, "User specified vendor ID");
module_param(product, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(product, "User specified product ID");
3、修改arch/arm/mach-s3c2440/mach-smdk2440.c
添加头文件
#include <mach/regs-clock.h>
#include <linux/delay.h>
添加函数
int usb_s3c2440_init(void)
{
/* Input Frequency is 12.0000MHz, and MDEV=0x38 PDIV=2 SDIV=2, so output frequency 48.00MHz */
unsigned long upllvalue = (0x38<<12)|(0x02<<4)|(0x02);
while (upllvalue != __raw_readl(S3C2410_UPLLCON))
{
__raw_writel(upllvalue, S3C2410_UPLLCON);
mdelay(1);
}
return 0;
}
找到smdk2440_map_io(void)
在该函数中添加下面一行
usb_s3c2440_init();
4、修改drivers/usb/host/ohci-s3c2410.c
添加头文件
#include <mach/regs-clock.h>
找到struct s3c2410_hcd_info *info = dev->dev.platform_data;
在该行下面加入
unsigned long upllvalue = (0x38<<12)|(0x02<<4)|(0x02);
while (upllvalue != __raw_readl(S3C2410_UPLLCON))
{
__raw_writel(upllvalue, S3C2410_UPLLCON);
mdelay(1);
}
__raw_writel(upllvalue, S3C2410_UPLLCON);
5、配置menuconfig
Device Drivers --->
Generic Driver Options --->
(/sbin/hotplug) path to uevent helper
[*] Block devices --->
<*> Low Performance USB Block driver
SCSI device support --->
<*> SCSI device support
<*> SCSI generic support
[*] Probe all LUNs on each SCSI device
[*] USB support --->
{*} Support for Host-side USB
[*] USB device filesystem (DEPRECATED)
[*] USB device class-devices (DEPRECATED)
<*> OHCI HCD support
<*> USB Mass Storage support
[*] HID Devices --->
-*- Generic HID support
<*> USB Human Interface Device (full HID) support
SCSI device support --->
<*> SCSI device support
[*] legacy /proc/scsi/ support
<*> SCSI disk support
File systems --->
DOS/FAT/NT Filesystems --->
<*> MSDOS fs support
<*> VFAT (Windows-95) fs support
(437) Default codepage for FAT
(iso8859-1) Default iocharset for FAT
<*> NTFS file system support
[*] NTFS write support
Partition Types --->
[*] PC BIOS (MSDOS partition tables) support
[*] Windows Logical Disk Manager (Dynamic Disk) support
-*- Native language support --->
<*> Codepage 437 (United States, Canada)
<*> Simplified Chinese charset (CP936, GB2312)
<*> ASCII (United States)
<*> NLS ISO 8859-1 (Latin 1; Western European Languages)
<*> NLS UTF-8
- fl2440内核移植(五)——USB驱动移植
- fl2440 linux内核移植usb驱动
- fl2440 usb驱动移植
- fl2440——移植USB驱动、内核添加USB支持、U盘挂载
- ARM9开发板FL2440移植Linux-3.0内核————添加USB驱动
- Exynos4412 内核移植(五)—— 驱动的移植
- Exynos4412 内核移植(五)—— 驱动的移植
- fl2440内核移植(二)——RTC移植
- fl2440内核移植(三)——LCD移植
- fl2440内核移植(四)——DM9000移植
- fl2440内核移植(一)——最小系统
- linux-2.6.35内核移植—USB驱动的添加
- ARM9开发板FL2440移植Linux-3.0内核————MMC和LCD驱动
- fl2440——内核自带按键驱动的移植与测试
- FL2440移植Linux内核
- fl2440内核移植
- fl2440 内核移植
- Linux驱动移植(四)——Linux内核移植
- javascript学习笔记
- latex: IEEEtran.bst 参考文献的标题最后的逗号放在反引号的后面
- 第4周-项目4-(2)
- Jenkins进阶系列之——13修改Jenkins权限控制
- JVM怎样让native method跑起来
- fl2440内核移植(五)——USB驱动移植
- 第4周-项目4-(3)
- Jenkins进阶系列之——14配置Jenkins用户和权限
- 第4周-项目4-(4)
- Jenkins入门系列之——00答疑解惑
- Jenkins进阶系列之——15Maven获取Jenkins的Subversion的版本号
- LeetCode107—Binary Tree Level Order Traversal II
- Java基础之异常篇
- 取消Android标题栏