2 # Copyright (C) 2011 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
12 PKG_BASE_NAME:=drv_dsl_cpe_api_danube
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
20 FW_NAME:=ltq-dsl-fw-0.1
21 FW_MD5:=4700a36b66b955b4c5544227267356f4
23 include $(INCLUDE_DIR)/package.mk
25 define Download/ltq-dsl-fw
26 FILE:=$(FW_NAME).tar.bz2
28 URL:=http://mirror2.openwrt.org/sources/
30 $(eval $(call Download,ltq-dsl-fw))
32 define KernelPackage/ltq-dsl-template
34 CATEGORY:=Kernel modules
35 SUBMENU:=Network Devices
36 TITLE:=Lantiq dsl driver for $(1)
37 URL:=http://www.lantiq.com/
39 DEPENDS:=@TARGET_lantiq_$(1) +kmod-atm
40 FILES:=$(PKG_BUILD_DIR)/src/mei/lantiq_mei.ko \
41 $(PKG_BUILD_DIR)/src/drv_dsl_cpe_api.ko \
42 $(PKG_BUILD_DIR)/src/mei/lantiq_atm.ko
43 AUTOLOAD:=$(call AutoLoad,50,lantiq_mei drv_dsl_cpe_api lantiq_atm)
44 MAINTAINER:=John Crispin <blogic@openwrt.org>
47 KernelPackage/ltq-dsl-danube=$(call KernelPackage/ltq-dsl-template,danube)
48 KernelPackage/ltq-dsl-ase=$(call KernelPackage/ltq-dsl-template,ase)
49 KernelPackage/ltq-dsl-ar9=$(call KernelPackage/ltq-dsl-template,ar9)
50 KernelPackage/ltq-dsl-vr9=$(call KernelPackage/ltq-dsl-template,vr9)
52 define Package/kmod-ltq-dsl-firmware-template
53 TITLE+=Firmware Annex-$(1) $(2)
55 CATEGORY:=Kernel modules
56 SUBMENU:=Network Devices
58 URL:=http://www.lantiq.com/
59 DEPENDS:=@TARGET_lantiq_$(2) kmod-ltq-dsl-$(2)
60 MAINTAINER:=John Crispin <blogic@openwrt.org>
63 Package/kmod-ltq-dsl-firmware-a-danube=$(call Package/kmod-ltq-dsl-firmware-template,a,danube)
64 Package/kmod-ltq-dsl-firmware-b-danube=$(call Package/kmod-ltq-dsl-firmware-template,b,danube)
65 Package/kmod-ltq-dsl-firmware-a-ase=$(call Package/kmod-ltq-dsl-firmware-template,a,ase)
66 Package/kmod-ltq-dsl-firmware-b-ase=$(call Package/kmod-ltq-dsl-firmware-template,b,ase)
67 Package/kmod-ltq-dsl-firmware-a-ar9=$(call Package/kmod-ltq-dsl-firmware-template,a,ar9)
68 Package/kmod-ltq-dsl-firmware-b-ar9=$(call Package/kmod-ltq-dsl-firmware-template,b,ar9)
69 Package/kmod-ltq-dsl-firmware-a-vr9=$(call Package/kmod-ltq-dsl-firmware-template,a,vr9)
70 Package/kmod-ltq-dsl-firmware-b-vr9=$(call Package/kmod-ltq-dsl-firmware-template,b,vr9)
72 define KernelPackage/ltq-dsl/description
73 Lantiq DSL driver for AR9, Amazon SE, Danube and VR9
76 define KernelPackage/ltq-dsl/config
77 source "$(SOURCE)/Config.in"
81 IFX_DSL_LINES_PER_DEVICE=1
82 IFX_DSL_CHANNELS_PER_LINE=1
84 CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \
85 --with-max-device="$(IFX_DSL_MAX_DEVICE)" \
86 --with-lines-per-device="$(IFX_DSL_LINES_PER_DEVICE)" \
87 --with-channels-per-line="$(IFX_DSL_CHANNELS_PER_LINE)" \
88 --disable-dsl-delt-static \
92 --enable-dsl-pm-total \
93 --enable-dsl-pm-history \
94 --enable-dsl-pm-showtime \
95 --enable-dsl-pm-channel-counters \
96 --enable-dsl-pm-datapath-counters \
97 --enable-dsl-pm-line-counters \
98 --enable-dsl-pm-channel-thresholds \
99 --enable-dsl-pm-datapath-thresholds \
100 --enable-dsl-pm-line-thresholds \
101 --enable-dsl-pm-optional-parameters \
103 --enable-kernelbuild="$(LINUX_DIR)" \
106 CONFIG_TAG_danube:=DANUBE
107 CONFIG_TAG_ase:=AMAZON_SE
110 CONFIGURE_ARGS += --enable-add-drv-cflags="-DMODULE -DCONFIG_$(CONFIG_TAG_$(BUILD_VARIANT))"
112 ifeq ($(BUILD_VARIANT),vr9)
113 CONFIGURE_ARGS += --enable-vinax
115 CONFIGURE_ARGS += --enable-danube
118 ifeq ($(CONFIG_LANTIQ_DSL_DEBUG),y)
121 --enable-debug-prints=yes
122 EXTRA_CFLAGS += -DDEBUG
125 EXTRA_CFLAGS = -fno-pic -mno-abicalls -mlong-calls -G 0
129 $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/mei/
130 $(CP) ./src/* $(PKG_BUILD_DIR)/src/mei/
132 $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(FW_NAME).tar.bz2
135 define Build/Configure
136 (cd $(PKG_BUILD_DIR); aclocal && autoconf && automake)
137 $(call Build/Configure/Default)
142 ARCH=mips CROSS_COMPILE="$(KERNEL_CROSS)" \
143 $(MAKE) BUILD_VARIANT=$(BUILD_VARIANT) M=$(PKG_BUILD_DIR)/src/mei/ V=1 modules
144 $(call Build/Compile/Default)
147 define Build/InstallDev
148 $(INSTALL_DIR) $(1)/usr/include
149 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api.h $(1)/usr/include
150 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_ioctl.h $(1)/usr/include
151 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_adslmib.h $(1)/usr/include
152 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_adslmib_ioctl.h $(1)/usr/include
153 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_g997.h $(1)/usr/include
154 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_types.h $(1)/usr/include
155 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_pm.h $(1)/usr/include
156 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_api_error.h $(1)/usr/include
157 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_danube_ctx.h $(1)/usr/include
158 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_cmv_danube.h $(1)/usr/include
161 define Package/kmod-ltq-dsl-firmware-$(BUILD_VARIANT)/install
162 $(INSTALL_DIR) $(1)/lib/firmware/
163 $(CP) $(PKG_BUILD_DIR)/$(FW_NAME)/ltq-dsl-fw-$(BUILD_VARIANT).bin $(1)/lib/firmware/dsl-fw-$(word 1, $(subst -, ,$(BUILD_VARIANT))).bin
164 ln -s /lib/firmware/dsl-fw-$(word 1, $(subst -, ,$(BUILD_VARIANT))).bin $(1)/lib/firmware/ModemHWE.bin
167 $(eval $(call BuildPackage,kmod-ltq-dsl-firmware-a-danube))
168 $(eval $(call BuildPackage,kmod-ltq-dsl-firmware-b-danube))
169 $(eval $(call BuildPackage,kmod-ltq-dsl-firmware-a-ase))
170 $(eval $(call BuildPackage,kmod-ltq-dsl-firmware-b-ase))
171 $(eval $(call BuildPackage,kmod-ltq-dsl-firmware-a-ar9))
172 $(eval $(call BuildPackage,kmod-ltq-dsl-firmware-b-ar9))
173 #$(eval $(call BuildPackage,kmod-ltq-dsl-firmware-a-vr9))
174 #$(eval $(call BuildPackage,kmod-ltq-dsl-firmware-b-vr9))
175 $(eval $(call KernelPackage,ltq-dsl-danube))
176 $(eval $(call KernelPackage,ltq-dsl-ase))
177 $(eval $(call KernelPackage,ltq-dsl-ar9))
178 #$(eval $(call KernelPackage,ltq-dsl-vr9))