[ifxmips] adds dsl support, thank you infineon/lantiq
[openwrt.git] / package / ifxmips-dsl-api / Makefile
1 #
2 # Copyright (C) 2009 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 FW_BASE_NAME:=dsl_danube_firmware_adsl
21 FW_A_VER:=02.04.04.00.00.01
22 FW_B_VER:=02.04.01.07.00.02
23 FW_A_FILE_VER:=244001
24 FW_B_FILE_VER:=241702
25 FW_A_MD5:=f717db3067a0049a26e233ab11238710
26 FW_B_MD5:=349de7cd20368f4ac9b7e8322114a512
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define KernelPackage/ifxmips-dsl-api
31 SECTION:=driver
32 CATEGORY:=Infineon
33 TITLE:=DSL CPE API driver
34 URL:=http://www.infineon.com/
35 MAINTAINER:=Infineon Technologies AG / Lantiq / blogic@openwrt.org
36 DEPENDS:=@TARGET_ifxmips
37 FILES:=$(PKG_BUILD_DIR)/src/mei/ifxmips_mei.$(LINUX_KMOD_SUFFIX) \
38 $(PKG_BUILD_DIR)/src/drv_dsl_cpe_api.$(LINUX_KMOD_SUFFIX) \
39 $(PKG_BUILD_DIR)/src/mei/ifxmips_atm.$(LINUX_KMOD_SUFFIX)
40 AUTOLOAD:=$(call AutoLoad,50,ifxmips_mei drv_dsl_cpe_api ifxmips_atm)
41 endef
42
43 define KernelPackage/ifxmips-dsl-api/description
44 Infineon DSL CPE API for Amazon SE, Danube and Vinax.
45
46 This package contains the DSL CPE API driver for Amazon SE & Danube.
47
48 Supported Devices:
49 - Amazon SE
50 - Danube
51
52 This package was kindly contributed to openwrt by Infineon/Lantiq
53 endef
54
55 define KernelPackage/ifxmips-dsl-api/config
56 source "$(SOURCE)/Config.in"
57 endef
58
59 define Download/annex-a
60 FILE:=$(FW_BASE_NAME)_a-$(FW_A_VER).tar.gz
61 URL:=http://mirror2.openwrt.org/sources/
62 MD5SUM:=$(FW_A_MD5)
63 endef
64 $(eval $(call Download,annex-a))
65
66 define Download/annex-b
67 FILE:=$(FW_BASE_NAME)_b-$(FW_B_VER).tar.gz
68 URL:=http://mirror2.openwrt.org/sources/
69 MD5SUM:=$(FW_B_MD5)
70 endef
71 $(eval $(call Download,annex-b))
72
73 IFX_DSL_MAX_DEVICE=1
74 IFX_DSL_LINES_PER_DEVICE=1
75 IFX_DSL_CHANNELS_PER_LINE=1
76
77 CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \
78 --with-max-device="$(IFX_DSL_MAX_DEVICE)" \
79 --with-lines-per-device="$(IFX_DSL_LINES_PER_DEVICE)" \
80 --with-channels-per-line="$(IFX_DSL_CHANNELS_PER_LINE)" \
81 --enable-danube \
82 --enable-add-drv-cflags="-DMODULE" \
83 --enable-debug=yes \
84 --enable-debug-prints=yes \
85 --disable-dsl-delt-static \
86 --disable-adsl-led \
87 --enable-dsl-ceoc \
88 --enable-dsl-pm \
89 --enable-dsl-pm-total \
90 --enable-dsl-pm-history \
91 --enable-dsl-pm-showtime \
92 --enable-dsl-pm-channel-counters \
93 --enable-dsl-pm-datapath-counters \
94 --enable-dsl-pm-line-counters \
95 --enable-dsl-pm-channel-thresholds \
96 --enable-dsl-pm-datapath-thresholds \
97 --enable-dsl-pm-line-thresholds \
98 --enable-dsl-pm-optional-parameters \
99 --enable-linux-26 \
100 --enable-kernelbuild="$(LINUX_DIR)" \
101 ARCH=$(LINUX_KARCH)
102
103 EXTRA_CFLAGS = -fno-pic -mno-abicalls -mlong-calls -G 0
104
105 define Build/Prepare
106 $(PKG_UNPACK)
107 $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/mei/
108 $(CP) ./src/* $(PKG_BUILD_DIR)/src/mei/
109 $(Build/Patch)
110 $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(FW_BASE_NAME)_a-$(FW_A_VER).tar.gz
111 $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(FW_BASE_NAME)_b-$(FW_B_VER).tar.gz
112 endef
113
114 define Build/Compile
115 cd $(LINUX_DIR); \
116 ARCH=mips CROSS_COMPILE="$(KERNEL_CROSS)" \
117 $(MAKE) M=$(PKG_BUILD_DIR)/src/mei/ V=1 modules
118 $(call Build/Compile/Default)
119 endef
120
121 define Build/InstallDev
122 $(INSTALL_DIR) $(1)/usr/include
123 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api.h $(1)/usr/include
124 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_ioctl.h $(1)/usr/include
125 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_adslmib.h $(1)/usr/include
126 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_adslmib_ioctl.h $(1)/usr/include
127 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_g997.h $(1)/usr/include
128 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_types.h $(1)/usr/include
129 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_pm.h $(1)/usr/include
130 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_error.h $(1)/usr/include
131 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_danube_ctx.h $(1)/usr/include
132 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_cmv_danube.h $(1)/usr/include
133 endef
134
135 define KernelPackage/ifxmips-dsl-api/install
136 $(INSTALL_DIR) $(1)/lib/firmware/
137 $(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
138 endef
139
140 $(eval $(call KernelPackage,ifxmips-dsl-api))
This page took 0.052039 seconds and 5 git commands to generate.