diff --git a/boards/arm/npcm400f_evb/npcm400f_evb.dts b/boards/arm/npcm400f_evb/npcm400f_evb.dts index f405d70154525b..ccbada9a4ba7cc 100644 --- a/boards/arm/npcm400f_evb/npcm400f_evb.dts +++ b/boards/arm/npcm400f_evb/npcm400f_evb.dts @@ -175,7 +175,7 @@ }; &i3c0 { - status = "disabled"; + status = "okay"; assigned-address = <0x20>; i2c-scl-hz = <100000>; i3c-scl-hz = <12500000>; @@ -188,7 +188,7 @@ }; &i3c1 { - status = "disabled"; + status = "okay"; assigned-address = <0x21>; i2c-scl-hz = <100000>; i3c-scl-hz = <12500000>; diff --git a/boards/arm/npcm400f_evb/npcm400f_evb_defconfig b/boards/arm/npcm400f_evb/npcm400f_evb_defconfig index 915bec55bcc3eb..14e8eb95e322da 100644 --- a/boards/arm/npcm400f_evb/npcm400f_evb_defconfig +++ b/boards/arm/npcm400f_evb/npcm400f_evb_defconfig @@ -94,8 +94,10 @@ CONFIG_SPI=y CONFIG_SPIP_NPCM4XX=y # I3C driver -#CONFIG_I3C=y -#CONFIG_I3C_NPCM4XX=y +CONFIG_I3C=y +CONFIG_I3C_NPCM4XX=y +CONFIG_I3C_SLAVE=y +CONFIG_I3C_SLAVE_MQUEUE=y # USB Driver CONFIG_USB=y diff --git a/drivers/i3c/CMakeLists.txt b/drivers/i3c/CMakeLists.txt index c2538eb0f2c505..05a937348c63b5 100644 --- a/drivers/i3c/CMakeLists.txt +++ b/drivers/i3c/CMakeLists.txt @@ -3,11 +3,16 @@ zephyr_library() zephyr_library_sources(i3c_common.c) +add_subdirectory_ifdef(CONFIG_I3C_SLAVE slave) -#zephyr_library_sources_ifdef(CONFIG_I3C_ASPEED i3c_global_aspeed.c) -#zephyr_library_sources_ifdef(CONFIG_I3C_ASPEED i3c_aspeed.c) +zephyr_library_sources_ifdef(CONFIG_I3C_ASPEED i3c_global_aspeed.c) +zephyr_library_sources_ifdef(CONFIG_I3C_ASPEED i3c_aspeed.c) -add_subdirectory_ifdef(CONFIG_I3C_NPCM4XX NPCM4XX) -add_subdirectory_ifdef(CONFIG_I3C_SLAVE slave) zephyr_library_sources_ifdef(CONFIG_I3C_NPCM4XX i3c_npcm4xx.c) -zephyr_library_sources_ifdef(CONFIG_I3C_SHELL i3c_shell.c) \ No newline at end of file +add_subdirectory_ifdef(CONFIG_I3C_NPCM4XX npcm4xx) +zephyr_include_directories_ifdef( + CONFIG_I3C_NPCM4XX + ${ZEPHYR_BASE}/drivers/i3c/npcm4xx +) + +zephyr_library_sources_ifdef(CONFIG_I3C_SHELL i3c_shell.c) diff --git a/drivers/i3c/i3c_npcm4xx.c b/drivers/i3c/i3c_npcm4xx.c index 210666c111b97d..ac3cdabb95f66a 100644 --- a/drivers/i3c/i3c_npcm4xx.c +++ b/drivers/i3c/i3c_npcm4xx.c @@ -14,13 +14,13 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include "pub_I3C.h" +#include "i3c_core.h" +#include "i3c_master.h" +#include "i3c_slave.h" +#include "hal_I3C.h" +#include "i3c_drv.h" +#include "api_i3c.h" #include #include diff --git a/drivers/i3c/NPCM4XX/CMakeLists.txt b/drivers/i3c/npcm4xx/CMakeLists.txt similarity index 82% rename from drivers/i3c/NPCM4XX/CMakeLists.txt rename to drivers/i3c/npcm4xx/CMakeLists.txt index a6d8e31ff37ea9..973664a64722e8 100644 --- a/drivers/i3c/NPCM4XX/CMakeLists.txt +++ b/drivers/i3c/npcm4xx/CMakeLists.txt @@ -4,4 +4,4 @@ zephyr_sources_ifdef(CONFIG_I3C_NPCM4XX i3c_core.c) zephyr_sources_ifdef(CONFIG_I3C_NPCM4XX i3c_master.c) zephyr_sources_ifdef(CONFIG_I3C_NPCM4XX i3c_slave.c) -zephyr_sources_ifdef(CONFIG_I3C_NPCM4XX api_i3c.c) \ No newline at end of file +zephyr_sources_ifdef(CONFIG_I3C_NPCM4XX api_i3c.c) diff --git a/drivers/i3c/NPCM4XX/api_i3c.c b/drivers/i3c/npcm4xx/api_i3c.c similarity index 97% rename from drivers/i3c/NPCM4XX/api_i3c.c rename to drivers/i3c/npcm4xx/api_i3c.c index f797ec55492828..49bba3b239a428 100644 --- a/drivers/i3c/NPCM4XX/api_i3c.c +++ b/drivers/i3c/npcm4xx/api_i3c.c @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include -#include -#include -#include +#include "pub_I3C.h" +#include "i3c_core.h" +#include "i3c_master.h" +#include "i3c_slave.h" +#include "hal_I3C.h" +#include "i3c_drv.h" extern I3C_BUS_INFO_t gBus[]; extern I3C_DEVICE_INFO_t gI3c_dev_node_internal[]; diff --git a/include/drivers/i3c/NPCM4XX/api_i3c.h b/drivers/i3c/npcm4xx/api_i3c.h similarity index 99% rename from include/drivers/i3c/NPCM4XX/api_i3c.h rename to drivers/i3c/npcm4xx/api_i3c.h index 049cb9acd39e15..f8d688f0ef9a58 100644 --- a/include/drivers/i3c/NPCM4XX/api_i3c.h +++ b/drivers/i3c/npcm4xx/api_i3c.h @@ -5,7 +5,7 @@ #ifndef API_I3C_H #define API_I3C_H -#include +#include "pub_I3C.h" #ifdef __cplusplus extern "C"{ diff --git a/include/drivers/i3c/NPCM4XX/hal_I3C.h b/drivers/i3c/npcm4xx/hal_I3C.h similarity index 98% rename from include/drivers/i3c/NPCM4XX/hal_I3C.h rename to drivers/i3c/npcm4xx/hal_I3C.h index 7f270a6bb15b0e..8da584a85debb9 100644 --- a/include/drivers/i3c/NPCM4XX/hal_I3C.h +++ b/drivers/i3c/npcm4xx/hal_I3C.h @@ -5,8 +5,8 @@ #ifndef __HAL_I3C_H__ #define __HAL_I3C_H__ -#include -#include +#include "pub_I3C.h" +#include "i3c_drv.h" #if (CHIP_ID_NPCM4XX == 5832) /*#define I3C_PORT1_MODE I3C_DEVICE_MODE_CURRENT_MASTER*/ diff --git a/drivers/i3c/NPCM4XX/i3c_core.c b/drivers/i3c/npcm4xx/i3c_core.c similarity index 99% rename from drivers/i3c/NPCM4XX/i3c_core.c rename to drivers/i3c/npcm4xx/i3c_core.c index e66eaf3a0bf3ba..2aefb6135abe9c 100644 --- a/drivers/i3c/NPCM4XX/i3c_core.c +++ b/drivers/i3c/npcm4xx/i3c_core.c @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include -#include -#include -#include +#include "pub_I3C.h" +#include "i3c_core.h" +#include "i3c_master.h" +#include "i3c_slave.h" +#include "hal_I3C.h" +#include "i3c_drv.h" I3C_BUS_INFO_t gBus[I3C_BUS_COUNT_MAX] = { {.busno = 0, .DevCount = 0, .pDevList = NULL, .pCurrentMaster = NULL, diff --git a/include/drivers/i3c/NPCM4XX/i3c_core.h b/drivers/i3c/npcm4xx/i3c_core.h similarity index 99% rename from include/drivers/i3c/NPCM4XX/i3c_core.h rename to drivers/i3c/npcm4xx/i3c_core.h index b58845ec873d45..fe080870ffd2bf 100644 --- a/include/drivers/i3c/NPCM4XX/i3c_core.h +++ b/drivers/i3c/npcm4xx/i3c_core.h @@ -5,7 +5,7 @@ #ifndef __I3C_CORE_H__ #define __I3C_CORE_H__ -#include +#include "pub_I3C.h" /* * variable diff --git a/include/drivers/i3c/NPCM4XX/i3c_drv.h b/drivers/i3c/npcm4xx/i3c_drv.h similarity index 99% rename from include/drivers/i3c/NPCM4XX/i3c_drv.h rename to drivers/i3c/npcm4xx/i3c_drv.h index 7d5b8c9d4282a2..26b0c3b68fd555 100644 --- a/include/drivers/i3c/NPCM4XX/i3c_drv.h +++ b/drivers/i3c/npcm4xx/i3c_drv.h @@ -14,7 +14,7 @@ #include #include -#include +#include "pub_I3C.h" #define DT_DRV_COMPAT nuvoton_npcm4xx_i3c diff --git a/drivers/i3c/NPCM4XX/i3c_master.c b/drivers/i3c/npcm4xx/i3c_master.c similarity index 99% rename from drivers/i3c/NPCM4XX/i3c_master.c rename to drivers/i3c/npcm4xx/i3c_master.c index c7cc626f20a41a..53ec173f3c883c 100644 --- a/drivers/i3c/NPCM4XX/i3c_master.c +++ b/drivers/i3c/npcm4xx/i3c_master.c @@ -2,12 +2,12 @@ * Copyright (c) 2023 Nuvoton Technology Corporation. * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include -#include -#include -#include +#include "pub_I3C.h" +#include "i3c_core.h" +#include "i3c_master.h" +#include "i3c_slave.h" +#include "hal_I3C.h" +#include "i3c_drv.h" LOG_MODULE_REGISTER(npcm4xx_i3c_master, CONFIG_I3C_LOG_LEVEL); diff --git a/include/drivers/i3c/NPCM4XX/i3c_master.h b/drivers/i3c/npcm4xx/i3c_master.h similarity index 97% rename from include/drivers/i3c/NPCM4XX/i3c_master.h rename to drivers/i3c/npcm4xx/i3c_master.h index 6719fa8d8ea19c..9475fb06862fbf 100644 --- a/include/drivers/i3c/NPCM4XX/i3c_master.h +++ b/drivers/i3c/npcm4xx/i3c_master.h @@ -5,7 +5,7 @@ #ifndef __I3C_MASTER_H__ #define __I3C_MASTER_H__ -#include +#include "pub_I3C.h" #ifdef __cplusplus extern "C" diff --git a/drivers/i3c/NPCM4XX/i3c_slave.c b/drivers/i3c/npcm4xx/i3c_slave.c similarity index 97% rename from drivers/i3c/NPCM4XX/i3c_slave.c rename to drivers/i3c/npcm4xx/i3c_slave.c index b51e0a84b0bd47..4d51d504012aca 100644 --- a/drivers/i3c/NPCM4XX/i3c_slave.c +++ b/drivers/i3c/npcm4xx/i3c_slave.c @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include -#include -#include -#include -#include +#include "pub_I3C.h" +#include "i3c_core.h" +#include "i3c_master.h" +#include "i3c_slave.h" +#include "hal_I3C.h" +#include "i3c_drv.h" +#include "api_i3c.h" I3C_REG_ITEM_t *pSlaveReg[I3C_PORT_MAX] = { NULL, diff --git a/include/drivers/i3c/NPCM4XX/i3c_slave.h b/drivers/i3c/npcm4xx/i3c_slave.h similarity index 97% rename from include/drivers/i3c/NPCM4XX/i3c_slave.h rename to drivers/i3c/npcm4xx/i3c_slave.h index 46172cb9d1efe6..6bdf8c99882471 100644 --- a/include/drivers/i3c/NPCM4XX/i3c_slave.h +++ b/drivers/i3c/npcm4xx/i3c_slave.h @@ -5,7 +5,7 @@ #ifndef __I3C_SLAVE_H__ #define __I3C_SLAVE_H__ -#include +#include "pub_I3C.h" #ifdef __cplusplus extern "C" diff --git a/include/drivers/i3c/NPCM4XX/pub_I3C.h b/drivers/i3c/npcm4xx/pub_I3C.h similarity index 100% rename from include/drivers/i3c/NPCM4XX/pub_I3C.h rename to drivers/i3c/npcm4xx/pub_I3C.h