Linux开发

推荐列表 站点导航

当前位置:首页 > 服务器技术 > Linux开发 >

fl2440 linux内核移植usb驱动

来源:网络整理  作者:wy  发布时间:2020-12-24 00:58
开发板:fl2440 Linux内核:linux-3.0 1.添加USB结构体变量,加厂商ID和设备ID [zoulei@CentOS linux-3.0]$vim arch/arm/mach-s3c2440/mach...

Linux内核:linux-3.0

 

1.添加USB结构体变量,加厂商ID和设备ID

[zoulei@CentOS linux-3.0]$vim arch/arm/mach-s3c2440/mach-smdk2440.c

--- mach1-smdk2440.c    2017-04-15 06:12:36.061000246 -0700

+++ mach2-smdk2440.c    2017-04-15 06:21:30.015999978 -0700

@@ -13,6 +13,7 @@

IT之家

IT之家/ 

+#include <linux/dm9000.h> 

#include <linux/kernel.h>

#include <linux/types.h>

#include <linux/interrupt.h>

@@ -22,6 +23,12 @@

#include <linux/serial_core.h>

#include <linux/platform_device.h>

#include <linux/io.h>

+/IT之家  add by zoulei for norflash  IT之家/  

+#include <linux/gpio_keys.h>  

+#include <linux/input.h>  

+#include <linux/mtd/physmap.h>  

+#include <linux/mtd/mtd.h>  

+#include <linux/mtd/partitions.h>

#include <asm/mach/arch.h>

#include <asm/mach/map.h>

@@ -44,9 +51,45 @@

#include <plat/clock.h>

#include <plat/devs.h>

#include <plat/cpu.h>

-

+#include <plat/ts.h>         /IT之家Add by zoulei to support Touch screen, 2017.04.15IT之家/  

+#include <mach/regs-clock.h> /IT之家Add by zoulei  2017.04.15, for usb_s3c2440_init() IT之家/  

+#include <linux/i2c.h>       /IT之家Add by zoulei 2017.4.15, for AT24C512 driver IT之家/  

+#include <linux/i2c/at24.h>  /IT之家Add by zoulei 2017.4.15, for AT24C512 driver IT之家/  

+#include <linux/delay.h>  

#include <plat/common-smdk.h>

+#define DM9000_BASE    (S3C2410_CS4 + 0x300)  

+static struct resource s3c_dm9000_resource[] = {  

+     [0] = {  

+        .start = DM9000_BASE,  

+        .end   = DM9000_BASE + 3,  

+        .flags = IORESOURCE_MEM  

+    },  

+    [1] = {  

+        .start = DM9000_BASE + 4,  

+        .end   = DM9000_BASE + 7,  

+        .flags = IORESOURCE_MEM  

+    },  

+    [2] = {  

+        .start = IRQ_EINT7,  

+        .end   = IRQ_EINT7,  

+        .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,  

+    }  

+};  

+

+static struct dm9000_plat_data s3c_dm9000_pdata = {  

+    .flags      = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM),  

+};  

+static struct platform_device s3c_device_dm9000 = {  

+    .name       = "dm9000",  

+    .id     = -1,  

+    .num_resources  = ARRAY_SIZE(s3c_dm9000_resource),  

+    .resource   = s3c_dm9000_resource,  

+    .dev        = {  

+        .platform_data  = &s3c_dm9000_pdata,  

+    },  

+};   

+

static struct map_desc smdk2440_iodesc[] __initdata = {

/IT之家 ISA IO Space map (memory space selected by A24) IT之家/

@@ -155,13 +198,30 @@

&s3c_device_wdt,

&s3c_device_i2c0,

&s3c_device_iis,

+        &s3c_device_dm9000,

};

+/IT之家 Add by zoulei 2017.04.15, fix device descriptor read/64, error -62 bug, value refer to datasheet P255 IT之家/   

+int usb_s3c2440_init(void)  

