firmware-utils/mkzynfw: add support for the NBG460N board
[openwrt.git] / package / ifxmips-dsl-api / Makefile
1 #
2 # Copyright (C) 2009-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # ralph / blogic
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=ifxmips-dsl-api
13 PKG_BASE_NAME:=drv_dsl_cpe_api_danube
14 PKG_VERSION:=3.24.4.4
15 PKG_SOURCE:=$(PKG_BASE_NAME)-$(PKG_VERSION).tar.gz
16 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/drv_dsl_cpe_api-$(PKG_VERSION)
17 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
18 PKG_MD5SUM:=c45bc531c1ed2ac80f68fb986b63bb87
19
20 ifeq ($(DUMP),)
21 STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell grep '^CONFIG_IFXMIPS_DSL_' $(TOPDIR)/.config | md5s)
22 endif
23
24 FW_BASE_NAME:=dsl_danube_firmware_adsl
25 FW_A_VER:=02.04.04.00.00.01
26 FW_B_VER:=02.04.01.07.00.02
27 FW_A_FILE_VER:=244001
28 FW_B_FILE_VER:=241702
29 FW_A_MD5:=f717db3067a0049a26e233ab11238710
30 FW_B_MD5:=349de7cd20368f4ac9b7e8322114a512
31
32 PATCH_DIR ?= ./patches$(if $(wildcard ./patches-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
33
34 include $(INCLUDE_DIR)/package.mk
35
36 define KernelPackage/ifxmips-dsl-api
37 SECTION:=sys
38 CATEGORY:=Kernel modules
39 SUBMENU:=Network Devices
40 TITLE:=DSL CPE API driver
41 URL:=http://www.infineon.com/
42 MAINTAINER:=Infineon Technologies AG / Lantiq / John Crispin <blogic@openwrt.org>
43 DEPENDS:=@TARGET_ifxmips @BROKEN
44 FILES:=$(PKG_BUILD_DIR)/src/mei/ifxmips_mei.$(LINUX_KMOD_SUFFIX) \
45 $(PKG_BUILD_DIR)/src/drv_dsl_cpe_api.$(LINUX_KMOD_SUFFIX) \
46 $(PKG_BUILD_DIR)/src/mei/ifxmips_atm.$(LINUX_KMOD_SUFFIX)
47 AUTOLOAD:=$(call AutoLoad,50,ifxmips_mei drv_dsl_cpe_api ifxmips_atm)
48 MENU:=1
49 endef
50
51 define KernelPackage/ifxmips-dsl-api/description
52 Infineon DSL CPE API for Amazon SE, Danube and Vinax.
53
54 This package contains the DSL CPE API driver for Amazon SE & Danube.
55
56 Supported Devices:
57 - Amazon SE
58 - Danube
59
60 This package was kindly contributed to openwrt by Infineon/Lantiq
61 endef
62
63 define KernelPackage/ifxmips-dsl-api/config
64 source "$(SOURCE)/Config.in"
65 endef
66
67 ifeq ($(CONFIG_IFXMIPS_DSL_FIRMWARE),y)
68 FW_FILE:=arcor_A800_452CPW_FW_1.02.206(20081201).bin
69 define Download/firmware
70 URL:=http://www.arcor.de/hilfe/files/pdf/
71 FILE=$(FW_FILE)
72 MD5SUM:=19d9af4e369287a0f0abaed415cdac10
73 endef
74 $(eval $(call Download,firmware))
75
76 else
77
78 define Download/annex-a
79 FILE:=$(FW_BASE_NAME)_a-$(FW_A_VER).tar.gz
80 URL:=http://mirror2.openwrt.org/sources/
81 MD5SUM:=$(FW_A_MD5)
82 endef
83 $(eval $(call Download,annex-a))
84
85 define Download/annex-b
86 FILE:=$(FW_BASE_NAME)_b-$(FW_B_VER).tar.gz
87 URL:=http://mirror2.openwrt.org/sources/
88 MD5SUM:=$(FW_B_MD5)
89 endef
90 $(eval $(call Download,annex-b))
91 endif
92
93 IFX_DSL_MAX_DEVICE=1
94 IFX_DSL_LINES_PER_DEVICE=1
95 IFX_DSL_CHANNELS_PER_LINE=1
96
97 CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \
98 --with-max-device="$(IFX_DSL_MAX_DEVICE)" \
99 --with-lines-per-device="$(IFX_DSL_LINES_PER_DEVICE)" \
100 --with-channels-per-line="$(IFX_DSL_CHANNELS_PER_LINE)" \
101 --enable-danube \
102 --enable-add-drv-cflags="-DMODULE" \
103 --disable-dsl-delt-static \
104 --disable-adsl-led \
105 --enable-dsl-ceoc \
106 --enable-dsl-pm \
107 --enable-dsl-pm-total \
108 --enable-dsl-pm-history \
109 --enable-dsl-pm-showtime \
110 --enable-dsl-pm-channel-counters \
111 --enable-dsl-pm-datapath-counters \
112 --enable-dsl-pm-line-counters \
113 --enable-dsl-pm-channel-thresholds \
114 --enable-dsl-pm-datapath-thresholds \
115 --enable-dsl-pm-line-thresholds \
116 --enable-dsl-pm-optional-parameters \
117 --enable-linux-26 \
118 --enable-kernelbuild="$(LINUX_DIR)" \
119 ARCH=$(LINUX_KARCH)
120
121 EXTRA_CFLAGS = -fno-pic -mno-abicalls -mlong-calls -G 0
122
123 ifeq ($(CONFIG_IFXMIPS_DSL_DEBUG),y)
124 CONFIGURE_ARGS += \
125 --enable-debug=yes \
126 --enable-debug-prints=yes
127 EXTRA_CFLAGS += -DDEBUG
128 endif
129
130 define Build/Prepare
131 $(PKG_UNPACK)
132 $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/mei/
133 $(CP) ./src/* $(PKG_BUILD_DIR)/src/mei/
134 $(Build/Patch)
135 ifeq ($(CONFIG_IFXMIPS_DSL_FIRMWARE),)
136 $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(FW_BASE_NAME)_a-$(FW_A_VER).tar.gz
137 $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(FW_BASE_NAME)_b-$(FW_B_VER).tar.gz
138 endif
139 endef
140
141 define Build/Configure
142 (cd $(PKG_BUILD_DIR); aclocal && autoconf && automake)
143 $(call Build/Configure/Default)
144 endef
145
146 define Build/Compile
147 cd $(LINUX_DIR); \
148 ARCH=mips CROSS_COMPILE="$(KERNEL_CROSS)" \
149 $(MAKE) M=$(PKG_BUILD_DIR)/src/mei/ V=1 modules
150 $(call Build/Compile/Default)
151 endef
152
153 define Build/InstallDev
154 $(INSTALL_DIR) $(1)/usr/include
155 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api.h $(1)/usr/include
156 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_ioctl.h $(1)/usr/include
157 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_adslmib.h $(1)/usr/include
158 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_adslmib_ioctl.h $(1)/usr/include
159 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_g997.h $(1)/usr/include
160 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_types.h $(1)/usr/include
161 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_pm.h $(1)/usr/include
162 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_error.h $(1)/usr/include
163 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_danube_ctx.h $(1)/usr/include
164 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_cmv_danube.h $(1)/usr/include
165 endef
166
167 define KernelPackage/ifxmips-dsl-api/install
168 $(INSTALL_DIR) $(1)/lib/firmware/
169 ifeq ($(CONFIG_IFXMIPS_DSL_FIRMWARE),y)
170 $(PLATFORM_DIR)/extract.sh $(DL_DIR) '$(FW_FILE)'
171 $(CP) $(DL_DIR)/dsl_$(if $(CONFIG_IFXMIPS_ANNEX_A),a,b).bin $(1)/lib/firmware/ModemHWE.bin
172 else
173 $(CP) $(PKG_BUILD_DIR)/$(FW_BASE_NAME)_$(if $(CONFIG_IFXMIPS_ANNEX_A),a_$(FW_A_FILE_VER),b_$(FW_B_FILE_VER)).bin $(1)/lib/firmware/ModemHWE.bin
174 endif
175 endef
176
177 $(eval $(call KernelPackage,ifxmips-dsl-api))
This page took 0.0472359999999999 seconds and 5 git commands to generate.