Skip to contentSkip to conversation

i2c: UniPhier: add I2C drivers based on driver model

PATCH New Masahiro Yamada 3 participants 12 messages Jan 13, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v6 cover i2c: UniPhier: add I2C drivers based on driver model

Masahiro Yamada (5):
i2c: add CONFIG_DM_I2C to Kconfig
i2c: UniPhier: add driver for UniPhier i2c controller
i2c: UniPhier: add driver for UniPhier FIFO-builtin i2c controller
ARM: UniPhier: enable I2C for UniPhier SoCs
ARM: UniPhier: enable CONFIG_I2C_EEPROM

 configs/ph1_ld4_defconfig    |   2 +
 configs/ph1_pro4_defconfig   |   2 +
 configs/ph1_sld8_defconfig   |   2 +
 drivers/i2c/Kconfig          |  22 +++
 drivers/i2c/Makefile         |   2 +
 drivers/i2c/i2c-uniphier-f.c | 379 +++++++++++++++++++++++++++++++++++++++++++
 drivers/i2c/i2c-uniphier.c   | 239 +++++++++++++++++++++++++++
 include/configs/uniphier.h   |   3 +
 8 files changed, 651 insertions(+)
 create mode 100644 drivers/i2c/i2c-uniphier-f.c
 create mode 100644 drivers/i2c/i2c-uniphier.c
Signature · 1 line
1.9.1
#1 lore raw

PATCH v6 1/5 i2c: add CONFIG_DM_I2C to Kconfig

---

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/i2c/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/i2c/Kconfig +6 -0
index e69de29..96715d0 100644
@@ -0,0 +1,6 @@
+config DM_I2C
+	bool "Enable Driver Model for I2C drivers"
+	depends on DM
+	help
+	  If you want to use driver model for I2C drivers, say Y.
+	  To use legacy I2C drivers, say N.
Signature · 1 line
1.9.1
#2 lore raw

PATCH v6 1/5 i2c: add CONFIG_DM_I2C to Kconfig

Quoted 4 lines · Masahiro Yamada

Applied to u-boot-dm, thanks!

Quoted 10 lines

---

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/i2c/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
#3 lore raw

PATCH v6 2/5 i2c: UniPhier: add driver for UniPhier i2c controller

In reply to Masahiro Yamada

This commit adds on-chip I2C driver used on some old Panasonic UniPhier SoCs.

---

Changes in v6:
- Pass (struct uniphier_fi2c_regs*) to reset_bus() and check_device_busy()
- Add "static" to issue_stop()
- Remove an extra blank line

Changes in v5:
- Drop unnecessary __packed

Changes in v4:
- Use a structure instead of macros for register access

Changes in v3: None
Changes in v2:
- Fix a typo. s/freqency/frequency/
- Add some comments to explain the formula calculating wait time.
- add comments on every register
- skip stop condition if the next message is read

 drivers/i2c/Kconfig        |   8 ++
 drivers/i2c/Makefile       |   1 +
 drivers/i2c/i2c-uniphier.c | 239 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 248 insertions(+)
 create mode 100644 drivers/i2c/i2c-uniphier.c
drivers/i2c/Kconfig +8 -0
index 96715d0..6a479ef 100644
@@ -4,3 +4,11 @@ config DM_I2C
 	help
 	  If you want to use driver model for I2C drivers, say Y.
 	  To use legacy I2C drivers, say N.
+
+config SYS_I2C_UNIPHIER
+	bool "UniPhier I2C driver"
+	depends on ARCH_UNIPHIER && DM_I2C
+	default y
+	help
+	  Support for Panasonic UniPhier I2C controller driver.  This I2C
+	  controller is used on PH1-LD4, PH1-sLD8 or older UniPhier SoCs.
drivers/i2c/Makefile +1 -0
index 6f3c86c..e2fcd24 100644
@@ -31,4 +31,5 @@ obj-$(CONFIG_SYS_I2C_SANDBOX) += sandbox_i2c.o i2c-emul-uclass.o
 obj-$(CONFIG_SYS_I2C_SH) += sh_i2c.o
 obj-$(CONFIG_SYS_I2C_SOFT) += soft_i2c.o
 obj-$(CONFIG_SYS_I2C_TEGRA) += tegra_i2c.o
+obj-$(CONFIG_SYS_I2C_UNIPHIER) += i2c-uniphier.o
 obj-$(CONFIG_SYS_I2C_ZYNQ) += zynq_i2c.o
drivers/i2c/i2c-uniphier.c new file +239 -0

239 lines not on this page · raw message

Signature · 1 line
1.9.1
#4 lore raw