+{  

+    /IT之家 Input Frequency is 12.0000MHz, and MDEV=0x38 PDIV=2 SDIV=2, so output frequency 48.00MHz IT之家/  

+    unsigned long upllvalue = (0x38<<12)|(0x02<<4)|(0x02);   

+    while (upllvalue != __raw_readl(S3C2410_UPLLCON))  

+   {  

+        __raw_writel(upllvalue, S3C2410_UPLLCON);   

+        mdelay(1);   

+    }  

+  

+    return 0;  

+}  

+

+

static void __init smdk2440_map_io(void)

{

s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));

-       s3c24xx_init_clocks(16934400);

+       s3c24xx_init_clocks(12000000);

        s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));

+        usb_s3c2440_init(); /IT之家 Add by zoulei, 2017.04.15 IT之家/

}

static void __init smdk2440_machine_init(void)

##################################################

[zoulei@CentOS linux-3.0]$ vim drivers/usb/serial/option.c

--- option.c    2017-04-15 06:06:17.470001485 -0700

+++ option1.c   2017-04-15 05:47:14.996001503 -0700

@@ -50,7 +50,14 @@

static int option_send_setup(struct usb_serial_port IT之家port);

static void option_instat_callback(struct urb IT之家urb);

-/IT之家 Vendor and product IDs IT之家/

+ /IT之家 Vendor and product IDs IT之家/  

+static int vendor = 0; /IT之家   Add by zoulei IT之家/  

+static int product = 0; /IT之家   Add by zoulei  IT之家/  

+

+/IT之家   Vendor and product IDs IT之家/  

+#define OPTION_VENDOR_RESERVED      0xFFFF /IT之家   Add by zoulei IT之家/  

+#define OPTION_RESERVED_DEVICE      0xFFFF /IT之家   Add by zoulei IT之家/   

+

#define OPTION_VENDOR_ID                       0x0AF0

#define OPTION_PRODUCT_COLT                    0x5000

#define OPTION_PRODUCT_RICOLA                  0x6000

@@ -446,7 +453,8 @@

.reason = OPTION_BLACKLIST_SENDSETUP

};

-static const struct usb_device_id option_ids[] = {

+static  struct usb_device_id option_ids[] = {

+        { USB_DEVICE(OPTION_VENDOR_RESERVED, OPTION_RESERVED_DEVICE) },

{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },

{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },

{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) },

@@ -1079,6 +1087,15 @@

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);  

+            }  

+

retval = usb_serial_register(&option_1port_device);

if (retval)

goto failed_1port_device_register;

 

2.添加U盘支持  

[zoulei@CentOS linux-3.0]$ make menuconfig

Device Drivers  ---> 

Generic Driver Options  --->

(/sbin/hotplug) path to uevent helper                  //配置u盘的热插拔

[IT之家] Block devices  --->

<IT之家>   Low Performance USB Block driver     //低性能USB块设备驱动

SCSI device support  ---> 

<IT之家> SCSI device support   //SCSI设备的支持

[IT之家]  legacy /proc/scsi/ support

<IT之家> SCSI disk support     //是对 USB 鼠标键盘的支持

<IT之家> SCSI generic support //SCSI通用的支持

[IT之家] Probe all LUNs on each SCSI device           //所有在每个SCSI LUN探针装置

[IT之家] HID Devices --->

<IT之家> USB Human Interface Device (full HID) support //是对 USB 鼠标键盘的支持

[IT之家] /dev/hiddev raw HID device support

[IT之家] USB support  ---> 

<IT之家>   Support for Host-side USB  //主机端USB支持

[IT之家]     USB device filesystem (DEPRECATED)  //USB设备文件系统(不推荐使用)

[IT之家]     USB device class-devices (DEPRECATED)   / /USB设备类设备(不推荐使用)

<IT之家>   USB Monitor   //USB监控

<IT之家>   OHCI HCD support  //支持OHCI标准

