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