51c00e99f00b05aad75108a9163d6157f4375cc8
[openwrt.git] / package / 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
19 include $(INCLUDE_DIR)/package.mk
20
21 define KernelPackage/ltq-vmmc
22 SUBMENU:=Voice over IP
23 TITLE:=TAPI LL driver for Voice Macro
24 URL:=http://www.lantiq.com/
25 DEPENDS:=+kmod-ltq-tapi @TARGET_lantiq_xway
26 FILES:=$(PKG_BUILD_DIR)/src/drv_vmmc.ko
27 AUTOLOAD:=$(call AutoLoad,25,drv_vmmc)
28 MAINTAINER:=John Crispin <blogic@openwrt.org>
29 endef
30
31 define KernelPackage/ltq-vmmc/description
32 Voice Subsystem Low Level Driver for Danube, AR9, VR9 device families
33 endef
34
35 define KernelPackage/ltq-vmmc/config
36 source "$(SOURCE)/Config.in"
37 endef
38
39 CONFIGURE_ARGS += \
40 ARCH=$(LINUX_KARCH) \
41 --enable-linux-26 \
42 --enable-kernelbuild="$(LINUX_DIR)" \
43 --enable-kernelincl="$(LINUX_DIR)/include" \
44 --enable-tapiincl="$(STAGING_DIR)/usr/include/drv_tapi" \
45 --with-ifxos-incl=$(STAGING_DIR)/usr/include/ifxos \
46 $(call autoconf_bool,CONFIG_VOICE_CPE_VMMC_EVENT_LOGGER,el-debug) \
47 $(call autoconf_bool,CONFIG_VOICE_CPE_VMMC_PMC,pmc) \
48 $(call autoconf_bool,CONFIG_VOICE_CPE_VMMC_DISABLE_DECT_NIBBLE_SWAP,dect-nibble-swap) \
49 $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_FAX,fax t38) \
50 $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_CID,cid) \
51 $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_DECT,dect) \
52 $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_KPI,kpi) \
53 $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_LT_GR909,lt calibration) \
54 $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_HDLC,hdlc) \
55 $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_TRACES,trace)
56
57 ifneq ($(CONFIG_VOICE_CPE_VMMC_MPS_HISTORY_SIZE),128)
58 CONFIGURE_ARGS += --enable-history-buf=$(CONFIG_VOICE_CPE_VMMC_MPS_HISTORY_SIZE)
59 endif
60
61 #defaults
62 FW_URL:=http://localhost/
63 FW_TARGET:=ifx_firmware.bin
64 FW_FILE:=fw_voip_ifx.tar.gz
65 COEF_TARGET:=ifx_bbd_fxs.bin
66 COEF_FILE:=coef_voip_ifx.tar.gz
67
68 FW_DIR:=lib/firmware
69
70 ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_DANUBE),y)
71 CONFIGURE_ARGS += --with-device=DANUBE
72 FW_SOURCE:=voip_R12.1.0.1.0-enc.bin
73 FW_TARGET:=danube_firmware.bin
74 FW_FILE=fw_voip_danube-12.1.0.1.0.tar.gz
75 FW_MD5SUM:=51868b88dee9dbc65d3dbba355ded91c
76 COEF_TARGET:=danube_bbd_fxs.bin
77 COEF_FILE:=coef_voip_danube-0.9.0.tar.gz
78 COEF_MD5SUM:=c8ac6592b304b03829a8123560e15710
79 endif
80
81 ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_AR9),y)
82 CONFIGURE_ARGS += --with-device=AR9
83 # TODO: add fw/coef
84 endif
85
86 ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_VR9),y)
87 CONFIGURE_ARGS += --with-device=VR9
88 # TODO: add fw/coef
89 endif
90
91 define Download/firmware
92 FILE:=$(FW_FILE)
93 URL:=$(FW_URL)
94 MD5SUM:=$(FW_MD5SUM)
95 endef
96 $(eval $(call Download,firmware))
97
98 define Download/coef
99 FILE:=$(COEF_FILE)
100 URL:=$(FW_URL)
101 MD5SUM:=$(COEF_MD5SUM)
102 endef
103 $(eval $(call Download,coef))
104
105 define Build/Configure
106 rm -rf \
107 $(PKG_BUILD_DIR)/coef \
108 $(PKG_BUILD_DIR)/firmware
109 mkdir -p \
110 $(PKG_BUILD_DIR)/coef \
111 $(PKG_BUILD_DIR)/firmware
112 $(TAR) -C $(PKG_BUILD_DIR)/firmware -xvzf $(DL_DIR)/$(FW_FILE)
113 $(TAR) -C $(PKG_BUILD_DIR)/coef -xvzf $(DL_DIR)/$(COEF_FILE)
114 (cd $(PKG_BUILD_DIR); aclocal && autoconf && automake)
115 $(call Build/Configure/Default)
116 endef
117
118 define Build/InstallDev
119 $(INSTALL_DIR) $(1)/usr/include
120 mkdir -p $(1)/usr/include/drv_vmmc
121 $(CP) -v --dereference $(PKG_BUILD_DIR)/include/* $(1)/usr/include/drv_vmmc
122 (cd $(1)/usr/include/drv_vmmc && ln -snf . include)
123 endef
124
125 define KernelPackage/ltq-vmmc/install
126 $(INSTALL_DIR) $(1)/etc/init.d $(1)/$(FW_DIR)
127 $(INSTALL_BIN) ./files/vmmc.init $(1)/etc/init.d/vmmc
128 $(CP) $(PKG_BUILD_DIR)/firmware/$(FW_SOURCE) $(1)/$(FW_DIR)/$(FW_TARGET)
129 $(CP) $(PKG_BUILD_DIR)/coef/$(COEF_TARGET) $(1)/$(FW_DIR)/$(COEF_TARGET)
130 endef
131
132 $(eval $(call KernelPackage,ltq-vmmc))
This page took 0.044226 seconds and 3 git commands to generate.