* RE: [PATCH] Adding PCI-E support for 460SX based redwood board.
From: Tirumala Reddy Marri @ 2009-11-30 18:52 UTC (permalink / raw)
To: Tirumala Reddy Marri, linuxppc-dev, benh; +Cc: tmarri
In-Reply-To: <1259192937-8591-1-git-send-email-tmarri@amcc.com>
Hi Ben,
Could you please review the patch I sent .
Thanks,
Marri
-----Original Message-----
From: tmarri@amcc.com [mailto:tmarri@amcc.com]=20
Sent: Wednesday, November 25, 2009 3:49 PM
To: linuxppc-dev@ozlabs.org
Cc: tmarri@macc.com; Tirumala Reddy Marri
Subject: [PATCH] Adding PCI-E support for 460SX based redwood board.
From: Tirumala Marri <tmarri@amcc.com>
This patch would add PCI-E support for AMCC 460SX processor based=20
redwood board.
Signed-off-by: Tirumala Marri <tmarri@amcc.com>
---
arch/powerpc/boot/dts/redwood.dts | 122
+++++++++++++++++++++++++++++++++++++
arch/powerpc/sysdev/ppc4xx_pci.c | 119
++++++++++++++++++++++++++++++++++++
arch/powerpc/sysdev/ppc4xx_pci.h | 58 +++++++++++++++++
3 files changed, 299 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/boot/dts/redwood.dts
b/arch/powerpc/boot/dts/redwood.dts
index ad402c4..9eeec28 100644
--- a/arch/powerpc/boot/dts/redwood.dts
+++ b/arch/powerpc/boot/dts/redwood.dts
@@ -233,6 +233,128 @@
has-inverted-stacr-oc;
has-new-stacr-staopc;
};
+ PCIE0: pciex@d00000000 {
+ device_type =3D "pci";
+ #interrupt-cells =3D <1>;
+ #size-cells =3D <2>;
+ #address-cells =3D <3>;
+ compatible =3D "ibm,plb-pciex-460sx",
"ibm,plb-pciex";
+ primary;
+ port =3D <0x0>; /* port number */
+ reg =3D <0x0000000d 0x00000000 0x20000000
/* Config space access */
+ 0x0000000c 0x10000000
0x00001000>; /* Registers */
+ dcr-reg =3D <0x100 0x020>;
+ sdr-base =3D <0x300>;
+
+ /* Outbound ranges, one memory and one
IO,
+ * later cannot be changed
+ */
+ ranges =3D <0x02000000 0x00000000
0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000
+ 0x01000000 0x00000000
0x00000000 0x0000000f 0x80000000 0x00000000 0x00010000>;
+
+ /* Inbound 2GB range starting at 0 */
+ dma-ranges =3D <0x42000000 0x0 0x0 0x0 0x0
0x0 0x80000000>;
+
+ /* This drives busses 10 to 0x1f */
+ bus-range =3D <0x10 0x1f>;
+
+ /* Legacy interrupts (note the weird
polarity, the bridge seems
+ * to invert PCIe legacy interrupts).
+ * We are de-swizzling here because the
numbers are actually for
+ * port of the root complex virtual P2P
bridge. But I want
+ * to avoid putting a node for it in the
tree, so the numbers
+ * below are basically de-swizzled
numbers.
+ * The real slot is on idsel 0, so the
swizzling is 1:1
+ */
+ interrupt-map-mask =3D <0x0 0x0 0x0 0x7>;
+ interrupt-map =3D <
+ 0x0 0x0 0x0 0x1 &UIC3 0x0 0x4 /*
swizzled int A */
+ 0x0 0x0 0x0 0x2 &UIC3 0x1 0x4 /*
swizzled int B */
+ 0x0 0x0 0x0 0x3 &UIC3 0x2 0x4 /*
swizzled int C */
+ 0x0 0x0 0x0 0x4 &UIC3 0x3 0x4 /*
swizzled int D */>;
+ };
+
+ PCIE1: pciex@d20000000 {
+ device_type =3D "pci";
+ #interrupt-cells =3D <1>;
+ #size-cells =3D <2>;
+ #address-cells =3D <3>;
+ compatible =3D "ibm,plb-pciex-460sx",
"ibm,plb-pciex";
+ primary;
+ port =3D <0x1>; /* port number */
+ reg =3D <0x0000000d 0x20000000 0x20000000
/* Config space access */
+ 0x0000000c 0x10001000
0x00001000>; /* Registers */
+ dcr-reg =3D <0x120 0x020>;
+ sdr-base =3D <0x340>;
+
+ /* Outbound ranges, one memory and one
IO,
+ * later cannot be changed
+ */
+ ranges =3D <0x02000000 0x00000000
0x80000000 0x0000000e 0x80000000 0x00000000 0x80000000
+ 0x01000000 0x00000000
0x00000000 0x0000000f 0x80010000 0x00000000 0x00010000>;
+
+ /* Inbound 2GB range starting at 0 */
+ dma-ranges =3D <0x42000000 0x0 0x0 0x0 0x0
0x0 0x80000000>;
+
+ /* This drives busses 10 to 0x1f */
+ bus-range =3D <0x20 0x2f>;
+
+ /* Legacy interrupts (note the weird
polarity, the bridge seems
+ * to invert PCIe legacy interrupts).
+ * We are de-swizzling here because the
numbers are actually for
+ * port of the root complex virtual P2P
bridge. But I want
+ * to avoid putting a node for it in the
tree, so the numbers
+ * below are basically de-swizzled
numbers.
+ * The real slot is on idsel 0, so the
swizzling is 1:1
+ */
+ interrupt-map-mask =3D <0x0 0x0 0x0 0x7>;
+ interrupt-map =3D <
+ 0x0 0x0 0x0 0x1 &UIC3 0x4 0x4 /*
swizzled int A */
+ 0x0 0x0 0x0 0x2 &UIC3 0x5 0x4 /*
swizzled int B */
+ 0x0 0x0 0x0 0x3 &UIC3 0x6 0x4 /*
swizzled int C */
+ 0x0 0x0 0x0 0x4 &UIC3 0x7 0x4 /*
swizzled int D */>;
+ };
+
+ PCIE2: pciex@d40000000 {
+ device_type =3D "pci";
+ #interrupt-cells =3D <1>;
+ #size-cells =3D <2>;
+ #address-cells =3D <3>;
+ compatible =3D "ibm,plb-pciex-460sx",
"ibm,plb-pciex";
+ primary;
+ port =3D <0x2>; /* port number */
+ reg =3D <0x0000000d 0x40000000 0x20000000
/* Config space access */
+ 0x0000000c 0x10002000
0x00001000>; /* Registers */
+ dcr-reg =3D <0x140 0x020>;
+ sdr-base =3D <0x370>;
+
+ /* Outbound ranges, one memory and one
IO,
+ * later cannot be changed
+ */
+ ranges =3D <0x02000000 0x00000000
0x80000000 0x0000000f 0x00000000 0x00000000 0x80000000
+ 0x01000000 0x00000000
0x00000000 0x0000000f 0x80020000 0x00000000 0x00010000>;
+
+ /* Inbound 2GB range starting at 0 */
+ dma-ranges =3D <0x42000000 0x0 0x0 0x0 0x0
0x0 0x80000000>;
+
+ /* This drives busses 10 to 0x1f */
+ bus-range =3D <0x30 0x3f>;
+
+ /* Legacy interrupts (note the weird
polarity, the bridge seems
+ * to invert PCIe legacy interrupts).
+ * We are de-swizzling here because the
numbers are actually for
+ * port of the root complex virtual P2P
bridge. But I want
+ * to avoid putting a node for it in the
tree, so the numbers
+ * below are basically de-swizzled
numbers.
+ * The real slot is on idsel 0, so the
swizzling is 1:1
+ */
+ interrupt-map-mask =3D <0x0 0x0 0x0 0x7>;
+ interrupt-map =3D <
+ 0x0 0x0 0x0 0x1 &UIC3 0x8 0x4 /*
swizzled int A */
+ 0x0 0x0 0x0 0x2 &UIC3 0x9 0x4 /*
swizzled int B */
+ 0x0 0x0 0x0 0x3 &UIC3 0xa 0x4 /*
swizzled int C */
+ 0x0 0x0 0x0 0x4 &UIC3 0xb 0x4 /*
swizzled int D */>;
+ };
=20
};
=20
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c
b/arch/powerpc/sysdev/ppc4xx_pci.c
index 6ff9d71..64cd020 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -972,6 +972,123 @@ static struct ppc4xx_pciex_hwops
ppc460ex_pcie_hwops __initdata =3D
.setup_utl =3D ppc460ex_pciex_init_utl,
};
=20
+static int __init ppc460sx_pciex_core_init(struct device_node *np)
+{
+ /* HSS drive amplitude */
+ mtdcri(SDR0, PESDR0_460SX_HSSL0DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR0_460SX_HSSL1DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR0_460SX_HSSL2DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR0_460SX_HSSL3DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR0_460SX_HSSL4DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR0_460SX_HSSL5DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR0_460SX_HSSL6DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR0_460SX_HSSL7DAMP, 0xB9843211);
+
+ mtdcri(SDR0, PESDR1_460SX_HSSL0DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR1_460SX_HSSL1DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR1_460SX_HSSL2DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR1_460SX_HSSL3DAMP, 0xB9843211);
+
+ mtdcri(SDR0, PESDR2_460SX_HSSL0DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR2_460SX_HSSL1DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR2_460SX_HSSL2DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR2_460SX_HSSL3DAMP, 0xB9843211);
+
+ /* HSS TX pre-emphasis */
+ mtdcri(SDR0, PESDR0_460SX_HSSL0COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR0_460SX_HSSL1COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR0_460SX_HSSL2COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR0_460SX_HSSL3COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR0_460SX_HSSL4COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR0_460SX_HSSL5COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR0_460SX_HSSL6COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR0_460SX_HSSL7COEFA, 0xDCB98987);
+
+ mtdcri(SDR0, PESDR1_460SX_HSSL0COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR1_460SX_HSSL1COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR1_460SX_HSSL2COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR1_460SX_HSSL3COEFA, 0xDCB98987);
+
+ mtdcri(SDR0, PESDR2_460SX_HSSL0COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR2_460SX_HSSL1COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR2_460SX_HSSL2COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR2_460SX_HSSL3COEFA, 0xDCB98987);
+
+ /* HSS TX calibration control */
+ mtdcri(SDR0, PESDR0_460SX_HSSL1CALDRV, 0x22222222);
+ mtdcri(SDR0, PESDR1_460SX_HSSL1CALDRV, 0x22220000);
+ mtdcri(SDR0, PESDR2_460SX_HSSL1CALDRV, 0x22220000);
+
+ /* HSS TX slew control */
+ mtdcri(SDR0, PESDR0_460SX_HSSSLEW, 0xFFFFFFFF);
+ mtdcri(SDR0, PESDR1_460SX_HSSSLEW, 0xFFFF0000);
+ mtdcri(SDR0, PESDR2_460SX_HSSSLEW, 0xFFFF0000);
+
+ udelay(100);
+
+ /* De-assert PLLRESET */
+ dcri_clrset(SDR0, PESDR0_PLLLCT2, 0x00000100, 0);
+
+ /* Reset DL, UTL, GPL before configuration */
+ mtdcri(SDR0, PESDR0_460SX_RCSSET,
+ PESDRx_RCSSET_RSTDL | PESDRx_RCSSET_RSTGU);
+ mtdcri(SDR0, PESDR1_460SX_RCSSET,
+ PESDRx_RCSSET_RSTDL | PESDRx_RCSSET_RSTGU);
+ mtdcri(SDR0, PESDR2_460SX_RCSSET,
+ PESDRx_RCSSET_RSTDL | PESDRx_RCSSET_RSTGU);
+
+ udelay(100);
+
+ /*
+ * If bifurcation is not enabled, u-boot would have disabled the
+ * third PCIe port
+ */
+ if (((mfdcri(SDR0, PESDR1_460SX_HSSCTLSET) & 0x00000001) =3D=3D
+ 0x00000001)) {
+ printk(KERN_INFO "PCI: PCIE bifurcation setup
successfully.\n");
+ printk(KERN_INFO "PCI: Total 3 PCIE ports are
present\n");
+ return 3;
+ }
+
+ printk(KERN_INFO "PCI: Total 2 PCIE ports are present\n");
+ return 2;
+}
+
+static int ppc460sx_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
+{
+
+ if (port->endpoint)
+ dcri_clrset(SDR0, port->sdr_base + PESDRn_UTLSET2,
+ 0x01000000, 0);
+ else
+ dcri_clrset(SDR0, port->sdr_base + PESDRn_UTLSET2,
+ 0, 0x01000000);
+
+ /*Gen-1*/
+ mtdcri(SDR0, port->sdr_base + PESDRn_460SX_RCEI, 0x08000000);
+
+ dcri_clrset(SDR0, port->sdr_base + PESDRn_RCSSET,
+ (PESDRx_RCSSET_RSTGU | PESDRx_RCSSET_RSTDL),
+ PESDRx_RCSSET_RSTPYN);
+
+ port->has_ibpre =3D 1;
+
+ return 0;
+}
+
+static int ppc460sx_pciex_init_utl(struct ppc4xx_pciex_port *port)
+{
+ /* Max 128 Bytes */
+ out_be32 (port->utl_base + PEUTL_PBBSZ, 0x00000000);
+ return 0;
+}
+
+static struct ppc4xx_pciex_hwops ppc460sx_pcie_hwops __initdata =3D {
+ .core_init =3D ppc460sx_pciex_core_init,
+ .port_init_hw =3D ppc460sx_pciex_init_port_hw,
+ .setup_utl =3D ppc460sx_pciex_init_utl,
+};
+
#endif /* CONFIG_44x */
=20
#ifdef CONFIG_40x
@@ -1087,6 +1204,8 @@ static int __init
ppc4xx_pciex_check_core_init(struct device_node *np)
}
if (of_device_is_compatible(np, "ibm,plb-pciex-460ex"))
ppc4xx_pciex_hwops =3D &ppc460ex_pcie_hwops;
+ if (of_device_is_compatible(np, "ibm,plb-pciex-460sx"))
+ ppc4xx_pciex_hwops =3D &ppc460sx_pcie_hwops;
#endif /* CONFIG_44x */
#ifdef CONFIG_40x
if (of_device_is_compatible(np, "ibm,plb-pciex-405ex"))
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.h
b/arch/powerpc/sysdev/ppc4xx_pci.h
index d04e40b..56d9e5d 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.h
+++ b/arch/powerpc/sysdev/ppc4xx_pci.h
@@ -324,6 +324,64 @@
#define PESDR0_460EX_IHS2 0x036D
=20
/*
+ * 460SX addtional DCRs
+ */
+#define PESDRn_460SX_RCEI 0x02
+
+#define PESDR0_460SX_HSSL0DAMP 0x320
+#define PESDR0_460SX_HSSL1DAMP 0x321
+#define PESDR0_460SX_HSSL2DAMP 0x322
+#define PESDR0_460SX_HSSL3DAMP 0x323
+#define PESDR0_460SX_HSSL4DAMP 0x324
+#define PESDR0_460SX_HSSL5DAMP 0x325
+#define PESDR0_460SX_HSSL6DAMP 0x326
+#define PESDR0_460SX_HSSL7DAMP 0x327
+
+#define PESDR1_460SX_HSSL0DAMP 0x354
+#define PESDR1_460SX_HSSL1DAMP 0x355
+#define PESDR1_460SX_HSSL2DAMP 0x356
+#define PESDR1_460SX_HSSL3DAMP 0x357
+
+#define PESDR2_460SX_HSSL0DAMP 0x384
+#define PESDR2_460SX_HSSL1DAMP 0x385
+#define PESDR2_460SX_HSSL2DAMP 0x386
+#define PESDR2_460SX_HSSL3DAMP 0x387
+
+#define PESDR0_460SX_HSSL0COEFA 0x328
+#define PESDR0_460SX_HSSL1COEFA 0x329
+#define PESDR0_460SX_HSSL2COEFA 0x32A
+#define PESDR0_460SX_HSSL3COEFA 0x32B
+#define PESDR0_460SX_HSSL4COEFA 0x32C
+#define PESDR0_460SX_HSSL5COEFA 0x32D
+#define PESDR0_460SX_HSSL6COEFA 0x32E
+#define PESDR0_460SX_HSSL7COEFA 0x32F
+
+#define PESDR1_460SX_HSSL0COEFA 0x358
+#define PESDR1_460SX_HSSL1COEFA 0x359
+#define PESDR1_460SX_HSSL2COEFA 0x35A
+#define PESDR1_460SX_HSSL3COEFA 0x35B
+
+#define PESDR2_460SX_HSSL0COEFA 0x388
+#define PESDR2_460SX_HSSL1COEFA 0x389
+#define PESDR2_460SX_HSSL2COEFA 0x38A
+#define PESDR2_460SX_HSSL3COEFA 0x38B
+
+#define PESDR0_460SX_HSSL1CALDRV 0x339
+#define PESDR1_460SX_HSSL1CALDRV 0x361
+#define PESDR2_460SX_HSSL1CALDRV 0x391
+
+#define PESDR0_460SX_HSSSLEW 0x338
+#define PESDR1_460SX_HSSSLEW 0x360
+#define PESDR2_460SX_HSSSLEW 0x390
+
+#define PESDR0_460SX_HSSCTLSET 0x31E
+#define PESDR1_460SX_HSSCTLSET 0x352
+#define PESDR2_460SX_HSSCTLSET 0x382
+
+#define PESDR0_460SX_RCSSET 0x304
+#define PESDR1_460SX_RCSSET 0x344
+#define PESDR2_460SX_RCSSET 0x374
+/*
* Of the above, some are common offsets from the base
*/
#define PESDRn_UTLSET1 0x00
--=20
1.6.3.3
^ permalink raw reply related
* RE: [PATCH] Adding PCI-E support for 460SX based redwood board.
From: Benjamin Herrenschmidt @ 2009-11-30 19:38 UTC (permalink / raw)
To: Tirumala Reddy Marri; +Cc: linuxppc-dev, tmarri
In-Reply-To: <AC5E1C3367E37D44970B81A6ADD1DA2C08642D5B@SDCEXCHANGE01.ad.amcc.com>
On Mon, 2009-11-30 at 10:52 -0800, Tirumala Reddy Marri wrote:
> Hi Ben,
> Could you please review the patch I sent .
> Thanks,
> Marri
Hi !
The original message never made it. This one did but the patch is line
wrapped. Please fix your mailer and re-send.
Cheers,
Ben.
> -----Original Message-----
> From: tmarri@amcc.com [mailto:tmarri@amcc.com]
> Sent: Wednesday, November 25, 2009 3:49 PM
> To: linuxppc-dev@ozlabs.org
> Cc: tmarri@macc.com; Tirumala Reddy Marri
> Subject: [PATCH] Adding PCI-E support for 460SX based redwood board.
>
> From: Tirumala Marri <tmarri@amcc.com>
>
> This patch would add PCI-E support for AMCC 460SX processor based
> redwood board.
>
> Signed-off-by: Tirumala Marri <tmarri@amcc.com>
>
> ---
> arch/powerpc/boot/dts/redwood.dts | 122
> +++++++++++++++++++++++++++++++++++++
> arch/powerpc/sysdev/ppc4xx_pci.c | 119
> ++++++++++++++++++++++++++++++++++++
> arch/powerpc/sysdev/ppc4xx_pci.h | 58 +++++++++++++++++
> 3 files changed, 299 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/boot/dts/redwood.dts
> b/arch/powerpc/boot/dts/redwood.dts
> index ad402c4..9eeec28 100644
> --- a/arch/powerpc/boot/dts/redwood.dts
> +++ b/arch/powerpc/boot/dts/redwood.dts
> @@ -233,6 +233,128 @@
> has-inverted-stacr-oc;
> has-new-stacr-staopc;
> };
> + PCIE0: pciex@d00000000 {
> + device_type = "pci";
> + #interrupt-cells = <1>;
> + #size-cells = <2>;
> + #address-cells = <3>;
> + compatible = "ibm,plb-pciex-460sx",
> "ibm,plb-pciex";
> + primary;
> + port = <0x0>; /* port number */
> + reg = <0x0000000d 0x00000000 0x20000000
> /* Config space access */
> + 0x0000000c 0x10000000
> 0x00001000>; /* Registers */
> + dcr-reg = <0x100 0x020>;
> + sdr-base = <0x300>;
> +
> + /* Outbound ranges, one memory and one
> IO,
> + * later cannot be changed
> + */
> + ranges = <0x02000000 0x00000000
> 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000
> + 0x01000000 0x00000000
> 0x00000000 0x0000000f 0x80000000 0x00000000 0x00010000>;
> +
> + /* Inbound 2GB range starting at 0 */
> + dma-ranges = <0x42000000 0x0 0x0 0x0 0x0
> 0x0 0x80000000>;
> +
> + /* This drives busses 10 to 0x1f */
> + bus-range = <0x10 0x1f>;
> +
> + /* Legacy interrupts (note the weird
> polarity, the bridge seems
> + * to invert PCIe legacy interrupts).
> + * We are de-swizzling here because the
> numbers are actually for
> + * port of the root complex virtual P2P
> bridge. But I want
> + * to avoid putting a node for it in the
> tree, so the numbers
> + * below are basically de-swizzled
> numbers.
> + * The real slot is on idsel 0, so the
> swizzling is 1:1
> + */
> + interrupt-map-mask = <0x0 0x0 0x0 0x7>;
> + interrupt-map = <
> + 0x0 0x0 0x0 0x1 &UIC3 0x0 0x4 /*
> swizzled int A */
> + 0x0 0x0 0x0 0x2 &UIC3 0x1 0x4 /*
> swizzled int B */
> + 0x0 0x0 0x0 0x3 &UIC3 0x2 0x4 /*
> swizzled int C */
> + 0x0 0x0 0x0 0x4 &UIC3 0x3 0x4 /*
> swizzled int D */>;
> + };
> +
> + PCIE1: pciex@d20000000 {
> + device_type = "pci";
> + #interrupt-cells = <1>;
> + #size-cells = <2>;
> + #address-cells = <3>;
> + compatible = "ibm,plb-pciex-460sx",
> "ibm,plb-pciex";
> + primary;
> + port = <0x1>; /* port number */
> + reg = <0x0000000d 0x20000000 0x20000000
> /* Config space access */
> + 0x0000000c 0x10001000
> 0x00001000>; /* Registers */
> + dcr-reg = <0x120 0x020>;
> + sdr-base = <0x340>;
> +
> + /* Outbound ranges, one memory and one
> IO,
> + * later cannot be changed
> + */
> + ranges = <0x02000000 0x00000000
> 0x80000000 0x0000000e 0x80000000 0x00000000 0x80000000
> + 0x01000000 0x00000000
> 0x00000000 0x0000000f 0x80010000 0x00000000 0x00010000>;
> +
> + /* Inbound 2GB range starting at 0 */
> + dma-ranges = <0x42000000 0x0 0x0 0x0 0x0
> 0x0 0x80000000>;
> +
> + /* This drives busses 10 to 0x1f */
> + bus-range = <0x20 0x2f>;
> +
> + /* Legacy interrupts (note the weird
> polarity, the bridge seems
> + * to invert PCIe legacy interrupts).
> + * We are de-swizzling here because the
> numbers are actually for
> + * port of the root complex virtual P2P
> bridge. But I want
> + * to avoid putting a node for it in the
> tree, so the numbers
> + * below are basically de-swizzled
> numbers.
> + * The real slot is on idsel 0, so the
> swizzling is 1:1
> + */
> + interrupt-map-mask = <0x0 0x0 0x0 0x7>;
> + interrupt-map = <
> + 0x0 0x0 0x0 0x1 &UIC3 0x4 0x4 /*
> swizzled int A */
> + 0x0 0x0 0x0 0x2 &UIC3 0x5 0x4 /*
> swizzled int B */
> + 0x0 0x0 0x0 0x3 &UIC3 0x6 0x4 /*
> swizzled int C */
> + 0x0 0x0 0x0 0x4 &UIC3 0x7 0x4 /*
> swizzled int D */>;
> + };
> +
> + PCIE2: pciex@d40000000 {
> + device_type = "pci";
> + #interrupt-cells = <1>;
> + #size-cells = <2>;
> + #address-cells = <3>;
> + compatible = "ibm,plb-pciex-460sx",
> "ibm,plb-pciex";
> + primary;
> + port = <0x2>; /* port number */
> + reg = <0x0000000d 0x40000000 0x20000000
> /* Config space access */
> + 0x0000000c 0x10002000
> 0x00001000>; /* Registers */
> + dcr-reg = <0x140 0x020>;
> + sdr-base = <0x370>;
> +
> + /* Outbound ranges, one memory and one
> IO,
> + * later cannot be changed
> + */
> + ranges = <0x02000000 0x00000000
> 0x80000000 0x0000000f 0x00000000 0x00000000 0x80000000
> + 0x01000000 0x00000000
> 0x00000000 0x0000000f 0x80020000 0x00000000 0x00010000>;
> +
> + /* Inbound 2GB range starting at 0 */
> + dma-ranges = <0x42000000 0x0 0x0 0x0 0x0
> 0x0 0x80000000>;
> +
> + /* This drives busses 10 to 0x1f */
> + bus-range = <0x30 0x3f>;
> +
> + /* Legacy interrupts (note the weird
> polarity, the bridge seems
> + * to invert PCIe legacy interrupts).
> + * We are de-swizzling here because the
> numbers are actually for
> + * port of the root complex virtual P2P
> bridge. But I want
> + * to avoid putting a node for it in the
> tree, so the numbers
> + * below are basically de-swizzled
> numbers.
> + * The real slot is on idsel 0, so the
> swizzling is 1:1
> + */
> + interrupt-map-mask = <0x0 0x0 0x0 0x7>;
> + interrupt-map = <
> + 0x0 0x0 0x0 0x1 &UIC3 0x8 0x4 /*
> swizzled int A */
> + 0x0 0x0 0x0 0x2 &UIC3 0x9 0x4 /*
> swizzled int B */
> + 0x0 0x0 0x0 0x3 &UIC3 0xa 0x4 /*
> swizzled int C */
> + 0x0 0x0 0x0 0x4 &UIC3 0xb 0x4 /*
> swizzled int D */>;
> + };
>
> };
>
> diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c
> b/arch/powerpc/sysdev/ppc4xx_pci.c
> index 6ff9d71..64cd020 100644
> --- a/arch/powerpc/sysdev/ppc4xx_pci.c
> +++ b/arch/powerpc/sysdev/ppc4xx_pci.c
> @@ -972,6 +972,123 @@ static struct ppc4xx_pciex_hwops
> ppc460ex_pcie_hwops __initdata =
> .setup_utl = ppc460ex_pciex_init_utl,
> };
>
> +static int __init ppc460sx_pciex_core_init(struct device_node *np)
> +{
> + /* HSS drive amplitude */
> + mtdcri(SDR0, PESDR0_460SX_HSSL0DAMP, 0xB9843211);
> + mtdcri(SDR0, PESDR0_460SX_HSSL1DAMP, 0xB9843211);
> + mtdcri(SDR0, PESDR0_460SX_HSSL2DAMP, 0xB9843211);
> + mtdcri(SDR0, PESDR0_460SX_HSSL3DAMP, 0xB9843211);
> + mtdcri(SDR0, PESDR0_460SX_HSSL4DAMP, 0xB9843211);
> + mtdcri(SDR0, PESDR0_460SX_HSSL5DAMP, 0xB9843211);
> + mtdcri(SDR0, PESDR0_460SX_HSSL6DAMP, 0xB9843211);
> + mtdcri(SDR0, PESDR0_460SX_HSSL7DAMP, 0xB9843211);
> +
> + mtdcri(SDR0, PESDR1_460SX_HSSL0DAMP, 0xB9843211);
> + mtdcri(SDR0, PESDR1_460SX_HSSL1DAMP, 0xB9843211);
> + mtdcri(SDR0, PESDR1_460SX_HSSL2DAMP, 0xB9843211);
> + mtdcri(SDR0, PESDR1_460SX_HSSL3DAMP, 0xB9843211);
> +
> + mtdcri(SDR0, PESDR2_460SX_HSSL0DAMP, 0xB9843211);
> + mtdcri(SDR0, PESDR2_460SX_HSSL1DAMP, 0xB9843211);
> + mtdcri(SDR0, PESDR2_460SX_HSSL2DAMP, 0xB9843211);
> + mtdcri(SDR0, PESDR2_460SX_HSSL3DAMP, 0xB9843211);
> +
> + /* HSS TX pre-emphasis */
> + mtdcri(SDR0, PESDR0_460SX_HSSL0COEFA, 0xDCB98987);
> + mtdcri(SDR0, PESDR0_460SX_HSSL1COEFA, 0xDCB98987);
> + mtdcri(SDR0, PESDR0_460SX_HSSL2COEFA, 0xDCB98987);
> + mtdcri(SDR0, PESDR0_460SX_HSSL3COEFA, 0xDCB98987);
> + mtdcri(SDR0, PESDR0_460SX_HSSL4COEFA, 0xDCB98987);
> + mtdcri(SDR0, PESDR0_460SX_HSSL5COEFA, 0xDCB98987);
> + mtdcri(SDR0, PESDR0_460SX_HSSL6COEFA, 0xDCB98987);
> + mtdcri(SDR0, PESDR0_460SX_HSSL7COEFA, 0xDCB98987);
> +
> + mtdcri(SDR0, PESDR1_460SX_HSSL0COEFA, 0xDCB98987);
> + mtdcri(SDR0, PESDR1_460SX_HSSL1COEFA, 0xDCB98987);
> + mtdcri(SDR0, PESDR1_460SX_HSSL2COEFA, 0xDCB98987);
> + mtdcri(SDR0, PESDR1_460SX_HSSL3COEFA, 0xDCB98987);
> +
> + mtdcri(SDR0, PESDR2_460SX_HSSL0COEFA, 0xDCB98987);
> + mtdcri(SDR0, PESDR2_460SX_HSSL1COEFA, 0xDCB98987);
> + mtdcri(SDR0, PESDR2_460SX_HSSL2COEFA, 0xDCB98987);
> + mtdcri(SDR0, PESDR2_460SX_HSSL3COEFA, 0xDCB98987);
> +
> + /* HSS TX calibration control */
> + mtdcri(SDR0, PESDR0_460SX_HSSL1CALDRV, 0x22222222);
> + mtdcri(SDR0, PESDR1_460SX_HSSL1CALDRV, 0x22220000);
> + mtdcri(SDR0, PESDR2_460SX_HSSL1CALDRV, 0x22220000);
> +
> + /* HSS TX slew control */
> + mtdcri(SDR0, PESDR0_460SX_HSSSLEW, 0xFFFFFFFF);
> + mtdcri(SDR0, PESDR1_460SX_HSSSLEW, 0xFFFF0000);
> + mtdcri(SDR0, PESDR2_460SX_HSSSLEW, 0xFFFF0000);
> +
> + udelay(100);
> +
> + /* De-assert PLLRESET */
> + dcri_clrset(SDR0, PESDR0_PLLLCT2, 0x00000100, 0);
> +
> + /* Reset DL, UTL, GPL before configuration */
> + mtdcri(SDR0, PESDR0_460SX_RCSSET,
> + PESDRx_RCSSET_RSTDL | PESDRx_RCSSET_RSTGU);
> + mtdcri(SDR0, PESDR1_460SX_RCSSET,
> + PESDRx_RCSSET_RSTDL | PESDRx_RCSSET_RSTGU);
> + mtdcri(SDR0, PESDR2_460SX_RCSSET,
> + PESDRx_RCSSET_RSTDL | PESDRx_RCSSET_RSTGU);
> +
> + udelay(100);
> +
> + /*
> + * If bifurcation is not enabled, u-boot would have disabled the
> + * third PCIe port
> + */
> + if (((mfdcri(SDR0, PESDR1_460SX_HSSCTLSET) & 0x00000001) ==
> + 0x00000001)) {
> + printk(KERN_INFO "PCI: PCIE bifurcation setup
> successfully.\n");
> + printk(KERN_INFO "PCI: Total 3 PCIE ports are
> present\n");
> + return 3;
> + }
> +
> + printk(KERN_INFO "PCI: Total 2 PCIE ports are present\n");
> + return 2;
> +}
> +
> +static int ppc460sx_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
> +{
> +
> + if (port->endpoint)
> + dcri_clrset(SDR0, port->sdr_base + PESDRn_UTLSET2,
> + 0x01000000, 0);
> + else
> + dcri_clrset(SDR0, port->sdr_base + PESDRn_UTLSET2,
> + 0, 0x01000000);
> +
> + /*Gen-1*/
> + mtdcri(SDR0, port->sdr_base + PESDRn_460SX_RCEI, 0x08000000);
> +
> + dcri_clrset(SDR0, port->sdr_base + PESDRn_RCSSET,
> + (PESDRx_RCSSET_RSTGU | PESDRx_RCSSET_RSTDL),
> + PESDRx_RCSSET_RSTPYN);
> +
> + port->has_ibpre = 1;
> +
> + return 0;
> +}
> +
> +static int ppc460sx_pciex_init_utl(struct ppc4xx_pciex_port *port)
> +{
> + /* Max 128 Bytes */
> + out_be32 (port->utl_base + PEUTL_PBBSZ, 0x00000000);
> + return 0;
> +}
> +
> +static struct ppc4xx_pciex_hwops ppc460sx_pcie_hwops __initdata = {
> + .core_init = ppc460sx_pciex_core_init,
> + .port_init_hw = ppc460sx_pciex_init_port_hw,
> + .setup_utl = ppc460sx_pciex_init_utl,
> +};
> +
> #endif /* CONFIG_44x */
>
> #ifdef CONFIG_40x
> @@ -1087,6 +1204,8 @@ static int __init
> ppc4xx_pciex_check_core_init(struct device_node *np)
> }
> if (of_device_is_compatible(np, "ibm,plb-pciex-460ex"))
> ppc4xx_pciex_hwops = &ppc460ex_pcie_hwops;
> + if (of_device_is_compatible(np, "ibm,plb-pciex-460sx"))
> + ppc4xx_pciex_hwops = &ppc460sx_pcie_hwops;
> #endif /* CONFIG_44x */
> #ifdef CONFIG_40x
> if (of_device_is_compatible(np, "ibm,plb-pciex-405ex"))
> diff --git a/arch/powerpc/sysdev/ppc4xx_pci.h
> b/arch/powerpc/sysdev/ppc4xx_pci.h
> index d04e40b..56d9e5d 100644
> --- a/arch/powerpc/sysdev/ppc4xx_pci.h
> +++ b/arch/powerpc/sysdev/ppc4xx_pci.h
> @@ -324,6 +324,64 @@
> #define PESDR0_460EX_IHS2 0x036D
>
> /*
> + * 460SX addtional DCRs
> + */
> +#define PESDRn_460SX_RCEI 0x02
> +
> +#define PESDR0_460SX_HSSL0DAMP 0x320
> +#define PESDR0_460SX_HSSL1DAMP 0x321
> +#define PESDR0_460SX_HSSL2DAMP 0x322
> +#define PESDR0_460SX_HSSL3DAMP 0x323
> +#define PESDR0_460SX_HSSL4DAMP 0x324
> +#define PESDR0_460SX_HSSL5DAMP 0x325
> +#define PESDR0_460SX_HSSL6DAMP 0x326
> +#define PESDR0_460SX_HSSL7DAMP 0x327
> +
> +#define PESDR1_460SX_HSSL0DAMP 0x354
> +#define PESDR1_460SX_HSSL1DAMP 0x355
> +#define PESDR1_460SX_HSSL2DAMP 0x356
> +#define PESDR1_460SX_HSSL3DAMP 0x357
> +
> +#define PESDR2_460SX_HSSL0DAMP 0x384
> +#define PESDR2_460SX_HSSL1DAMP 0x385
> +#define PESDR2_460SX_HSSL2DAMP 0x386
> +#define PESDR2_460SX_HSSL3DAMP 0x387
> +
> +#define PESDR0_460SX_HSSL0COEFA 0x328
> +#define PESDR0_460SX_HSSL1COEFA 0x329
> +#define PESDR0_460SX_HSSL2COEFA 0x32A
> +#define PESDR0_460SX_HSSL3COEFA 0x32B
> +#define PESDR0_460SX_HSSL4COEFA 0x32C
> +#define PESDR0_460SX_HSSL5COEFA 0x32D
> +#define PESDR0_460SX_HSSL6COEFA 0x32E
> +#define PESDR0_460SX_HSSL7COEFA 0x32F
> +
> +#define PESDR1_460SX_HSSL0COEFA 0x358
> +#define PESDR1_460SX_HSSL1COEFA 0x359
> +#define PESDR1_460SX_HSSL2COEFA 0x35A
> +#define PESDR1_460SX_HSSL3COEFA 0x35B
> +
> +#define PESDR2_460SX_HSSL0COEFA 0x388
> +#define PESDR2_460SX_HSSL1COEFA 0x389
> +#define PESDR2_460SX_HSSL2COEFA 0x38A
> +#define PESDR2_460SX_HSSL3COEFA 0x38B
> +
> +#define PESDR0_460SX_HSSL1CALDRV 0x339
> +#define PESDR1_460SX_HSSL1CALDRV 0x361
> +#define PESDR2_460SX_HSSL1CALDRV 0x391
> +
> +#define PESDR0_460SX_HSSSLEW 0x338
> +#define PESDR1_460SX_HSSSLEW 0x360
> +#define PESDR2_460SX_HSSSLEW 0x390
> +
> +#define PESDR0_460SX_HSSCTLSET 0x31E
> +#define PESDR1_460SX_HSSCTLSET 0x352
> +#define PESDR2_460SX_HSSCTLSET 0x382
> +
> +#define PESDR0_460SX_RCSSET 0x304
> +#define PESDR1_460SX_RCSSET 0x344
> +#define PESDR2_460SX_RCSSET 0x374
> +/*
> * Of the above, some are common offsets from the base
> */
> #define PESDRn_UTLSET1 0x00
^ permalink raw reply
* Re: [PATCH] powerpc: Fix DEBUG_HIGHMEM build break from d4515646699
From: Benjamin Herrenschmidt @ 2009-11-30 19:49 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev, mingo
In-Reply-To: <20091130175750.GD2937@zod.rchland.ibm.com>
On Mon, 2009-11-30 at 12:57 -0500, Josh Boyer wrote:
> On Mon, Nov 23, 2009 at 04:28:53PM -0600, Becky Bruce wrote:
> >Code was added to mm/higmem.c that depends on several
> >kmap types that powerpc does not support. We add dummy
> >invalid definitions for KM_NMI, KM_NM_PTE, and KM_IRQ_PTE.
> >
> >According to list discussion, this fix should not be needed
> >anymore starting with 2.6.33. The code is commented to this
> >effect so hopefully we will remember to remove this.
> >
> >Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
>
> Ben, I see you have this queued up in you 'next' branch, but this seems to be
> impacting 2.6.32 and according to the comments won't be needed in 2.6.33.
> Right now, 2.6.32 doesn't build for a general Fedora ppc32 kernel because of
> this bug. Should this be sent to Linus for .32?
Why would fedora have DEBUG_HIGHMEM enabled ? I'll see what I can do.
> ( http://ppc.koji.fedoraproject.org/koji/getfile?taskID=31439&name=build.log
> for the curious among you that want to look at the build log)
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH] powerpc: Fix DEBUG_HIGHMEM build break from d4515646699
From: Josh Boyer @ 2009-11-30 19:54 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, mingo
In-Reply-To: <1259610583.2076.97.camel@pasglop>
On Tue, Dec 01, 2009 at 06:49:43AM +1100, Benjamin Herrenschmidt wrote:
>On Mon, 2009-11-30 at 12:57 -0500, Josh Boyer wrote:
>> On Mon, Nov 23, 2009 at 04:28:53PM -0600, Becky Bruce wrote:
>> >Code was added to mm/higmem.c that depends on several
>> >kmap types that powerpc does not support. We add dummy
>> >invalid definitions for KM_NMI, KM_NM_PTE, and KM_IRQ_PTE.
>> >
>> >According to list discussion, this fix should not be needed
>> >anymore starting with 2.6.33. The code is commented to this
>> >effect so hopefully we will remember to remove this.
>> >
>> >Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
>>
>> Ben, I see you have this queued up in you 'next' branch, but this seems to be
>> impacting 2.6.32 and according to the comments won't be needed in 2.6.33.
>> Right now, 2.6.32 doesn't build for a general Fedora ppc32 kernel because of
>> this bug. Should this be sent to Linus for .32?
>
>Why would fedora have DEBUG_HIGHMEM enabled ? I'll see what I can do.
Why shouldn't it? Fedora generally builds rawhide kernels with all kinds of
debug options set.
When you say you'll see what you can do, do you mean you'll see if you can get
the patch into .32, or change the Fedora config? If you mean change the Fedora
config, I can do that myself. I was more pointing out that you have a .32
patch not needed for .33 heading for .33... ;)
josh
^ permalink raw reply
* Re: [PATCH] powerpc: Fix DEBUG_HIGHMEM build break from d4515646699
From: Benjamin Herrenschmidt @ 2009-11-30 20:16 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev, mingo
In-Reply-To: <20091130195435.GE2937@zod.rchland.ibm.com>
> When you say you'll see what you can do, do you mean you'll see if you can get
> the patch into .32, or change the Fedora config? If you mean change the Fedora
> config, I can do that myself. I was more pointing out that you have a .32
> patch not needed for .33 heading for .33... ;)
I'll try to get the patch in later today
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH v2 0/3] Kernel handling of Dynamic Logical Partitioning
From: Nathan Fontenot @ 2009-11-30 20:48 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: linuxppc-dev, gregkh, paul Mackerras, linux-kernel
In-Reply-To: <m13a3ztwtw.fsf@fess.ebiederm.org>
Eric W. Biederman wrote:
> Nathan Fontenot <nfont@austin.ibm.com> writes:
>
>> version 2 of the patch set with updates from comments.
>>
>> The Dynamic Logical Partitioning (DLPAR) capabilities of the powerpc pseries
>> platform allows for the addition and removal of resources (i.e. cpus,
>> memory, pci devices) from a partition. The removal of a resource involves
>> removing the resource's node from the device tree and then returning the
>> resource to firmware via the rtas set-indicator call. To add a resource, it
>> is first obtained from firmware via the rtas set-indicator call and then a
>> new device tree node is created using the ibm,configure-coinnector rtas call
>> and added to the device tree.
>>
>> The following set of patches implements the needed infrastructure to have the
>> kernel handle the DLPAR addition and removal of cpus (other DLPAR'able items to
>> follow in future patches). The framework for this is to create a set of
>> probe/release sysfs files that will facilitate arch-specific call-outs to handle
>> addition and removal of cpus to the system.
>
> How does this differ from /sys/devices/system/cpu/cpuX/online ?
>
> From the descriptions it appears that we already have what you are trying to
> add and you just need to tie it into DLPAR on ppc.
>
The DLPAR and hotplug operations need to be kept separate for ppc. One big reason
for this is that DLPAR operations on ppc are driven from the Hardware Management
Console (HMC). It is (almost always) not possible to DLPAR add a resource (i.e.
cpu, memory,pcie device) from the OS. There are HMC <=> firmware interactions
that must occur to make the resource available to the partition.
Second is that there are times when one would want to hotplug add/remove
a cpu but not dlpar add/remove it.
When a resource is DLPAR removed, the OS has no knowledge that the resource exists.
Likewise, this allows the addition of resources from the HMC after the system is booted.
This is a feature of ppc partitions that allows for the dynamic movement of resources
between partitions.
-Nathan Fontenot
^ permalink raw reply
* Re: [PATCH 00/10 v6] Fix 8xx MMU/TLB
From: Scott Wood @ 2009-11-30 22:25 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev@ozlabs.org, Rex Feany
In-Reply-To: <1259357845.2076.9.camel@pasglop>
Benjamin Herrenschmidt wrote:
> On Fri, 2009-11-27 at 11:57 +0100, Joakim Tjernlund wrote:
>> Scott and Rex, I think we need you s-o-b to make it into the kernel proper.
>>
>> Marcelo and Vitaly, I noticed you guys are listed as 8xx maintainers.
>> Have you seen this? What do you think?
>
> I think Marcelo isn't much involved with 8xx anymore. I'd say if Scott
> and Vitaly are ok, then the patches are good. But I'll wait for at least
> Scott to give an Ack as he can at least test which I can't :-)
ACK
-Scott
^ permalink raw reply
* Re: [PATCH 00/10 v6] Fix 8xx MMU/TLB
From: Joakim Tjernlund @ 2009-11-30 22:30 UTC (permalink / raw)
To: Scott Wood; +Cc: Rex Feany, linuxppc-dev@ozlabs.org
In-Reply-To: <4B14465A.3080804@freescale.com>
Scott Wood <scottwood@freescale.com> wrote on 30/11/2009 23:25:30:
>
> Benjamin Herrenschmidt wrote:
> > On Fri, 2009-11-27 at 11:57 +0100, Joakim Tjernlund wrote:
> >> Scott and Rex, I think we need you s-o-b to make it into the kernel proper.
> >>
> >> Marcelo and Vitaly, I noticed you guys are listed as 8xx maintainers.
> >> Have you seen this? What do you think?
> >
> > I think Marcelo isn't much involved with 8xx anymore. I'd say if Scott
> > and Vitaly are ok, then the patches are good. But I'll wait for at least
> > Scott to give an Ack as he can at least test which I can't :-)
>
> ACK
Yippie, lets see if I can work up the energy to do the
same for 2.4 once this is in 2.6 :)
^ permalink raw reply
* [git pull] Please pull powerpc.git merge branch
From: Benjamin Herrenschmidt @ 2009-11-30 22:46 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Andrew Morton, linuxppc-dev list, Linux Kernel list
Hi Linus
Please pull one patch from Becky to fix a build breakage in 2.6.32 with
CONFIG_DEBUG_HIGHMEM. This is, I believe, the same patch that went
into ARM to fix the same issue.
Cheers,
Ben.
The following changes since commit a8a8a669ea13d792296737505adc43ccacf3a648:
Linus Torvalds (1):
Merge branch 'i2c-pnx-fixes' of git://git.fluff.org/bjdooks/linux
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git merge
Becky Bruce (1):
powerpc: Fix DEBUG_HIGHMEM build break from d4515646699
arch/powerpc/include/asm/kmap_types.h | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
^ permalink raw reply
* [PATCH] Adding PCI-E support for 460SX based redwood board.
From: tmarri @ 2009-11-30 22:58 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev, writetomarri, Tirumala Marri
From: Tirumala Marri <tmarri@amcc.com>
This patch would add PCI-E support for AMCC 460SX processor based
redwood board.
Signed-off-by: Tirumala Marri <tmarri@amcc.com>
---
arch/powerpc/boot/dts/redwood.dts | 122 +++++++++++++++++++++++++++++++++++++
arch/powerpc/sysdev/ppc4xx_pci.c | 119 ++++++++++++++++++++++++++++++++++++
arch/powerpc/sysdev/ppc4xx_pci.h | 58 +++++++++++++++++
3 files changed, 299 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/boot/dts/redwood.dts b/arch/powerpc/boot/dts/redwood.dts
index ad402c4..9eeec28 100644
--- a/arch/powerpc/boot/dts/redwood.dts
+++ b/arch/powerpc/boot/dts/redwood.dts
@@ -233,6 +233,128 @@
has-inverted-stacr-oc;
has-new-stacr-staopc;
};
+ PCIE0: pciex@d00000000 {
+ device_type = "pci";
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ compatible = "ibm,plb-pciex-460sx", "ibm,plb-pciex";
+ primary;
+ port = <0x0>; /* port number */
+ reg = <0x0000000d 0x00000000 0x20000000 /* Config space access */
+ 0x0000000c 0x10000000 0x00001000>; /* Registers */
+ dcr-reg = <0x100 0x020>;
+ sdr-base = <0x300>;
+
+ /* Outbound ranges, one memory and one IO,
+ * later cannot be changed
+ */
+ ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000
+ 0x01000000 0x00000000 0x00000000 0x0000000f 0x80000000 0x00000000 0x00010000>;
+
+ /* Inbound 2GB range starting at 0 */
+ dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
+
+ /* This drives busses 10 to 0x1f */
+ bus-range = <0x10 0x1f>;
+
+ /* Legacy interrupts (note the weird polarity, the bridge seems
+ * to invert PCIe legacy interrupts).
+ * We are de-swizzling here because the numbers are actually for
+ * port of the root complex virtual P2P bridge. But I want
+ * to avoid putting a node for it in the tree, so the numbers
+ * below are basically de-swizzled numbers.
+ * The real slot is on idsel 0, so the swizzling is 1:1
+ */
+ interrupt-map-mask = <0x0 0x0 0x0 0x7>;
+ interrupt-map = <
+ 0x0 0x0 0x0 0x1 &UIC3 0x0 0x4 /* swizzled int A */
+ 0x0 0x0 0x0 0x2 &UIC3 0x1 0x4 /* swizzled int B */
+ 0x0 0x0 0x0 0x3 &UIC3 0x2 0x4 /* swizzled int C */
+ 0x0 0x0 0x0 0x4 &UIC3 0x3 0x4 /* swizzled int D */>;
+ };
+
+ PCIE1: pciex@d20000000 {
+ device_type = "pci";
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ compatible = "ibm,plb-pciex-460sx", "ibm,plb-pciex";
+ primary;
+ port = <0x1>; /* port number */
+ reg = <0x0000000d 0x20000000 0x20000000 /* Config space access */
+ 0x0000000c 0x10001000 0x00001000>; /* Registers */
+ dcr-reg = <0x120 0x020>;
+ sdr-base = <0x340>;
+
+ /* Outbound ranges, one memory and one IO,
+ * later cannot be changed
+ */
+ ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x80000000 0x00000000 0x80000000
+ 0x01000000 0x00000000 0x00000000 0x0000000f 0x80010000 0x00000000 0x00010000>;
+
+ /* Inbound 2GB range starting at 0 */
+ dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
+
+ /* This drives busses 10 to 0x1f */
+ bus-range = <0x20 0x2f>;
+
+ /* Legacy interrupts (note the weird polarity, the bridge seems
+ * to invert PCIe legacy interrupts).
+ * We are de-swizzling here because the numbers are actually for
+ * port of the root complex virtual P2P bridge. But I want
+ * to avoid putting a node for it in the tree, so the numbers
+ * below are basically de-swizzled numbers.
+ * The real slot is on idsel 0, so the swizzling is 1:1
+ */
+ interrupt-map-mask = <0x0 0x0 0x0 0x7>;
+ interrupt-map = <
+ 0x0 0x0 0x0 0x1 &UIC3 0x4 0x4 /* swizzled int A */
+ 0x0 0x0 0x0 0x2 &UIC3 0x5 0x4 /* swizzled int B */
+ 0x0 0x0 0x0 0x3 &UIC3 0x6 0x4 /* swizzled int C */
+ 0x0 0x0 0x0 0x4 &UIC3 0x7 0x4 /* swizzled int D */>;
+ };
+
+ PCIE2: pciex@d40000000 {
+ device_type = "pci";
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ compatible = "ibm,plb-pciex-460sx", "ibm,plb-pciex";
+ primary;
+ port = <0x2>; /* port number */
+ reg = <0x0000000d 0x40000000 0x20000000 /* Config space access */
+ 0x0000000c 0x10002000 0x00001000>; /* Registers */
+ dcr-reg = <0x140 0x020>;
+ sdr-base = <0x370>;
+
+ /* Outbound ranges, one memory and one IO,
+ * later cannot be changed
+ */
+ ranges = <0x02000000 0x00000000 0x80000000 0x0000000f 0x00000000 0x00000000 0x80000000
+ 0x01000000 0x00000000 0x00000000 0x0000000f 0x80020000 0x00000000 0x00010000>;
+
+ /* Inbound 2GB range starting at 0 */
+ dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
+
+ /* This drives busses 10 to 0x1f */
+ bus-range = <0x30 0x3f>;
+
+ /* Legacy interrupts (note the weird polarity, the bridge seems
+ * to invert PCIe legacy interrupts).
+ * We are de-swizzling here because the numbers are actually for
+ * port of the root complex virtual P2P bridge. But I want
+ * to avoid putting a node for it in the tree, so the numbers
+ * below are basically de-swizzled numbers.
+ * The real slot is on idsel 0, so the swizzling is 1:1
+ */
+ interrupt-map-mask = <0x0 0x0 0x0 0x7>;
+ interrupt-map = <
+ 0x0 0x0 0x0 0x1 &UIC3 0x8 0x4 /* swizzled int A */
+ 0x0 0x0 0x0 0x2 &UIC3 0x9 0x4 /* swizzled int B */
+ 0x0 0x0 0x0 0x3 &UIC3 0xa 0x4 /* swizzled int C */
+ 0x0 0x0 0x0 0x4 &UIC3 0xb 0x4 /* swizzled int D */>;
+ };
};
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index 6ff9d71..64cd020 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -972,6 +972,123 @@ static struct ppc4xx_pciex_hwops ppc460ex_pcie_hwops __initdata =
.setup_utl = ppc460ex_pciex_init_utl,
};
+static int __init ppc460sx_pciex_core_init(struct device_node *np)
+{
+ /* HSS drive amplitude */
+ mtdcri(SDR0, PESDR0_460SX_HSSL0DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR0_460SX_HSSL1DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR0_460SX_HSSL2DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR0_460SX_HSSL3DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR0_460SX_HSSL4DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR0_460SX_HSSL5DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR0_460SX_HSSL6DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR0_460SX_HSSL7DAMP, 0xB9843211);
+
+ mtdcri(SDR0, PESDR1_460SX_HSSL0DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR1_460SX_HSSL1DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR1_460SX_HSSL2DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR1_460SX_HSSL3DAMP, 0xB9843211);
+
+ mtdcri(SDR0, PESDR2_460SX_HSSL0DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR2_460SX_HSSL1DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR2_460SX_HSSL2DAMP, 0xB9843211);
+ mtdcri(SDR0, PESDR2_460SX_HSSL3DAMP, 0xB9843211);
+
+ /* HSS TX pre-emphasis */
+ mtdcri(SDR0, PESDR0_460SX_HSSL0COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR0_460SX_HSSL1COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR0_460SX_HSSL2COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR0_460SX_HSSL3COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR0_460SX_HSSL4COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR0_460SX_HSSL5COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR0_460SX_HSSL6COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR0_460SX_HSSL7COEFA, 0xDCB98987);
+
+ mtdcri(SDR0, PESDR1_460SX_HSSL0COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR1_460SX_HSSL1COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR1_460SX_HSSL2COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR1_460SX_HSSL3COEFA, 0xDCB98987);
+
+ mtdcri(SDR0, PESDR2_460SX_HSSL0COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR2_460SX_HSSL1COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR2_460SX_HSSL2COEFA, 0xDCB98987);
+ mtdcri(SDR0, PESDR2_460SX_HSSL3COEFA, 0xDCB98987);
+
+ /* HSS TX calibration control */
+ mtdcri(SDR0, PESDR0_460SX_HSSL1CALDRV, 0x22222222);
+ mtdcri(SDR0, PESDR1_460SX_HSSL1CALDRV, 0x22220000);
+ mtdcri(SDR0, PESDR2_460SX_HSSL1CALDRV, 0x22220000);
+
+ /* HSS TX slew control */
+ mtdcri(SDR0, PESDR0_460SX_HSSSLEW, 0xFFFFFFFF);
+ mtdcri(SDR0, PESDR1_460SX_HSSSLEW, 0xFFFF0000);
+ mtdcri(SDR0, PESDR2_460SX_HSSSLEW, 0xFFFF0000);
+
+ udelay(100);
+
+ /* De-assert PLLRESET */
+ dcri_clrset(SDR0, PESDR0_PLLLCT2, 0x00000100, 0);
+
+ /* Reset DL, UTL, GPL before configuration */
+ mtdcri(SDR0, PESDR0_460SX_RCSSET,
+ PESDRx_RCSSET_RSTDL | PESDRx_RCSSET_RSTGU);
+ mtdcri(SDR0, PESDR1_460SX_RCSSET,
+ PESDRx_RCSSET_RSTDL | PESDRx_RCSSET_RSTGU);
+ mtdcri(SDR0, PESDR2_460SX_RCSSET,
+ PESDRx_RCSSET_RSTDL | PESDRx_RCSSET_RSTGU);
+
+ udelay(100);
+
+ /*
+ * If bifurcation is not enabled, u-boot would have disabled the
+ * third PCIe port
+ */
+ if (((mfdcri(SDR0, PESDR1_460SX_HSSCTLSET) & 0x00000001) ==
+ 0x00000001)) {
+ printk(KERN_INFO "PCI: PCIE bifurcation setup successfully.\n");
+ printk(KERN_INFO "PCI: Total 3 PCIE ports are present\n");
+ return 3;
+ }
+
+ printk(KERN_INFO "PCI: Total 2 PCIE ports are present\n");
+ return 2;
+}
+
+static int ppc460sx_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
+{
+
+ if (port->endpoint)
+ dcri_clrset(SDR0, port->sdr_base + PESDRn_UTLSET2,
+ 0x01000000, 0);
+ else
+ dcri_clrset(SDR0, port->sdr_base + PESDRn_UTLSET2,
+ 0, 0x01000000);
+
+ /*Gen-1*/
+ mtdcri(SDR0, port->sdr_base + PESDRn_460SX_RCEI, 0x08000000);
+
+ dcri_clrset(SDR0, port->sdr_base + PESDRn_RCSSET,
+ (PESDRx_RCSSET_RSTGU | PESDRx_RCSSET_RSTDL),
+ PESDRx_RCSSET_RSTPYN);
+
+ port->has_ibpre = 1;
+
+ return 0;
+}
+
+static int ppc460sx_pciex_init_utl(struct ppc4xx_pciex_port *port)
+{
+ /* Max 128 Bytes */
+ out_be32 (port->utl_base + PEUTL_PBBSZ, 0x00000000);
+ return 0;
+}
+
+static struct ppc4xx_pciex_hwops ppc460sx_pcie_hwops __initdata = {
+ .core_init = ppc460sx_pciex_core_init,
+ .port_init_hw = ppc460sx_pciex_init_port_hw,
+ .setup_utl = ppc460sx_pciex_init_utl,
+};
+
#endif /* CONFIG_44x */
#ifdef CONFIG_40x
@@ -1087,6 +1204,8 @@ static int __init ppc4xx_pciex_check_core_init(struct device_node *np)
}
if (of_device_is_compatible(np, "ibm,plb-pciex-460ex"))
ppc4xx_pciex_hwops = &ppc460ex_pcie_hwops;
+ if (of_device_is_compatible(np, "ibm,plb-pciex-460sx"))
+ ppc4xx_pciex_hwops = &ppc460sx_pcie_hwops;
#endif /* CONFIG_44x */
#ifdef CONFIG_40x
if (of_device_is_compatible(np, "ibm,plb-pciex-405ex"))
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.h b/arch/powerpc/sysdev/ppc4xx_pci.h
index d04e40b..56d9e5d 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.h
+++ b/arch/powerpc/sysdev/ppc4xx_pci.h
@@ -324,6 +324,64 @@
#define PESDR0_460EX_IHS2 0x036D
/*
+ * 460SX addtional DCRs
+ */
+#define PESDRn_460SX_RCEI 0x02
+
+#define PESDR0_460SX_HSSL0DAMP 0x320
+#define PESDR0_460SX_HSSL1DAMP 0x321
+#define PESDR0_460SX_HSSL2DAMP 0x322
+#define PESDR0_460SX_HSSL3DAMP 0x323
+#define PESDR0_460SX_HSSL4DAMP 0x324
+#define PESDR0_460SX_HSSL5DAMP 0x325
+#define PESDR0_460SX_HSSL6DAMP 0x326
+#define PESDR0_460SX_HSSL7DAMP 0x327
+
+#define PESDR1_460SX_HSSL0DAMP 0x354
+#define PESDR1_460SX_HSSL1DAMP 0x355
+#define PESDR1_460SX_HSSL2DAMP 0x356
+#define PESDR1_460SX_HSSL3DAMP 0x357
+
+#define PESDR2_460SX_HSSL0DAMP 0x384
+#define PESDR2_460SX_HSSL1DAMP 0x385
+#define PESDR2_460SX_HSSL2DAMP 0x386
+#define PESDR2_460SX_HSSL3DAMP 0x387
+
+#define PESDR0_460SX_HSSL0COEFA 0x328
+#define PESDR0_460SX_HSSL1COEFA 0x329
+#define PESDR0_460SX_HSSL2COEFA 0x32A
+#define PESDR0_460SX_HSSL3COEFA 0x32B
+#define PESDR0_460SX_HSSL4COEFA 0x32C
+#define PESDR0_460SX_HSSL5COEFA 0x32D
+#define PESDR0_460SX_HSSL6COEFA 0x32E
+#define PESDR0_460SX_HSSL7COEFA 0x32F
+
+#define PESDR1_460SX_HSSL0COEFA 0x358
+#define PESDR1_460SX_HSSL1COEFA 0x359
+#define PESDR1_460SX_HSSL2COEFA 0x35A
+#define PESDR1_460SX_HSSL3COEFA 0x35B
+
+#define PESDR2_460SX_HSSL0COEFA 0x388
+#define PESDR2_460SX_HSSL1COEFA 0x389
+#define PESDR2_460SX_HSSL2COEFA 0x38A
+#define PESDR2_460SX_HSSL3COEFA 0x38B
+
+#define PESDR0_460SX_HSSL1CALDRV 0x339
+#define PESDR1_460SX_HSSL1CALDRV 0x361
+#define PESDR2_460SX_HSSL1CALDRV 0x391
+
+#define PESDR0_460SX_HSSSLEW 0x338
+#define PESDR1_460SX_HSSSLEW 0x360
+#define PESDR2_460SX_HSSSLEW 0x390
+
+#define PESDR0_460SX_HSSCTLSET 0x31E
+#define PESDR1_460SX_HSSCTLSET 0x352
+#define PESDR2_460SX_HSSCTLSET 0x382
+
+#define PESDR0_460SX_RCSSET 0x304
+#define PESDR1_460SX_RCSSET 0x344
+#define PESDR2_460SX_RCSSET 0x374
+/*
* Of the above, some are common offsets from the base
*/
#define PESDRn_UTLSET1 0x00
--
1.6.3.3
^ permalink raw reply related
* [RFC PATCH v3 0/3] rework of usbgecko-based early debug
From: Albert Herranz @ 2009-11-30 23:09 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Albert Herranz
This series is a rework of the previously posted patch:
- [RFC PATCH v2 08/11] powerpc: gamecube/wii: early debugging using usbgecko
It tries to implement the ideas suggested by Benjamin Herrenschmidt
regarding the use of a fixmap entry to provide a valid I/O mapping
immediately after MMU_init runs and MMU is definitively enabled.
Albert Herranz (3):
powerpc: udbg: add early remap hook
powerpc: udbg: add fixmap entry for early debug
powerpc: gamecube/wii: early debugging using usbgecko
arch/powerpc/Kconfig.debug | 8 +++
arch/powerpc/include/asm/fixmap.h | 3 +
arch/powerpc/include/asm/udbg.h | 4 +
arch/powerpc/kernel/head_32.S | 21 +++++++
arch/powerpc/kernel/udbg.c | 5 ++
arch/powerpc/mm/init_32.c | 10 +++
arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c | 59 ++++++++++++++++++++
arch/powerpc/platforms/embedded6xx/usbgecko_udbg.h | 2 +
8 files changed, 112 insertions(+), 0 deletions(-)
^ permalink raw reply
* [RFC PATCH v3 1/3] powerpc: udbg: add early remap hook
From: Albert Herranz @ 2009-11-30 23:09 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Albert Herranz
In-Reply-To: <cover.1259609263.git.albert_herranz@yahoo.es>
The udbg facility provides an early debug extension that can be enabled
using CONFIG_PPC_EARLY_DEBUG.
In some cases, this early debugging facility cannot be used after
MMU_init runs (and the MMU is loaded and enabled with the definitive
mappings) because the early mappings are not valid anymore.
This patch provides a udbg hook called udbg_early_remap that gets called
at the end of MMU_init and can be used by a low level udbg driver
to accomplish several goals, like:
- extending the early debugging life by configuring and using a new
valid I/O mapping
- safely disabling the early debugging
Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
---
arch/powerpc/include/asm/udbg.h | 3 +++
arch/powerpc/kernel/udbg.c | 3 +++
arch/powerpc/mm/init_32.c | 10 ++++++++++
3 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/include/asm/udbg.h b/arch/powerpc/include/asm/udbg.h
index cd21e5e..9dfedec 100644
--- a/arch/powerpc/include/asm/udbg.h
+++ b/arch/powerpc/include/asm/udbg.h
@@ -18,6 +18,9 @@ extern void (*udbg_putc)(char c);
extern void (*udbg_flush)(void);
extern int (*udbg_getc)(void);
extern int (*udbg_getc_poll)(void);
+#ifdef CONFIG_PPC_EARLY_DEBUG
+extern void (*udbg_early_remap)(void);
+#endif
extern void udbg_puts(const char *s);
extern int udbg_write(const char *s, int n);
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c
index fc9af47..2711050 100644
--- a/arch/powerpc/kernel/udbg.c
+++ b/arch/powerpc/kernel/udbg.c
@@ -21,6 +21,9 @@ void (*udbg_putc)(char c);
void (*udbg_flush)(void);
int (*udbg_getc)(void);
int (*udbg_getc_poll)(void);
+#ifdef CONFIG_PPC_EARLY_DEBUG
+void (*udbg_early_remap)(void);
+#endif
/*
* Early debugging facilities. You can enable _one_ of these via .config,
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index 9ddcfb4..066e4ff 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -43,6 +43,7 @@
#include <asm/tlb.h>
#include <asm/sections.h>
#include <asm/system.h>
+#include <asm/udbg.h>
#include "mmu_decl.h"
@@ -180,6 +181,15 @@ void __init MMU_init(void)
#ifdef CONFIG_BOOTX_TEXT
btext_unmap();
#endif
+#ifdef CONFIG_PPC_EARLY_DEBUG
+ /*
+ * This hook can be used by a low level early udbg driver to either
+ * provide a new valid I/O mapping to be used after MMU_init
+ * or just to safely disable actual udbg I/O from now on.
+ */
+ if (udbg_early_remap)
+ udbg_early_remap();
+#endif
}
/* This is only called until mem_init is done. */
--
1.6.3.3
^ permalink raw reply related
* [RFC PATCH v3 2/3] powerpc: udbg: add fixmap entry for early debug
From: Albert Herranz @ 2009-11-30 23:09 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Albert Herranz
In-Reply-To: <cover.1259609263.git.albert_herranz@yahoo.es>
Add a new entry to the fixmap table to allow low level early udbg drivers
to safely reserve virtual address space and create their I/O mappings.
Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
---
arch/powerpc/include/asm/fixmap.h | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/include/asm/fixmap.h b/arch/powerpc/include/asm/fixmap.h
index f1f4e23..424e5a6 100644
--- a/arch/powerpc/include/asm/fixmap.h
+++ b/arch/powerpc/include/asm/fixmap.h
@@ -48,6 +48,9 @@ enum fixed_addresses {
FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
#endif
+#ifdef CONFIG_PPC_EARLY_DEBUG
+ FIX_EARLY_DEBUG_BASE,
+#endif
/* FIX_PCIE_MCFG, */
__end_of_fixed_addresses
};
--
1.6.3.3
^ permalink raw reply related
* [RFC PATCH v3 3/3] powerpc: gamecube/wii: early debugging using usbgecko
From: Albert Herranz @ 2009-11-30 23:09 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Albert Herranz
In-Reply-To: <cover.1259609263.git.albert_herranz@yahoo.es>
Add support for using the USB Gecko adapter as an early debugging
console on the Nintendo GameCube and Wii video game consoles.
The USB Gecko is a 3rd party memory card interface adapter that provides
a EXI (External Interface) to USB serial converter.
Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
---
arch/powerpc/Kconfig.debug | 8 +++
arch/powerpc/include/asm/udbg.h | 1 +
arch/powerpc/kernel/head_32.S | 21 +++++++
arch/powerpc/kernel/udbg.c | 2 +
arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c | 59 ++++++++++++++++++++
arch/powerpc/platforms/embedded6xx/usbgecko_udbg.h | 2 +
6 files changed, 93 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 3b10051..11e385b 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -254,6 +254,14 @@ config PPC_EARLY_DEBUG_CPM
using a CPM-based serial port. This assumes that the bootwrapper
has run, and set up the CPM in a particular way.
+config PPC_EARLY_DEBUG_USBGECKO
+ bool "Early debugging through the USB Gecko adapter"
+ depends on GAMECUBE_COMMON
+ select USBGECKO_UDBG
+ help
+ Select this to enable early debugging for Nintendo GameCube/Wii
+ consoles via an external USB Gecko adapter.
+
endchoice
config PPC_EARLY_DEBUG_44x_PHYSLOW
diff --git a/arch/powerpc/include/asm/udbg.h b/arch/powerpc/include/asm/udbg.h
index 9dfedec..5abfd0f 100644
--- a/arch/powerpc/include/asm/udbg.h
+++ b/arch/powerpc/include/asm/udbg.h
@@ -54,6 +54,7 @@ extern void __init udbg_init_btext(void);
extern void __init udbg_init_44x_as1(void);
extern void __init udbg_init_40x_realmode(void);
extern void __init udbg_init_cpm(void);
+extern void __init udbg_init_usbgecko(void);
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_UDBG_H */
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 829c3fe..c3f3737 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -164,6 +164,9 @@ __after_mmu_off:
#ifdef CONFIG_PPC_EARLY_DEBUG_CPM
bl setup_cpm_bat
#endif
+#ifdef CONFIG_PPC_EARLY_DEBUG_USBGECKO
+ bl setup_usbgecko_bat
+#endif
/*
* Call setup_cpu for CPU 0 and initialize 6xx Idle
@@ -1203,6 +1206,24 @@ setup_cpm_bat:
blr
#endif
+#ifdef CONFIG_PPC_EARLY_DEBUG_USBGECKO
+setup_usbgecko_bat:
+ /* prepare a BAT for early io */
+#if defined(CONFIG_GAMECUBE)
+ lis r8, 0x0c00
+#elif defined(CONFIG_WII)
+ lis r8, 0x0d00
+#else
+#error Invalid platform for USB Gecko based early debugging.
+#endif
+ mr r11, r8
+ ori r8, r8, 0x002a /* uncached, guarded ,rw */
+ ori r11, r11, 0x3 /* 128K */
+ mtspr SPRN_DBAT1L, r8
+ mtspr SPRN_DBAT1U, r11
+ blr
+#endif
+
#ifdef CONFIG_8260
/* Jump into the system reset for the rom.
* We first disable the MMU, and then jump to the ROM reset address.
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c
index 2711050..65a7926 100644
--- a/arch/powerpc/kernel/udbg.c
+++ b/arch/powerpc/kernel/udbg.c
@@ -63,6 +63,8 @@ void __init udbg_early_init(void)
udbg_init_40x_realmode();
#elif defined(CONFIG_PPC_EARLY_DEBUG_CPM)
udbg_init_cpm();
+#elif defined(CONFIG_PPC_EARLY_DEBUG_USBGECKO)
+ udbg_init_usbgecko();
#endif
#ifdef CONFIG_PPC_EARLY_DEBUG
diff --git a/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c b/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
index ba4c7cc..3f125b6 100644
--- a/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
+++ b/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
@@ -17,6 +17,7 @@
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/udbg.h>
+#include <asm/fixmap.h>
#include "usbgecko_udbg.h"
@@ -270,3 +271,61 @@ done:
of_node_put(np);
return;
}
+
+#ifdef CONFIG_PPC_EARLY_DEBUG_USBGECKO
+
+static void __init ug_early_remap(void)
+{
+ unsigned long addr;
+ void __iomem *io;
+
+ if (ug_io_base) {
+ addr = (unsigned long)ug_io_base;
+ set_fixmap_nocache(FIX_EARLY_DEBUG_BASE, addr & PAGE_MASK);
+ io = (void __iomem *)__fix_to_virt(FIX_EARLY_DEBUG_BASE);
+ io += addr & ~PAGE_MASK;
+ udbg_printf("%s: %p -> %p\n", __func__, ug_io_base, io);
+ ug_io_base = io;
+ }
+}
+
+static void __iomem * __init ug_early_grab_exi_io_base(void)
+{
+#if defined(CONFIG_GAMECUBE)
+ return (void __iomem *)0x0c006800;
+#elif defined(CONFIG_WII)
+ return (void __iomem *)0x0d006800;
+#else
+#error Invalid platform for USB Gecko based early debugging.
+#endif
+}
+
+/*
+ * USB Gecko early debug support initialization for udbg.
+ */
+void __init udbg_init_usbgecko(void)
+{
+ void __iomem *exi_io_base;
+
+ /*
+ * At this point we have a BAT already setup that enables I/O
+ * to the EXI hardware.
+ */
+
+ exi_io_base = ug_early_grab_exi_io_base();
+ if (!exi_io_base)
+ return;
+
+ /* try to detect a USB Gecko */
+ if (!ug_udbg_probe(exi_io_base))
+ return;
+
+ /* we found a USB Gecko, load udbg hooks */
+ udbg_putc = ug_udbg_putc;
+ udbg_getc = ug_udbg_getc;
+ udbg_getc_poll = ug_udbg_getc_poll;
+ udbg_early_remap = ug_early_remap;
+}
+
+#endif /* CONFIG_PPC_EARLY_DEBUG_USBGECKO */
+
diff --git a/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.h b/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.h
index 3929de3..bb6cde4 100644
--- a/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.h
+++ b/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.h
@@ -27,4 +27,6 @@ static inline void __init ug_udbg_init(void)
#endif /* CONFIG_USBGECKO_UDBG */
+void __init udbg_init_usbgecko(void);
+
#endif /* __USBGECKO_UDBG_H */
--
1.6.3.3
^ permalink raw reply related
* linux-next: powerpc tree build failure
From: Stephen Rothwell @ 2009-11-30 23:23 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev
Cc: linux-next, linux-kernel, David Gibson
[-- Attachment #1: Type: text/plain, Size: 672 bytes --]
Hi Ben,
Today's linux-next build (powerpc ppc64_defconfig) failed like this:
arch/powerpc/mm/mmu_context_hash64.c: In function 'destroy_context':
arch/powerpc/mm/mmu_context_hash64.c:96: error: passing argument 1 of 'subpage_prot_free' from incompatible pointer type
arch/powerpc/include/asm/mmu-hash64.h:404: note: expected 'pgd_t *' but argument is of type 'struct mm_struct *'
Casued by commit c045256d146800ea1d741a8e9e377dada6b7e195 ("powerpc/mm:
Fix bug in pagetable cache cleanup with CONFIG_PPC_SUBPAGE_PROT") which I
have reverted for today.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: [PATCH v2] ppc440spe-adma: adds updated ppc440spe adma driver
From: Dan Williams @ 2009-12-01 0:39 UTC (permalink / raw)
To: Anatolij Gustschin
Cc: linux-raid@vger.kernel.org, linuxppc-dev@ozlabs.org,
Yuri Tikhonov, wd@denx.de, dzu@denx.de
In-Reply-To: <1259186722-15012-1-git-send-email-agust@denx.de>
Anatolij Gustschin wrote:
> This patch adds new version of the PPC440SPe ADMA driver.
>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
[minor] Sign-offs are typically in delivery path order, so yours would
appear last.
[..]
> drivers/dma/ppc440spe/ppc440spe-adma.c | 5015 ++++++++++++++++++++
> drivers/dma/ppc440spe/ppc440spe_adma.h | 195 +
> drivers/dma/ppc440spe/ppc440spe_dma.h | 223 +
> drivers/dma/ppc440spe/ppc440spe_xor.h | 110 +
I belong to the school of thought that says something along the lines of
"don't duplicate the directory path in the filename". You seem to have
copied the iop-adma driver's inconsistent use of '-' and '_' let's not
carry that forward, i.e. looking for a changelog like:
drivers/dma/ppc440spe/adma.c | 5015 ++++++++++++++++++++
drivers/dma/ppc440spe/adma.h | 195 +
drivers/dma/ppc440spe/dma.h | 223 +
drivers/dma/ppc440spe/xor.h | 110 +
> +/**
> + * ppc440spe_adma_prep_dma_pqzero_sum - prepare CDB group for
> + * a PQ_ZERO_SUM operation
> + */
> +static struct dma_async_tx_descriptor *ppc440spe_adma_prep_dma_pqzero_sum(
> + struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src,
> + unsigned int src_cnt, const unsigned char *scf, size_t len,
> + enum sum_check_flags *pqres, unsigned long flags)
> +{
> + struct ppc440spe_adma_chan *ppc440spe_chan;
> + struct ppc440spe_adma_desc_slot *sw_desc, *iter;
> + dma_addr_t pdest, qdest;
> + int slot_cnt, slots_per_op, idst, dst_cnt;
> +
> + if (unlikely(!len))
> + return NULL;
> + if (len > PAGE_SIZE)
> + return NULL;
This won't work, as currently we'll end up in an infinite loop in
async_syndrome_val() because all descriptor allocation failures are
assumed to be time-limited. The code just issues any pending operations
and waits for descriptor resources to become available.
What this comes down to is that ppc440spe_adma is essentially fibbing
about its support for the pq_val operation. I think a more generic
solution would be to advertise to the async_tx api that the driver has
per channel temporary buffers that can be used to store intermediate pq
results and let the async_tx api handle the emulation using its
knowledge of ->max_pq. We would also need a mechanism for the async_tx
api to lock out other requesters of the temporary buffer until a
coherent set of descriptors referencing those temporary buffers has been
submitted to the driver. This would help other drivers like mv_xor
which has no val support and ioatdma which currently can only validate
up to 8 sources asynchronously.
Can you clarify what ppc440spe-adma supports in this area? It looks
like it has some hardware support for result checking but always needs
to write p and/or q somewhere? Some devices may be able to do the final
comparison against the original parity values asynchronously while
others may need to do it synchronously in software. These details can
be handled at the async_tx api level.
Until this is resolved I would prefer that ppe440spe-adma use the
existing pq_val emulation by not setting DMA_PQ_VAL in the capability mask.
--
Dan
^ permalink raw reply
* Re: [RFC PATCH v3 3/3] powerpc: gamecube/wii: early debugging using usbgecko
From: Richard Holden @ 2009-12-01 1:25 UTC (permalink / raw)
To: Albert Herranz; +Cc: linuxppc-dev
In-Reply-To: <86935119c483c2d6e4c810c0afd079e049443b18.1259609263.git.albert_herranz@yahoo.es>
Albert Herranz wrote:
> Add support for using the USB Gecko adapter as an early debugging
> console on the Nintendo GameCube and Wii video game consoles.
> The USB Gecko is a 3rd party memory card interface adapter that provides
> a EXI (External Interface) to USB serial converter.
>
> Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
> ---
> arch/powerpc/Kconfig.debug | 8 +++
> arch/powerpc/include/asm/udbg.h | 1 +
> arch/powerpc/kernel/head_32.S | 21 +++++++
> arch/powerpc/kernel/udbg.c | 2 +
> arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c | 59 ++++++++++++++++++++
> arch/powerpc/platforms/embedded6xx/usbgecko_udbg.h | 2 +
> 6 files changed, 93 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
> index 3b10051..11e385b 100644
> --- a/arch/powerpc/Kconfig.debug
> +++ b/arch/powerpc/Kconfig.debug
> @@ -254,6 +254,14 @@ config PPC_EARLY_DEBUG_CPM
> using a CPM-based serial port. This assumes that the bootwrapper
> has run, and set up the CPM in a particular way.
>
> +config PPC_EARLY_DEBUG_USBGECKO
> + bool "Early debugging through the USB Gecko adapter"
> + depends on GAMECUBE_COMMON
> + select USBGECKO_UDBG
> + help
> + Select this to enable early debugging for Nintendo GameCube/Wii
> + consoles via an external USB Gecko adapter.
> +
> endchoice
>
> config PPC_EARLY_DEBUG_44x_PHYSLOW
Small nit, my preference would be for this to be in the patch 1 where it
is first referenced.
> diff --git a/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c b/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
> index ba4c7cc..3f125b6 100644
> --- a/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
> +++ b/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
> @@ -17,6 +17,7 @@
> #include <asm/io.h>
> #include <asm/prom.h>
> #include <asm/udbg.h>
> +#include <asm/fixmap.h>
>
> #include "usbgecko_udbg.h"
>
> @@ -270,3 +271,61 @@ done:
> of_node_put(np);
> return;
> }
> +
> +#ifdef CONFIG_PPC_EARLY_DEBUG_USBGECKO
> +
> +static void __init ug_early_remap(void)
you may want to rename the ug_ prefix, it took me a while looking back
and forth through the patch to convince myself it wasn't a typo.
-Richard Holden
^ permalink raw reply
* Re: [PATCH] ppc64: re-enable kexec to allow module loads with CONFIG_MODVERSIONS and CONFIG_RELOCATABLE turned on
From: Rusty Russell @ 2009-12-01 2:58 UTC (permalink / raw)
To: Neil Horman; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <20091130181600.GA11583@hmsreliant.think-freely.org>
On Tue, 1 Dec 2009 04:46:00 am Neil Horman wrote:
> Paul, Ben, given that Rusty hasn't come back with any opinion on this patch, do you
> feel comfortable merging it via the ppc tree? Currently the earlyinit routine
> is only compiled in and used for your arch, so I think its fairly benign.
Sorry, I *did* track down the archives for linuxppc-dev, then find your post,
then read your patch. But I didn't actually reply.
Other than minor issues, there's one significant one: you shouldn't be trying
to change rodata. It might work on PPC today, but it's poor form at least.
How's this? Untested on ppc.
Other changes:
1) I also changed reloc_start to an array; this is a good idea for any
linker-defined symbols so the compiler can't make assumptions about size.
2) local.h? How about module.h?
3) I don't think the extra ". = 0" is necessary.
4) ARCH_USES_RELOC_ENTRIES isn't clear enough for me; I prefer
ARCH_RELOCATE_KCRCTAB.
module: handle ppc64 relocating kcrctabs when CONFIG_RELOCATABLE=y
http://lists.ozlabs.org/pipermail/linuxppc-dev/2009-November/077972.html
Inspired-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
diff --git a/arch/powerpc/include/asm/module.h b/arch/powerpc/include/asm/module.h
--- a/arch/powerpc/include/asm/module.h
+++ b/arch/powerpc/include/asm/module.h
@@ -87,5 +87,10 @@ struct exception_table_entry;
void sort_ex_table(struct exception_table_entry *start,
struct exception_table_entry *finish);
+#ifdef CONFIG_MODVERSIONS
+#define ARCH_RELOCATES_KCRCTAB
+
+extern const unsigned long reloc_start[];
+#endif
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_MODULE_H */
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -38,6 +38,9 @@ jiffies = jiffies_64 + 4;
#endif
SECTIONS
{
+ . = 0;
+ reloc_start = .;
+
. = KERNELBASE;
/*
diff --git a/kernel/module.c b/kernel/module.c
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1030,11 +1030,23 @@ static int try_to_force_load(struct modu
}
#ifdef CONFIG_MODVERSIONS
+/* If the arch applies (non-zero) relocations to kernel kcrctab, unapply it. */
+static unsigned long maybe_relocated(unsigned long crc,
+ const struct module *crc_owner)
+{
+#ifdef ARCH_RELOCATES_KCRCTAB
+ if (crc_owner == NULL)
+ return crc - (unsigned long)reloc_start;
+#endif
+ return crc;
+}
+
static int check_version(Elf_Shdr *sechdrs,
unsigned int versindex,
const char *symname,
struct module *mod,
- const unsigned long *crc)
+ const unsigned long *crc,
+ const struct module *crc_owner)
{
unsigned int i, num_versions;
struct modversion_info *versions;
@@ -1055,10 +1067,10 @@ static int check_version(Elf_Shdr *sechd
if (strcmp(versions[i].name, symname) != 0)
continue;
- if (versions[i].crc == *crc)
+ if (versions[i].crc == maybe_relocated(*crc, crc_owner))
return 1;
DEBUGP("Found checksum %lX vs module %lX\n",
- *crc, versions[i].crc);
+ maybe_relocated(*crc, crc_owner), versions[i].crc);
goto bad_version;
}
@@ -1081,7 +1093,8 @@ static inline int check_modstruct_versio
if (!find_symbol(MODULE_SYMBOL_PREFIX "module_layout", NULL,
&crc, true, false))
BUG();
- return check_version(sechdrs, versindex, "module_layout", mod, crc);
+ return check_version(sechdrs, versindex, "module_layout", mod, crc,
+ NULL);
}
/* First part is kernel version, which we ignore if module has crcs. */
@@ -1099,7 +1112,8 @@ static inline int check_version(Elf_Shdr
unsigned int versindex,
const char *symname,
struct module *mod,
- const unsigned long *crc)
+ const unsigned long *crc,
+ const struct module *crc_owner)
{
return 1;
}
@@ -1134,8 +1148,8 @@ static const struct kernel_symbol *resol
/* use_module can fail due to OOM,
or module initialization or unloading */
if (sym) {
- if (!check_version(sechdrs, versindex, name, mod, crc) ||
- !use_module(mod, owner))
+ if (!check_version(sechdrs, versindex, name, mod, crc, owner)
+ || !use_module(mod, owner))
sym = NULL;
}
return sym;
^ permalink raw reply
* Re: [RFC PATCH v3 3/3] powerpc: gamecube/wii: early debugging using usbgecko
From: Albert Herranz @ 2009-12-01 5:23 UTC (permalink / raw)
To: Richard Holden; +Cc: linuxppc-dev
In-Reply-To: <4B147086.6070602@gmail.com>
Richard Holden wrote:
> Albert Herranz wrote:
>> Add support for using the USB Gecko adapter as an early debugging
>> console on the Nintendo GameCube and Wii video game consoles.
>> The USB Gecko is a 3rd party memory card interface adapter that provides
>> a EXI (External Interface) to USB serial converter.
>>
>> Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
>> ---
>> arch/powerpc/Kconfig.debug | 8 +++
>> arch/powerpc/include/asm/udbg.h | 1 +
>> arch/powerpc/kernel/head_32.S | 21 +++++++
>> arch/powerpc/kernel/udbg.c | 2 +
>> arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c | 59 ++++++++++++++++++++
>> arch/powerpc/platforms/embedded6xx/usbgecko_udbg.h | 2 +
>> 6 files changed, 93 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
>> index 3b10051..11e385b 100644
>> --- a/arch/powerpc/Kconfig.debug
>> +++ b/arch/powerpc/Kconfig.debug
>> @@ -254,6 +254,14 @@ config PPC_EARLY_DEBUG_CPM
>> using a CPM-based serial port. This assumes that the bootwrapper
>> has run, and set up the CPM in a particular way.
>>
>> +config PPC_EARLY_DEBUG_USBGECKO
>> + bool "Early debugging through the USB Gecko adapter"
>> + depends on GAMECUBE_COMMON
>> + select USBGECKO_UDBG
>> + help
>> + Select this to enable early debugging for Nintendo GameCube/Wii
>> + consoles via an external USB Gecko adapter.
>> +
>> endchoice
>>
>> config PPC_EARLY_DEBUG_44x_PHYSLOW
>
> Small nit, my preference would be for this to be in the patch 1 where it
> is first referenced.
>
The first patch is generic, and uses PPC_EARLY_DEBUG.
This is the first patch where PPC_EARLY_DEBUG_USBGECKO is referenced.
>> diff --git a/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c b/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
>> index ba4c7cc..3f125b6 100644
>> --- a/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
>> +++ b/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
>> @@ -17,6 +17,7 @@
>> #include <asm/io.h>
>> #include <asm/prom.h>
>> #include <asm/udbg.h>
>> +#include <asm/fixmap.h>
>>
>> #include "usbgecko_udbg.h"
>>
>> @@ -270,3 +271,61 @@ done:
>> of_node_put(np);
>> return;
>> }
>> +
>> +#ifdef CONFIG_PPC_EARLY_DEBUG_USBGECKO
>> +
>> +static void __init ug_early_remap(void)
>
> you may want to rename the ug_ prefix, it took me a while looking back
> and forth through the patch to convince myself it wasn't a typo.
>
What's wrong with ug_ ? (ug = (u)sb(g)ecko)
> -Richard Holden
>
Thanks,
Albert
^ permalink raw reply
* ep440xs board boot problem
From: Allan Wang @ 2009-12-01 5:35 UTC (permalink / raw)
To: linuxppc-dev
Hello, All,=0A=0AI am new to the list. I am still newbie to embedded linux.=
I have bought an ep440xs board which is similar to sequoia board. u-boot i=
s working. I am trying to make it run linux. I have the following problems=
and need your help. Thank you very much:=0A=0A=0AI am using linux kernel 2=
.6.30.4. I encounter 2 problems:=0A1. After console_init() is called inside=
start_kernel(), the console starts printing garbage like:=0ASerial: 8250/1=
6550 driver, 4 ports, IRQ sharing enabled=0Aserial8250.0: ttyS0 at MMIO 0x1=
ef600300 (irq =3D 16) is a 16550A=0A=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=
=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=
=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=
=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=
=BF=BD=0A=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=
=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=
=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=
=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=0A=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=
=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=
=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=
=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=
=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=0A=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=
=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=
=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=
=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=
=EF=BF=BD=0A=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=
=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=
=BF=BD=EF=BF=BD.=0A2. It pakics when mounting the root file system(NFS):=0A=
(gdb) bt=0A#0 panic (fmt=3D0xc0290e94 "VFS: Unable to mount root fs on %s"=
)=0Aat kernel/panic.c:70=0A#1 0xc02d8ce0 in mount_block_root (name=3D0xc02=
90de4 "/dev/root", flags=3D0x8001)=0Aat init/do_mounts.c:272=0A#2 0xc02d90=
84 in prepare_namespace () at init/do_mounts.c:415=0A#3 0xc02d81ec in kern=
el_init (unused=3D<value optimized out>) at init/main.c:885=0A#4 0xc000de6=
0 in kernel_thread ()=0AThere is a patch for Sequoia board to delete /chose=
n part in sequoia.dts, is /chosen required?=0A=0AAllan=0A=0A=0A=0A
^ permalink raw reply
* RE: [PATCH v3 3/3] powerpc/fsl: 85xx: add cache-sram support
From: Mahajan Vivek-B08308 @ 2009-12-01 5:36 UTC (permalink / raw)
To: Wood Scott-B07421; +Cc: linuxppc-dev, Gala Kumar-B11780
In-Reply-To: <20091120173859.GC18967@loki.buserror.net>
> From: Wood Scott-B07421=20
> Sent: Friday, November 20, 2009 11:09 PM
> > Cache-sram does not have any device tree entry since it is not a=20
> > hardware as such. Putting it under chosen can be another option.
> > I think, Scott (cc'ed) was of the opinion that since 32b=20
> base address=20
> > support is missing; so there is no point in moving this=20
> address to the=20
> > command line and .config should be okay for now for it.
>=20
> I don't know what you mean by "32b base address support is=20
> missing". I have no objection to putting it on the command line.
It was a typo, it should be missing 36b address support. Since the
kernel=20
did not run under different environment (i.e 32b / 36b base address); so
it=20
was decided that .config may be okay for this.
>=20
> -Scott
>=20
Thanks,
Vivek
^ permalink raw reply
* Re: [RFC PATCH v3 3/3] powerpc: gamecube/wii: early debugging using usbgecko
From: Michael Ellerman @ 2009-12-01 5:40 UTC (permalink / raw)
To: Albert Herranz; +Cc: Richard Holden, linuxppc-dev
In-Reply-To: <4B14A834.4070907@yahoo.es>
[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]
On Tue, 2009-12-01 at 06:23 +0100, Albert Herranz wrote:
> Richard Holden wrote:
> >> diff --git a/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c b/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
> >> index ba4c7cc..3f125b6 100644
> >> --- a/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
> >> +++ b/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
> >> @@ -17,6 +17,7 @@
> >> #include <asm/io.h>
> >> #include <asm/prom.h>
> >> #include <asm/udbg.h>
> >> +#include <asm/fixmap.h>
> >>
> >> #include "usbgecko_udbg.h"
> >>
> >> @@ -270,3 +271,61 @@ done:
> >> of_node_put(np);
> >> return;
> >> }
> >> +
> >> +#ifdef CONFIG_PPC_EARLY_DEBUG_USBGECKO
> >> +
> >> +static void __init ug_early_remap(void)
> >
> > you may want to rename the ug_ prefix, it took me a while looking back
> > and forth through the patch to convince myself it wasn't a typo.
> >
>
> What's wrong with ug_ ? (ug = (u)sb(g)ecko)
What's wrong with usb_gecko_early_remap() :)
cheers
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [RFC PATCH v3 3/3] powerpc: gamecube/wii: early debugging using usbgecko
From: Albert Herranz @ 2009-12-01 5:45 UTC (permalink / raw)
To: michael; +Cc: Richard Holden, linuxppc-dev
In-Reply-To: <1259646011.4502.4.camel@concordia>
Michael Ellerman wrote:
>>> you may want to rename the ug_ prefix, it took me a while looking back
>>> and forth through the patch to convince myself it wasn't a typo.
>>>
>> What's wrong with ug_ ? (ug = (u)sb(g)ecko)
>
> What's wrong with usb_gecko_early_remap() :)
>
Nothing, except that names end up been way long for my taste (like for example usb_gecko_early_grab_exi_io_base())
I prefer to use a shorter prefix consistently.
But that's my taste :)
Cheers,
Albert
^ permalink raw reply
* Re: Ethernet issues with lite5200 board from linux-2.6.31
From: Yogesh Chaudhari @ 2009-12-01 5:48 UTC (permalink / raw)
To: Grant Likely
Cc: Robin Gareus, rt-users, Fernando Lopez-Lezcano, Peter Zijlstra,
Frank Rowand, Philippe Reynes, Mark Knecht, LKML, Steven Rostedt,
Sven-Thorsten Dietrich, linuxppc-dev, Clark Williams, Darren Hart,
Will Schmidt, Jon Masters, John Kacur, Ingo Molnar, Jan Blunck,
Gregory Haskins
In-Reply-To: <fa686aa40911300759h153b3300uc54b5d1871bfc839@mail.gmail.com>
Hello Grant,
2009/11/30 Grant Likely <grant.likely@secretlab.ca>:
> On Mon, Nov 30, 2009 at 2:50 AM, Yogesh Chaudhari <mr.yogesh@gmail.com> w=
rote:
>> Hello,
>> =A0 =A0 =A0 =A0 I am running linux kernel with rt patch on embedded boar=
d
>> based on lite5200 eval board. From linux-2.6.31 release, in which the
>> mdio patch has gone inside, =A0the fec ethernet does not come up on this
>> board. I get the following message at startup:
>> mpc52xx MII bus: probed
>> mdio_bus f0003000: error probing PHY at address 1
>>
>>
>> After the bootup if I try to do a ifconfig I get the message:
>> net eth2: of_phy_connect failed
>>
>>
>> If I change the value of reg in dts file (lite5200.dts) to 0 then this
>> ethernet comes up. However upto this kernel version, this was not
>> required.
>>
>> Ethernet does not come up on board with original lite5200.dts file
>
> Is your board based on the Lite5200 or the Lite5200B? =A0The phys are at
> different addresses on those two revisions of the board. =A0There is a
> different .dts file for each board.
>
>> phy0: ethernet-phy@1 {
>> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =
=3D <1>;
>> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0};
>>
>> Ethernet comes up on board with this change
>> phy0: ethernet-phy@1 {
>> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =
=3D <0>;
>> =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0};
>
> Some PHYs treat address 0 as the 'broadcast' address. =A0You need to
> fill in this field (and modify the ethernet-phy@<address> node name)
> to reflect the address that your phy is actually at.
This change in reg value was not required till 2.6.31. It is only
after this version that the change is needed. Is there some change in
31 that makes this change mandatory?
>
> g.
>
--=20
DREAM IT, CODE IT
"CODITO, ERGO SUM"
"I CODE, THEREFORE I AM"
^ permalink raw reply
* RE: ep440xs board boot problem
From: Tirumala Reddy Marri @ 2009-12-01 5:49 UTC (permalink / raw)
To: Allan Wang, linuxppc-dev
In-Reply-To: <288168.33010.qm@web52902.mail.re2.yahoo.com>
SXQgY291bGQgYmUgcmFtZGlzayBzaXplIGlzc3VlLiAgaWYgaXQgaXMgYmlnZ2VyIHRoYW4gNE1C
IHlvdSBtaWdodCBoYXZlIHRvIHBhc3MgcmFtaWRpc2tfc2l6ZT0xMDAwMDAgKDEwME1CIG9yID4g
eW91ciByYW1kaXNrIHNpemUpLg0KDQotLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KRnJvbTog
bGludXhwcGMtZGV2LWJvdW5jZXMrdG1hcnJpPWFtY2MuY29tQGxpc3RzLm96bGFicy5vcmcgW21h
aWx0bzpsaW51eHBwYy1kZXYtYm91bmNlcyt0bWFycmk9YW1jYy5jb21AbGlzdHMub3psYWJzLm9y
Z10gT24gQmVoYWxmIE9mIEFsbGFuIFdhbmcNClNlbnQ6IE1vbmRheSwgTm92ZW1iZXIgMzAsIDIw
MDkgOTozNSBQTQ0KVG86IGxpbnV4cHBjLWRldkBsaXN0cy5vemxhYnMub3JnDQpTdWJqZWN0OiBl
cDQ0MHhzIGJvYXJkIGJvb3QgcHJvYmxlbQ0KDQpIZWxsbywgQWxsLA0KDQpJIGFtIG5ldyB0byB0
aGUgbGlzdC4gSSBhbSBzdGlsbCBuZXdiaWUgdG8gZW1iZWRkZWQgbGludXguIEkgaGF2ZSBib3Vn
aHQgYW4gZXA0NDB4cyBib2FyZCB3aGljaCBpcyBzaW1pbGFyIHRvIHNlcXVvaWEgYm9hcmQuIHUt
Ym9vdCBpcyB3b3JraW5nLiBJIGFtIHRyeWluZyB0byBtYWtlIGl0IHJ1biBsaW51eC4gIEkgaGF2
ZSB0aGUgZm9sbG93aW5nIHByb2JsZW1zIGFuZCBuZWVkIHlvdXIgaGVscC4gVGhhbmsgeW91IHZl
cnkgbXVjaDoNCg0KDQpJIGFtIHVzaW5nIGxpbnV4IGtlcm5lbCAyLjYuMzAuNC4gSSBlbmNvdW50
ZXIgMiBwcm9ibGVtczoNCjEuIEFmdGVyIGNvbnNvbGVfaW5pdCgpIGlzIGNhbGxlZCBpbnNpZGUg
c3RhcnRfa2VybmVsKCksIHRoZSBjb25zb2xlIHN0YXJ0cyBwcmludGluZyBnYXJiYWdlIGxpa2U6
DQpTZXJpYWw6IDgyNTAvMTY1NTAgZHJpdmVyLCA0IHBvcnRzLCBJUlEgc2hhcmluZyBlbmFibGVk
DQpzZXJpYWw4MjUwLjA6IHR0eVMwIGF0IE1NSU8gMHgxZWY2MDAzMDAgKGlycSA9IDE2KSBpcyBh
IDE2NTUwQQ0K77+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+9
77+977+977+977+977+977+977+977+977+977+977+977+977+977+9DQrvv73vv73vv73vv73v
v73vv73vv73vv73vv73vv73vv73vv73vv73vv73vv73vv73vv73vv73vv73vv73vv73vv73vv73v
v73vv73vv73vv73vv70NCu+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/
ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/
vQ0K77+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+9
77+977+977+977+977+977+977+977+977+977+977+977+9DQrvv73vv73vv73vv73vv73vv73v
v73vv73vv73vv73vv73vv73vv73vv73vv73vv73vv70uDQoyLiBJdCBwYWtpY3Mgd2hlbiBtb3Vu
dGluZyB0aGUgcm9vdCBmaWxlIHN5c3RlbShORlMpOg0KKGdkYikgYnQNCiMwICBwYW5pYyAoZm10
PTB4YzAyOTBlOTQgIlZGUzogVW5hYmxlIHRvIG1vdW50IHJvb3QgZnMgb24gJXMiKQ0KYXQga2Vy
bmVsL3BhbmljLmM6NzANCiMxICAweGMwMmQ4Y2UwIGluIG1vdW50X2Jsb2NrX3Jvb3QgKG5hbWU9
MHhjMDI5MGRlNCAiL2Rldi9yb290IiwgZmxhZ3M9MHg4MDAxKQ0KYXQgaW5pdC9kb19tb3VudHMu
YzoyNzINCiMyICAweGMwMmQ5MDg0IGluIHByZXBhcmVfbmFtZXNwYWNlICgpIGF0IGluaXQvZG9f
bW91bnRzLmM6NDE1DQojMyAgMHhjMDJkODFlYyBpbiBrZXJuZWxfaW5pdCAodW51c2VkPTx2YWx1
ZSBvcHRpbWl6ZWQgb3V0PikgYXQgaW5pdC9tYWluLmM6ODg1DQojNCAgMHhjMDAwZGU2MCBpbiBr
ZXJuZWxfdGhyZWFkICgpDQpUaGVyZSBpcyBhIHBhdGNoIGZvciBTZXF1b2lhIGJvYXJkIHRvIGRl
bGV0ZSAvY2hvc2VuIHBhcnQgaW4gc2VxdW9pYS5kdHMsIGlzIC9jaG9zZW4gcmVxdWlyZWQ/DQoN
CkFsbGFuDQoNCg0KDQogICAgICANCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fDQpMaW51eHBwYy1kZXYgbWFpbGluZyBsaXN0DQpMaW51eHBwYy1kZXZAbGlz
dHMub3psYWJzLm9yZw0KaHR0cHM6Ly9saXN0cy5vemxhYnMub3JnL2xpc3RpbmZvL2xpbnV4cHBj
LWRldg0K
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox