Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions boards/arm/efr32_slwstk6061a/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ The efr32_slwstk6061a board configuration supports the following hardware featur
| UART | on-chip | serial port-polling; |
| | | serial port-interrupt |
+-----------+------------+-------------------------------------+
| SPI(M) | on-chip | spi port-polling |
+-----------+------------+-------------------------------------+

The default configuration can be found in the defconfig file:

Expand Down Expand Up @@ -103,6 +105,14 @@ means Pin number 2 on PORTA, as used in the board's datasheets and manuals.
+-------+-------------+-------------------------------------+
| PA1 | USART0_RX | UART Console EFM_BC_RX US0_RX #0 |
+-------+-------------+-------------------------------------+
| PC6 | SPI_MOSI | Flash MOSI US1_TX #11 |
+-------+-------------+-------------------------------------+
| PC7 | SPI_MISO | Flash MISO US1_RX #11 |
+-------+-------------+-------------------------------------+
| PC8 | SPI_SCLK | Flash SCLK US1_CLK #11 |
+-------+-------------+-------------------------------------+
| PA4 | SPI_CS | Flash Chip Select (GPIO) |
+-------+-------------+-------------------------------------+

System Clock
============
Expand Down
25 changes: 25 additions & 0 deletions boards/arm/efr32_slwstk6061a/efr32_slwstk6061a.dts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,31 @@
status = "okay";
};

&usart1 {
compatible = "silabs,gecko-spi-usart";

#address-cells = <1>;
#size-cells = <0>;

location-rx = <GECKO_LOCATION(11) GECKO_PORT_C GECKO_PIN(7)>;
location-tx = <GECKO_LOCATION(11) GECKO_PORT_C GECKO_PIN(6)>;
location-clk = <GECKO_LOCATION(11) GECKO_PORT_C GECKO_PIN(8)>;

cs-gpios = <&gpioa 4 0>;

status = "okay";

mx25r80: mx25r8035f@0 {
compatible = "jedec,spi-nor";
label = "MX25R8035F";
reg = <0>;
spi-max-frequency = <80000000>;
size = <0x800000>;
has-be32k;
jedec-id = [c2 28 14];
};
};

&rtcc0 {
prescaler = <1>;
status = "okay";
Expand Down
1 change: 1 addition & 0 deletions boards/arm/efr32_slwstk6061a/efr32_slwstk6061a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ toolchain:
supported:
- gpio
- nvs
- spi
testing:
ignore_tags:
- net
Expand Down
3 changes: 3 additions & 0 deletions boards/arm/efr32mg_sltb004a/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ config GPIO_GECKO_PORTD
config GPIO_GECKO_PORTF
default y

config GPIO_GECKO_PORTK
default y

endif # GPIO_GECKO

if COUNTER
Expand Down
10 changes: 10 additions & 0 deletions boards/arm/efr32mg_sltb004a/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ The efr32mg_sltb004a board configuration supports the following hardware feature
+-----------+------------+-------------------------------------+
| I2C | on-chip | i2c port-polling |
+-----------+------------+-------------------------------------+
| SPI(M) | on-chip | spi port-polling |
Copy link
Contributor

@dbkinder dbkinder Oct 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the significance of the (M) notation? Master? Can this just be SPI or if the M is important it should be explained?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it means master. Slave-mode is not implemented by this driver. I copied the notation from https://docs.zephyrproject.org/latest/boards/arm/nrf52840_pca10059/doc/index.html#supported-features which contains SPI (M/S).
I do not know what the preferred way for this is. I can also remove the (M).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you think technical folks will know what this means, then it's OK by me. Otherwise, maybe say ```SPI Master`` to be clear.

+-----------+------------+-------------------------------------+

The default configuration can be found in the defconfig file:
``boards/arm/efr32mg_sltb004a/efr32mg_sltb004a_defconfig``.
Expand Down Expand Up @@ -119,6 +121,14 @@ in the board's and microcontroller's datasheets and manuals.
+------+-------------+-----------------------------------+
| PC5 | I2C_SCL | ENV_I2C_SCL I2C1_SCL #17 |
+------+-------------+-----------------------------------+
| PK0 | SPI_MOSI | Flash MOSI US2_TX #29 |
+------+-------------+-----------------------------------+
| PK2 | SPI_MISO | Flash MISO US2_RX #30 |
+------+-------------+-----------------------------------+
| PF7 | SPI_SCLK | Flash SCLK US2_CLK #18 |
+------+-------------+-----------------------------------+
| PK1 | SPI_CS | Flash Chip Select (GPIO) |
+------+-------------+-----------------------------------+

System Clock
============
Expand Down
25 changes: 25 additions & 0 deletions boards/arm/efr32mg_sltb004a/efr32mg_sltb004a.dts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,31 @@
status = "okay";
};

&usart2 {
compatible = "silabs,gecko-spi-usart";

#address-cells = <1>;
#size-cells = <0>;

location-rx = <GECKO_LOCATION(30) GECKO_PORT_K GECKO_PIN(2)>;
location-tx = <GECKO_LOCATION(29) GECKO_PORT_K GECKO_PIN(0)>;
location-clk = <GECKO_LOCATION(18) GECKO_PORT_F GECKO_PIN(7)>;

cs-gpios = <&gpiok 1 0>;

status = "okay";

mx25r80: mx25r8035f@0 {
compatible = "jedec,spi-nor";
label = "MX25R8035F";
reg = <0>;
spi-max-frequency = <80000000>;
size = <0x800000>;
has-be32k;
jedec-id = [c2 28 14];
};
};

&leuart0 {
current-speed = <9600>;
location-rx = <GECKO_LOCATION(27) GECKO_PORT_F GECKO_PIN(4)>;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/efr32mg_sltb004a/efr32mg_sltb004a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ supported:
- gpio
- i2c
- nvs
- spi
testing:
ignore_tags:
- net
Expand Down
1 change: 1 addition & 0 deletions drivers/spi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ zephyr_library_sources_ifdef(CONFIG_NRFX_SPIS spi_nrfx_spis.c)
zephyr_library_sources_ifdef(CONFIG_SPI_LITESPI spi_litespi.c)
zephyr_library_sources_ifdef(CONFIG_SPI_OC_SIMPLE spi_oc_simple.c)
zephyr_library_sources_ifdef(CONFIG_SPI_XEC_QMSPI spi_xec_qmspi.c)
zephyr_library_sources_ifdef(CONFIG_SPI_GECKO spi_gecko.c)

zephyr_library_sources_ifdef(CONFIG_USERSPACE spi_handlers.c)
2 changes: 2 additions & 0 deletions drivers/spi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,6 @@ source "drivers/spi/Kconfig.oc_simple"

source "drivers/spi/Kconfig.xec_qmspi"

source "drivers/spi/Kconfig.gecko"

endif # SPI
14 changes: 14 additions & 0 deletions drivers/spi/Kconfig.gecko
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Kconfig.gecko - Gecko SPI configuration option
#
# Copyright (c) 2019 Christian Taedcke <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0
#

menuconfig SPI_GECKO
bool "Gecko SPI controller driver"
depends on HAS_SILABS_GECKO
depends on GPIO_GECKO
select SOC_GECKO_USART
help
Enable the SPI peripherals on Gecko
Loading