package/lantiq: make lantiq kernel modules work with xway_legacy
[openwrt/openwrt.git] / package / kernel / lantiq / ltq-adsl / Makefile
1 #
2 # Copyright (C) 2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=ltq-adsl
12 PKG_VERSION:=3.24.4.4
13 PKG_RELEASE:=1
14 PKG_SOURCE:=drv_dsl_cpe_api_danube-$(PKG_VERSION).tar.gz
15 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-dsl-$(BUILD_VARIANT)/drv_dsl_cpe_api-$(PKG_VERSION)
16 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
17 PKG_MD5SUM:=c45bc531c1ed2ac80f68fb986b63bb87
18 PKG_MAINTAINER:=John Crispin <john@phrozen.org>
19
20 PKG_USE_MIPS16:=0
21 PKG_CHECK_FORMAT_SECURITY:=0
22 PKG_FIXUP:=autoreconf
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define KernelPackage/ltq-adsl-template
27 SECTION:=sys
28 CATEGORY:=Kernel modules
29 SUBMENU:=Network Devices
30 TITLE:=adsl driver for $(1)
31 URL:=http://www.lantiq.com/
32 VARIANT:=$(1)
33 DEPENDS:=@$(2) +kmod-ltq-adsl-$(1)-mei
34 FILES:=$(PKG_BUILD_DIR)/src/drv_dsl_cpe_api.ko
35 AUTOLOAD:=$(call AutoLoad,51,drv_dsl_cpe_api)
36 endef
37
38 KernelPackage/ltq-adsl-danube=$(call KernelPackage/ltq-adsl-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy))
39 KernelPackage/ltq-adsl-ar9=$(call KernelPackage/ltq-adsl-template,ar9,TARGET_lantiq_xway)
40 KernelPackage/ltq-adsl-ase=$(call KernelPackage/ltq-adsl-template,ase,TARGET_lantiq_ase)
41
42 define KernelPackage/ltq-dsl/config
43 source "$(SOURCE)/Config.in"
44 endef
45
46 IFX_DSL_MAX_DEVICE=1
47 IFX_DSL_LINES_PER_DEVICE=1
48 IFX_DSL_CHANNELS_PER_LINE=1
49
50 CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \
51 --with-max-device="$(IFX_DSL_MAX_DEVICE)" \
52 --with-lines-per-device="$(IFX_DSL_LINES_PER_DEVICE)" \
53 --with-channels-per-line="$(IFX_DSL_CHANNELS_PER_LINE)" \
54 --disable-dsl-delt-static \
55 --disable-adsl-led \
56 --enable-dsl-ceoc \
57 --enable-dsl-pm \
58 --enable-dsl-pm-total \
59 --enable-dsl-pm-history \
60 --enable-dsl-pm-showtime \
61 --enable-dsl-pm-channel-counters \
62 --enable-dsl-pm-datapath-counters \
63 --enable-dsl-pm-line-counters \
64 --enable-dsl-pm-channel-thresholds \
65 --enable-dsl-pm-datapath-thresholds \
66 --enable-dsl-pm-line-thresholds \
67 --enable-dsl-pm-optional-parameters \
68 --enable-linux-26 \
69 --enable-kernelbuild="$(LINUX_DIR)" \
70 ARCH=$(LINUX_KARCH)
71
72 CONFIG_TAG_danube:=DANUBE
73 CONFIG_TAG_ase:=AMAZON_SE
74 CONFIG_TAG_ar9:=AR9
75 CONFIGURE_ARGS += --enable-add-drv-cflags="-DMODULE -DCONFIG_$(CONFIG_TAG_$(BUILD_VARIANT))"
76
77 CONFIGURE_ARGS += --enable-danube
78
79 ifeq ($(CONFIG_LANTIQ_DSL_DEBUG),y)
80 CONFIGURE_ARGS += \
81 --enable-debug=yes \
82 --enable-debug-prints=yes
83 EXTRA_CFLAGS += -DDEBUG
84 endif
85
86 EXTRA_CFLAGS = -fno-pic -mno-abicalls -mlong-calls -G 0
87
88 define Build/InstallDev
89 $(INSTALL_DIR) $(1)/usr/include/adsl
90 $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_*.h $(1)/usr/include/adsl/
91 endef
92
93 $(eval $(call KernelPackage,ltq-adsl-danube))
94 $(eval $(call KernelPackage,ltq-adsl-ase))
95 $(eval $(call KernelPackage,ltq-adsl-ar9))