Skip to content

Commit 93ae0b5

Browse files
tixygalak
authored andcommitted
boards: mps2_an385: Enable I2C devices
The FPGA on the MPS2 board implements 4 SBCon devices for I2C which are connected to: - a touchscreen controller - the audio device (for configuration) - both shield connectors Change-Id: I55ca985e18b45d68f5e7421c4768dfc9bf2fcb3f Signed-off-by: Jon Medhurst <[email protected]>
1 parent a6d59bb commit 93ae0b5

File tree

4 files changed

+45
-1
lines changed

4 files changed

+45
-1
lines changed

arch/arm/soc/arm/mps2/soc_devices.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@
5858
#define CMSDK_APB_DUALTIMER_IRQ IRQ_DUAL_TIMER
5959
#endif /* CONFIG_COUNTER */
6060

61+
#if defined(CONFIG_I2C_SBCON)
62+
#define I2C_SBCON_0_BASE_ADDR I2C_TOUCH_BASE_ADDR
63+
#define I2C_SBCON_1_BASE_ADDR I2C_AUDIO_CONF_BASE_ADDR
64+
#define I2C_SBCON_2_BASE_ADDR I2C_SHIELD0_BASE_ADDR
65+
#define I2C_SBCON_3_BASE_ADDR I2C_SHIELD1_BASE_ADDR
66+
#endif
67+
6168
#ifndef _ASMLANGUAGE
6269

6370
#include "soc_registers.h"

arch/arm/soc/arm/mps2/soc_memory_map.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
#define UART_4_BASE_ADDR (MPS2_APB_BASE_ADDR + 0x9000)
3636

3737
/* MPS2 peripherals in FPGA APB subsystem */
38-
#define FPGAIO_BASE_ADDR (MPS2_FPGA_APB_BASE_ADDR + 0x8000)
38+
#define I2C_TOUCH_BASE_ADDR (MPS2_FPGA_APB_BASE_ADDR + 0x2000)
39+
#define I2C_AUDIO_CONF_BASE_ADDR (MPS2_FPGA_APB_BASE_ADDR + 0x3000)
40+
#define FPGAIO_BASE_ADDR (MPS2_FPGA_APB_BASE_ADDR + 0x8000)
41+
#define I2C_SHIELD0_BASE_ADDR (MPS2_FPGA_APB_BASE_ADDR + 0x9000)
42+
#define I2C_SHIELD1_BASE_ADDR (MPS2_FPGA_APB_BASE_ADDR + 0xa000)
3943

4044
#endif /* _SOC_MEMORY_MAP_H_ */

boards/arm/mps2_an385/Kconfig.defconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,35 @@ endif # TIMER_DTMR_CMSDK_APB
105105

106106
endif # COUNTER
107107

108+
if I2C
109+
110+
config I2C_SBCON
111+
def_bool y
112+
113+
config I2C_SBCON_0
114+
def_bool y
115+
116+
config I2C_SBCON_0_NAME
117+
default I2C_TOUCH
118+
119+
config I2C_SBCON_1
120+
def_bool y
121+
122+
config I2C_SBCON_1_NAME
123+
default I2C_AUDIO_CONF
124+
125+
config I2C_SBCON_2
126+
def_bool y
127+
128+
config I2C_SBCON_2_NAME
129+
default I2C_SHIELD0
130+
131+
config I2C_SBCON_3
132+
def_bool y
133+
134+
config I2C_SBCON_3_NAME
135+
default I2C_SHIELD1
136+
137+
endif # I2C
138+
108139
endif

boards/arm/mps2_an385/mps2_an385_defconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ CONFIG_UART_CONSOLE_ON_DEV_NAME="UART_0"
2828

2929
# Watchdog
3030
CONFIG_WATCHDOG=y
31+
32+
CONFIG_I2C=y

0 commit comments

Comments
 (0)