Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards: renesas: Add I2C support for Renesas RA4, RA2 devices #82321

Merged
merged 3 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions boards/renesas/ek_ra2a1/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ hardware features:
+-----------+------------+-------------------------------+
| ENTROPY | on-chip | entropy |
+-----------+------------+-------------------------------+
| I2C | on-chip | i2c |
+-----------+------------+-------------------------------+

The default configuration can be found in
:zephyr_file:`boards/renesas/ek_ra2a1/ek_ra2a1_defconfig`
Expand Down
9 changes: 9 additions & 0 deletions boards/renesas/ek_ra2a1/ek_ra2a1-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,13 @@
<RA_PSEL(RA_PSEL_GPT1, 4, 7)>;
};
};

iic0_default: iic0_default {
group1 {
/* SCL0 SDA0 */
psels = <RA_PSEL(RA_PSEL_I2C, 0, 0)>,
<RA_PSEL(RA_PSEL_I2C, 4, 1)>;
drive-strength = "medium";
};
};
};
11 changes: 11 additions & 0 deletions boards/renesas/ek_ra2a1/ek_ra2a1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,14 @@
&trng {
status = "okay";
};

&iic0 {
pinctrl-0 = <&iic0_default>;
pinctrl-names = "default";
#address-cells = <1>;
#size-cells = <0>;
clock-frequency = <DT_FREQ_M(1)>;
interrupts = <0 1>, <1 1>, <2 1>, <3 1>;
interrupt-names = "rxi", "txi", "tei", "eri";
status = "okay";
};
2 changes: 2 additions & 0 deletions boards/renesas/ek_ra4m2/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ The below features are currently supported on Zephyr OS for EK-RA4M2 board:
+-----------+------------+----------------------+
| PWM | on-chip | pwm |
+-----------+------------+----------------------+
| I2C | on-chip | i2c |
+-----------+------------+----------------------+

Other hardware features are currently not supported by the port.

Expand Down
9 changes: 9 additions & 0 deletions boards/renesas/ek_ra4m2/ek_ra4m2-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@
<RA_PSEL(RA_PSEL_GPT1, 1, 4)>;
};
};

iic0_default: iic0_default {
group1 {
/* SCL0 SDA0 */
psels = <RA_PSEL(RA_PSEL_I2C, 4, 0)>,
<RA_PSEL(RA_PSEL_I2C, 4, 1)>;
drive-strength = "medium";
};
};
};
11 changes: 11 additions & 0 deletions boards/renesas/ek_ra4m2/ek_ra4m2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,14 @@
interrupt-names = "gtioca", "overflow";
status = "okay";
};

&iic0 {
pinctrl-0 = <&iic0_default>;
pinctrl-names = "default";
#address-cells = <1>;
#size-cells = <0>;
clock-frequency = <DT_FREQ_M(1)>;
interrupts = <87 1>, <88 1>, <89 1>, <90 1>;
interrupt-names = "rxi", "txi", "tei", "eri";
status = "okay";
};
2 changes: 2 additions & 0 deletions boards/renesas/ek_ra4m3/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ The below features are currently supported on Zephyr OS for EK-RA4M3 board:
+-----------+------------+----------------------+
| PWM | on-chip | pwm |
+-----------+------------+----------------------+
| I2C | on-chip | i2c |
+-----------+------------+----------------------+

Other hardware features are currently not supported by the port.

Expand Down
9 changes: 9 additions & 0 deletions boards/renesas/ek_ra4m3/ek_ra4m3-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@
<RA_PSEL(RA_PSEL_GPT1, 1, 10)>;
};
};

iic0_default: iic0_default {
group1 {
/* SCL0 SDA0 */
psels = <RA_PSEL(RA_PSEL_I2C, 4, 0)>,
<RA_PSEL(RA_PSEL_I2C, 4, 1)>;
drive-strength = "medium";
};
};
};
11 changes: 11 additions & 0 deletions boards/renesas/ek_ra4m3/ek_ra4m3.dts
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,14 @@
interrupt-names = "gtioca", "overflow";
status = "okay";
};

&iic0 {
pinctrl-0 = <&iic0_default>;
pinctrl-names = "default";
#address-cells = <1>;
#size-cells = <0>;
clock-frequency = <DT_FREQ_M(1)>;
interrupts = <87 1>, <88 1>, <89 1>, <90 1>;
interrupt-names = "rxi", "txi", "tei", "eri";
status = "okay";
};
2 changes: 2 additions & 0 deletions boards/renesas/ek_ra4w1/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ The below features are currently supported on Zephyr OS for EK-RA4W1 board:
+-----------+------------+----------------------+
| PWM | on-chip | pwm |
+-----------+------------+----------------------+
| I2C | on-chip | i2c |
+-----------+------------+----------------------+

