stm32/l1: enable spi peripherals

STM32L1 uses the same spi controller as STM32F1 so we can just set the
right addresses and enable them. We also need to add the fixup names and
to correctly include the header for ST LL HAL.

Signed-off-by: Karl Palsson <karlp@etactica.com>
This commit is contained in:
Karl Palsson 2019-10-03 20:57:43 +00:00 committed by Maureen Helm
commit d46c1a0c98
3 changed files with 40 additions and 0 deletions

View file

@ -72,6 +72,28 @@
label= "I2C_2";
};
spi1: spi@40013000 {
compatible = "st,stm32-spi";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x40013000 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00001000>;
interrupts = <35 0>;
status = "disabled";
label = "SPI_1";
};
spi2: spi@40003800 {
compatible = "st,stm32-spi";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x40003800 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00004000>;
interrupts = <36 0>;
status = "disabled";
label = "SPI_2";
};
usart1: serial@40013800 {
compatible = "st,stm32-usart", "st,stm32-uart";
reg = <0x40013800 0x400>;

View file

@ -109,6 +109,20 @@
#define DT_I2C_2_CLOCK_BITS DT_ST_STM32_I2C_V1_40005800_CLOCK_BITS
#define DT_I2C_2_CLOCK_BUS DT_ST_STM32_I2C_V1_40005800_CLOCK_BUS
#define DT_SPI_1_BASE_ADDRESS DT_ST_STM32_SPI_40013000_BASE_ADDRESS
#define DT_SPI_1_IRQ_PRI DT_ST_STM32_SPI_40013000_IRQ_0_PRIORITY
#define DT_SPI_1_NAME DT_ST_STM32_SPI_40013000_LABEL
#define DT_SPI_1_IRQ DT_ST_STM32_SPI_40013000_IRQ_0
#define DT_SPI_1_CLOCK_BITS DT_ST_STM32_SPI_40013000_CLOCK_BITS
#define DT_SPI_1_CLOCK_BUS DT_ST_STM32_SPI_40013000_CLOCK_BUS
#define DT_SPI_2_BASE_ADDRESS DT_ST_STM32_SPI_40003800_BASE_ADDRESS
#define DT_SPI_2_IRQ_PRI DT_ST_STM32_SPI_40003800_IRQ_0_PRIORITY
#define DT_SPI_2_NAME DT_ST_STM32_SPI_40003800_LABEL
#define DT_SPI_2_IRQ DT_ST_STM32_SPI_40003800_IRQ_0
#define DT_SPI_2_CLOCK_BITS DT_ST_STM32_SPI_40003800_CLOCK_BITS
#define DT_SPI_2_CLOCK_BUS DT_ST_STM32_SPI_40003800_CLOCK_BUS
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0

View file

@ -51,6 +51,10 @@
#include <stm32l1xx_ll_i2c.h>
#endif
#ifdef CONFIG_SPI_STM32
#include <stm32l1xx_ll_spi.h>
#endif
#ifdef CONFIG_WWDG_STM32
#include <stm32l1xx_ll_wwdg.h>
#endif