zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.83k stars 6.6k forks source link

Add dts support to SPI slave drivers & tests #10894

Closed galak closed 5 years ago

galak commented 6 years ago

Issue #10636 exposed a problem that a few cases that SPI slave drivers aren't converted to DTS. Doing a grep in the tree for SPI_._NAME or SPI_DRV_NAME or spi_config we come up with:

tests/drivers/spi/spi_loopback/Kconfig: default SPI_1_NAME

We need to convert these slave drivers to use DTS.

I'm working on it. So far I found only one thing that is missing on the master side (in drivers/bluetooth/hci/spi.c). The CS line is not asserted in the general case, there is only some specific steering of it for BlueNRG. But it's not that trivial to get this information from DTS since this line may be (at least for Nordic SoCs it is) configured in cs-gpios property in the parent node. Configuration of other settings is already in place (through the "zephyr,bt-hci-spi" node). On the slave side (in samples/bluetooth/hci_spi) to get the relevant settings I will follow the way you started in galak@f30bc9e, but I think that instead of adding the spi-slave property and setting #address-cells to 0 I will use a separate binding for "nordic,nrf-spis" node that will inherit from "spi-device". But first I need to make the hci_spi example working. Currently it is not handling correctly SPI transactions as it does not configure SPI to work in the slave mode, so the whole communication does not start. But even after I corrected this I still get some "invalid message type" errors. I need to debug it further.

Any update on this?

galak commented 6 years ago

@vanwinkeljan can you look at adding DTS support to drivers/display/display_ili9340.c. Thanks.

galak commented 6 years ago

@mbolivar can you add dts support to WS2812 & LPD880x

galak commented 6 years ago

@tbursztyka can you look at converting adc_ti_adc108s102 to device tree.

galak commented 6 years ago

@tbursztyka can you look at winc1500 & eth_enc28j60 as well?

galak commented 6 years ago

@mbolivar can you add dts support to WS2812 & LPD880x

Any update? This drivers will soon not be usable once all SPI controllers use DTS.

galak commented 6 years ago

@agansari can you look at converting the eth_enc28j60 driver over to use DTS.

galak commented 6 years ago

PR #11165 to convert over BMI160 Sensor

carlescufi commented 5 years ago

@anangl have you taken a look at drivers/bluetooth/hci/spi.c ?

galak commented 5 years ago

@mbolivar any updates on the LED drivers?

galak commented 5 years ago

@anangl have you taken a look at drivers/bluetooth/hci/spi.c ?

@anangl / @carlescufi any update?

carlescufi commented 5 years ago

@galak not from me, no. I hope that @anangl can update us.

anangl commented 5 years ago

@galak

@anangl have you taken a look at drivers/bluetooth/hci/spi.c ?

@anangl / @carlescufi any update?

I'm working on it. So far I found only one thing that is missing on the master side (in drivers/bluetooth/hci/spi.c). The CS line is not asserted in the general case, there is only some specific steering of it for BlueNRG. But it's not that trivial to get this information from DTS since this line may be (at least for Nordic SoCs it is) configured in cs-gpios property in the parent node. Configuration of other settings is already in place (through the "zephyr,bt-hci-spi" node). On the slave side (in samples/bluetooth/hci_spi) to get the relevant settings I will follow the way you started in https://github.com/galak/zephyr/commit/f30bc9ea7033a1b63d5dde87ae765f2130050128, but I think that instead of adding the spi-slave property and setting #address-cells to 0 I will use a separate binding for "nordic,nrf-spis" node that will inherit from "spi-device". But first I need to make the hci_spi example working. Currently it is not handling correctly SPI transactions as it does not configure SPI to work in the slave mode, so the whole communication does not start. But even after I corrected this I still get some "invalid message type" errors. I need to debug it further.

galak commented 5 years ago

Converted BME280 in PR #12496

anangl commented 5 years ago

@galak

@anangl have you taken a look at drivers/bluetooth/hci/spi.c ?

@anangl / @carlescufi any update?

Created PR #12927 to address the issue in HCI SPI driver.

galak commented 5 years ago

PR #14187 handles the last reference, otherwise all controllers and spi clients are using DTS so closing this out.