1. 程式人生 > >linux-2.6.32移植到qq2440開發板手冊

linux-2.6.32移植到qq2440開發板手冊

虛 擬 機: RedHat 9.0
交叉編譯器: arm-linux-gcc-4.3.2
開 發 板: QQ2440V3
本次移植用到的核心原始碼包為: linux-2.6.32.2-mini2440-20110413.tar.gz
1.修改頂層的 Makefile
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-2.由於本人用的是 X35 的屏,故要支援 X35 ,修改
linux-2.6.32.2/drivers/video/Kconfig
config FB_S3C2410_X240320
boolean"3.5 inch 240X320 SONY LCD (X35-ACX502BMU) "
depends on FB_S3C2410
help
3.5 inch 240X320 SONY LCD (X35-ACX502BMU)
然後, make menuconfig,
選中 3.5 inch 240X320 SONY LCD (X35-ACX502BMU)這一項。
3.移植 CS8900 網絡卡
首先在 drivers/net 目錄下建立一個 cs8900 目錄,然後將 cs8900.c
cs8900.h 複製到 drivers/net/cs8900 目錄下,然後在
arch/arm/mach-s3c2410/include/mach/map.h 檔案中新增如下內容:
#define pSMDK2410_ETH_IO __phys_to_pfn(0x19000000)
#define vSMDK2410_ETH_IO 0xE0000000
#define SMDK2410_EHT_IRQ IRQ_EINT9
arch/arm/mach-s3c2440/mach-mini2440.c static struct map_desc
mini2440_iodesc[]
__initdata{};的花括號裡新增如下內容(包括花括號)
{
.virtual = vSMDK2410_ETH_IO,
.pfn = __phys_to_pfn(S3C2410_CS3 + (1<<24)),
.length = SZ_1M,
.type = MT_DEVICE,
}
drivers/net/cs8900/Kconfig 檔案中加入
config ARM_CS8900
tristate "CS8900 support"
depends on ARM || ARCH_SMDK2410 || MACH_MINI2440
help
Support for CS8900A chipset based Ethernet cards. If you
have
a network (Ethernet) card of this type, say Y and read the
Ethernet-HOWTO, available from
<http://www.tldp.org/docs.html#howto>as well as .
drivers/net/Makefile 中加入
obj-$(CONFIG_ARM_CS8900) += cs8900.o
drivers/net/Kconfig 中加入
source “drivers/net/cs8900/Kconfig”
drivers/net/Makefile 中加入
obj-$(CONFIG_ARM_CS8900) += cs8900/
然後 make menuconfig,選中 CS8900 support,去掉 DM9000 support.
4.make zImage 出現如下問題
drivers/net/cs8900/cs8900.c:399: error: implicit declaration of
function 'netdev_mc_empty'
drivers/net/cs8900/cs8900.c: In function 'cs8900_probe':
drivers/net/cs8900/cs8900.c:489: warning: too many arguments for
format
make[3]: *** [drivers/net/cs8900/cs8900.o] 錯誤 1
make[2]: *** [drivers/net/cs8900] 錯誤 2
make[1]: *** [drivers/net] 錯誤 2
make: *** [drivers] 錯誤 2
出現 implicit declaration of function 後,最有可能是沒有標頭檔案或是根本
沒有定義‘ netdev_mc_empty’,用 source insight 查詢其定義的地方,根本沒
有找到,因此,直接把它遮蔽掉
if ((dev->flags & IFF_ALLMULTI) )//&& !netdev_mc_empty(dev))