<IT之家>   USB Mass Storage support  //支持USB海量存储

File systems  --->               //配置u盘的文件系统

DOS/FAT/NT Filesystems  --->

<IT之家> MSDOS fs support

<IT之家> VFAT (Windows-95) fs support

(437) Default codepage for FAT //默认代码页

(iso8859-1) Default iocharset for FAT //默认字符集

-IT之家- Native language support  --->     //配置u盘的语言格式支持

--- Native language support       

<IT之家>    Codepage  437 (United States, Canada)

<IT之家>   Simplified Chinese charset (CP936, GB2312)

<IT之家>   ASCII (United States) 

<IT之家>   NLS UTF-8

 

3.自动挂载:

[zoulei@centos6 ~]$ cd /home/zoulei/opt/rootfs/etc

[zoulei@centos6 etc]$ vim mdev.conf

sd[a-z][0-9]      0:0 0777        @(mount /dev/$MDEV /mnt/usb)

sd[a-z]           0:0 0777        $(umount /mnt/usb)

#ub[a-z][0-9]      0:0 0777        @(mount /dev/$MDEV /mnt/usb)

#ub[a-z]           0:0 0777        $(umount /mnt/usb)

mmcblk[0-9]p[0-9] 0:0 0777        @(mount /dev/$MDEV /mnt/sdc)

mmcblk[0-9]       0:0 0777        $(umount /mnt/sdc)

注意:根文件树加了这个配置文件就可以自动挂载了,否则就需要手动挂载:mount  /dev/sda  /mnt/usb

如果你的U盘在板子上显示是sd,也可能有的设备是ub,这时候进入你的根文件树查看是否自动挂载

sd的设备后置a-z或者0-9都可以显示自动挂载 ub的设备后置从a-z可以显示自动挂载,如果你的ub设备显示数字,可将第三行改为

#ub[a-z][0-9]      0:0 0777        @(mount /dev/$MDEV /mnt/usb)

mmcblk的设备也是如此。

 

4.开发板上操作

当插上U盘后开发板上显示:

>: usb 1-1.1: new full speed USB device number 3 using s3c2410-ohci

scsi0 : usb-storage 1-1.1:1.0

scsi 0:0:0:0: Direct-Access     UDISK    PDU15_1G 71G2.0  0.00 PQ: 0 ANSI: 2

sd 0:0:0:0: [sda] 2015231 512-byte logical blocks: (1.03 GB/983 MiB)

sd 0:0:0:0: Attached scsi generic sg0 type 0

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Asking for cache data failed

sd 0:0:0:0: [sda] Assuming drive cache: write through

sd 0:0:0:0: [sda] Asking for cache data failed

sd 0:0:0:0: [sda] Assuming drive cache: write through

sda: sda1

sd 0:0:0:0: [sda] Asking for cache data failed

sd 0:0:0:0: [sda] Assuming drive cache: write through

sd 0:0:0:0: [sda] Attached SCSI removable disk

fl2440 linux内核移植usb驱动

查看挂载到/mnt/usb目录,可以看到里面有我的u盘的内容,说明U盘移植成功了!

已经添加了中文支持。可是u盘还是显示不了中文。

 

遇到的问题及解决方法:

问题1.

>: usb 1-1.2: new full speed USB device number 3 using s3c2410-ohci

scsi0 : usb-storage 1-1.2:1.0

JFFS2 notice: (769) check_node_data: wrong data CRC in data node at 0x00bc06f8: read 0x45e69e3e, calculated 0x21c8152d.

JFFS2 notice: (769) check_node_data: wrong data CRC in data node at 0x0109c890: read 0x10e5206a, calculated 0x8be51971.

scsi 0:0:0:0: Direct-Access     UDISK    PDU15_1G 71G2.0  0.00 PQ: 0 ANSI: 2

scsi 0:0:0:0: Attached scsi generic sg0 type 0

>: usb 1-1.2: USB disconnect, device number 3

