Convert CONFIG_SYS_I2C_LEGACY to Kconfig and add CONFIG_[ST]PL_SYS_I2C_LEGACY
[platform/kernel/u-boot.git] / drivers / i2c / Kconfig
index 095a9bc..1466f8d 100644 (file)
@@ -2,7 +2,29 @@
 # I2C subsystem configuration
 #
 
-menu "I2C support"
+menuconfig I2C
+       bool "I2C support"
+       default y
+       help
+         Note:
+         This is a stand-in for an option to enable I2C support. In fact this
+         simply enables building of the I2C directory for U-Boot. The actual
+         I2C feature is enabled by DM_I2C (for driver model) and
+         the #define CONFIG_SYS_I2C_LEGACY (for the legacy I2C stack).
+
+         So at present there is no need to ever disable this option.
+
+         Eventually it will:
+
+         Enable support for the I2C (Inter-Integrated Circuit) bus in U-Boot.
+         I2C works with a clock and data line which can be driven by a
+         one or more masters or slaves. It is a fairly complex bus but is
+         widely used as it only needs two lines for communication. Speeds of
+         400kbps are typical but up to 3.4Mbps is supported by some
+         hardware. Enable this option to build the drivers in drivers/i2c as
+         part of a U-Boot build.
+
+if I2C
 
 config DM_I2C
        bool "Enable Driver Model for I2C drivers"
@@ -11,19 +33,41 @@ config DM_I2C
          Enable driver model for I2C. The I2C uclass interface: probe, read,
          write and speed, is implemented with the bus drivers operations,
          which provide methods for bus setting and data transfer. Each chip
+         device (bus child) info is kept as parent plat. The interface
+         is defined in include/i2c.h.
+
+config SPL_DM_I2C
+       bool "Enable Driver Model for I2C drivers in SPL"
+       depends on SPL_DM && DM_I2C
+       default y
+       help
+         Enable driver model for I2C. The I2C uclass interface: probe, read,
+         write and speed, is implemented with the bus drivers operations,
+         which provide methods for bus setting and data transfer. Each chip
          device (bus child) info is kept as parent platdata. The interface
-         is defined in include/i2c.h. When i2c bus driver supports the i2c
-         uclass, but the device drivers not, then DM_I2C_COMPAT config can
-         be used as compatibility layer.
+         is defined in include/i2c.h.
 
-config DM_I2C_COMPAT
-       bool "Enable I2C compatibility layer"
-       depends on DM
+config SYS_I2C_LEGACY
+       bool "Enable legacy I2C subsystem and drivers"
+       depends on !DM_I2C
+       help
+         Enable the legacy I2C subsystem and drivers.  While this is
+         deprecated in U-Boot itself, this can be useful in some situations
+         in SPL or TPL.
+
+config SPL_SYS_I2C_LEGACY
+       bool "Enable legacy I2C subsystem and drivers in SPL"
+       depends on SUPPORT_SPL && !SPL_DM_I2C
        help
-         Enable old-style I2C functions for compatibility with existing code.
-         This option can be enabled as a temporary measure to avoid needing
-         to convert all code for a board in a single commit. It should not
-         be enabled for any board in an official release.
+         Enable the legacy I2C subsystem and drivers in SPL.  This is useful
+         in some size constrained situations.
+
+config TPL_SYS_I2C_LEGACY
+       bool "Enable legacy I2C subsystem and drivers in TPL"
+       depends on SUPPORT_TPL && !SPL_DM_I2C
+       help
+         Enable the legacy I2C subsystem and drivers in TPL.  This is useful
+         in some size constrained situations.
 
 config I2C_CROS_EC_TUNNEL
        tristate "Chrome OS EC tunnel I2C bus"
@@ -72,6 +116,16 @@ config DM_I2C_GPIO
          bindings are supported.
          Binding info: doc/device-tree-bindings/i2c/i2c-gpio.txt
 
