aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-stm32mp
diff options
context:
space:
mode:
authorPatrick Delaunay2020-11-06 19:01:29 +0100
committerPatrick Delaunay2021-01-13 09:52:58 +0100
commiteb653acd63c5d9b584cf3c924193d5c43eac6847 (patch)
tree776cb907784ef5e66d5cec44c7f27b506a580aa4 /arch/arm/mach-stm32mp
parentee6726be4f0dccb612f0193c62ca149164c8a5af (diff)
arm: stm32mp: migrate trace to log macro
Change debug and pr_ macro to log macro and define LOG_CATEGORY. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'arch/arm/mach-stm32mp')
-rw-r--r--arch/arm/mach-stm32mp/boot_params.c8
-rw-r--r--arch/arm/mach-stm32mp/cmd_stm32key.c3
-rw-r--r--arch/arm/mach-stm32mp/cpu.c18
-rw-r--r--arch/arm/mach-stm32mp/dram_init.c8
-rw-r--r--arch/arm/mach-stm32mp/fdt.c17
-rw-r--r--arch/arm/mach-stm32mp/pwr_regulator.c2
-rw-r--r--arch/arm/mach-stm32mp/spl.c16
7 files changed, 43 insertions, 29 deletions
diff --git a/arch/arm/mach-stm32mp/boot_params.c b/arch/arm/mach-stm32mp/boot_params.c
index 37ee9e1612c..13322e34d60 100644
--- a/arch/arm/mach-stm32mp/boot_params.c
+++ b/arch/arm/mach-stm32mp/boot_params.c
@@ -3,6 +3,8 @@
* Copyright (C) 2019, STMicroelectronics - All Rights Reserved
*/
+#define LOG_CATEGORY LOGC_ARCH
+
#include <common.h>
#include <log.h>
#include <asm/sections.h>
@@ -32,15 +34,15 @@ void save_boot_params(unsigned long r0, unsigned long r1, unsigned long r2,
*/
void *board_fdt_blob_setup(void)
{
- debug("%s: nt_fw_dtb=%lx\n", __func__, nt_fw_dtb);
+ log_debug("%s: nt_fw_dtb=%lx\n", __func__, nt_fw_dtb);
/* use external device tree only if address is valid */
if (nt_fw_dtb >= STM32_DDR_BASE) {
if (fdt_magic(nt_fw_dtb) == FDT_MAGIC)
return (void *)nt_fw_dtb;
- debug("%s: DTB not found.\n", __func__);
+ log_debug("%s: DTB not found.\n", __func__);
}
- debug("%s: fall back to builtin DTB, %p\n", __func__, &_end);
+ log_debug("%s: fall back to builtin DTB, %p\n", __func__, &_end);
return (void *)&_end;
}
diff --git a/arch/arm/mach-stm32mp/cmd_stm32key.c b/arch/arm/mach-stm32mp/cmd_stm32key.c
index 544bab38480..42fdc112388 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32key.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32key.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <console.h>
+#include <log.h>
#include <misc.h>
#include <dm/device.h>
#include <dm/uclass.h>
@@ -34,7 +35,7 @@ static void fuse_hash_value(u32 addr, bool print)
DM_DRIVER_GET(stm32mp_bsec),
&dev);
if (ret) {
- pr_err("Can't find stm32mp_bsec driver\n");
+ log_err("Can't find stm32mp_bsec driver\n");
return;
}
diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c
index 29c0d92195c..717f80e9ff3 100644
--- a/arch/arm/mach-stm32mp/cpu.c
+++ b/arch/arm/mach-stm32mp/cpu.c
@@ -2,6 +2,9 @@
/*
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
*/
+
+#define LOG_CATEGORY LOGC_ARCH
+
#include <common.h>
#include <clk.h>
#include <cpu_func.h>
@@ -463,8 +466,8 @@ static void setup_boot_mode(void)
struct udevice *dev;
int alias;
- pr_debug("%s: boot_ctx=0x%x => boot_mode=%x, instance=%d forced=%x\n",
- __func__, boot_ctx, boot_mode, instance, forced_mode);
+ log_debug("%s: boot_ctx=0x%x => boot_mode=%x, instance=%d forced=%x\n",
+ __func__, boot_ctx, boot_mode, instance, forced_mode);
switch (boot_mode & TAMP_BOOT_DEVICE_MASK) {
case BOOT_SERIAL_UART:
if (instance > ARRAY_SIZE(serial_addr))
@@ -510,7 +513,7 @@ static void setup_boot_mode(void)
env_set("boot_instance", "0");
break;
default:
- pr_debug("unexpected boot mode = %x\n", boot_mode);
+ log_debug("unexpected boot mode = %x\n", boot_mode);
break;
}
@@ -537,7 +540,7 @@ static void setup_boot_mode(void)
case BOOT_NORMAL:
break;
default:
- pr_debug("unexpected forced boot mode = %x\n", forced_mode);
+ log_debug("unexpected forced boot mode = %x\n", forced_mode);
break;
}
@@ -577,14 +580,13 @@ __weak int setup_mac_address(void)
enetaddr[i] = ((uint8_t *)&otp)[i];
if (!is_valid_ethaddr(enetaddr)) {
- pr_err("invalid MAC address in OTP %pM\n", enetaddr);
+ log_err("invalid MAC address in OTP %pM\n", enetaddr);
return -EINVAL;
}
- pr_debug("OTP MAC address = %pM\n", enetaddr);
+ log_debug("OTP MAC address = %pM\n", enetaddr);
ret = eth_env_set_enetaddr("ethaddr", enetaddr);
if (ret)
- pr_err("Failed to set mac address %pM from OTP: %d\n",
- enetaddr, ret);
+ log_err("Failed to set mac address %pM from OTP: %d\n", enetaddr, ret);
#endif
return 0;
diff --git a/arch/arm/mach-stm32mp/dram_init.c b/arch/arm/mach-stm32mp/dram_init.c
index 0e8ce63f4a2..32b177bb798 100644
--- a/arch/arm/mach-stm32mp/dram_init.c
+++ b/arch/arm/mach-stm32mp/dram_init.c
@@ -3,6 +3,8 @@
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
*/
+#define LOG_CATEGORY LOGC_ARCH
+
#include <common.h>
#include <dm.h>
#include <image.h>
@@ -21,15 +23,15 @@ int dram_init(void)
ret = uclass_get_device(UCLASS_RAM, 0, &dev);
if (ret) {
- debug("RAM init failed: %d\n", ret);
+ log_debug("RAM init failed: %d\n", ret);
return ret;
}
ret = ram_get_info(dev, &ram);
if (ret) {
- debug("Cannot get RAM size: %d\n", ret);
+ log_debug("Cannot get RAM size: %d\n", ret);
return ret;
}
- debug("RAM init base=%lx, size=%x\n", ram.base, ram.size);
+ log_debug("RAM init base=%lx, size=%x\n", ram.base, ram.size);
gd->ram_size = ram.size;
diff --git a/arch/arm/mach-stm32mp/fdt.c b/arch/arm/mach-stm32mp/fdt.c
index 0de1d822912..aaedeac8d5b 100644
--- a/arch/arm/mach-stm32mp/fdt.c
+++ b/arch/arm/mach-stm32mp/fdt.c
@@ -3,6 +3,8 @@
* Copyright (C) 2019-2020, STMicroelectronics - All Rights Reserved
*/
+#define LOG_CATEGORY LOGC_ARCH
+
#include <common.h>
#include <fdt_support.h>
#include <log.h>
@@ -172,15 +174,15 @@ static int stm32_fdt_fixup_etzpc(void *fdt, int soc_node)
status = (decprot[offset] >> shift) & DECPROT_MASK;
addr = array[i];
- debug("ETZPC: 0x%08x decprot %d=%d\n", addr, i, status);
+ log_debug("ETZPC: 0x%08x decprot %d=%d\n", addr, i, status);
if (addr == ETZPC_RESERVED ||
status == DECPROT_NON_SECURED)
continue;
if (fdt_disable_subnode_by_address(fdt, soc_node, addr))
- printf("ETZPC: 0x%08x node disabled, decprot %d=%d\n",
- addr, i, status);
+ log_notice("ETZPC: 0x%08x node disabled, decprot %d=%d\n",
+ addr, i, status);
}
return 0;
@@ -194,7 +196,7 @@ static void stm32_fdt_fixup_cpu(void *blob, char *name)
off = fdt_path_offset(blob, "/cpus");
if (off < 0) {
- printf("%s: couldn't find /cpus node\n", __func__);
+ log_warning("%s: couldn't find /cpus node\n", __func__);
return;
}
@@ -203,7 +205,8 @@ static void stm32_fdt_fixup_cpu(void *blob, char *name)
reg = fdtdec_get_addr(blob, off, "reg");
if (reg != 0) {
fdt_del_node(blob, off);
- printf("FDT: cpu %d node remove for %s\n", reg, name);
+ log_notice("FDT: cpu %d node remove for %s\n",
+ reg, name);
/* after delete we can't trust the offsets anymore */
off = -1;
}
@@ -216,8 +219,8 @@ static void stm32_fdt_disable(void *fdt, int offset, u32 addr,
const char *string, const char *name)
{
if (fdt_disable_subnode_by_address(fdt, offset, addr))
- printf("FDT: %s@%08x node disabled for %s\n",
- string, addr, name);
+ log_notice("FDT: %s@%08x node disabled for %s\n",
+ string, addr, name);
}
static void stm32_fdt_disable_optee(void *blob)
diff --git a/arch/arm/mach-stm32mp/pwr_regulator.c b/arch/arm/mach-stm32mp/pwr_regulator.c
index 766ed95f1a6..846637ab162 100644
--- a/arch/arm/mach-stm32mp/pwr_regulator.c
+++ b/arch/arm/mach-stm32mp/pwr_regulator.c
@@ -3,6 +3,8 @@
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
*/
+#define LOG_CATEGORY UCLASS_REGULATOR
+
#include <common.h>
#include <dm.h>
#include <errno.h>
diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c
index 66a634654ee..0c50ad54df6 100644
--- a/arch/arm/mach-stm32mp/spl.c
+++ b/arch/arm/mach-stm32mp/spl.c
@@ -3,6 +3,8 @@
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
*/
+#define LOG_CATEGORY LOGC_ARCH
+
#include <common.h>
#include <cpu_func.h>
#include <dm.h>
@@ -80,7 +82,7 @@ void spl_display_print(void)
*/
model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
if (model)
- printf("Model: %s\n", model);
+ log_info("Model: %s\n", model);
}
#endif
@@ -98,25 +100,25 @@ void board_init_f(ulong dummy)
ret = spl_early_init();
if (ret) {
- debug("spl_early_init() failed: %d\n", ret);
+ log_debug("spl_early_init() failed: %d\n", ret);
hang();
}
ret = uclass_get_device(UCLASS_CLK, 0, &dev);
if (ret) {
- debug("Clock init failed: %d\n", ret);
+ log_debug("Clock init failed: %d\n", ret);
hang();
}
ret = uclass_get_device(UCLASS_RESET, 0, &dev);
if (ret) {
- debug("Reset init failed: %d\n", ret);
+ log_debug("Reset init failed: %d\n", ret);
hang();
}
ret = uclass_get_device(UCLASS_PINCTRL, 0, &dev);
if (ret) {
- debug("%s: Cannot find pinctrl device\n", __func__);
+ log_debug("%s: Cannot find pinctrl device\n", __func__);
hang();
}
@@ -125,13 +127,13 @@ void board_init_f(ulong dummy)
ret = board_early_init_f();
if (ret) {
- debug("board_early_init_f() failed: %d\n", ret);
+ log_debug("board_early_init_f() failed: %d\n", ret);
hang();
}
ret = uclass_get_device(UCLASS_RAM, 0, &dev);
if (ret) {
- printf("DRAM init failed: %d\n", ret);
+ log_err("DRAM init failed: %d\n", ret);
hang();
}