usb 1-1.1: new full speed USB device number 4 using s3c2410-ohci

scsi1 : usb-storage 1-1.1:1.0

scsi 1:0:0:0: Direct-Access     UDISK    PDU15_1G 71G2.0  0.00 PQ: 0 ANSI: 2

scsi 1:0:0:0: Attached scsi generic sg0 type 0

解决:插上U盘后开发板上只显示这么少的信息,而且查看我的U盘会有错误显示!

说明有很多内核配置我没选上,于是又再选上支持usb,u盘的选项

问题2:

>: mount /dev/sda1 /mnt/usb/

mount: mounting /dev/sda1 on /mnt/usb/ failed: Device or resource busy

解决:因为内核是自动挂载的,当然这是自己在根文件系统树里面配置的,如果你已经自动挂载,

那么再手动挂载就会显示设备资源忙的提示。

问题3.

>: usb 1-1.1: new full speed USB device number 3 using s3c2410-ohci

scsi0 : usb-storage 1-1.1:1.0

scsi 0:0:0:0: Direct-Access     UDISK    PDU15_1G 71G2.0  0.00 PQ: 0 ANSI: 2

sd 0:0:0:0: [sda] 2015231 512-byte logical blocks: (1.03 GB/983 MiB)

sd 0:0:0:0: Attached scsi generic sg0 type 0

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Asking for cache data failed

sd 0:0:0:0: [sda] Assuming drive cache: write through

sd 0:0:0:0: [sda] Asking for cache data failed

sd 0:0:0:0: [sda] Assuming drive cache: write through

sda: sda1

sd 0:0:0:0: [sda] Asking for cache data failed

sd 0:0:0:0: [sda] Assuming drive cache: write through

sd 0:0:0:0: [sda] Attached SCSI removable disk

FAT-fs (sda1): codepage cp437 not found

FAT-fs (sda1): codepage cp437 not found

FAT-fs (sda1): IO charset iso8859-1 not found

解决:内核没有选上Codepage  437,在--- Native language support 里面选上就可以了!

相关热词: Linux

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/server/kaifa/8396.shtml

相关文章
Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

fl2440 linux内核移植usb驱动

2020-12-24 编辑:wy

Linux内核:linux-3.0

 

1.添加USB结构体变量,加厂商ID和设备ID

[zoulei@CentOS linux-3.0]$vim arch/arm/mach-s3c2440/mach-smdk2440.c

--- mach1-smdk2440.c    2017-04-15 06:12:36.061000246 -0700

+++ mach2-smdk2440.c    2017-04-15 06:21:30.015999978 -0700

@@ -13,6 +13,7 @@

IT之家

IT之家/ 

+#include <linux/dm9000.h> 

#include <linux/kernel.h>

#include <linux/types.h>

#include <linux/interrupt.h>

@@ -22,6 +23,12 @@

#include <linux/serial_core.h>

#include <linux/platform_device.h>

#include <linux/io.h>

+/IT之家  add by zoulei for norflash  IT之家/  

+#include <linux/gpio_keys.h>  

+#include <linux/input.h>  

+#include <linux/mtd/physmap.h>  

+#include <linux/mtd/mtd.h>  

+#include <linux/mtd/partitions.h>

#include <asm/mach/arch.h>

#include <asm/mach/map.h>

@@ -44,9 +51,45 @@

#include <plat/clock.h>

#include <plat/devs.h>

#include <plat/cpu.h>

-

+#include <plat/ts.h>         /IT之家Add by zoulei to support Touch screen, 2017.04.15IT之家/  

+#include <mach/regs-clock.h> /IT之家Add by zoulei  2017.04.15, for usb_s3c2440_init() IT之家/  

+#include <linux/i2c.h>       /IT之家Add by zoulei 2017.4.15, for AT24C512 driver IT之家/  

+#include <linux/i2c/at24.h>  /IT之家Add by zoulei 2017.4.15, for AT24C512 driver IT之家/  

