cosmetic: remove trailing whitespaces
[openwrt.git] / package / kernel / lantiq / ltq-vmmc / 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:=drv_vmmc
12 PKG_VERSION:=1.9.0
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_MD5SUM:=d8eee8cba0edb28974cc1f8532e3bd18
17 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
18 PKG_MAINTAINER:=John Crispin <blogic@openwrt.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-vmmc
27   SUBMENU:=Voice over IP
28   TITLE:=TAPI LL driver for Voice Macro
29   URL:=http://www.lantiq.com/
30   DEPENDS:=@(TARGET_lantiq_falcon||TARGET_lantiq_xway) +kmod-ltq-tapi
31   FILES:=$(PKG_BUILD_DIR)/src/drv_vmmc.ko
32   AUTOLOAD:=$(call AutoProbe,drv_vmmc)
33 endef
34
35 define KernelPackage/ltq-vmmc/description
36         Voice Subsystem Low Level Driver for Danube, AR9, VR9 device families
37 endef
38
39 define KernelPackage/ltq-vmmc/config
40         source "$(SOURCE)/Config.in"
41 endef
42
43 CONFIGURE_ARGS += \
44         ARCH=$(LINUX_KARCH) \
45         --enable-linux-26 \
46         --enable-kernelbuild="$(LINUX_DIR)" \
47         --enable-kernelincl="$(LINUX_DIR)/include" \
48         --enable-tapiincl="$(STAGING_DIR)/usr/include/drv_tapi" \
49         --with-ifxos-incl=$(STAGING_DIR)/usr/include/ifxos \
50         $(call autoconf_bool,CONFIG_VOICE_CPE_VMMC_EVENT_LOGGER,el-debug) \
51         $(call autoconf_bool,CONFIG_VOICE_CPE_VMMC_PMC,pmc) \
52         $(call autoconf_bool,CONFIG_VOICE_CPE_VMMC_DISABLE_DECT_NIBBLE_SWAP,dect-nibble-swap) \
53         $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_FAX,fax t38) \
54         $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_CID,cid) \
55         $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_DECT,dect) \
56         $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_KPI,kpi) \
57         $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_LT_GR909,lt calibration) \
58         $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_HDLC,hdlc) \
59         $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_TRACES,trace)
60
61 ifneq ($(CONFIG_VOICE_CPE_VMMC_MPS_HISTORY_SIZE),128)
62   CONFIGURE_ARGS += --enable-history-buf=$(CONFIG_VOICE_CPE_VMMC_MPS_HISTORY_SIZE)
63 endif
64
65 #defaults
66 FW_URL:=http://downloads.openwrt.org/sources/
67 FW_TARGET:=ifx_firmware.bin
68 FW_FILE:=fw_voip_ifx.tar.gz
69 COEF_TARGET:=ifx_bbd_fxs.bin
70 COEF_FILE:=coef_voip_ifx.tar.gz
71
72 FW_DIR:=lib/firmware
73
74 FW_TARGET_GENERIC:=$(FW_TARGET)
75 COEF_TARGET_GENERIC:=$(COEF_TARGET)
76
77 ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_DANUBE)$(CONFIG_LTQ_VOICE_CPE_VMMC_WITH_DEVICE_DANUBE),y)
78   CONFIGURE_ARGS += --with-device=DANUBE
79   FW_SOURCE:=voip_R12.1.0.1.0-enc.bin
80   FW_TARGET:=danube_firmware.bin
81   FW_FILE=fw_voip_danube-12.1.0.1.0.tar.gz
82   FW_MD5SUM:=51868b88dee9dbc65d3dbba355ded91c
83   FW_DOWNLOAD:=1
84   COEF_SRC:=danube_bbd_fxs.bin
85   COEF_TARGET:=danube_bbd_fxs.bin
86   COEF_FILE:=coef_voip_danube-0.9.0.tar.gz
87   COEF_MD5SUM:=c8ac6592b304b03829a8123560e15710
88   COEF_DOWNLOAD:=1
89 endif
90
91 ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_AR9),y)
92   CONFIGURE_ARGS += --with-device=AR9
93   # TODO: add fw/coef
94 endif
95
96 COEF_SRC:=$(COEF_TARGET)
97
98 ifeq ($(CONFIG_VOICE_VMMC_WITH_DEVICE_FALCON),y)
99   CONFIGURE_ARGS += --with-device=FALCON
100   FW_SOURCE:=voip_R1.1.0.6.0-enc.bin
101   FW_MD5SUM:=cd4366a52a8010b76793e3810a4f14b3
102   FW_TARGET:=falcon_voip_fw.bin
103   FW_FILE=fw_voip_falcon-1.1.0.6.0.tar.gz
104   FW_DOWNLOAD:=1
105   COEF_TARGET:=falcon_bbd.bin
106 # FXS part
107 ifeq ($(CONFIG_LTQ_VOICE_CPE_VMMC_COEF_FALCON_ETSI),y)
108         COEF_SRC:=ETSI_3_10.BIN
109 endif
110 ifeq ($(CONFIG_LTQ_VOICE_CPE_VMMC_COEF_FALCON_US600R),y)
111         COEF_SRC:=R600_3_10.BIN
112 endif
113 ifeq ($(CONFIG_LTQ_VOICE_CPE_VMMC_COEF_FALCON_USE_CUSTOM_FILE),y)
114         COEF_SRC:=$(CONFIG_LTQ_VOICE_CPE_VMMC_COEF_FALCON_CUSTOM_FILE)
115 endif
116   COEF_FILE:=coef_voip_falcon.tar.gz
117   COEF_MD5SUM:=56c5a838f2bb9bd87d0e8dce271f810b
118   COEF_DOWNLOAD:=1
119 endif
120
121 ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_VR9),y)
122   CONFIGURE_ARGS += --with-device=VR9
123   # TODO: add fw/coef
124 endif
125
126 define Download/firmware
127   FILE:=$(FW_FILE)
128   URL:=$(FW_URL)
129   MD5SUM:=$(FW_MD5SUM)
130 endef
131 $(eval $(if $(FW_DOWNLOAD),$(call Download,firmware)))
132
133 define Download/coef
134   FILE:=$(COEF_FILE)
135   URL:=$(FW_URL)
136   MD5SUM:=$(COEF_MD5SUM)
137 endef
138 $(eval $(if $(COEF_DOWNLOAD),$(call Download,coef)))
139
140 define Build/Configure
141         rm -rf \
142                 $(PKG_BUILD_DIR)/coef \
143                 $(PKG_BUILD_DIR)/firmware
144         mkdir -p \
145                 $(PKG_BUILD_DIR)/coef \
146                 $(PKG_BUILD_DIR)/firmware
147         $(TAR) -C $(PKG_BUILD_DIR)/firmware -xvzf $(DL_DIR)/$(FW_FILE)
148         $(TAR) -C $(PKG_BUILD_DIR)/coef -xvzf $(DL_DIR)/$(COEF_FILE)
149         $(call Build/Configure/Default)
150 endef
151
152 define Build/InstallDev
153         $(INSTALL_DIR) $(1)/usr/include
154         mkdir -p $(1)/usr/include/drv_vmmc
155         $(CP) -v --dereference $(PKG_BUILD_DIR)/include/* $(1)/usr/include/drv_vmmc
156         (cd $(1)/usr/include/drv_vmmc && ln -snf . include)
157 endef
158
159 define KernelPackage/ltq-vmmc/install
160         $(INSTALL_DIR) $(1)/etc/init.d $(1)/$(FW_DIR)
161         $(INSTALL_BIN) ./files/vmmc.init $(1)/etc/init.d/vmmc
162         $(CP) $(PKG_BUILD_DIR)/firmware/$(FW_SOURCE) $(1)/$(FW_DIR)/$(FW_TARGET)
163         ln -s /$(FW_DIR)/$(FW_TARGET) $(1)/$(FW_DIR)/$(FW_TARGET_GENERIC)
164         $(CP) $(PKG_BUILD_DIR)/coef/$(COEF_SRC) $(1)/$(FW_DIR)/$(COEF_TARGET)
165         ln -s /$(FW_DIR)/$(COEF_TARGET) $(1)/$(FW_DIR)/$(COEF_TARGET_GENERIC)
166 endef
167
168 $(eval $(call KernelPackage,ltq-vmmc))