Makefile 5.7 KB

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