caiwang / board2ihost

0 stars 0 forks source link

rocklite + linux-rockchip + kernel 3.0.36 source code -> rt2800usb.ko #61

Open unissoft-bj opened 9 years ago

unissoft-bj commented 9 years ago

1,安装编译环境,下载linux-rockchip到/usr/src

ref : http://radxa.com/Rock/Booting_Linux apt-get install build-essential lzop libncurses5-dev libssl-dev git clone -b radxa-stable-3.0 https://github.com/radxa/linux-rockchip.git http://pan.baidu.com/s/1jfOTo (china)

2,下载kernel source 3.0.36到/usr/src

https://launchpad.net/linux/trunk/3.0.36/+download/linux-3.0.36.tar.gz https://launchpad.net/linux/+milestone/3.0.36

image

3,复制kernel source中的rt2x00源码到linux-rockchip cp -r ./linux-3.0.36/drivers/net/wireless/rt2x00 ./linux-rockchip/drivers/net/wireless/ image

4,编辑linux-rockchip下的 Kconfig,把rt2x00加进去(endif之前) root@radxa:/usr/src# nano ./linux-rockchip/drivers/net/wireless/Kconfig

source "drivers/net/wireless/rt2x00/Kconfig" 加在endif之前

image

5,编辑linux-rockchip下的Makefile,把rt2x00加进去 root@radxa:/usr/src# nano ./linux-rockchip/drivers/net/wireless/Makefile

obj-$(CONFIG_RT2X00) += rt2x00/ 加在最后一行

image

unissoft-bj commented 9 years ago

6,准备编译,配置 root@radxa:/usr/src# cd linux-rockchip/ root@radxa:/usr/src/linux-rockchip# make radxa_rock_linux_defconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/lex.zconf.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf #

configuration written to .config

# root@radxa:/usr/src/linux-rockchip#

7,修改配置,加入ralink rt2x00 root@radxa:/usr/src/linux-rockchip# make menuconfig

Device Drivers

Network Device Support

Wireless LAN image image

image

8,修改配置,kernel版本 root@radxa:/usr/src/linux-rockchip# nano .config

CONFIG_LOCALVERSION="+" 与rock lite sd卡版本保持一致 uname -a

root@radxa:/usr/src/linux-rockchip# uname -a Linux radxa 3.0.36+ #33 SMP PREEMPT Thu Oct 30 15:02:32 CST 2014 armv7l armv7l armv7l GNU/Linux

image

unissoft-bj commented 9 years ago

9,编译模块 root@radxa:/usr/src/linux-rockchip# make modules image

10,安装到指定目录 root@radxa:/usr/src/linux-rockchip# mkdir modules root@radxa:/usr/src/linux-rockchip# make INSTALL_MOD_PATH=./modules modules_install image

11,检查.ko文件 root@radxa:/usr/src/linux-rockchip# cd modules/lib/modules/3.0.36+/kernel/drivers/net/wireless/rt2x00/ root@radxa:/usr/src/linux-rockchip/modules/lib/modules/3.0.36+/kernel/drivers/net/wireless/rt2x00# ls -l total 148 -rw-r--r-- 1 root root 44836 May 2 04:22 rt2800lib.ko -rw-r--r-- 1 root root 36900 May 2 04:22 rt2800usb.ko -rw-r--r-- 1 root root 47238 May 2 04:22 rt2x00lib.ko -rw-r--r-- 1 root root 14934 May 2 04:22 rt2x00usb.ko root@radxa:/usr/src/linux-rockchip/modules/lib/modules/3.0.36+/kernel/drivers/net/wireless/rt2x00# modinfo rt2800usb.ko filename: /usr/src/linux-rockchip/modules/lib/modules/3.0.36+/kernel/drivers/net/wireless/rt2x00/rt2800usb.ko license: GPL firmware: rt2870.bin description: Ralink RT2800 USB Wireless LAN driver. version: 2.3.0 author: http://rt2x00.serialmonkey.com srcversion: C87A3BD5EC42ACB59FFFFB9

...

alias: usb:v07B8p2770d_dc_dsc_dp_ic_isc_ip alias: usb:v07B8p2870d_dc_dsc_dp_ic_isc_ip depends: rt2x00usb,rt2x00lib,rt2800lib vermagic: 3.0.36+ SMP preempt mod_unload ARMv7 parm: nohwcrypt:Disable hardware encryption. (bool) root@radxa:/usr/src/linux-rockchip/modules/lib/modules/3.0.36+/kernel/drivers/net/wireless/rt2x00#

12,应用驱动 mkdir /root/rt2x00.k3036 cp *.ko /root/rt2x00.k3036/
cat >> /root/ins_rt2x00.sh << EOF insmod /root/rt2x00.k3036/rt2x00lib.ko insmod /root/rt2x00.k3036/rt2x00usb.ko insmod /root/rt2x00.k3036/rt2800lib.ko insmod /root/rt2x00.k3036/rt2800usb.ko EOF

bash /root/ins_rt2x00.sh