lpc1788->linux 2.6.33在uc板上移植usbwifi总结(使用dw131)
编译:
使用arm-2010q1
编译是进入工程目录projects/usbwifi/目录里面,直接make clean, make
内核配置选项在usbwifi.kernel.LPC
busybox 配置选项在 usbwifi.busybox
initramfs需要的东西在 usbwifi.initramfs 里面
(1)usb ohci调试出现的问题为usb ohci的中断进不去,查的最后结果是因为usb stctl设置问题,设置为3就可以了。
首先下载的dw131的驱动,通过insmod加载,然后在iwconfig的时候出现挂机,pc在0x1c地址出错,后来查出是驱动问题
修改驱动代码,dw131使用的是r8721的驱动,是在device/staging device类别里面,但是2.6.33驱动里面是没有的,查到的最近的
是2.6.37,拷贝到2.6.33的驱动里面,修改kconfig,及makefile两个文件
iwconfig 来自于wireless tool编译。
驱动正常
usb 1-1: new full speed USB device using lpc178x-ohci and address 2
usb 1-1: New USB device found, idVendor=07d1, idProduct=3303
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: 11n Adapter
usb 1-1: Manufacturer: Manufacturer Realtek
usb 1-1: SerialNumber: 00e04c000001
r8712u: DriverVersion: v7_0.20100831
r8712u: register rtl8712_netdev_ops to netdev_ops
r8712u: USB_SPEED_LOW with 4 endpoints
r8712u: Boot from EFUSE: Autoload OK
r8712u: CustomerID = 0x0000
r8712u: MAC Address from efuse = 28:10:7b:c4:f2:fc
~ # ifconfig wlan0 up(启动网卡)
r8712u: 1 RCR=0x153f00e
r8712u: 2 RCR=0x553f00e
~ #
(2)ethernet 调试问题
ethernet ping 的时候有发送指示等在闪,但是在host端没收到数据,后来查出是mdix问题,接着在0x19寄存器里面强制为
mdix_force模式就可以了,不知道为什么
(3)mtdblock的flash驱动问题
首先在u-boot里面使用发现读不出id,查到是地址问题,ea板接的是cs0, 而uc板接的是cs1,所以p4.31要写入到配置表,
配置表位于iomux.c里面,cofig.h文件的地址也是要改的0x80000000->0x90000000
这次有数据了,但还是读不出id,(读出是错的),查原理图发现shift有问题。默认scs里面的shift是设置为1的,而uc板是
需要shift的,所以要设置为0才可以.
启动发现id对了。
另外的就是jedec_flash.c里面要写入flash的信息 sst39vf6410在u-boot 2010.6里面是没有的。
在linux下面除了要改flash的base 地址要改,也要写入jedec_flash.c里面的配置信息,
flash的容量也要改成8m
U-Boot 2010.03 (Jul 31 2013 - 12:58:13)
CPU : LPC178x/7x series (Cortex-M3)
Freqs: SYSTICK=108MHz,EMCCLK=54MHz,PCLK=54MHz
Board: EA-LPC1788 rev 1
st[1]=81
scs = 68
DRAM: 32 MB
cfi_flash.c,flash_init
Flash: 8 MB
In: serial
Out: serial
Err: serial
Net: LPC178X_MAC
Hit any key to stop autoboot: 0
## Booting kernel from Legacy Image at 90020000 ...
Image Name: Linux-2.6.33-arm1
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4037216 Bytes = 3.9 MB
Load Address: a0008000
Entry Point: a0008001
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
?Linux version 2.6.33-arm1 (root@localhost.localdomain) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-189) ) #260 Wed Jul 31 14:35:16 EDT 2013
CPU: ARMv7-M Processor [412fc230] revision 0 (ARMv7M)
CPU: NO data cache, NO instruction cache
Machine: NXP LPC178x/7x
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 8128
Kernel command line: lpc178x_platform=ea-lpc1788 console=ttyS0,115200 panic=10 ip=172.17.0.206:172.17.0.1:::ea-lpc1788:eth0:off ethaddr=C0:B1:3C:88:88:88
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 28476k/28476k available, 4292k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0x00000000 - 0x00001000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0x00000000 - 0xffffffff (4095 MB)
lowmem : 0xa0000000 - 0xa2000000 ( 32 MB)
modules : 0xa0000000 - 0x01000000 (1552 MB)
.init : 0xa0008000 - 0xa0246000 (2296 kB)
.text : 0xa0246000 - 0xa03ca000 (1552 kB)
.data : 0xa03ca000 - 0xa03e1a60 ( 95 kB)
Hierarchical RCU implementation.
NR_IRQS:41
Calibrating delay loop... 30.92 BogoMIPS (lpj=154624)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
lpc178x_iomux_init
bio: create slab <bio-0> at 0
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource cm3-systick
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
JFFS2 version 2.2. (NAND) ?? 2001-2006 Red Hat, Inc.
alg: No test for stdrng (krng)
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 5 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x4000c000 (irq = 5) is a 16550A
console [ttyS0] enabled
serial8250.2: ttyS1 at MMIO 0x40098000 (irq = 7) is a 16550A
physmap platform flash device: 00800000 at 90000000
cfi->mfr = bf, cfi->id = 236d
physmap-flash: Found 1 x16 devices at 0x0 in 16-bit bank
the id is 2
Amd/Fujitsu Extended Query Table at 0x0000
gen_probe: No supported Vendor Command Set found
Found: SST 39VF6401
physmap-flash: Found 1 x16 devices at 0x0 in 16-bit bank
number of JEDEC chips: 1
RedBoot partition parsing not available
Using physmap partition information
Creating 3 MTD partitions on "physmap-flash":
0x000000000000-0x000000020000 : "flash_uboot_env"
0x000000020000-0x000000600000 : "flash_linux_image"
0x000000600000-0x000000800000 : "flash_jffs2"
phy_id = 20005c90
lpc_mii_bus: probed
eth0: using RMII interface
eth0: LPC mac at 0x20084000 irq 28
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:01, irq=-1)
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
lpc178x_hc_start 80000100
lpc178x-ohci lpc178x-ohci: LPC178x OHCI
lpc178x-ohci lpc178x-ohci: new USB bus registered, assigned bus number 1
lpc178x-ohci lpc178x-ohci: line-2141
lpc178x-ohci lpc178x-ohci: irq 24, io mem 0x2008c000
ohci_lpc178x_start
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: LPC178x OHCI
usb usb1: Manufacturer: Linux 2.6.33-arm1 ohci_hcd
usb usb1: SerialNumber: lpc178x-ohci
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
usbcore: registered new interface driver r8712u
TCP cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
IP-Config: Guessing netmask 255.255.0.0
IP-Config: Complete:
device=eth0, addr=172.17.0.206, mask=255.255.0.0, gw=255.255.255.255,
host=ea-lpc1788, domain=, nis-domain=(none),
bootserver=172.17.0.1, rootserver=172.17.0.1, rootpath=
Freeing init memory: 2296K
init started: BusyBox v1.17.0 (2013-07-29 16:20:08 EDT)
~ #
编译:
使用arm-2010q1
编译是进入工程目录projects/usbwifi/目录里面,直接make clean, make
内核配置选项在usbwifi.kernel.LPC
busybox 配置选项在 usbwifi.busybox
initramfs需要的东西在 usbwifi.initramfs 里面
(1)usb ohci调试出现的问题为usb ohci的中断进不去,查的最后结果是因为usb stctl设置问题,设置为3就可以了。
首先下载的dw131的驱动,通过insmod加载,然后在iwconfig的时候出现挂机,pc在0x1c地址出错,后来查出是驱动问题
修改驱动代码,dw131使用的是r8721的驱动,是在device/staging device类别里面,但是2.6.33驱动里面是没有的,查到的最近的
是2.6.37,拷贝到2.6.33的驱动里面,修改kconfig,及makefile两个文件
iwconfig 来自于wireless tool编译。
驱动正常
usb 1-1: new full speed USB device using lpc178x-ohci and address 2
usb 1-1: New USB device found, idVendor=07d1, idProduct=3303
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: 11n Adapter
usb 1-1: Manufacturer: Manufacturer Realtek
usb 1-1: SerialNumber: 00e04c000001
r8712u: DriverVersion: v7_0.20100831
r8712u: register rtl8712_netdev_ops to netdev_ops
r8712u: USB_SPEED_LOW with 4 endpoints
r8712u: Boot from EFUSE: Autoload OK
r8712u: CustomerID = 0x0000
r8712u: MAC Address from efuse = 28:10:7b:c4:f2:fc
~ # ifconfig wlan0 up(启动网卡)
r8712u: 1 RCR=0x153f00e
r8712u: 2 RCR=0x553f00e
~ #
(2)ethernet 调试问题
ethernet ping 的时候有发送指示等在闪,但是在host端没收到数据,后来查出是mdix问题,接着在0x19寄存器里面强制为
mdix_force模式就可以了,不知道为什么
(3)mtdblock的flash驱动问题
首先在u-boot里面使用发现读不出id,查到是地址问题,ea板接的是cs0, 而uc板接的是cs1,所以p4.31要写入到配置表,
配置表位于iomux.c里面,cofig.h文件的地址也是要改的0x80000000->0x90000000
这次有数据了,但还是读不出id,(读出是错的),查原理图发现shift有问题。默认scs里面的shift是设置为1的,而uc板是
需要shift的,所以要设置为0才可以.
启动发现id对了。
另外的就是jedec_flash.c里面要写入flash的信息 sst39vf6410在u-boot 2010.6里面是没有的。
在linux下面除了要改flash的base 地址要改,也要写入jedec_flash.c里面的配置信息,
flash的容量也要改成8m
U-Boot 2010.03 (Jul 31 2013 - 12:58:13)
CPU : LPC178x/7x series (Cortex-M3)
Freqs: SYSTICK=108MHz,EMCCLK=54MHz,PCLK=54MHz
Board: EA-LPC1788 rev 1
st[1]=81
scs = 68
DRAM: 32 MB
cfi_flash.c,flash_init
Flash: 8 MB
In: serial
Out: serial
Err: serial
Net: LPC178X_MAC
Hit any key to stop autoboot: 0
## Booting kernel from Legacy Image at 90020000 ...
Image Name: Linux-2.6.33-arm1
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4037216 Bytes = 3.9 MB
Load Address: a0008000
Entry Point: a0008001
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
?Linux version 2.6.33-arm1 (root@localhost.localdomain) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-189) ) #260 Wed Jul 31 14:35:16 EDT 2013
CPU: ARMv7-M Processor [412fc230] revision 0 (ARMv7M)
CPU: NO data cache, NO instruction cache
Machine: NXP LPC178x/7x
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 8128
Kernel command line: lpc178x_platform=ea-lpc1788 console=ttyS0,115200 panic=10 ip=172.17.0.206:172.17.0.1:::ea-lpc1788:eth0:off ethaddr=C0:B1:3C:88:88:88
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 28476k/28476k available, 4292k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0x00000000 - 0x00001000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0x00000000 - 0xffffffff (4095 MB)
lowmem : 0xa0000000 - 0xa2000000 ( 32 MB)
modules : 0xa0000000 - 0x01000000 (1552 MB)
.init : 0xa0008000 - 0xa0246000 (2296 kB)
.text : 0xa0246000 - 0xa03ca000 (1552 kB)
.data : 0xa03ca000 - 0xa03e1a60 ( 95 kB)
Hierarchical RCU implementation.
NR_IRQS:41
Calibrating delay loop... 30.92 BogoMIPS (lpj=154624)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
lpc178x_iomux_init
bio: create slab <bio-0> at 0
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource cm3-systick
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
JFFS2 version 2.2. (NAND) ?? 2001-2006 Red Hat, Inc.
alg: No test for stdrng (krng)
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 5 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x4000c000 (irq = 5) is a 16550A
console [ttyS0] enabled
serial8250.2: ttyS1 at MMIO 0x40098000 (irq = 7) is a 16550A
physmap platform flash device: 00800000 at 90000000
cfi->mfr = bf, cfi->id = 236d
physmap-flash: Found 1 x16 devices at 0x0 in 16-bit bank
the id is 2
Amd/Fujitsu Extended Query Table at 0x0000
gen_probe: No supported Vendor Command Set found
Found: SST 39VF6401
physmap-flash: Found 1 x16 devices at 0x0 in 16-bit bank
number of JEDEC chips: 1
RedBoot partition parsing not available
Using physmap partition information
Creating 3 MTD partitions on "physmap-flash":
0x000000000000-0x000000020000 : "flash_uboot_env"
0x000000020000-0x000000600000 : "flash_linux_image"
0x000000600000-0x000000800000 : "flash_jffs2"
phy_id = 20005c90
lpc_mii_bus: probed
eth0: using RMII interface
eth0: LPC mac at 0x20084000 irq 28
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:01, irq=-1)
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
lpc178x_hc_start 80000100
lpc178x-ohci lpc178x-ohci: LPC178x OHCI
lpc178x-ohci lpc178x-ohci: new USB bus registered, assigned bus number 1
lpc178x-ohci lpc178x-ohci: line-2141
lpc178x-ohci lpc178x-ohci: irq 24, io mem 0x2008c000
ohci_lpc178x_start
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: LPC178x OHCI
usb usb1: Manufacturer: Linux 2.6.33-arm1 ohci_hcd
usb usb1: SerialNumber: lpc178x-ohci
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
usbcore: registered new interface driver r8712u
TCP cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
IP-Config: Guessing netmask 255.255.0.0
IP-Config: Complete:
device=eth0, addr=172.17.0.206, mask=255.255.0.0, gw=255.255.255.255,
host=ea-lpc1788, domain=, nis-domain=(none),
bootserver=172.17.0.1, rootserver=172.17.0.1, rootpath=
Freeing init memory: 2296K
init started: BusyBox v1.17.0 (2013-07-29 16:20:08 EDT)
~ #