+#include <linux/delay.h>  

#include <plat/common-smdk.h>

+#define DM9000_BASE    (S3C2410_CS4 + 0x300)  

+static struct resource s3c_dm9000_resource[] = {  

+     [0] = {  

+        .start = DM9000_BASE,  

+        .end   = DM9000_BASE + 3,  

+        .flags = IORESOURCE_MEM  

+    },  

+    [1] = {  

+        .start = DM9000_BASE + 4,  

+        .end   = DM9000_BASE + 7,  

+        .flags = IORESOURCE_MEM  

+    },  

+    [2] = {  

+        .start = IRQ_EINT7,  

+        .end   = IRQ_EINT7,  

+        .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,  

+    }  

+};  

+

+static struct dm9000_plat_data s3c_dm9000_pdata = {  

+    .flags      = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM),  

+};  

+static struct platform_device s3c_device_dm9000 = {  

+    .name       = "dm9000",  

+    .id     = -1,  

+    .num_resources  = ARRAY_SIZE(s3c_dm9000_resource),  

+    .resource   = s3c_dm9000_resource,  

+    .dev        = {  

+        .platform_data  = &s3c_dm9000_pdata,  

+    },  

+};   

+

static struct map_desc smdk2440_iodesc[] __initdata = {

/IT之家 ISA IO Space map (memory space selected by A24) IT之家/

@@ -155,13 +198,30 @@

&s3c_device_wdt,

&s3c_device_i2c0,

&s3c_device_iis,

+        &s3c_device_dm9000,

};

+/IT之家 Add by zoulei 2017.04.15, fix device descriptor read/64, error -62 bug, value refer to datasheet P255 IT之家/   

+int usb_s3c2440_init(void)  

+{  

+    /IT之家 Input Frequency is 12.0000MHz, and MDEV=0x38 PDIV=2 SDIV=2, so output frequency 48.00MHz IT之家/  

+    unsigned long upllvalue = (0x38<<12)|(0x02<<4)|(0x02);   

+    while (upllvalue != __raw_readl(S3C2410_UPLLCON))  

+   {  

+        __raw_writel(upllvalue, S3C2410_UPLLCON);   

+        mdelay(1);   

+    }  

+  

+    return 0;  

+}  

+

+

static void __init smdk2440_map_io(void)

{

s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));

-       s3c24xx_init_clocks(16934400);

+       s3c24xx_init_clocks(12000000);

        s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));

+        usb_s3c2440_init(); /IT之家 Add by zoulei, 2017.04.15 IT之家/

}

static void __init smdk2440_machine_init(void)

##################################################

[zoulei@CentOS linux-3.0]$ vim drivers/usb/serial/option.c

--- option.c    2017-04-15 06:06:17.470001485 -0700

+++ option1.c   2017-04-15 05:47:14.996001503 -0700

@@ -50,7 +50,14 @@

static int option_send_setup(struct usb_serial_port IT之家port);

static void option_instat_callback(struct urb IT之家urb);

-/IT之家 Vendor and product IDs IT之家/

+ /IT之家 Vendor and product IDs IT之家/  

+static int vendor = 0; /IT之家   Add by zoulei IT之家/  

+static int product = 0; /IT之家   Add by zoulei  IT之家/  

+

+/IT之家   Vendor and product IDs IT之家/  

+#define OPTION_VENDOR_RESERVED      0xFFFF /IT之家   Add by zoulei IT之家/  

+#define OPTION_RESERVED_DEVICE      0xFFFF /IT之家   Add by zoulei IT之家/   

+

#define OPTION_VENDOR_ID                       0x0AF0

#define OPTION_PRODUCT_COLT                    0x5000

#define OPTION_PRODUCT_RICOLA                  0x6000

@@ -446,7 +453,8 @@

.reason = OPTION_BLACKLIST_SENDSETUP

};

