[Buildroot] [PATCH] package/linux-tools: introduce spi linux tools

Eugen.Hristev at microchip.com Eugen.Hristev at microchip.com
Wed May 13 15:59:41 UTC 2020


On 13.05.2020 18:21, Baruch Siach wrote:

> Hi Eugen,
> 
> On Wed, May 13 2020, Eugen Hristev wrote:
>> 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.
> 
> We have a package for spidev_test already. Consider adding spidev_fdx to
> that package instead.
> 

Hi Baruch,

While I understand your point, you should also consider that all linux 
tools have a specific way to build in buildroot, and this I think should 
be consistent.
And spi tools would be not just spidev_test and might include future 
applications, which may or may not have their place in the same spot as 
spidev_test .

Eugen

> baruch
> 
>> Signed-off-by: Eugen Hristev <eugen.hristev at 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
> 
> 
> --
>                                                       ~. .~   Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>     - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
> 



More information about the buildroot mailing list