一、移植環境:
1、 主機:Ubuntu 10.10發行版
2、 目標機:FS_S5PC100平台
3、 交叉編譯工具:arm-cortex_a8-linux-gnueabi
4、wifi模塊:marvell-8686
5、內核:linux-2.6.35
---------------------------------------------------------------------
二、在linux下的移植
1. 平台代碼修改
$ vim driver/mmc/host/sdhci.c
屏蔽以下代碼
629行:
//printK (KERN_WARING "%s: too large timeout requested!\n", mmc_hostname(host_>mmc));
2. 內核驅動支持
因為S5PC100平台上SDIO功能已經支持,所以只需要內核驅動支持marvell-8686即可。
$ make menuconfig
修改:
[*] Networking support --->
[*] Wireless --->
<*> cfg80211 - wireless configuration API
{*} common routines for IEEE 802.11 drivers
Device Drivers --->
[*] Network device support --->
Wireless LAN --->
<*>Marvell 8xxx Libertas WLAN driver support
<*> Marvell Libertas 8385/8686/8688 SDIO 802.11b/g cards
Generic Driver Options --->
(sd8686.bin sd8686_helper.bin) External firmware blobs to build into the kernel
(firmware) Firmware blobs root directory
3. 內核的修改
wifi的移植依賴於網卡驅動的移植和nand-flash平台的支持,可以參考Linux-2.6.35內核移植—網卡驅動的移植(見 http://www.linuxidc.com/Linux/2012-07/64775.htm )和Linux-2.6.35內核移植——Nand flash 驅動的移植(見 http://www.linuxidc.com/Linux/2012-07/64776.htm ),文件arch/arm/mach-s5pc100/mach-smdkc100.c下有內核的分區, 把第2個分區改成8M。因為生成的文件系統太大,大於4M。
修改如下(紅色字體部分):
static struct mtd_partition s5pc100_nand_part[] = {
[0] = {
.name = "bootloader",
.size = SZ_1M,
.offset = 0,
},
[1] = {
.name = "kernel",
.size = SZ_1M * 4,
.offset = MTDPART_OFS_APPEND,
},
[2] = {
.name = "rootfs",
.size = SZ_8M,
.offset = MTDPART_OFS_APPEND,
},
[3] = {
.name = "usrfs",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL,
},
};
4. 固件准備
將固件sd8686.bin和sd8686_helper.bin拷貝到linux-2.6.35/firmware下。編譯時會自動編譯進內核。
sd8686.bin和sd8686_helper.bin ,wpa_supplicant-0.7.3與openssl-0.9.8e下載地址:
免費下載地址在 http://linux.linuxidc.com/
用戶名與密碼都是www.linuxidc.com
具體下載目錄在 /2012年資料/7月/9日/基於Ubuntu-2.6.35內核的SDIO-WiFi驅動移植/
$ cp sd8686.bin linux-2.6.35/firmware/
$ cp sd8686_helper.bin linux-2.6.35/firmware/
$ make zImage $ sudo cp zImage /tftpboot