linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH NEXT v2 1/4] powerpc/pasemi: Add PCI initialisation for Nemo board.
@ 2018-08-19 20:21 Darren Stevens
  2018-12-09 22:47 ` Darren Stevens
  2018-12-22  9:54 ` [NEXT, v2, " Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Darren Stevens @ 2018-08-19 20:21 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: chzigotzky

[-- Attachment #1: Type: text/plain, Size: 178 bytes --]

  AmigaOS...........: http://yam.ch/
  Unix/MacOS/Windows: http://www.mozilla.com/thunderbird/

General information about MIME can be found at:
http://en.wikipedia.org/wiki/MIME

[-- Attachment #2: Type: text/plain, Size: 678 bytes --]

The A-Eon Amigaone X1000's Nemo motherboard has an AMD SB600
connected to one of the PCI-e root ports on its PaSemi
Pwrficient 1628M SoC. Normally the SB600 southbridge would be
connected to a hidden PCI-e port on the system's northbridge,
and as a result doesn't fully comply with the PCI-e spec.
    
Add code to relax the PCI-e detection in both the root port
and the Linux kernel allowing on board devices to be detected.
    
Signed-off-by: Darren Stevens <Darren@stevens-zone.net>

---

Changes made:

v2: Replaced sb600_bus with a define, moved iob_mapbase into 
    sb600_set_flag()
    Created some register/Flag names (as I don't have the docs
    for the PA6T-1682M)

[-- Attachment #3: pci.patch --]
[-- Type: text/plain, Size: 1664 bytes --]

diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index c3c6417..116c0fe 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -108,6 +108,61 @@ static int workaround_5945(struct pci_bus *bus, unsigned int devfn,
 	return 1;
 }
 
+#ifdef CONFIG_PPC_PASEMI_NEMO
+#define PXP_ERR_CFG_REG	0x4
+#define PXP_IGNORE_PCIE_ERRORS	0x800
+#define SB600_BUS 5
+
+static void sb600_set_flag(int bus)
+{
+	static void __iomem *iob_mapbase = NULL;
+	struct resource res;
+	struct device_node *dn;
+	int err;
+
+	if (iob_mapbase == NULL) {
+		dn = of_find_compatible_node(NULL, "isa", "pasemi,1682m-iob");
+		if (!dn) {
+			pr_crit("NEMO SB600 missing iob node\n");
+			return;
+		}
+
+		err = of_address_to_resource(dn, 0, &res);
+		of_node_put(dn);
+
+		if (err) {
+			pr_crit("NEMO SB600 missing resource\n");
+			return;
+		}
+
+		pr_info("NEMO SB600 IOB base %08llx\n",res.start);
+
+		iob_mapbase = ioremap(res.start + 0x100, 0x94);
+	}
+
+	if (iob_mapbase != NULL) {
+		if (bus == SB600_BUS) {
+			/*
+			 * This is the SB600's bus, tell the PCI-e root port
+			 * to allow non-zero devices to enumerate.
+			 */
+			out_le32(iob_mapbase + PXP_ERR_CFG_REG, in_le32(iob_mapbase + PXP_ERR_CFG_REG) | PXP_IGNORE_PCIE_ERRORS);
+		} else {
+			/*
+			 * Only scan device 0 on other busses
+			 */
+			out_le32(iob_mapbase + PXP_ERR_CFG_REG, in_le32(iob_mapbase + PXP_ERR_CFG_REG) & ~PXP_IGNORE_PCIE_ERRORS);
+		}
+	}
+}
+
+#else
+
+static void sb600_set_flag(int bus)
+{
+}
+#endif
+
 static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn,
 			      int offset, int len, u32 *val)
 {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH NEXT v2 1/4] powerpc/pasemi: Add PCI initialisation for Nemo board.
  2018-08-19 20:21 [PATCH NEXT v2 1/4] powerpc/pasemi: Add PCI initialisation for Nemo board Darren Stevens
@ 2018-12-09 22:47 ` Darren Stevens
  2018-12-17 12:48   ` Michael Ellerman
  2018-12-22  9:54 ` [NEXT, v2, " Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Darren Stevens @ 2018-12-09 22:47 UTC (permalink / raw)
  To: linuxppc-dev, mpe; +Cc: chzigotzky

Michael,

Any comments on these?

On 19/08/2018, Darren Stevens wrote:
> The A-Eon Amigaone X1000's Nemo motherboard has an AMD SB600
> connected to one of the PCI-e root ports on its PaSemi
> Pwrficient 1628M SoC. Normally the SB600 southbridge would be
> connected to a hidden PCI-e port on the system's northbridge,
> and as a result doesn't fully comply with the PCI-e spec.
>     
> Add code to relax the PCI-e detection in both the root port
> and the Linux kernel allowing on board devices to be detected.
>     
> Signed-off-by: Darren Stevens <Darren@stevens-zone.net>
>
> ---
>
> Changes made:
>
> v2: Replaced sb600_bus with a define, moved iob_mapbase into 
>     sb600_set_flag()
>     Created some register/Flag names (as I don't have the docs
>     for the PA6T-1682M)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH NEXT v2 1/4] powerpc/pasemi: Add PCI initialisation for Nemo board.
  2018-12-09 22:47 ` Darren Stevens
@ 2018-12-17 12:48   ` Michael Ellerman
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2018-12-17 12:48 UTC (permalink / raw)
  To: Darren Stevens, linuxppc-dev; +Cc: chzigotzky

Darren Stevens <darren@stevens-zone.net> writes:

> Michael,
>
> Any comments on these?

Hi Darren,

I guess in general we'd like more of this to come from the device tree.

But I'll merge this series as-is, because I don't think it helps anyone
to have this code out-of-tree. We can always clean things up further in
future if anyone has the time & motivation.

cheers

> On 19/08/2018, Darren Stevens wrote:
>> The A-Eon Amigaone X1000's Nemo motherboard has an AMD SB600
>> connected to one of the PCI-e root ports on its PaSemi
>> Pwrficient 1628M SoC. Normally the SB600 southbridge would be
>> connected to a hidden PCI-e port on the system's northbridge,
>> and as a result doesn't fully comply with the PCI-e spec.
>>     
>> Add code to relax the PCI-e detection in both the root port
>> and the Linux kernel allowing on board devices to be detected.
>>     
>> Signed-off-by: Darren Stevens <Darren@stevens-zone.net>
>>
>> ---
>>
>> Changes made:
>>
>> v2: Replaced sb600_bus with a define, moved iob_mapbase into 
>>     sb600_set_flag()
>>     Created some register/Flag names (as I don't have the docs
>>     for the PA6T-1682M)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [NEXT, v2, 1/4] powerpc/pasemi: Add PCI initialisation for Nemo board.
  2018-08-19 20:21 [PATCH NEXT v2 1/4] powerpc/pasemi: Add PCI initialisation for Nemo board Darren Stevens
  2018-12-09 22:47 ` Darren Stevens
@ 2018-12-22  9:54 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2018-12-22  9:54 UTC (permalink / raw)
  To: Darren Stevens, linuxppc-dev; +Cc: chzigotzky

On Sun, 2018-08-19 at 20:21:55 UTC, Darren Stevens wrote:
> The A-Eon Amigaone X1000's Nemo motherboard has an AMD SB600
> connected to one of the PCI-e root ports on its PaSemi
> Pwrficient 1628M SoC. Normally the SB600 southbridge would be
> connected to a hidden PCI-e port on the system's northbridge,
> and as a result doesn't fully comply with the PCI-e spec.
>     
> Add code to relax the PCI-e detection in both the root port
> and the Linux kernel allowing on board devices to be detected.
>     
> Signed-off-by: Darren Stevens <Darren@stevens-zone.net>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/68f211a4d1e5882e881bbb84b65059

cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-22 10:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-19 20:21 [PATCH NEXT v2 1/4] powerpc/pasemi: Add PCI initialisation for Nemo board Darren Stevens
2018-12-09 22:47 ` Darren Stevens
2018-12-17 12:48   ` Michael Ellerman
2018-12-22  9:54 ` [NEXT, v2, " Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).