soc: stm32mp157: add I2c support

Add I2C support and I2C5 configuration for arduino connector.

Signed-off-by: Christophe Priouzeau <christophe.priouzeau@linaro.org>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@linaro.org>
This commit is contained in:
Christophe Priouzeau 2019-06-25 08:54:37 +02:00 committed by Kumar Gala
commit 83fb969cfb
4 changed files with 37 additions and 1 deletions

View file

@ -9,6 +9,7 @@
#include <arm/armv7-m.dtsi>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/clock/stm32_clock.h>
#include <dt-bindings/i2c/i2c.h>
/ {
cpus {
@ -210,6 +211,19 @@
label = "UART_8";
};
i2c5: i2c@40015000 {
compatible = "st,stm32-i2c-v2";
clock-frequency = <I2C_BITRATE_STANDARD>;
reg = <0x40015000 0x400>;
#address-cells = <1>;
#size-cells = <0>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x01000000>;
interrupt-names = "event", "error";
interrupts = <107 0>, <108 0>;
status = "disabled";
label = "I2C_5";
};
mailbox: mailbox@4c001000 {
compatible = "st,stm32-ipcc-mailbox";
reg = <0x4c001000 0x400>;
@ -219,7 +233,6 @@
status = "disabled";
label = "MAILBOX_0";
};
};
};

View file

@ -47,4 +47,11 @@ config IPM_STM32_IPCC
endif # IPM
if I2C_STM32
config I2C_STM32_V2
default y
endif # I2C_STM32
endif # SOC_SERIES_STM32MP1X

View file

@ -313,4 +313,16 @@
DT_ST_STM32_UART_40019000_CLOCK_BUS
#define DT_UART_STM32_UART_8_HW_FLOW_CONTROL \
DT_ST_STM32_UART_40019000_HW_FLOW_CONTROL
#define DT_I2C_5_BASE_ADDRESS DT_ST_STM32_I2C_V2_40015000_BASE_ADDRESS
#define DT_I2C_5_EVENT_IRQ_PRI DT_ST_STM32_I2C_V2_40015000_IRQ_EVENT_PRIORITY
#define DT_I2C_5_ERROR_IRQ_PRI DT_ST_STM32_I2C_V2_40015000_IRQ_ERROR_PRIORITY
#define CONFIG_I2C_5_NAME DT_ST_STM32_I2C_V2_40015000_LABEL
#define DT_I2C_5_EVENT_IRQ DT_ST_STM32_I2C_V2_40015000_IRQ_EVENT
#define DT_I2C_5_ERROR_IRQ DT_ST_STM32_I2C_V2_40015000_IRQ_ERROR
#define DT_I2C_5_BITRATE DT_ST_STM32_I2C_V2_40015000_CLOCK_FREQUENCY
#define DT_I2C_5_CLOCK_BITS DT_ST_STM32_I2C_V2_40015000_CLOCK_BITS
#define DT_I2C_5_CLOCK_BUS DT_ST_STM32_I2C_V2_40015000_CLOCK_BUS
/* End of SoC Level DTS fixup file */

View file

@ -50,6 +50,10 @@
#include <stm32mp1xx_ll_ipcc.h>
#endif
#ifdef CONFIG_I2C
#include <stm32mp1xx_ll_i2c.h>
#endif
#endif /* !_ASMLANGUAGE */
#endif /* _STM32MP1SOC_H_ */