+config SPL_DM_I2C_GPIO
+       bool "Enable Driver Model for software emulated I2C bus driver in SPL"
+       depends on SPL_DM && DM_I2C_GPIO && SPL_DM_GPIO && SPL_GPIO
+       default y
+       help
+         Enable the i2c bus driver emulation by using the GPIOs. The bus GPIO
+         configuration is given by the device tree. Kernel-style device tree
+         bindings are supported.
+         Binding info: doc/device-tree-bindings/i2c/i2c-gpio.txt
+
 config SYS_I2C_AT91
        bool "Atmel I2C driver"
        depends on DM_I2C && ARCH_AT91
@@ -82,6 +136,14 @@ config SYS_I2C_AT91
          i2c-gpio driver unless your system can cope with this limitation.
          Binding info: doc/device-tree-bindings/i2c/i2c-at91.txt
 
+config SYS_I2C_IPROC
+       bool "Broadcom I2C driver"
+       depends on DM_I2C
+       help
+         Broadcom I2C driver.
+         Add support for Broadcom I2C driver.
+         Say yes here to to enable the Broadco I2C driver.
+
 config SYS_I2C_FSL
        bool "Freescale I2C bus driver"
        depends on DM_I2C
@@ -91,11 +153,19 @@ config SYS_I2C_FSL
 
 config SYS_I2C_CADENCE
        tristate "Cadence I2C Controller"
-       depends on DM_I2C && (ARCH_ZYNQ || ARM64)
+       depends on DM_I2C
        help
          Say yes here to select Cadence I2C Host Controller. This controller is
          e.g. used by Xilinx Zynq.
 
+config SYS_I2C_CA
+       tristate "Cortina-Access I2C Controller"
+       depends on DM_I2C && CORTINA_PLATFORM
+       default n
+       help
+         Add support for the Cortina Access I2C host controller.
+         Say yes here to select Cortina-Access I2C Host Controller.
+
 config SYS_I2C_DAVINCI
        bool "Davinci I2C Controller"
        depends on (ARCH_KEYSTONE || ARCH_DAVINCI)
@@ -110,16 +180,6 @@ config SYS_I2C_DW
          controller is used in various SoCs, e.g. the ST SPEAr, Altera
          SoCFPGA, Synopsys ARC700 and some Intel x86 SoCs.
 
-config SYS_I2C_DW_ENABLE_STATUS_UNSUPPORTED
-       bool "DW I2C Enable Status Register not supported"
-       depends on SYS_I2C_DW && (TARGET_SPEAR300 || TARGET_SPEAR310 || \
-               TARGET_SPEAR320 || TARGET_SPEAR600 || TARGET_X600)
-       default y
-       help
-         Some versions of the Designware I2C controller do not support the
-         enable status register. This config option can be enabled in such
-         cases.
-
 config SYS_I2C_ASPEED
        bool "Aspeed I2C Controller"
        depends on DM_I2C && ARCH_ASPEED
@@ -143,6 +203,12 @@ config SYS_I2C_IMX_LPI2C
        help
          Add support for the NXP i.MX LPI2C driver.
 
+config SYS_I2C_LPC32XX
+       bool "LPC32XX I2C driver"
+       depends on ARCH_LPC32XX
+       help
+         Enable support for the LPC32xx I2C driver.
+
 config SYS_I2C_MESON
        bool "Amlogic Meson I2C driver"
        depends on DM_I2C && ARCH_MESON
@@ -217,7 +283,7 @@ endif
 if SYS_I2C_MXC_I2C1
 config SYS_MXC_I2C1_SPEED
        int "I2C Channel 1 speed"
-       default 40000000 if TARGET_LS2080A_SIMU || TARGET_LS2080A_EMU
+       default 40000000 if TARGET_LS2080A_EMU
        default 100000
        help
         MXC I2C Channel 1 speed
@@ -232,7 +298,7 @@ endif
 if SYS_I2C_MXC_I2C2
 config SYS_MXC_I2C2_SPEED
        int "I2C Channel 2 speed"
-       default 40000000 if TARGET_LS2080A_SIMU || TARGET_LS2080A_EMU
+       default 40000000 if TARGET_LS2080A_EMU
        default 100000
        help
         MXC I2C Channel 2 speed
