[PATCH] ARM: imx: mx5: Convert MX53 Menlo board to DM I2C and DM RTC
Marek Vasut
marex at denx.de
Sun May 8 02:19:12 CEST 2022
Convert the board to DM I2C and DM RTC. This leads to removal of board
side iomuxc configuration, which is now done using pin control driver,
and conversion of board side legacy I2C accessors to DM ones.
Signed-off-by: Marek Vasut <marex at denx.de>
Cc: Stefano Babic <sbabic at denx.de>
---
board/menlo/m53menlo/m53menlo.c | 27 +++++++--------------------
configs/m53menlo_defconfig | 8 ++------
2 files changed, 9 insertions(+), 26 deletions(-)
diff --git a/board/menlo/m53menlo/m53menlo.c b/board/menlo/m53menlo/m53menlo.c
index 9545e633a3d..61ab3844b87 100644
--- a/board/menlo/m53menlo/m53menlo.c
+++ b/board/menlo/m53menlo/m53menlo.c
@@ -226,16 +226,21 @@ static const char *lvds_compat_string;
static int detect_lvds(struct display_info_t const *dev)
{
+ struct udevice *idev, *ibus;
u8 touchid[23];
u8 *touchptr = &touchid[0];
int ret;
- ret = i2c_set_bus_num(0);
+ ret = uclass_get_device_by_seq(UCLASS_I2C, 0, &ibus);
+ if (ret)
+ return 0;
+
+ ret = dm_i2c_probe(ibus, 0x38, 0, &idev);
if (ret)
return 0;
/* Touchscreen is at address 0x38, ID register is 0xbb. */
- ret = i2c_read(0x38, 0xbb, 1, touchid, sizeof(touchid));
+ ret = dm_i2c_read(idev, 0xbb, touchid, sizeof(touchid));
if (ret)
return 0;
@@ -385,23 +390,6 @@ splasherr:
return 0;
}
-#define I2C_PAD_CTRL (PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | \
- PAD_CTL_PUS_100K_UP | PAD_CTL_ODE)
-
-static void setup_iomux_i2c(void)
-{
- static const iomux_v3_cfg_t i2c_pads[] = {
- /* I2C1 */
- NEW_PAD_CTRL(MX53_PAD_EIM_D28__I2C1_SDA, I2C_PAD_CTRL),
- NEW_PAD_CTRL(MX53_PAD_EIM_D21__I2C1_SCL, I2C_PAD_CTRL),
- /* I2C2 */
- NEW_PAD_CTRL(MX53_PAD_EIM_D16__I2C2_SDA, I2C_PAD_CTRL),
- NEW_PAD_CTRL(MX53_PAD_EIM_EB2__I2C2_SCL, I2C_PAD_CTRL),
- };
-
- imx_iomux_v3_setup_multiple_pads(i2c_pads, ARRAY_SIZE(i2c_pads));
-}
-
static void setup_iomux_video(void)
{
static const iomux_v3_cfg_t lcd_pads[] = {
@@ -505,7 +493,6 @@ int board_early_init_f(void)
{
setup_iomux_uart();
setup_iomux_fec();
- setup_iomux_i2c();
setup_iomux_nand();
setup_iomux_video();
diff --git a/configs/m53menlo_defconfig b/configs/m53menlo_defconfig
index df4907a8263..90d3e59e57d 100644
--- a/configs/m53menlo_defconfig
+++ b/configs/m53menlo_defconfig
@@ -11,9 +11,6 @@ CONFIG_NR_DRAM_BANKS=2
CONFIG_ENV_SIZE=0x4000
CONFIG_ENV_OFFSET=0x100000
CONFIG_TARGET_M53MENLO=y
-CONFIG_SYS_I2C_MXC_I2C1=y
-CONFIG_SYS_I2C_MXC_I2C2=y
-CONFIG_SYS_I2C_MXC_I2C3=y
CONFIG_DM_GPIO=y
CONFIG_DEFAULT_DEVICE_TREE="imx53-m53menlo"
CONFIG_SPL_TEXT_BASE=0x70008000
@@ -53,7 +50,6 @@ CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
CONFIG_CMD_BMP=y
CONFIG_CMD_BOOTCOUNT=y
-CONFIG_CMD_DATE=y
CONFIG_CMD_BTRFS=y
CONFIG_CMD_EXT4=y
CONFIG_CMD_EXT4_WRITE=y
@@ -75,8 +71,7 @@ CONFIG_VERSION_VARIABLE=y
CONFIG_DM=y
CONFIG_BOOTCOUNT_LIMIT=y
CONFIG_SYS_BOOTCOUNT_MAGIC=0x0B01C041
-CONFIG_SYS_I2C_LEGACY=y
-CONFIG_SPL_SYS_I2C_LEGACY=y
+CONFIG_DM_I2C=y
CONFIG_SYS_I2C_MXC=y
CONFIG_FSL_ESDHC_IMX=y
CONFIG_MTD=y
@@ -102,6 +97,7 @@ CONFIG_PINCTRL_IMX5=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_RTC=y
CONFIG_RTC_M41T62=y
CONFIG_MXC_UART=y
CONFIG_SYSRESET=y
--
2.35.1
More information about the U-Boot
mailing list