[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 37/42] hw/arm/mps2: Add I2C devices
From: |
Peter Maydell |
Subject: |
[PULL 37/42] hw/arm/mps2: Add I2C devices |
Date: |
Tue, 23 Jun 2020 12:38:59 +0100 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
>From 'Application Note AN385', chapter 3.14:
The SMM implements a simple SBCon interface based on I2C.
There are 4 SBCon interfaces on the FPGA APB subsystem.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20200617072539.32686-13-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/mps2.c | 8 ++++++++
hw/arm/Kconfig | 1 +
2 files changed, 9 insertions(+)
diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
index daa26f68d79..2f6acbf2c21 100644
--- a/hw/arm/mps2.c
+++ b/hw/arm/mps2.c
@@ -40,6 +40,7 @@
#include "hw/misc/mps2-scc.h"
#include "hw/misc/mps2-fpgaio.h"
#include "hw/ssi/pl022.h"
+#include "hw/i2c/arm_sbcon_i2c.h"
#include "hw/net/lan9118.h"
#include "net/net.h"
#include "hw/watchdog/cmsdk-apb-watchdog.h"
@@ -365,6 +366,13 @@ static void mps2_common_init(MachineState *machine)
qdev_get_gpio_in(orgate_dev, j));
}
}
+ for (i = 0; i < 4; i++) {
+ static const hwaddr i2cbase[] = {0x40022000, /* Touch */
+ 0x40023000, /* Audio */
+ 0x40029000, /* Shield0 */
+ 0x4002a000}; /* Shield1 */
+ sysbus_create_simple(TYPE_ARM_SBCON_I2C, i2cbase[i], NULL);
+ }
/* In hardware this is a LAN9220; the LAN9118 is software compatible
* except that it doesn't support the checksum-offload feature.
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 90ed584e7ac..4a224a6351a 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -406,6 +406,7 @@ config MPS2
select SPLIT_IRQ
select UNIMP
select CMSDK_APB_WATCHDOG
+ select VERSATILE_I2C
config FSL_IMX7
bool
--
2.20.1
- [PULL 22/42] target/arm: Convert Neon VTRN to decodetree, (continued)
- [PULL 22/42] target/arm: Convert Neon VTRN to decodetree, Peter Maydell, 2020/06/23
- [PULL 25/42] target/arm: Remove dead code relating to SABA and UABA, Peter Maydell, 2020/06/23
- [PULL 26/42] hw/watchdog/cmsdk-apb-watchdog: Add trace event for lock status, Peter Maydell, 2020/06/23
- [PULL 28/42] hw/i2c/versatile_i2c: Add SCL/SDA definitions, Peter Maydell, 2020/06/23
- [PULL 27/42] hw/i2c/versatile_i2c: Add definitions for register addresses, Peter Maydell, 2020/06/23
- [PULL 30/42] hw/arm: Use TYPE_VERSATILE_I2C instead of hardcoded string, Peter Maydell, 2020/06/23
- [PULL 29/42] hw/i2c: Add header for ARM SBCon two-wire serial bus interface, Peter Maydell, 2020/06/23
- [PULL 31/42] hw/arm/mps2: Document CMSDK/FPGA APB subsystem sections, Peter Maydell, 2020/06/23
- [PULL 34/42] hw/arm/mps2: Add CMSDK AHB GPIO peripherals as unimplemented devices, Peter Maydell, 2020/06/23
- [PULL 36/42] hw/arm/mps2: Add SPI devices, Peter Maydell, 2020/06/23
- [PULL 37/42] hw/arm/mps2: Add I2C devices,
Peter Maydell <=
- [PULL 32/42] hw/arm/mps2: Rename CMSDK AHB peripheral region, Peter Maydell, 2020/06/23
- [PULL 38/42] hw/arm/mps2: Add audio I2S interface as unimplemented device, Peter Maydell, 2020/06/23
- [PULL 39/42] hw/arm/mps2-tz: Use the ARM SBCon two-wire serial bus interface, Peter Maydell, 2020/06/23
- [PULL 41/42] tests/qtest/arm-cpu-features: Add feature setting tests, Peter Maydell, 2020/06/23
- [PULL 40/42] target/arm: Check supported KVM features globally (not per vCPU), Peter Maydell, 2020/06/23
- [PULL 35/42] hw/arm/mps2: Map the FPGA I/O block, Peter Maydell, 2020/06/23
- [PULL 42/42] arm/virt: Add memory hot remove support, Peter Maydell, 2020/06/23
- [PULL 33/42] hw/arm/mps2: Add CMSDK APB watchdog device, Peter Maydell, 2020/06/23
- Re: [PULL 00/42] target-arm queue, no-reply, 2020/06/23
- Re: [PULL 00/42] target-arm queue, Peter Maydell, 2020/06/24