Skip to contentSkip to conversation

Add ASPEED AST2600 I2C new controller driver

PATCH Superseded Ryan Chen 3 participants 8 messages Jan 30, 2023 – Feb 13, 2023

Subsystems (2)

v3 of 12 Superseded Latest is v12 →

lore
Share & tools
lore

Ryan Chen

author
#0 lore raw

v3 cover Add ASPEED AST2600 I2C new controller driver

This series add AST2600 i2c new register set driver. The i2c new register set have new clock divider option for more flexiable generation.

Changes in v3:
-modify uclass_get_device_by_driver to ofnode_get_parent. -Add i2c reg address in dtsi node.
-fix up git config name from ryan_chen to Ryan Chen.

Changes in v2:
-add speed support desciption in Kconfig.
-modify include header ordering.
-separate include register define header.
-modify wording reserver to reserved.
-remove defined string AST2600.
-modify signle-line comment style.
-remove extra ().
-modify local regs for register ctrl.

Ryan Chen (2):
i2c:aspeed:support ast2600 i2c new register mode driver
arm: aspeed: dtsi: add reg for i2c

 MAINTAINERS               |   6 +
 arch/arm/dts/ast2600.dtsi |   1 +
 drivers/i2c/Kconfig       |  10 ++
 drivers/i2c/Makefile      |   1 +
 drivers/i2c/ast2600_i2c.c | 367 ++++++++++++++++++++++++++++++++++++++
 drivers/i2c/ast2600_i2c.h | 120 +++++++++++++
 6 files changed, 505 insertions(+)
 create mode 100644 drivers/i2c/ast2600_i2c.c
 create mode 100644 drivers/i2c/ast2600_i2c.h
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v3 1/2 i2c:aspeed:support ast2600 i2c new register mode driver

Add i2c new register mode driver to support AST2600 i2c new register mode. AST2600 i2c controller have legacy and new register mode. The new register mode have global register support 4 base clock for scl clock selection, and new clock divider mode.

---
 MAINTAINERS               |   6 +
 drivers/i2c/Kconfig       |  10 ++
 drivers/i2c/Makefile      |   1 +
 drivers/i2c/ast2600_i2c.c | 367 ++++++++++++++++++++++++++++++++++++++
 drivers/i2c/ast2600_i2c.h | 120 +++++++++++++
 5 files changed, 504 insertions(+)
 create mode 100644 drivers/i2c/ast2600_i2c.c
 create mode 100644 drivers/i2c/ast2600_i2c.h
MAINTAINERS +6 -0
index 3fc4cd0f12..1cf54f0b4e 100644
@@ -769,6 +769,12 @@ S:	Maintained
 F:	drivers/pci/pcie_phytium.c
 F:	arch/arm/dts/phytium-durian.dts
 
+ASPEED AST2600 I2C DRIVER
+M:	Ryan Chen <[email protected]>
+R:	Aspeed BMC SW team <[email protected]>
+S:	Maintained
+F:	drivers/i2c/ast2600_i2c.c
+
 ASPEED FMC SPI DRIVER
 M:	Chin-Ting Kuo <[email protected]>
 M:	Cédric Le Goater <[email protected]>
drivers/i2c/Kconfig +10 -0
index 08b6c7bdcc..77e2a1c4c0 100644
@@ -221,6 +221,16 @@ 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_AST2600
+    bool "AST2600 I2C Controller"
+    depends on DM_I2C && ARCH_ASPEED
+    help
+      Say yes here to select AST2600 I2C Host Controller. The driver
+      support AST2600 I2C new mode register. This I2C controller supports:
+      _Standard-mode (up to 100 kHz)
+      _Fast-mode (up to 400 kHz)
+      _Fast-mode Plus (up to 1 MHz)
+
 config SYS_I2C_ASPEED
 	bool "Aspeed I2C Controller"
 	depends on DM_I2C && ARCH_ASPEED
drivers/i2c/Makefile +1 -0
index 920aafb91c..89db2d8e37 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_$(SPL_)I2C_CROS_EC_LDO) += cros_ec_ldo.o
 
 obj-$(CONFIG_$(SPL_)SYS_I2C_LEGACY) += i2c_core.o
 obj-$(CONFIG_SYS_I2C_ASPEED) += ast_i2c.o
+obj-$(CONFIG_SYS_I2C_AST2600) += ast2600_i2c.o
 obj-$(CONFIG_SYS_I2C_AT91) += at91_i2c.o
 obj-$(CONFIG_SYS_I2C_CADENCE) += i2c-cdns.o
 obj-$(CONFIG_SYS_I2C_CA) += i2c-cortina.o
drivers/i2c/ast2600_i2c.c new file +367 -0

367 lines not on this page · raw message

