diff --git a/build/uniproton_config/config_armv8_kp920/defconfig b/build/uniproton_config/config_armv8_kp920/defconfig index da1033f0c33d15c15666482f6998459fba196a5e..44908d3a9759bd6305ae6ab12505ac510448a75c 100644 --- a/build/uniproton_config/config_armv8_kp920/defconfig +++ b/build/uniproton_config/config_armv8_kp920/defconfig @@ -283,4 +283,9 @@ CONFIG_CONFIG_BOARD_LOOPSPERMSEC=25000 # # Spi Modules Configuration # -# CONFIG_OS_SUPPORT_SPI is not set \ No newline at end of file +# CONFIG_OS_SUPPORT_SPI is not set + +# +# Log Modules Configuration +# +# CONFIG_OS_OPTION_LOG=y \ No newline at end of file diff --git a/demos/kp920/bsp/kp920/cpu_config.h b/demos/kp920/bsp/kp920/cpu_config.h index dc817f3fb0ba74338eec5085542017acb25eada3..ab8f3c12659bbcfb0b7092b0c9ee189471267b31 100644 --- a/demos/kp920/bsp/kp920/cpu_config.h +++ b/demos/kp920/bsp/kp920/cpu_config.h @@ -29,6 +29,9 @@ #define MMU_LPI_PEND_ADDR 0x202780B00000ULL /* 预留使用 */ #define MMU_LPI_PEND_ADDR_LEN 0x200000 +/*日志模块预留地址*/ +#define MMU_LOG_MEM_ADDR 0x59200000 + /* 系统硬件IO空间 */ #define MMU_ECAM_ADDR 0xd0000000ULL #define MMU_ECAM_ADDR_LEN 0x10000000ULL /* 256Bus * 32Device * 8Fuc * 4KB */ diff --git a/demos/kp920/bsp/mmu.c b/demos/kp920/bsp/mmu.c index fc1fbcf5d15748efd5d6a0be1720f1f7515a1638..c04f962e6a25ca8e03ef7768d544b75e21184876 100644 --- a/demos/kp920/bsp/mmu.c +++ b/demos/kp920/bsp/mmu.c @@ -7,6 +7,7 @@ #include "prt_sys.h" #include "prt_task.h" #include "cpu_config.h" +#include "prt_log.h" extern U64 g_mmu_page_begin; extern U64 g_mmu_page_end; @@ -27,6 +28,7 @@ typedef enum { MMU_ITS_TYPE, MMU_ITS1_TYPE, MMU_UART_TYPE, + MMU_LOG_TYPE, MMU_ECAM_TYPE, #ifdef OS_SUPPORT_SPI MMU_SUBCTRL_TYPE, @@ -99,6 +101,12 @@ static mmu_mmap_region_s g_mem_map_info[MMU_MAX_TYPE] = { .size = MMU_UART_ADDR_LEN, .max_level = 0x2, .attrs = MMU_ATTR_DEVICE_NGNRNE | MMU_ACCESS_RWX, + }, { + .virt = MMU_LOG_MEM_ADDR, + .phys = MMU_LOG_MEM_ADDR, + .size = SHM_MAP_SIZE, + .max_level = 0x2, + .attrs = MMU_ATTR_DEVICE_NGNRNE | MMU_ACCESS_RWX, }, { .virt = MMU_ECAM_ADDR, .phys = MMU_ECAM_ADDR, diff --git a/demos/kp920/config/prt_config.c b/demos/kp920/config/prt_config.c index 4f50778c0d452fd5c99addd18c948526288d69f7..f110badc261d8104bf57f84033a7bc72db8d7de5 100644 --- a/demos/kp920/config/prt_config.c +++ b/demos/kp920/config/prt_config.c @@ -13,6 +13,9 @@ * Description: UniProton的初始化C文件。 */ #include "prt_config_internal.h" +#include "cpu_config.h" +#include "prt_cpu_external.h" +#include "prt_log.h" OS_SEC_ALW_INLINE INLINE void OsConfigAddrSizeGet(uintptr_t addr, uintptr_t size, uintptr_t *destAddr, uintptr_t *destSize) @@ -211,8 +214,20 @@ static U32 OsHwiConfigReg(void) return OS_OK; } +#if defined(OS_OPTION_LOG) +static U32 PRT_LogMemInit(void) +{ + PRT_LogInit(MMU_LOG_MEM_ADDR); + (void)PRT_Log(OS_LOG_INFO, OS_LOG_F1, "PRT_Log init success1", 21); + return OS_OK; +} +#endif + /* 系统初始化注册表 */ struct OsModuleConfigInfo g_moduleConfigTab[] = { +#if defined(OS_OPTION_LOG) + {OS_MID_LOG, {NULL, PRT_LogMemInit}}, +#endif /* {模块号, 模块注册函数, 模块初始化函数} */ {OS_MID_SYS, {OsSysConfigReg, NULL}}, {OS_MID_MEM, {OsMemConfigReg, OsMemConfigInit}},