treewide: opt-out of tree-wide mold usage
[openwrt/openwrt.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 PKG_BUILD_FLAGS:=no-mold
29
30 include $(INCLUDE_DIR)/package.mk
31
32 define KernelPackage/ltq-vdsl-vr11-mei
33 TITLE:=mei driver for vdsl
34 SECTION:=sys
35 SUBMENU:=Network Devices
36 DEPENDS:=@TARGET_ipq40xx +kmod-ltq-ifxos +kmod-vrx518_tc
37 FILES:=$(PKG_BUILD_DIR)/src/drv_mei_cpe.ko
38 AUTOLOAD:=$(call AutoLoad,50,drv_mei_cpe)
39 endef
40
41 define KernelPackage/ltq-vdsl-vr11-mei/description
42 Lantiq MEI CPE Kernel Module Driver
43 endef
44
45
46 define Package/ltq-vdsl-vr11-mei-test
47 SECTION:=net
48 CATEGORY:=Network
49 TITLE:=Lantiq mei driver test tool
50 URL:=http://www.lantiq.com/
51 DEPENDS:=@TARGET_ipq40xx +kmod-ltq-vdsl-vr11-mei
52 endef
53
54 define Package/ltq-vdsl-vr11-mei-test/description
55 Userland tool to directly control the mei driver, this is only needed
56 for test and development purposes.
57 endef
58
59 MAKE_FLAGS += \
60 $(KERNEL_MAKE_FLAGS) \
61 SHELL="$(BASH)"
62
63 # ltq-vdsl-app uses a header provided by the MEI driver which has some
64 # conditionals.
65 # Define the conditionals here to have the same view on both sides. If you
66 # change them, you need to change them for the ltq-vdsl-app as well
67 MEI_DRV_CFLAGS = \
68 -DMEI_DRV_ATM_PTM_INTERFACE_ENABLE=1 \
69 -DMEI_SUPPORT_DEBUG_STREAMS=1 \
70 -DMEI_SUPPORT_OPTIMIZED_FW_DL=1
71
72 #MEI_DRV_CFLAGS+= \
73 # -DMEI_SUPPORT_OPTIMIZED_FW_DL=0 \
74 # -DIRQ_POLLING_FORCE=99
75
76 CONFIGURE_ARGS += \
77 --enable-debug-logger-support=no
78 # --enable-debug-stream-support=no
79
80 # This looks weird, but it's necessary to address the right device.
81 # (pdev->dev.parent instead of pdev->dev)
82 MEI_DRV_CFLAGS+= \
83 -DMEI_TARGET_x86=1
84
85 CONFIGURE_ARGS += \
86 --enable-kernelincl="$(LINUX_DIR)/include" \
87 --enable-device=vr11 \
88 --enable-debug \
89 --enable-error_print \
90 --enable-ifxos-include="-I$(STAGING_DIR)/usr/include/ifxos/" \
91 --enable-ifxos-library="-L$(STAGING_DIR)/usr/lib" \
92 --enable-add_drv_cflags="$(MEI_DRV_CFLAGS)" \
93 --enable-linux-26 \
94 --enable-kernelbuild="$(LINUX_DIR)" \
95 --enable-drv_test_appl=yes \
96 ARCH=$(LINUX_KARCH)
97
98 define Build/InstallDev
99 $(INSTALL_DIR) $(1)/usr/include/vdsl
100 $(CP) $(PKG_BUILD_DIR)/src/drv_mei_cpe_api_intern.h $(1)/usr/include/vdsl/
101 $(CP) $(PKG_BUILD_DIR)/src/drv_mei_cpe_api_atm_ptm_intern.h $(1)/usr/include/vdsl/
102 $(CP) $(PKG_BUILD_DIR)/src/drv_mei_cpe_interface.h $(1)/usr/include/vdsl
103 $(CP) $(PKG_BUILD_DIR)/src/drv_mei_cpe_config.h $(1)/usr/include/vdsl/
104 $(CP) $(PKG_BUILD_DIR)/src/cmv_message_format.h $(1)/usr/include/vdsl/
105 endef
106
107 $(eval $(call KernelPackage,ltq-vdsl-vr11-mei))
108
109 define Package/ltq-vdsl-vr11-mei-test/install
110 $(INSTALL_DIR) $(1)/bin
111 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mei_cpe_drv_test $(1)/bin
112 endef
113
114 $(eval $(call BuildPackage,ltq-vdsl-vr11-mei-test))