[ifxmips]
[openwrt/svn-archive/archive.git] / package / ifx-vmmc / Makefile
1 #
2 # Copyright (C) 2008-2010 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.7.0
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_MD5SUM:=3f1b44e79408a3320aa9f8b21a260fd0
17 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
18
19 PATCH_DIR ?= ./patches$(if $(wildcard ./patches-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define KernelPackage/ifx-vmmc
24 SUBMENU:=Voice over IP
25 TITLE:=TAPI LL driver for Voice Macro
26 URL:=http://www.lantiq.com/
27 MAINTAINER:=Lantiq
28 DEPENDS:=+kmod-ifx-tapi @BROKEN
29 FILES:=$(PKG_BUILD_DIR)/src/drv_vmmc.ko
30 AUTOLOAD:=$(call AutoLoad,25,drv_vmmc)
31 MENU:=1
32 endef
33
34 define KernelPackage/ifx-vmmc/description
35 Voice Subsystem Low Level Driver for Danube, AR9, VR9 device families
36 endef
37
38 define KernelPackage/ifx-vmmc/config
39 source "$(SOURCE)/Config.in"
40 endef
41
42 CONFIGURE_ARGS += \
43 ARCH=$(LINUX_KARCH) \
44 --enable-linux-26 \
45 --enable-kernelbuild="$(LINUX_DIR)" \
46 --enable-kernelincl="$(LINUX_DIR)/include" \
47 --enable-tapiincl="$(STAGING_DIR)/usr/include/drv_tapi" \
48 --with-ifxos-incl=$(STAGING_DIR)/usr/include/ifxos \
49 $(call autoconf_bool,CONFIG_VOICE_CPE_VMMC_EVENT_LOGGER,el-debug) \
50 $(call autoconf_bool,CONFIG_VOICE_CPE_VMMC_PMC,pmc) \
51 $(call autoconf_bool,CONFIG_VOICE_CPE_VMMC_DISABLE_DECT_NIBBLE_SWAP,dect-nibble-swap) \
52 $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_FAX,fax t38) \
53 $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_CID,cid) \
54 $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_DECT,dect) \
55 $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_KPI,kpi) \
56 $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_LT_GR909,lt calibration) \
57 $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_HDLC,hdlc) \
58 $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_TRACES,trace)
59
60 ifneq ($(CONFIG_VOICE_CPE_VMMC_MPS_HISTORY_SIZE),128)
61 CONFIGURE_ARGS += --enable-history-buf=$(CONFIG_VOICE_CPE_VMMC_MPS_HISTORY_SIZE)
62 endif
63
64 #defaults
65 FW_URL:=http://localhost/
66 FW_TARGET:=ifx_firmware.bin
67 FW_FILE:=fw_voip_ifx.tar.gz
68 COEF_TARGET:=ifx_bbd_fxs.bin
69 COEF_FILE:=coef_voip_ifx.tar.gz
70
71 FW_DIR:=lib/firmware
72 ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_DANUBE_extract),y)
73 CONFIGURE_ARGS += --with-device=DANUBE
74 FW_TARGET:=danube_firmware.bin
75 FW_SOURCE:=danube_firmware.bin
76 FW_URL:=http://www.arcor.de/hilfe/files/pdf/
77 FW_FILE=arcor_A800_452CPW_FW_1.02.206(20081201).bin
78 FW_MD5SUM:=19d9af4e369287a0f0abaed415cdac10
79 COEF_TARGET:=danube_bbd_fxs.bin
80 COEF_FILE:=arcor_A800_452CPW_FW_1.02.206(20081201).bin
81 COEF_MD5SUM:=19d9af4e369287a0f0abaed415cdac10
82 endif
83
84 ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_DANUBE),y)
85 CONFIGURE_ARGS += --with-device=DANUBE
86 FW_SOURCE:=voip_R12.1.0.1.0-enc.bin
87 FW_TARGET:=danube_firmware.bin
88 FW_FILE=fw_voip_danube-12.1.0.1.0.tar.gz
89 FW_MD5SUM:=51868b88dee9dbc65d3dbba355ded91c
90 COEF_TARGET:=danube_bbd_fxs.bin
91 COEF_FILE:=coef_voip_danube-0.9.0.tar.gz
92 COEF_MD5SUM:=c8ac6592b304b03829a8123560e15710
93 endif
94
95 ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_AR9),y)
96 CONFIGURE_ARGS += --with-device=AR9
97 # TODO: add fw/coef
98 endif
99
100 ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_VR9),y)
101 CONFIGURE_ARGS += --with-device=VR9
102 # TODO: add fw/coef
103 endif
104
105 ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_DANUBE_extract),y)
106 define Download/decode
107 FILE:=ifxmips_fw_decodev2.tar.bz2
108 URL:=http://downloads.openwrt.org/sources/
109 MD5SUM:=9f4ebfae5cb9d9e8fca46057a653ae27
110 endef
111 $(eval $(call Download,decode))
112 endif
113
114 define Download/firmware
115 FILE:=$(FW_FILE)
116 URL:=$(FW_URL)
117 MD5SUM:=$(FW_MD5SUM)
118 endef
119 $(eval $(call Download,firmware))
120
121 define Download/coef
122 FILE:=$(COEF_FILE)
123 URL:=$(FW_URL)
124 MD5SUM:=$(COEF_MD5SUM)
125 endef
126 $(eval $(call Download,coef))
127
128 define Build/Configure
129 rm -rf \
130 $(PKG_BUILD_DIR)/coef \
131 $(PKG_BUILD_DIR)/firmware
132 mkdir -p \
133 $(PKG_BUILD_DIR)/coef \
134 $(PKG_BUILD_DIR)/firmware
135 ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_DANUBE_extract),y)
136 $(PLATFORM_DIR)/extract.sh $(DL_DIR) '$(FW_FILE)'
137 $(CP) $(DL_DIR)/voip.bin $(PKG_BUILD_DIR)/firmware/$(FW_TARGET)
138 $(CP) $(DL_DIR)/voip_coef.bin $(PKG_BUILD_DIR)/coef/$(COEF_TARGET)
139 else
140 $(TAR) -C $(PKG_BUILD_DIR)/firmware -xvzf $(DL_DIR)/$(FW_FILE)
141 $(TAR) -C $(PKG_BUILD_DIR)/coef -xvzf $(DL_DIR)/$(COEF_FILE)
142 endif
143 (cd $(PKG_BUILD_DIR); aclocal && autoconf && automake)
144 $(call Build/Configure/Default)
145 endef
146
147 define Build/InstallDev
148 $(INSTALL_DIR) $(1)/usr/include
149 mkdir -p $(1)/usr/include/drv_vmmc
150 $(CP) -v --dereference $(PKG_BUILD_DIR)/include/* $(1)/usr/include/drv_vmmc
151 (cd $(1)/usr/include/drv_vmmc && ln -snf . include)
152 endef
153
154 define KernelPackage/ifx-vmmc/install
155 $(INSTALL_DIR) $(1)/etc/init.d $(1)/$(FW_DIR)
156 $(INSTALL_BIN) ./files/vmmc.init $(1)/etc/init.d/vmmc
157 $(CP) $(PKG_BUILD_DIR)/firmware/$(FW_SOURCE) $(1)/$(FW_DIR)/$(FW_TARGET)
158 $(CP) $(PKG_BUILD_DIR)/coef/$(COEF_TARGET) $(1)/$(FW_DIR)/$(COEF_TARGET)
159 endef
160
161 $(eval $(call KernelPackage,ifx-vmmc))