From patchwork Wed Sep 21 13:22:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 1680684 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=thorsis.com header.i=@thorsis.com header.a=rsa-sha256 header.s=default header.b=Cogsadr4; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MXfJD21Nwz1ypX for ; Wed, 21 Sep 2022 23:23:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1A92684CBC; Wed, 21 Sep 2022 15:23:00 +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="Cogsadr4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BFAA98497B; Wed, 21 Sep 2022 15:22:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 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 154E084CA4 for ; Wed, 21 Sep 2022 15:22:26 +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 1oazgG-0001rK-Cc; Wed, 21 Sep 2022 15:22:24 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=default; t=1663766544; 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=jlFBKQdqwaEgVbcNphBzH5GghM4MgSzQiO4jGelfGac=; b=Cogsadr4Rp+BslkZbaG5Wj/CPITeQ4P0veasOKNa9aYT9PdpceoqpJMWXhJibFFBNiZu6s 2f1fSGiEabXMwlMS/ADtdUgxOX75e2OS0/znjcbdp92dmf7kKBn4tElqxNkKqL6aZbB+/a nIt7tme/eKLJ3W1EOp5r52G2FGFQTjyd4OCzEdTGwGrRnlRnpAfimUGESzbggA9jKeMpD/ aMqlVpysDiYmLtUplr4x7KAz7b4I1dLef7z3Mnny8EaB+Q3T6oqmNlliIh35Uo5IRw3khp kwBvTao2TYs5XBPc+Hy62xNZm4NrXaedwQlbRsvIJq7zu0AM3vEkPRm8IG/3Ug== From: Alexander Dahl To: u-boot@lists.denx.de Cc: Michal Simek , Simon Glass Subject: [PATCH v2 1/8] dm: fpga: Introduce new uclass Date: Wed, 21 Sep 2022 15:22:09 +0200 Message-Id: <20220921132216.7089-2-ada@thorsis.com> In-Reply-To: <20220921132216.7089-1-ada@thorsis.com> References: <20220921132216.7089-1-ada@thorsis.com> 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 For future DM based FPGA drivers and for now to have a meaningful logging class for old FPGA drivers. Suggested-by: Michal Simek Signed-off-by: Alexander Dahl --- include/dm/uclass-id.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index a432e43871..c2b15881ba 100644 --- a/include/dm/uclass-id.h +++ b/include/dm/uclass-id.h @@ -56,6 +56,7 @@ enum uclass_id { UCLASS_ETH, /* Ethernet device */ UCLASS_ETH_PHY, /* Ethernet PHY device */ UCLASS_FIRMWARE, /* Firmware */ + UCLASS_FPGA, /* FPGA device */ UCLASS_FUZZING_ENGINE, /* Fuzzing engine */ UCLASS_FS_FIRMWARE_LOADER, /* Generic loader */ UCLASS_GPIO, /* Bank of general-purpose I/O pins */ From patchwork Wed Sep 21 13:22:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 1680682 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=thorsis.com header.i=@thorsis.com header.a=rsa-sha256 header.s=default header.b=bng9b1sG; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MXfHp57hHz1ypX for ; Wed, 21 Sep 2022 23:23:34 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6421184CA9; Wed, 21 Sep 2022 15:22:56 +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="bng9b1sG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B59C984C9D; Wed, 21 Sep 2022 15:22:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 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 A1CE684C99 for ; Wed, 21 Sep 2022 15:22:25 +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 1oazgG-0001rN-Dw; Wed, 21 Sep 2022 15:22:24 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=default; t=1663766544; 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=wYAuFToenkCYv07PikbMDdn1XhsWrH1dvRDF8slQLj0=; b=bng9b1sGaRBWCr4sFaPwldn+sbA1jcROZmYePDGePfnCsil6E+xkqp0TGPc/2e2yhG7QJ4 fAJJymwLHETMcTcz8rhgeHAEhij3VTJoeGLZoETxsrqHJFWRVV/IAFk6gxIvNNXzxI5/b+ F41Bq4VbJQAmTiGM9EezWrSYaIz4eHR9Ix6JaOwrjN6353sHY5Q3GbNEMEzQCTbH6FFevb lFOKiULNaB2kE7A2Sxd8ieYmX9Ln4KvZOdDvuita+IKCMPfNb7E3IcvElr+qAKFBgm0vTu IG8c6rygGlnQznON13sjIaBgw8Q7qFsN8xSrBRj7s/ip/EF4Kh0g3vj6Sybp0g== From: Alexander Dahl To: u-boot@lists.denx.de Cc: Michal Simek , Simon Glass Subject: [PATCH v2 2/8] fpga: altera: Use logging feature instead of FPGA_DEBUG Date: Wed, 21 Sep 2022 15:22:10 +0200 Message-Id: <20220921132216.7089-3-ada@thorsis.com> In-Reply-To: <20220921132216.7089-1-ada@thorsis.com> References: <20220921132216.7089-1-ada@thorsis.com> 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/altera.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/fpga/altera.c b/drivers/fpga/altera.c index 10c0475d25..e969d83de7 100644 --- a/drivers/fpga/altera.c +++ b/drivers/fpga/altera.c @@ -7,6 +7,8 @@ * Rich Ireland, Enterasys Networks, rireland@enterasys.com. */ +#define LOG_CATEGORY UCLASS_FPGA + /* * Altera FPGA support */ @@ -16,9 +18,6 @@ #include #include -/* Define FPGA_DEBUG to 1 to get debug printf's */ -#define FPGA_DEBUG 0 - static const struct altera_fpga { enum altera_family family; const char *name; @@ -106,8 +105,8 @@ int altera_load(Altera_desc *desc, const void *buf, size_t bsize) if (!fpga) return FPGA_FAIL; - debug_cond(FPGA_DEBUG, "%s: Launching the %s Loader...\n", - __func__, fpga->name); + log_debug("%s: Launching the %s Loader...\n", + __func__, fpga->name); if (fpga->load) return fpga->load(desc, buf, bsize); return 0; @@ -120,8 +119,8 @@ int altera_dump(Altera_desc *desc, const void *buf, size_t bsize) if (!fpga) return FPGA_FAIL; - debug_cond(FPGA_DEBUG, "%s: Launching the %s Reader...\n", - __func__, fpga->name); + log_debug("%s: Launching the %s Reader...\n", + __func__, fpga->name); if (fpga->dump) return fpga->dump(desc, buf, bsize); return 0; From patchwork Wed Sep 21 13:22:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 1680681 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=thorsis.com header.i=@thorsis.com header.a=rsa-sha256 header.s=default header.b=rsNwKFQT; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MXfHc2zyYz1ypX for ; Wed, 21 Sep 2022 23:23:24 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CA65D84CB2; Wed, 21 Sep 2022 15:22:53 +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="rsNwKFQT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5A0D084C9A; Wed, 21 Sep 2022 15:22:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 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 114B884CA2 for ; Wed, 21 Sep 2022 15:22:26 +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 1oazgG-0001rQ-F2; Wed, 21 Sep 2022 15:22:24 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=default; t=1663766544; 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=Z4kcbKDFWGCeav5bee2iA3r6SKqH0GcloxdLW64cWqo=; b=rsNwKFQTl1APgSEaO3u1ZQCM1uXZ656F/1qLs2Q4ooIPfzbVmRWfDrF2roIhb5q/REQBPy rOo7w4FZqtyWWfruqvSAkr74s8SHdF8JyqOhYzT8UGp61N36M45PwFVyXJsbnjxX+J4Nxl FXVZaYOfpFEYJtc9krW95wRb34bu5tD4EdOuzjmeb/yp7neMucb221l0+1wN9kRlpVBv5c 9skvFyXdm74vqF7dSWVGbP8cA/vJjJcLcJgg0hzh4/k0gtCnBGnW4DtS7l/v9T1msnxk2O +WbVrp5/i93PT4wX96OseWXY+vE2BdQk5xhuhkHlRQzhUnUrsmWrnzCUcviVxQ== From: Alexander Dahl To: u-boot@lists.denx.de Cc: Michal Simek , Simon Glass Subject: [PATCH v2 3/8] fpga: cyclon2: Use logging feature instead of FPGA_DEBUG Date: Wed, 21 Sep 2022 15:22:11 +0200 Message-Id: <20220921132216.7089-4-ada@thorsis.com> In-Reply-To: <20220921132216.7089-1-ada@thorsis.com> References: <20220921132216.7089-1-ada@thorsis.com> 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/cyclon2.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/fpga/cyclon2.c b/drivers/fpga/cyclon2.c index 3b008facb8..7dc241b269 100644 --- a/drivers/fpga/cyclon2.c +++ b/drivers/fpga/cyclon2.c @@ -5,18 +5,14 @@ * Based on ACE1XK.c */ +#define LOG_CATEGORY UCLASS_FPGA + #include /* core U-Boot definitions */ +#include #include #include /* ACEX device family */ #include -/* Define FPGA_DEBUG to get debug printf's */ -#ifdef FPGA_DEBUG -#define PRINTF(fmt, args...) printf(fmt, ##args) -#else -#define PRINTF(fmt, args...) -#endif - /* Note: The assumption is that we cannot possibly run fast enough to * overrun the device (the Slave Parallel mode can free run at 50MHz). * If there is a need to operate slower, define CONFIG_FPGA_DELAY in @@ -42,7 +38,7 @@ int CYC2_load(Altera_desc *desc, const void *buf, size_t bsize) switch (desc->iface) { case passive_serial: - PRINTF("%s: Launching Passive Serial Loader\n", __func__); + log_debug("%s: Launching Passive Serial Loader\n", __func__); ret_val = CYC2_ps_load(desc, buf, bsize); break; @@ -51,8 +47,8 @@ int CYC2_load(Altera_desc *desc, const void *buf, size_t bsize) * done in the write() callback. Use the existing PS load * function for FPP, too. */ - PRINTF("%s: Launching Fast Passive Parallel Loader\n", - __func__); + log_debug("%s: Launching Fast Passive Parallel Loader\n", + __func__); ret_val = CYC2_ps_load(desc, buf, bsize); break; @@ -72,7 +68,7 @@ int CYC2_dump(Altera_desc *desc, const void *buf, size_t bsize) switch (desc->iface) { case passive_serial: - PRINTF("%s: Launching Passive Serial Dump\n", __func__); + log_debug("%s: Launching Passive Serial Dump\n", __func__); ret_val = CYC2_ps_dump(desc, buf, bsize); break; @@ -99,14 +95,14 @@ static int CYC2_ps_load(Altera_desc *desc, const void *buf, size_t bsize) Altera_CYC2_Passive_Serial_fns *fn = desc->iface_fns; int ret = 0; - PRINTF("%s: start with interface functions @ 0x%p\n", - __func__, fn); + log_debug("%s: start with interface functions @ 0x%p\n", + __func__, fn); if (fn) { int cookie = desc->cookie; /* make a local copy */ unsigned long ts; /* timestamp */ - PRINTF("%s: Function Table:\n" + log_debug("%s: Function Table:\n" "ptr:\t0x%p\n" "struct: 0x%p\n" "config:\t0x%p\n" From patchwork Wed Sep 21 13:22:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 1680677 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=thorsis.com header.i=@thorsis.com header.a=rsa-sha256 header.s=default header.b=oJThmcO2; 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MXfGj0SLBz1ypX for ; Wed, 21 Sep 2022 23:22:37 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C146E849C5; Wed, 21 Sep 2022 15:22:29 +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="oJThmcO2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0F39284CA5; Wed, 21 Sep 2022 15:22:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 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 7C5F38497B for ; Wed, 21 Sep 2022 15:22:25 +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 1oazgG-0001rT-G8; Wed, 21 Sep 2022 15:22:24 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=default; t=1663766544; 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=Xm0X5+NAZ9sZrXcojac/GOAc84htVFk8AgoCj5ImVWk=; b=oJThmcO2tswSqGZy23j/KsklPt6e2/0O4Np8vWEYoYk+yNSkXuAAEunDiDVWYt5pns4n4F Tg+gqwC//bu242VoKH3P8/EkdGj6F6aZGv9bihiI1xEfpmpi+r7d2J87Mf1ijPuFe+IIwF NOuich210trl+8yhqIZ6caodGsoDQ2UENie+34D66pjy+dD8GNOcaxq7asr0Podl2dpL7T ig7y0l6nQez5ff8S5MjvtFMY38e1lG8b63nFRp74oOIn1aTjgHfhfwqKrFpNbVgkPKwzZM gUKMiL3JQotg0uB1FMEWrMHBJSiuYY2vM6EJrGNrZ8QVhZin44ymzcynzNAgzQ== From: Alexander Dahl To: u-boot@lists.denx.de Cc: Michal Simek , Simon Glass Subject: [PATCH v2 4/8] fpga: Add missing Kconfig symbols for old FPGA drivers Date: Wed, 21 Sep 2022 15:22:12 +0200 Message-Id: <20220921132216.7089-5-ada@thorsis.com> In-Reply-To: <20220921132216.7089-1-ada@thorsis.com> References: <20220921132216.7089-1-ada@thorsis.com> 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 Those drivers could not be built anymore without those options present. Signed-off-by: Alexander Dahl --- drivers/fpga/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig index e07a9cf80e..4d55f60ba9 100644 --- a/drivers/fpga/Kconfig +++ b/drivers/fpga/Kconfig @@ -27,6 +27,12 @@ config FPGA_STRATIX_V help Say Y here to enable the Altera Stratix V FPGA specific driver. +config FPGA_ACEX1K + bool "Enable Altera ACEX 1K driver" + depends on FPGA_ALTERA + help + Say Y here to enable the Altera ACEX 1K FPGA specific driver. + config FPGA_CYCLON2 bool "Enable Altera FPGA driver for Cyclone II" depends on FPGA_ALTERA @@ -71,6 +77,12 @@ config FPGA_VERSALPL Versal. The bitstream will only be generated as PDI for Versal platform. +config FPGA_SPARTAN2 + bool "Enable Spartan2 FPGA driver" + depends on FPGA_XILINX + help + Enable Spartan2 FPGA driver. + config FPGA_SPARTAN3 bool "Enable Spartan3 FPGA driver" depends on FPGA_XILINX From patchwork Wed Sep 21 13:22:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 1680678 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=thorsis.com header.i=@thorsis.com header.a=rsa-sha256 header.s=default header.b=ri+fJHVq; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MXfGx3ZW0z1ypX for ; Wed, 21 Sep 2022 23:22:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 515FF84C9D; Wed, 21 Sep 2022 15:22:33 +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="ri+fJHVq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AA7D384CA6; Wed, 21 Sep 2022 15:22:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 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 9E23684A28 for ; Wed, 21 Sep 2022 15:22:25 +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 1oazgG-0001rW-HE; Wed, 21 Sep 2022 15:22:24 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=default; t=1663766545; 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=MDwSEOD0mjDYQNc2w4U7uZqhgl5esygYazqF/oe5KM4=; b=ri+fJHVqGUmwvWAIEg34Xsz+iif7T91d5MQS0N+yL5YtuY5pzae2e+vcsyVQXTsfIhoYCh gjg/83VufrsjaLgJi4h93DH71I0OxHV+JEuGS5/z3yqMFWiv7xNUTGgnJ8pD7STTNWdxQ5 0eqth63kXFXL51x2LcNrcvq2cPDXAwlsZOch39L0Zfvgs4zC8evj2z37IxI2zqcg+fT59B FHi7pfkjtUhcBDQWzEpCHFeHM0jqkRUfPc6Hp9OaSx5Q/Y/O9ZI1mtzMJ//I0/m7/Rokc4 e2bXiAotqC1VrdR9JG4KqyxXon02z/JstJAd0gp4py2PhcZpzI56WejdwEHj6w== From: Alexander Dahl To: u-boot@lists.denx.de Cc: Michal Simek , Simon Glass Subject: [PATCH v2 5/8] fpga: ACEX1K: Use logging feature instead of FPGA_DEBUG Date: Wed, 21 Sep 2022 15:22:13 +0200 Message-Id: <20220921132216.7089-6-ada@thorsis.com> In-Reply-To: <20220921132216.7089-1-ada@thorsis.com> References: <20220921132216.7089-1-ada@thorsis.com> 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/ACEX1K.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/fpga/ACEX1K.c b/drivers/fpga/ACEX1K.c index aca8049c56..3877aedb1d 100644 --- a/drivers/fpga/ACEX1K.c +++ b/drivers/fpga/ACEX1K.c @@ -7,18 +7,14 @@ * Rich Ireland, Enterasys Networks, rireland@enterasys.com. */ +#define LOG_CATEGORY UCLASS_FPGA + #include /* core U-Boot definitions */ #include +#include #include /* ACEX device family */ #include -/* Define FPGA_DEBUG to get debug printf's */ -#ifdef FPGA_DEBUG -#define PRINTF(fmt,args...) printf (fmt ,##args) -#else -#define PRINTF(fmt,args...) -#endif - /* Note: The assumption is that we cannot possibly run fast enough to * overrun the device (the Slave Parallel mode can free run at 50MHz). * If there is a need to operate slower, define CONFIG_FPGA_DELAY in @@ -44,7 +40,7 @@ int ACEX1K_load(Altera_desc *desc, const void *buf, size_t bsize) switch (desc->iface) { case passive_serial: - PRINTF ("%s: Launching Passive Serial Loader\n", __FUNCTION__); + log_debug("%s: Launching Passive Serial Loader\n", __func__); ret_val = ACEX1K_ps_load (desc, buf, bsize); break; @@ -64,7 +60,7 @@ int ACEX1K_dump(Altera_desc *desc, const void *buf, size_t bsize) switch (desc->iface) { case passive_serial: - PRINTF ("%s: Launching Passive Serial Dump\n", __FUNCTION__); + log_debug("%s: Launching Passive Serial Dump\n", __func__); ret_val = ACEX1K_ps_dump (desc, buf, bsize); break; @@ -93,8 +89,8 @@ static int ACEX1K_ps_load(Altera_desc *desc, const void *buf, size_t bsize) Altera_ACEX1K_Passive_Serial_fns *fn = desc->iface_fns; int i; - PRINTF ("%s: start with interface functions @ 0x%p\n", - __FUNCTION__, fn); + log_debug("%s: start with interface functions @ 0x%p\n", + __func__, fn); if (fn) { size_t bytecount = 0; @@ -102,7 +98,7 @@ static int ACEX1K_ps_load(Altera_desc *desc, const void *buf, size_t bsize) int cookie = desc->cookie; /* make a local copy */ unsigned long ts; /* timestamp */ - PRINTF ("%s: Function Table:\n" + log_debug("%s: Function Table:\n" "ptr:\t0x%p\n" "struct: 0x%p\n" "config:\t0x%p\n" @@ -110,7 +106,7 @@ static int ACEX1K_ps_load(Altera_desc *desc, const void *buf, size_t bsize) "clk:\t0x%p\n" "data:\t0x%p\n" "done:\t0x%p\n\n", - __FUNCTION__, &fn, fn, fn->config, fn->status, + __func__, &fn, fn, fn->config, fn->status, fn->clk, fn->data, fn->done); #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK printf ("Loading FPGA Device %d...", cookie); From patchwork Wed Sep 21 13:22:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 1680685 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=thorsis.com header.i=@thorsis.com header.a=rsa-sha256 header.s=default header.b=KN+4JRN9; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MXfJR3d3Bz1ypX for ; Wed, 21 Sep 2022 23:24:07 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 678F084CC2; Wed, 21 Sep 2022 15:23:03 +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="KN+4JRN9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 73A5684C99; Wed, 21 Sep 2022 15:22:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 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 1173084CA3 for ; Wed, 21 Sep 2022 15:22:26 +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 1oazgG-0001rZ-IG; Wed, 21 Sep 2022 15:22:24 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=default; t=1663766545; 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=441jGI9C/lteOUOV6jqojpuBoKPyxvOaTR38plBFAYg=; b=KN+4JRN9b4xsQik3OOr8pp1WI8gTU2+D6VecWpKM8II+SRF2Ieky+TDYctyuP+hk2rf2Kt oGgAgeONJJfG09WVX+pHsyguBGt20uKEaUbcpIRO2DkwaIWqY1Iz2Ug7orCEnV/CwKCLlI hAygadGS5MHPwYoHy3MjZyZHCRuU7ZRjh0IlSeRagkHkOsfWaj5v0ETL9+hfdZo7pv8HMI 4vI1VbYOSm13ToKHXtehv8u4gfcY6R9GoZvmNXUsgXf6Rcj/AomcQhf+GshwY1cmcCmuo5 nB/syMFlNRQjryDyAikQiSntGRID4QwiOjvXMF97gQ32AhGUXgqBxn047WbnXw== From: Alexander Dahl To: u-boot@lists.denx.de Cc: Michal Simek , Simon Glass Subject: [PATCH v2 6/8] fpga: spartan2: Use logging feature instead of FPGA_DEBUG Date: Wed, 21 Sep 2022 15:22:14 +0200 Message-Id: <20220921132216.7089-7-ada@thorsis.com> In-Reply-To: <20220921132216.7089-1-ada@thorsis.com> References: <20220921132216.7089-1-ada@thorsis.com> 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/spartan2.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/fpga/spartan2.c b/drivers/fpga/spartan2.c index 47692e3207..045265d59a 100644 --- a/drivers/fpga/spartan2.c +++ b/drivers/fpga/spartan2.c @@ -4,16 +4,12 @@ * Rich Ireland, Enterasys Networks, rireland@enterasys.com. */ +#define LOG_CATEGORY UCLASS_FPGA + #include /* core U-Boot definitions */ +#include #include /* Spartan-II device family */ -/* Define FPGA_DEBUG to get debug printf's */ -#ifdef FPGA_DEBUG -#define PRINTF(fmt,args...) printf (fmt ,##args) -#else -#define PRINTF(fmt,args...) -#endif - #undef CONFIG_SYS_FPGA_CHECK_BUSY /* Note: The assumption is that we cannot possibly run fast enough to @@ -46,12 +42,12 @@ static int spartan2_load(xilinx_desc *desc, const void *buf, size_t bsize, switch (desc->iface) { case slave_serial: - PRINTF ("%s: Launching Slave Serial Load\n", __FUNCTION__); + log_debug("%s: Launching Slave Serial Load\n", __func__); ret_val = spartan2_ss_load(desc, buf, bsize); break; case slave_parallel: - PRINTF ("%s: Launching Slave Parallel Load\n", __FUNCTION__); + log_debug("%s: Launching Slave Parallel Load\n", __func__); ret_val = spartan2_sp_load(desc, buf, bsize); break; @@ -69,12 +65,12 @@ static int spartan2_dump(xilinx_desc *desc, const void *buf, size_t bsize) switch (desc->iface) { case slave_serial: - PRINTF ("%s: Launching Slave Serial Dump\n", __FUNCTION__); + log_debug("%s: Launching Slave Serial Dump\n", __func__); ret_val = spartan2_ss_dump(desc, buf, bsize); break; case slave_parallel: - PRINTF ("%s: Launching Slave Parallel Dump\n", __FUNCTION__); + log_debug("%s: Launching Slave Parallel Dump\n", __func__); ret_val = spartan2_sp_dump(desc, buf, bsize); break; @@ -100,8 +96,8 @@ static int spartan2_sp_load(xilinx_desc *desc, const void *buf, size_t bsize) int ret_val = FPGA_FAIL; /* assume the worst */ xilinx_spartan2_slave_parallel_fns *fn = desc->iface_fns; - PRINTF ("%s: start with interface functions @ 0x%p\n", - __FUNCTION__, fn); + log_debug("%s: start with interface functions @ 0x%p\n", + __func__, fn); if (fn) { size_t bytecount = 0; @@ -109,7 +105,7 @@ static int spartan2_sp_load(xilinx_desc *desc, const void *buf, size_t bsize) int cookie = desc->cookie; /* make a local copy */ unsigned long ts; /* timestamp */ - PRINTF ("%s: Function Table:\n" + log_debug("%s: Function Table:\n" "ptr:\t0x%p\n" "struct: 0x%p\n" "pre: 0x%p\n" @@ -124,7 +120,7 @@ static int spartan2_sp_load(xilinx_desc *desc, const void *buf, size_t bsize) "busy:\t0x%p\n" "abort:\t0x%p\n", "post:\t0x%p\n\n", - __FUNCTION__, &fn, fn, fn->pre, fn->pgm, fn->init, fn->err, + __func__, &fn, fn, fn->pre, fn->pgm, fn->init, fn->err, fn->clk, fn->cs, fn->wr, fn->rdata, fn->wdata, fn->busy, fn->abort, fn->post); @@ -302,8 +298,8 @@ static int spartan2_ss_load(xilinx_desc *desc, const void *buf, size_t bsize) int i; unsigned char val; - PRINTF ("%s: start with interface functions @ 0x%p\n", - __FUNCTION__, fn); + log_debug("%s: start with interface functions @ 0x%p\n", + __func__, fn); if (fn) { size_t bytecount = 0; @@ -311,7 +307,7 @@ static int spartan2_ss_load(xilinx_desc *desc, const void *buf, size_t bsize) int cookie = desc->cookie; /* make a local copy */ unsigned long ts; /* timestamp */ - PRINTF ("%s: Function Table:\n" + log_debug("%s: Function Table:\n" "ptr:\t0x%p\n" "struct: 0x%p\n" "pgm:\t0x%p\n" @@ -319,7 +315,7 @@ static int spartan2_ss_load(xilinx_desc *desc, const void *buf, size_t bsize) "clk:\t0x%p\n" "wr:\t0x%p\n" "done:\t0x%p\n\n", - __FUNCTION__, &fn, fn, fn->pgm, fn->init, + __func__, &fn, fn, fn->pgm, fn->init, fn->clk, fn->wr, fn->done); #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK printf ("Loading FPGA Device %d...\n", cookie); From patchwork Wed Sep 21 13:22:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 1680683 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=thorsis.com header.i=@thorsis.com header.a=rsa-sha256 header.s=default header.b=YenlvODM; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MXfJ127XWz1ypX for ; Wed, 21 Sep 2022 23:23:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3F32E84CB6; Wed, 21 Sep 2022 15:22:58 +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="YenlvODM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 92A1C84C99; Wed, 21 Sep 2022 15:22:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 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 1081184CA1 for ; Wed, 21 Sep 2022 15:22:26 +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 1oazgG-0001rc-JN; Wed, 21 Sep 2022 15:22:24 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=default; t=1663766545; 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=sfq33EIaoej9aAcbmVg10ZQNZoPHr/HUl4vZHMzS404=; b=YenlvODMQZQ9Vvt/BqBCFlnJsoSpnG+54t1vA9R7BjLdDCJ20EiWTE7BcmcsDA521CRQoa ElL1unFJkzNkbRfcbEk5YZGH3yoNxm++IXQU0McqdtUV9SWSjD2zq1l6ON+R06BtLCCqKD jVzQ2kuHyTpi5uys7L7l47Qm1NrKDKt/+ACq5QxSENqfgq92xRf2acrB1oyPgOiOBLhhO2 GIW20YIf+B67MoOwy+vT021eT8fcnVc55BCauGbJHs9X1zcEuxmIv4PWobA/EHRAQZmBBY Q+768t6qEvY4scebswtkCB3B9VgijWOKIyo2W67y70plCchGBPYLo5dKjyI/lA== From: Alexander Dahl To: u-boot@lists.denx.de Cc: Michal Simek , Simon Glass Subject: [PATCH v2 7/8] fpga: spartan3: Use logging feature instead of FPGA_DEBUG Date: Wed, 21 Sep 2022 15:22:15 +0200 Message-Id: <20220921132216.7089-8-ada@thorsis.com> In-Reply-To: <20220921132216.7089-1-ada@thorsis.com> References: <20220921132216.7089-1-ada@thorsis.com> 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/spartan3.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/fpga/spartan3.c b/drivers/fpga/spartan3.c index 918f6db506..c88a55a43f 100644 --- a/drivers/fpga/spartan3.c +++ b/drivers/fpga/spartan3.c @@ -9,16 +9,12 @@ * on spartan2.c (Rich Ireland, rireland@enterasys.com). */ +#define LOG_CATEGORY UCLASS_FPGA + #include /* core U-Boot definitions */ +#include #include /* Spartan-II device family */ -/* Define FPGA_DEBUG to get debug printf's */ -#ifdef FPGA_DEBUG -#define PRINTF(fmt,args...) printf (fmt ,##args) -#else -#define PRINTF(fmt,args...) -#endif - #undef CONFIG_SYS_FPGA_CHECK_BUSY /* Note: The assumption is that we cannot possibly run fast enough to @@ -51,12 +47,12 @@ static int spartan3_load(xilinx_desc *desc, const void *buf, size_t bsize, switch (desc->iface) { case slave_serial: - PRINTF ("%s: Launching Slave Serial Load\n", __FUNCTION__); + log_debug("%s: Launching Slave Serial Load\n", __func__); ret_val = spartan3_ss_load(desc, buf, bsize); break; case slave_parallel: - PRINTF ("%s: Launching Slave Parallel Load\n", __FUNCTION__); + log_debug("%s: Launching Slave Parallel Load\n", __func__); ret_val = spartan3_sp_load(desc, buf, bsize); break; @@ -74,12 +70,12 @@ static int spartan3_dump(xilinx_desc *desc, const void *buf, size_t bsize) switch (desc->iface) { case slave_serial: - PRINTF ("%s: Launching Slave Serial Dump\n", __FUNCTION__); + log_debug("%s: Launching Slave Serial Dump\n", __func__); ret_val = spartan3_ss_dump(desc, buf, bsize); break; case slave_parallel: - PRINTF ("%s: Launching Slave Parallel Dump\n", __FUNCTION__); + log_debug("%s: Launching Slave Parallel Dump\n", __func__); ret_val = spartan3_sp_dump(desc, buf, bsize); break; @@ -105,8 +101,8 @@ static int spartan3_sp_load(xilinx_desc *desc, const void *buf, size_t bsize) int ret_val = FPGA_FAIL; /* assume the worst */ xilinx_spartan3_slave_parallel_fns *fn = desc->iface_fns; - PRINTF ("%s: start with interface functions @ 0x%p\n", - __FUNCTION__, fn); + log_debug("%s: start with interface functions @ 0x%p\n", + __func__, fn); if (fn) { size_t bytecount = 0; @@ -114,7 +110,7 @@ static int spartan3_sp_load(xilinx_desc *desc, const void *buf, size_t bsize) int cookie = desc->cookie; /* make a local copy */ unsigned long ts; /* timestamp */ - PRINTF ("%s: Function Table:\n" + log_debug("%s: Function Table:\n" "ptr:\t0x%p\n" "struct: 0x%p\n" "pre: 0x%p\n" @@ -129,7 +125,7 @@ static int spartan3_sp_load(xilinx_desc *desc, const void *buf, size_t bsize) "busy:\t0x%p\n" "abort:\t0x%p\n", "post:\t0x%p\n\n", - __FUNCTION__, &fn, fn, fn->pre, fn->pgm, fn->init, fn->err, + __func__, &fn, fn, fn->pre, fn->pgm, fn->init, fn->err, fn->clk, fn->cs, fn->wr, fn->rdata, fn->wdata, fn->busy, fn->abort, fn->post); @@ -309,8 +305,8 @@ static int spartan3_ss_load(xilinx_desc *desc, const void *buf, size_t bsize) int i; unsigned char val; - PRINTF ("%s: start with interface functions @ 0x%p\n", - __FUNCTION__, fn); + log_debug("%s: start with interface functions @ 0x%p\n", + __func__, fn); if (fn) { size_t bytecount = 0; @@ -318,7 +314,7 @@ static int spartan3_ss_load(xilinx_desc *desc, const void *buf, size_t bsize) int cookie = desc->cookie; /* make a local copy */ unsigned long ts; /* timestamp */ - PRINTF ("%s: Function Table:\n" + log_debug("%s: Function Table:\n" "ptr:\t0x%p\n" "struct: 0x%p\n" "pgm:\t0x%p\n" @@ -326,7 +322,7 @@ static int spartan3_ss_load(xilinx_desc *desc, const void *buf, size_t bsize) "clk:\t0x%p\n" "wr:\t0x%p\n" "done:\t0x%p\n\n", - __FUNCTION__, &fn, fn, fn->pgm, fn->init, + __func__, &fn, fn, fn->pgm, fn->init, fn->clk, fn->wr, fn->done); #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK printf ("Loading FPGA Device %d...\n", cookie); From patchwork Wed Sep 21 13:22:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 1680680 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=thorsis.com header.i=@thorsis.com header.a=rsa-sha256 header.s=default header.b=AImIjLbc; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MXfHN739Sz1ypX for ; Wed, 21 Sep 2022 23:23:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AF8B584CAB; Wed, 21 Sep 2022 15:22:51 +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="AImIjLbc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E06A084C96; Wed, 21 Sep 2022 15:22:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 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 A676184C9A for ; Wed, 21 Sep 2022 15:22:25 +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 1oazgG-0001rf-KV; Wed, 21 Sep 2022 15:22:24 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=default; t=1663766545; 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=2086oaufdwfSAmbGRHRjc786IQPSlFFSoL8UHgGH5v4=; b=AImIjLbchHW5XqlbTQe11KA26aJo4/5HZYC2Ajc6TXlU7CihhVBHc7n8YGt2kDda0ypR8O 4YNFgtTbhJjIvGu30jIeMz9zol10NlNfdnKwGfP3AjxjDQUNzPh1GPP9pFdXHO6T7cHQr0 Wn/e0k0f2HOmVQY6F/d5sX8tuN/fbgJ6V+PFI07QC+4Le07Te9m8g9uSsRuof1AjhYwIVg j7eSzRurjE+54oHD1c/mM9Jl8SDWb34hMz7WW0Te2ZwDuAlZ5jEkFyXI+FH0QhMY5AfnG0 3ZHUTIucu2n8OaYVQO5fvj+I4UxSbqBCPsZlDgua2YC1KcGd9M+KkSOn2tNHkA== From: Alexander Dahl To: u-boot@lists.denx.de Cc: Michal Simek , Simon Glass Subject: [PATCH v2 8/8] fpga: virtex2: Use logging feature instead of FPGA_DEBUG Date: Wed, 21 Sep 2022 15:22:16 +0200 Message-Id: <20220921132216.7089-9-ada@thorsis.com> In-Reply-To: <20220921132216.7089-1-ada@thorsis.com> References: <20220921132216.7089-1-ada@thorsis.com> 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 | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/drivers/fpga/virtex2.c b/drivers/fpga/virtex2.c index 51b8d31205..fddf8ac4ce 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("%s: Launching Slave Serial Load\n", __func__); ret_val = virtex2_ss_load(desc, buf, bsize); break; case slave_selectmap: - PRINTF("%s: Launching Slave Parallel Load\n", __func__); + log_debug("%s: Launching Slave Parallel Load\n", __func__); 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("%s: Launching Slave Serial Dump\n", __func__); ret_val = virtex2_ss_dump(desc, buf, bsize); break; case slave_parallel: - PRINTF("%s: Launching Slave Parallel Dump\n", __func__); + log_debug("%s: Launching Slave Parallel Dump\n", __func__); ret_val = virtex2_ssm_dump(desc, buf, bsize); break; @@ -150,8 +143,8 @@ 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("%s:%d: Start with interface functions @ 0x%p\n", + __func__, __LINE__, fn); if (!fn) { printf("%s:%d: NULL Interface function table!\n", @@ -160,7 +153,7 @@ 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" + log_debug("%s:%d: Function Table:\n" " base 0x%p\n" " struct 0x%p\n" " pre 0x%p\n" @@ -169,7 +162,7 @@ static int virtex2_slave_pre(xilinx_virtex2_slave_fns *fn, int cookie) " error 0x%p\n", __func__, __LINE__, &fn, fn, fn->pre, fn->pgm, fn->init, fn->err); - PRINTF(" clock 0x%p\n" + log_debug(" clock 0x%p\n" " cs 0x%p\n" " write 0x%p\n" " rdata 0x%p\n" @@ -330,8 +323,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 = %d\n", - __func__, __LINE__, bytecount); + log_debug("%s:%d:done went active early, bytecount = %d\n", + __func__, __LINE__, bytecount); break; } @@ -465,8 +458,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 = %d\n", - __func__, __LINE__, bytecount); + log_debug("%s:%d:done went active early, bytecount = %d\n", + __func__, __LINE__, bytecount); break; }