From 8122bb73a48d5c2e376c43c1d5b703516ea944dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lothar=20Wa=C3=9Fmann?= Date: Fri, 1 Jul 2016 16:04:11 +0200 Subject: [PATCH] karo: tx6ul: enable soft i2c driver and 'i2c' command --- board/karo/tx6/Kconfig | 2 ++ board/karo/tx6/tx6ul.c | 2 +- configs/tx6ul-0010_defconfig | 1 + configs/tx6ul-0011_defconfig | 1 + drivers/i2c/Kconfig | 4 ++++ include/configs/tx6.h | 9 ++++----- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/board/karo/tx6/Kconfig b/board/karo/tx6/Kconfig index c01fbd5e82..1121891347 100644 --- a/board/karo/tx6/Kconfig +++ b/board/karo/tx6/Kconfig @@ -54,6 +54,8 @@ config TX6_EMMC config TX6UL bool select SOC_MX6UL + select SYS_I2C + select SYS_I2C_SOFT select SYS_SDRAM_BUS_WIDTH_16 config TX6QP diff --git a/board/karo/tx6/tx6ul.c b/board/karo/tx6/tx6ul.c index dd35076738..1817e2793b 100644 --- a/board/karo/tx6/tx6ul.c +++ b/board/karo/tx6/tx6ul.c @@ -467,7 +467,7 @@ static struct pmic_regs rn5t567_regs[] = { { RN5T567_LDORTC1_SLOT, 0x0f, ~0x3f, }, }; -static int pmic_addr __maybe_unused = 0x33; +static int pmic_addr = 0x33; #endif int board_init(void) diff --git a/configs/tx6ul-0010_defconfig b/configs/tx6ul-0010_defconfig index b0390d7167..550e931aca 100644 --- a/configs/tx6ul-0010_defconfig +++ b/configs/tx6ul-0010_defconfig @@ -13,6 +13,7 @@ CONFIG_CMD_BOOTZ=y CONFIG_CMD_CACHE=y CONFIG_CMD_DHCP=y CONFIG_CMD_FUSE=y +CONFIG_CMD_I2C=y CONFIG_CMD_MEMTEST=y CONFIG_CMD_MEMINFO=y CONFIG_CMD_MII=y diff --git a/configs/tx6ul-0011_defconfig b/configs/tx6ul-0011_defconfig index 478dcd4f14..747cfecdde 100644 --- a/configs/tx6ul-0011_defconfig +++ b/configs/tx6ul-0011_defconfig @@ -14,6 +14,7 @@ CONFIG_CMD_BOOTZ=y CONFIG_CMD_CACHE=y CONFIG_CMD_DHCP=y CONFIG_CMD_FUSE=y +CONFIG_CMD_I2C=y CONFIG_CMD_MEMTEST=y CONFIG_CMD_MEMINFO=y CONFIG_CMD_MII=y diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index fced6ebf94..f0dc19ac08 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig @@ -10,6 +10,10 @@ config HARD_I2C config SYS_I2C bool +config SYS_I2C_SOFT + bool "Software emulated I2C bus driver" + depends on SYS_I2C + config DM_I2C bool "Enable Driver Model for I2C drivers" depends on DM diff --git a/include/configs/tx6.h b/include/configs/tx6.h index d8ab70c31e..e4a2a6c88e 100644 --- a/include/configs/tx6.h +++ b/include/configs/tx6.h @@ -319,22 +319,21 @@ #error Unsupported TX6 module revision #endif #else /* CONFIG_TX6_REV */ -/* autodetect which PMIC is present to derive TX6_REV */ #ifdef CONFIG_SOC_MX6UL -#ifndef CONFIG_TX6_UBOOT_NOENV +#ifdef CONFIG_SYS_I2C_SOFT /* NOENV U-Boot is used for initial bootstrap. * Since the TAMPER_PIN_DISABLE fuses have to be programmed * to be able to use the TAMPER pins as GPIO to access the * PMIC I2C bus, this is not possible on virgin hardware. */ -#define CONFIG_SYS_I2C -#define CONFIG_SYS_I2C_SOFT #define CONFIG_SYS_I2C_SOFT_SPEED 400000 +#define CONFIG_SYS_I2C_SPEED CONFIG_SYS_I2C_SOFT_SPEED #define CONFIG_SOFT_I2C_GPIO_SCL IMX_GPIO_NR(5, 0) #define CONFIG_SOFT_I2C_GPIO_SDA IMX_GPIO_NR(5, 1) #define CONFIG_SOFT_I2C_READ_REPEATED_START -#endif /* CONFIG_TX6_UBOOT_NOENV */ +#endif /* CONFIG_SYS_I2C_SOFT */ #else /* !CONFIG_SOC_MX6UL */ +/* autodetect which PMIC is present to derive TX6_REV */ #define CONFIG_LTC3676 /* TX6_REV == 1 */ #endif /* CONFIG_SOC_MX6UL */ #define CONFIG_RN5T567 /* TX6_REV == 3 */ -- 2.39.2