-static const struct usb_device_id option_ids[] = {

+static  struct usb_device_id option_ids[] = {

+        { USB_DEVICE(OPTION_VENDOR_RESERVED, OPTION_RESERVED_DEVICE) },

{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },

{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },

{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) },

@@ -1079,6 +1087,15 @@

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);  

+            }  

+

retval = usb_serial_register(&option_1port_device);

if (retval)

goto failed_1port_device_register;

 

2.添加U盘支持  

[zoulei@CentOS linux-3.0]$ make menuconfig

Device Drivers  ---> 

Generic Driver Options  --->

(/sbin/hotplug) path to uevent helper                  //配置u盘的热插拔

[IT之家] Block devices  --->

<IT之家>   Low Performance USB Block driver     //低性能USB块设备驱动

SCSI device support  ---> 

<IT之家> SCSI device support   //SCSI设备的支持

[IT之家]  legacy /proc/scsi/ support

<IT之家> SCSI disk support     //是对 USB 鼠标键盘的支持

<IT之家> SCSI generic support //SCSI通用的支持

[IT之家] Probe all LUNs on each SCSI device           //所有在每个SCSI LUN探针装置

[IT之家] HID Devices --->

<IT之家> USB Human Interface Device (full HID) support //是对 USB 鼠标键盘的支持

[IT之家] /dev/hiddev raw HID device support

[IT之家] USB support  ---> 

<IT之家>   Support for Host-side USB  //主机端USB支持

[IT之家]     USB device filesystem (DEPRECATED)  //USB设备文件系统(不推荐使用)

[IT之家]     USB device class-devices (DEPRECATED)   / /USB设备类设备(不推荐使用)

<IT之家>   USB Monitor   //USB监控

<IT之家>   OHCI HCD support  //支持OHCI标准

<IT之家>   USB Mass Storage support  //支持USB海量存储

File systems  --->               //配置u盘的文件系统

DOS/FAT/NT Filesystems  --->

<IT之家> MSDOS fs support

<IT之家> VFAT (Windows-95) fs support

(437) Default codepage for FAT //默认代码页

(iso8859-1) Default iocharset for FAT //默认字符集

-IT之家- Native language support  --->     //配置u盘的语言格式支持

--- Native language support       

<IT之家>    Codepage  437 (United States, Canada)

<IT之家>   Simplified Chinese charset (CP936, GB2312)

<IT之家>   ASCII (United States) 

<IT之家>   NLS UTF-8

 

3.自动挂载:

[zoulei@centos6 ~]$ cd /home/zoulei/opt/rootfs/etc

[zoulei@centos6 etc]$ vim mdev.conf

sd[a-z][0-9]      0:0 0777        @(mount /dev/$MDEV /mnt/usb)

sd[a-z]           0:0 0777        $(umount /mnt/usb)

#ub[a-z][0-9]      0:0 0777        @(mount /dev/$MDEV /mnt/usb)

#ub[a-z]           0:0 0777        $(umount /mnt/usb)

mmcblk[0-9]p[0-9] 0:0 0777        @(mount /dev/$MDEV /mnt/sdc)

mmcblk[0-9]       0:0 0777        $(umount /mnt/sdc)

注意:根文件树加了这个配置文件就可以自动挂载了,否则就需要手动挂载:mount  /dev/sda  /mnt/usb

如果你的U盘在板子上显示是sd,也可能有的设备是ub,这时候进入你的根文件树查看是否自动挂载

sd的设备后置a-z或者0-9都可以显示自动挂载 ub的设备后置从a-z可以显示自动挂载,如果你的ub设备显示数字,可将第三行改为

#ub[a-z][0-9]      0:0 0777        @(mount /dev/$MDEV /mnt/usb)

mmcblk的设备也是如此。

 

4.开发板上操作

当插上U盘后开发板上显示:

>: usb 1-1.1: new full speed USB device number 3 using s3c2410-ohci

scsi0 : usb-storage 1-1.1:1.0