drivers/i2c/ast2600_i2c.h new file +120 -0

120 lines not on this page · raw message

Signature · 1 line
2.34.1
Reviewed-by on v3 1/2
#2 lore raw

Re: [PATCH v3 1/2] i2c:aspeed:support ast2600 i2c new register mode driver

Quoted 8 lines · Ryan Chen

Add i2c new register mode driver to support AST2600 i2c new register mode. AST2600 i2c controller have legacy and new register mode. The new register mode have global register support 4 base clock for scl clock selection, and new clock divider mode.

Quoted 9 lines
---
 MAINTAINERS               |   6 +
 drivers/i2c/Kconfig       |  10 ++
 drivers/i2c/Makefile      |   1 +
 drivers/i2c/ast2600_i2c.c | 367 ++++++++++++++++++++++++++++++++++++++
 drivers/i2c/ast2600_i2c.h | 120 +++++++++++++
 5 files changed, 504 insertions(+)
 create mode 100644 drivers/i2c/ast2600_i2c.c
 create mode 100644 drivers/i2c/ast2600_i2c.h
Reviewed-by on v3 1/2
#3 lore raw

Re: [PATCH v3 1/2] i2c:aspeed:support ast2600 i2c new register mode driver

In reply to Ryan Chen

Hello Ryan,

Quoted 8 lines · Ryan Chen

Add i2c new register mode driver to support AST2600 i2c new register mode. AST2600 i2c controller have legacy and new register mode. The new register mode have global register support 4 base clock for scl clock selection, and new clock divider mode.

Quoted 9 lines
---
 MAINTAINERS               |   6 +
 drivers/i2c/Kconfig       |  10 ++
 drivers/i2c/Makefile      |   1 +
 drivers/i2c/ast2600_i2c.c | 367 ++++++++++++++++++++++++++++++++++++++
 drivers/i2c/ast2600_i2c.h | 120 +++++++++++++
 5 files changed, 504 insertions(+)
 create mode 100644 drivers/i2c/ast2600_i2c.c
 create mode 100644 drivers/i2c/ast2600_i2c.h

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: [email protected]
#4 lore raw

Re: [PATCH v3 1/2] i2c:aspeed:support ast2600 i2c new register mode driver

In reply to Ryan Chen

Hello Ryan,

Quoted 9 lines · Ryan Chen

Add i2c new register mode driver to support AST2600 i2c new register mode. AST2600 i2c controller have legacy and new register mode. The new register mode have global register support 4 base clock for scl clock selection, and new clock divider mode.

Quoted 9 lines
---
 MAINTAINERS               |   6 +
 drivers/i2c/Kconfig       |  10 ++
 drivers/i2c/Makefile      |   1 +
 drivers/i2c/ast2600_i2c.c | 367 ++++++++++++++++++++++++++++++++++++++
 drivers/i2c/ast2600_i2c.h | 120 +++++++++++++
 5 files changed, 504 insertions(+)
 create mode 100644 drivers/i2c/ast2600_i2c.c
 create mode 100644 drivers/i2c/ast2600_i2c.h

Applied to u-boot-i2c.git master

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: [email protected]
author
#5 lore raw

PATCH v3 2/2 arm: aspeed: dtsi: add reg for i2c

In reply to Ryan Chen

The i2c driver have global register that i2c bus use ofnode_get_parent to get parent register address.

---
 arch/arm/dts/ast2600.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/dts/ast2600.dtsi +1 -0
index 8d91eedc17..beabcf14f8 100644
@@ -681,6 +681,7 @@
 
 			i2c: bus@1e78a000 {
 				compatible = "simple-bus";
+				reg = <0x1e78a000 0x1000>;
 				#address-cells = <1>;
 				#size-cells = <1>;
 				ranges = <0 0x1e78a000 0x1000>;
Signature · 1 line
2.34.1
Reviewed-by on v3 2/2
#6 lore raw

Re: [PATCH v3 2/2] arm: aspeed: dtsi: add reg for i2c

Hello Ryan,

Quoted 7 lines · Ryan Chen

The i2c driver have global register that i2c bus use ofnode_get_parent to get parent register address.

---
 arch/arm/dts/ast2600.dtsi | 1 +
 1 file changed, 1 insertion(+)

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: [email protected]
#7 lore raw

Re: [PATCH v3 2/2] arm: aspeed: dtsi: add reg for i2c

In reply to Ryan Chen

Hello Ryan,

Quoted 8 lines · Ryan Chen

The i2c driver have global register that i2c bus use ofnode_get_parent to get parent register address.

---
 arch/arm/dts/ast2600.dtsi | 1 +
 1 file changed, 1 insertion(+)

Applied to u-boot-i2c.git master

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: [email protected]