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
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 <john@phrozen.org>
21 PKG_CHECK_FORMAT_SECURITY:=0
24 include $(INCLUDE_DIR)/package.mk
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||TARGET_lantiq_xrx200) +kmod-ltq-tapi
31 FILES:=$(PKG_BUILD_DIR)/src/drv_vmmc.ko
32 AUTOLOAD:=$(call AutoProbe,drv_vmmc)
35 define KernelPackage/ltq-vmmc/description
36 Voice Subsystem Low Level Driver for Danube, AR9, VR9 device families
39 define KernelPackage/ltq-vmmc/config
40 source "$(SOURCE)/Config.in"
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)
61 ifneq ($(CONFIG_VOICE_CPE_VMMC_MPS_HISTORY_SIZE),128)
62 CONFIGURE_ARGS += --enable-history-buf=$(CONFIG_VOICE_CPE_VMMC_MPS_HISTORY_SIZE)
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
74 FW_TARGET_GENERIC:=$(FW_TARGET)
75 COEF_TARGET_GENERIC:=$(COEF_TARGET)
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
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
91 ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_AR9),y)
92 CONFIGURE_ARGS += --with-device=AR9
96 COEF_SRC:=$(COEF_TARGET)
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
105 COEF_TARGET:=falcon_bbd.bin
107 ifeq ($(CONFIG_LTQ_VOICE_CPE_VMMC_COEF_FALCON_ETSI),y)
108 COEF_SRC:=ETSI_3_10.BIN
110 ifeq ($(CONFIG_LTQ_VOICE_CPE_VMMC_COEF_FALCON_US600R),y)
111 COEF_SRC:=R600_3_10.BIN
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)
116 COEF_FILE:=coef_voip_falcon.tar.gz
117 COEF_MD5SUM:=56c5a838f2bb9bd87d0e8dce271f810b
121 ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_VR9),y)
122 CONFIGURE_ARGS += --with-device=VR9
123 FW_TARGET:=voice_ar9_firmware.bin
124 FW_SOURCE:=voip_R2.3.1.7.0-enc.bin
125 FW_FILE=fw_voip_vr9-2.3.1.7.0.tar.gz
126 FW_MD5SUM:=9d716b99349b56b619dbaf6647b227cb
128 COEF_SRC:=ETSI_3_10.BIN
129 COEF_TARGET:=vr9_bbd_fxs.bin
130 COEF_FILE:=coef_voip_vr9-0.9.3.tar.gz
131 COEF_MD5SUM:=66fa5c6a4110726b1f8658359b8008e6
134 COEF_SRC_FXO:=FXO_ETSI_0_0.BIN
135 COEF_TARGET_FXO:=vr9_bbd.bin
138 define Download/firmware
143 $(eval $(if $(FW_DOWNLOAD),$(call Download,firmware)))
148 MD5SUM:=$(COEF_MD5SUM)
150 $(eval $(if $(COEF_DOWNLOAD),$(call Download,coef)))
152 define Build/Configure
154 $(PKG_BUILD_DIR)/coef \
155 $(PKG_BUILD_DIR)/firmware
157 $(PKG_BUILD_DIR)/coef \
158 $(PKG_BUILD_DIR)/firmware
159 $(TAR) -C $(PKG_BUILD_DIR)/firmware -xvzf $(DL_DIR)/$(FW_FILE)
160 $(TAR) -C $(PKG_BUILD_DIR)/coef -xvzf $(DL_DIR)/$(COEF_FILE)
161 $(call Build/Configure/Default)
164 define Build/InstallDev
165 $(INSTALL_DIR) $(1)/usr/include
166 mkdir -p $(1)/usr/include/drv_vmmc
167 $(CP) -v --dereference $(PKG_BUILD_DIR)/include/* $(1)/usr/include/drv_vmmc
168 (cd $(1)/usr/include/drv_vmmc && ln -snf . include)
171 define KernelPackage/ltq-vmmc/install
172 $(INSTALL_DIR) $(1)/etc/init.d $(1)/$(FW_DIR)
173 $(INSTALL_BIN) ./files/vmmc.init $(1)/etc/init.d/vmmc
174 $(CP) $(PKG_BUILD_DIR)/firmware/$(FW_SOURCE) $(1)/$(FW_DIR)/$(FW_TARGET)
175 ln -s /$(FW_DIR)/$(FW_TARGET) $(1)/$(FW_DIR)/$(FW_TARGET_GENERIC)
176 $(CP) $(PKG_BUILD_DIR)/coef/$(COEF_SRC) $(1)/$(FW_DIR)/$(COEF_TARGET)
177 $(CP) $(PKG_BUILD_DIR)/coef/$(COEF_SRC_FXO) $(1)/$(FW_DIR)/$(COEF_TARGET_FXO)
178 ln -s /$(FW_DIR)/$(COEF_TARGET) $(1)/$(FW_DIR)/$(COEF_TARGET_GENERIC)
181 $(eval $(call KernelPackage,ltq-vmmc))