scsi 0:0:0:0: Direct-Access     UDISK    PDU15_1G 71G2.0  0.00 PQ: 0 ANSI: 2

sd 0:0:0:0: [sda] 2015231 512-byte logical blocks: (1.03 GB/983 MiB)

sd 0:0:0:0: Attached scsi generic sg0 type 0

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Asking for cache data failed

sd 0:0:0:0: [sda] Assuming drive cache: write through

sd 0:0:0:0: [sda] Asking for cache data failed

sd 0:0:0:0: [sda] Assuming drive cache: write through

sda: sda1

sd 0:0:0:0: [sda] Asking for cache data failed

sd 0:0:0:0: [sda] Assuming drive cache: write through

sd 0:0:0:0: [sda] Attached SCSI removable disk

fl2440 linux内核移植usb驱动

查看挂载到/mnt/usb目录,可以看到里面有我的u盘的内容,说明U盘移植成功了!

已经添加了中文支持。可是u盘还是显示不了中文。

 

遇到的问题及解决方法:

问题1.

>: usb 1-1.2: new full speed USB device number 3 using s3c2410-ohci

scsi0 : usb-storage 1-1.2:1.0

JFFS2 notice: (769) check_node_data: wrong data CRC in data node at 0x00bc06f8: read 0x45e69e3e, calculated 0x21c8152d.

JFFS2 notice: (769) check_node_data: wrong data CRC in data node at 0x0109c890: read 0x10e5206a, calculated 0x8be51971.

scsi 0:0:0:0: Direct-Access     UDISK    PDU15_1G 71G2.0  0.00 PQ: 0 ANSI: 2

scsi 0:0:0:0: Attached scsi generic sg0 type 0

>: usb 1-1.2: USB disconnect, device number 3

usb 1-1.1: new full speed USB device number 4 using s3c2410-ohci

scsi1 : usb-storage 1-1.1:1.0

scsi 1:0:0:0: Direct-Access     UDISK    PDU15_1G 71G2.0  0.00 PQ: 0 ANSI: 2

scsi 1:0:0:0: Attached scsi generic sg0 type 0

解决:插上U盘后开发板上只显示这么少的信息,而且查看我的U盘会有错误显示!

说明有很多内核配置我没选上,于是又再选上支持usb,u盘的选项

问题2:

>: mount /dev/sda1 /mnt/usb/

mount: mounting /dev/sda1 on /mnt/usb/ failed: Device or resource busy

解决:因为内核是自动挂载的,当然这是自己在根文件系统树里面配置的,如果你已经自动挂载,

那么再手动挂载就会显示设备资源忙的提示。

问题3.

>: usb 1-1.1: new full speed USB device number 3 using s3c2410-ohci

scsi0 : usb-storage 1-1.1:1.0

scsi 0:0:0:0: Direct-Access     UDISK    PDU15_1G 71G2.0  0.00 PQ: 0 ANSI: 2

sd 0:0:0:0: [sda] 2015231 512-byte logical blocks: (1.03 GB/983 MiB)

sd 0:0:0:0: Attached scsi generic sg0 type 0

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Asking for cache data failed

sd 0:0:0:0: [sda] Assuming drive cache: write through

sd 0:0:0:0: [sda] Asking for cache data failed

sd 0:0:0:0: [sda] Assuming drive cache: write through

sda: sda1

sd 0:0:0:0: [sda] Asking for cache data failed

sd 0:0:0:0: [sda] Assuming drive cache: write through

sd 0:0:0:0: [sda] Attached SCSI removable disk

FAT-fs (sda1): codepage cp437 not found

FAT-fs (sda1): codepage cp437 not found

FAT-fs (sda1): IO charset iso8859-1 not found

解决:内核没有选上Codepage  437,在--- Native language support 里面选上就可以了!

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/server/kaifa/8396.shtml

相关文章

风云图片

推荐阅读

返回Linux开发频道首页