PATCH v6 2/5 i2c: UniPhier: add driver for UniPhier i2c controller

Quoted 7 lines · Masahiro Yamada

This commit adds on-chip I2C driver used on some old Panasonic UniPhier SoCs.

Quoted 7 lines

---

Changes in v6:
- Pass (struct uniphier_fi2c_regs*) to reset_bus() and check_device_busy()
- Add "static" to issue_stop()
- Remove an extra blank line

Applied to u-boot-dm, thanks!

Quoted 21 lines

Changes in v5:
- Drop unnecessary __packed

Changes in v4:
- Use a structure instead of macros for register access

Changes in v3: None
Changes in v2:
- Fix a typo. s/freqency/frequency/
- Add some comments to explain the formula calculating wait time.
- add comments on every register
- skip stop condition if the next message is read

 drivers/i2c/Kconfig        |   8 ++
 drivers/i2c/Makefile       |   1 +
 drivers/i2c/i2c-uniphier.c | 239 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 248 insertions(+)
 create mode 100644 drivers/i2c/i2c-uniphier.c
#5 lore raw

PATCH v6 3/5 i2c: UniPhier: add driver for UniPhier FIFO-builtin i2c controller

In reply to Masahiro Yamada

This commit adds on-chip I2C driver used on newer SoCs of Panasonic UniPhier platform.

---

Changes in v6:
- Add some debug messages

Changes in v5:
- Drop unnecessary __packed

Changes in v4:
- Use a structure instead of macros for register access

Changes in v3:
- Fix a bug in that device busy is checked even if the stop condition is not issued.

Changes in v2:
- Fix a typo. s/freqency/frequency/
- Rename the struct member for clarification. s/wait_us/timeout/
- Add comments on all the registers
- Skip stop condition if the next message is read

 drivers/i2c/Kconfig          |   8 +
 drivers/i2c/Makefile         |   1 +
 drivers/i2c/i2c-uniphier-f.c | 379 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 388 insertions(+)
 create mode 100644 drivers/i2c/i2c-uniphier-f.c
drivers/i2c/Kconfig +8 -0
index 6a479ef..202ea5d 100644
@@ -12,3 +12,11 @@ config SYS_I2C_UNIPHIER
 	help
 	  Support for Panasonic UniPhier I2C controller driver.  This I2C
 	  controller is used on PH1-LD4, PH1-sLD8 or older UniPhier SoCs.
+
+config SYS_I2C_UNIPHIER_F
+	bool "UniPhier FIFO-builtin I2C driver"
+	depends on ARCH_UNIPHIER && DM_I2C
+	default y
+	help
+	  Support for Panasonic UniPhier FIFO-builtin I2C controller driver.
+	  This I2C controller is used on PH1-Pro4 or newer UniPhier SoCs.
drivers/i2c/Makefile +1 -0
index e2fcd24..0e4c9f4 100644
@@ -32,4 +32,5 @@ obj-$(CONFIG_SYS_I2C_SH) += sh_i2c.o
 obj-$(CONFIG_SYS_I2C_SOFT) += soft_i2c.o
 obj-$(CONFIG_SYS_I2C_TEGRA) += tegra_i2c.o
 obj-$(CONFIG_SYS_I2C_UNIPHIER) += i2c-uniphier.o
+obj-$(CONFIG_SYS_I2C_UNIPHIER_F) += i2c-uniphier-f.o
 obj-$(CONFIG_SYS_I2C_ZYNQ) += zynq_i2c.o
drivers/i2c/i2c-uniphier-f.c new file +379 -0

379 lines not on this page · raw message

Signature · 1 line
1.9.1
#6 lore raw

PATCH v6 3/5 i2c: UniPhier: add driver for UniPhier FIFO-builtin i2c controller

Quoted 7 lines · Masahiro Yamada

This commit adds on-chip I2C driver used on newer SoCs of Panasonic UniPhier platform.

Applied to u-boot-dm, thanks!

Quoted 26 lines

---

Changes in v6:
- Add some debug messages

Changes in v5:
- Drop unnecessary __packed

Changes in v4:
- Use a structure instead of macros for register access

Changes in v3:
- Fix a bug in that device busy is checked even if the stop condition is not issued.

Changes in v2:
- Fix a typo. s/freqency/frequency/
- Rename the struct member for clarification. s/wait_us/timeout/
- Add comments on all the registers
- Skip stop condition if the next message is read

 drivers/i2c/Kconfig          |   8 +
 drivers/i2c/Makefile         |   1 +
 drivers/i2c/i2c-uniphier-f.c | 379 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 388 insertions(+)
 create mode 100644 drivers/i2c/i2c-uniphier-f.c
