From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96B08C433FE for ; Fri, 7 Oct 2022 12:21:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 61FF984E92; Fri, 7 Oct 2022 14:20:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=thorsis.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=thorsis.com header.i=@thorsis.com header.b="RGLDzQ4A"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A737D84E86; Fri, 7 Oct 2022 14:20:17 +0200 (CEST) Received: from mail.thorsis.com (mail.thorsis.com [92.198.35.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 83CD984E81 for ; Fri, 7 Oct 2022 14:20:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=thorsis.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ada@thorsis.com Received: from adahl by ada.ifak-system.com with local (Exim 4.92) (envelope-from ) id 1ogmKh-0002xZ-B0; Fri, 07 Oct 2022 14:20:03 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=default; t=1665145203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZUuI5p19copf7LXx4WTKN+8LyQVL3A1T4oXbpdRTxOk=; b=RGLDzQ4Avaw7fTgGCsJ9REpU+UJy5XDCR5SPfXKN6bnyFnsuuhebw3IfW9YNWMgwrkb+2W rA0FlsuSokRomBOyYUP8DZWNiMA+TEuFkIK2jENYEgVDSSkLIMHxFHEXFDxN/p6AKmUucq e6kEK48p/7+gsPawERMlE8xjsfgIE6j5mU/Lq+cEx841QFLwUv6xzlyh7CgnqeqANWo1Z4 bQjGA6oMM7iNoxQSxkbdSTe42X5yvIJA8dxdnD0a/buByjt5j+Fwtb+iIuW5/U8TE1ABmH o5ahxSSH04vrc6QoZwu7HbgmPM9j+UpgkZ+urXDdAeVlMH23Yf2BN/POMxa2IA== From: Alexander Dahl To: u-boot@lists.denx.de Cc: Michal Simek Subject: [PATCH v4 10/10] fpga: virtex2: Use logging feature instead of FPGA_DEBUG Date: Fri, 7 Oct 2022 14:20:03 +0200 Message-Id: <20221007122003.11239-11-ada@thorsis.com> In-Reply-To: <20221007122003.11239-1-ada@thorsis.com> References: <20221007122003.11239-1-ada@thorsis.com> Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.6 at phobos.denx.de X-Virus-Status: Clean Instead of using DEBUG or LOG_DEBUG the driver still had its own definition for debug output. Signed-off-by: Alexander Dahl --- drivers/fpga/virtex2.c | 69 ++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 39 deletions(-) diff --git a/drivers/fpga/virtex2.c b/drivers/fpga/virtex2.c index e769ceebc1..0d536f0d04 100644 --- a/drivers/fpga/virtex2.c +++ b/drivers/fpga/virtex2.c @@ -12,21 +12,14 @@ * on spartan2.c (Rich Ireland, rireland@enterasys.com). */ +#define LOG_CATEGORY UCLASS_FPGA + #include #include +#include #include #include -#if 0 -#define FPGA_DEBUG -#endif - -#ifdef FPGA_DEBUG -#define PRINTF(fmt, args...) printf(fmt, ##args) -#else -#define PRINTF(fmt, args...) -#endif - /* * If the SelectMap interface can be overrun by the processor, define * CONFIG_SYS_FPGA_CHECK_BUSY and/or CONFIG_FPGA_DELAY in the board @@ -89,12 +82,12 @@ static int virtex2_load(xilinx_desc *desc, const void *buf, size_t bsize, switch (desc->iface) { case slave_serial: - PRINTF("%s: Launching Slave Serial Load\n", __func__); + log_debug("Launching Slave Serial Load\n"); ret_val = virtex2_ss_load(desc, buf, bsize); break; case slave_selectmap: - PRINTF("%s: Launching Slave Parallel Load\n", __func__); + log_debug("Launching Slave Parallel Load\n"); ret_val = virtex2_ssm_load(desc, buf, bsize); break; @@ -111,12 +104,12 @@ static int virtex2_dump(xilinx_desc *desc, const void *buf, size_t bsize) switch (desc->iface) { case slave_serial: - PRINTF("%s: Launching Slave Serial Dump\n", __func__); + log_debug("Launching Slave Serial Dump\n"); ret_val = virtex2_ss_dump(desc, buf, bsize); break; case slave_parallel: - PRINTF("%s: Launching Slave Parallel Dump\n", __func__); + log_debug("Launching Slave Parallel Dump\n"); ret_val = virtex2_ssm_dump(desc, buf, bsize); break; @@ -150,8 +143,7 @@ static int virtex2_slave_pre(xilinx_virtex2_slave_fns *fn, int cookie) { unsigned long ts; - PRINTF("%s:%d: Start with interface functions @ 0x%p\n", - __func__, __LINE__, fn); + log_debug("Start with interface functions @ 0x%p\n", fn); if (!fn) { printf("%s:%d: NULL Interface function table!\n", @@ -160,25 +152,24 @@ static int virtex2_slave_pre(xilinx_virtex2_slave_fns *fn, int cookie) } /* Gotta split this one up (so the stack won't blow??) */ - PRINTF("%s:%d: Function Table:\n" - " base 0x%p\n" - " struct 0x%p\n" - " pre 0x%p\n" - " prog 0x%p\n" - " init 0x%p\n" - " error 0x%p\n", - __func__, __LINE__, - &fn, fn, fn->pre, fn->pgm, fn->init, fn->err); - PRINTF(" clock 0x%p\n" - " cs 0x%p\n" - " write 0x%p\n" - " rdata 0x%p\n" - " wdata 0x%p\n" - " busy 0x%p\n" - " abort 0x%p\n" - " post 0x%p\n\n", - fn->clk, fn->cs, fn->wr, fn->rdata, fn->wdata, - fn->busy, fn->abort, fn->post); + log_debug("Function Table:\n" + " base 0x%p\n" + " struct 0x%p\n" + " pre 0x%p\n" + " prog 0x%p\n" + " init 0x%p\n" + " error 0x%p\n", + &fn, fn, fn->pre, fn->pgm, fn->init, fn->err); + log_debug(" clock 0x%p\n" + " cs 0x%p\n" + " write 0x%p\n" + " rdata 0x%p\n" + " wdata 0x%p\n" + " busy 0x%p\n" + " abort 0x%p\n" + " post 0x%p\n\n", + fn->clk, fn->cs, fn->wr, fn->rdata, fn->wdata, + fn->busy, fn->abort, fn->post); #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK printf("Initializing FPGA Device %d...\n", cookie); @@ -330,8 +321,8 @@ static int virtex2_ssm_load(xilinx_desc *desc, const void *buf, size_t bsize) #endif if ((*fn->done)(cookie) == FPGA_SUCCESS) { - PRINTF("%s:%d:done went active early, bytecount = %zu\n", - __func__, __LINE__, bytecount); + log_debug("done went active early, bytecount = %zu\n", + bytecount); break; } @@ -465,8 +456,8 @@ static int virtex2_ss_load(xilinx_desc *desc, const void *buf, size_t bsize) #endif if ((*fn->done)(cookie) == FPGA_SUCCESS) { - PRINTF("%s:%d:done went active early, bytecount = %zu\n", - __func__, __LINE__, bytecount); + log_debug("done went active early, bytecount = %zu\n", + bytecount); break; } -- 2.30.2