soc: logging: move soc tree to new logger
Use the new logger framework for soc related code. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
8e38670af3
commit
071c9dc0f3
7 changed files with 36 additions and 44 deletions
|
@ -10,4 +10,9 @@ menu "Hardware Configuration"
|
||||||
osource "$(SOC_DIR)/$(ARCH)/Kconfig"
|
osource "$(SOC_DIR)/$(ARCH)/Kconfig"
|
||||||
osource "$(SOC_DIR)/$(ARCH)/*/Kconfig"
|
osource "$(SOC_DIR)/$(ARCH)/*/Kconfig"
|
||||||
|
|
||||||
|
|
||||||
|
module = SOC
|
||||||
|
module-str = SOC
|
||||||
|
source "subsys/logging/Kconfig.template.log_config"
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
|
@ -24,6 +24,9 @@ extern void _NmiInit(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <system_nrf51.h>
|
#include <system_nrf51.h>
|
||||||
|
#define LOG_LEVEL CONFIG_SOC_LOG_LEVEL
|
||||||
|
#include <logging/log.h>
|
||||||
|
LOG_MODULE_REGISTER(soc);
|
||||||
|
|
||||||
static int nordicsemi_nrf51_init(struct device *arg)
|
static int nordicsemi_nrf51_init(struct device *arg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define SYS_LOG_LEVEL SYS_LOG_LEVEL_DEBUG
|
|
||||||
#include <logging/sys_log.h>
|
|
||||||
|
|
||||||
#include <zephyr.h>
|
#include <zephyr.h>
|
||||||
#include <soc_power.h>
|
#include <soc_power.h>
|
||||||
#include <nrf_power.h>
|
#include <nrf_power.h>
|
||||||
|
|
||||||
|
#define LOG_LEVEL CONFIG_SOC_LOG_LEVEL
|
||||||
|
#include <logging/log.h>
|
||||||
|
LOG_MODULE_DECLARE(soc);
|
||||||
|
|
||||||
#if defined(CONFIG_SYS_POWER_DEEP_SLEEP)
|
#if defined(CONFIG_SYS_POWER_DEEP_SLEEP)
|
||||||
/* System_OFF is deepest Power state available, On exiting from this
|
/* System_OFF is deepest Power state available, On exiting from this
|
||||||
* state CPU including all peripherals reset
|
* state CPU including all peripherals reset
|
||||||
|
@ -48,7 +48,7 @@ static void _low_power_mode(enum power_states state)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* Unsupported State */
|
/* Unsupported State */
|
||||||
SYS_LOG_ERR("Unsupported State\n");
|
LOG_ERR("Unsupported State");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ void _sys_soc_set_power_state(enum power_states state)
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
/* Unsupported State */
|
/* Unsupported State */
|
||||||
SYS_LOG_ERR("Unsupported State\n");
|
LOG_ERR("Unsupported State");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ void _sys_soc_power_state_post_ops(enum power_states state)
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
/* Unsupported State */
|
/* Unsupported State */
|
||||||
SYS_LOG_ERR("Unsupported State\n");
|
LOG_ERR("Unsupported State");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ bool _sys_soc_is_valid_power_state(enum power_states state)
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SYS_LOG_DBG("Unsupported State\n");
|
LOG_DBG("Unsupported State");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,10 @@ extern void _NmiInit(void);
|
||||||
#include <nrf.h>
|
#include <nrf.h>
|
||||||
#include <hal/nrf_power.h>
|
#include <hal/nrf_power.h>
|
||||||
|
|
||||||
|
#define LOG_LEVEL CONFIG_SOC_LOG_LEVEL
|
||||||
|
#include <logging/log.h>
|
||||||
|
LOG_MODULE_REGISTER(soc);
|
||||||
|
|
||||||
static int nordicsemi_nrf52_init(struct device *arg)
|
static int nordicsemi_nrf52_init(struct device *arg)
|
||||||
{
|
{
|
||||||
u32_t key;
|
u32_t key;
|
||||||
|
|
|
@ -27,26 +27,6 @@ config ARC_INIT
|
||||||
help
|
help
|
||||||
Allows x86 processor to kickoff the ARC slave processor.
|
Allows x86 processor to kickoff the ARC slave processor.
|
||||||
|
|
||||||
config SYS_LOG_ARC_INIT_LEVEL
|
|
||||||
int "Quark SE Sensor Subsystem log level"
|
|
||||||
depends on SYS_LOG
|
|
||||||
default 0
|
|
||||||
help
|
|
||||||
Sets log level for the boot initialization and boot process of the sensor
|
|
||||||
sub-system.
|
|
||||||
|
|
||||||
Levels are:
|
|
||||||
|
|
||||||
- 0 OFF, do not write
|
|
||||||
|
|
||||||
- 1 ERROR, only write SYS_LOG_ERR
|
|
||||||
|
|
||||||
- 2 WARNING, write SYS_LOG_WRN in addition to previous level
|
|
||||||
|
|
||||||
- 3 INFO, write SYS_LOG_INF in addition to previous levels
|
|
||||||
|
|
||||||
- 4 DEBUG, write SYS_LOG_DBG in addition to previous levels
|
|
||||||
|
|
||||||
config ARC_GDB_ENABLE
|
config ARC_GDB_ENABLE
|
||||||
bool "Allows the usage of GDB with the ARC processor."
|
bool "Allows the usage of GDB with the ARC processor."
|
||||||
depends on ARC_INIT
|
depends on ARC_INIT
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
#include "shared_mem.h"
|
#include "shared_mem.h"
|
||||||
#include <mmustructs.h>
|
#include <mmustructs.h>
|
||||||
|
|
||||||
|
#define LOG_LEVEL CONFIG_SOC_LOG_LEVEL
|
||||||
|
#include <logging/log.h>
|
||||||
|
LOG_MODULE_REGISTER(soc);
|
||||||
|
|
||||||
#ifdef CONFIG_X86_MMU
|
#ifdef CONFIG_X86_MMU
|
||||||
/* loapic */
|
/* loapic */
|
||||||
|
@ -50,9 +53,6 @@ MMU_BOOT_REGION(0xB0500000, 256*1024, MMU_ENTRY_WRITE);
|
||||||
#define SCSS_REG_VAL(offset) \
|
#define SCSS_REG_VAL(offset) \
|
||||||
(*((volatile u32_t *)(SCSS_REGISTER_BASE+offset)))
|
(*((volatile u32_t *)(SCSS_REGISTER_BASE+offset)))
|
||||||
|
|
||||||
#define SYS_LOG_LEVEL CONFIG_SYS_LOG_ARC_INIT_LEVEL
|
|
||||||
#include <logging/sys_log.h>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @brief ARC Init
|
* @brief ARC Init
|
||||||
|
@ -78,12 +78,12 @@ int _arc_init(struct device *arg)
|
||||||
* we read the value and stick it in shared_mem->arc_start which is
|
* we read the value and stick it in shared_mem->arc_start which is
|
||||||
* the beginning of the address space at 0xA8000000 */
|
* the beginning of the address space at 0xA8000000 */
|
||||||
reset_vector = (u32_t *)RESET_VECTOR;
|
reset_vector = (u32_t *)RESET_VECTOR;
|
||||||
SYS_LOG_DBG("Reset vector address: %x", *reset_vector);
|
LOG_DBG("Reset vector address: %x", *reset_vector);
|
||||||
shared_data->arc_start = *reset_vector;
|
shared_data->arc_start = *reset_vector;
|
||||||
shared_data->flags = 0;
|
shared_data->flags = 0;
|
||||||
if (!shared_data->arc_start) {
|
if (!shared_data->arc_start) {
|
||||||
/* Reset vector points to NULL => skip ARC init. */
|
/* Reset vector points to NULL => skip ARC init. */
|
||||||
SYS_LOG_DBG("Reset vector is NULL, skipping ARC init.");
|
LOG_DBG("Reset vector is NULL, skipping ARC init.");
|
||||||
goto skip_arc_init;
|
goto skip_arc_init;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,14 +92,14 @@ int _arc_init(struct device *arg)
|
||||||
SCSS_REG_VAL(SCSS_SS_CFG) |= ARC_RUN_REQ_A;
|
SCSS_REG_VAL(SCSS_SS_CFG) |= ARC_RUN_REQ_A;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SYS_LOG_DBG("Waiting for arc to start...");
|
LOG_DBG("Waiting for arc to start...");
|
||||||
/* Block until the ARC core actually starts up */
|
/* Block until the ARC core actually starts up */
|
||||||
while (SCSS_REG_VAL(SCSS_SS_STS) & 0x4000) {
|
while (SCSS_REG_VAL(SCSS_SS_STS) & 0x4000) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Block until ARC's quark_se_init() sets a flag indicating it is ready,
|
/* Block until ARC's quark_se_init() sets a flag indicating it is ready,
|
||||||
* if we get stuck here ARC has run but has exploded very early */
|
* if we get stuck here ARC has run but has exploded very early */
|
||||||
SYS_LOG_DBG("Waiting for arc to init...");
|
LOG_DBG("Waiting for arc to init...");
|
||||||
while (!(shared_data->flags & ARC_READY)) {
|
while (!(shared_data->flags & ARC_READY)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,18 +4,18 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define SYS_LOG_LEVEL SYS_LOG_LEVEL_INFO
|
|
||||||
#define SYS_LOG_DOMAIN "soc/s1000"
|
|
||||||
|
|
||||||
#include <device.h>
|
#include <device.h>
|
||||||
#include <xtensa_api.h>
|
#include <xtensa_api.h>
|
||||||
#include <xtensa/xtruntime.h>
|
#include <xtensa/xtruntime.h>
|
||||||
#include <logging/sys_log.h>
|
|
||||||
#include <board.h>
|
#include <board.h>
|
||||||
#include <irq_nextlevel.h>
|
#include <irq_nextlevel.h>
|
||||||
#include <xtensa/hal.h>
|
#include <xtensa/hal.h>
|
||||||
#include <init.h>
|
#include <init.h>
|
||||||
|
|
||||||
|
#define LOG_LEVEL CONFIG_SOC_LOG_LEVEL
|
||||||
|
#include <logging/log.h>
|
||||||
|
LOG_MODULE_REGISTER(soc);
|
||||||
|
|
||||||
static u32_t ref_clk_freq;
|
static u32_t ref_clk_freq;
|
||||||
|
|
||||||
void _soc_irq_enable(u32_t irq)
|
void _soc_irq_enable(u32_t irq)
|
||||||
|
@ -42,7 +42,7 @@ void _soc_irq_enable(u32_t irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dev_cavs) {
|
if (!dev_cavs) {
|
||||||
SYS_LOG_DBG("board: CAVS device binding failed\n");
|
LOG_DBG("board: CAVS device binding failed");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ void _soc_irq_enable(u32_t irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dev_ictl) {
|
if (!dev_ictl) {
|
||||||
SYS_LOG_DBG("board: DW intr_control device binding failed\n");
|
LOG_DBG("board: DW intr_control device binding failed");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ void _soc_irq_disable(u32_t irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dev_cavs) {
|
if (!dev_cavs) {
|
||||||
SYS_LOG_DBG("board: CAVS device binding failed\n");
|
LOG_DBG("board: CAVS device binding failed");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ void _soc_irq_disable(u32_t irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dev_ictl) {
|
if (!dev_ictl) {
|
||||||
SYS_LOG_DBG("board: DW intr_control device binding failed\n");
|
LOG_DBG("board: DW intr_control device binding failed");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ static int soc_init(struct device *dev)
|
||||||
soc_read_bootstraps();
|
soc_read_bootstraps();
|
||||||
|
|
||||||
ref_clk_freq = soc_get_ref_clk_freq();
|
ref_clk_freq = soc_get_ref_clk_freq();
|
||||||
SYS_LOG_INF("Reference clock frequency: %u Hz", ref_clk_freq);
|
LOG_INF("Reference clock frequency: %u Hz", ref_clk_freq);
|
||||||
|
|
||||||
soc_set_resource_ownership();
|
soc_set_resource_ownership();
|
||||||
soc_set_power_and_clock();
|
soc_set_power_and_clock();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue