From patchwork Sat Feb 24 14:25:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 129512 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1742946lja; Sat, 24 Feb 2018 06:25:32 -0800 (PST) X-Google-Smtp-Source: AH8x2266e3sudnhseb+x08Q22gvPdZoKM5PCRFraIe6/O1BS556nwAfWEngNERcz3IVh2mVvGX2d X-Received: by 2002:a17:902:461:: with SMTP id 88-v6mr5021723ple.88.1519482332273; Sat, 24 Feb 2018 06:25:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519482332; cv=none; d=google.com; s=arc-20160816; b=q7dziGKqcuLoThBxR8Q2LIot3AAdmfJm3AKMHWyP1QZB5NdlYxD8+6zx2fl8K7chMR uGRFRF+mNVMRfW8KKXy+raLx4wUVBggjaSb9JW+ikfdqyfpl6eBezCIqUIQOagDVEPHr scaBGkWsI2uFZlPtfexTaynCUHmZ+LpjHh9Yx5pdJlgy4XvO1a9DiF3gmFUqfuZxOBi7 CnuJUGjLTERntOEeyvq6ISTMaSmU9Yn9kdmfVrLUGfOzgcVDgaF/6l7+AmJ33R5IGvlV N0ARDeX2bu0VxjTRdl7vrk/Kp+G6P+eCRg3dyewYPgx2YJMJoSxlHrIksTZubk2Qs1P1 /kgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=beJEzLj8r/xJMQHW1AWeSOApUmRop4IrXECa1VF7KUE=; b=yxo2cThGHC1evkIOqd4/ESgKVG5RfPGB/sjsxSztAFhPokpaZMz9IIZg2pOC8Z+kR9 EYskwZFBTTNGAQgShRMKZWFWRloShBPNpgWkhEWrKZAG+AnbM5O9b5t67agnvLgufL0I 3xb+NW0hhYF8cleZ4jmH3hN4IPXDCMI/layNNcKNrsiv51BATOPXok/HJwzZMkNy41cp owuYKDGluz0EQba3OtiCzJk+1qcQPQzDdSbnvHfS6jOJ7vabqC7R2EQplCy2rzcwIBfc iyrq31FdyNSRtXuVFkewQ/c3Ff2MF2c91mvMPyca8JE/ZJdry3NI4xBIi2GequXZ5m3K JNsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=abmY0jXU; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id f31-v6si3640209plb.636.2018.02.24.06.25.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Feb 2018 06:25:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=abmY0jXU; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A42F42243693D; Sat, 24 Feb 2018 06:19:28 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::241; helo=mail-wr0-x241.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 85A0A2243693A for ; Sat, 24 Feb 2018 06:19:27 -0800 (PST) Received: by mail-wr0-x241.google.com with SMTP id s5so16839723wra.0 for ; Sat, 24 Feb 2018 06:25:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aZalxFCT2VwIDvIicMW/BWrP+B0jrz3iFI00EnicRDs=; b=abmY0jXUucOMcrsHJeYSIA0ZyOkP0ZXeVuv+yPSTKmEJF2n+lRRfk5ygBibak/0db6 BMV6pq9YHEiVzpgXh7KjGPkRiTgtb6+xufRr5iSx2CM8bY7tSaVTW60SbezcpdUMD2jI XDUAv/zvjcXKvxfnp2yAB1T+75s5NZ0N55tJo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aZalxFCT2VwIDvIicMW/BWrP+B0jrz3iFI00EnicRDs=; b=Ah+4Ntghvsi9g1JXt7vm3YWrigNap0WWWUhCbb6gYh4fR1cRGRgHelX8S1G48jvfgR 19h31/9bCKiMt9LWtN2ujthHVz2RSgcU3UHCn8iQ+cFKfNIayZsFm8VPXt/ueJNKUMlz ZImcXLJ7m4elAoF8Xo5+KLKQfrO0r+F5beugrLqfh8pFUa/NTDCEUb+9qlIbhdVNaZqS MygLI21JWD/1/apnmZRYRQnKqntIM4/WjObKsUalItjhLwGzv6OKF+VmRxi8uh2PV0Lo 1Bdj0o7+STzdoNnz1m11f6wyQ3NboF/F0tQ93UM9A8Z5KUV6SIrAIlyZOPw8Ytqg/eAx JyiA== X-Gm-Message-State: APf1xPAbhBfZHbmbO7RXuigkfvEsM1GsPqwQQhlsLiCfLaFF0U07aVFv BEQfti/fjolnn7PXjcGiVeXxcyCWxdA= X-Received: by 10.223.138.251 with SMTP id z56mr4583781wrz.196.1519482328824; Sat, 24 Feb 2018 06:25:28 -0800 (PST) Received: from localhost.localdomain ([160.162.31.62]) by smtp.gmail.com with ESMTPSA id a14sm4612944wrf.22.2018.02.24.06.25.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Feb 2018 06:25:28 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Sat, 24 Feb 2018 14:25:15 +0000 Message-Id: <20180224142515.461-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180224142515.461-1-ard.biesheuvel@linaro.org> References: <20180224142515.461-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH edk2-platforms 2/2] Silicon/SynQuacerI2cDxe: remove special runtime treatment of DEBUG()s X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lersek@redhat.com, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" It is no longer necessary to inhibit DEBUG() calls at runtime, due to the fact that we switched to a DebugLib implementation that takes care of this. Since a platform could theoretically wire up DXE_RUNTIME_DRIVER modules to a DebugLib/SerialPortLib implementation combo that does remap the UART MMIO region for runtime and produces UEFI debug output on a UART that is not owned by the OS, it is better not to handle this in the driver directly. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c | 28 +++++++++----------- 1 file changed, 13 insertions(+), 15 deletions(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c index 5e70f9d921c3..415e3f0804ed 100644 --- a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c +++ b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c @@ -13,8 +13,6 @@ #include "SynQuacerI2cDxe.h" -#define BOOTTIME_DEBUG(x) do { if (!EfiAtRuntime()) DEBUG (x); } while (0) - // // We cannot use Stall () or timer events at runtime, so we need to busy-wait // for the controller to signal the completion interrupts. This value was @@ -168,27 +166,27 @@ SynQuacerI2cMasterStart ( MmioWrite8 (I2c->MmioBase + F_I2C_REG_DAR, SlaveAddress << 1); } - BOOTTIME_DEBUG ((DEBUG_INFO, "%a: slave:0x%02x\n", __FUNCTION__, + DEBUG ((DEBUG_INFO, "%a: slave:0x%02x\n", __FUNCTION__, SlaveAddress)); Bsr = MmioRead8 (I2c->MmioBase + F_I2C_REG_BSR); Bcr = MmioRead8 (I2c->MmioBase + F_I2C_REG_BCR); if ((Bsr & F_I2C_BSR_BB) && !(Bcr & F_I2C_BCR_MSS)) { - BOOTTIME_DEBUG ((DEBUG_INFO, "%a: bus is busy\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: bus is busy\n", __FUNCTION__)); return EFI_ALREADY_STARTED; } if (Bsr & F_I2C_BSR_BB) { // Bus is busy - BOOTTIME_DEBUG ((DEBUG_INFO, "%a: Continuous Start\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Continuous Start\n", __FUNCTION__)); MmioWrite8 (I2c->MmioBase + F_I2C_REG_BCR, Bcr | F_I2C_BCR_SCC); } else { if (Bcr & F_I2C_BCR_MSS) { - BOOTTIME_DEBUG ((DEBUG_WARN, + DEBUG ((DEBUG_WARN, "%a: is not in master mode\n", __FUNCTION__)); return EFI_DEVICE_ERROR; } - BOOTTIME_DEBUG ((DEBUG_INFO, "%a: Start Condition\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Start Condition\n", __FUNCTION__)); MmioWrite8 (I2c->MmioBase + F_I2C_REG_BCR, Bcr | F_I2C_BCR_MSS | F_I2C_BCR_INTE | F_I2C_BCR_BEIE); } @@ -329,13 +327,13 @@ SynQuacerI2cStartRequest ( Status = WaitForInterrupt (I2c); if (EFI_ERROR (Status)) { - BOOTTIME_DEBUG ((DEBUG_WARN, "%a: Timeout waiting for interrupt - %r\n", + DEBUG ((DEBUG_WARN, "%a: Timeout waiting for interrupt - %r\n", __FUNCTION__, Status)); break; } if (MmioRead8 (I2c->MmioBase + F_I2C_REG_BSR) & F_I2C_BSR_LRB) { - BOOTTIME_DEBUG ((DEBUG_WARN, "%a: No ack received\n", __FUNCTION__)); + DEBUG ((DEBUG_WARN, "%a: No ack received\n", __FUNCTION__)); Status = EFI_DEVICE_ERROR; break; } @@ -346,13 +344,13 @@ SynQuacerI2cStartRequest ( Bcr = MmioRead8 (I2c->MmioBase + F_I2C_REG_BCR); if (Bcr & F_I2C_BCR_BER) { - BOOTTIME_DEBUG ((DEBUG_WARN, "%a: Bus error detected\n", __FUNCTION__)); + DEBUG ((DEBUG_WARN, "%a: Bus error detected\n", __FUNCTION__)); Status = EFI_DEVICE_ERROR; break; } if ((Bsr & F_I2C_BSR_AL) || !(Bcr & F_I2C_BCR_MSS)) { - BOOTTIME_DEBUG ((DEBUG_WARN, "%a: Arbitration lost\n", __FUNCTION__)); + DEBUG ((DEBUG_WARN, "%a: Arbitration lost\n", __FUNCTION__)); Status = EFI_DEVICE_ERROR; break; } @@ -368,7 +366,7 @@ SynQuacerI2cStartRequest ( Status = WaitForInterrupt (I2c); if (EFI_ERROR (Status)) { - BOOTTIME_DEBUG ((DEBUG_WARN, + DEBUG ((DEBUG_WARN, "%a: Timeout waiting for interrupt - %r\n", __FUNCTION__, Status)); break; } @@ -383,13 +381,13 @@ SynQuacerI2cStartRequest ( Status = WaitForInterrupt (I2c); if (EFI_ERROR (Status)) { - BOOTTIME_DEBUG ((DEBUG_WARN, + DEBUG ((DEBUG_WARN, "%a: Timeout waiting for interrupt - %r\n", __FUNCTION__, Status)); break; } if (MmioRead8 (I2c->MmioBase + F_I2C_REG_BSR) & F_I2C_BSR_LRB) { - BOOTTIME_DEBUG ((DEBUG_WARN, "%a: No ack received\n", __FUNCTION__)); + DEBUG ((DEBUG_WARN, "%a: No ack received\n", __FUNCTION__)); Status = EFI_DEVICE_ERROR; break; } @@ -486,7 +484,7 @@ SynQuacerI2cInit ( Dev->Resources[0].AddrLen, EFI_MEMORY_UC | EFI_MEMORY_RUNTIME); if (EFI_ERROR (Status)) { - BOOTTIME_DEBUG ((DEBUG_WARN, "%a: failed to add memory space - %r\n", + DEBUG ((DEBUG_WARN, "%a: failed to add memory space - %r\n", __FUNCTION__, Status)); }