From patchwork Fri Nov 6 18:01:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 1395804 X-Patchwork-Delegate: patrick.delaunay73@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.a=rsa-sha256 header.s=STMicroelectronics header.b=sA8An2Dy; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CSSsV1k4mz9sTD for ; Sat, 7 Nov 2020 05:02:38 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 35E29824C4; Fri, 6 Nov 2020 19:02:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="sA8An2Dy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 423A8824AE; Fri, 6 Nov 2020 19:02:16 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 19743808F1 for ; Fri, 6 Nov 2020 19:02:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=patrick.delaunay@st.com Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A6Hw7RH022204; Fri, 6 Nov 2020 19:02:06 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=11E36KKDnjmRDGmBM01Od1KyPHcHAM0H57GQwUzgpJ4=; b=sA8An2Dysl2HA1iHuWONX2zb6psddYc5bs+J01wkPRkxRZXkZWoXXlPPKJKOKy3NUlVE 35vQjWHSx/ZFH+LyMk0TwY3yfcIhXX/EcLQ7lbsoizbeBfJM3DVvKwNF+GRi8G0l5eHj kFTDq9fWNXLc+9PRoRSqeNYA31UHvgQeDNPYwqH2zwYwTXf1z/2IFIu5CBSGkRA4gXTT XwHR24mOXYOI/bbACIN4ou+CbE2Gj2T8FfxkneA4SSVKU82otICT47y5EVa7Z/e7MuBb fwk53UT3QlrsRKc1+bQKnhYbltUwZ1J2L99FB7qxamwnSo5ALUfxEa19pscS5ffhsTFJ Ng== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 34h00ewu61-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Nov 2020 19:02:06 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7941410002A; Fri, 6 Nov 2020 19:02:06 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 6F4D824B21F; Fri, 6 Nov 2020 19:02:06 +0100 (CET) Received: from localhost (10.75.127.44) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 6 Nov 2020 19:02:05 +0100 From: Patrick Delaunay To: CC: Patrick Delaunay , Patrice Chotard , Tom Rini , U-Boot STM32 Subject: [PATCH v2 01/33] arm: stm32mp: migrate trace to log macro Date: Fri, 6 Nov 2020 19:01:29 +0100 Message-ID: <20201106180201.31784-2-patrick.delaunay@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201106180201.31784-1-patrick.delaunay@st.com> References: <20201106180201.31784-1-patrick.delaunay@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG3NODE1.st.com (10.75.127.7) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-06_06:2020-11-05, 2020-11-06 signatures=0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Change debug and pr_ macro to log macro and define LOG_CATEGORY. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- (no changes since v1) arch/arm/mach-stm32mp/boot_params.c | 8 +++++--- arch/arm/mach-stm32mp/cmd_stm32key.c | 3 ++- arch/arm/mach-stm32mp/cpu.c | 18 ++++++++++-------- arch/arm/mach-stm32mp/dram_init.c | 8 +++++--- arch/arm/mach-stm32mp/fdt.c | 17 ++++++++++------- arch/arm/mach-stm32mp/pwr_regulator.c | 2 ++ arch/arm/mach-stm32mp/spl.c | 16 +++++++++------- 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 37ee9e1612..13322e34d6 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 #include #include @@ -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 f191085a12..86307a9ae8 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32key.c +++ b/arch/arm/mach-stm32mp/cmd_stm32key.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,7 @@ static void fuse_hash_value(u32 addr, bool print) DM_GET_DRIVER(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 6785ab6b58..b79fa9e4cf 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 #include #include @@ -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 0e8ce63f4a..32b177bb79 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 #include #include @@ -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 0de1d82291..aaedeac8d5 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 #include #include @@ -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 900dee4c38..b9b4c7d439 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 #include #include diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c index b679b0a645..01776ee99a 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 #include #include @@ -78,7 +80,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 @@ -96,25 +98,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(); } @@ -123,13 +125,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(); }