#7 lore raw

PATCH v6 4/5 ARM: UniPhier: enable I2C for UniPhier SoCs

In reply to Masahiro Yamada

---

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 configs/ph1_ld4_defconfig  | 2 ++
 configs/ph1_pro4_defconfig | 2 ++
 configs/ph1_sld8_defconfig | 2 ++
 3 files changed, 6 insertions(+)
configs/ph1_ld4_defconfig +2 -0
index 2e9dd00..86b4b15 100644
@@ -18,6 +18,7 @@ CONFIG_CMD_LOADB=y
 CONFIG_CMD_LOADS=y
 CONFIG_CMD_FLASH=y
 CONFIG_CMD_NAND=y
+CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_ECHO=y
 CONFIG_CMD_ITEST=y
@@ -34,6 +35,7 @@ CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
 CONFIG_DM_SERIAL=y
 CONFIG_UNIPHIER_SERIAL=y
+CONFIG_DM_I2C=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
configs/ph1_pro4_defconfig +2 -0
index 5dca64b..242bcf9 100644
@@ -18,6 +18,7 @@ CONFIG_CMD_LOADB=y
 CONFIG_CMD_LOADS=y
 CONFIG_CMD_FLASH=y
 CONFIG_CMD_NAND=y
+CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_ECHO=y
 CONFIG_CMD_ITEST=y
@@ -34,6 +35,7 @@ CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
 CONFIG_DM_SERIAL=y
 CONFIG_UNIPHIER_SERIAL=y
+CONFIG_DM_I2C=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
configs/ph1_sld8_defconfig +2 -0
index 2a6e334..8e95f17 100644
@@ -18,6 +18,7 @@ CONFIG_CMD_LOADB=y
 CONFIG_CMD_LOADS=y
 CONFIG_CMD_FLASH=y
 CONFIG_CMD_NAND=y
+CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_ECHO=y
 CONFIG_CMD_ITEST=y
@@ -34,6 +35,7 @@ CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
 CONFIG_DM_SERIAL=y
 CONFIG_UNIPHIER_SERIAL=y
+CONFIG_DM_I2C=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
Signature · 1 line
1.9.1
#8 lore raw

PATCH v6 4/5 ARM: UniPhier: enable I2C for UniPhier SoCs

Quoted 10 lines · Masahiro Yamada

---

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

Quoted 4 lines
 configs/ph1_ld4_defconfig  | 2 ++
 configs/ph1_pro4_defconfig | 2 ++
 configs/ph1_sld8_defconfig | 2 ++
 3 files changed, 6 insertions(+)

Applied to u-boot-dm, thanks!

#9 lore raw

PATCH v6 5/5 ARM: UniPhier: enable CONFIG_I2C_EEPROM

In reply to Masahiro Yamada

---

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 include/configs/uniphier.h | 3 +++
 1 file changed, 3 insertions(+)
include/configs/uniphier.h +3 -0
index 5a53c50..9ad47f6 100644
@@ -43,6 +43,9 @@
 #define CONFIG_SDRAM1_SIZE	0x10000000
 #endif
 
+#define CONFIG_I2C_EEPROM
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  10
+
 /*
  * Support card address map
  */
Signature · 1 line
1.9.1
#11 lore raw

v6 cover i2c: UniPhier: add I2C drivers based on driver model

In reply to Masahiro Yamada

Hello Simon,

Am 13.01.2015 04:44, schrieb Masahiro Yamada:

Quoted 16 lines

Masahiro Yamada (5):
i2c: add CONFIG_DM_I2C to Kconfig
i2c: UniPhier: add driver for UniPhier i2c controller
i2c: UniPhier: add driver for UniPhier FIFO-builtin i2c controller
ARM: UniPhier: enable I2C for UniPhier SoCs
ARM: UniPhier: enable CONFIG_I2C_EEPROM

  configs/ph1_ld4_defconfig    |   2 +
  configs/ph1_pro4_defconfig   |   2 +
  configs/ph1_sld8_defconfig   |   2 +
  drivers/i2c/Kconfig          |  22 +++
  drivers/i2c/Makefile         |   2 +
  drivers/i2c/i2c-uniphier-f.c | 379 +++++++++++++++++++++++++++++++++++++++++++
  drivers/i2c/i2c-uniphier.c   | 239 +++++++++++++++++++++++++++
  include/configs/uniphier.h   |   3 +
  8 files changed, 651 insertions(+)
Quoted 3 lines

create mode 100644 drivers/i2c/i2c-uniphier-f.c
create mode 100644 drivers/i2c/i2c-uniphier.c

Do you pick up this patchset into your u-boot-dm.git tree?

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany