From patchwork Mon Apr 26 13:26:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 1470306 X-Patchwork-Delegate: ykai007@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; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=QsUYrmsI; 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 4FTQfs6LlBz9sXG for ; Mon, 26 Apr 2021 23:27:14 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 17A9E82B8E; Mon, 26 Apr 2021 15:27:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="QsUYrmsI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AB3CF82B7E; Mon, 26 Apr 2021 15:27:00 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DD91780C99 for ; Mon, 26 Apr 2021 15:26:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=linux.amoon@gmail.com Received: by mail-pg1-x52d.google.com with SMTP id t22so4791053pgu.0 for ; Mon, 26 Apr 2021 06:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=c6HlBhQsOGVYAND+YPAecKd+jI/VaQl+7bMCnGi+dLU=; b=QsUYrmsIdIh0KNq4aSeXSAeFto84SmixE7n2aSHueuejq8vPPIoX1MMKvRGB4cn5hJ dhEg02NX7nSzFnKX+DzyT6h9tFQVde4L4Hltl7B+AbrJVSKencEt4pb+TEvg4OAN5TVv oMfyMw5uNlB+lnHa98mWMfArwazLBf3uU4HPtgQMl9mjjX9tX4HOb/ArL19kxlxvixKf zno+ABUeqh0ThyVYSQB3QUluG5TZspDfGkosWhRUKSnGcbjuexSgN2V5EoEOPSrE53O5 Vpes8I226ZcxZ9KbcRFbN+9LlKlv6V5fZNCyfmSUToZAkX/pKz6HQhubhvgDBjlb0xbV 2ovg== 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:mime-version :content-transfer-encoding; bh=c6HlBhQsOGVYAND+YPAecKd+jI/VaQl+7bMCnGi+dLU=; b=Z2CFfsBXk1SKtM+ztt2gkDVDzekvJ33f0YqIUGuLB6EtyD3dGxKiUE5a1biMW4l9nY gCSAT0IilDhuuSSFY27iyTJbQ0S6xx6Av8aNkzHn0iqqZjLwMy1SYAcXqKwvDICFxozu /62N+edlEqs1Dh8pylE1pisQRqxWYi1/mFMpw0P27RTrYRNOMqwdCvQvDB1voKVb7nCu f33KfZOScF/wpeou4PTpq5dtgp0AsHXg7keM+EcaFliH2UHlNYshxITNl7TQsyWbTnzH LwkN5ciw65kPFcOduyvrcu6vlxGLtCg+eIqN9X7siS9ukpgB9iIqz7s+F5R4PtZKKXkd lMtA== X-Gm-Message-State: AOAM532omj1KxtHp8tu3+n88r+GEoTr0qBPg4vltZiK0g9cF835hq8LN joam/hd7daQhoysI5uQTEh9ttkkOEEN2Hg== X-Google-Smtp-Source: ABdhPJzRy/cQnp67FrQSNwKfAS/tyGafGU3vDoDBgikaOzKO3EM06WXjtKTCrtvoTWlU/GtGvZH7Dg== X-Received: by 2002:aa7:91d1:0:b029:1fe:2a02:73b9 with SMTP id z17-20020aa791d10000b02901fe2a0273b9mr17755997pfa.2.1619443614677; Mon, 26 Apr 2021 06:26:54 -0700 (PDT) Received: from archl-on1.. ([103.51.75.154]) by smtp.gmail.com with ESMTPSA id w1sm11185811pgp.31.2021.04.26.06.26.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Apr 2021 06:26:54 -0700 (PDT) From: Anand Moon To: u-boot@lists.denx.de Cc: Neil Armstrong , Bin Meng , Kever Yang , Anand Moon Subject: [PATCH 1/3] pci: pcie_dw_rockchip: Fixed the below compilation error Date: Mon, 26 Apr 2021 13:26:30 +0000 Message-Id: <20210426132632.10221-1-linux.amoon@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.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.4 at phobos.denx.de X-Virus-Status: Clean Use the Error values that may be returned by PCI functions Added the error macro from linux/include/linux/pci.h drivers/pci/pcie_dw_rockchip.c: In function 'rk_pcie_read': drivers/pci/pcie_dw_rockchip.c:70:10: error: 'PCIBIOS_UNSUPPORTED' undeclared (first use in this function) 70 | return PCIBIOS_UNSUPPORTED; | ^~~~~~~~~~~~~~~~~~~ drivers/pci/pcie_dw_rockchip.c: In function 'rk_pcie_write': drivers/pci/pcie_dw_rockchip.c:90:10: error: 'PCIBIOS_UNSUPPORTED' undeclared (first use in this function) 90 | return PCIBIOS_UNSUPPORTED; | ^~~~~~~~~~~~~~~~~~~ Cc: Neil Armstrong Cc: Kever Yang Signed-off-by: Anand Moon Reviewed-by: Kever Yang --- drivers/pci/pcie_dw_common.h | 9 +++++++++ drivers/pci/pcie_dw_rockchip.c | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pcie_dw_common.h b/drivers/pci/pcie_dw_common.h index 6b701645af..ba5feb5b51 100644 --- a/drivers/pci/pcie_dw_common.h +++ b/drivers/pci/pcie_dw_common.h @@ -90,6 +90,15 @@ #define PCIE_MISC_CONTROL_1_OFF 0x8bc #define PCIE_DBI_RO_WR_EN BIT(0) +/* Error values that may be returned by PCI functions */ +#define PCIBIOS_SUCCESSFUL 0x00 +#define PCIBIOS_FUNC_NOT_SUPPORTED 0x81 +#define PCIBIOS_BAD_VENDOR_ID 0x83 +#define PCIBIOS_DEVICE_NOT_FOUND 0x86 +#define PCIBIOS_BAD_REGISTER_NUMBER 0x87 +#define PCIBIOS_SET_FAILED 0x88 +#define PCIBIOS_BUFFER_TOO_SMALL 0x89 + /* Parameters for the waiting for iATU enabled routine */ #define LINK_WAIT_MAX_IATU_RETRIES 5 #define LINK_WAIT_IATU 10000 diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c index bc22af4230..9702b40019 100644 --- a/drivers/pci/pcie_dw_rockchip.c +++ b/drivers/pci/pcie_dw_rockchip.c @@ -67,7 +67,7 @@ static int rk_pcie_read(void __iomem *addr, int size, u32 *val) { if ((uintptr_t)addr & (size - 1)) { *val = 0; - return PCIBIOS_UNSUPPORTED; + return PCIBIOS_BAD_REGISTER_NUMBER; } if (size == 4) { @@ -87,7 +87,7 @@ static int rk_pcie_read(void __iomem *addr, int size, u32 *val) static int rk_pcie_write(void __iomem *addr, int size, u32 val) { if ((uintptr_t)addr & (size - 1)) - return PCIBIOS_UNSUPPORTED; + return PCIBIOS_BAD_REGISTER_NUMBER; if (size == 4) writel(val, addr);