Other hardware features are currently not supported by the port.

Expand Down
9 changes: 9 additions & 0 deletions boards/renesas/ek_ra4w1/ek_ra4w1-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@
<RA_PSEL(RA_PSEL_GPT1, 1, 4)>;
};
};

iic0_default: iic0_default {
group1 {
/* SCL0 SDA0 */
psels = <RA_PSEL(RA_PSEL_I2C, 4, 7)>,
<RA_PSEL(RA_PSEL_I2C, 2, 4)>;
drive-strength = "medium";
};
};
};
11 changes: 11 additions & 0 deletions boards/renesas/ek_ra4w1/ek_ra4w1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,14 @@
interrupt-names = "gtioca", "overflow";
status = "okay";
};

&iic0 {
pinctrl-0 = <&iic0_default>;
pinctrl-names = "default";
#address-cells = <1>;
#size-cells = <0>;
clock-frequency = <DT_FREQ_M(1)>;
interrupts = <10 1>, <11 1>, <12 1>, <13 1>;
interrupt-names = "rxi", "txi", "tei", "eri";
status = "okay";
};
14 changes: 14 additions & 0 deletions dts/arm/renesas/ra/ra2/ra2xx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,20 @@
status = "disabled";
};

iic0: iic0@40053000 {
compatible = "renesas,ra-iic";
channel = <0>;
reg = <0x40053000 0x100>;
status = "disabled";
};

iic1: iic1@40053100 {
compatible = "renesas,ra-iic";
channel = <1>;
reg = <0x40053100 0x100>;
status = "disabled";
};

flash-controller@407e0000 {
reg = <0x407e0000 0x10000>;
#address-cells = <1>;
Expand Down
2 changes: 2 additions & 0 deletions dts/arm/renesas/ra/ra4/r7fa4e2b93cfm.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
/delete-node/ &agt3;
/delete-node/ &agt4;
/delete-node/ &agt5;
/delete-node/ &iic0;
/delete-node/ &iic1;

/delete-node/ &adc1;

Expand Down
14 changes: 14 additions & 0 deletions dts/arm/renesas/ra/ra4/ra4-cm33-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,20 @@
status = "disabled";
};

iic0: iic0@4009f000 {
compatible = "renesas,ra-iic";
channel = <0>;
reg = <0x4009f000 0x100>;
status = "disabled";
};

iic1: iic1@4009f100 {
compatible = "renesas,ra-iic";
channel = <1>;
reg = <0x4009f100 0x100>;
status = "disabled";
};

option_setting_ofs: option_setting_ofs@100a100 {
compatible = "zephyr,memory-region";
reg = <0x0100a100 0x18>;
Expand Down
14 changes: 14 additions & 0 deletions dts/arm/renesas/ra/ra4/ra4-cm4-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,20 @@
status = "disabled";
};

iic0: iic0@40053000 {
compatible = "renesas,ra-iic";
channel = <0>;
reg = <0x40053000 0x100>;
status = "disabled";
};

iic1: iic1@40053100 {
compatible = "renesas,ra-iic";
channel = <1>;
reg = <0x40053100 0x100>;
status = "disabled";
};

id_code: id_code@1010018 {
compatible = "zephyr,memory-region";
reg = <0x01010018 0x20>;
Expand Down
1 change: 1 addition & 0 deletions tests/drivers/i2c/i2c_api/boards/ek_ra2a1.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SENSOR_GY271_QMC=y
6 changes: 6 additions & 0 deletions tests/drivers/i2c/i2c_api/boards/ek_ra2a1.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/ {
aliases {
i2c-0 = &iic0;
gy271 = &iic0;
};
};
1 change: 1 addition & 0 deletions tests/drivers/i2c/i2c_api/boards/ek_ra4m2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SENSOR_GY271_QMC=y
6 changes: 6 additions & 0 deletions tests/drivers/i2c/i2c_api/boards/ek_ra4m2.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/ {
aliases {
i2c-0 = &iic0;
gy271 = &iic0;
};
};
1 change: 1 addition & 0 deletions tests/drivers/i2c/i2c_api/boards/ek_ra4m3.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SENSOR_GY271_QMC=y
6 changes: 6 additions & 0 deletions tests/drivers/i2c/i2c_api/boards/ek_ra4m3.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/ {
aliases {
i2c-0 = &iic0;
gy271 = &iic0;
};
};
1 change: 1 addition & 0 deletions tests/drivers/i2c/i2c_api/boards/ek_ra4w1.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SENSOR_GY271_QMC=y
6 changes: 6 additions & 0 deletions tests/drivers/i2c/i2c_api/boards/ek_ra4w1.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/ {
aliases {
i2c-0 = &iic0;
gy271 = &iic0;
};
};
Loading