public inbox for buildroot@busybox.net
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/linux-tools: introduce spi linux tools
@ 2020-05-13 15:03 Eugen Hristev
  2020-05-13 15:21 ` Baruch Siach
  0 siblings, 1 reply; 8+ messages in thread
From: Eugen Hristev @ 2020-05-13 15:03 UTC (permalink / raw)
  To: buildroot

Add new linux tools package : spi. This is present in the Linux Kernel since
4.5.
It now includes spidev_test and spidev_fdx tools.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
---

Inspired by the linux-tools iio mk.in file.

 package/linux-tools/Config.in            |  7 ++++++
 package/linux-tools/linux-tool-spi.mk.in | 29 ++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 package/linux-tools/linux-tool-spi.mk.in

diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in
index ceb58c668a..60df99dc4a 100644
--- a/package/linux-tools/Config.in
+++ b/package/linux-tools/Config.in
@@ -108,6 +108,13 @@ comment "selftests needs BR2_PACKAGE_BUSYBOX_SHOW_OTHERS and a toolchain w/ dyna
 	depends on BR2_USE_MMU
 	depends on !BR2_PACKAGE_BUSYBOX_SHOW_OTHERS || BR2_STATIC_LIBS
 
+config BR2_PACKAGE_LINUX_TOOLS_SPI
+	bool "spi"
+	select BR2_PACKAGE_LINUX_TOOLS
+	help
+	  spi is a collection of tools to test and measure performances
+	  of SPI (Serial Peripheral Interface) bus devices.
+
 config BR2_PACKAGE_LINUX_TOOLS_TMON
 	bool "tmon"
 	select BR2_PACKAGE_LINUX_TOOLS
diff --git a/package/linux-tools/linux-tool-spi.mk.in b/package/linux-tools/linux-tool-spi.mk.in
new file mode 100644
index 0000000000..f6c4298380
--- /dev/null
+++ b/package/linux-tools/linux-tool-spi.mk.in
@@ -0,0 +1,29 @@
+################################################################################
+#
+# spi
+#
+################################################################################
+
+LINUX_TOOLS += spi
+
+SPI_MAKE_OPTS = $(LINUX_MAKE_FLAGS)
+
+define SPI_BUILD_CMDS
+	$(Q)if ! grep install $(LINUX_DIR)/tools/spi/Makefile >/dev/null 2>&1 ; then \
+		echo "Your kernel version is too old and does not have install section in the spi tools." ; \
+		echo "At least kernel 4.5 must be used." ; \
+		exit 1 ; \
+	fi
+
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/spi \
+		$(SPI_MAKE_OPTS)
+endef
+
+# DESTDIR used since kernel version 4.14
+define SPI_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/spi \
+		$(SPI_MAKE_OPTS) \
+		INSTALL_ROOT=$(TARGET_DIR) \
+		DESTDIR=$(TARGET_DIR) \
+		install
+endef
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-06-04 21:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-13 15:03 [Buildroot] [PATCH] package/linux-tools: introduce spi linux tools Eugen Hristev
2020-05-13 15:21 ` Baruch Siach
2020-05-13 15:59   ` Eugen.Hristev at microchip.com
2020-05-13 17:46     ` Baruch Siach
2020-05-13 19:58       ` Yann E. MORIN
2020-06-04 14:27         ` Eugen.Hristev at microchip.com
2020-06-04 15:35           ` Baruch Siach
2020-06-04 21:59             ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox