spi: spidev: Add Toradex LAVA HAT
Subsystems (2)
cover spi: spidev: Add Toradex LAVA HAT
From: Francesco Dolcini <[email protected]>
Add a compatible string for the SPI loopback device present on the Toradex LAVA HAT test fixture and add it to the spidev driver.
The Toradex LAVA HAT is a board used for automated hardware-in-the-loop (HIL) testing, it provides several test-related functionalities, and exists in multiple variants depending on the board it is mated with. The SPI function is implemented with a loopback on the MISO/MOSI signals.
Francesco Dolcini (2):
dt-bindings: trivial-devices: add toradex,lava-hat-spi
spi: spidev: Add Toradex LAVA HAT OF compatible
Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++ drivers/spi/spidev.c | 2 ++ 2 files changed, 4 insertions(+)
Signature · 1 line
2.47.3
PATCH 1/2 dt-bindings: trivial-devices: add toradex,lava-hat-spi
From: Francesco Dolcini <[email protected]>
Add a compatible string for the SPI loopback device present on the Toradex LAVA HAT test fixture.
The Toradex LAVA HAT is a board used for automated hardware-in-the-loop (HIL) testing, it provides several test-related functionalities, and exists in multiple variants depending on the board it is mated with. The SPI function is implemented with a loopback on the MISO/MOSI signals.
As the device can be fully described using only "compatible" and "reg", it is appropriate to list it under trivial-devices.yaml rather than introducing a dedicated binding.
The SPI implementation is identical across all Toradex LAVA HAT variants, so a single compatible string is sufficient.
--- Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
@@ -519,6 +519,8 @@ properties: - ti,tps546d24 # I2C Touch-Screen Controller - ti,tsc2003 + # Toradex Lava Hat SPI + - toradex,lava-hat-spi # Winbond/Nuvoton H/W Monitor - winbond,w83793
Signature · 1 line
2.47.3
Re: [PATCH v1 1/2] dt-bindings: trivial-devices: add toradex,lava-hat-spi
Quoted 14 lines · Francesco Dolcini
From: Francesco Dolcini <[email protected]>
Add a compatible string for the SPI loopback device present on the Toradex LAVA HAT test fixture.
The Toradex LAVA HAT is a board used for automated hardware-in-the-loop (HIL) testing, it provides several test-related functionalities, and exists in multiple variants depending on the board it is mated with. The SPI function is implemented with a loopback on the MISO/MOSI signals.
As the device can be fully described using only "compatible" and "reg", it is appropriate to list it under
trivial-devices.yamlrather than introducing a dedicated binding.
Quoted 6 lines
The SPI implementation is identical across all Toradex LAVA HAT variants, so a single compatible string is sufficient.
pw-bot: not-applicable
Re: [PATCH v1 1/2] dt-bindings: trivial-devices: add toradex,lava-hat-spi
Quoted 18 lines · Conor Dooley
Quoted 17 lines · Francesco Dolcini
From: Francesco Dolcini <[email protected]>
Add a compatible string for the SPI loopback device present on the Toradex LAVA HAT test fixture.
The Toradex LAVA HAT is a board used for automated hardware-in-the-loop (HIL) testing, it provides several test-related functionalities, and exists in multiple variants depending on the board it is mated with. The SPI function is implemented with a loopback on the MISO/MOSI signals.
As the device can be fully described using only "compatible" and "reg", it is appropriate to list it under
trivial-devices.yamlrather than introducing a dedicated binding.The SPI implementation is identical across all Toradex LAVA HAT variants, so a single compatible string is sufficient.
Quoted 6 lines
Quoted 3 lines
Acked-by Conor Dooley <[email protected]>pw-bot: not-applicable
Heh, let's wait. That's a test device, so it won't be ever used in any final product, right? So not in final DTS?
Then why it's here? I think I directed previously to document it with the rest of test devices - in incomplete-devices schema?
Best regards,
Krzysztof
Re: [PATCH v1 1/2] dt-bindings: trivial-devices: add toradex,lava-hat-spi
Quoted 27 lines · Krzysztof Kozlowski
Quoted 18 lines · Conor Dooley
Quoted 17 lines · Francesco Dolcini
From: Francesco Dolcini <[email protected]>
Add a compatible string for the SPI loopback device present on the Toradex LAVA HAT test fixture.
The Toradex LAVA HAT is a board used for automated hardware-in-the-loop (HIL) testing, it provides several test-related functionalities, and exists in multiple variants depending on the board it is mated with. The SPI function is implemented with a loopback on the MISO/MOSI signals.
As the device can be fully described using only "compatible" and "reg", it is appropriate to list it under
trivial-devices.yamlrather than introducing a dedicated binding.The SPI implementation is identical across all Toradex LAVA HAT variants, so a single compatible string is sufficient.
Quoted 6 lines
Quoted 3 lines
Acked-by Conor Dooley <[email protected]>pw-bot: not-applicable
Quoted 5 lines
Heh, let's wait. That's a test device, so it won't be ever used in any final product, right? So not in final DTS?
Then why it's here? I think I directed previously to document it with the rest of test devices - in incomplete-devices schema?
Oh it's that, I forgot about this discussion, sorry!
Re: [PATCH v1 1/2] dt-bindings: trivial-devices: add toradex,lava-hat-spi
In reply to Krzysztof KozlowskiQuoted 23 lines · Krzysztof Kozlowski
Quoted 22 lines · Conor Dooley
Quoted 20 lines · Francesco Dolcini
From: Francesco Dolcini <[email protected]>
Add a compatible string for the SPI loopback device present on the Toradex LAVA HAT test fixture.
The Toradex LAVA HAT is a board used for automated hardware-in-the-loop (HIL) testing, it provides several test-related functionalities, and exists in multiple variants depending on the board it is mated with. The SPI function is implemented with a loopback on the MISO/MOSI signals.
As the device can be fully described using only "compatible" and "reg", it is appropriate to list it under
trivial-devices.yamlrather than introducing a dedicated binding.The SPI implementation is identical across all Toradex LAVA HAT variants, so a single compatible string is sufficient.
Quoted 6 lines
Quoted 2 lines
Acked-by Conor Dooley <[email protected]>pw-bot: not-applicable
Heh, let's wait. That's a test device, so it won't be ever used in any final product, right? So not in final DTS?
It will be used in various DT overlay, that I plan to send for inclusion in mainline Linux kernel once we have a way forward. So yes, there will be DTB files using it.
The need is to be able to test SPI with a mainline Linux kernel, so I am looking for a solution that works in mainline Linux.
What is the reason to not wanting to have a DT overlay file for a test device in the Linux kernel? I assume that I would not be able to have an overlay included, if it uses a compatible that is defined in incomplete-devices. This was my understanding from
https://lore.kernel.org/all/[email protected]/
Quoted 2 lines
Then why it's here? I think I directed previously to document it with the rest of test devices - in incomplete-devices schema?
Because, that would not allow to add it to any DT file, from my understanding.
I linked here both the email thread in which we discussed the topic before, and I understood it was ok to send it, given we have an actual HW for it and we plan to submit DT to support it in mainline Linux.
I see we are running in circle, apologize for that. What can I do so that we can move forward?
Francesco
Re: [PATCH v1 1/2] dt-bindings: trivial-devices: add toradex,lava-hat-spi
Quoted 28 lines · Francesco Dolcini
Quoted 27 lines · Krzysztof Kozlowski
Quoted 24 lines · Conor Dooley
Quoted 14 lines · Francesco Dolcini
From: Francesco Dolcini <[email protected]>
Add a compatible string for the SPI loopback device present on the Toradex LAVA HAT test fixture.
The Toradex LAVA HAT is a board used for automated hardware-in-the-loop (HIL) testing, it provides several test-related functionalities, and exists in multiple variants depending on the board it is mated with. The SPI function is implemented with a loopback on the MISO/MOSI signals.
As the device can be fully described using only "compatible" and "reg", it is appropriate to list it under
trivial-devices.yamlrather than introducing a dedicated binding.Quoted 6 lines
The SPI implementation is identical across all Toradex LAVA HAT variants, so a single compatible string is sufficient.
Acked-by Conor Dooley <[email protected]>pw-bot: not-applicable
Quoted 6 lines
Quoted 2 lines
Heh, let's wait. That's a test device, so it won't be ever used in any final product, right? So not in final DTS?
It will be used in various DT overlay, that I plan to send for inclusion in mainline Linux kernel once we have a way forward. So yes, there will be DTB files using it.
Then you need to document it properly and post the DTS.
Toradex LAVA hat is way too generic. No, single compatible string is not sufficient, please read writing bindings.
Please define exact model and variants.
Quoted 3 lines
The need is to be able to test SPI with a mainline Linux kernel, so I am looking for a solution that works in mainline Linux.
incomplete devices do not stop you from that.
But you don't get exceptions because you want to mainline your DTS. Your need detailed hardware description and precise compatible per each exact hat ("exists in multiple variants").
Best regards,
Krzysztof
Re: [PATCH v1 1/2] dt-bindings: trivial-devices: add toradex,lava-hat-spi
Quoted 29 lines · Krzysztof Kozlowski
Quoted 28 lines · Francesco Dolcini
Quoted 27 lines · Krzysztof Kozlowski
Quoted 24 lines · Conor Dooley
Quoted 14 lines · Francesco Dolcini
From: Francesco Dolcini <[email protected]>
Add a compatible string for the SPI loopback device present on the Toradex LAVA HAT test fixture.
The Toradex LAVA HAT is a board used for automated hardware-in-the-loop (HIL) testing, it provides several test-related functionalities, and exists in multiple variants depending on the board it is mated with. The SPI function is implemented with a loopback on the MISO/MOSI signals.
As the device can be fully described using only "compatible" and "reg", it is appropriate to list it under
trivial-devices.yamlrather than introducing a dedicated binding.Quoted 6 lines
The SPI implementation is identical across all Toradex LAVA HAT variants, so a single compatible string is sufficient.
Acked-by Conor Dooley <[email protected]>pw-bot: not-applicable
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Heh, let's wait. That's a test device, so it won't be ever used in any final product, right? So not in final DTS?
It will be used in various DT overlay, that I plan to send for inclusion in mainline Linux kernel once we have a way forward. So yes, there will be DTB files using it.
Then you need to document it properly and post the DTS.
Ok, I will.
I can also post the DTS in the next version. In general, my understanding is that so far when sending a patch to add new compatible you wanted to see a user of it, whatever is a driver or a DTS file. Given we have a driver change for this in this series, I assumed it was ok to not send also a DT file.
Quoted 10 lines
Toradex LAVA hat is way too generic. No, single compatible string is not sufficient, please read writing bindings.
Please define exact model and variants.
Quoted 3 lines
The need is to be able to test SPI with a mainline Linux kernel, so I am looking for a solution that works in mainline Linux.
incomplete devices do not stop you from that.
Do this sentence means that I can send a DT file for inclusion in the Linux kernel using a compatible documented in incomplete-devices?
Quoted 3 lines
But you don't get exceptions because you want to mainline your DTS. Your need detailed hardware description and precise compatible per each exact hat ("exists in multiple variants").
Let me get into more details here, before sending a new patch version.
We have various LAVA HAT devices, the difference is that they provide different features and a different layout, based on the actual carrier board they are mated with.
We have an "Aquila LAVA HAT", that can be mated with the "Aquila Development Board", and a "Verdin LAVA HAT", that can be mated with a "Verdin Dahlia Board".
As an example, you can find the Verdin Dahlia DTS here, ti/k3-am625-verdin-wifi-dahlia.dts, that can be mated with the "Verdin LAVA HAT".
The SPI device on both "Aquila LAVA HAT" and "Verdin LAVA HAT", is the same, no differences. On the Aquila variant we
have two instances of it, while on the Verdin we have only one instance of it.
So, would we need a compatible like this?
compatible = "toradex,aquila-lava-hat-spi", "toradex,lava-hat-spi";
or
compatible = "toradex,verdin-lava-hat-spi", "toradex,lava-hat-spi";
The actual implementation on both the HW devices is the same, so the driver can just probe on "toradex,lava-hat-spi".
Thanks
Francesco
Re: [PATCH v1 1/2] dt-bindings: trivial-devices: add toradex,lava-hat-spi
Quoted 7 lines · Francesco Dolcini
Quoted 7 lines
Toradex LAVA hat is way too generic. No, single compatible string is not sufficient, please read writing bindings.
Please define exact model and variants.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
The need is to be able to test SPI with a mainline Linux kernel, so I am looking for a solution that works in mainline Linux.
incomplete devices do not stop you from that.
Do this sentence means that I can send a DT file for inclusion in the Linux kernel using a compatible documented in incomplete-devices?
No. You will be testing a mainline DTS + load non-mainline overlay. So your requirements of "mainline Linux" are fully solved. Overlay is loaded by bootloader for example and thus your kernel is fully mainline.
Quoted 7 lines
Quoted 4 lines
But you don't get exceptions because you want to mainline your DTS. Your need detailed hardware description and precise compatible per each exact hat ("exists in multiple variants").
Let me get into more details here, before sending a new patch version.
Quoted 7 lines
We have various LAVA HAT devices, the difference is that they provide different features and a different layout, based on the actual carrier board they are mated with.
We have an "Aquila LAVA HAT", that can be mated with the "Aquila Development Board", and a "Verdin LAVA HAT", that can be mated with a "Verdin Dahlia Board".
Of course, because each device is specific so even the hat must be specific, unless you have a standard connector like Arduino or RPi.
Quoted 10 lines
As an example, you can find the Verdin Dahlia DTS here,
ti/k3-am625-verdin-wifi-dahlia.dts, that can be mated with the "Verdin LAVA HAT".The SPI device on both "Aquila LAVA HAT" and "Verdin LAVA HAT", is the same, no differences. On the Aquila variant we
have two instances of it, while on the Verdin we have only one instance of it.
Quoted 7 lines
So, would we need a compatible like this?
compatible = "toradex,aquila-lava-hat-spi", "toradex,lava-hat-spi";
or
compatible = "toradex,verdin-lava-hat-spi", "toradex,lava-hat-spi";
Yes, assuming that verdin/aquila hat works for EVERY verdin/aquila board, regardless what SoM or SoC you have there.
Verdin is a SoM family according to:
https://www.toradex.com/computer-on-modules/verdin-arm-family
and I doubt you can attach hat to a SoM. There is no connector on SoM for the hat... so probably you have a board, like Dahlia.
Best regards,
Krzysztof
Re: [PATCH v1 1/2] dt-bindings: trivial-devices: add toradex,lava-hat-spi
Quoted 11 lines · Krzysztof Kozlowski
Quoted 10 lines · Francesco Dolcini
Quoted 10 lines
Toradex LAVA hat is way too generic. No, single compatible string is not sufficient, please read writing bindings.
Please define exact model and variants.
Quoted 3 lines
The need is to be able to test SPI with a mainline Linux kernel, so I am looking for a solution that works in mainline Linux.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
incomplete devices do not stop you from that.
Do this sentence means that I can send a DT file for inclusion in the Linux kernel using a compatible documented in incomplete-devices?
No. You will be testing a mainline DTS + load non-mainline overlay. So your requirements of "mainline Linux" are fully solved. Overlay is loaded by bootloader for example and thus your kernel is fully mainline.
Ok, I was not clear enough, I am looking to have a solution that is 100% in mainline.
Quoted 29 lines
Quoted 6 lines
Quoted 3 lines
But you don't get exceptions because you want to mainline your DTS. Your need detailed hardware description and precise compatible per each exact hat ("exists in multiple variants").
Let me get into more details here, before sending a new patch version.
Quoted 7 lines
We have various LAVA HAT devices, the difference is that they provide different features and a different layout, based on the actual carrier board they are mated with.
We have an "Aquila LAVA HAT", that can be mated with the "Aquila Development Board", and a "Verdin LAVA HAT", that can be mated with a "Verdin Dahlia Board".
Of course, because each device is specific so even the hat must be specific, unless you have a standard connector like Arduino or RPi.
Quoted 12 lines
As an example, you can find the Verdin Dahlia DTS here,
ti/k3-am625-verdin-wifi-dahlia.dts, that can be mated with the "Verdin LAVA HAT".The SPI device on both "Aquila LAVA HAT" and "Verdin LAVA HAT", is the same, no differences. On the Aquila variant we
have two instances of it, while on the Verdin we have only one instance of it.So, would we need a compatible like this?
Quoted 8 lines
Quoted 5 lines
compatible = "toradex,aquila-lava-hat-spi", "toradex,lava-hat-spi";
or
compatible = "toradex,verdin-lava-hat-spi", "toradex,lava-hat-spi";
Yes, assuming that verdin/aquila hat works for EVERY verdin/aquila board, regardless what SoM or SoC you have there.
This is correct, it's exactly like that.
Quoted 5 lines
Verdin is a SoM family according to:
https://www.toradex.com/computer-on-modules/verdin-arm-familyand I doubt you can attach hat to a SoM. There is no connector on SoM for the hat... so probably you have a board, like Dahlia.
Correct, the HAT is for the carrier, and the carrier is for the family.
With that clarified I plan to send a v2, with something like "toradex,verdin-dahlia-lava-hat-spi", "toradex,lava-hat-spi" (for each carrier board we have) and DTS files where this is used, and properly documenting the compatibility between the various HW devices.
Thanks,
Francesco
PATCH 2/2 spi: spidev: Add Toradex LAVA HAT OF compatible
In reply to Francesco DolciniFrom: Francesco Dolcini <[email protected]>
Add "toradex,lava-hat-spi" OF compatible, that describes the SPI interface implemented in the Toradex LAVA HAT. The Toradex LAVA HAT is a test fixture used in Toradex automated testing lab, it provides various functionality, including SPI MISO-MOSI loopback on various SPI interface.
--- drivers/spi/spidev.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/spi/spidev.c +2 -0
@@ -701,6 +701,7 @@ static const struct spi_device_id spidev_spi_ids[] = { { .name = /* semtech */ "sx1301" }, { .name = /* silabs */ "em3581" }, { .name = /* silabs */ "si3210" }, + { .name = /* toradex */ "lava-hat-spi" }, {}, };MODULE_DEVICE_TABLE (spi, spidev_spi_ids);
@@ -735,6 +736,7 @@ static const struct of_device_id spidev_dt_ids[] = { { .compatible = "semtech,sx1301", .data = &spidev_of_check }, { .compatible = "silabs,em3581", .data = &spidev_of_check }, { .compatible = "silabs,si3210", .data = &spidev_of_check }, + { .compatible = "toradex,lava-hat-spi", .data = &spidev_of_check }, {}, };MODULE_DEVICE_TABLE (of, spidev_dt_ids);
Signature · 1 line
2.47.3