* [PATCH 2/8 v3] [POWERPC] prpmc2800: fix frequencies in prpmc2800.dts
From: Dale Farnsworth @ 2008-04-07 22:08 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20080407220027.GA24510@farnsworth.org>
From: Dale Farnsworth <dale@farnsworth.org>
After the conversion to dts v1 format, seeing the frequencies
in decimal made it obvious that some of them had been
incorrectly truncated. This fixes them. Note that the PCI
frequency comes from a different source and is documented
as 66MHz, so it was left at 66000000.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Acked-by: Mark A. Greer <mgreer@mvista.com>
---
arch/powerpc/boot/dts/prpmc2800.dts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
===================================================================
--- linux-2.6.orig/arch/powerpc/boot/dts/prpmc2800.dts
+++ linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
@@ -27,7 +27,7 @@
PowerPC,7447 {
device_type = "cpu";
reg = <0>;
- clock-frequency = <733000000>; /* Default */
+ clock-frequency = <733333333>; /* Default */
bus-frequency = <133333333>;
timebase-frequency = <33333333>;
i-cache-line-size = <32>;
@@ -137,7 +137,7 @@
compatible = "marvell,mv64x60-brg";
reg = <0xb200 0x8>;
clock-src = <8>;
- clock-frequency = <133000000>;
+ clock-frequency = <133333333>;
current-speed = <9600>;
bcr = <0>;
};
@@ -146,7 +146,7 @@
compatible = "marvell,mv64x60-brg";
reg = <0xb208 0x8>;
clock-src = <8>;
- clock-frequency = <133000000>;
+ clock-frequency = <133333333>;
current-speed = <9600>;
bcr = <0>;
};
^ permalink raw reply
* [PATCH 3/8 v3] [POWERPC] mv64x60: Fix FDT compatible names: mv64x60 => mv64360
From: Dale Farnsworth @ 2008-04-07 22:09 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20080407220027.GA24510@farnsworth.org>
From: Mark A. Greer <mgreer@mvista.com>
Compatible names should refer to a specific version of the hardware,
without wildcards. Change each instance of mv64x60 to mv64360, which
is the oldest version we currently support.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
---
arch/powerpc/boot/dts/prpmc2800.dts | 40 +++++++--------
arch/powerpc/boot/serial.c | 2
arch/powerpc/platforms/embedded6xx/prpmc2800.c | 4 -
arch/powerpc/sysdev/mv64x60_dev.c | 10 +--
arch/powerpc/sysdev/mv64x60_pci.c | 6 +-
arch/powerpc/sysdev/mv64x60_pic.c | 4 -
arch/powerpc/sysdev/mv64x60_udbg.c | 2
7 files changed, 34 insertions(+), 34 deletions(-)
Index: linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
===================================================================
--- linux-2.6.orig/arch/powerpc/boot/dts/prpmc2800.dts
+++ linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
@@ -46,7 +46,7 @@
#address-cells = <1>;
#size-cells = <1>;
model = "mv64360"; /* Default */
- compatible = "marvell,mv64x60";
+ compatible = "marvell,mv64360";
clock-frequency = <133333333>;
reg = <0xf1000000 0x10000>;
virtual-reg = <0xf1000000>;
@@ -74,7 +74,7 @@
#address-cells = <1>;
#size-cells = <0>;
device_type = "mdio";
- compatible = "marvell,mv64x60-mdio";
+ compatible = "marvell,mv64360-mdio";
PHY0: ethernet-phy@1 {
device_type = "ethernet-phy";
compatible = "broadcom,bcm5421";
@@ -95,7 +95,7 @@
reg = <0x2000 0x2000>;
eth0 {
device_type = "network";
- compatible = "marvell,mv64x60-eth";
+ compatible = "marvell,mv64360-eth";
block-index = <0>;
interrupts = <32>;
interrupt-parent = <&PIC>;
@@ -104,7 +104,7 @@
};
eth1 {
device_type = "network";
- compatible = "marvell,mv64x60-eth";
+ compatible = "marvell,mv64360-eth";
block-index = <1>;
interrupts = <33>;
interrupt-parent = <&PIC>;
@@ -115,7 +115,7 @@
SDMA0: sdma@4000 {
device_type = "dma";
- compatible = "marvell,mv64x60-sdma";
+ compatible = "marvell,mv64360-sdma";
reg = <0x4000 0xc18>;
virtual-reg = <0xf1004000>;
interrupt-base = <0>;
@@ -125,7 +125,7 @@
SDMA1: sdma@6000 {
device_type = "dma";
- compatible = "marvell,mv64x60-sdma";
+ compatible = "marvell,mv64360-sdma";
reg = <0x6000 0xc18>;
virtual-reg = <0xf1006000>;
interrupt-base = <0>;
@@ -134,7 +134,7 @@
};
BRG0: brg@b200 {
- compatible = "marvell,mv64x60-brg";
+ compatible = "marvell,mv64360-brg";
reg = <0xb200 0x8>;
clock-src = <8>;
clock-frequency = <133333333>;
@@ -143,7 +143,7 @@
};
BRG1: brg@b208 {
- compatible = "marvell,mv64x60-brg";
+ compatible = "marvell,mv64360-brg";
reg = <0xb208 0x8>;
clock-src = <8>;
clock-frequency = <133333333>;
@@ -166,7 +166,7 @@
MPSC0: mpsc@8000 {
device_type = "serial";
- compatible = "marvell,mpsc";
+ compatible = "marvell,mv64360-mpsc";
reg = <0x8000 0x38>;
virtual-reg = <0xf1008000>;
sdma = <&SDMA0>;
@@ -186,7 +186,7 @@
MPSC1: mpsc@9000 {
device_type = "serial";
- compatible = "marvell,mpsc";
+ compatible = "marvell,mv64360-mpsc";
reg = <0x9000 0x38>;
virtual-reg = <0xf1009000>;
sdma = <&SDMA1>;
@@ -205,14 +205,14 @@
};
wdt@b410 { /* watchdog timer */
- compatible = "marvell,mv64x60-wdt";
+ compatible = "marvell,mv64360-wdt";
reg = <0xb410 0x8>;
timeout = <10>; /* wdt timeout in seconds */
};
i2c@c000 {
device_type = "i2c";
- compatible = "marvell,mv64x60-i2c";
+ compatible = "marvell,mv64360-i2c";
reg = <0xc000 0x20>;
virtual-reg = <0xf100c000>;
freq_m = <8>;
@@ -226,18 +226,18 @@
PIC: pic {
#interrupt-cells = <1>;
#address-cells = <0>;
- compatible = "marvell,mv64x60-pic";
+ compatible = "marvell,mv64360-pic";
reg = <0x0 0x88>;
interrupt-controller;
};
mpp@f000 {
- compatible = "marvell,mv64x60-mpp";
+ compatible = "marvell,mv64360-mpp";
reg = <0xf000 0x10>;
};
gpp@f100 {
- compatible = "marvell,mv64x60-gpp";
+ compatible = "marvell,mv64360-gpp";
reg = <0xf100 0x20>;
};
@@ -246,7 +246,7 @@
#size-cells = <2>;
#interrupt-cells = <1>;
device_type = "pci";
- compatible = "marvell,mv64x60-pci";
+ compatible = "marvell,mv64360-pci";
reg = <0xcf8 0x8>;
ranges = <0x01000000 0x0 0x0
0x88000000 0x0 0x01000000
@@ -285,28 +285,28 @@
};
cpu-error@0070 {
- compatible = "marvell,mv64x60-cpu-error";
+ compatible = "marvell,mv64360-cpu-error";
reg = <0x70 0x10 0x128 0x28>;
interrupts = <3>;
interrupt-parent = <&PIC>;
};
sram-ctrl@0380 {
- compatible = "marvell,mv64x60-sram-ctrl";
+ compatible = "marvell,mv64360-sram-ctrl";
reg = <0x380 0x80>;
interrupts = <13>;
interrupt-parent = <&PIC>;
};
pci-error@1d40 {
- compatible = "marvell,mv64x60-pci-error";
+ compatible = "marvell,mv64360-pci-error";
reg = <0x1d40 0x40 0xc28 0x4>;
interrupts = <12>;
interrupt-parent = <&PIC>;
};
mem-ctrl@1400 {
- compatible = "marvell,mv64x60-mem-ctrl";
+ compatible = "marvell,mv64360-mem-ctrl";
reg = <0x1400 0x60>;
interrupts = <17>;
interrupt-parent = <&PIC>;
Index: linux-2.6/arch/powerpc/boot/serial.c
===================================================================
--- linux-2.6.orig/arch/powerpc/boot/serial.c
+++ linux-2.6/arch/powerpc/boot/serial.c
@@ -119,7 +119,7 @@ int serial_console_init(void)
if (dt_is_compatible(devp, "ns16550"))
rc = ns16550_console_init(devp, &serial_cd);
- else if (dt_is_compatible(devp, "marvell,mpsc"))
+ else if (dt_is_compatible(devp, "marvell,mv64360-mpsc"))
rc = mpsc_console_init(devp, &serial_cd);
else if (dt_is_compatible(devp, "fsl,cpm1-scc-uart") ||
dt_is_compatible(devp, "fsl,cpm1-smc-uart") ||
Index: linux-2.6/arch/powerpc/platforms/embedded6xx/prpmc2800.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/embedded6xx/prpmc2800.c
+++ linux-2.6/arch/powerpc/platforms/embedded6xx/prpmc2800.c
@@ -49,13 +49,13 @@ static void __init prpmc2800_setup_arch(
* ioremap mpp and gpp registers in case they are later
* needed by prpmc2800_reset_board().
*/
- np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-mpp");
+ np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-mpp");
reg = of_get_property(np, "reg", NULL);
paddr = of_translate_address(np, reg);
of_node_put(np);
mv64x60_mpp_reg_base = ioremap(paddr, reg[1]);
- np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-gpp");
+ np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-gpp");
reg = of_get_property(np, "reg", NULL);
paddr = of_translate_address(np, reg);
of_node_put(np);
Index: linux-2.6/arch/powerpc/sysdev/mv64x60_dev.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/mv64x60_dev.c
+++ linux-2.6/arch/powerpc/sysdev/mv64x60_dev.c
@@ -446,22 +446,22 @@ static int __init mv64x60_device_setup(v
int err;
id = 0;
- for_each_compatible_node(np, "serial", "marvell,mpsc")
+ for_each_compatible_node(np, "serial", "marvell,mv64360-mpsc")
if ((err = mv64x60_mpsc_device_setup(np, id++)))
goto error;
id = 0;
- for_each_compatible_node(np, "network", "marvell,mv64x60-eth")
+ for_each_compatible_node(np, "network", "marvell,mv64360-eth")
if ((err = mv64x60_eth_device_setup(np, id++)))
goto error;
id = 0;
- for_each_compatible_node(np, "i2c", "marvell,mv64x60-i2c")
+ for_each_compatible_node(np, "i2c", "marvell,mv64360-i2c")
if ((err = mv64x60_i2c_device_setup(np, id++)))
goto error;
/* support up to one watchdog timer */
- np = of_find_compatible_node(np, NULL, "marvell,mv64x60-wdt");
+ np = of_find_compatible_node(np, NULL, "marvell,mv64360-wdt");
if (np) {
if ((err = mv64x60_wdt_device_setup(np, id)))
goto error;
@@ -489,7 +489,7 @@ static int __init mv64x60_add_mpsc_conso
if (!np)
goto not_mpsc;
- if (!of_device_is_compatible(np, "marvell,mpsc"))
+ if (!of_device_is_compatible(np, "marvell,mv64360-mpsc"))
goto not_mpsc;
prop = of_get_property(np, "block-index", NULL);
Index: linux-2.6/arch/powerpc/sysdev/mv64x60_pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/mv64x60_pci.c
+++ linux-2.6/arch/powerpc/sysdev/mv64x60_pci.c
@@ -86,14 +86,14 @@ static int __init mv64x60_sysfs_init(voi
struct platform_device *pdev;
const unsigned int *prop;
- np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60");
+ np = of_find_compatible_node(NULL, NULL, "marvell,mv64360");
if (!np)
return 0;
prop = of_get_property(np, "hs_reg_valid", NULL);
of_node_put(np);
- pdev = platform_device_register_simple("marvell,mv64x60", 0, NULL, 0);
+ pdev = platform_device_register_simple("marvell,mv64360", 0, NULL, 0);
if (IS_ERR(pdev))
return PTR_ERR(pdev);
@@ -166,6 +166,6 @@ void __init mv64x60_pci_init(void)
{
struct device_node *np;
- for_each_compatible_node(np, "pci", "marvell,mv64x60-pci")
+ for_each_compatible_node(np, "pci", "marvell,mv64360-pci")
mv64x60_add_bridge(np);
}
Index: linux-2.6/arch/powerpc/sysdev/mv64x60_pic.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/mv64x60_pic.c
+++ linux-2.6/arch/powerpc/sysdev/mv64x60_pic.c
@@ -238,13 +238,13 @@ void __init mv64x60_init_irq(void)
const unsigned int *reg;
unsigned long flags;
- np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-gpp");
+ np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-gpp");
reg = of_get_property(np, "reg", &size);
paddr = of_translate_address(np, reg);
mv64x60_gpp_reg_base = ioremap(paddr, reg[1]);
of_node_put(np);
- np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-pic");
+ np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-pic");
reg = of_get_property(np, "reg", &size);
paddr = of_translate_address(np, reg);
mv64x60_irq_reg_base = ioremap(paddr, reg[1]);
Index: linux-2.6/arch/powerpc/sysdev/mv64x60_udbg.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/mv64x60_udbg.c
+++ linux-2.6/arch/powerpc/sysdev/mv64x60_udbg.c
@@ -85,7 +85,7 @@ static void mv64x60_udbg_init(void)
if (!stdout)
return;
- for_each_compatible_node(np, "serial", "marvell,mpsc") {
+ for_each_compatible_node(np, "serial", "marvell,mv64360-mpsc") {
if (np == stdout)
break;
}
^ permalink raw reply
* [PATCH 4/8 v3] [POWERPC] mv64x60: remove device tree absolute path references
From: Dale Farnsworth @ 2008-04-07 22:09 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20080407220027.GA24510@farnsworth.org>
From: Dale Farnsworth <dale@farnsworth.org>
Replace several device node absolute path lookups in the mv64x60
bootwrapper code with lookups by compatible or device_type
properties.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Acked-by: Mark A. Greer <mgreer@mvista.com>
---
arch/powerpc/boot/mv64x60.c | 4 ++--
arch/powerpc/boot/mv64x60_i2c.c | 2 +-
arch/powerpc/boot/prpmc2800.c | 23 ++++++++++++-----------
3 files changed, 15 insertions(+), 14 deletions(-)
--- a/arch/powerpc/boot/mv64x60.c
+++ b/arch/powerpc/boot/mv64x60.c
@@ -535,7 +535,7 @@ u8 *mv64x60_get_bridge_pbase(void)
u32 v[2];
void *devp;
- devp = finddevice("/mv64x60");
+ devp = find_node_by_compatible(NULL, "marvell,mv64360");
if (devp == NULL)
goto err_out;
if (getprop(devp, "reg", v, sizeof(v)) != sizeof(v))
@@ -553,7 +553,7 @@ u8 *mv64x60_get_bridge_base(void)
u32 v;
void *devp;
- devp = finddevice("/mv64x60");
+ devp = find_node_by_compatible(NULL, "marvell,mv64360");
if (devp == NULL)
goto err_out;
if (getprop(devp, "virtual-reg", &v, sizeof(v)) != sizeof(v))
diff --git a/arch/powerpc/boot/mv64x60_i2c.c b/arch/powerpc/boot/mv64x60_i2c.c
index d085377..a69cd7a 100644
--- a/arch/powerpc/boot/mv64x60_i2c.c
+++ b/arch/powerpc/boot/mv64x60_i2c.c
@@ -185,7 +185,7 @@ int mv64x60_i2c_open(void)
u32 v;
void *devp;
- devp = finddevice("/mv64x60/i2c");
+ devp = find_node_by_compatible(NULL, "marvell,mv64360-i2c");
if (devp == NULL)
goto err_out;
if (getprop(devp, "virtual-reg", &v, sizeof(v)) != sizeof(v))
diff --git a/arch/powerpc/boot/prpmc2800.c b/arch/powerpc/boot/prpmc2800.c
index 05c3245..f74b2cf 100644
--- a/arch/powerpc/boot/prpmc2800.c
+++ b/arch/powerpc/boot/prpmc2800.c
@@ -344,20 +344,20 @@ static void prpmc2800_bridge_setup(u32 mem_size)
acc_bits);
/* Get the cpu -> pci i/o & mem mappings from the device tree */
- devp = finddevice("/mv64x60/pci@80000000");
+ devp = find_node_by_compatible(NULL, "marvell,mv64360-pci");
if (devp == NULL)
- fatal("Error: Missing /mv64x60/pci@80000000"
+ fatal("Error: Missing marvell,mv64360-pci"
" device tree node\n\r");
rc = getprop(devp, "ranges", v, sizeof(v));
if (rc != sizeof(v))
- fatal("Error: Can't find /mv64x60/pci@80000000/ranges"
+ fatal("Error: Can't find marvell,mv64360-pci ranges"
" property\n\r");
/* Get the cpu -> pci i/o & mem mappings from the device tree */
- devp = finddevice("/mv64x60");
+ devp = find_node_by_compatible(NULL, "marvell,mv64360");
if (devp == NULL)
- fatal("Error: Missing /mv64x60 device tree node\n\r");
+ fatal("Error: Missing marvell,mv64360 device tree node\n\r");
enables = in_le32((u32 *)(bridge_base + MV64x60_CPU_BAR_ENABLE));
enables |= 0x0007fe00; /* Disable all cpu->pci windows */
@@ -429,9 +429,9 @@ static void prpmc2800_fixups(void)
setprop(devp, "model", model, l);
/* Set /cpus/PowerPC,7447/clock-frequency */
- devp = finddevice("/cpus/PowerPC,7447");
+ devp = find_node_by_prop_value_str(NULL, "device_type", "cpu");
if (devp == NULL)
- fatal("Error: Missing proper /cpus device tree node\n\r");
+ fatal("Error: Missing proper cpu device tree node\n\r");
v[0] = bip->core_speed;
setprop(devp, "clock-frequency", &v[0], sizeof(v[0]));
@@ -443,16 +443,17 @@ static void prpmc2800_fixups(void)
v[1] = bip->mem_size;
setprop(devp, "reg", v, sizeof(v));
- /* Update /mv64x60/model, if this is a mv64362 */
+ /* Update model, if this is a mv64362 */
if (bip->bridge_type == BRIDGE_TYPE_MV64362) {
- devp = finddevice("/mv64x60");
+ devp = find_node_by_compatible(NULL, "marvell,mv64360");
if (devp == NULL)
- fatal("Error: Missing /mv64x60 device tree node\n\r");
+ fatal("Error: Missing marvell,mv64360"
+ " device tree node\n\r");
setprop(devp, "model", "mv64362", strlen("mv64362") + 1);
}
/* Set User FLASH size */
- devp = finddevice("/mv64x60/flash@a0000000");
+ devp = find_node_by_compatible(NULL, "direct-mapped");
if (devp == NULL)
fatal("Error: Missing User FLASH device tree node\n\r");
rc = getprop(devp, "reg", v, sizeof(v));
^ permalink raw reply related
* [PATCH 5/8 v3] [POWERPC] prpmc2800: clean up dts properties
From: Dale Farnsworth @ 2008-04-07 22:10 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20080407220027.GA24510@farnsworth.org>
From: Mark A. Greer <mgreer@mvista.com>
Remove several unused (or software config only) properties.
Rename marvel node to "system-controller". Also, rename the
"block-index" property to "cell-index" to conform to current
practice.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
---
arch/powerpc/boot/dts/prpmc2800.dts | 27 ++------------------------
arch/powerpc/boot/mpsc.c | 2 -
arch/powerpc/sysdev/mv64x60_dev.c | 18 ++++++-----------
3 files changed, 11 insertions(+), 36 deletions(-)
Index: linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
===================================================================
--- linux-2.6.orig/arch/powerpc/boot/dts/prpmc2800.dts
+++ linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
@@ -42,7 +42,7 @@
reg = <0x0 0x20000000>; /* Default (512MB) */
};
- mv64x60@f1000000 { /* Marvell Discovery */
+ system-controller@f1000000 { /* Marvell Discovery mv64360 */
#address-cells = <1>;
#size-cells = <1>;
model = "mv64360"; /* Default */
@@ -114,21 +114,17 @@
};
SDMA0: sdma@4000 {
- device_type = "dma";
compatible = "marvell,mv64360-sdma";
reg = <0x4000 0xc18>;
virtual-reg = <0xf1004000>;
- interrupt-base = <0>;
interrupts = <36>;
interrupt-parent = <&PIC>;
};
SDMA1: sdma@6000 {
- device_type = "dma";
compatible = "marvell,mv64360-sdma";
reg = <0x6000 0xc18>;
virtual-reg = <0xf1006000>;
- interrupt-base = <0>;
interrupts = <38>;
interrupt-parent = <&PIC>;
};
@@ -139,7 +135,6 @@
clock-src = <8>;
clock-frequency = <133333333>;
current-speed = <9600>;
- bcr = <0>;
};
BRG1: brg@b208 {
@@ -148,7 +143,6 @@
clock-src = <8>;
clock-frequency = <133333333>;
current-speed = <9600>;
- bcr = <0>;
};
CUNIT: cunit@f200 {
@@ -174,12 +168,7 @@
cunit = <&CUNIT>;
mpscrouting = <&MPSCROUTING>;
mpscintr = <&MPSCINTR>;
- block-index = <0>;
- max_idle = <40>;
- chr_1 = <0>;
- chr_2 = <0>;
- chr_10 = <3>;
- mpcr = <0>;
+ cell-index = <0>;
interrupts = <40>;
interrupt-parent = <&PIC>;
};
@@ -194,12 +183,7 @@
cunit = <&CUNIT>;
mpscrouting = <&MPSCROUTING>;
mpscintr = <&MPSCINTR>;
- block-index = <1>;
- max_idle = <40>;
- chr_1 = <0>;
- chr_2 = <0>;
- chr_10 = <3>;
- mpcr = <0>;
+ cell-index = <1>;
interrupts = <42>;
interrupt-parent = <&PIC>;
};
@@ -207,7 +191,6 @@
wdt@b410 { /* watchdog timer */
compatible = "marvell,mv64360-wdt";
reg = <0xb410 0x8>;
- timeout = <10>; /* wdt timeout in seconds */
};
i2c@c000 {
@@ -215,10 +198,6 @@
compatible = "marvell,mv64360-i2c";
reg = <0xc000 0x20>;
virtual-reg = <0xf100c000>;
- freq_m = <8>;
- freq_n = <3>;
- timeout = <1000>; /* 1000 = 1 second */
- retries = <1>;
interrupts = <37>;
interrupt-parent = <&PIC>;
};
Index: linux-2.6/arch/powerpc/boot/mpsc.c
===================================================================
--- linux-2.6.orig/arch/powerpc/boot/mpsc.c
+++ linux-2.6/arch/powerpc/boot/mpsc.c
@@ -141,7 +141,7 @@ int mpsc_console_init(void *devp, struct
if (mpscintr_base == NULL)
goto err_out;
- n = getprop(devp, "block-index", &v, sizeof(v));
+ n = getprop(devp, "cell-index", &v, sizeof(v));
if (n != sizeof(v))
goto err_out;
reg_set = (int)v;
Index: linux-2.6/arch/powerpc/sysdev/mv64x60_dev.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/mv64x60_dev.c
+++ linux-2.6/arch/powerpc/sysdev/mv64x60_dev.c
@@ -127,7 +127,7 @@ static int __init mv64x60_mpsc_device_se
if (err)
return err;
- prop = of_get_property(np, "block-index", NULL);
+ prop = of_get_property(np, "cell-index", NULL);
if (!prop)
return -ENODEV;
port_number = *(int *)prop;
@@ -136,6 +136,7 @@ static int __init mv64x60_mpsc_device_se
pdata.cache_mgmt = 1; /* All current revs need this set */
+ pdata.max_idle = 40; /* default */
prop = of_get_property(np, "max_idle", NULL);
if (prop)
pdata.max_idle = *prop;
@@ -345,21 +346,19 @@ static int __init mv64x60_i2c_device_set
memset(&pdata, 0, sizeof(pdata));
+ pdata.freq_m = 8; /* default */
prop = of_get_property(np, "freq_m", NULL);
if (!prop)
return -ENODEV;
pdata.freq_m = *prop;
+ pdata.freq_m = 3; /* default */
prop = of_get_property(np, "freq_n", NULL);
if (!prop)
return -ENODEV;
pdata.freq_n = *prop;
- prop = of_get_property(np, "timeout", NULL);
- if (prop)
- pdata.timeout = *prop;
- else
- pdata.timeout = 1000; /* 1 second */
+ pdata.timeout = 1000; /* default: 1 second */
pdev = platform_device_alloc(MV64XXX_I2C_CTLR_NAME, id);
if (!pdev)
@@ -401,10 +400,7 @@ static int __init mv64x60_wdt_device_set
memset(&pdata, 0, sizeof(pdata));
- prop = of_get_property(np, "timeout", NULL);
- if (!prop)
- return -ENODEV;
- pdata.timeout = *prop;
+ pdata.timeout = 10; /* Default: 10 seconds */
np = of_get_parent(np);
if (!np)
@@ -492,7 +488,7 @@ static int __init mv64x60_add_mpsc_conso
if (!of_device_is_compatible(np, "marvell,mv64360-mpsc"))
goto not_mpsc;
- prop = of_get_property(np, "block-index", NULL);
+ prop = of_get_property(np, "cell-index", NULL);
if (!prop)
goto not_mpsc;
^ permalink raw reply
* [PATCH 6/8 v3] [POWERPC] mv643xx_eth: prepare to support multiple silicon blocks
From: Dale Farnsworth @ 2008-04-07 22:11 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20080407220027.GA24510@farnsworth.org>
From: Dale Farnsworth <dale@farnsworth.org>
The mv643xx_eth driver is being modified to support multiple instances
of the ethernet silicon block on the same platform. Each block contains
a single register bank containing the registers for up to three ports
interleaved within that bank. This patch updates the PowerPC OF to
platform_device glue code to support multiple silicon blocks, each
with up to three ethernet ports. The main difference is that we now
allow multiple mv64x60_shared platform_devices to be registered and
we provide each port platform_device with a pointer to its associated
shared platform_device. The pointer will not be used until the
mv643xx_eth driver changes are committed.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Acked-by: Mark Greer <mgreer@mvista.com>
---
arch/powerpc/boot/dts/prpmc2800.dts | 13 ++++--
arch/powerpc/sysdev/mv64x60_dev.c | 52 ++++++++++++++------------
2 files changed, 37 insertions(+), 28 deletions(-)
Index: linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
===================================================================
--- linux-2.6.orig/arch/powerpc/boot/dts/prpmc2800.dts
+++ linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
@@ -91,21 +91,24 @@
};
};
- ethernet@2000 {
+ ethernet-group@2000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "marvell,mv64360-eth-group";
reg = <0x2000 0x2000>;
- eth0 {
+ ethernet@0 {
device_type = "network";
compatible = "marvell,mv64360-eth";
- block-index = <0>;
+ reg = <0>;
interrupts = <32>;
interrupt-parent = <&PIC>;
phy = <&PHY0>;
local-mac-address = [ 00 00 00 00 00 00 ];
};
- eth1 {
+ ethernet@1 {
device_type = "network";
compatible = "marvell,mv64360-eth";
- block-index = <1>;
+ reg = <1>;
interrupts = <33>;
interrupt-parent = <&PIC>;
phy = <&PHY1>;
Index: linux-2.6/arch/powerpc/sysdev/mv64x60_dev.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/mv64x60_dev.c
+++ linux-2.6/arch/powerpc/sysdev/mv64x60_dev.c
@@ -206,30 +206,24 @@ error:
/*
* Create mv64x60_eth platform devices
*/
-static int __init eth_register_shared_pdev(struct device_node *np)
+static struct platform_device * __init mv64x60_eth_register_shared_pdev(
+ struct device_node *np, int id)
{
struct platform_device *pdev;
struct resource r[1];
int err;
- np = of_get_parent(np);
- if (!np)
- return -ENODEV;
-
err = of_address_to_resource(np, 0, &r[0]);
- of_node_put(np);
if (err)
- return err;
+ return ERR_PTR(err);
- pdev = platform_device_register_simple(MV643XX_ETH_SHARED_NAME, 0,
+ pdev = platform_device_register_simple(MV643XX_ETH_SHARED_NAME, id,
r, 1);
- if (IS_ERR(pdev))
- return PTR_ERR(pdev);
-
- return 0;
+ return pdev;
}
-static int __init mv64x60_eth_device_setup(struct device_node *np, int id)
+static int __init mv64x60_eth_device_setup(struct device_node *np, int id,
+ struct platform_device *shared_pdev)
{
struct resource r[1];
struct mv643xx_eth_platform_data pdata;
@@ -240,16 +234,12 @@ static int __init mv64x60_eth_device_set
const phandle *ph;
int err;
- /* only register the shared platform device the first time through */
- if (id == 0 && (err = eth_register_shared_pdev(np)))
- return err;
-
memset(r, 0, sizeof(r));
of_irq_to_resource(np, 0, &r[0]);
memset(&pdata, 0, sizeof(pdata));
- prop = of_get_property(np, "block-index", NULL);
+ prop = of_get_property(np, "reg", NULL);
if (!prop)
return -ENODEV;
pdata.port_number = *prop;
@@ -302,7 +292,7 @@ static int __init mv64x60_eth_device_set
of_node_put(phy);
- pdev = platform_device_alloc(MV643XX_ETH_NAME, pdata.port_number);
+ pdev = platform_device_alloc(MV643XX_ETH_NAME, id);
if (!pdev)
return -ENOMEM;
@@ -437,8 +427,9 @@ error:
static int __init mv64x60_device_setup(void)
{
- struct device_node *np = NULL;
- int id;
+ struct device_node *np, *np2;
+ struct platform_device *pdev;
+ int id, id2;
int err;
id = 0;
@@ -447,9 +438,24 @@ static int __init mv64x60_device_setup(v
goto error;
id = 0;
- for_each_compatible_node(np, "network", "marvell,mv64360-eth")
- if ((err = mv64x60_eth_device_setup(np, id++)))
+ id2 = 0;
+ for_each_compatible_node(np, NULL, "marvell,mv64360-eth-group") {
+ pdev = mv64x60_eth_register_shared_pdev(np, id++);
+ if (IS_ERR(pdev)) {
+ err = PTR_ERR(pdev);
goto error;
+ }
+ for_each_child_of_node(np, np2) {
+ if (!of_device_is_compatible(np2,
+ "marvell,mv64360-eth"))
+ continue;
+ err = mv64x60_eth_device_setup(np2, id2++, pdev);
+ if (err) {
+ of_node_put(np2);
+ goto error;
+ }
+ }
+ }
id = 0;
for_each_compatible_node(np, "i2c", "marvell,mv64360-i2c")
^ permalink raw reply
* [PATCH 7/8 v3] [POWERPC] Document the mv64x60 device tree bindings
From: Dale Farnsworth @ 2008-04-07 22:12 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20080407220027.GA24510@farnsworth.org>
From: Dale Farnsworth <dale@farnsworth.org>
Add the device tree bindings for the Marvell mv64x60 series of
system controller chips in booting-without-of.text.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Acked-by: Mark A. Greer <mgreer@mvista.com>
---
Documentation/powerpc/booting-without-of.txt | 548 ++++++++++++++++-
1 file changed, 545 insertions(+), 3 deletions(-)
Index: linux-2.6/Documentation/powerpc/booting-without-of.txt
===================================================================
--- linux-2.6.orig/Documentation/powerpc/booting-without-of.txt
+++ linux-2.6/Documentation/powerpc/booting-without-of.txt
@@ -59,7 +59,30 @@ Table of Contents
p) Freescale Synchronous Serial Interface
q) USB EHCI controllers
- VII - Specifying interrupt information for devices
+ VII - Marvell Discovery mv64[345]6x System Controller chips
+ 1) The /system-controller node
+ 2) Child nodes of /system-controller
+ a) Marvell Discovery MDIO bus
+ b) Marvell Discovery ethernet controller
+ c) Marvell Discovery PHY nodes
+ d) Marvell Discovery SDMA nodes
+ e) Marvell Discovery BRG nodes
+ f) Marvell Discovery CUNIT nodes
+ g) Marvell Discovery MPSCROUTING nodes
+ h) Marvell Discovery MPSCINTR nodes
+ i) Marvell Discovery MPSC nodes
+ j) Marvell Discovery Watch Dog Timer nodes
+ k) Marvell Discovery I2C nodes
+ l) Marvell Discovery PIC (Programmable Interrupt Controller) nodes
+ m) Marvell Discovery MPP (Multipurpose Pins) multiplexing nodes
+ n) Marvell Discovery GPP (General Purpose Pins) nodes
+ o) Marvell Discovery PCI host bridge node
+ p) Marvell Discovery CPU Error nodes
+ q) Marvell Discovery SRAM Controller nodes
+ r) Marvell Discovery PCI Error Handler nodes
+ s) Marvell Discovery Memory Controller nodes
+
+ VIII - Specifying interrupt information for devices
1) interrupts property
2) interrupt-parent property
3) OpenPIC Interrupt Controllers
@@ -2817,9 +2830,528 @@ platforms are moved over to use the flat
};
- More devices will be defined as this spec matures.
+VII - Marvell Discovery mv64[345]6x System Controller chips
+===========================================================
+
+The Marvell mv64[345]60 series of system controller chips contain
+many of the peripherals needed to implement a complete computer
+system. In this section, we define device tree nodes to describe
+the system controller chip itself and each of the peripherals
+which it contains. Compatible string values for each node are
+prefixed with the string "marvell,", for Marvell Technology Group Ltd.
+
+1) The /system-controller node
+
+ This node is used to represent the system-controller and must be
+ present when the system uses a system contller chip. The top-level
+ system-controller node contains information that is global to all
+ devices within the system controller chip. The node name begins
+ with "system-controller" followed by the unit address, which is
+ the base address of the memory-mapped register set for the system
+ controller chip.
+
+ Required properties:
+
+ - ranges : Describes the translation of system controller addresses
+ for memory mapped registers.
+ - clock-frequency: Contains the main clock frequency for the system
+ controller chip.
+ - reg : This property defines the address and size of the
+ memory-mapped registers contained within the system controller
+ chip. The address specified in the "reg" property should match
+ the unit address of the system-controller node.
+ - #address-cells : Address representation for system controller
+ devices. This field represents the number of cells needed to
+ represent the address of the memory-mapped registers of devices
+ within the system controller chip.
+ - #size-cells : Size representation for for the memory-mapped
+ registers within the system controller chip.
+ - #interrupt-cells : Defines the width of cells used to represent
+ interrupts.
+
+ Optional properties:
+
+ - model : The specific model of the system controller chip. Such
+ as, "mv64360", "mv64460", or "mv64560".
+ - compatible : A string identifying the compatibility identifiers
+ of the system controller chip.
+
+ The system-controller node contains child nodes for each system
+ controller device that the platform uses. Nodes should not be created
+ for devices which exist on the system controller chip but are not used
+
+ Example Marvell Discovery mv64360 system-controller node:
+
+ system-controller@f1000000 { /* Marvell Discovery mv64360 */
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "mv64360"; /* Default */
+ compatible = "marvell,mv64360";
+ clock-frequency = <133333333>;
+ reg = <0xf1000000 0x10000>;
+ virtual-reg = <0xf1000000>;
+ ranges = <0x88000000 0x88000000 0x1000000 /* PCI 0 I/O Space */
+ 0x80000000 0x80000000 0x8000000 /* PCI 0 MEM Space */
+ 0xa0000000 0xa0000000 0x4000000 /* User FLASH */
+ 0x00000000 0xf1000000 0x0010000 /* Bridge's regs */
+ 0xf2000000 0xf2000000 0x0040000>;/* Integrated SRAM */
+
+ [ child node definitions... ]
+ }
+
+2) Child nodes of /system-controller
+
+ a) Marvell Discovery MDIO bus
+
+ The MDIO is a bus to which the PHY devices are connected. For each
+ device that exists on this bus, a child node should be created. See
+ the definition of the PHY node below for an example of how to define
+ a PHY.
+
+ Required properties:
+ - #address-cells : Should be <1>
+ - #size-cells : Should be <0>
+ - device_type : Should be "mdio"
+ - compatible : Should be "marvell,mv64360-mdio"
+
+ Example:
+
+ mdio {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ device_type = "mdio";
+ compatible = "marvell,mv64360-mdio";
+
+ ethernet-phy@0 {
+ ......
+ };
+ };
+
+
+ b) Marvell Discovery ethernet controller
+
+ The Discover ethernet controller is described with two levels
+ of nodes. The first level describes an ethernet silicon block
+ and the second level describes up to 3 ethernet nodes within
+ that block. The reason for the multiple levels is that the
+ registers for the node are interleaved within a single set
+ of registers. The "ethernet-block" level describes the
+ shared register set, and the "ethernet" nodes describe ethernet
+ port-specific properties.
+
+ Ethernet block node
+
+ Required properties:
+ - #address-cells : <1>
+ - #size-cells : <0>
+ - compatible : "marvell,mv64360-eth-block"
+ - reg : Offset and length of the register set for this block
+
+ Example Discovery Ethernet block node:
+ ethernet-block@2000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "marvell,mv64360-eth-block";
+ reg = <0x2000 0x2000>;
+ ethernet@0 {
+ .......
+ };
+ };
+
+ Ethernet port node
+
+ Required properties:
+ - device_type : Should be "network".
+ - compatible : Should be "marvell,mv64360-eth".
+ - reg : Should be <0>, <1>, or <2>, according to which registers
+ within the silicon block the device uses.
+ - interrupts : <a> where a is the interrupt number for the port.
+ - interrupt-parent : the phandle for the interrupt controller
+ that services interrupts for this device.
+ - phy : the phandle for the PHY connected to this ethernet
+ controller.
+ - local-mac-address : 6 bytes, MAC address
+
+ Example Discovery Ethernet port node:
+ ethernet@0 {
+ device_type = "network";
+ compatible = "marvell,mv64360-eth";
+ reg = <0>;
+ interrupts = <32>;
+ interrupt-parent = <&PIC>;
+ phy = <&PHY0>;
+ local-mac-address = [ 00 00 00 00 00 00 ];
+ };
+
+
+
+ c) Marvell Discovery PHY nodes
+
+ Required properties:
+ - device_type : Should be "ethernet-phy"
+ - interrupts : <a> where a is the interrupt number for this phy.
+ - interrupt-parent : the phandle for the interrupt controller that
+ services interrupts for this device.
+ - reg : The ID number for the phy, usually a small integer
+
+ Example Discovery PHY node:
+ ethernet-phy@1 {
+ device_type = "ethernet-phy";
+ compatible = "broadcom,bcm5421";
+ interrupts = <76>; /* GPP 12 */
+ interrupt-parent = <&PIC>;
+ reg = <1>;
+ };
+
+
+ d) Marvell Discovery SDMA nodes
+
+ Represent DMA hardware associated with the MPSC (multiprotocol
+ serial controllers).
+
+ Required properties:
+ - compatible : "marvell,mv64360-sdma"
+ - reg : Offset and length of the register set for this device
+ - interrupts : <a> where a is the interrupt number for the DMA
+ device.
+ - interrupt-parent : the phandle for the interrupt controller
+ that services interrupts for this device.
+
+ Example Discovery SDMA node:
+ sdma@4000 {
+ compatible = "marvell,mv64360-sdma";
+ reg = <0x4000 0xc18>;
+ virtual-reg = <0xf1004000>;
+ interrupts = <36>;
+ interrupt-parent = <&PIC>;
+ };
+
+
+ e) Marvell Discovery BRG nodes
+
+ Represent baud rate generator hardware associated with the MPSC
+ (multiprotocol serial controllers).
+
+ Required properties:
+ - compatible : "marvell,mv64360-brg"
+ - reg : Offset and length of the register set for this device
+ - clock-src : A value from 0 to 15 which selects the clock
+ source for the baud rate generator. This value corresponds
+ to the CLKS value in the BRGx configuration register. See
+ the mv64x60 User's Manual.
+ - clock-frequence : The frequency (in Hz) of the baud rate
+ generator's input clock.
+ - current-speed : The current speed setting (presumably by
+ firmware) of the baud rate generator.
+
+ Example Discovery BRG node:
+ brg@b200 {
+ compatible = "marvell,mv64360-brg";
+ reg = <0xb200 0x8>;
+ clock-src = <8>;
+ clock-frequency = <133333333>;
+ current-speed = <9600>;
+ };
+
+
+ f) Marvell Discovery CUNIT nodes
+
+ Represent the Serial Communications Unit device hardware.
+
+ Required properties:
+ - reg : Offset and length of the register set for this device
+
+ Example Discovery CUNIT node:
+ cunit@f200 {
+ reg = <0xf200 0x200>;
+ };
+
+
+ g) Marvell Discovery MPSCROUTING nodes
+
+ Represent the Discovery's MPSC routing hardware
+
+ Required properties:
+ - reg : Offset and length of the register set for this device
+
+ Example Discovery CUNIT node:
+ mpscrouting@b500 {
+ reg = <0xb400 0xc>;
+ };
+
+
+ h) Marvell Discovery MPSCINTR nodes
+
+ Represent the Discovery's MPSC DMA interrupt hardware registers
+ (SDMA cause and mask registers).
+
+ Required properties:
+ - reg : Offset and length of the register set for this device
+
+ Example Discovery MPSCINTR node:
+ mpsintr@b800 {
+ reg = <0xb800 0x100>;
+ };
+
+
+ i) Marvell Discovery MPSC nodes
+
+ Represent the Discovery's MPSC (Multiprotocol Serial Controller)
+ serial port.
+
+ Required properties:
+ - device_type : "serial"
+ - compatible : "marvell,mv64360-mpsc"
+ - reg : Offset and length of the register set for this device
+ - sdma : the phandle for the SDMA node used by this port
+ - brg : the phandle for the BRG node used by this port
+ - cunit : the phandle for the CUNIT node used by this port
+ - mpscrouting : the phandle for the MPSCROUTING node used by this port
+ - mpscintr : the phandle for the MPSCINTR node used by this port
+ - cell-index : the hardware index of this cell in the MPSC core
+ - max_idle : value needed for MPSC CHR3 (Maximum Frame Length)
+ register
+ - interrupts : <a> where a is the interrupt number for the MPSC.
+ - interrupt-parent : the phandle for the interrupt controller
+ that services interrupts for this device.
+
+ Example Discovery MPSCINTR node:
+ mpsc@8000 {
+ device_type = "serial";
+ compatible = "marvell,mv64360-mpsc";
+ reg = <0x8000 0x38>;
+ virtual-reg = <0xf1008000>;
+ sdma = <&SDMA0>;
+ brg = <&BRG0>;
+ cunit = <&CUNIT>;
+ mpscrouting = <&MPSCROUTING>;
+ mpscintr = <&MPSCINTR>;
+ cell-index = <0>;
+ max_idle = <40>;
+ interrupts = <40>;
+ interrupt-parent = <&PIC>;
+ };
+
+
+ j) Marvell Discovery Watch Dog Timer nodes
+
+ Represent the Discovery's watchdog timer hardware
+
+ Required properties:
+ - compatible : "marvell,mv64360-wdt"
+ - reg : Offset and length of the register set for this device
+
+ Example Discovery Watch Dog Timer node:
+ wdt@b410 {
+ compatible = "marvell,mv64360-wdt";
+ reg = <0xb410 0x8>;
+ };
+
+
+ k) Marvell Discovery I2C nodes
+
+ Represent the Discovery's I2C hardware
+
+ Required properties:
+ - device_type : "i2c"
+ - compatible : "marvell,mv64360-i2c"
+ - reg : Offset and length of the register set for this device
+ - interrupts : <a> where a is the interrupt number for the I2C.
+ - interrupt-parent : the phandle for the interrupt controller
+ that services interrupts for this device.
+
+ Example Discovery I2C node:
+ compatible = "marvell,mv64360-i2c";
+ reg = <0xc000 0x20>;
+ virtual-reg = <0xf100c000>;
+ interrupts = <37>;
+ interrupt-parent = <&PIC>;
+ };
+
+
+ l) Marvell Discovery PIC (Programmable Interrupt Controller) nodes
+
+ Represent the Discovery's PIC hardware
+
+ Required properties:
+ - #interrupt-cells : <1>
+ - #address-cells : <0>
+ - compatible : "marvell,mv64360-pic"
+ - reg : Offset and length of the register set for this device
+ - interrupt-controller
+
+ Example Discovery PIC node:
+ pic {
+ #interrupt-cells = <1>;
+ #address-cells = <0>;
+ compatible = "marvell,mv64360-pic";
+ reg = <0x0 0x88>;
+ interrupt-controller;
+ };
+
+
+ m) Marvell Discovery MPP (Multipurpose Pins) multiplexing nodes
+
+ Represent the Discovery's MPP hardware
+
+ Required properties:
+ - compatible : "marvell,mv64360-mpp"
+ - reg : Offset and length of the register set for this device
+
+ Example Discovery MPP node:
+ mpp@f000 {
+ compatible = "marvell,mv64360-mpp";
+ reg = <0xf000 0x10>;
+ };
+
+
+ n) Marvell Discovery GPP (General Purpose Pins) nodes
+
+ Represent the Discovery's GPP hardware
+
+ Required properties:
+ - compatible : "marvell,mv64360-gpp"
+ - reg : Offset and length of the register set for this device
+
+ Example Discovery GPP node:
+ gpp@f000 {
+ compatible = "marvell,mv64360-gpp";
+ reg = <0xf100 0x20>;
+ };
+
+
+ o) Marvell Discovery PCI host bridge node
+
+ Represents the Discovery's PCI host bridge device. The properties
+ for this node conform to Rev 2.1 of the PCI Bus Binding to IEEE
+ 1275-1994. A typical value for the compatible property is
+ "marvell,mv64360-pci".
+
+ Example Discovery PCI host bridge node
+ pci@80000000 {
+ #address-cells = <3>;
+ #size-cells = <2>;
+ #interrupt-cells = <1>;
+ device_type = "pci";
+ compatible = "marvell,mv64360-pci";
+ reg = <0xcf8 0x8>;
+ ranges = <0x01000000 0x0 0x0
+ 0x88000000 0x0 0x01000000
+ 0x02000000 0x0 0x80000000
+ 0x80000000 0x0 0x08000000>;
+ bus-range = <0 255>;
+ clock-frequency = <66000000>;
+ interrupt-parent = <&PIC>;
+ interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
+ interrupt-map = <
+ /* IDSEL 0x0a */
+ 0x5000 0 0 1 &PIC 80
+ 0x5000 0 0 2 &PIC 81
+ 0x5000 0 0 3 &PIC 91
+ 0x5000 0 0 4 &PIC 93
+
+ /* IDSEL 0x0b */
+ 0x5800 0 0 1 &PIC 91
+ 0x5800 0 0 2 &PIC 93
+ 0x5800 0 0 3 &PIC 80
+ 0x5800 0 0 4 &PIC 81
+
+ /* IDSEL 0x0c */
+ 0x6000 0 0 1 &PIC 91
+ 0x6000 0 0 2 &PIC 93
+ 0x6000 0 0 3 &PIC 80
+ 0x6000 0 0 4 &PIC 81
+
+ /* IDSEL 0x0d */
+ 0x6800 0 0 1 &PIC 93
+ 0x6800 0 0 2 &PIC 80
+ 0x6800 0 0 3 &PIC 81
+ 0x6800 0 0 4 &PIC 91
+ >;
+ };
+
+
+ p) Marvell Discovery CPU Error nodes
+
+ Represent the Discovery's CPU error handler device.
+
+ Required properties:
+ - compatible : "marvell,mv64360-cpu-error"
+ - reg : Offset and length of the register set for this device
+ - interrupts : the interrupt number for this device
+ - interrupt-parent : the phandle for the interrupt controller
+ that services interrupts for this device.
+
+ Example Discovery CPU Error node:
+ cpu-error@0070 {
+ compatible = "marvell,mv64360-cpu-error";
+ reg = <0x70 0x10 0x128 0x28>;
+ interrupts = <3>;
+ interrupt-parent = <&PIC>;
+ };
+
+
+ q) Marvell Discovery SRAM Controller nodes
+
+ Represent the Discovery's SRAM controller device.
+
+ Required properties:
+ - compatible : "marvell,mv64360-sram-ctrl"
+ - reg : Offset and length of the register set for this device
+ - interrupts : the interrupt number for this device
+ - interrupt-parent : the phandle for the interrupt controller
+ that services interrupts for this device.
+
+ Example Discovery SRAM Controller node:
+ sram-ctrl@0380 {
+ compatible = "marvell,mv64360-sram-ctrl";
+ reg = <0x380 0x80>;
+ interrupts = <13>;
+ interrupt-parent = <&PIC>;
+ };
+
+
+ r) Marvell Discovery PCI Error Handler nodes
+
+ Represent the Discovery's PCI error handler device.
+
+ Required properties:
+ - compatible : "marvell,mv64360-pci-error"
+ - reg : Offset and length of the register set for this device
+ - interrupts : the interrupt number for this device
+ - interrupt-parent : the phandle for the interrupt controller
+ that services interrupts for this device.
+
+ Example Discovery PCI Error Handler node:
+ pci-error@1d40 {
+ compatible = "marvell,mv64360-pci-error";
+ reg = <0x1d40 0x40 0xc28 0x4>;
+ interrupts = <12>;
+ interrupt-parent = <&PIC>;
+ };
+
+
+ s) Marvell Discovery Memory Controller nodes
+
+ Represent the Discovery's memory controller device.
+
+ Required properties:
+ - compatible : "marvell,mv64360-mem-ctrl"
+ - reg : Offset and length of the register set for this device
+ - interrupts : the interrupt number for this device
+ - interrupt-parent : the phandle for the interrupt controller
+ that services interrupts for this device.
+
+ Example Discovery Memory Controller node:
+ mem-ctrl@1400 {
+ compatible = "marvell,mv64360-mem-ctrl";
+ reg = <0x1400 0x60>;
+ interrupts = <17>;
+ interrupt-parent = <&PIC>;
+ };
+
-VII - Specifying interrupt information for devices
+VIII - Specifying interrupt information for devices
===================================================
The device tree represents the busses and devices of a hardware
^ permalink raw reply
* [PATCH 8/8 v3] [POWERPC] prpmc2800 needs a dtbImage
From: Dale Farnsworth @ 2008-04-07 22:13 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20080407220027.GA24510@farnsworth.org>
From: Dale Farnsworth <dale@farnsworth.org>
The prpmc2800 platform requires a zImage formatted file with an
embedded dtb file. Rename the requested boot image file to
dtbImage.prpmc2800.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Acked-by: Mark A. Greer <mgreer@mvista.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/boot/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -192,7 +192,7 @@ image-$(CONFIG_PPC_CHRP) += zImage.chrp
image-$(CONFIG_PPC_EFIKA) += zImage.chrp
image-$(CONFIG_PPC_PMAC) += zImage.pmac
image-$(CONFIG_PPC_HOLLY) += zImage.holly
-image-$(CONFIG_PPC_PRPMC2800) += zImage.prpmc2800
+image-$(CONFIG_PPC_PRPMC2800) += dtbImage.prpmc2800
image-$(CONFIG_PPC_ISERIES) += zImage.iseries
image-$(CONFIG_DEFAULT_UIMAGE) += uImage
^ permalink raw reply
* [PATCH 1/1 resend][PPC] replace logical by bitand in pci_process_ISA_OF_ranges(), arch/powerpc/kernel/isa-bridge.c
From: Roel Kluin @ 2008-04-07 22:26 UTC (permalink / raw)
To: jwboyer; +Cc: linuxppc-dev, lkml
in arch/powerpc/kernel/isa-bridge.c:
41:#define ISA_SPACE_MASK 0x1
42:#define ISA_SPACE_IO 0x1
...
83: if ((range->isa_addr.a_hi && ISA_SPACE_MASK) != ISA_SPACE_IO) {
...
89: if ((range->isa_addr.a_hi && ISA_SPACE_MASK) != ISA_SPACE_IO)
I think these should be single &'s, I can't test it (no hardware)
please consider the patch below.
--
replace logical by bit and for ISA_SPACE_MASK
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/powerpc/kernel/isa-bridge.c b/arch/powerpc/kernel/isa-bridge.c
index f0f49d1..406a9e6 100644
--- a/arch/powerpc/kernel/isa-bridge.c
+++ b/arch/powerpc/kernel/isa-bridge.c
@@ -80,13 +80,13 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node,
* (size depending on dev->n_addr_cells)
* cell 5: the size of the range
*/
- if ((range->isa_addr.a_hi && ISA_SPACE_MASK) != ISA_SPACE_IO) {
+ if ((range->isa_addr.a_hi & ISA_SPACE_MASK) != ISA_SPACE_IO) {
range++;
rlen -= sizeof(struct isa_range);
if (rlen < sizeof(struct isa_range))
goto inval_range;
}
- if ((range->isa_addr.a_hi && ISA_SPACE_MASK) != ISA_SPACE_IO)
+ if ((range->isa_addr.a_hi & ISA_SPACE_MASK) != ISA_SPACE_IO)
goto inval_range;
isa_addr = range->isa_addr.a_lo;
^ permalink raw reply related
* Re: Question on mpc52xx_common.c
From: Matt Sealey @ 2008-04-07 22:31 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, Detlev Zundel
In-Reply-To: <fa686aa40804031200n4cd7aeb4g330ab3e2620680e@mail.gmail.com>
Grant Likely wrote:
> (cc'ing the mailing list in my reply)
>
> On Thu, Apr 3, 2008 at 10:27 AM, Detlev Zundel <dzu@denx.de> wrote:
>> I wrote,
>>
>> > debugging a lite5200b kernel (linux-2.6-denx equivalent of 2.6.25-rc8) I
>> > noticed that in mpc52xx_map_common_devices (mpc52xx_common.c:161) the
>> > cdm module is tentatively mapped. It seems strange to me that there is no
>> > error checking here. Is a FDT without an cdm entry usable at all?
>
> Sure, why not? If the firmware has already set it up correctly and no
> devices using it are in use, then the kernel should be okay. :-)
> That said, I can't imagine choosing to not put the cdm node into the
> device tree.
*ahem* Efika.
--
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations
^ permalink raw reply
* Kernel 2.6.23 Error with make bzImage
From: Sam Karp @ 2008-04-07 22:36 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 1314 bytes --]
I've been trying to build the linux 2.6.23 kernel for the PPC405 on the
xilinx ml403. I copied over my xparameters.h and xparameters_ml40x.h files
and added the following options through menuconfig.
Enable loadable module support: DISABLE
Processor:
- Type 40x
- Math emulation: ENABLE
- IBM 40x options:
- Machine Type: "Xilinx-ML403"
Platform options:
- Kernel command line: "console=ttyUL0 root=/dev/ram"
Bus options:
- PCI support: DISABLE
- PCCARD (PCMCIA/CardBus) support:
- PCCARD (PCMCIA/CardBus) support: DISABLE
Drivers
- Block Devices:
- Xilinx SystemACE support: ENABLE
- Character devices:
- Serial drivers:
- Xilinx uartlite serial port support: ENABLE
- Support for console on Xilinx uartlite serial port:
ENABLE
I then ran make bzImage and got the following errors. I'm guessing there
are two options I chose that conflict. Any insight?
CC arch/powerpc/kernel/swsusp.o
arch/powerpc/kernel/swsusp.c 19 error: redefinition of
'save_processor_state'
include/asm/suspend.h 7 : previous definition of 'save_processor_state' was
here
arch/powerpc/kernel/swsusp.c 35 error: redefinition of
'restore_processor_state'
include/asm/suspend.h 11 : previous definition of 'restore_processor_state'
was here
Thanks,
Sam
[-- Attachment #2: Type: text/html, Size: 1734 bytes --]
^ permalink raw reply
* Re: [PATCH 1/1 resend][PPC] replace logical by bitand in pci_process_ISA_OF_ranges(), arch/powerpc/kernel/isa-bridge.c
From: Nathan Lynch @ 2008-04-07 22:59 UTC (permalink / raw)
To: Roel Kluin; +Cc: linuxppc-dev, lkml
In-Reply-To: <47FA9FA6.8090201@tiscali.nl>
Roel Kluin wrote:
> replace logical by bit and for ISA_SPACE_MASK
I think Paul has picked this up now:
http://ozlabs.org/pipermail/linuxppc-dev/2008-April/054103.html
^ permalink raw reply
* [PATCH] pseries: phyp dump: Variable size reserve space.
From: Manish Ahuja @ 2008-04-07 23:45 UTC (permalink / raw)
To: linuxppc-dev, paulus; +Cc: mahuja, linasvepstas
A small proposed change in the amount of reserve space we allocate during boot.
Currently we reserve 256MB only.
The proposed change does one of the 3 things.
A. It checks to see if there is cmdline variable set and if found sets the
value to it. OR
B. It computes 5% of total ram and rounds it down to multiples of 256MB. AND
C. Compares the rounded down value and returns larger of two values, the new
computed value or 256MB.
Again this is for large systems who have excess memory.
Signed-off-by: Manish Ahuja <mahuja@us.ibm.com>
---
arch/powerpc/kernel/prom.c | 35 +++++++++++++++++++++++++++--
arch/powerpc/platforms/pseries/phyp_dump.c | 9 +++++++
include/asm-powerpc/phyp_dump.h | 4 ++-
3 files changed, 45 insertions(+), 3 deletions(-)
Index: 2.6.25-rc1/arch/powerpc/platforms/pseries/phyp_dump.c
===================================================================
--- 2.6.25-rc1.orig/arch/powerpc/platforms/pseries/phyp_dump.c 2008-04-02 23:36:51.000000000 -0500
+++ 2.6.25-rc1/arch/powerpc/platforms/pseries/phyp_dump.c 2008-04-02 23:48:34.000000000 -0500
@@ -496,3 +496,12 @@ static int __init early_phyp_dump_enable
}
early_param("phyp_dump", early_phyp_dump_enabled);
+/* Look for phyp_dump_reserve_size= cmdline option */
+static int __init early_phyp_dump_reserve_size(char *p)
+{
+ if (p)
+ phyp_dump_info->phyp_dump_reserve_bootvar = memparse(p, &p);
+
+ return 0;
+}
+early_param("phyp_dump_reserve_size", early_phyp_dump_reserve_size);
Index: 2.6.25-rc1/include/asm-powerpc/phyp_dump.h
===================================================================
--- 2.6.25-rc1.orig/include/asm-powerpc/phyp_dump.h 2008-04-02 23:36:49.000000000 -0500
+++ 2.6.25-rc1/include/asm-powerpc/phyp_dump.h 2008-04-02 23:37:57.000000000 -0500
@@ -24,8 +24,10 @@ struct phyp_dump {
/* Memory that is reserved during very early boot. */
unsigned long init_reserve_start;
unsigned long init_reserve_size;
- /* Check status during boot if dump supported, active & present*/
+ /* cmd line options during boot */
+ unsigned long phyp_dump_reserve_bootvar;
unsigned long phyp_dump_at_boot;
+ /* Check status during boot if dump supported, active & present*/
unsigned long phyp_dump_configured;
unsigned long phyp_dump_is_active;
/* store cpu & hpte size */
Index: 2.6.25-rc1/arch/powerpc/kernel/prom.c
===================================================================
--- 2.6.25-rc1.orig/arch/powerpc/kernel/prom.c 2008-04-02 23:36:49.000000000 -0500
+++ 2.6.25-rc1/arch/powerpc/kernel/prom.c 2008-04-08 00:01:34.000000000 -0500
@@ -1042,6 +1042,33 @@ static void __init early_reserve_mem(voi
#ifdef CONFIG_PHYP_DUMP
/**
+ * phyp_dump_calculate_reserve_size() - reserve variable boot area 5% or arg
+ *
+ * Function to find the largest size we need to reserve
+ * during early boot process.
+ *
+ * It either looks for boot param and returns that OR
+ * returns larger of 256 or 5% rounded down to multiples of 256MB.
+ *
+ */
+static inline unsigned long phyp_dump_calculate_reserve_size(void)
+{
+ unsigned long tmp;
+
+ if (phyp_dump_info->phyp_dump_reserve_bootvar)
+ return phyp_dump_info->phyp_dump_reserve_bootvar;
+
+ /* divide by 20 to get 5% of value */
+ tmp = lmb_end_of_DRAM();
+ do_div(tmp, 20);
+
+ /* round it down in multiples of 256 */
+ tmp = tmp & ~0x000000001FFFFFFF;
+
+ return (tmp > PHYP_DUMP_RMR_END ? tmp : PHYP_DUMP_RMR_END);
+}
+
+/**
* phyp_dump_reserve_mem() - reserve all not-yet-dumped mmemory
*
* This routine may reserve memory regions in the kernel only
@@ -1054,6 +1081,8 @@ static void __init early_reserve_mem(voi
static void __init phyp_dump_reserve_mem(void)
{
unsigned long base, size;
+ unsigned long variable_reserve_size;
+
if (!phyp_dump_info->phyp_dump_configured) {
printk(KERN_ERR "Phyp-dump not supported on this hardware\n");
return;
@@ -1064,9 +1093,11 @@ static void __init phyp_dump_reserve_mem
return;
}
+ variable_reserve_size = phyp_dump_calculate_reserve_size();
+
if (phyp_dump_info->phyp_dump_is_active) {
/* Reserve *everything* above RMR.Area freed by userland tools*/
- base = PHYP_DUMP_RMR_END;
+ base = variable_reserve_size;
size = lmb_end_of_DRAM() - base;
/* XXX crashed_ram_end is wrong, since it may be beyond
@@ -1078,7 +1109,7 @@ static void __init phyp_dump_reserve_mem
} else {
size = phyp_dump_info->cpu_state_size +
phyp_dump_info->hpte_region_size +
- PHYP_DUMP_RMR_END;
+ variable_reserve_size;
base = lmb_end_of_DRAM() - size;
lmb_reserve(base, size);
phyp_dump_info->init_reserve_start = base;
^ permalink raw reply
* Re: [PATCH 1/1 resend][PPC] replace logical by bitand in pci_process_ISA_OF_ranges(), arch/powerpc/kernel/isa-bridge.c
From: Benjamin Herrenschmidt @ 2008-04-07 23:50 UTC (permalink / raw)
To: Roel Kluin; +Cc: linuxppc-dev, lkml
In-Reply-To: <47FA9FA6.8090201@tiscali.nl>
On Tue, 2008-04-08 at 00:26 +0200, Roel Kluin wrote:
> in arch/powerpc/kernel/isa-bridge.c:
> 41:#define ISA_SPACE_MASK 0x1
> 42:#define ISA_SPACE_IO 0x1
> ...
>
> 83: if ((range->isa_addr.a_hi && ISA_SPACE_MASK) != ISA_SPACE_IO) {
> ...
> 89: if ((range->isa_addr.a_hi && ISA_SPACE_MASK) != ISA_SPACE_IO)
>
> I think these should be single &'s, I can't test it (no hardware)
> please consider the patch below.
> --
> replace logical by bit and for ISA_SPACE_MASK
>
> Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> diff --git a/arch/powerpc/kernel/isa-bridge.c b/arch/powerpc/kernel/isa-bridge.c
> index f0f49d1..406a9e6 100644
> --- a/arch/powerpc/kernel/isa-bridge.c
> +++ b/arch/powerpc/kernel/isa-bridge.c
> @@ -80,13 +80,13 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node,
> * (size depending on dev->n_addr_cells)
> * cell 5: the size of the range
> */
> - if ((range->isa_addr.a_hi && ISA_SPACE_MASK) != ISA_SPACE_IO) {
> + if ((range->isa_addr.a_hi & ISA_SPACE_MASK) != ISA_SPACE_IO) {
> range++;
> rlen -= sizeof(struct isa_range);
> if (rlen < sizeof(struct isa_range))
> goto inval_range;
> }
> - if ((range->isa_addr.a_hi && ISA_SPACE_MASK) != ISA_SPACE_IO)
> + if ((range->isa_addr.a_hi & ISA_SPACE_MASK) != ISA_SPACE_IO)
> goto inval_range;
>
> isa_addr = range->isa_addr.a_lo;
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [RFC][PATCH] initial port of fixmap over from x86 for ppc32
From: Benjamin Herrenschmidt @ 2008-04-07 23:51 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev, Paul Mackerras, hollisb
In-Reply-To: <20080407162053.GB2688@loki.buserror.net>
On Mon, 2008-04-07 at 11:20 -0500, Scott Wood wrote:
>
> Another possible use is a BAT/TLB1 mapping for SoC registers (or
> anything
> else on the board which is frequently accessed), which can be reused
> by
> ioremap() to avoid wasting normal TLB entries, and to facilitate early
> debugging.
As far as the above is concerned, I'm not too fan of fixed virtual
addresses. I'd rather dynamically assign it. But we can do it.
Ben.
^ permalink raw reply
* Re: [PATCH 2 of 3] [KVM] Add DCR access information to struct kvm_run
From: David Gibson @ 2008-04-08 1:11 UTC (permalink / raw)
To: Hollis Blanchard; +Cc: kvm-devel, linuxppc-dev, kvm-ppc-devel
In-Reply-To: <474b35009da7b7bdb58c.1207601613@localhost.localdomain>
On Mon, Apr 07, 2008 at 03:53:33PM -0500, Hollis Blanchard wrote:
> 1 file changed, 7 insertions(+)
> include/linux/kvm.h | 7 +++++++
>
>
> Device Control Registers are essentially another address space found on PowerPC
> 4xx processors, analogous to PIO on x86. DCRs are always 32 bits, and are
> identified by a 32-bit number.
Well... 10-bit, actually.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply
* Re: [PATCH 3 of 3] [KVM POWERPC] PowerPC 440 KVM implementation
From: Josh Boyer @ 2008-04-08 2:12 UTC (permalink / raw)
To: Hollis Blanchard; +Cc: kvm-devel, linuxppc-dev, kvm-ppc-devel
In-Reply-To: <b07f3049f16483f80322.1207601614@localhost.localdomain>
On Mon, 07 Apr 2008 15:53:34 -0500
Hollis Blanchard <hollisb@us.ibm.com> wrote:
> Currently supports only PowerPC 440 Linux guests on 440 hosts. (Only tested
> with 440EP "Bamboo" guests so far, but with appropriate userspace support other
> SoC/board combinations should work.)
I haven't reviewed the whole patch yet, but lots of it looks pretty
clean. A couple comments on some things that made me scratch my head
below.
> Interrupt handling: We use IVPR to hijack the host interrupt vectors while
> running the guest, but hand off decrementer and external interrupts for normal
> guest processing.
>
> Address spaces: We take advantage of the fact that Linux doesn't use the AS=1
> address space (in host or guest), which gives us virtual address space to use
> for guest mappings. While the guest is running, the host kernel remains mapped
> in AS=0, but the guest can only use AS=1 mappings.
>
> TLB entries: The TLB entries covering the host linear address space remain
> present while running the guest (which reduces the overhead of lightweight
> exits). We keep three copies of the TLB:
> - guest TLB: contents of the TLB as the guest sees it
> - shadow TLB: the TLB that is actually in hardware while guest is running
> - host TLB: to restore TLB state when context switching guest -> host
> When a TLB miss occurs because a mapping was not present in the shadow TLB, but
> was present in the guest TLB, KVM handles the fault without invoking the guest.
> Large guest pages are backed by multiple 4KB shadow pages through this
> mechanism.
>
> Instruction emulation: The guest kernel executes at user level, so executing
> privileged instructions trap into KVM, where we decode and emulate them. Future
> performance work will focus on reducing the overhead and frequency of these
> traps.
>
> IO: MMIO and DCR accesses are emulated by userspace. We use virtio for network
> and block IO, so those drivers must be enabled in the guest. It's possible that
> some qemu device emulation (e.g. e1000 or rtl8139) may also work with little
> effort.
>
> Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
As Olof pointed out, having this in Documentation might be nice.
> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
> --- a/arch/powerpc/Kconfig.debug
> +++ b/arch/powerpc/Kconfig.debug
> @@ -151,6 +151,7 @@
>
> config PPC_EARLY_DEBUG
> bool "Early debugging (dangerous)"
> + depends on !KVM
> help
> Say Y to enable some early debugging facilities that may be available
> for your processor/board combination. Those facilities are hacks
Might want to add a brief explanation as to why this doesn't work with
KVM due to the AS conflict.
> diff --git a/arch/powerpc/kvm/44x_tlb.c b/arch/powerpc/kvm/44x_tlb.c
> new file mode 100644
> --- /dev/null
> +++ b/arch/powerpc/kvm/44x_tlb.c
> @@ -0,0 +1,224 @@
> +/*
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License, version 2, as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
> + *
> + * Copyright IBM Corp. 2007
> + *
> + * Authors: Hollis Blanchard <hollisb@us.ibm.com>
> + */
> +
> +#include <linux/types.h>
> +#include <linux/string.h>
> +#include <linux/kvm_host.h>
> +#include <linux/highmem.h>
> +#include <asm/mmu-44x.h>
> +#include <asm/kvm_ppc.h>
> +
> +#include "44x_tlb.h"
> +
> +#define PPC44x_TLB_USER_PERM_MASK (PPC44x_TLB_UX|PPC44x_TLB_UR|PPC44x_TLB_UW)
> +#define PPC44x_TLB_SUPER_PERM_MASK (PPC44x_TLB_SX|PPC44x_TLB_SR|PPC44x_TLB_SW)
> +
> +static unsigned int kvmppc_tlb_44x_pos;
> +
> +static u32 kvmppc_44x_tlb_shadow_attrib(u32 attrib, int usermode)
> +{
> + /* XXX remove mask when Linux is fixed */
> + attrib &= 0xf03f;
What does that mean? Is this the "44x TLB handler writes to reserved
fields" issue? If so, could you comment that a little more verbosely?
Or you could just send a patch to fix Linux... ;).
> +
> + if (!usermode) {
> + /* Guest is in supervisor mode, so we need to translate guest
> + * supervisor permissions into user permissions. */
> + attrib &= ~PPC44x_TLB_USER_PERM_MASK;
> + attrib |= (attrib & PPC44x_TLB_SUPER_PERM_MASK) << 3;
> + }
> +
> + /* Make sure host can always access this memory. */
> + attrib |= PPC44x_TLB_SX|PPC44x_TLB_SR|PPC44x_TLB_SW;
> +
> + return attrib;
> +}
> +
<snip>
> diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
> new file mode 100644
> --- /dev/null
> +++ b/arch/powerpc/kvm/emulate.c
> @@ -0,0 +1,753 @@
> +/*
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License, version 2, as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
> + *
> + * Copyright IBM Corp. 2007
> + *
> + * Authors: Hollis Blanchard <hollisb@us.ibm.com>
> + */
> +
> +#include <linux/jiffies.h>
> +#include <linux/timer.h>
> +#include <linux/types.h>
> +#include <linux/string.h>
> +#include <linux/kvm_host.h>
> +
> +#include <asm/dcr.h>
> +#include <asm/time.h>
> +#include <asm/byteorder.h>
> +#include <asm/kvm_ppc.h>
#include <asm/dcr-regs.h>
> +
> +#include "44x_tlb.h"
> +
> +#define DCRN_CPR0_CFGADDR 0xc
> +#define DCRN_CPR0_CFGDATA 0xd
Remove these.
<snip>
> +int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
> +{
> + u32 inst = vcpu->arch.last_inst;
> + u32 ea;
> + int ra;
> + int rb;
> + int rc;
> + int rs;
> + int rt;
> + int sprn;
> + int dcrn;
> + enum emulation_result emulated = EMULATE_DONE;
> + int advance = 1;
> +
> + switch (get_op(inst)) {
<snip>
> + case 323: /* mfdcr */
> + dcrn = get_dcrn(inst);
> + rt = get_rt(inst);
> +
> + /* emulate some access in kernel */
> + switch (dcrn) {
> + case DCRN_CPR0_CFGADDR:
> + vcpu->arch.gpr[rt] = vcpu->arch.cpr0_cfgaddr;
> + break;
> + case DCRN_CPR0_CFGDATA:
> + local_irq_disable();
> + mtdcr(DCRN_CPR0_CFGADDR,
> + vcpu->arch.cpr0_cfgaddr);
> + vcpu->arch.gpr[rt] = mfdcr(DCRN_CPR0_CFGDATA);
> + local_irq_enable();
> + break;
> + default:
> + run->dcr.dcrn = dcrn;
> + run->dcr.data = 0;
> + run->dcr.is_write = 0;
> + vcpu->arch.io_gpr = rt;
> + vcpu->arch.dcr_needed = 1;
> + emulated = EMULATE_DO_DCR;
> + }
> +
> + break;
<snip>
> + case 451: /* mtdcr */
> + dcrn = get_dcrn(inst);
> + rs = get_rs(inst);
> +
> + /* emulate some access in kernel */
> + switch (dcrn) {
> + case DCRN_CPR0_CFGADDR:
> + vcpu->arch.cpr0_cfgaddr = vcpu->arch.gpr[rs];
> + break;
> + default:
> + run->dcr.dcrn = dcrn;
> + run->dcr.data = vcpu->arch.gpr[rs];
> + run->dcr.is_write = 1;
> + vcpu->arch.dcr_needed = 1;
> + emulated = EMULATE_DO_DCR;
> + }
> +
> + break;
What exactly are those doing? I'm confused as to why the CPR0 DCRs are
special cased. Also, you don't seem to actually be doing much on
storing guest DCRs, so can I assume they aren't really needed at
runtime?
josh
^ permalink raw reply
* Re: Question on mpc52xx_common.c
From: Arnd Bergmann @ 2008-04-08 2:14 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Detlev Zundel
In-Reply-To: <47FAA0A8.7050602@genesi-usa.com>
On Tuesday 08 April 2008, Matt Sealey wrote:
> Grant Likely wrote:
> >=20
> > Sure, why not? =A0If the firmware has already set it up correctly and no
> > devices using it are in use, then the kernel should be okay. =A0:-)
> > That said, I can't imagine choosing to not put the cdm node into the
> > device tree.
>=20
> *ahem* Efika.
Maybe we should just give up on making the efika boot with its regular
device tree and instead add a boot wrapper that either fixes up the
data provided by its firmware or just adds a proper dt blob?
Arnd <><
^ permalink raw reply
* Re: Question on mpc52xx_common.c
From: Grant Likely @ 2008-04-08 2:25 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev, Detlev Zundel
In-Reply-To: <200804080414.42867.arnd@arndb.de>
On Mon, Apr 7, 2008 at 8:14 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 08 April 2008, Matt Sealey wrote:
>
> > Grant Likely wrote:
> > >
> > > Sure, why not? If the firmware has already set it up correctly and no
> > > devices using it are in use, then the kernel should be okay. :-)
> > > That said, I can't imagine choosing to not put the cdm node into the
> > > device tree.
> >
> > *ahem* Efika.
>
> Maybe we should just give up on making the efika boot with its regular
> device tree and instead add a boot wrapper that either fixes up the
> data provided by its firmware or just adds a proper dt blob?
Current kernels boot the Efika without any firmware scripts.
prom_init.c is able to handle the few fixups that the kernel really
wants to see. (So life is mostly happy in Efika land now. :-)
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [kvm-ppc-devel] [PATCH] [v2] Add idle wait support for 44x platforms
From: Arnd Bergmann @ 2008-04-08 2:21 UTC (permalink / raw)
To: linuxppc-dev, jyoung5; +Cc: kvm-ppc-devel, Jimi Xenidis
In-Reply-To: <1207323761.6634.6.camel@thinkpadL>
On Friday 04 April 2008, Jerone Young wrote:
> > > +int __init ppc44x_idle_init(void)
> > > +{
> > > +=A0=A0=A0void *func =3D modes[current_mode].entry;
> > > +=A0=A0=A0struct device_node *node;
> > > +
> > > +=A0=A0=A0node =3D of_find_node_by_path("/hypervisor");
> > > +=A0=A0=A0if (node) {
> > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0/* if we find /hypervisor node is i=
n device tree,
> > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 set idle mode to wait */
> > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0func =3D &ppc44x_idle; /* wait */
> > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0of_node_put(node);
> > > +=A0=A0=A0}
> > > +
> > > +=A0=A0=A0ppc_md.power_save =3D func;
> > > +=A0=A0=A0return 0;
> > > +}
> > > +
> > > +arch_initcall(ppc44x_idle_init);
> >=20
> > IIRC, this would over-ride the idle_param() below, is that the =A0
> > intended behavior?
>=20
> Yes. At the moment if it detects a hypervisor in the kernel tree it
> overrides what the command line says.
>=20
This is unusual behavior. Normally, we try to come up with reasonable
defaults and give the user the chance to override it.
Arnd <><
^ permalink raw reply
* Re: [PATCH] Add idle wait support for 44x platforms
From: Arnd Bergmann @ 2008-04-08 2:17 UTC (permalink / raw)
To: linuxppc-dev; +Cc: kvm-ppc-devel
In-Reply-To: <20080404064741.69f8669b@zod.rchland.ibm.com>
On Friday 04 April 2008, Josh Boyer wrote:
> On Fri, 04 Apr 2008 01:12:38 -0500
> Jerone Young <jyoung5@us.ibm.com> wrote:
> > >
> > > > +static int current_mode = 0;
> > >
> > > Leave this as: static int current_mode;, so it'll end up in the bss
> >
> > The problem here is that this defines the default case. Is there really
> > a benefit having this in bss ?
>
> It's still defined to 0 if it's in the BSS, as that is all initialized
> to 0.
Actually, a static assignment to 0 has not caused the symbol to end up
in .data for many gcc versions, it always goes into .bss now unless you
assign it a value other than 0 or use explicit section attributes.
Whether or not you write the "= 0" is purely stylistic sugar and does
not have any impact the generated binary.
Arnd <><
^ permalink raw reply
* Re: [PATCH] Add idle wait support for 44x platforms
From: Josh Boyer @ 2008-04-08 2:31 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: kvm-ppc-devel, linuxppc-dev
In-Reply-To: <200804080417.37272.arnd@arndb.de>
On Tue, 8 Apr 2008 04:17:36 +0200
Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 04 April 2008, Josh Boyer wrote:
> > On Fri, 04 Apr 2008 01:12:38 -0500
> > Jerone Young <jyoung5@us.ibm.com> wrote:
> > > >
> > > > > +static int current_mode = 0;
> > > >
> > > > Leave this as: static int current_mode;, so it'll end up in the bss
> > >
> > > The problem here is that this defines the default case. Is there really
> > > a benefit having this in bss ?
> >
> > It's still defined to 0 if it's in the BSS, as that is all initialized
> > to 0.
>
> Actually, a static assignment to 0 has not caused the symbol to end up
> in .data for many gcc versions, it always goes into .bss now unless you
> assign it a value other than 0 or use explicit section attributes.
IIRC, gcc 3.2 is still supported and it didn't do that. Old toolchains
still exist.
> Whether or not you write the "= 0" is purely stylistic sugar and does
> not have any impact the generated binary.
Only if you're using a newer gcc version...
josh
^ permalink raw reply
* Re: [PATCH] pseries: phyp dump: Variable size reserve space.
From: Olof Johansson @ 2008-04-08 2:43 UTC (permalink / raw)
To: Manish Ahuja; +Cc: mahuja, linuxppc-dev, linasvepstas, paulus
In-Reply-To: <47FAB221.7050406@austin.ibm.com>
Hi,
Just a few nitpicks, no comments on the functional parts:
On Mon, Apr 07, 2008 at 06:45:37PM -0500, Manish Ahuja wrote:
> A small proposed change in the amount of reserve space we allocate during boot.
> Currently we reserve 256MB only.
> The proposed change does one of the 3 things.
>
> A. It checks to see if there is cmdline variable set and if found sets the
> value to it. OR
> B. It computes 5% of total ram and rounds it down to multiples of 256MB. AND
> C. Compares the rounded down value and returns larger of two values, the new
> computed value or 256MB.
...
> +/* Look for phyp_dump_reserve_size= cmdline option */
> +static int __init early_phyp_dump_reserve_size(char *p)
> +{
> + if (p)
> + phyp_dump_info->phyp_dump_reserve_bootvar = memparse(p, &p);
[...]
> @@ -24,8 +24,10 @@ struct phyp_dump {
> /* Memory that is reserved during very early boot. */
> unsigned long init_reserve_start;
> unsigned long init_reserve_size;
> - /* Check status during boot if dump supported, active & present*/
> + /* cmd line options during boot */
> + unsigned long phyp_dump_reserve_bootvar;
> unsigned long phyp_dump_at_boot;
> + /* Check status during boot if dump supported, active & present*/
> unsigned long phyp_dump_configured;
> unsigned long phyp_dump_is_active;
> /* store cpu & hpte size */
These make for some really long variable names and lines. I know from
experience, since I've picked unneccessary long driver names in the past
myself. :)
How about just naming the new variables reserve_bootvar, etc? The name
of the struct they're in makes it obvious what they're for.
> +static inline unsigned long phyp_dump_calculate_reserve_size(void)
> +{
> + unsigned long tmp;
> +
> + if (phyp_dump_info->phyp_dump_reserve_bootvar)
> + return phyp_dump_info->phyp_dump_reserve_bootvar;
> +
> + /* divide by 20 to get 5% of value */
> + tmp = lmb_end_of_DRAM();
> + do_div(tmp, 20);
> +
> + /* round it down in multiples of 256 */
> + tmp = tmp & ~0x000000001FFFFFFF;
That's 512MB, isn't it?
-Olof
^ permalink raw reply
* Re: [kvm-ppc-devel] [PATCH] [v2] Add idle wait support for 44x platforms
From: Josh Boyer @ 2008-04-08 2:35 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: kvm-ppc-devel, linuxppc-dev, Jimi Xenidis
In-Reply-To: <200804080421.45447.arnd@arndb.de>
On Tue, 8 Apr 2008 04:21:44 +0200
Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 04 April 2008, Jerone Young wrote:
> > > > +int __init ppc44x_idle_init(void)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0void *func =3D modes[current_mode].entry;
> > > > +=C2=A0=C2=A0=C2=A0struct device_node *node;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0node =3D of_find_node_by_path("/hypervisor");
> > > > +=C2=A0=C2=A0=C2=A0if (node) {
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
/* if we find /hypervisor node is in device tree,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 set idle mode to wait */
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
func =3D &ppc44x_idle; /* wait */
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
of_node_put(node);
> > > > +=C2=A0=C2=A0=C2=A0}
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0ppc_md.power_save =3D func;
> > > > +=C2=A0=C2=A0=C2=A0return 0;
> > > > +}
> > > > +
> > > > +arch_initcall(ppc44x_idle_init);
> > >=20
> > > IIRC, this would over-ride the idle_param() below, is that the =C2=A0
> > > intended behavior?
> >=20
> > Yes. At the moment if it detects a hypervisor in the kernel tree it
> > overrides what the command line says.
> >=20
>=20
> This is unusual behavior. Normally, we try to come up with reasonable
> defaults and give the user the chance to override it.
The /hypervisor check is going away completely in the next version of
the patch. I've spoken to the HW guys and am more comfortable with
wait being the default. The spin version should still be an option,
specified by the kernel parameter.
josh
^ permalink raw reply
* Re: [PATCH] Add idle wait support for 44x platforms
From: Arnd Bergmann @ 2008-04-08 2:41 UTC (permalink / raw)
To: linuxppc-dev; +Cc: kvm-ppc-devel
In-Reply-To: <20080407213127.7bb9a769@zod.rchland.ibm.com>
On Tuesday 08 April 2008, Josh Boyer wrote:
> >=20
> > Actually, a static assignment to 0 has not caused the symbol to end up
> > in .data for many gcc versions, it always goes into .bss now unless you
> > assign it a value other than 0 or use explicit section attributes.
>=20
> IIRC, gcc 3.2 is still supported and it didn't do that. =A0Old toolchains
> still exist.
Ok, I thought it was before 3.2. The oldest version I had around was
gcc-3.3 and that had the new behaviour.
Arnd <><
^ permalink raw reply
* Re: [PATCH 2/3] [POWERPC][V3] Xilinx: of_serial support for Xilinx uart 16550.
From: David Gibson @ 2008-04-08 2:44 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev, paulus, John Linn, Arnd Bergmann
In-Reply-To: <1207406756.6809.2.camel@vader.jdub.homelinux.org>
On Sat, Apr 05, 2008 at 09:45:56AM -0500, Josh Boyer wrote:
> On Thu, 2008-04-03 at 06:16 +0200, Arnd Bergmann wrote:
> > On Thursday 03 April 2008, Grant Likely wrote:
> > > >
> > > > Since it is not really compatible with ns16550, shouldn't you at least specify
> > > > a different "compatible" property? That way, the driver won't do incorrect
> > > > accesses when you try to use an old driver with a device tree that specifies
> > > > one of these.
> > >
> > > Heh; we've gone back and forth on this issue. The problem is that we
> > > have a common case of ns16550 like devices that require a little bit
> > > of register address tweaking that spans a whole range of vendors (so
> > > adding a compatible match with each of those vendor's prefixes is
> > > probably non-scalable). So, if "ns16550" is not a good idea, then
> > > what should be used? "sparse16550" has been suggested more than once.
> >
> > After another IRC discussion between Grant, Segher and myself, we concluded
> > that we don't need to invent a new "compatible" value, as only new device
> > trees with old kernels will have a problem with this, and they don't work
> > in the first place.
> >
> > The devices will still have their specific "compatible" value, e.g.
> > "xlnx,plb-uart16550-1.00.c", followed by "ns16550", and possibly
> > "ns16450" and "i8250", although the last two do not have an effect
> > on Linux.
> >
> > Josh, can you please forward all three patches in their latest version?
> >
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> So is the discussion on reg-offset settled then? It seemed Paul and
> David had some issues with that, and I'd like to make sure everyone is
> agreed on that before I bring in patches 2 and 3.
I didn't like it very much, but I don't really care enough to argue
about it.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ 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