Skip to content

Commit

Permalink
drivers: i2c: Base OMAP I2C support for TI-K3 processor
Browse files Browse the repository at this point in the history
The OMAP I2C provides support for I2C serial interface on TI K3 series.
It is compatible with Philips I2C physical layer.
The commit includes:
Zephyr i2c api implementation

Signed-off-by: Dhruv Menon <[email protected]>
  • Loading branch information
malto101 committed Oct 21, 2024
1 parent 6f64f77 commit 04702a7
Show file tree
Hide file tree
Showing 7 changed files with 1,186 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/* Copyright (C) 2023 BeagleBoard.org Foundation
* Copyright (C) 2023 S Prashanth
* Copyright (c) 2024 Texas Instruments Incorporated
* Andrew Davis <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include <ti/j721e_main_r5.dtsi>
#include <zephyr/dt-bindings/pinctrl/ti-k3-pinctrl.h>
#include <freq.h>

/ {
model = "BeagleBone-AI64";
compatible = "beagle,beaglebone-ai64";

chosen {
zephyr,sram = &ddr1;
zephyr,console = &uart2;
zephyr,shell-uart = &uart2;
};

cpus {
cpu@0 {
status = "okay";
};
};

ddr0: memory@a2000000 {
compatible = "mmio-sram";
reg = <0xa2000000 DT_SIZE_M(1)>;
};

rsc_table: memory@a2100000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0xa2100000 DT_SIZE_M(1)>;
zephyr,memory-region = "RSC_TABLE";
};

ddr1: memory@a2200000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0xa2200000 DT_SIZE_M(14)>;
zephyr,memory-region = "DRAM";
};
};

&i2c6 {
status = "okay";
pinctrl-0 = <&i2c6_scl_default &i2c6_sda_default>;
pinctrl-names = "default";
};

&uart2 {
status = "okay";
pinctrl-0 = <&uart2_tx_default &uart2_rx_default>;
pinctrl-names = "default";
current-speed = <115200>;
};

&systick_timer {
status = "okay";
};

&pinctrl {
uart2_tx_default: uart2_tx_default {
/* 0x1c is address of padconfig register of p8.34 and 14 is mux mode */
pinmux = <K3_PINMUX(0x1c, PIN_OUTPUT, MUX_MODE_14)>;
};

uart2_rx_default: uart2_rx_default {
/* 0x14 is address of padconfig register of p8.22 and 14 is mux mode */
pinmux = <K3_PINMUX(0x14, PIN_INPUT, MUX_MODE_14)>;
};
i2c6_scl_default: i2c6_scl_default {
/* 0x1e0 is the address of padconfig register of p9.17 and 2 is mux mode */
pinmux = <K3_PINMUX(0x1d0, PIN_INPUT_PULLUP, MUX_MODE_2)>;
};
i2c6_sda_default: i2c6_sda_default {
/* 0x1dc is the address of padconfig register of p9.18 and 2 is mux mode */
pinmux = <K3_PINMUX(0x1e4, PIN_INPUT_PULLUP, MUX_MODE_2)>;
};
};
1 change: 1 addition & 0 deletions drivers/i2c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ zephyr_library_sources_ifdef(CONFIG_I2C_LITEX i2c_litex.c)
zephyr_library_sources_ifdef(CONFIG_I2C_NPCX i2c_npcx_controller.c)
zephyr_library_sources_ifdef(CONFIG_I2C_NPCX i2c_npcx_port.c)
zephyr_library_sources_ifdef(CONFIG_I2C_DW i2c_dw.c)
zephyr_library_sources_ifdef(CONFIG_I2C_OMAP i2c_omap.c)
zephyr_library_sources_ifdef(CONFIG_I2C_RCAR i2c_rcar.c)
zephyr_library_sources_ifdef(CONFIG_I2C_TCA954X i2c_tca954x.c)
zephyr_library_sources_ifdef(CONFIG_I2C_XEC_V2 i2c_mchp_xec_v2.c)
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ source "drivers/i2c/Kconfig.litex"
source "drivers/i2c/Kconfig.lpc11u6x"
source "drivers/i2c/Kconfig.npcx"
source "drivers/i2c/Kconfig.test"
source "drivers/i2c/Kconfig.omap"
source "drivers/i2c/Kconfig.rcar"
source "drivers/i2c/Kconfig.renesas_ra"
source "drivers/i2c/Kconfig.tca954x"
Expand Down
26 changes: 26 additions & 0 deletions drivers/i2c/Kconfig.omap
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (C) 2024 BeagleBoard.org Foundation
# Copyright (C) 2024 Dhruv Menon <[email protected]>

# SPDX-License-Identifier: Apache-2.0

config I2C_OMAP
bool "TI OMAP I2C Driver"
default y
depends on DT_HAS_TI_OMAP_I2C_ENABLED
select I2C_BITBANG
help
Enable the I2C driver for TI OMAP SoCs.

menu "Custom I2C OMAP Logging"
config OMAP_I2C_LOG_LEVEL
int "OMAP I2C Log Level"
default # For DEBUG level
range 0 4
help
Set the log level for the OMAP I2C module:
0: None
1: Error
2: Warning
3: Info
4: Debug
endmenu
Loading

0 comments on commit 04702a7

Please sign in to comment.