@@ -328,9 +394,25 @@ config SYS_MXC_I2C8_SLAVE
         MXC I2C8 Slave
 endif
 
+config SYS_I2C_NEXELL
+       bool "Nexell I2C driver"
+       depends on DM_I2C
+       help
+         Add support for the Nexell I2C driver. This is used with various
+         Nexell parts such as S5Pxx18 series SoCs. All chips
+         have several I2C ports and all are provided, controlled by the
+         device tree.
+
+config SYS_I2C_OCORES
+       bool "ocores I2C driver"
+       depends on DM_I2C
+       help
+         Add support for ocores I2C controller. For details see
+         https://opencores.org/projects/i2c
+
 config SYS_I2C_OMAP24XX
        bool "TI OMAP2+ I2C driver"
-       depends on ARCH_OMAP2PLUS
+       depends on ARCH_OMAP2PLUS || ARCH_K3
        help
          Add support for the OMAP2+ I2C driver.
 
@@ -377,9 +459,38 @@ config SYS_I2C_SANDBOX
          bus. Devices can be attached to the bus using the device tree
          which specifies the driver to use.  See sandbox.dts as an example.
 
+config SYS_I2C_SOFT
+       bool "Legacy software I2C interface"
+       help
+         Enable the legacy software defined I2C interface
+
+config SYS_I2C_SOFT_SPEED
+       int "Software I2C bus speed"
+       depends on SYS_I2C_SOFT
+       default 100000
+       help
+         Speed of the software I2C bus
+
+config SYS_I2C_SOFT_SLAVE
+       hex "Software I2C slave address"
+       depends on SYS_I2C_SOFT
+       default 0xfe
+       help
+         Slave address of the software I2C bus
+
+config SYS_I2C_OCTEON
+       bool "Octeon II/III/TX/TX2 I2C driver"
+       depends on (ARCH_OCTEON || ARCH_OCTEONTX || ARCH_OCTEONTX2) && DM_I2C
+       default y
+       help
+         Add support for the Marvell Octeon I2C driver. This is used with
+         various Octeon parts such as Octeon II/III and OcteonTX/TX2. All
+         chips have several I2C ports and all are provided, controlled by
+         the device tree.
+
 config SYS_I2C_S3C24X0
        bool "Samsung I2C driver"
-       depends on ARCH_EXYNOS4 && DM_I2C
+       depends on (ARCH_EXYNOS4 || ARCH_EXYNOS5) && DM_I2C
        help
          Support for Samsung I2C controller as Samsung SoCs.
 
@@ -403,9 +514,16 @@ config SYS_I2C_STM32F7
           _ Optional clock stretching
           _ Software reset
 
+config SYS_I2C_SYNQUACER
+       bool "Socionext SynQuacer I2C controller"
+       depends on ARCH_SYNQUACER && DM_I2C
+       help
+         Support for Socionext Synquacer I2C controller. This I2C controller
+         will be used for RTC and LS-connector on DeveloperBox.
+
 config SYS_I2C_TEGRA
        bool "NVIDIA Tegra internal I2C controller"
-       depends on TEGRA
+       depends on ARCH_TEGRA
        help
          Support for NVIDIA I2C controller available in Tegra SoCs.
 
@@ -427,14 +545,13 @@ config SYS_I2C_UNIPHIER_F
 
 config SYS_I2C_VERSATILE
        bool "Arm Ltd Versatile I2C bus driver"
-       depends on DM_I2C && (TARGET_VEXPRESS_CA15_TC2 || TARGET_VEXPRESS64_JUNO)
+       depends on DM_I2C && TARGET_VEXPRESS64_JUNO
        help
          Add support for the Arm Ltd Versatile Express I2C driver. The I2C host
          controller is present in the development boards manufactured by Arm Ltd.
 
 config SYS_I2C_MVTWSI
        bool "Marvell I2C driver"
-       depends on DM_I2C
        help
          Support for Marvell I2C controllers as used on the orion5x and
          kirkwood SoC families.
@@ -473,4 +590,4 @@ config SYS_I2C_IHS
 
 source "drivers/i2c/muxes/Kconfig"
 
-endmenu
+endif