--- zzzz-none-000/linux-2.6.28.10/Makefile 2009-05-02 18:54:43.000000000 +0000 +++ fusiv-7390-686/linux-2.6.28.10/Makefile 2016-05-11 07:31:24.000000000 +0000 @@ -14,7 +14,8 @@ # o use make's built-in rules and variables # (this increases performance and avoids hard-to-debug behaviour); # o print "Entering directory ..."; -MAKEFLAGS += -rR --no-print-directory +# MAKEFLAGS += -rR --no-print-directory +MAKEFLAGS := -rR --no-print-directory # We are using a recursive build, so we need to do a little thinking # to get the ordering right. @@ -149,6 +150,28 @@ srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) TOPDIR := $(srctree) + +ifeq ($(KERNEL_LAYOUT),iks) +BUILD_FUSIV = yes +endif + +ifeq ($(KERNEL_LAYOUT),iks34) +BUILD_FUSIV = yes +FUSIV_BONDING = yes +endif + +HPATH = $(TOPDIR)/include + +ifeq ($(BUILD_FUSIV),yes) +FUSIV_TOPDIR := fusiv_src +FUSIV_APCODEPATH = $(TOPDIR)/fusiv_src/kernel/ap_code +FUSIV_APINCPATH = $(TOPDIR)/fusiv_src/kernel/ap_code/inc +FUSIV_DRIVERS_INCPATH = $(TOPDIR)/fusiv_src/kernel/drivers/inc +FUSIV_ATM_INCPATH = $(TOPDIR)/fusiv_src/kernel/drivers/adsl +FUSIV_SWITCH_INCPATH = $(TOPDIR)/fusiv_src/kernel/drivers/switch +FUSIV_PWRMGMT_INCPATH = $(TOPDIR)/fusiv_src/kernel/drivers/powermgmt +endif + # FIXME - TOPDIR is obsolete, use srctree/objtree objtree := $(CURDIR) src := $(srctree) @@ -193,6 +216,9 @@ ARCH ?= $(SUBARCH) CROSS_COMPILE ?= +-include $(obj)/.kernelvariables +$(warning use: CROSS_COMPILE=$(CROSS_COMPILE)) + # Architecture as present in compile.h UTS_MACHINE := $(ARCH) SRCARCH := $(ARCH) @@ -322,25 +348,49 @@ CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(CF) MODFLAGS = -DMODULE +ifeq ($(FUSIV_BONDING),yes) +MODFLAGS += -DVX185_BONDING +endif + CFLAGS_MODULE = $(MODFLAGS) AFLAGS_MODULE = $(MODFLAGS) LDFLAGS_MODULE = -CFLAGS_KERNEL = +CFLAGS_KERNEL = # -save-temps # -v -Wl,--verbose AFLAGS_KERNEL = +# Get GCC Version (using call to Preprocessor) +KERNEL_GCC_VERSION := $(shell echo $$((`/bin/echo -e "(__GNUC__ * 10000) + (__GNUC_MINOR__ * 100) + __GNUC_PATCHLEVEL__" | $(CROSS_COMPILE)gcc -E -P -`))) +# Test for GCC >= 4.6.0 +KBUILD_CFLAGS_GCC40600_ALLOWED := $(shell [ "$(KERNEL_GCC_VERSION)" -ge "40600" ] && echo 1) +ifeq ($(KBUILD_CFLAGS_GCC40600_ALLOWED),1) +# Additional Flags for GCC >= 4.6.0 +KBUILD_CFLAGS_GCC40600 += -Wno-error=unused-but-set-variable +endif # Use LINUXINCLUDE when you must reference the include/ directory. # Needed to be compatible with the O= option LINUXINCLUDE := -Iinclude \ $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ -I$(srctree)/arch/$(hdr-arch)/include \ - -include include/linux/autoconf.h - -KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) + -include include/linux/autoconf.h \ + -include $(srctree)/include/linux/kconfig.h \ + $(EXTRALINUXINCLUDE) + +ifeq ($(BUILD_FUSIV),yes) +KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) -DNEW_CONFIG -I$(HPATH) -I$(FUSIV_APCODEPATH) -I$(FUSIV_APINCPATH) -I$(FUSIV_DRIVERS_INCPATH) -I$(FUSIV_ATM_INCPATH) -I$(FUSIV_SWITCH_INCPATH) -I$(FUSIV_PWRMGMT_INCPATH) +else +KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) -DNEW_CONFIG -I$(HPATH) +endif KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ - -fno-strict-aliasing -fno-common \ - -Werror-implicit-function-declaration + -fno-strict-aliasing -fno-common \ + -Werror-implicit-function-declaration \ + $(KBUILD_CFLAGS_GCC40600) + +ifeq ($(FUSIV_BONDING),yes) +KBUILD_CFLAGS += -DVX185_BONDING +endif + KBUILD_AFLAGS := -D__ASSEMBLY__ # Read KERNELRELEASE from include/config/kernel.release (if it exists) @@ -462,6 +512,9 @@ net-y := net/ libs-y := lib/ core-y := usr/ +ifeq ($(BUILD_FUSIV),yes) +fusiv_src-y := fusiv_src/ +endif endif # KBUILD_EXTMOD ifeq ($(dot-config),1) @@ -599,9 +652,11 @@ # relocations required by build roots. This is not defined in the # makefile but the argument can be passed to make if needed. # - +#BUILDROOT_SRCDIR := ../buildroot-2009.01 +#INSTALL_MOD_PATH := $(BUILDROOT_SRCDIR)/project_build_mips/uclibc/root/ +UTIL_PATH := $(INSTALL_MOD_PATH)/sbin MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) -export MODLIB +export MODLIB UTIL_PATH # # INSTALL_MOD_STRIP, if defined, will cause modules to be @@ -626,17 +681,20 @@ vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ - $(net-y) $(net-m) $(libs-y) $(libs-m))) + $(net-y) $(fusiv_src-y) $(net-m) $(libs-y) $(libs-m))) vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \ $(init-n) $(init-) \ $(core-n) $(core-) $(drivers-n) $(drivers-) \ - $(net-n) $(net-) $(libs-n) $(libs-)))) + $(net-n) $(net-) $(fusiv_src-y) $(libs-n) $(libs-)))) init-y := $(patsubst %/, %/built-in.o, $(init-y)) core-y := $(patsubst %/, %/built-in.o, $(core-y)) drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y)) net-y := $(patsubst %/, %/built-in.o, $(net-y)) +ifeq ($(BUILD_FUSIV),yes) +fusiv_src-y := $(patsubst %/, %/built-in.o, $(fusiv_src-y)) +endif libs-y1 := $(patsubst %/, %/lib.a, $(libs-y)) libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y)) libs-y := $(libs-y1) $(libs-y2) @@ -669,7 +727,7 @@ # System.map is generated to document addresses of all kernel symbols vmlinux-init := $(head-y) $(init-y) -vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y) +vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y) $(fusiv_src-y) vmlinux-all := $(vmlinux-init) $(vmlinux-main) vmlinux-lds := arch/$(SRCARCH)/kernel/vmlinux.lds export KBUILD_VMLINUX_OBJS := $(vmlinux-all) @@ -1025,6 +1083,154 @@ include/linux/utsrelease.h: include/config/kernel.release FORCE $(call filechk,utsrelease.h) +#Atheros 11g WLAN driver Install +atheros_wlan_install: + if [ -f ../fusiv_src/vendors/atheros_11n/wlan.ko ]; then \ + mkdir -p $(MODLIB)/atheros_11n; \ + cp -rfp ../fusiv_src/vendors/atheros_11n/*.ko $(MODLIB)/atheros_11n/; \ + chmod 644 $(MODLIB)/atheros_11n/*.ko; \ + cp -fp ../fusiv_src/vendors/atheros_11n/hostapd $(UTIL_PATH)/.; \ + cp -fp ../fusiv_src/vendors/atheros_11n/wlanconfig $(UTIL_PATH)/.; \ + fi + +#Atheros 11n WLAN driver Install +atheros_11n_wlan_install: + if [ -f ../fusiv_src/vendors/atheros_11n/lib/wlan.ko ]; then \ + rm -rf $(MODLIB)/atheros/* ; \ + rm -rf ../fusiv_src/vendors/atheros/* ; \ + mkdir -p $(MODLIB)/atheros_11n; \ + cp -rfp ../fusiv_src/vendors/atheros_11n/lib/*.ko $(MODLIB)/atheros_11n/; \ + chmod 644 $(MODLIB)/atheros_11n/*.ko; \ + cp -fp ../fusiv_src/vendors/atheros_11n/sbin/* $(UTIL_PATH)/.; \ + cp -rfp ../fusiv_src/vendors/atheros_11n/etc/* $(INSTALL_MOD_PATH)/etc/.; \ + fi + +#Atheros AQU WLAN driver Install +atheros_aqu_wlan_install: + if [ -f ../fusiv_src/vendors/atheros_aqu/lib/modules/$(KERNELRELEASE)/net/ath_hal.ko ]; then \ + rm -rf $(MODLIB)/atheros/* ; \ + rm -rf ../fusiv_src/vendors/atheros/* ; \ + rm -rf $(MODLIB)/atheros_11n/* ; \ + rm -rf ../fusiv_src/vendors/atheros_11n/* ; \ + cp -fp ../fusiv_src/vendors/atheros_aqu/lib/* $(INSTALL_MOD_PATH)/lib/; \ + mkdir -p $(MODLIB)/net; \ + cp -fp ../fusiv_src/vendors/atheros_aqu/lib/modules/$(KERNELRELEASE)/net/*.ko $(MODLIB)/net/; \ + chmod 644 $(MODLIB)/net/*.ko; \ + cp -fp ../fusiv_src/vendors/atheros_aqu/sbin/* $(UTIL_PATH)/.; \ + cp -rfp ../fusiv_src/vendors/atheros_aqu/etc/* $(INSTALL_MOD_PATH)/etc/.; \ + fi + +tr69: + if [ -f ../fusiv_src/vendors/TR69/cwmpc ]; then \ + cp -pf ../fusiv_src/vendors/TR69/cwmpc $(INSTALL_MOD_PATH)/bin/; \ + cp -pf ../fusiv_src/vendors/TR69/cpestate.xml $(INSTALL_MOD_PATH);\ + fi + +#Ralink 11g WLAN driver Install +RT_11g_wlan_install: + if [ -f ../fusiv_src/vendors/Ralink/ra11g/rt61ap.ko ]; then \ + mkdir -p $(MODLIB)/ra11g; \ + cp ../fusiv_src/vendors/Ralink/ra11g/*.ko $(MODLIB)/ra11g/; \ + chmod 644 $(MODLIB)/ra11g/*.ko; \ + mkdir -p $(INSTALL_MOD_PATH)/etc/Wireless/RT61AP; \ + cp -f ../fusiv_src/vendors/Ralink/ra11g/RT61AP.dat $(INSTALL_MOD_PATH)/etc/Wireless/RT61AP; \ + cp -f ../fusiv_src/vendors/Ralink/ra11g/RT2561.bin $(INSTALL_MOD_PATH)/etc/Wireless/RT61AP; \ + cp -f ../fusiv_src/vendors/Ralink/ra11g/RT2561S.bin $(INSTALL_MOD_PATH)/etc/Wireless/RT61AP; \ + fi +#Ralink 11n WLAN driver Install +RT_11n_wlan_install: + if [ -f ../fusiv_src/vendors/Ralink/ra11n/rt3562ap.ko ]; then \ + mkdir -p $(MODLIB)/ra11n; \ + cp ../fusiv_src/vendors/Ralink/ra11n/*.ko $(MODLIB)/ra11n/; \ + chmod 644 $(MODLIB)/ra11n/*.ko; \ + mkdir -p $(INSTALL_MOD_PATH)/etc/Wireless/RT2860AP; \ + cp -f ../fusiv_src/vendors/Ralink/ra11n/RT2860AP.dat $(INSTALL_MOD_PATH)/etc/Wireless/RT2860AP; \ + cp -f ../fusiv_src/vendors/Ralink/ra11n/RT2860APCard.dat $(INSTALL_MOD_PATH)/etc/Wireless/RT2860AP; \ + cp -f ../fusiv_src/vendors/Ralink/ra11n/rt2860apd $(INSTALL_MOD_PATH)/bin/; \ + mkdir -p $(INSTALL_MOD_PATH)/etc/xml; \ + cp ../fusiv_src/vendors/Ralink/ra11n/*.xml $(INSTALL_MOD_PATH)/etc/xml; \ + cp ../fusiv_src/vendors/Ralink/ra11n/wscd $(INSTALL_MOD_PATH)/bin/; \ + fi + +#IKANOS Vindhya WLAN Install +#vindhya_wlan_install: +# if [ -f ../adiwlan/adiwlan_ap.ko ]; then\ +# mkdir -p $(MODLIB)/adiwlan;\ +# cp ../adiwlan/adiwlan_ap.ko $(MODLIB)/adiwlan;\ +# fi + +#IKANOS DSP Firmware Install +dsp_V2_firmware_install: + if [ -f ../fusiv_src/kernel/drivers/voice/ipvoice/dspvoice.ko ]; then \ + rm -rf $(INSTALL_MOD_PATH)/dsp ; \ + mkdir -p $(INSTALL_MOD_PATH)/dsp; \ + cp ../fusiv_src/kernel/drivers/voice/dspimages/dsp218x_dsp*.dsp $(INSTALL_MOD_PATH)/dsp; \ + cp ../fusiv_src/kernel/drivers/voice/dspimages/dsp218x_dsp*.dsp $(INSTALL_MOD_PATH)/dsp; \ + cp ../fusiv_src/kernel/drivers/voice/ipvoice/dsplib/pcmfiles/4.pcm $(INSTALL_MOD_PATH)/dsp; \ + #cp ../fusiv_src/kernel/drivers/voice/dspimages/dsp218x_6ch_*.dsp $(INSTALL_MOD_PATH)/dsp; \ + #cp ../fusiv_src/kernel/drivers/voice/dspimages/dsp218x_6ch_*.dsp $(INSTALL_MOD_PATH)/dsp; \ + fi + +#IKANOS DSP Firmware Install +dsp_V1_firmware_install: + if [ -f ../fusiv_src/kernel/drivers/voice/ipvoice/dspvoice.ko ]; then \ + rm -rf $(INSTALL_MOD_PATH)/dsp ; \ + mkdir -p $(INSTALL_MOD_PATH)/dsp; \ + cp ../fusiv_src/kernel/drivers/voice/dspimages/dsp218x_1ch_*.dsp $(INSTALL_MOD_PATH)/dsp; \ + cp ../fusiv_src/kernel/drivers/voice/ipvoice/dsplib/pcmfiles/4.pcm $(INSTALL_MOD_PATH)/dsp; \ + fi + +#IKANOS DSP Firmware Install +dsp_V1_FXO_TO_VOIP_firmware_install: + if [ -f ../fusiv_src/kernel/drivers/voice/ipvoice/dspvoice.ko ]; then \ + rm -rf $(INSTALL_MOD_PATH)/dsp ; \ + mkdir -p $(INSTALL_MOD_PATH)/dsp; \ + cp ../fusiv_src/kernel/drivers/voice/dspimages/dsp218x_2ch_*.dsp $(INSTALL_MOD_PATH)/dsp; \ + cp ../fusiv_src/kernel/drivers/voice/ipvoice/dsplib/pcmfiles/4.pcm $(INSTALL_MOD_PATH)/dsp; \ + fi + +#IKANOS SPI Driver Install +spidrv_install: + if [ -f ../fusiv_src/kernel/drivers/spi/spi_driver_lkm.ko ]; then \ + mkdir -p $(MODLIB)/fusiv_src/kernel/drivers/spi; \ + cp ../fusiv_src/kernel/drivers/spi/spi_driver_lkm.ko $(MODLIB)/fusiv_src/kernel/drivers/spi; \ + fi + +#IKANOS APCNTRL Install +apcntrl_install: + if [ -f ../fusiv_src/kernel/drivers/apcntrl/apcntrl_lkm.ko ]; then \ + mkdir -p $(MODLIB)/fusiv_src/kernel/drivers/apcntrl; \ + cp ../fusiv_src/kernel/drivers/apcntrl/apcntrl_lkm.ko $(MODLIB)/fusiv_src/kernel/drivers/apcntrl; \ + fi + +#IKANOS POWERMGMT Install +pwrmgmt_install: + if [ -f ../fusiv_src/kernel/drivers/powermgmt/pwrmgmtdrv_lkm.ko ]; then \ + mkdir -p $(MODLIB)/fusiv_src/kernel/drivers/powermgmt; \ + cp ../fusiv_src/kernel/drivers/powermgmt/pwrmgmtdrv_lkm.ko $(MODLIB)/fusiv_src/kernel/drivers/powermgmt; \ + fi + +#IKANOS IPQOS Install +ipqos_install: + if [ -f ../fusiv_src/kernel/drivers/ipqos/ipqos_lkm.ko ]; then \ + mkdir -p $(MODLIB)/fusiv_src/kernel/drivers/ipqos; \ + cp ../fusiv_src/kernel/drivers/ipqos/ipqos_lkm.ko $(MODLIB)/fusiv_src/kernel/drivers/ipqos; \ + fi + +#IKANOS IGMP_SNOOP Install +igmpsnoop_install: + if [ -f ../fusiv_src/kernel/drivers/igmpsnoop/igmpsnoop_lkm.ko ]; then \ + mkdir -p $(MODLIB)/fusiv_src/kernel/drivers/igmpsnoop; \ + cp ../fusiv_src/kernel/drivers/igmpsnoop/igmpsnoop_lkm.ko $(MODLIB)/fusiv_src/kernel/drivers/igmpsnoop; \ + fi + +#IKANOS GPON Install +gpon_install: + if [ -f ../fusiv_src/kernel/drivers/gpon/gpon_lkm.ko ]; then \ + mkdir -p $(INSTALL_MOD_PATH)/gpon; \ + cp ../fusiv_src/kernel/drivers/gpon/gpon_lkm.ko $(INSTALL_MOD_PATH)/gpon; \ + fi + # --------------------------------------------------------------------------- PHONY += depend dep @@ -1088,7 +1294,67 @@ # By default, build modules as well -all: modules +# By default, build modules as well +ifdef CONFIG_FUSIV_DSP_BASED_VOICE_V2_ARCH +ADDITIONAL_MOD = dsp_V2_firmware_install +endif + +ifdef CONFIG_FUSIV_DSP_BASED_VOICE_V1_ARCH +ifdef CONFIG_FUSIV_DSP_BASED_VOICE_V1_FXO_TO_VOIP + ADDITIONAL_MOD = dsp_V1_FXO_TO_VOIP_firmware_install +else + ADDITIONAL_MOD = dsp_V1_firmware_install +endif +endif + +ifdef CONFIG_FUSIV_KERNEL_WLAN_ATH_11G +ADDITIONAL_MOD += atheros_wlan_install +endif + +ifdef CONFIG_FUSIV_KERNEL_WLAN_ATH_11N +ADDITIONAL_MOD += atheros_11n_wlan_install +endif + +ifdef CONFIG_FUSIV_KERNEL_WLAN_ATH_AQU +ADDITIONAL_MOD += atheros_aqu_wlan_install +endif + +ifdef CONFIG_FUSIV_KERNEL_WLAN_RT_11G +ADDITIONAL_MOD += RT_11g_wlan_install +endif + +ifdef CONFIG_FUSIV_KERNEL_WLAN_RT_11N +ADDITIONAL_MOD += RT_11n_wlan_install +endif + +ifdef CONFIG_FUSIV_KERNEL_HOST_IPQOS + ADDITIONAL_MOD += ipqos_install +endif + +ifdef CONFIG_FUSIV_KERNEL_APCONTROL + ADDITIONAL_MOD += apcntrl_install +endif + +ifdef CONFIG_FUSIV_KERNEL_POWERMGMT + ADDITIONAL_MOD += pwrmgmt_install +endif + +ifdef CONFIG_FUSIV_KERNEL_IGMP_SNOOP + ADDITIONAL_MOD += igmpsnoop_install +endif + +ifdef CONFIG_FUSIV_KERNEL_GPON + ADDITIONAL_MOD += gpon_install +endif + +ifdef CONFIG_FUSIV_KERNEL_TR69 +ADDITIONAL_MOD += tr69 +endif + +ifdef CONFIG_FUSIV_KERNEL_SPI + ADDITIONAL_MOD += spidrv_install +endif +all: modules $(ADDITIONAL_MOD) # Build modules # @@ -1153,6 +1419,10 @@ endif # CONFIG_MODULES +ifdef CONFIG_MACH_FUSIV +all: adiimage +endif + ### # Cleaning is done on three levels. # make clean Delete most generated files @@ -1172,6 +1442,7 @@ include/linux/utsrelease.h \ include/linux/bounds.h include/asm*/asm-offsets.h \ Module.symvers Module.markers tags TAGS cscope* +MRPROPER_FILES += $(patsubst %,% %.old,.kernelvariables .kernelshell .kernelshellrc) # clean - Delete most, but leave enough to build external modules # @@ -1187,11 +1458,19 @@ $(call cmd,rmdirs) $(call cmd,rmfiles) @find . $(RCS_FIND_IGNORE) \ - \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ + \( -name '*.[oas]' -o -name '*.ko' -o -name '*.xko' -o -name '.*.cmd' \ -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ -o -name '*.symtypes' -o -name 'modules.order' \ -o -name 'Module.markers' -o -name '.tmp_*.o.*' \) \ -type f -print | xargs rm -f +ifeq ($(BUILD_FUSIV),yes) + @find . $(FUSIV_TOPDIR) \ + \( -name '*.[oas]' -o -name '*.ko' -o -name '*.xko' -o -name '.*.cmd' \ + -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ + -o -name '*.symtypes' -o -name 'modules.order' \ + -o -name 'Module.markers' -o -name '.tmp_*.o.*' \) \ + -type f -print | xargs rm -f +endif # mrproper - Delete all generated files, including .config # @@ -1391,7 +1670,7 @@ $(call cmd,rmdirs) $(call cmd,rmfiles) @find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \ - \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ + \( -name '*.[oas]' -o -name '*.ko' -o -name '*.xko' -o -name '.*.cmd' \ -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \ -type f -print | xargs rm -f