我尝试从文件2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO.bz2构建2.5.0.3驱动程序到RT5370芯片组。
在Ubuntu 10.04.4 x32下安装STLinux 2.4,在内核linux-sh4-2.5.32.59_stm24_0211下生成。但我在路径而不是STLinux-2.4中写了/opt/STM/STLinux-2.2/devkit/sources/kernel/linux-sh4-2.5.32.59_stm24_0211,因为Makefile有一些缺陷:
install:
ifeq ($(TARGET), LINUX)
ifneq (,$(findstring 2.4,$(LINUX_SRC)))
$(MAKE) -C $(RT28xx_DIR)/os/linux -f Makefile.4 install
else
$(MAKE) -C $(RT28xx_DIR)/os/linux -f Makefile.6 install
endif
endif
在路径2.4中提到将内核构建为2.4,在我的情况下是一个错误。
在Makefile中写道:
PLATFORM = ST
...
LINUX_SRC = /opt/STM/STLinux-2.2/devkit/sources/kernel/linux-sh4-2.5.32.59_stm24_0211
CROSS_COMPILE = /opt/STM/STLinux-2.2/devkit/sh4/bin/sh4-linux-
在./os/linux/config.mk中写道:
HAS_WPA_SUPPLICANT=y
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
CC := sh4-linux-gcc
LD := sh4-linux-ld
使用run make命令构建。但是有错误:
script/Makefile.build:49: *** CFLAGS was changed in "/home/vitaliy/drv_src/os/linux/Makefile". Fix it to use EXTRA_CFLAGS.
在./os/linux/config.mk创建字符串:
ifeq ($(PLATFORM),ST)
CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -Wall -O2 -Wundef -Wstrict-prototypes -Wno-trigraphs -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-aliasing -fno-common -fomit-frame-pointer -ffreestanding -m4-nofpu -o $(WFLAGS)
export CFLAGS
endif
将CFLAGS更改为EXTRA_CFLAGS。
再次出错:
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible.
确定。删除标志-fomit-frame-pointer。
再次出错:
error: cpu/cache.h: No such file or directory.
在字符串中:
WFLAGS := -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT -DLINUX -Wall -Wstrict-prototypes -Wno-trigraphs
删除标志-DLINUX。
再次出现未知类型的错误(例如:./ ox / linux /../../common / crypt_md5.c:638:1:错误:未知类型名称'VOID'等等类型'UCHAR' ,'ULONG'等)。
借助
构建的第二种方式KBUILD_NOPEDANTIC = 1不更改驱动程序的源文件。
在这种情况下也是错误的:
./os/linux/../../common/crypt_md5.c:28:23: fatal error: rt_config.h: No such file or directory.
我的建筑有什么问题?或者我可以修复源代码并为SH4平台构建驱动程序。
谢谢!
答案 0 :(得分:4)
我最近得到了同样的适配器,我试图为ARM进行交叉编译,并遇到同样的问题。
基本上,您只需要从驱动程序包的根目录添加include文件夹。
我做了这些修改以使其正常工作:
{p}在DRIVER_DIR/Makefile
中添加:
PLATFORM = MYPLATFORM
所有其他平台都已注释掉。
稍后在同一档案中:
ifeq ($(PLATFORM),MYPLATFORM)
LINUX_SRC = /DIR_TO_MY_KERNEL_SRC/freescale_mainline/linux-mainline
CROSS_COMPILE = /DIR_TO_MY_CROSS_COMPILER/arm-unknown-linux-uclibcgnueabi-
CROSS_COMPILE_INCLUDE = /DRIVER_DIR/include /*Might not be necessary*/
endif
然后在DRIVER_DIR/os/linux/config.mk
中添加:
ifeq ($(PLATFORM),MYPLATFORM)
EXTRA_CFLAGS := $(WFLAGS) -I$(RT28xx_DIR)/include
endif
另外,请注意,在内核配置中,您需要启用几个标志:
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_WEXT_SPY=y
CONFIG_WEXT_PRIV=y
您可以在Device Drivers-->Network Device Support-->Wireless LAN-->IEEE 802.11 for Host AP
我现在就像这样编译它:
DRIVER_DIR$ ARCH=arm make
希望它有所帮助!