From 38a69e96b39adb6f47baaa272f266b1fa1be512e Mon Sep 17 00:00:00 2001 From: Vipul Kumar Date: Fri, 16 Feb 2018 19:07:17 +0530 Subject: [PATCH 1/9] i2c: Added Kconfig support for CONFIG_SYS_I2C_ZYNQ This patch added Kconfig support for CONFIG_SYS_I2C_ZYNQ. Signed-off-by: Vipul Kumar Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- drivers/i2c/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index 9d43690503..1c8b8f7b3e 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig @@ -268,6 +268,12 @@ config SYS_I2C_BUS_MAX help Define the maximum number of available I2C buses. +config SYS_I2C_ZYNQ + bool "Xilinx I2C driver" + depends on ARCH_ZYNQMP || ARCH_ZYNQ + help + Support for Xilinx I2C controller. + config SYS_I2C_IHS bool "gdsys IHS I2C driver" depends on DM_I2C From fc3a6f1c53460ef383d9c51785db37a951965f9c Mon Sep 17 00:00:00 2001 From: Vipul Kumar Date: Fri, 16 Feb 2018 19:07:18 +0530 Subject: [PATCH 2/9] i2c: Enabled CONFIG_SYS_I2C_ZYNQ in the respective defconfig This patch enabled CONFIG_SYS_I2C_ZYNQ in the respective defconfig. Signed-off-by: Vipul Kumar Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- configs/syzygy_hub_defconfig | 1 + configs/topic_miami_defconfig | 1 + configs/topic_miamilite_defconfig | 1 + configs/topic_miamiplus_defconfig | 1 + configs/xilinx_zynqmp_zcu102_rev1_0_defconfig | 1 + configs/xilinx_zynqmp_zcu102_revA_defconfig | 1 + configs/xilinx_zynqmp_zcu102_revB_defconfig | 1 + configs/zynq_zc702_defconfig | 1 + configs/zynq_zc706_defconfig | 1 + configs/zynq_zybo_defconfig | 1 + include/configs/xilinx_zynqmp_zcu102.h | 1 - include/configs/zynq-common.h | 4 ---- 12 files changed, 10 insertions(+), 5 deletions(-) diff --git a/configs/syzygy_hub_defconfig b/configs/syzygy_hub_defconfig index 8f06465f6e..019088410d 100644 --- a/configs/syzygy_hub_defconfig +++ b/configs/syzygy_hub_defconfig @@ -35,6 +35,7 @@ CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y +CONFIG_SYS_I2C_ZYNQ=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y CONFIG_PHY_MARVELL=y diff --git a/configs/topic_miami_defconfig b/configs/topic_miami_defconfig index d47d6f8a6f..9bf187b2dc 100644 --- a/configs/topic_miami_defconfig +++ b/configs/topic_miami_defconfig @@ -32,6 +32,7 @@ CONFIG_DFU_RAM=y CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y +CONFIG_SYS_I2C_ZYNQ=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y CONFIG_SPI_FLASH=y diff --git a/configs/topic_miamilite_defconfig b/configs/topic_miamilite_defconfig index ae33fc445b..31386a5e81 100644 --- a/configs/topic_miamilite_defconfig +++ b/configs/topic_miamilite_defconfig @@ -32,6 +32,7 @@ CONFIG_DFU_RAM=y CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y +CONFIG_SYS_I2C_ZYNQ=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y CONFIG_SPI_FLASH=y diff --git a/configs/topic_miamiplus_defconfig b/configs/topic_miamiplus_defconfig index 496c43eac8..82674a9191 100644 --- a/configs/topic_miamiplus_defconfig +++ b/configs/topic_miamiplus_defconfig @@ -30,6 +30,7 @@ CONFIG_DFU_RAM=y CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y +CONFIG_SYS_I2C_ZYNQ=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y CONFIG_SPI_FLASH=y diff --git a/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig b/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig index d0a1467501..12a0d645ac 100644 --- a/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig +++ b/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig @@ -53,6 +53,7 @@ CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQMPPL=y CONFIG_DM_GPIO=y CONFIG_CMD_PCA953X=y +CONFIG_SYS_I2C_ZYNQ=y CONFIG_MISC=y CONFIG_DM_MMC=y CONFIG_MMC_SDHCI=y diff --git a/configs/xilinx_zynqmp_zcu102_revA_defconfig b/configs/xilinx_zynqmp_zcu102_revA_defconfig index ecefb00ada..b6e8a0e01c 100644 --- a/configs/xilinx_zynqmp_zcu102_revA_defconfig +++ b/configs/xilinx_zynqmp_zcu102_revA_defconfig @@ -53,6 +53,7 @@ CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQMPPL=y CONFIG_DM_GPIO=y CONFIG_CMD_PCA953X=y +CONFIG_SYS_I2C_ZYNQ=y CONFIG_MISC=y CONFIG_DM_MMC=y CONFIG_MMC_SDHCI=y diff --git a/configs/xilinx_zynqmp_zcu102_revB_defconfig b/configs/xilinx_zynqmp_zcu102_revB_defconfig index c2add99841..c5bc4cdb63 100644 --- a/configs/xilinx_zynqmp_zcu102_revB_defconfig +++ b/configs/xilinx_zynqmp_zcu102_revB_defconfig @@ -53,6 +53,7 @@ CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQMPPL=y CONFIG_DM_GPIO=y CONFIG_CMD_PCA953X=y +CONFIG_SYS_I2C_ZYNQ=y CONFIG_MISC=y CONFIG_DM_MMC=y CONFIG_MMC_SDHCI=y diff --git a/configs/zynq_zc702_defconfig b/configs/zynq_zc702_defconfig index c6a789317d..f2be8d302a 100644 --- a/configs/zynq_zc702_defconfig +++ b/configs/zynq_zc702_defconfig @@ -41,6 +41,7 @@ CONFIG_DFU_RAM=y CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y +CONFIG_SYS_I2C_ZYNQ=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y CONFIG_SPI_FLASH=y diff --git a/configs/zynq_zc706_defconfig b/configs/zynq_zc706_defconfig index 665b4d3fd0..9197aeb7d1 100644 --- a/configs/zynq_zc706_defconfig +++ b/configs/zynq_zc706_defconfig @@ -41,6 +41,7 @@ CONFIG_DFU_RAM=y CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y +CONFIG_SYS_I2C_ZYNQ=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y CONFIG_SPI_FLASH=y diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig index 2a45ceeb2c..57b39a282f 100644 --- a/configs/zynq_zybo_defconfig +++ b/configs/zynq_zybo_defconfig @@ -40,6 +40,7 @@ CONFIG_DFU_RAM=y CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y +CONFIG_SYS_I2C_ZYNQ=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y CONFIG_SPI_FLASH=y diff --git a/include/configs/xilinx_zynqmp_zcu102.h b/include/configs/xilinx_zynqmp_zcu102.h index 85f78ba43b..88819c6cc1 100644 --- a/include/configs/xilinx_zynqmp_zcu102.h +++ b/include/configs/xilinx_zynqmp_zcu102.h @@ -36,7 +36,6 @@ {1, {{I2C_MUX_PCA9548, 0x75, 7} } }, \ } -#define CONFIG_SYS_I2C_ZYNQ #define CONFIG_PCA953X #define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR} diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index 6f9c1535b0..07b121d7d6 100644 --- a/include/configs/zynq-common.h +++ b/include/configs/zynq-common.h @@ -117,10 +117,6 @@ # define DFU_ALT_INFO #endif -#if defined(CONFIG_ZYNQ_I2C0) || defined(CONFIG_ZYNQ_I2C1) -#define CONFIG_SYS_I2C_ZYNQ -#endif - /* I2C */ #if defined(CONFIG_SYS_I2C_ZYNQ) # define CONFIG_SYS_I2C From e7affad190fcebcb2c93eed97ae4a74d947cb14d Mon Sep 17 00:00:00 2001 From: Vipul Kumar Date: Fri, 16 Feb 2018 19:07:19 +0530 Subject: [PATCH 3/9] i2c: Added Kconfig support for CONFIG_SYS_I2C_ZYNQ_SLAVE This patch added Kconfig support for CONFIG_SYS_I2C_ZYNQ_SLAVE and set it default to 0. Signed-off-by: Vipul Kumar Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- drivers/i2c/Kconfig | 7 +++++++ include/configs/xilinx_zynqmp.h | 1 - include/configs/zynq-common.h | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index 1c8b8f7b3e..6200f1c1e1 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig @@ -274,6 +274,13 @@ config SYS_I2C_ZYNQ help Support for Xilinx I2C controller. +config SYS_I2C_ZYNQ_SLAVE + hex "Set slave addr" + depends on SYS_I2C_ZYNQ + default 0 + help + Set CONFIG_SYS_I2C_ZYNQ_SLAVE for slave addr. + config SYS_I2C_IHS bool "gdsys IHS I2C driver" depends on DM_I2C diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 52baa42a2f..20ff1136ba 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -127,7 +127,6 @@ #if defined(CONFIG_SYS_I2C_ZYNQ) # define CONFIG_SYS_I2C # define CONFIG_SYS_I2C_ZYNQ_SPEED 100000 -# define CONFIG_SYS_I2C_ZYNQ_SLAVE 0 #endif /* EEPROM */ diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index 07b121d7d6..cf37f84e28 100644 --- a/include/configs/zynq-common.h +++ b/include/configs/zynq-common.h @@ -121,7 +121,6 @@ #if defined(CONFIG_SYS_I2C_ZYNQ) # define CONFIG_SYS_I2C # define CONFIG_SYS_I2C_ZYNQ_SPEED 100000 -# define CONFIG_SYS_I2C_ZYNQ_SLAVE 0 #endif /* EEPROM */ From ce3c9a59afd0591a105a316335d7015d8d902367 Mon Sep 17 00:00:00 2001 From: Vipul Kumar Date: Fri, 16 Feb 2018 19:07:20 +0530 Subject: [PATCH 4/9] i2c: Added Kconfig support for CONFIG_SYS_I2C_ZYNQ_SPEED This patch added Kconfig support for CONFIG_SYS_I2C_ZYNQ_SPEED and set it to default value 100000. Signed-off-by: Vipul Kumar Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- drivers/i2c/Kconfig | 7 +++++++ include/configs/xilinx_zynqmp.h | 1 - include/configs/zynq-common.h | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index 6200f1c1e1..6843131970 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig @@ -281,6 +281,13 @@ config SYS_I2C_ZYNQ_SLAVE help Set CONFIG_SYS_I2C_ZYNQ_SLAVE for slave addr. +config SYS_I2C_ZYNQ_SPEED + int "Set I2C speed" + depends on SYS_I2C_ZYNQ + default 100000 + help + Set CONFIG_SYS_I2C_ZYNQ_SPEED for speed setting. + config SYS_I2C_IHS bool "gdsys IHS I2C driver" depends on DM_I2C diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 20ff1136ba..825af80d23 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -126,7 +126,6 @@ /* I2C */ #if defined(CONFIG_SYS_I2C_ZYNQ) # define CONFIG_SYS_I2C -# define CONFIG_SYS_I2C_ZYNQ_SPEED 100000 #endif /* EEPROM */ diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index cf37f84e28..0ebb66b468 100644 --- a/include/configs/zynq-common.h +++ b/include/configs/zynq-common.h @@ -120,7 +120,6 @@ /* I2C */ #if defined(CONFIG_SYS_I2C_ZYNQ) # define CONFIG_SYS_I2C -# define CONFIG_SYS_I2C_ZYNQ_SPEED 100000 #endif /* EEPROM */ From 5c32de202b622c6ffca541fe3b7153bd8e9f626c Mon Sep 17 00:00:00 2001 From: Vipul Kumar Date: Fri, 16 Feb 2018 19:07:21 +0530 Subject: [PATCH 5/9] i2c: Added Kconfig support for CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET This patch added Kconfig support for CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET and enabled it in respective defconfig. Signed-off-by: Vipul Kumar Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- configs/syzygy_hub_defconfig | 1 + configs/xilinx_zynqmp_zcu102_rev1_0_defconfig | 1 + configs/xilinx_zynqmp_zcu102_revA_defconfig | 1 + configs/xilinx_zynqmp_zcu102_revB_defconfig | 1 + configs/zynq_zybo_defconfig | 1 + drivers/misc/Kconfig | 6 ++++++ include/configs/syzygy_hub.h | 1 - include/configs/xilinx_zynqmp_zcu102.h | 1 - include/configs/zynq_zybo.h | 1 - 9 files changed, 11 insertions(+), 3 deletions(-) diff --git a/configs/syzygy_hub_defconfig b/configs/syzygy_hub_defconfig index 019088410d..e611498bc3 100644 --- a/configs/syzygy_hub_defconfig +++ b/configs/syzygy_hub_defconfig @@ -36,6 +36,7 @@ CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y CONFIG_SYS_I2C_ZYNQ=y +CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0xFA CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y CONFIG_PHY_MARVELL=y diff --git a/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig b/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig index 12a0d645ac..02cd71038f 100644 --- a/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig +++ b/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig @@ -55,6 +55,7 @@ CONFIG_DM_GPIO=y CONFIG_CMD_PCA953X=y CONFIG_SYS_I2C_ZYNQ=y CONFIG_MISC=y +CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0x20 CONFIG_DM_MMC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y diff --git a/configs/xilinx_zynqmp_zcu102_revA_defconfig b/configs/xilinx_zynqmp_zcu102_revA_defconfig index b6e8a0e01c..9176e8e702 100644 --- a/configs/xilinx_zynqmp_zcu102_revA_defconfig +++ b/configs/xilinx_zynqmp_zcu102_revA_defconfig @@ -55,6 +55,7 @@ CONFIG_DM_GPIO=y CONFIG_CMD_PCA953X=y CONFIG_SYS_I2C_ZYNQ=y CONFIG_MISC=y +CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0x20 CONFIG_DM_MMC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y diff --git a/configs/xilinx_zynqmp_zcu102_revB_defconfig b/configs/xilinx_zynqmp_zcu102_revB_defconfig index c5bc4cdb63..3c2a865e30 100644 --- a/configs/xilinx_zynqmp_zcu102_revB_defconfig +++ b/configs/xilinx_zynqmp_zcu102_revB_defconfig @@ -55,6 +55,7 @@ CONFIG_DM_GPIO=y CONFIG_CMD_PCA953X=y CONFIG_SYS_I2C_ZYNQ=y CONFIG_MISC=y +CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0x20 CONFIG_DM_MMC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig index 57b39a282f..202bf724f3 100644 --- a/configs/zynq_zybo_defconfig +++ b/configs/zynq_zybo_defconfig @@ -41,6 +41,7 @@ CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y CONFIG_SYS_I2C_ZYNQ=y +CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0xFA CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y CONFIG_SPI_FLASH=y diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index f1c15cb9fa..d774569cbc 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -214,6 +214,12 @@ config SPL_I2C_EEPROM This option is an SPL-variant of the I2C_EEPROM option. See the help of I2C_EEPROM for details. +config ZYNQ_GEM_I2C_MAC_OFFSET + hex "Set the I2C MAC offset" + default 0x0 + help + Set the MAC offset for i2C. + if I2C_EEPROM config SYS_I2C_EEPROM_ADDR diff --git a/include/configs/syzygy_hub.h b/include/configs/syzygy_hub.h index 4147b45ef0..19e201f955 100644 --- a/include/configs/syzygy_hub.h +++ b/include/configs/syzygy_hub.h @@ -14,7 +14,6 @@ #define CONFIG_ZYNQ_I2C1 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 #define CONFIG_ZYNQ_GEM_EEPROM_ADDR 0x57 -#define CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET 0xFA #define CONFIG_EXTRA_ENV_SETTINGS \ "fit_image=fit.itb\0" \ diff --git a/include/configs/xilinx_zynqmp_zcu102.h b/include/configs/xilinx_zynqmp_zcu102.h index 88819c6cc1..0095f61ea3 100644 --- a/include/configs/xilinx_zynqmp_zcu102.h +++ b/include/configs/xilinx_zynqmp_zcu102.h @@ -43,7 +43,6 @@ #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 #define CONFIG_ZYNQ_EEPROM_BUS 5 #define CONFIG_ZYNQ_GEM_EEPROM_ADDR 0x54 -#define CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET 0x20 #include diff --git a/include/configs/zynq_zybo.h b/include/configs/zynq_zybo.h index 808967cee3..a589c92d97 100644 --- a/include/configs/zynq_zybo.h +++ b/include/configs/zynq_zybo.h @@ -15,7 +15,6 @@ #define CONFIG_ZYNQ_I2C1 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 #define CONFIG_ZYNQ_GEM_EEPROM_ADDR 0x50 -#define CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET 0xFA #define CONFIG_DISPLAY #define CONFIG_I2C_EDID From e885b4255f88d83461cf5a15b5a5782050687242 Mon Sep 17 00:00:00 2001 From: Vipul Kumar Date: Fri, 16 Feb 2018 19:07:22 +0530 Subject: [PATCH 6/9] i2c: Added kconfig support for CONFIG_ZYNQ_I2C0 and CONFIG_ZYNQ_I2C1 This patch added Kconfig support for CONFIG_ZYNQ_I2C0 and CONFIG_ZYNQ_I2C1 and enabled it in respective defconfig. Signed-off-by: Vipul Kumar Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- configs/syzygy_hub_defconfig | 1 + configs/topic_miami_defconfig | 2 ++ configs/topic_miamilite_defconfig | 2 ++ configs/topic_miamiplus_defconfig | 2 ++ configs/xilinx_zynqmp_zcu102_rev1_0_defconfig | 2 ++ configs/xilinx_zynqmp_zcu102_revA_defconfig | 2 ++ configs/xilinx_zynqmp_zcu102_revB_defconfig | 2 ++ configs/zynq_zc702_defconfig | 1 + configs/zynq_zc706_defconfig | 1 + configs/zynq_zybo_defconfig | 2 ++ drivers/i2c/Kconfig | 12 ++++++++++++ include/configs/syzygy_hub.h | 1 - include/configs/topic_miami.h | 2 -- include/configs/xilinx_zynqmp_zcu102.h | 2 -- include/configs/zynq_zc70x.h | 1 - include/configs/zynq_zybo.h | 2 -- 16 files changed, 29 insertions(+), 8 deletions(-) diff --git a/configs/syzygy_hub_defconfig b/configs/syzygy_hub_defconfig index e611498bc3..67d1f545d7 100644 --- a/configs/syzygy_hub_defconfig +++ b/configs/syzygy_hub_defconfig @@ -36,6 +36,7 @@ CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y CONFIG_SYS_I2C_ZYNQ=y +CONFIG_ZYNQ_I2C1=y CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0xFA CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y diff --git a/configs/topic_miami_defconfig b/configs/topic_miami_defconfig index 9bf187b2dc..8b02599b26 100644 --- a/configs/topic_miami_defconfig +++ b/configs/topic_miami_defconfig @@ -33,6 +33,8 @@ CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y CONFIG_SYS_I2C_ZYNQ=y +CONFIG_ZYNQ_I2C0=y +CONFIG_ZYNQ_I2C1=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y CONFIG_SPI_FLASH=y diff --git a/configs/topic_miamilite_defconfig b/configs/topic_miamilite_defconfig index 31386a5e81..572b2f5149 100644 --- a/configs/topic_miamilite_defconfig +++ b/configs/topic_miamilite_defconfig @@ -33,6 +33,8 @@ CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y CONFIG_SYS_I2C_ZYNQ=y +CONFIG_ZYNQ_I2C0=y +CONFIG_ZYNQ_I2C1=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y CONFIG_SPI_FLASH=y diff --git a/configs/topic_miamiplus_defconfig b/configs/topic_miamiplus_defconfig index 82674a9191..3e8504d6a0 100644 --- a/configs/topic_miamiplus_defconfig +++ b/configs/topic_miamiplus_defconfig @@ -31,6 +31,8 @@ CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y CONFIG_SYS_I2C_ZYNQ=y +CONFIG_ZYNQ_I2C0=y +CONFIG_ZYNQ_I2C1=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y CONFIG_SPI_FLASH=y diff --git a/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig b/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig index 02cd71038f..1df5b0b5c6 100644 --- a/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig +++ b/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig @@ -54,6 +54,8 @@ CONFIG_FPGA_ZYNQMPPL=y CONFIG_DM_GPIO=y CONFIG_CMD_PCA953X=y CONFIG_SYS_I2C_ZYNQ=y +CONFIG_ZYNQ_I2C0=y +CONFIG_ZYNQ_I2C1=y CONFIG_MISC=y CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0x20 CONFIG_DM_MMC=y diff --git a/configs/xilinx_zynqmp_zcu102_revA_defconfig b/configs/xilinx_zynqmp_zcu102_revA_defconfig index 9176e8e702..c8a8362148 100644 --- a/configs/xilinx_zynqmp_zcu102_revA_defconfig +++ b/configs/xilinx_zynqmp_zcu102_revA_defconfig @@ -54,6 +54,8 @@ CONFIG_FPGA_ZYNQMPPL=y CONFIG_DM_GPIO=y CONFIG_CMD_PCA953X=y CONFIG_SYS_I2C_ZYNQ=y +CONFIG_ZYNQ_I2C0=y +CONFIG_ZYNQ_I2C1=y CONFIG_MISC=y CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0x20 CONFIG_DM_MMC=y diff --git a/configs/xilinx_zynqmp_zcu102_revB_defconfig b/configs/xilinx_zynqmp_zcu102_revB_defconfig index 3c2a865e30..8f85b5f675 100644 --- a/configs/xilinx_zynqmp_zcu102_revB_defconfig +++ b/configs/xilinx_zynqmp_zcu102_revB_defconfig @@ -54,6 +54,8 @@ CONFIG_FPGA_ZYNQMPPL=y CONFIG_DM_GPIO=y CONFIG_CMD_PCA953X=y CONFIG_SYS_I2C_ZYNQ=y +CONFIG_ZYNQ_I2C0=y +CONFIG_ZYNQ_I2C1=y CONFIG_MISC=y CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0x20 CONFIG_DM_MMC=y diff --git a/configs/zynq_zc702_defconfig b/configs/zynq_zc702_defconfig index f2be8d302a..8e8b80053a 100644 --- a/configs/zynq_zc702_defconfig +++ b/configs/zynq_zc702_defconfig @@ -42,6 +42,7 @@ CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y CONFIG_SYS_I2C_ZYNQ=y +CONFIG_ZYNQ_I2C0=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y CONFIG_SPI_FLASH=y diff --git a/configs/zynq_zc706_defconfig b/configs/zynq_zc706_defconfig index 9197aeb7d1..8f83d173c5 100644 --- a/configs/zynq_zc706_defconfig +++ b/configs/zynq_zc706_defconfig @@ -42,6 +42,7 @@ CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y CONFIG_SYS_I2C_ZYNQ=y +CONFIG_ZYNQ_I2C0=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y CONFIG_SPI_FLASH=y diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig index 202bf724f3..92f3e1ec26 100644 --- a/configs/zynq_zybo_defconfig +++ b/configs/zynq_zybo_defconfig @@ -41,6 +41,8 @@ CONFIG_FPGA_XILINX=y CONFIG_FPGA_ZYNQPL=y CONFIG_DM_GPIO=y CONFIG_SYS_I2C_ZYNQ=y +CONFIG_ZYNQ_I2C0=y +CONFIG_ZYNQ_I2C1=y CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0xFA CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index 6843131970..932abd3059 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig @@ -288,6 +288,18 @@ config SYS_I2C_ZYNQ_SPEED help Set CONFIG_SYS_I2C_ZYNQ_SPEED for speed setting. +config ZYNQ_I2C0 + bool "Xilinx I2C0 controller" + depends on SYS_I2C_ZYNQ + help + Enable Xilinx I2C0 controller. + +config ZYNQ_I2C1 + bool "Xilinx I2C1 controller" + depends on SYS_I2C_ZYNQ + help + Enable Xilinx I2C1 controller. + config SYS_I2C_IHS bool "gdsys IHS I2C driver" depends on DM_I2C diff --git a/include/configs/syzygy_hub.h b/include/configs/syzygy_hub.h index 19e201f955..73c9189b73 100644 --- a/include/configs/syzygy_hub.h +++ b/include/configs/syzygy_hub.h @@ -11,7 +11,6 @@ #ifndef __CONFIG_SYZYGY_HUB_H #define __CONFIG_SYZYGY_HUB_H -#define CONFIG_ZYNQ_I2C1 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 #define CONFIG_ZYNQ_GEM_EEPROM_ADDR 0x57 diff --git a/include/configs/topic_miami.h b/include/configs/topic_miami.h index e32fab2513..9e8409ba57 100644 --- a/include/configs/topic_miami.h +++ b/include/configs/topic_miami.h @@ -10,8 +10,6 @@ #ifndef __CONFIG_TOPIC_MIAMI_H #define __CONFIG_TOPIC_MIAMI_H -#define CONFIG_ZYNQ_I2C0 -#define CONFIG_ZYNQ_I2C1 /* Speed up boot time by ignoring the environment which we never used */ diff --git a/include/configs/xilinx_zynqmp_zcu102.h b/include/configs/xilinx_zynqmp_zcu102.h index 0095f61ea3..27d9d6a06f 100644 --- a/include/configs/xilinx_zynqmp_zcu102.h +++ b/include/configs/xilinx_zynqmp_zcu102.h @@ -11,8 +11,6 @@ #define __CONFIG_ZYNQMP_ZCU102_H #define CONFIG_ZYNQ_SDHCI1 -#define CONFIG_ZYNQ_I2C0 -#define CONFIG_ZYNQ_I2C1 #define CONFIG_SYS_I2C_MAX_HOPS 1 #define CONFIG_SYS_NUM_I2C_BUSES 18 #define CONFIG_SYS_I2C_BUSES { \ diff --git a/include/configs/zynq_zc70x.h b/include/configs/zynq_zc70x.h index fc46fec9cc..720f953344 100644 --- a/include/configs/zynq_zc70x.h +++ b/include/configs/zynq_zc70x.h @@ -10,7 +10,6 @@ #ifndef __CONFIG_ZYNQ_ZC70X_H #define __CONFIG_ZYNQ_ZC70X_H -#define CONFIG_ZYNQ_I2C0 #define CONFIG_ZYNQ_EEPROM #include diff --git a/include/configs/zynq_zybo.h b/include/configs/zynq_zybo.h index a589c92d97..8f4e088502 100644 --- a/include/configs/zynq_zybo.h +++ b/include/configs/zynq_zybo.h @@ -11,8 +11,6 @@ #ifndef __CONFIG_ZYNQ_ZYBO_H #define __CONFIG_ZYNQ_ZYBO_H -#define CONFIG_ZYNQ_I2C0 -#define CONFIG_ZYNQ_I2C1 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 #define CONFIG_ZYNQ_GEM_EEPROM_ADDR 0x50 #define CONFIG_DISPLAY From 71d5a14204dcd2023feca41cd606bd99d075446a Mon Sep 17 00:00:00 2001 From: Vipul Kumar Date: Wed, 28 Feb 2018 11:32:22 +0530 Subject: [PATCH 7/9] microblaze: Added Kconfig support for CONFIG_XILINX_GPIO This patch added Kconfig support for CONFIG_XILINX_GPIO and enabled it in respective defconfig. Signed-off-by: Vipul Kumar Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- configs/microblaze-generic_defconfig | 1 + drivers/gpio/Kconfig | 5 +++++ include/configs/microblaze-generic.h | 1 - 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configs/microblaze-generic_defconfig b/configs/microblaze-generic_defconfig index ac494043d4..699dc447f0 100644 --- a/configs/microblaze-generic_defconfig +++ b/configs/microblaze-generic_defconfig @@ -46,6 +46,7 @@ CONFIG_BOOTP_BOOTPATH=y CONFIG_BOOTP_GATEWAY=y CONFIG_BOOTP_HOSTNAME=y CONFIG_SPL_DM=y +CONFIG_XILINX_GPIO=y CONFIG_MTD_NOR_FLASH=y CONFIG_PHY_ATHEROS=y CONFIG_PHY_BROADCOM=y diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 34d4409116..cc75aece6a 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -183,6 +183,11 @@ config SANDBOX_GPIO_COUNT of 'anonymous' GPIOs that do not belong to any device or bank. Select a suitable value depending on your needs. +config XILINX_GPIO + bool "Xilinx GPIO driver" + help + This config enable the Xilinx GPIO driver for Microblaze. + config CMD_TCA642X bool "tca642x - Command to access tca642x state" help diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index fe9aaaec1d..73c3c2ae48 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -41,7 +41,6 @@ /* gpio */ #ifdef XILINX_GPIO_BASEADDR -# define CONFIG_XILINX_GPIO # define CONFIG_SYS_GPIO_0_ADDR XILINX_GPIO_BASEADDR #endif From 5dc5a53c5e5f56971d3df4f6f994993d5efa53f8 Mon Sep 17 00:00:00 2001 From: Vipul Kumar Date: Wed, 28 Feb 2018 15:53:28 +0530 Subject: [PATCH 8/9] mmc: Added Kconfig support for CONFIG_ZYNQ_SDHCI_MAX_FREQ This patch added Kconfig support for CONFIG_ZYNQ_SDHCI_MAX_FREQ and enabled it in respective defconfig. Signed-off-by: Vipul Kumar Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- arch/arm/cpu/armv8/zynqmp/Kconfig | 3 +++ arch/arm/mach-zynq/Kconfig | 3 +++ configs/xilinx_zynqmp_ep_defconfig | 1 + drivers/mmc/Kconfig | 6 ++++++ include/configs/xilinx_zynqmp.h | 3 --- include/configs/xilinx_zynqmp_ep.h | 1 - include/configs/zynq-common.h | 5 ----- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/arch/arm/cpu/armv8/zynqmp/Kconfig b/arch/arm/cpu/armv8/zynqmp/Kconfig index 9e521ed874..8a311e1c89 100644 --- a/arch/arm/cpu/armv8/zynqmp/Kconfig +++ b/arch/arm/cpu/armv8/zynqmp/Kconfig @@ -96,6 +96,9 @@ config SPL_ZYNQMP_ALT_BOOTMODE_ENABLED Overwrite bootmode selected via boot mode pins to tell SPL what should be the next boot device. +config ZYNQ_SDHCI_MAX_FREQ + default 200000000 + config SPL_ZYNQMP_ALT_BOOTMODE hex default 0x0 if JTAG_MODE diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig index b9cd45ba09..87729047f9 100644 --- a/arch/arm/mach-zynq/Kconfig +++ b/arch/arm/mach-zynq/Kconfig @@ -63,4 +63,7 @@ config BOOT_INIT_FILE Add register writes to boot.bin format (max 256 pairs). Expect a table of register-value pairs, e.g. "0x12345678 0x4321" +config ZYNQ_SDHCI_MAX_FREQ + default 52000000 + endif diff --git a/configs/xilinx_zynqmp_ep_defconfig b/configs/xilinx_zynqmp_ep_defconfig index 7f8e774ec0..00db5e3607 100644 --- a/configs/xilinx_zynqmp_ep_defconfig +++ b/configs/xilinx_zynqmp_ep_defconfig @@ -3,6 +3,7 @@ CONFIG_SYS_CONFIG_NAME="xilinx_zynqmp_ep" CONFIG_ARCH_ZYNQMP=y CONFIG_SYS_TEXT_BASE=0x8000000 CONFIG_SYS_MALLOC_F_LEN=0x8000 +CONFIG_ZYNQ_SDHCI_MAX_FREQ=52000000 CONFIG_ZYNQMP_USB=y CONFIG_DEFAULT_DEVICE_TREE="zynqmp-ep108" CONFIG_DEBUG_UART=y diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index 88a13591ad..9967fffbd4 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -481,6 +481,12 @@ config MMC_SDHCI_ZYNQ help Support for Arasan SDHCI host controller on Zynq/ZynqMP ARM SoCs platform +config ZYNQ_SDHCI_MAX_FREQ + int "Set the maximum frequency of the controller" + depends on MMC_SDHCI_ZYNQ + help + Set the maximum frequency of the controller. + config MMC_SUNXI bool "Allwinner sunxi SD/MMC Host Controller support" depends on ARCH_SUNXI && !UART0_PORT_F diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 825af80d23..f5fc24578c 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -56,9 +56,6 @@ #if defined(CONFIG_MMC_SDHCI_ZYNQ) # define CONFIG_SUPPORT_EMMC_BOOT -# ifndef CONFIG_ZYNQ_SDHCI_MAX_FREQ -# define CONFIG_ZYNQ_SDHCI_MAX_FREQ 200000000 -# endif #endif #ifdef CONFIG_NAND_ARASAN diff --git a/include/configs/xilinx_zynqmp_ep.h b/include/configs/xilinx_zynqmp_ep.h index 3a572b7a6c..a77eeea8a2 100644 --- a/include/configs/xilinx_zynqmp_ep.h +++ b/include/configs/xilinx_zynqmp_ep.h @@ -13,7 +13,6 @@ #ifndef __CONFIG_ZYNQMP_EP_H #define __CONFIG_ZYNQMP_EP_H -#define CONFIG_ZYNQ_SDHCI_MAX_FREQ 52000000 #define CONFIG_ZYNQ_SDHCI_MIN_FREQ (CONFIG_ZYNQ_SDHCI_MAX_FREQ >> 9) #define CONFIG_ZYNQ_EEPROM #define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \ diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index 0ebb66b468..554fb66634 100644 --- a/include/configs/zynq-common.h +++ b/include/configs/zynq-common.h @@ -73,11 +73,6 @@ #define CONFIG_MTD_DEVICE #endif -/* MMC */ -#if defined(CONFIG_MMC_SDHCI_ZYNQ) -# define CONFIG_ZYNQ_SDHCI_MAX_FREQ 52000000 -#endif - #ifdef CONFIG_USB_EHCI_ZYNQ # define CONFIG_EHCI_IS_TDI From 3ccc207a3098e59ab7333210deba94e7d41d7c8d Mon Sep 17 00:00:00 2001 From: Vipul Kumar Date: Wed, 28 Feb 2018 15:53:29 +0530 Subject: [PATCH 9/9] mmc: Added Kconfig support for CONFIG_ZYNQ_SDHCI_MIN_FREQ This patch added Kconfig support for CONFIG_ZYNQ_SDHCI_MIN_FREQ and enabled it in respective defconfig. Signed-off-by: Vipul Kumar Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- configs/xilinx_zynqmp_ep_defconfig | 1 + drivers/mmc/Kconfig | 7 +++++++ drivers/mmc/zynq_sdhci.c | 4 ---- include/configs/xilinx_zynqmp_ep.h | 1 - 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/configs/xilinx_zynqmp_ep_defconfig b/configs/xilinx_zynqmp_ep_defconfig index 00db5e3607..a0c8f28b97 100644 --- a/configs/xilinx_zynqmp_ep_defconfig +++ b/configs/xilinx_zynqmp_ep_defconfig @@ -62,6 +62,7 @@ CONFIG_MISC=y CONFIG_DM_MMC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y +CONFIG_ZYNQ_SDHCI_MIN_FREQ=100000 CONFIG_NAND=y CONFIG_NAND_ARASAN=y CONFIG_SPI_FLASH=y diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index 9967fffbd4..5f67e336db 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -487,6 +487,13 @@ config ZYNQ_SDHCI_MAX_FREQ help Set the maximum frequency of the controller. +config ZYNQ_SDHCI_MIN_FREQ + int "Set the minimum frequency of the controller" + depends on MMC_SDHCI_ZYNQ + default 0 + help + Set the minimum frequency of the controller. + config MMC_SUNXI bool "Allwinner sunxi SD/MMC Host Controller support" depends on ARCH_SUNXI && !UART0_PORT_F diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c index 0fddb420dc..414778cc4a 100644 --- a/drivers/mmc/zynq_sdhci.c +++ b/drivers/mmc/zynq_sdhci.c @@ -16,10 +16,6 @@ DECLARE_GLOBAL_DATA_PTR; -#ifndef CONFIG_ZYNQ_SDHCI_MIN_FREQ -# define CONFIG_ZYNQ_SDHCI_MIN_FREQ 0 -#endif - struct arasan_sdhci_plat { struct mmc_config cfg; struct mmc mmc; diff --git a/include/configs/xilinx_zynqmp_ep.h b/include/configs/xilinx_zynqmp_ep.h index a77eeea8a2..a26377a412 100644 --- a/include/configs/xilinx_zynqmp_ep.h +++ b/include/configs/xilinx_zynqmp_ep.h @@ -13,7 +13,6 @@ #ifndef __CONFIG_ZYNQMP_EP_H #define __CONFIG_ZYNQMP_EP_H -#define CONFIG_ZYNQ_SDHCI_MIN_FREQ (CONFIG_ZYNQ_SDHCI_MAX_FREQ >> 9) #define CONFIG_ZYNQ_EEPROM #define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \ ZYNQMP_USB1_XHCI_BASEADDR}