All of lore.kernel.org
 help / color / mirror / Atom feed
From: Z.q. Hou <zhiqiang.hou@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCHv2 1/3] dm: pcie_fsl: Fix workaround of P4080 erratum A003
Date: Sun, 25 Aug 2019 15:42:40 +0000	[thread overview]
Message-ID: <20190825154423.30781-2-Zhiqiang.Hou@nxp.com> (raw)
In-Reply-To: <20190825154423.30781-1-Zhiqiang.Hou@nxp.com>

From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

In the workaround of P4080 erratum A003, it uses the macro
CONFIG_SYS_FSL_CORENET_SERDES_ADDR to get the SerDes block
register address, the CONFIG_SYS_FSL_CORENET_SERDES_ADDR is
defined as following:

	(CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_SERDES_OFFSET)

The problem is the macro CONFIG_SYS_FSL_CORENET_SERDES_ADDR is
defined on both corenet and non-corenet platforms (though it
should be defined only on corenet platforms), but the macro
CONFIG_SYS_FSL_CORENET_SERDES_OFFSET is only defined on corenet
platforms, so when enabled this driver on non-corenet platforms,
the following build error will come up:

drivers/pci/pcie_fsl.c: In function 'fsl_pcie_init_port':
./arch/powerpc/include/asm/immap_85xx.h:3000:21: error:
'CONFIG_SYS_FSL_CORENET_SERDES_OFFSET' undeclared (first use
in this function); did you mean 'CONFIG_SYS_FSL_CORENET_SERDES_ADDR'?
  (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_SERDES_OFFSET)
	                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix this build error by replacing it with a new added macro for
SerDes address of P4080.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
---
V2:
 - Replaced CONFIG_SYS_FSL_CORENET_SERDES_ADDR with the CCSR base + 
   P4080 SerDes offset.
 - Reworded the change log slightly.

 drivers/pci/pcie_fsl.c | 2 +-
 drivers/pci/pcie_fsl.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pcie_fsl.c b/drivers/pci/pcie_fsl.c
index 4d61a46cef..29b50f2376 100644
--- a/drivers/pci/pcie_fsl.c
+++ b/drivers/pci/pcie_fsl.c
@@ -444,7 +444,7 @@ static int fsl_pcie_init_port(struct fsl_pcie *pcie)
 	    !fsl_pcie_link_up(pcie)) {
 		serdes_corenet_t *srds_regs;
 
-		srds_regs = (void *)CONFIG_SYS_FSL_CORENET_SERDES_ADDR;
+		srds_regs = (void *)P4080_SERDES_ADDR;
 		val_32 = in_be32(&srds_regs->srdspccr0);
 
 		if ((val_32 >> 28) == 3) {
diff --git a/drivers/pci/pcie_fsl.h b/drivers/pci/pcie_fsl.h
index 5eefc31fa9..35a740241e 100644
--- a/drivers/pci/pcie_fsl.h
+++ b/drivers/pci/pcie_fsl.h
@@ -40,6 +40,8 @@
 #define LTSSM_L0_REV3			0x11
 #define LTSSM_L0			0x16
 
+#define P4080_SERDES_ADDR		(CONFIG_SYS_IMMR + 0xEA000)
+
 struct fsl_pcie {
 	int idx;
 	struct udevice *bus;
-- 
2.17.1

  reply	other threads:[~2019-08-25 15:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-25 15:42 [U-Boot] [PATCHv2 0/3] dm: pcie_fsl: Fix some issues Z.q. Hou
2019-08-25 15:42 ` Z.q. Hou [this message]
2019-08-26  5:58   ` [U-Boot] [PATCHv2 1/3] dm: pcie_fsl: Fix workaround of P4080 erratum A003 Bin Meng
2019-08-26  8:34     ` Z.q. Hou
2019-08-26  8:50       ` Bin Meng
2019-08-26  9:10         ` Prabhakar Kushwaha
2019-08-26 13:00           ` Bin Meng
2019-08-27  5:01             ` Bin Meng
2019-08-27  6:54               ` Prabhakar Kushwaha
2019-08-26 10:17         ` Z.q. Hou
2019-08-26 12:27           ` Bin Meng
2019-08-25 15:42 ` [U-Boot] [PATCHv2 2/3] dm: pcie_fsl: Fix the Class Code fixup function Z.q. Hou
2019-08-26  6:07   ` Bin Meng
2019-08-26  7:42     ` Z.q. Hou
2019-08-25 15:42 ` [U-Boot] [PATCHv2 3/3] dm: pcie_fsl: Fix the calculation of controller index Z.q. Hou
2019-08-26  6:10   ` Bin Meng
2019-08-26  7:47     ` Z.q. Hou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190825154423.30781-2-Zhiqiang.Hou@nxp.com \
    --to=zhiqiang.hou@nxp.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.