f2dcf8db84d573db5035e144153289a800ec223a
[openwrt/staging/jow.git] / package / kernel / lantiq / ltq-vdsl-vr11-mei / Makefile
1 # Copyright (C) 2012 OpenWrt.org
2 # Copyright (C) 2015-2016 Lantiq Beteiligungs GmbH & Co KG.
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
10 PKG_NAME:=ltq-vdsl-vr11-mei
11 PKG_VERSION:=1.11.1
12 PKG_RELEASE:=2
13 PKG_BASE_NAME:=dsl_cpe_mei
14
15 UGW_VERSION=8.5.2.10
16 UGW_BASENAME=$(PKG_BASE_NAME)-ugw_$(UGW_VERSION)
17
18 PKG_SOURCE:=$(UGW_BASENAME).tar.bz2
19 PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/intel/$(PKG_BASE_NAME)/-/archive/ugw_$(UGW_VERSION)/
20 PKG_HASH:=337614473d50ed64de010adaed99a16103e08eea8fc67fe9d6caf155bea33d1d
21 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(UGW_BASENAME)
22 PKG_LICENSE:=GPL-2.0 BSD-2-Clause
23 PKG_LICENSE_FILES:=LICENSE
24 PKG_EXTMOD_SUBDIRS:=src
25
26 PKG_FIXUP:=autoreconf
27 PKG_FLAGS:=nonshared
28
29 include $(INCLUDE_DIR)/package.mk
30
31 define KernelPackage/ltq-vdsl-vr11-mei
32 TITLE:=mei driver for vdsl
33 SECTION:=sys
34 SUBMENU:=Network Devices
35 DEPENDS:=@TARGET_ipq40xx +kmod-ltq-ifxos +kmod-vrx518_tc
36 FILES:=$(PKG_BUILD_DIR)/src/drv_mei_cpe.ko
37 AUTOLOAD:=$(call AutoLoad,50,drv_mei_cpe)
38 endef
39
40 define KernelPackage/ltq-vdsl-vr11-mei/description
41 Lantiq MEI CPE Kernel Module Driver
42 endef
43
44
45 define Package/ltq-vdsl-vr11-mei-test
46 SECTION:=net
47 CATEGORY:=Network
48 TITLE:=Lantiq mei driver test tool
49 URL:=http://www.lantiq.com/
50 DEPENDS:=@TARGET_ipq40xx +kmod-ltq-vdsl-vr11-mei
51 endef
52
53 define Package/ltq-vdsl-vr11-mei-test/description
54 Userland tool to directly control the mei driver, this is only needed
55 for test and development purposes.
56 endef
57
58 MAKE_FLAGS += \
59 $(KERNEL_MAKE_FLAGS) \
60 SHELL="$(BASH)"
61
62 # ltq-vdsl-app uses a header provided by the MEI driver which has some
63 # conditionals.
64 # Define the conditionals here to have the same view on both sides. If you
65 # change them, you need to change them for the ltq-vdsl-app as well
66 MEI_DRV_CFLAGS = \
67 -DMEI_DRV_ATM_PTM_INTERFACE_ENABLE=1 \
68 -DMEI_SUPPORT_DEBUG_STREAMS=1 \
69 -DMEI_SUPPORT_OPTIMIZED_FW_DL=1
70
71 #MEI_DRV_CFLAGS+= \
72 # -DMEI_SUPPORT_OPTIMIZED_FW_DL=0 \
73 # -DIRQ_POLLING_FORCE=99
74
75 CONFIGURE_ARGS += \
76 --enable-debug-logger-support=no
77 # --enable-debug-stream-support=no
78
79 # This looks weird, but it's necessary to address the right device.
80 # (pdev->dev.parent instead of pdev->dev)
81 MEI_DRV_CFLAGS+= \
82 -DMEI_TARGET_x86=1
83
84 CONFIGURE_ARGS += \
85 --enable-kernelincl="$(LINUX_DIR)/include" \
86 --enable-device=vr11 \
87 --enable-debug \
88 --enable-error_print \
89 --enable-ifxos-include="-I$(STAGING_DIR)/usr/include/ifxos/" \
90 --enable-ifxos-library="-L$(STAGING_DIR)/usr/lib" \
91 --enable-add_drv_cflags="$(MEI_DRV_CFLAGS)" \
92 --enable-linux-26 \
93 --enable-kernelbuild="$(LINUX_DIR)" \
94 --enable-drv_test_appl=yes \
95 ARCH=$(LINUX_KARCH)
96
97 define Build/InstallDev
98 $(INSTALL_DIR) $(1)/usr/include/vdsl
99 $(CP) $(PKG_BUILD_DIR)/src/drv_mei_cpe_api_intern.h $(1)/usr/include/vdsl/
100 $(CP) $(PKG_BUILD_DIR)/src/drv_mei_cpe_api_atm_ptm_intern.h $(1)/usr/include/vdsl/
101 $(CP) $(PKG_BUILD_DIR)/src/drv_mei_cpe_interface.h $(1)/usr/include/vdsl
102 $(CP) $(PKG_BUILD_DIR)/src/drv_mei_cpe_config.h $(1)/usr/include/vdsl/
103 $(CP) $(PKG_BUILD_DIR)/src/cmv_message_format.h $(1)/usr/include/vdsl/
104 endef
105
106 $(eval $(call KernelPackage,ltq-vdsl-vr11-mei))
107
108 define Package/ltq-vdsl-vr11-mei-test/install
109 $(INSTALL_DIR) $(1)/bin
110 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mei_cpe_drv_test $(1)/bin
111 endef
112
113 $(eval $(call BuildPackage,ltq-vdsl-vr11-mei-test))