lantiq: ltq-vdsl-mei: add mei_cpe_drv_test application
[openwrt/openwrt.git] / package / kernel / lantiq / ltq-vdsl-mei / Makefile
1 # Copyright (C) 2012 OpenWrt.org
2 #
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
5
6 include $(TOPDIR)/rules.mk
7 include $(INCLUDE_DIR)/kernel.mk
8
9 PKG_NAME:=ltq-vdsl-vr9-mei
10 PKG_VERSION:=1.4.8.4
11 PKG_RELEASE:=1
12
13 PKG_BASE_NAME:=drv_mei_cpe
14 PKG_SOURCE:=$(PKG_BASE_NAME)-$(PKG_VERSION).tar.gz
15 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_BASE_NAME)-$(PKG_VERSION)
16 PKG_SOURCE_URL:=https://github.com/xdarklight/$(PKG_BASE_NAME)/archive/v$(PKG_VERSION)
17 PKG_MD5SUM:=30570722dc7f19ff2f0228838043f2a2
18 PKG_FIXUP:=autoreconf
19 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
20 PKG_USE_MIPS16:=0
21 PKG_CHECK_FORMAT_SECURITY:=0
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define KernelPackage/ltq-vdsl-vr9-mei
26 TITLE:=mei driver for vdsl
27 SECTION:=sys
28 SUBMENU:=Network Devices
29 DEPENDS:=@TARGET_lantiq_xrx200 +kmod-ltq-ifxos
30 FILES:=$(PKG_BUILD_DIR)/src/drv_mei_cpe.ko
31 AUTOLOAD:=$(call AutoLoad,50,drv_mei_cpe)
32 endef
33
34 define KernelPackage/ltq-vdsl-vr9-mei/description
35 Lantiq MEI CPE Kernel Module Driver
36 endef
37
38
39 define Package/ltq-vdsl-mei_test
40 SECTION:=net
41 CATEGORY:=Network
42 TITLE:=Lantiq mei driver test tool
43 URL:=http://www.lantiq.com/
44 DEPENDS:=@TARGET_lantiq_xrx200
45 endef
46
47 define Package/ltq-vdsl-mei_test/description
48 Userland tool to directly control the mei driver, this is only needed
49 for test and development purposes.
50 endef
51
52
53 #DEBUG=-DDEBUG_PRINT=1
54
55 MAKE_FLAGS += \
56 SHELL="$(BASH)"
57
58 CONFIGURE_ARGS += \
59 --enable-kernelincl="$(LINUX_DIR)/include" \
60 --enable-device=vr9 \
61 --with-max-device=1 \
62 --with-lines-per-device=1 \
63 --enable-debug \
64 --enable-error_print \
65 --enable-ifxos-include="-I$(STAGING_DIR)/usr/include/ifxos/" \
66 --enable-ifxos-library="-L$(STAGING_DIR)/usr/lib" \
67 --enable-add_drv_cflags="$(DEBUG) -DMEI_DRV_ATM_PTM_INTERFACE_ENABLE=1 -DMEI_EXPORT_INTERNAL_API=1 -DMEI_SUPPORT_DSM=0 -fno-pic -mno-abicalls -mlong-calls -O2 -g0" \
68 --enable-linux-26 \
69 --enable-kernelbuild="$(LINUX_DIR)" \
70 --enable-drv_test_appl=yes \
71 ARCH=$(LINUX_KARCH)
72
73 define Build/InstallDev
74 $(INSTALL_DIR) $(1)/usr/include/vdsl
75 $(CP) $(PKG_BUILD_DIR)/src/drv_mei_cpe_api_intern.h $(1)/usr/include/vdsl/
76 $(CP) $(PKG_BUILD_DIR)/src/drv_mei_cpe_api_atm_ptm_intern.h $(1)/usr/include/vdsl/
77 $(CP) $(PKG_BUILD_DIR)/src/drv_mei_cpe_interface.h $(1)/usr/include/vdsl
78 $(CP) $(PKG_BUILD_DIR)/src/drv_mei_cpe_config.h $(1)/usr/include/vdsl/
79 $(CP) $(PKG_BUILD_DIR)/src/cmv_message_format.h $(1)/usr/include/vdsl/
80 endef
81
82 $(eval $(call KernelPackage,ltq-vdsl-vr9-mei))
83
84 define Package/ltq-vdsl-mei_test/install
85 $(INSTALL_DIR) $(1)/bin
86 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mei_cpe_drv_test $(1)/bin
87 endef
88
89 $(eval $(call BuildPackage,ltq-vdsl-mei_test))