linux的usb驱动失败,linux2.6.24下usb驱动完成情况及问题解决
1.在kernel启动是出现如下问题:
mount: mounting tmpfs on /dev failed
解决方案如下,
File systems --->Pseudo filesystems --->[*] Virtual memory file system support (former shm fs)
2.另附上vivi启动参数,最近一直用nfs,转换着麻烦,先记下来cp
设置从flash 启动:
param set linux_cmd_line "noinitrd init=/linuxrc console=ttySAC0 root=/dev/mtdblock3"
设置从nfs启动:
param set linux_cmd_line "noinitrd init=/linuxrc console=ttySAC0 root=/dev/nfs nfsroot=192.192.192.xx:/srv/nfs/rootfs ip=192.192.192.200:192.192.192.xx:192.192.192.xx:255.255.255.0::eth0:off"
设置从ramdisk启动:
param set linux_cmd_line "console=ttySAC0 initrd=0x30800000,0x400000 root=/dev/ram"。
3.测试通过了usb device的测试,可以进行从设备操作,对usb device进行模块加载操作,方法如下:(两个.ko文件为usb驱动的模块文件,需要加载后使用)
$ insmod s3c2410_udc.ko$ insmod g_file_storage.ko file=/dev/mtdblock5 stall=0 removable=1
4、usb从部分添加内容:
4.1.usb初始化为从设备时配置:
+++ linux-2.6.22/arch/arm/mach-s3c2410/mach-f2410.c 2007-11-15&s3c_device_i2c,&s3c_device_iis,&s3c_device_nand,+/* add by feng */+ &s3c_device_usbgadget,};/* USB */s3c_device_usb.dev.platform_data = &usb_s3c2410_info;s3c2410_modify_misccr(S3C2410_MISCCR_USBSUSPND0 |- S3C2410_MISCCR_USBSUSPND1, 0x8);+ S3C2410_MISCCR_USBSUSPND1 |+ S3C2410_MISCCR_USBHOST, 0x0);
4.2.添加udc驱动:
+++ linux-2.6.22/drivers/usb/gadget/s3c2410-udc.c 2007-11-15 17:38:17.000000000 +0800+++ linux-2.6.22/drivers/usb/gadget/s3c2410-udc.h 2007-11-15 17:38:31.000000000 +0800+++ linux-2.6.22/include/asm/arch-s3c2410/regs-udc.h 2007-11-16 01:22:25.000000000 +0800
4.3.在kconfig中添加udc选项支持:
+++ linux-2.6.22/drivers/usb/gadget/Kconfig 2007-11-15Select this only if your OMAP board has a Mini-AB connector.+# add by feng+config USB_GADGET_S3C2410+ boolean "S3C2410"+ depends on ARCH_S3C2410+ help+ Samsung's S3C2410 is an ARM-4 processor with an integrated+ full speed USB 1.1 device controller.+ It has 4 configurable endpoints, as well as endpoint+ zero (for control transfers).++config USB_S3C2410+ tristate+ depends on USB_GADGET_S3C2410+ default USB_GADGET+ select USB_GADGET_SELECTED++config USB_S3C2410_DEBUG+ boolean "S3C2410 udc debug messages"+ depends on USB_GADGET_S3C2410+#end add+config USB_GADGET_AT91boolean "AT91 USB Device Port"
4.4.在makefile中添加udc选项支持:
+++ linux-2.6.22/drivers/usb/gadget/Makefile 2007-11-15 17:01:04.000000000 +0800obj-$(CONFIG_USB_FSL_USB2) += fsl_usb2_udc.o+#add by feng+obj-$(CONFIG_USB_S3C2410) += s3c2410-udc.o
一、学习ctags查找源码的用法,超级方便
步骤:
1,现在源码目录中运行指令
$ ctags –R * ($ 为Linux系统Shell提示符)
2,用vi进入编辑环境,
Ctrl + ]查找查询
Ctrl + T返回上一步
:ta XX 查找文件XX
二、usb从部分(以后添加)
1,添加udc驱动:
在kconfig中添加udc支持:
在makefile中添加udc支持:
2.配置
Device Drivers --->USB Gadget Support ---> Support for USB GadgetsUSB Peripheral Controller (S3C2410) --->(X) S3C2410 File-backed Storage Gadget
参考luofuchong的帖子,修改文件,并修改mach-f2410.c文件,使其支持usb的初始化
在mach-f2410.c添加如下:
#include #include #include #include #include /* USB */static struct s3c2410_hcd_info usb_s3c2410_info = {.port[0] = {.flags = S3C_HCDFLG_USED},.port[1] = {.flags = S3C_HCDFLG_USED}};int __init s3c2410_init_usb(void){unsigned long upllvalue;printk("USB Control, (c) 2006 pc104/n");s3c_device_usb.dev.platform_data = &usb_s3c2410_info;s3c2410_modify_misccr(S3C2410_MISCCR_USBSUSPND0 |S3C2410_MISCCR_USBSUSPND1, 0x8);upllvalue = (0x78<<12)|(0x02<<4)|(0x03);while(upllvalue!=__raw_readl(S3C2410_UPLLCON)){__raw_writel(upllvalue,S3C2410_UPLLCON);mdelay(1);}return 0;}
static void __init f2410_init_machine(void)
{
s3c_device_nand.dev.platform_data = &sbc2410x_nand_info;
platform_add_devices(f2410_devices, ARRAY_SIZE(f2410_devices));
s3c2410_init_usb();
}
下面为配置:
下面为拷贝luofuchong的 linux-2.6.14下USB驱动移植心得,主要根据2.6.22的核改了一下,使其可以支持u盘。
/*****************************************from luofuchong**********************************/1、让内核支持热插拔│ General setup --->[*] Configure standard kernel features (for small systems) --->[*] Support for hot-pluggable devices (NEW)2.USB驱动设置Device Drivers --->Generic Driver Options ---> Userspace firmware loading supportBlock devices ---> Low Performance USB Block driverSCSI device support ---> SCSI generic support[*] Probe all LUNs on each SCSI deviceUSB support ---> Support for Host-side USB[*] USB device filesystem OHCI HCD support USB Mass Storage support[*] USB Monitor3、加入了MSDOS fs和VFAT fs的支持。File systems --->DOS/FAT/NT Filesystems ---> MSDOS fs support VFAT (Windows-95) fs support(936) Default codepage for FAT(cp936) Default iocharset for FATFile systems --->Partition Types --->[*] PC BIOS (MSDOS partition tables) support4. 加入中文字体库(可惜在我的板上还是没能正常显示中文~_~,知道的朋友麻烦告诉我一声,大家一起探讨)Native Language Support ---> Simplified Chinese charset (CP936, GB2312) NLS UTF85、另外,如果想让内核把它当成SCSI设备来处理的话,只要把上面:Device Drivers --->Block devices ---> Low Performance USB Block driver的 Low Performance USB Block driver这个选项去掉,然后把:Device Drivers --->SCSI device support --->SCSI disk support的SCSI disk support这个选项选上,重新编译内核就行。/***************************************end from*********************************************/
linux的usb驱动失败,linux2.6.24下usb驱动完成情况及问题解决相关推荐
- linux-2.6.14下USB驱动移植心得
linux-2.6.14下USB驱动移植心得 USB 驱动移植心得 一.代码修改 主要是按照这个贴来做: http://www.hfrk.net/S3C2410/kaifa/0631522024832 ...
- linux板卡支持USB键盘,让linux2.6.24内核在开发板支持usb鼠标
让linux2.6.24内核在开发板支持usb鼠标 发布时间:2008-03-27 16:06:22来源:红联作者:Inwind 今天下午,对以前移植的linux2.6.24内核不能检测USB鼠标进行 ...
- linux图形图像驱动,Linux_Linux操作系统下USB图像采集驱动的安装,ARMlinux下USB摄像头图像的采集 - phpStudy...
Linux操作系统下USB图像采集驱动的安装 ARMlinux下USB摄像头图像的采集很难,往往望而却步.相比较LINUX系统下的摄像头驱动的安装简单的多,下面就介绍我的安装过程. 我使用的linux ...
- win7万能声卡驱动_win7的早期版本下安装驱动失败
极少数用户遇到win7 x64下安装驱动失败,打开设备管理器,物理声卡和虚拟声卡都呈现黄标状态. 这是由于您使用的是win7的早期非商业版本,早期的win7 OS对数字签名只支持sha1算法,后来微软 ...
- linux at24测试程序,AT91RM9200在linux2.6.20下TWI测试程序
经过几天的瞎折腾,终于把AT91RM9200在linux2.6.20下TWI测试程序调试好了,总结如下 1.上拉电阻10K估计不合适,我换成2K的,SCL和SDA上就不断的有数据了,先前只有第一次有数 ...
- thinkpad装linux无线网卡驱动,ThinkPad E530 Fedora 20 下无线网卡驱动的安装
一直在用 Fedora 系列的 Linux, 但是它自带的无线网卡驱动似乎有些问题,经常是有时能连接上有时就不能.还经常搜索不到家里的无线路由器.因为家里有网线所以也就一直没在意.这两天在家里没什么事 ...
- ubuntu突然断电重启显卡驱动失败解决办法(不需要重装驱动)
今天实验室突然跳闸,开机的时候发现显卡驱动失效了,用nvidia-smi显示如下: NVIDIA-SMI has failed because it couldn't communicate with ...
- linux cp进行目录拷贝,目的路径下存在同名目录情况下出现的问题
cp -rf abc /home/oracle/ /home/oracle/下存在目录abc,则源目录abc及其内部文件被拷贝到了/home/oracle/abc下,即/home/oracle/a ...
- Linux USB RNDIS设备在WinXP、Win7、Win10下的驱动安装
在Win10下安装rndis驱动: 说明:win10下usb rndis驱动会默认识别为com口,经本人亲测可以使用该驱动在网络适配器里面出现小电脑,并网络ping通 资源连接:在我的个人上传资源中查 ...
最新文章
- SmartDispatcher 类
- 模型量化--TBN:Convolutional Neural Network with Ternary Inputs and Binary Weights
- 如何仅用递归函数和栈操作逆序一个栈
- FPGA实验四——时间基准电路和带使能的多周期计数器
- 控制面板的cpl程序列表
- 选择Asp for javascript,非.net。
- 题解-BOI 2004 Sequence
- windows游戏编程_2020年适合程序员编程的笔记本电脑推荐
- 欢迎大家讨论一个关于界面显示的问题!!
- java 学习笔记_java学习笔记
- UVA 11237 - Halloween treats(鸽笼原理)
- 蓝桥杯 传球游戏 动态规划
- ActionScript 游戏编程易错清单
- 11-411/611NLP Lecture 4.Words and Morphology
- 二次元《尤里国简介》
- LSTM神经网络算法
- arduino+无源蜂鸣器制作音乐《诺言》(实战篇)——从识读简乐谱到程序编写
- vue清除路由历史记录
- 施一公等团队登Science封面:AI与冷冻电镜揭示「原子级」NPC结构,生命科学突破...
- 神经网络训练集和测试集,神经网络验证集作用