Skip to content

Commit 2314a65

Browse files
committed
boards: efr32mg_sltb004a: Add support for spi nor flash
This commit adds support for the on-board flash MX25R8035F that is directly connected to the efr32mg soc. Signed-off-by: Christian Taedcke <[email protected]>
1 parent 5222e00 commit 2314a65

File tree

6 files changed

+47
-0
lines changed

6 files changed

+47
-0
lines changed

boards/arm/efr32mg_sltb004a/Kconfig.defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ config GPIO_GECKO_PORTD
2727
config GPIO_GECKO_PORTF
2828
default y
2929

30+
config GPIO_GECKO_PORTK
31+
default y
32+
3033
endif # GPIO_GECKO
3134

3235
if COUNTER

boards/arm/efr32mg_sltb004a/doc/index.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ The efr32mg_sltb004a board configuration supports the following hardware feature
7474
+-----------+------------+-------------------------------------+
7575
| I2C | on-chip | i2c port-polling |
7676
+-----------+------------+-------------------------------------+
77+
| SPI(M) | on-chip | spi port-polling |
78+
+-----------+------------+-------------------------------------+
7779

7880
The default configuration can be found in the defconfig file:
7981
``boards/arm/efr32mg_sltb004a/efr32mg_sltb004a_defconfig``.
@@ -117,6 +119,14 @@ in the board's and microcontroller's datasheets and manuals.
117119
+------+-------------+-----------------------------------+
118120
| PC5 | I2C_SCL | ENV_I2C_SCL I2C1_SCL #17 |
119121
+------+-------------+-----------------------------------+
122+
| PK0 | SPI_MOSI | Flash MOSI US2_TX #29 |
123+
+------+-------------+-----------------------------------+
124+
| PK2 | SPI_MISO | Flash MISO US2_RX #30 |
125+
+------+-------------+-----------------------------------+
126+
| PF7 | SPI_SCLK | Flash SCLK US2_CLK #18 |
127+
+------+-------------+-----------------------------------+
128+
| PK1 | SPI_CS | Flash Chip Select (GPIO) |
129+
+------+-------------+-----------------------------------+
120130

121131
System Clock
122132
============

boards/arm/efr32mg_sltb004a/efr32mg_sltb004a.dts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,31 @@
6363
status = "okay";
6464
};
6565

66+
&usart2 {
67+
compatible = "silabs,gecko-spi-usart";
68+
69+
#address-cells = <1>;
70+
#size-cells = <0>;
71+
72+
location-rx = <GECKO_LOCATION(30) GECKO_PORT_K GECKO_PIN(2)>;
73+
location-tx = <GECKO_LOCATION(29) GECKO_PORT_K GECKO_PIN(0)>;
74+
location-clk = <GECKO_LOCATION(18) GECKO_PORT_F GECKO_PIN(7)>;
75+
76+
cs-gpios = <&gpiok 1 0>;
77+
78+
status = "okay";
79+
80+
mx25r80: mx25r8035f@0 {
81+
compatible = "jedec,spi-nor";
82+
label = "MX25R8035F";
83+
reg = <0>;
84+
spi-max-frequency = <80000000>;
85+
size = <0x800000>;
86+
has-be32k;
87+
jedec-id = [c2 28 14];
88+
};
89+
};
90+
6691
&leuart0 {
6792
current-speed = <9600>;
6893
location-rx = <GECKO_LOCATION(27) GECKO_PORT_F GECKO_PIN(4)>;

boards/arm/efr32mg_sltb004a/efr32mg_sltb004a.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ supported:
1212
- gpio
1313
- i2c
1414
- nvs
15+
- spi
1516
testing:
1617
ignore_tags:
1718
- net

boards/arm/efr32mg_sltb004a/efr32mg_sltb004a_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CONFIG_I2C=y
99
CONFIG_CONSOLE=y
1010
CONFIG_UART_CONSOLE=y
1111
CONFIG_SERIAL=y
12+
CONFIG_SPI=y
1213
CONFIG_CORTEX_M_SYSTICK=y
1314
CONFIG_GPIO=y
1415
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=38400000

soc/arm/silabs_exx32/efr32mg12p/Kconfig.defconfig.efr32mg12p

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,10 @@ config SOC_FLASH_GECKO
3636
default y
3737

3838
endif # FLASH
39+
40+
if SPI
41+
42+
config SPI_GECKO
43+
default y
44+
45+
endif # SPI

0 commit comments

Comments
 (0)