Makefile 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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_MD5SUM:=d8eee8cba0edb28974cc1f8532e3bd18
  14. PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
  15. PKG_MAINTAINER:=John Crispin <blogic@openwrt.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) +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_MD5SUM:=51868b88dee9dbc65d3dbba355ded91c
  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_MD5SUM:=c8ac6592b304b03829a8123560e15710
  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_MD5SUM:=cd4366a52a8010b76793e3810a4f14b3
  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_MD5SUM:=56c5a838f2bb9bd87d0e8dce271f810b
  101. COEF_DOWNLOAD:=1
  102. endif
  103. ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_VR9),y)
  104. CONFIGURE_ARGS += --with-device=VR9
  105. # TODO: add fw/coef
  106. endif
  107. define Download/firmware
  108. FILE:=$(FW_FILE)
  109. URL:=$(FW_URL)
  110. MD5SUM:=$(FW_MD5SUM)
  111. endef
  112. $(eval $(if $(FW_DOWNLOAD),$(call Download,firmware)))
  113. define Download/coef
  114. FILE:=$(COEF_FILE)
  115. URL:=$(FW_URL)
  116. MD5SUM:=$(COEF_MD5SUM)
  117. endef
  118. $(eval $(if $(COEF_DOWNLOAD),$(call Download,coef)))
  119. define Build/Configure
  120. rm -rf \
  121. $(PKG_BUILD_DIR)/coef \
  122. $(PKG_BUILD_DIR)/firmware
  123. mkdir -p \
  124. $(PKG_BUILD_DIR)/coef \
  125. $(PKG_BUILD_DIR)/firmware
  126. $(TAR) -C $(PKG_BUILD_DIR)/firmware -xvzf $(DL_DIR)/$(FW_FILE)
  127. $(TAR) -C $(PKG_BUILD_DIR)/coef -xvzf $(DL_DIR)/$(COEF_FILE)
  128. $(call Build/Configure/Default)
  129. endef
  130. define Build/InstallDev
  131. $(INSTALL_DIR) $(1)/usr/include
  132. mkdir -p $(1)/usr/include/drv_vmmc
  133. $(CP) -v --dereference $(PKG_BUILD_DIR)/include/* $(1)/usr/include/drv_vmmc
  134. (cd $(1)/usr/include/drv_vmmc && ln -snf . include)
  135. endef
  136. define KernelPackage/ltq-vmmc/install
  137. $(INSTALL_DIR) $(1)/etc/init.d $(1)/$(FW_DIR)
  138. $(INSTALL_BIN) ./files/vmmc.init $(1)/etc/init.d/vmmc
  139. $(CP) $(PKG_BUILD_DIR)/firmware/$(FW_SOURCE) $(1)/$(FW_DIR)/$(FW_TARGET)
  140. ln -s /$(FW_DIR)/$(FW_TARGET) $(1)/$(FW_DIR)/$(FW_TARGET_GENERIC)
  141. $(CP) $(PKG_BUILD_DIR)/coef/$(COEF_SRC) $(1)/$(FW_DIR)/$(COEF_TARGET)
  142. ln -s /$(FW_DIR)/$(COEF_TARGET) $(1)/$(FW_DIR)/$(COEF_TARGET_GENERIC)
  143. endef
  144. $(eval $(call KernelPackage,ltq-vmmc))