* [PATCH 6/7] [POWERPC] Xilinx: updated device tree compatibility to match uboot bsp generator.
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
In-Reply-To: <1199820909-32341-6-git-send-email-stephen.neuendorffer@xilinx.com>
Missed this one in the boot loader before.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
arch/powerpc/boot/serial.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c
index cafeece..b6c68ef 100644
--- a/arch/powerpc/boot/serial.c
+++ b/arch/powerpc/boot/serial.c
@@ -128,7 +128,8 @@ int serial_console_init(void)
rc = cpm_console_init(devp, &serial_cd);
else if (dt_is_compatible(devp, "mpc5200-psc-uart"))
rc = mpc5200_psc_console_init(devp, &serial_cd);
- else if (dt_is_compatible(devp, "xilinx,uartlite"))
+ else if (dt_is_compatible(devp, "xlnx,opb-uartlite-1.00.b") ||
+ dt_is_compatible(devp, "xlnx,xps-uartlite-1.00.a"))
rc = uartlite_console_init(devp, &serial_cd);
/* Add other serial console driver calls here */
--
1.5.3.4-dirty
^ permalink raw reply related
* [PATCH 1/7] [POWERPC] Xilinx: Uartlite: Make console output actually work.
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
In-Reply-To: <1199820909-32341-1-git-send-email-stephen.neuendorffer@xilinx.com>
From: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Fixed to apply against 2.6.24-rc5, and remove DEBUG information.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
drivers/serial/uartlite.c | 121 +++++++++++++++++++++++++++++----------------
1 files changed, 79 insertions(+), 42 deletions(-)
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 3f59324..71e4c0a 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -9,6 +9,8 @@
* kind, whether express or implied.
*/
+#undef DEBUG
+
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/console.h>
@@ -321,6 +323,49 @@ static struct uart_ops ulite_ops = {
.verify_port = ulite_verify_port
};
+/**
+ * ulite_get_port: Get the uart_port for a given port number and base addr
+ */
+static struct uart_port *ulite_get_port(int id)
+{
+ struct uart_port *port;
+
+ /* if id = -1; then scan for a free id and use that */
+ if (id < 0) {
+ for (id = 0; id < ULITE_NR_UARTS; id++)
+ if (ulite_ports[id].mapbase == 0)
+ break;
+ }
+
+ if ((id < 0) || (id >= ULITE_NR_UARTS)) {
+ printk(KERN_WARNING "uartlite: invalid id: %i\n", id);
+ return NULL;
+ }
+
+ /* The ID is valid, so get the address of the uart_port structure */
+ port = &ulite_ports[id];
+
+ /* Is the structure is already initialized? */
+ if (port->mapbase)
+ return port;
+
+ /* At this point, we've got an empty uart_port struct, initialize it */
+ spin_lock_init(&port->lock);
+ port->membase = NULL;
+ port->fifosize = 16;
+ port->regshift = 2;
+ port->iotype = UPIO_MEM;
+ port->iobase = 1; /* mark port in use */
+ port->ops = &ulite_ops;
+ port->irq = NO_IRQ;
+ port->flags = UPF_BOOT_AUTOCONF;
+ port->dev = NULL;
+ port->type = PORT_UNKNOWN;
+ port->line = id;
+
+ return port;
+}
+
/* ---------------------------------------------------------------------
* Console driver operations
*/
@@ -376,7 +421,7 @@ static void ulite_console_write(struct console *co, const char *s,
}
#if defined(CONFIG_OF)
-static inline void __init ulite_console_of_find_device(int id)
+static inline u32 __init ulite_console_of_find_device(int id)
{
struct device_node *np;
struct resource res;
@@ -392,13 +437,14 @@ static inline void __init ulite_console_of_find_device(int id)
if (rc)
continue;
- ulite_ports[id].mapbase = res.start;
of_node_put(np);
- return;
+ return res.start+3;
}
+
+ return 0;
}
#else /* CONFIG_OF */
-static inline void __init ulite_console_of_find_device(int id) { /* do nothing */ }
+static inline u32 __init ulite_console_of_find_device(int id) { return 0; }
#endif /* CONFIG_OF */
static int __init ulite_console_setup(struct console *co, char *options)
@@ -408,25 +454,33 @@ static int __init ulite_console_setup(struct console *co, char *options)
int bits = 8;
int parity = 'n';
int flow = 'n';
+ u32 base;
- if (co->index < 0 || co->index >= ULITE_NR_UARTS)
- return -EINVAL;
+ /* Find a matching uart port in the device tree */
+ base = ulite_console_of_find_device(co->index);
- port = &ulite_ports[co->index];
+ /* Get the port structure */
+ port = ulite_get_port(co->index);
+ if (!port)
+ return -ENODEV;
- /* Check if it is an OF device */
- if (!port->mapbase)
- ulite_console_of_find_device(co->index);
+ /* was it initialized for this device? */
+ if (base) {
+ if ((port->mapbase) && (port->mapbase != base)) {
+ pr_debug(KERN_DEBUG "ulite: addr mismatch; %x != %x\n",
+ port->mapbase, base);
+ return -ENODEV; /* port used by another device; bail */
+ }
+ port->mapbase = base;
+ }
- /* Do we have a device now? */
- if (!port->mapbase) {
- pr_debug("console on ttyUL%i not present\n", co->index);
+ if (!port->mapbase)
return -ENODEV;
- }
- /* not initialized yet? */
+ /* registers mapped yet? */
if (!port->membase) {
- if (ulite_request_port(port))
+ port->membase = ioremap(port->mapbase, ULITE_REGION);
+ if (!port->membase)
return -ENODEV;
}
@@ -488,39 +542,22 @@ static int __devinit ulite_assign(struct device *dev, int id, u32 base, int irq)
struct uart_port *port;
int rc;
- /* if id = -1; then scan for a free id and use that */
- if (id < 0) {
- for (id = 0; id < ULITE_NR_UARTS; id++)
- if (ulite_ports[id].mapbase == 0)
- break;
- }
- if (id < 0 || id >= ULITE_NR_UARTS) {
- dev_err(dev, "%s%i too large\n", ULITE_NAME, id);
- return -EINVAL;
+ port = ulite_get_port(id);
+ if (!port) {
+ dev_err(dev, "Cannot get uart_port structure\n");
+ return -ENODEV;
}
- if ((ulite_ports[id].mapbase) && (ulite_ports[id].mapbase != base)) {
- dev_err(dev, "cannot assign to %s%i; it is already in use\n",
- ULITE_NAME, id);
- return -EBUSY;
+ /* was it initialized for this device? */
+ if ((port->mapbase) && (port->mapbase != base)) {
+ pr_debug(KERN_DEBUG "ulite: addr mismatch; %x != %x\n",
+ port->mapbase, base);
+ return -ENODEV;
}
- port = &ulite_ports[id];
-
- spin_lock_init(&port->lock);
- port->fifosize = 16;
- port->regshift = 2;
- port->iotype = UPIO_MEM;
- port->iobase = 1; /* mark port in use */
port->mapbase = base;
- port->membase = NULL;
- port->ops = &ulite_ops;
port->irq = irq;
- port->flags = UPF_BOOT_AUTOCONF;
port->dev = dev;
- port->type = PORT_UNKNOWN;
- port->line = id;
-
dev_set_drvdata(dev, port);
/* Register the port */
--
1.5.3.4-dirty
^ permalink raw reply related
* [PATCH 4/7] [POWERPC] Xilinx: Add correct compatible list for device tree bus bindings.
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
In-Reply-To: <1199820909-32341-4-git-send-email-stephen.neuendorffer@xilinx.com>
Includes both flavors of plb, opb, dcr, and a pseudo 'compound' bus
for representing compound peripherals containing more than one logical
device.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
arch/powerpc/platforms/40x/virtex.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
index 859ba1d..7590fa5 100644
--- a/arch/powerpc/platforms/40x/virtex.c
+++ b/arch/powerpc/platforms/40x/virtex.c
@@ -15,12 +15,22 @@
#include <asm/time.h>
#include <asm/xilinx_intc.h>
+static struct of_device_id xilinx_of_bus_ids[] = {
+ { .compatible = "xlnx,plb-v46-1.00.a", },
+ { .compatible = "xlnx,plb-v34-1.01.a", },
+ { .compatible = "xlnx,plb-v34-1.02.a", },
+ { .compatible = "xlnx,opb-v20-1.10.c", },
+ { .compatible = "xlnx,dcr-v29-1.00.a", },
+ { .compatible = "xlnx,compound", },
+ {},
+};
+
static int __init virtex_device_probe(void)
{
if (!machine_is(virtex))
return 0;
- of_platform_bus_probe(NULL, NULL, NULL);
+ of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL);
return 0;
}
--
1.5.3.4-dirty
^ permalink raw reply related
* [PATCH 7/7] [POWERPC] Xilinx: Uartlite: Section type fixups
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
In-Reply-To: <1199820909-32341-7-git-send-email-stephen.neuendorffer@xilinx.com>
All the __devexit functions are now appropriately tagged. This fixes
some ppc link warnings.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
drivers/serial/uartlite.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 02c2d89..ecd5540 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -594,7 +594,7 @@ static int __devinit ulite_assign(struct device *dev, int id, u32 base, int irq)
*
* @dev: pointer to device structure
*/
-static int __devinit ulite_release(struct device *dev)
+static int __devexit ulite_release(struct device *dev)
{
struct uart_port *port = dev_get_drvdata(dev);
int rc = 0;
@@ -627,7 +627,7 @@ static int __devinit ulite_probe(struct platform_device *pdev)
return ulite_assign(&pdev->dev, pdev->id, res->start, res2->start);
}
-static int ulite_remove(struct platform_device *pdev)
+static int __devexit ulite_remove(struct platform_device *pdev)
{
return ulite_release(&pdev->dev);
}
--
1.5.3.4-dirty
^ permalink raw reply related
* [PATCH 3/7] [POWERPC] Xilinx: Update compatible to use values generated by BSP generator.
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
In-Reply-To: <1199820909-32341-3-git-send-email-stephen.neuendorffer@xilinx.com>
Mainly, this involves two changes:
1) xilinx->xlnx (recognized standard is to use the stock ticker)
2) In order to have the device tree focus on describing what the
hardware is as exactly as possible, the compatible strings contain the
full IP name and IP version.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
arch/powerpc/platforms/40x/virtex.c | 2 +-
drivers/block/xsysace.c | 4 ++-
drivers/serial/uartlite.c | 43 ++++++++++++++++++++++-------------
drivers/video/xilinxfb.c | 2 +-
4 files changed, 32 insertions(+), 19 deletions(-)
diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
index 14bbc32..859ba1d 100644
--- a/arch/powerpc/platforms/40x/virtex.c
+++ b/arch/powerpc/platforms/40x/virtex.c
@@ -30,7 +30,7 @@ static int __init virtex_probe(void)
{
unsigned long root = of_get_flat_dt_root();
- if (!of_flat_dt_is_compatible(root, "xilinx,virtex"))
+ if (!of_flat_dt_is_compatible(root, "xlnx,virtex"))
return 0;
return 1;
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 82effce..45bc51b 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -1208,7 +1208,9 @@ static int __devexit ace_of_remove(struct of_device *op)
/* Match table for of_platform binding */
static struct of_device_id __devinit ace_of_match[] = {
- { .compatible = "xilinx,xsysace", },
+ { .compatible = "xlnx,opb-sysace-1.00.b", },
+ { .compatible = "xlnx,opb-sysace-1.00.c", },
+ { .compatible = "xlnx,xps-sysace-1.00.a", },
{},
};
MODULE_DEVICE_TABLE(of, ace_of_match);
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 71e4c0a..02c2d89 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -19,10 +19,21 @@
#include <linux/tty.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
+#include <linux/init.h>
#include <asm/io.h>
#if defined(CONFIG_OF)
+#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_platform.h>
+
+/* Match table for of_platform binding */
+static struct of_device_id __devinitdata ulite_of_match[] = {
+ { .type = "serial", .compatible = "xlnx,opb-uartlite-1.00.b", },
+ { .type = "serial", .compatible = "xlnx,xps-uartlite-1.00.a", },
+ {},
+};
+MODULE_DEVICE_TABLE(of, ulite_of_match);
+
#endif
#define ULITE_NAME "ttyUL"
@@ -427,18 +438,25 @@ static inline u32 __init ulite_console_of_find_device(int id)
struct resource res;
const unsigned int *of_id;
int rc;
+ const struct of_device_id *matches = ulite_of_match;
+
+ while (matches->compatible[0]) {
+ for_each_compatible_node(np, NULL, matches->compatible) {
+ if (!of_match_node(matches, np))
+ continue;
- for_each_compatible_node(np, NULL, "xilinx,uartlite") {
- of_id = of_get_property(np, "port-number", NULL);
- if ((!of_id) || (*of_id != id))
- continue;
+ of_id = of_get_property(np, "port-number", NULL);
+ if ((!of_id) || (*of_id != id))
+ continue;
- rc = of_address_to_resource(np, 0, &res);
- if (rc)
- continue;
+ rc = of_address_to_resource(np, 0, &res);
+ if (rc)
+ continue;
- of_node_put(np);
- return res.start+3;
+ of_node_put(np);
+ return res.start+3;
+ }
+ matches++;
}
return 0;
@@ -654,13 +672,6 @@ static int __devexit ulite_of_remove(struct of_device *op)
return ulite_release(&op->dev);
}
-/* Match table for of_platform binding */
-static struct of_device_id __devinit ulite_of_match[] = {
- { .type = "serial", .compatible = "xilinx,uartlite", },
- {},
-};
-MODULE_DEVICE_TABLE(of, ulite_of_match);
-
static struct of_platform_driver ulite_of_driver = {
.owner = THIS_MODULE,
.name = "uartlite",
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index e38d3b7..9b426d3 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -460,7 +460,7 @@ static int __devexit xilinxfb_of_remove(struct of_device *op)
/* Match table for of_platform binding */
static struct of_device_id __devinit xilinxfb_of_match[] = {
- { .compatible = "xilinx,ml300-fb", },
+ { .compatible = "xlnx,plb-tft-cntlr-ref-1.00.a", },
{},
};
MODULE_DEVICE_TABLE(of, xilinxfb_of_match);
--
1.5.3.4-dirty
^ permalink raw reply related
* [PATCH 5/7] [POWERPC] Xilinx: Update booting-without-of.
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
In-Reply-To: <1199820909-32341-5-git-send-email-stephen.neuendorffer@xilinx.com>
This now better describes what the UBoot device tree generator
actually does. In particular:
1) Nodes have a label derived from the device name, and a node name
derived from a generic version of the device type, e.g. 'ethernet',
'serial', etc.
2) Usage of compound nodes (representing more than one device in the
same IP) which actually works. This requires having a valid
compatible node, and all the other things that a bus normally has.
I've chosen 'xlnx,compound' as the bus name to describe these compound
nodes.
In addition, I've clarified some of the language relating to how mhs
nodes should be represent in the device tree.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
Documentation/powerpc/booting-without-of.txt | 56 +++++++++++++++-----------
1 files changed, 33 insertions(+), 23 deletions(-)
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index e9a3cb1..d14e45d 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -2276,7 +2276,7 @@ platforms are moved over to use the flattened-device-tree model.
properties of the device node. In general, device nodes for IP-cores
will take the following form:
- (name)@(base-address) {
+ (name): (generic-name)@(base-address) {
compatible = "xlnx,(ip-core-name)-(HW_VER)"
[, (list of compatible devices), ...];
reg = <(baseaddr) (size)>;
@@ -2286,6 +2286,9 @@ platforms are moved over to use the flattened-device-tree model.
xlnx,(parameter2) = <(int-value)>;
};
+ (generic-name): an open firmware-style name that describes the
+ generic class of device. Preferably, this is one word, such
+ as 'serial' or 'ethernet'.
(ip-core-name): the name of the ip block (given after the BEGIN
directive in system.mhs). Should be in lowercase
and all underscores '_' converted to dashes '-'.
@@ -2294,9 +2297,9 @@ platforms are moved over to use the flattened-device-tree model.
dropped from the parameter name, the name is converted
to lowercase and all underscore '_' characters are
converted to dashes '-'.
- (baseaddr): the C_BASEADDR parameter.
+ (baseaddr): the baseaddr parameter value (often named C_BASEADDR).
(HW_VER): from the HW_VER parameter.
- (size): equals C_HIGHADDR - C_BASEADDR + 1
+ (size): the address range size (often C_HIGHADDR - C_BASEADDR + 1).
Typically, the compatible list will include the exact IP core version
followed by an older IP core version which implements the same
@@ -2326,11 +2329,11 @@ platforms are moved over to use the flattened-device-tree model.
becomes the following device tree node:
- opb-uartlite-0@ec100000 {
+ opb_uartlite_0: serial@ec100000 {
device_type = "serial";
compatible = "xlnx,opb-uartlite-1.00.b";
reg = <ec100000 10000>;
- interrupt-parent = <&opb-intc>;
+ interrupt-parent = <&opb_intc_0>;
interrupts = <1 0>; // got this from the opb_intc parameters
current-speed = <d#115200>; // standard serial device prop
clock-frequency = <d#50000000>; // standard serial device prop
@@ -2339,16 +2342,19 @@ platforms are moved over to use the flattened-device-tree model.
xlnx,use-parity = <0>;
};
- Some IP cores actually implement 2 or more logical devices. In this case,
- the device should still describe the whole IP core with a single node
- and add a child node for each logical device. The ranges property can
- be used to translate from parent IP-core to the registers of each device.
- (Note: this makes the assumption that both logical devices have the same
- bus binding. If this is not true, then separate nodes should be used for
- each logical device). The 'cell-index' property can be used to enumerate
- logical devices within an IP core. For example, the following is the
- system.mhs entry for the dual ps2 controller found on the ml403 reference
- design.
+ Some IP cores actually implement 2 or more logical devices. In
+ this case, the device should still describe the whole IP core with
+ a single node and add a child node for each logical device. The
+ ranges property can be used to translate from parent IP-core to the
+ registers of each device. In addition, the parent node should be
+ compatible with the bus type 'xlnx,compound', and should contain
+ #address-cells and #size-cells, as with any other bus. (Note: this
+ makes the assumption that both logical devices have the same bus
+ binding. If this is not true, then separate nodes should be used
+ for each logical device). The 'cell-index' property can be used to
+ enumerate logical devices within an IP core. For example, the
+ following is the system.mhs entry for the dual ps2 controller found
+ on the ml403 reference design.
BEGIN opb_ps2_dual_ref
PARAMETER INSTANCE = opb_ps2_dual_ref_0
@@ -2370,21 +2376,24 @@ platforms are moved over to use the flattened-device-tree model.
It would result in the following device tree nodes:
- opb_ps2_dual_ref_0@a9000000 {
+ opb_ps2_dual_ref_0: opb-ps2-dual-ref@a9000000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "xlnx,compound";
ranges = <0 a9000000 2000>;
// If this device had extra parameters, then they would
// go here.
ps2@0 {
compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
reg = <0 40>;
- interrupt-parent = <&opb-intc>;
+ interrupt-parent = <&opb_intc_0>;
interrupts = <3 0>;
cell-index = <0>;
};
ps2@1000 {
compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
reg = <1000 40>;
- interrupt-parent = <&opb-intc>;
+ interrupt-parent = <&opb_intc_0>;
interrupts = <3 0>;
cell-index = <0>;
};
@@ -2447,17 +2456,18 @@ platforms are moved over to use the flattened-device-tree model.
Gives this device tree (some properties removed for clarity):
- plb-v34-0 {
+ plb@0 {
#address-cells = <1>;
#size-cells = <1>;
+ compatible = "xlnx,plb-v34-1.02.a";
device_type = "ibm,plb";
ranges; // 1:1 translation
- plb-bram-if-cntrl-0@ffff0000 {
+ plb_bram_if_cntrl_0: bram@ffff0000 {
reg = <ffff0000 10000>;
}
- opb-v20-0 {
+ opb@20000000 {
#address-cells = <1>;
#size-cells = <1>;
ranges = <20000000 20000000 20000000
@@ -2465,11 +2475,11 @@ platforms are moved over to use the flattened-device-tree model.
80000000 80000000 40000000
c0000000 c0000000 20000000>;
- opb-uart16550-0@a0000000 {
+ opb_uart16550_0: serial@a0000000 {
reg = <a00000000 2000>;
};
- opb-intc-0@d1000fc0 {
+ opb_intc_0: interrupt-controller@d1000fc0 {
reg = <d1000fc0 20>;
};
};
--
1.5.3.4-dirty
^ permalink raw reply related
* [PATCH 2/7] [POWERPC] Xilinx: update compatible list for interrupt controller
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
In-Reply-To: <1199820909-32341-2-git-send-email-stephen.neuendorffer@xilinx.com>
These values now match what is generated by the uboot BSP generator.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
arch/powerpc/sysdev/xilinx_intc.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/sysdev/xilinx_intc.c b/arch/powerpc/sysdev/xilinx_intc.c
index c2f17cc..ba8eea2 100644
--- a/arch/powerpc/sysdev/xilinx_intc.c
+++ b/arch/powerpc/sysdev/xilinx_intc.c
@@ -135,10 +135,16 @@ void __init xilinx_intc_init_tree(void)
struct device_node *np;
/* find top level interrupt controller */
- for_each_compatible_node(np, NULL, "xilinx,intc") {
+ for_each_compatible_node(np, NULL, "xlnx,opb-intc-1.00.c") {
if (!of_get_property(np, "interrupts", NULL))
break;
}
+ if (!np) {
+ for_each_compatible_node(np, NULL, "xlnx,xps-intc-1.00.a") {
+ if (!of_get_property(np, "interrupts", NULL))
+ break;
+ }
+ }
/* xilinx interrupt controller needs to be top level */
BUG_ON(!np);
--
1.5.3.4-dirty
^ permalink raw reply related
* Re: [PATCH] i2c-ibm_iic driver - new patch
From: Stefan Roese @ 2008-01-08 19:33 UTC (permalink / raw)
To: Sean MacLennan; +Cc: Stephen Rothwell, Arnd Bergmann, linuxppc-dev
In-Reply-To: <4783C284.1070400@pikatech.com>
On Tuesday 08 January 2008, Sean MacLennan wrote:
> Let's try again.
Looks good now. Time to send it to the i2c mailing list <i2c@lm-sensors.org>
and the maintainer Jean Delvare <khali@linux-fr.org>. And please keep the
linuxppc-dev list on CC.
Thanks.
Ciao,
Stefan
^ permalink raw reply
* Re: [PATCH 0/7] [POWERPC] Xilinx: Device Tree updates for xilinx.
From: Grant Likely @ 2008-01-08 19:42 UTC (permalink / raw)
To: Stephen Neuendorffer; +Cc: linuxppc-dev, simekm2
In-Reply-To: <20080108193511.1A5A359005C@mail222-sin.bigfish.com>
On 1/8/08, Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> wrote:
> These patches synchronize all the in-kernel drivers to use the compatible names generated by the UBoot BSP generator. (at git://git.xilinx.com/gen-mhs-devtree.git)
>
> This set of patches should all be ready for 2.6.25: I've removed the ones that weren't and cleaned up the remainder. In particular, there was a nasty code/data section mismatch in the uartlite that showed up in the microblaze. I've also added a patch for the uartlite names in the boot serial that I missed the first time around and a patch that fixes some other section mismatch warnings in the uartlite.
>
> For reference, below is the device tree for a Virtex2Pro design. Except for some small changes mentioned before, this is entirely automatically generated from the EDK design.
Woo! Good looking device tree. :-)
I'll review your patches this afternoon.
Cheers,
g.
>
> Steve
>
> / {
> mem_size_cells: #address-cells = <1>;
> #size-cells = <1>;
> compatible = "xlnx,virtex";
> model = "testing";
> DDR_256MB_32MX64_rank1_row13_col10_cl2_5: memory@0 {
> device_type = "memory";
> reg = < 0 memsize:10000000 >;
> } ;
> chosen {
> bootargs = "root=/dev/nfs nfsroot=172.19.221.221:/exports/xup/ydl41 ip=dhcp console=ttyUL0";
> } ;
> cpus {
> #address-cells = <1>;
> #cpus = <1>;
> #size-cells = <0>;
> PowerPC,405@0 {
> clock-frequency = <11e1a300>;
> d-cache-line-size = <20>;
> d-cache-size = <4000>;
> device_type = "cpu";
> i-cache-line-size = <20>;
> i-cache-size = <4000>;
> reg = <0>;
> timebase: timebase-frequency = <11e1a300>;
> xlnx,dcr-resync = <0>;
> xlnx,deterministic-mult = <0>;
> xlnx,disable-operand-forwarding = <1>;
> xlnx,mmu-enable = <1>;
> } ;
> } ;
> plb_v34 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "xlnx,plb-v34-1.02.a";
> ranges ;
> Ethernet_MAC: ethernet@80400000 {
> compatible = "xlnx,plb-ethernet-1.01.a";
> device_type = "network";
> interrupt-parent = <&opb_intc_0>;
> interrupts = < 2 0 >;
> local-mac-address = [ 00 00 00 00 00 00 ];
> reg = < 80400000 10000 >;
> xlnx,dev-blk-id = <0>;
> xlnx,dev-mir-enable = <1>;
> xlnx,dma-intr-coalesce = <1>;
> xlnx,dma-present = <1>;
> xlnx,err-count-exist = <1>;
> xlnx,fcs-insert-exist = <1>;
> xlnx,half-duplex-exist = <1>;
> xlnx,include-dev-pencoder = <1>;
> xlnx,ipif-fifo-depth = <8000>;
> xlnx,mac-fifo-depth = <40>;
> xlnx,mii-exist = <1>;
> xlnx,miim-clkdvd = <13>;
> xlnx,pad-insert-exist = <1>;
> xlnx,reset-present = <1>;
> xlnx,source-addr-insert-exist = <1>;
> } ;
> opb_v20 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "xlnx,opb-v20-1.10.c";
> ranges ;
> Audio_Codec: opb-ac97@7d400000 {
> compatible = "xlnx,opb-ac97-2.00.a";
> interrupt-parent = <&opb_intc_0>;
> interrupts = < 1 0 >;
> reg = < 7d400000 10000 >;
> xlnx,intr-level = <1>;
> xlnx,playback = <1>;
> xlnx,record = <1>;
> xlnx,use-bram = <1>;
> } ;
> DIPSWs_4Bit: opb-gpio@40020000 {
> compatible = "xlnx,opb-gpio-3.01.b";
> reg = < 40020000 10000 >;
> xlnx,all-inputs = <1>;
> xlnx,all-inputs-2 = <0>;
> xlnx,dout-default = <0>;
> xlnx,dout-default-2 = <0>;
> xlnx,gpio-width = <4>;
> xlnx,interrupt-present = <0>;
> xlnx,is-bidir = <1>;
> xlnx,is-bidir-2 = <1>;
> xlnx,is-dual = <0>;
> xlnx,tri-default = <ffffffff>;
> xlnx,tri-default-2 = <ffffffff>;
> xlnx,user-id-code = <3>;
> } ;
> LEDs_4Bit: opb-gpio@40000000 {
> compatible = "xlnx,opb-gpio-3.01.b";
> reg = < 40000000 10000 >;
> xlnx,all-inputs = <0>;
> xlnx,all-inputs-2 = <0>;
> xlnx,dout-default = <0>;
> xlnx,dout-default-2 = <0>;
> xlnx,gpio-width = <4>;
> xlnx,interrupt-present = <0>;
> xlnx,is-bidir = <0>;
> xlnx,is-bidir-2 = <1>;
> xlnx,is-dual = <0>;
> xlnx,tri-default = <ffffffff>;
> xlnx,tri-default-2 = <ffffffff>;
> xlnx,user-id-code = <3>;
> } ;
> PS2_Ports: opb-ps2-dual-ref@7a400000 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "xlnx,compound";
> ranges = < 0 7a400000 10000 >;
> opb-ps2-dual-ref@0 {
> compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
> interrupt-parent = <&opb_intc_0>;
> interrupts = < 6 0 >;
> reg = < 0 40 >;
> } ;
> opb-ps2-dual-ref@1000 {
> compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
> interrupt-parent = <&opb_intc_0>;
> interrupts = < 5 0 >;
> reg = < 1000 40 >;
> } ;
> } ;
> PushButtons_5Bit: opb-gpio@40040000 {
> compatible = "xlnx,opb-gpio-3.01.b";
> reg = < 40040000 10000 >;
> xlnx,all-inputs = <1>;
> xlnx,all-inputs-2 = <0>;
> xlnx,dout-default = <0>;
> xlnx,dout-default-2 = <0>;
> xlnx,gpio-width = <5>;
> xlnx,interrupt-present = <0>;
> xlnx,is-bidir = <1>;
> xlnx,is-bidir-2 = <1>;
> xlnx,is-dual = <0>;
> xlnx,tri-default = <ffffffff>;
> xlnx,tri-default-2 = <ffffffff>;
> xlnx,user-id-code = <3>;
> } ;
> RS232_Uart_1: serial@40400000 {
> compatible = "xlnx,opb-uartlite-1.00.b";
> device_type = "serial";
> interrupt-parent = <&opb_intc_0>;
> interrupts = < 4 0 >;
> port-number = <0>;
> reg = < 40400000 10000 >;
> xlnx,baudrate = <2580>;
> xlnx,clk-freq = <5f5e100>;
> xlnx,data-bits = <8>;
> xlnx,odd-parity = <0>;
> xlnx,use-parity = <0>;
> } ;
> SysACE_CompactFlash: opb-sysace@41800000 {
> compatible = "xlnx,opb-sysace-1.00.c";
> interrupt-parent = <&opb_intc_0>;
> interrupts = < 3 0 >;
> reg = < 41800000 10000 >;
> xlnx,mem-width = <10>;
> } ;
> dcr_v29 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "xlnx,dcr-v29-1.00.a";
> ranges = < 0 40700000 1000 >;
> VGA_FrameBuffer: plb-tft-cntlr-ref@200 {
> compatible = "xlnx,plb-tft-cntlr-ref-1.00.a";
> reg = < 200 8 >;
> xlnx,default-tft-base-addr = <7f>;
> xlnx,dps-init = <1>;
> xlnx,on-init = <1>;
> xlnx,pixclk-is-busclk-divby4 = <1>;
> } ;
> } ;
> onewire_0: opb-onewire@7a200000 {
> compatible = "xlnx,opb-onewire-1.00.a";
> reg = < 7a200000 10000 >;
> xlnx,add-pullup = "true";
> xlnx,checkcrc = "true";
> xlnx,clk-div = <f>;
> } ;
> opb_hwicap_0: opb-hwicap@41300000 {
> compatible = "xlnx,opb-hwicap-1.00.b";
> reg = < 41300000 10000 >;
> } ;
> opb_intc_0: interrupt-controller@41200000 {
> #interrupt-cells = <2>;
> compatible = "xlnx,opb-intc-1.00.c";
> interrupt-controller ;
> reg = < 41200000 10000 >;
> xlnx,num-intr-inputs = <7>;
> } ;
> opb_timer_0: opb-timer@40800000 {
> compatible = "xlnx,opb-timer-1.00.b";
> interrupt-parent = <&opb_intc_0>;
> interrupts = < 0 0 >;
> reg = < 40800000 100 >;
> xlnx,count-width = <20>;
> xlnx,gen0-assert = <1>;
> xlnx,gen1-assert = <1>;
> xlnx,one-timer-only = <0>;
> xlnx,trig0-assert = <1>;
> xlnx,trig1-assert = <1>;
> } ;
> } ;
> } ;
> } ;
>
>
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* trying to boot linux on MVME5100
From: Phil Howard @ 2008-01-08 19:54 UTC (permalink / raw)
To: linuxppc-embedded
Kernel version is 2.6.23.12 compiled with gcc 4.2.1.
I have an MVME5100 board with PPC6-Bug firmware on it. I'm trying to get a
Linux kernel loaded. The first problem I see is that even though I configure
the load and execute addresses (at 00400000 or 00400004) via NIOT, doing NBO
or NBH still loads things at 00005000. The time is set and the network is
working as I can see the kernel image there in memory at 00005000. When I do
NIOT a 2nd time (actually have done it a few times) it shows by default what
I set it to, even though I have power cycled in between. So it is definitely
saved to NVRAM. But it just seems to not be using it. Here are my latest
settings:
PPC6-Bug>niot
Controller LUN =00?
Device LUN =00?
Node Control Memory Address =03F1D850?
Client IP Address =172.30.1.3?
Server IP Address =172.30.1.1?
Subnet IP Address Mask =255.255.255.0?
Broadcast IP Address =172.30.1.255?
Gateway IP Address =172.30.1.2?
Boot File Name ("NULL" for None) =mvme5100/kernel.img?
Argument File Name ("NULL" for None) =?
Boot File Load Address =003F0000?
Boot File Execution Address =00400004?
Boot File Execution Delay =00000000?
Boot File Length =00000000?
Boot File Byte Offset =00000000?
BOOTP/RARP Request Retry =00?
TFTP/ARP Request Retry =00?
Trace Character Buffer Address =00000000?
BOOTP/RARP Request Control: Always/When-Needed (A/W)=W?
BOOTP/RARP Reply Update Control: Yes/No (Y/N) =Y?
PPC6-Bug>
The other issue I have is that this is a zImage kernel, and it does not
appear to be the right format for PPC6-Bug. The first word of the text
section is not an executable instruction. From the second word it looks
fine up to about 480 bytes into it, then at 512 bytes in there are more
valid CPU instructions. Maybe some padding alignment? So what is the
right entry point address? And where should the kernel really be loaded
if zImage is right?
PPC6-Bug>nbh
Network Booting from: I82559, Controller 0, Device 0
Device Name: /pci@fe000000/pci8086,1209@e,0:0,0
Loading: mvme5100/kernel.img
Client IP Address = 172.30.1.3
Server IP Address = 172.30.1.1
Gateway IP Address = 172.30.1.2
Subnet IP Address Mask = 255.255.255.0
Boot File Name = mvme5100/kernel.img
Argument File Name =
Network Boot File load in progress... To abort hit <BREAK>
Bytes Received =&1678856, Bytes Loaded =&1678856
Bytes/Second =&839428, Elapsed Time =2 Second(s)
Residual-Data Located at: $03FC26DC
IP =00005000 MSR =00003040 CR =20000004 FPSCR =00000000
R0 =00000000 R1 =03EFFE20 R2 =00000000 R3 =03FC26DC
R4 =00005000 R5 =00000000 R6 =00405030 R7 =00000000
R8 =03EFFE34 R9 =00000000 R10 =00000001 R11 =03EFFE7C
R12 =00000000 R13 =00000000 R14 =00000000 R15 =00000000
R16 =00000000 R17 =00000000 R18 =00000000 R19 =00000000
R20 =00000000 R21 =00000000 R22 =00000000 R23 =00000000
R24 =00000000 R25 =00000000 R26 =00000000 R27 =00000000
R28 =00000000 R29 =00000001 R30 =0040E228 R31 =00000001
SPR0 =00000000 SPR1 =00000000 SPR8 =00402AA0 SPR9 =00000000
00005000 7F454C46 WORD $7F454C46
PPC6-Bug>md 5000 50ff
00005000 7F454C46 01020100 00000000 00000000 .ELF............
00005010 00020014 00000001 00400200 00000034 .........@.....4
00005020 00199CA0 00008000 00340020 00040028 .........4. ...(
00005030 00090008 00000001 00010000 00400000 .............@..
00005040 00400000 00189AB8 00195C64 00000007 .@........\d....
00005050 00010000 6474E551 00000000 00000000 ....dt.Q........
00005060 00000000 00000000 00000000 00000007 ................
00005070 00000004 00000004 00000000 00000000 ................
00005080 00000000 00000000 00000000 00000000 ................
00005090 00000000 00000004 00000000 00000000 ................
000050A0 00000000 00000000 00000000 00000000 ................
000050B0 00000000 00000000 00000000 00000000 ................
000050C0 00000000 00000000 00000000 00000000 ................
000050D0 00000000 00000000 00000000 00000000 ................
000050E0 00000000 00000000 00000000 00000000 ................
000050F0 00000000 00000000 00000000 00000000 ................
PPC6-Bug>ds 15000 :20
00015000 0000E0F4 WORD $0000E0F4
00015004 9421FFF0 STWU R1,$FFFFFFF0(R1) ($03EFFE10)
00015008 7C0802A6 MFSPR R0,8
0001500C 429F0005 BCL 20,31,$00015010
00015010 BFC10008 STMW R30,$8(R1) ($03EFFE28)
00015014 7FC802A6 MFSPR R30,8
00015018 90010014 STW R0,$14(R1) ($03EFFE34)
0001501C 801EFFF0 LWZ R0,$FFFFFFF0(R30) ($0040E218)
00015020 7FC0F214 ADD R30,R0,R30
00015024 88030004 LBZ R0,$4(R3) ($03FC26E0)
00015028 2F800002 CMPI CRF7,0,R0,$2
0001502C 409E0024 BC 4,30,$00015050
00015030 817E8000 LWZ R11,$FFFF8000(R30) ($00406228)
00015034 3C00013F ADDIS R0,R0,$13F
00015038 6000FFFF ORI R0,R0,$FFFF
0001503C 812B0000 LWZ R9,$0(R11) ($03EFFE7C)
00015040 7F890040 CMPL CRF7,0,R9,R0
00015044 419D000C BC 12,29,$00015050
00015048 3C000140 ADDIS R0,R0,$140
0001504C 900B0000 STW R0,$0(R11) ($03EFFE7C)
00015050 80010014 LWZ R0,$14(R1) ($03EFFE34)
00015054 BBC10008 LMW R30,$8(R1) ($03EFFE28)
00015058 38210010 ADDI R1,R1,$10
0001505C 7C0803A6 MTSPR 8,R0
00015060 4E800020 BCLR 20,0
00015064 0000E090 WORD $0000E090
00015068 9421FFE0 STWU R1,$FFFFFFE0(R1) ($03EFFE00)
0001506C 7C0802A6 MFSPR R0,8
00015070 429F0005 BCL 20,31,$00015074
00015074 BF810010 STMW R28,$10(R1) ($03EFFE30)
00015078 7FC802A6 MFSPR R30,8
0001507C 90010024 STW R0,$24(R1) ($03EFFE44)
PPC6-Bug>
Executing at 00015004 hits a branch to 0 in just a few instructions.
Any ideas what are the proper steps with this board?
--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
^ permalink raw reply
* Re: [PATCH] Hwmon for Taco
From: Anton Vorontsov @ 2008-01-08 20:13 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev, Sean MacLennan
In-Reply-To: <20080108130251.7ae351c7@zod.rchland.ibm.com>
On Tue, Jan 08, 2008 at 01:02:51PM -0600, Josh Boyer wrote:
> On Tue, 08 Jan 2008 13:30:00 -0500
> Sean MacLennan <smaclennan@pikatech.com> wrote:
>
> > Ok, here is the ad7414 only. taco-dtm is no more!
>
> Cool. Couple more things.
>
> 1) This should go through the hwmon maintainer. Send it to him.
> (CC'ing this list is of course fine.)
>
> 2) You always need the Signed-off-by: for each patch you send
>
> 3) If you didn't author the code (this seems to come from Stefan), then
> you need the Signed-off-by from the original author.
Nope. Signed-off-by means completely different thing. It isn't
copyright, it isn't authorship. It's an information (for the history)
whom to bother if code appeared to be either:
a) broken;
b) stolen from the closed source product;
c) patented (where applicable).
There are Copyright (c) and Author: strings in the files for the
credits. If original patch had these strings, then yes, you must
keep them.
But no one needs author's Signed-off-by, it having zero information
you're hinting about. More than that, there were precedents when
author insisted on removing his Signed-off-by from the modified
patch (when S-o-b used as a permit into someone's tree).
Btw, kernel.org is distributing linux tarballs without changelogs,
thus without Signed-off-by lines. Nobody complains.
Yes, it's common sense and politeness to keep Signed-off-by lines
intact (and the order of these lines), but it's not strict
requirement. "Based on the patch from ..." is the equivalent of
this politeness.
> You're getting there :) These are all "newbie" type mistakes so keep
> plugging away.
>
> josh
Good luck,
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH 7/7] Add MPC512x PSC serial driver
From: John Rigby @ 2008-01-08 17:47 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40801080932g71fb6215wc3d6df107bec7238@mail.gmail.com>
Thanks for the quick feedback Grant.
Grant Likely wrote:
> Exactly *how* different is the 5121 PSC from the 5200 PSC? If it is
> really different, then it makes sense to clone.
The fifo handling has completely changed that is the main difference.
> In fact; I'd
> duplicate the mpc52xx_psc.h file also to avoid any crossover.
>
I agree.
> However, if the differences are manegable, I'd rather see a single
> driver that can drive either type of PSC. In fact, can you post a
> diff between this driver and the original PSC driver?
>
I simple diff will mostly show the removal of arch/ppc support so
won't be much help. How about I do take a pass at a new version
that supports 52xx and 512x but only for arch/powerpc?
^ permalink raw reply
* Re: [PATCH 7/7] Add MPC512x PSC serial driver
From: Grant Likely @ 2008-01-08 20:16 UTC (permalink / raw)
To: John Rigby; +Cc: linuxppc-dev
In-Reply-To: <4783B74D.1040501@freescale.com>
On 1/8/08, John Rigby <jrigby@freescale.com> wrote:
> Thanks for the quick feedback Grant.
>
> Grant Likely wrote:
> > Exactly *how* different is the 5121 PSC from the 5200 PSC? If it is
> > really different, then it makes sense to clone.
> The fifo handling has completely changed that is the main difference.
> > In fact; I'd
> > duplicate the mpc52xx_psc.h file also to avoid any crossover.
> >
> I agree.
>
> > However, if the differences are manegable, I'd rather see a single
> > driver that can drive either type of PSC. In fact, can you post a
> > diff between this driver and the original PSC driver?
> >
> I simple diff will mostly show the removal of arch/ppc support so
> won't be much help. How about I do take a pass at a new version
> that supports 52xx and 512x but only for arch/powerpc?
I'm cool with that. arch/powerpc support has *far* surpassed arch/ppc
for the 5200, so it may be time to just let the old stuff die, even if
it is a little ahead of schedule.
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH] Hwmon for Taco
From: Josh Boyer @ 2008-01-08 20:20 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev, Sean MacLennan
In-Reply-To: <20080108201314.GA29127@localhost.localdomain>
On Tue, 8 Jan 2008 23:13:14 +0300
Anton Vorontsov <avorontsov@ru.mvista.com> wrote:
[snip mostly valid stuff]
> Yes, it's common sense and politeness to keep Signed-off-by lines
> intact (and the order of these lines), but it's not strict
> requirement. "Based on the patch from ..." is the equivalent of
> this politeness.
You took my statement slightly out of context (or I did a lousy job of
explaining for this case).
Basically, I _know_ that Stefan has S-o-b lines in his tree. I _know_
he did most of the work, and I _know_ he's fairly agreeable to adding
his S-o-b line to patches he isn't pushing himself.
So I was simply asking if Sean could get Stefan to add his S-o-b as
well. At the very least a "From:" would be warranted if Sean hasn't
change any code. Then authorship would still be attributed to Stefan.
Yeah, it might be "politeness" but there's really no reason to be
impolite when all the parties involved are in the same discussion...
josh
^ permalink raw reply
* Beta Release for MPC5121e Linux BSP
From: james.mertz @ 2008-01-08 20:37 UTC (permalink / raw)
To: Linuxppc-embedded
Just came across this post.
Here=E2=80=99s the link to the beta linux BSP for MPC5121e:
http://www.freescale.com/webapp/sps/site/overview.jsp?code=3DCW_BSP_PPC&fsr=
ch=3D1
James Mertz
Freescale Semiconductor
^ permalink raw reply
* Re: [PATCH] Miscellaneous for Taco
From: Benjamin Herrenschmidt @ 2008-01-08 20:41 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev, Sean MacLennan
In-Reply-To: <200801082023.11475.sr@denx.de>
On Tue, 2008-01-08 at 20:23 +0100, Stefan Roese wrote:
> On Tuesday 08 January 2008, Sean MacLennan wrote:
> > How about just 44x?
> >
> > Cheers,
> > Sean
> >
> > diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
> > index 7580aa5..682deae 100644
> > --- a/drivers/usb/Kconfig
> > +++ b/drivers/usb/Kconfig
> > @@ -39,6 +39,7 @@ config USB_ARCH_HAS_OHCI
> > # PPC:
> > default y if STB03xxx
> > default y if PPC_MPC52xx
> > + default y if 44x
>
> No. Not all 44x have OHCI built in. Currently 440EP, 440EPx and 405EZ have it.
> But since your patch only touches 440EP, you should just enable OHCI for
> exactly this platform.
Note that the above Kconfig stuff just enabling the choice to enable
OHCI, it's not enabling build of OHCI per-se.
Ben.
^ permalink raw reply
* [RFC] Xilinx: lltemac: use uboot bsp generated device tree style.
From: Stephen Neuendorffer @ 2008-01-08 21:18 UTC (permalink / raw)
To: linuxppc-dev, grant.likely
This driver is not in mainline, however since it is by far the most complex driver we have in terms of interacting with the device tree, I wouldn't mind some feedback. The complexity comes from the fact that the driver is capable of being connected through two different control interfaces. Previously, this information was all incoded in the device tree for the ll-temac, but now (to better reflect the actual hardware) it is split across two nodes with a link.
The xparameters for the lltemac not only includes information about
the lltemac parameters, but also the ip that the lltemac is connected
to, (usually either an ll_fifo or the dma port of the mpmc). Since
we'd like the device tree to reflect the actual hardware, the code for
querying device trees has to traverse the device tree to discover this
information and pass it to the driver.
The expected device tree structure is something like:
TriMode_MAC_MII: xps-ll-temac@81c00000 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,compound";
ethernet@81c00000 {
compatible = "xlnx,xps-ll-temac-1.00.b";
device_type = "network";
interrupt-parent = <&xps_intc_0>;
interrupts = < 1 2 >;
llink-connected = <&TriMode_MAC_MII_fifo>;
local-mac-address = [ 02 00 00 00 00 01 ];
reg = < 81c00000 40 >;
xlnx,bus2core-clk-ratio = <1>;
xlnx,phy-type = <0>;
xlnx,phyaddr = <1>;
xlnx,rxcsum = <0>;
xlnx,rxfifo = <1000>;
xlnx,temac-type = <1>;
xlnx,txcsum = <0>;
xlnx,txfifo = <1000>;
} ;
} ;
TriMode_MAC_MII_fifo: xps-ll-fifo@81a00000 {
compatible = "xlnx,xps-ll-fifo-1.00.a";
interrupt-parent = <&xps_intc_0>;
interrupts = < 0 2 >;
reg = < 81a00000 10000 >;
} ;
or
TriMode_MAC_MII: xps-ll-temac@81c00000 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,compound";
ethernet@81c00000 {
compatible = "xlnx,xps-ll-temac-1.00.b";
device_type = "network";
interrupt-parent = <&xps_intc_0>;
interrupts = < 2 2 >;
llink-connected = <&PIM2>;
local-mac-address = [ 00 00 00 00 00 00 ];
reg = < 81c00000 40 >;
xlnx,bus2core-clk-ratio = <1>;
xlnx,phy-type = <0>;
xlnx,phyaddr = <1>;
xlnx,rxcsum = <0>;
xlnx,rxfifo = <1000>;
xlnx,temac-type = <1>;
xlnx,txcsum = <0>;
xlnx,txfifo = <1000>;
} ;
} ;
mpmc@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,mpmc-3.00.b";
PIM2: sdma@84600100 {
compatible = "xlnx,ll-dma-1.00.a";
interrupt-parent = <&xps_intc_0>;
interrupts = < 1 2 0 2 >;
reg = < 84600100 80 >;
} ;
} ;
---
drivers/net/xilinx_lltemac/xlltemac_main.c | 88 ++++++++++++++++++++++++++--
1 files changed, 83 insertions(+), 5 deletions(-)
diff --git a/drivers/net/xilinx_lltemac/xlltemac_main.c b/drivers/net/xilinx_lltemac/xlltemac_main.c
index 420bd7e..758b1a1 100644
--- a/drivers/net/xilinx_lltemac/xlltemac_main.c
+++ b/drivers/net/xilinx_lltemac/xlltemac_main.c
@@ -3251,10 +3251,22 @@ static u32 get_u32(struct of_device *ofdev, const char *s) {
}
}
+static struct of_device_id xtenet_fifo_of_match[] = {
+ { .compatible = "xlnx,xps-ll-fifo-1.00.a", },
+ { /* end of list */ },
+};
+
+static struct of_device_id xtenet_sdma_of_match[] = {
+ { .compatible = "xlnx,ll-dma-1.00.a", },
+ { /* end of list */ },
+};
+
static int __devinit xtenet_of_probe(struct of_device *ofdev, const struct of_device_id *match)
{
struct resource r_irq_struct;
struct resource r_mem_struct;
+ struct resource r_connected_mem_struct;
+ struct resource r_connected_irq_struct;
struct xlltemac_platform_data pdata_struct;
struct resource *r_irq = &r_irq_struct; /* Interrupt resources */
@@ -3262,6 +3274,8 @@ static int __devinit xtenet_of_probe(struct of_device *ofdev, const struct of_de
struct xlltemac_platform_data *pdata = &pdata_struct;
void *mac_address;
int rc = 0;
+ const phandle *llink_connected_handle;
+ struct device_node *llink_connected_node;
printk(KERN_INFO "Device Tree Probing \'%s\'\n",
ofdev->node->name);
@@ -3283,11 +3297,74 @@ static int __devinit xtenet_of_probe(struct of_device *ofdev, const struct of_de
pdata_struct.tx_csum = get_u32(ofdev, "xlnx,txcsum");
pdata_struct.rx_csum = get_u32(ofdev, "xlnx,rxcsum");
pdata_struct.phy_type = get_u32(ofdev, "xlnx,phy-type");
- pdata_struct.ll_dev_type = get_u32(ofdev, "xlnx,llink-connected-type");
- pdata_struct.ll_dev_baseaddress = get_u32(ofdev, "xlnx,llink-connected-baseaddr");
- pdata_struct.ll_dev_dma_rx_irq = get_u32(ofdev, "xlnx,llink-connected-dmarx-intr");
- pdata_struct.ll_dev_dma_tx_irq = get_u32(ofdev, "xlnx,llink-connected-dmatx-intr");
- pdata_struct.ll_dev_fifo_irq = get_u32(ofdev, "xlnx,llink-connected-fifo-intr");
+ llink_connected_handle =
+ of_get_property(ofdev->node, "llink-connected", NULL);
+ if(!llink_connected_handle) {
+ dev_warn(&ofdev->dev, "no Locallink connection found.\n");
+ return rc;
+ }
+
+ llink_connected_node =
+ of_find_node_by_phandle(*llink_connected_handle);
+
+ rc = of_address_to_resource(
+ llink_connected_node,
+ 0,
+ &r_connected_mem_struct);
+ if(rc) {
+ dev_warn(&ofdev->dev, "invalid address\n");
+ return rc;
+ }
+
+ pdata_struct.ll_dev_baseaddress = r_connected_mem_struct.start;
+ /** Get the right information from whatever the locallink is
+ connected to. */
+ if(of_match_node(xtenet_fifo_of_match, llink_connected_node)) {
+ /** Connected to a fifo. */
+ pdata_struct.ll_dev_type = XPAR_LL_FIFO;
+ pdata_struct.ll_dev_dma_rx_irq = NO_IRQ;
+ pdata_struct.ll_dev_dma_tx_irq = NO_IRQ;
+
+ rc = of_irq_to_resource(
+ llink_connected_node,
+ 0,
+ &r_connected_irq_struct);
+ if(rc == NO_IRQ) {
+ dev_warn(&ofdev->dev, "no IRQ found.\n");
+ return rc;
+ }
+ pdata_struct.ll_dev_fifo_irq = r_connected_irq_struct.start;
+ } else if(of_match_node(xtenet_sdma_of_match, llink_connected_node)) {
+ /** Connected to a dma port. */
+ pdata_struct.ll_dev_type = XPAR_LL_DMA;
+
+ rc = of_irq_to_resource(
+ llink_connected_node,
+ 0,
+ &r_connected_irq_struct);
+ if(rc == NO_IRQ) {
+ dev_warn(&ofdev->dev, "First IRQ not found.\n");
+ return rc;
+ }
+ pdata_struct.ll_dev_dma_rx_irq = r_connected_irq_struct.start;
+
+ rc = of_irq_to_resource(
+ llink_connected_node,
+ 1,
+ &r_connected_irq_struct);
+ if(rc == NO_IRQ) {
+ dev_warn(&ofdev->dev, "Second IRQ not found.\n");
+ return rc;
+ }
+ pdata_struct.ll_dev_dma_tx_irq = r_connected_irq_struct.start;
+
+ pdata_struct.ll_dev_fifo_irq = NO_IRQ;
+ } else {
+ dev_warn(&ofdev->dev, "Locallink connection not matched.\n");
+ return rc;
+ }
+
+ of_node_put(llink_connected_node);
mac_address = of_get_mac_address(ofdev->node);
if(mac_address) {
memcpy(pdata_struct.mac_addr, mac_address, 6);
@@ -3305,6 +3382,7 @@ static int __devexit xtenet_of_remove(struct of_device *dev)
static struct of_device_id xtenet_of_match[] = {
{ .compatible = "xlnx,xps-ll-temac-1.00.a", },
+ { .compatible = "xlnx,xps-ll-temac-1.00.b", },
{ /* end of list */ },
};
--
1.5.3.4-dirty
^ permalink raw reply related
* Generic desktop/server/laptop lable is confusing [Was Re: [PATCH 3/7] Basic Freescale MPC512x support]
From: John Rigby @ 2008-01-08 20:37 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Scott Wood
In-Reply-To: <20080108192531.GB5296@loki.buserror.net>
>
> It may work, but it pulls in code like prom_init.c that is not needed on
> non-OF boards. It's also quite confusing to have an embedded board's
> checkbox only show up when you say yes to "Generic desktop/server/laptop".
>
I have to agree with this, I have been confused by this myself.
Perhaps the prompt should be changed to something less
confusing?
> -Scott
>
>
^ permalink raw reply
* PowerPC Cross Compiler's Arch doesnt match
From: Jeff Parent @ 2008-01-08 21:39 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 2629 bytes --]
I'm building a linux distro for work, that runs on embedded systems with
either and ARM 9 or a PowerPC 603. I've had great luck building a cross
compiler w/ crosstools and using them in the compiler jail created by
Scratchbox. Now I am working on porting all my work to the PowerPC. When I
build the cross compilers I have selected GCC-4.0.1 and GLIBC-2.3.5 for both
setups. I create my jail in Scratchbox for the PowerPC and try compiling
any of the GNU applications and when running the configure script I get:
<./configure for sed-4.1.5>
checking build system type... config/config.guess: unable to guess system
type
This script, last modified 2008-01-08, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
If the version you run (./config.guess.old) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = 2008-01-08
uname -m = powerpc
uname -r = 2.6.18-5-686
uname -s = Linux
uname -v = #1 SMP Fri Jun 1 00:47:00 UTC 2007
/usr/bin/uname -p =
/bin/uname -X =
hostinfo =
/bin/universe =
/usr/bin/arch -k = powerpc
/bin/arch = powerpc
/usr/bin/oslevel =
/usr/convex/getsysinfo =
UNAME_MACHINE = powerpc
UNAME_RELEASE = 2.6.18-5-686
UNAME_SYSTEM = Linux
UNAME_VERSION = #1 SMP Fri Jun 1 00:47:00 UTC 2007
configure: error: cannot guess build type; you must specify one
[sbox-PPC: ~/devel/packages/sed/sed-4.1.5] >
So I looked into configure.guess and I find:
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
<A bunch of Case Statements>
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;;
<More Case Statements.>
However I do not see a case where the UNAME_MACHINE is set to powerpc, other
than for the Machten. Is there something I did wrong when creating my
cross-compiler?
--
------------------------------------------------------------------
Jeff Parent
Computer Engineer
[-- Attachment #2: Type: text/html, Size: 3681 bytes --]
^ permalink raw reply
* Re: Generic desktop/server/laptop lable is confusing [Was Re: [PATCH 3/7] Basic Freescale MPC512x support]
From: Grant Likely @ 2008-01-08 21:40 UTC (permalink / raw)
To: John Rigby; +Cc: Scott Wood, linuxppc-dev
In-Reply-To: <4783DF12.9050700@freescale.com>
On 1/8/08, John Rigby <jrigby@freescale.com> wrote:
>
> >
> > It may work, but it pulls in code like prom_init.c that is not needed on
> > non-OF boards. It's also quite confusing to have an embedded board's
> > checkbox only show up when you say yes to "Generic desktop/server/laptop".
> >
> I have to agree with this, I have been confused by this myself.
> Perhaps the prompt should be changed to something less
> confusing?
I'm agreeable to that. Maybe simply "Multiplatform" with a better
description in the help text?
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: Generic desktop/server/laptop lable is confusing [Was Re: [PATCH 3/7] Basic Freescale MPC512x support]
From: Scott Wood @ 2008-01-08 21:46 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, John Rigby
In-Reply-To: <fa686aa40801081340l1eed359arf345b020b4a410a0@mail.gmail.com>
Grant Likely wrote:
> On 1/8/08, John Rigby <jrigby@freescale.com> wrote:
>>> It may work, but it pulls in code like prom_init.c that is not needed on
>>> non-OF boards. It's also quite confusing to have an embedded board's
>>> checkbox only show up when you say yes to "Generic desktop/server/laptop".
>>>
>> I have to agree with this, I have been confused by this myself.
>> Perhaps the prompt should be changed to something less
>> confusing?
>
> I'm agreeable to that. Maybe simply "Multiplatform" with a better
> description in the help text?
Why do we need a config option for "multiplatform" at all? It seems to
be currently used to hang a few random, non-embeddy things off of such
as real OF and SMT. Let's clean up the mess rather than change the
description.
-Scott
^ permalink raw reply
* Re: MMU failure, Virtex4-FX60
From: Robert Woodworth @ 2008-01-08 21:54 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-embedded
In-Reply-To: <fa686aa40801071021g611ee7d6jbeafb4616cf29464@mail.gmail.com>
After further investigation...
There is a pending interrupt from the PLB waiting at bootup and it gets
hit by Linux when the MSR gets set and enables critical interrupts (same
time that it jumps into 0xC000XXXX). The kernel code detects the
interrupt as a PLB data bus error and goes into crash sequence die().
I think I have a problem with my reset hardware, such that the PLB is
not getting reset correctly with the PPC. With all interrupts disabled
and running a standalone C program, the PLB and memory work fine.
Any Virtex experts out there have any hints?
RJW.
On Mon, 2008-01-07 at 11:21 -0700, Grant Likely wrote:
> On 1/7/08, Robert Woodworth <rwoodworth@securics.com> wrote:
> > Hello!
> >
> > I'm building a new Virtex4-FX60 device. I have built it with the new
> > MPMC3 and a 256MB SO-DIMM. It works successfully with a "mem-test" type
> > embedded program.
> >
> > I cannot get it to boot a Linux kernel. I have traced it down to the
> > MMU not getting mapped correctly.
> >
> > I can load the kernel via jtag, get the pre-boot messages on the serial
> > but then when it tries to jump to 0xc0002218 (start_here: head_4xxx.S)
> > it fails with a "Machine check exception; invalid instruction address".
> >
> > Using the debugger and examining the memory once the mmu is suppose to
> > be configured, I see that it is not mapping 0xc0000000 to the proper
> > location. I'm sure I've set something up wrong in my FPGA and I need to
> > re-synthesize. But what?
>
> Hmmm, I haven't seen that failure mode before. MMU handling on an of
> my virtex platforms has never been a problem. Take a look at the TLB
> registers to see how they are configured to see if the mappings are
> really getting written.
>
> What kernel version are you using?
>
> Cheers,
> g.
>
^ permalink raw reply
* [PATCH 0/3 v2] Add iomega StorCenter basic port
From: Jon Loeliger @ 2008-01-08 22:05 UTC (permalink / raw)
To: linuxppc-dev
Folks,
Here's the second pass at the patches to add the basic
iomega StorCenter port to arch/powerpc. This version
of the patches addresses the comments from the first
round, cleaning up the Kconfig, DTS and board file.
Thanks,
jdl
arch/powerpc/boot/Makefile | 3 +-
arch/powerpc/boot/cuboot-824x.c | 52 +
arch/powerpc/boot/dts/storcenter.dts | 155 +++
arch/powerpc/configs/storcenter_defconfig | 1174 +++++++++++++++++++++++
arch/powerpc/platforms/embedded6xx/Kconfig | 23 +-
arch/powerpc/platforms/embedded6xx/Makefile | 1 +
arch/powerpc/platforms/embedded6xx/storcenter.c | 165 ++++
7 files changed, 1566 insertions(+), 7 deletions(-)
^ permalink raw reply
* [PATCH 1/3 v2] Add StorCenter DTS first draft.
From: Jon Loeliger @ 2008-01-08 22:06 UTC (permalink / raw)
To: linuxppc-dev
Based on the Kurobox DTS files.
Signed-off-by: Andy Wilcox <andy@protium.com>
Signed-off-by: Jon Loeliger <jdl@jdl.com>
---
Pulled PCI node out.
Fixed flash node.
arch/powerpc/boot/dts/storcenter.dts | 155 ++++++++++++++++++++++++++++++++++
1 files changed, 155 insertions(+), 0 deletions(-)
create mode 100644 arch/powerpc/boot/dts/storcenter.dts
diff --git a/arch/powerpc/boot/dts/storcenter.dts b/arch/powerpc/boot/dts/storcenter.dts
new file mode 100644
index 0000000..93aa5a1
--- /dev/null
+++ b/arch/powerpc/boot/dts/storcenter.dts
@@ -0,0 +1,155 @@
+/*
+ * Device Tree Source for IOMEGA StorCenter
+ *
+ * Copyright 2007 Oyvind Repvik
+ * Copyright 2007 Jon Loeliger
+ *
+ * Based on the Kurobox DTS by G. Liakhovetski <g.liakhovetski@gmx.de>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+/ {
+ model = "StorCenter";
+ compatible = "storcenter";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ aliases {
+ serial0 = &serial0;
+ serial1 = &serial1;
+ pci0 = &pci0;
+ };
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ PowerPC,8241@0 {
+ device_type = "cpu";
+ reg = <0>;
+ clock-frequency = <d# 200000000>; /* Hz */
+ timebase-frequency = <d# 25000000>; /* Hz */
+ bus-frequency = <0>; /* from bootwrapper */
+ i-cache-line-size = <d# 32>; /* bytes */
+ d-cache-line-size = <d# 32>; /* bytes */
+ i-cache-size = <4000>;
+ d-cache-size = <4000>;
+ };
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <00000000 04000000>; /* 64MB @ 0x0 */
+ };
+
+ flash@ff800000 {
+ compatible = "cfi-flash";
+ reg = <ff800000 800000>;
+ bank-width = <4>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ partion@0 {
+ label = "kernel";
+ reg = <0 170000>;
+ };
+ partion@1 {
+ label = "rootfs";
+ reg = <170000 590000>;
+ };
+ partion@2 {
+ label = "uboot";
+ reg = <700000 40000>;
+ };
+ partion@3 {
+ label = "config";
+ reg = <740000 c0000>;
+ };
+ };
+
+ soc@80000000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ device_type = "soc";
+ compatible = "fsl,mpc8241", "mpc10x";
+ store-gathering = <0>; /* 0 == off, !0 == on */
+ ranges = <0 fdf00000 00100000>;
+ reg = <fdf00000 10000>; /* EUMB */
+
+ i2c@3000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "fsl-i2c";
+ reg = <3000 1000>;
+ interrupts = <5 2>;
+ interrupt-parent = <&mpic>;
+
+ rtc@68 {
+ compatible = "dallas,ds1337";
+ reg = <68>;
+ };
+ };
+
+ serial0: serial@4500 {
+ cell-index = <0>;
+ device_type = "serial";
+ compatible = "ns16550";
+ reg = <4500 8>;
+ clock-frequency = <d# 97553800>; /* Hz */
+ current-speed = <d# 115200>;
+ interrupts = <9 2>;
+ interrupt-parent = <&mpic>;
+ };
+
+ serial1: serial@4600 {
+ cell-index = <1>;
+ device_type = "serial";
+ compatible = "ns16550";
+ reg = <4600 8>;
+ clock-frequency = <d# 97553800>; /* Hz */
+ current-speed = <d# 9600>;
+ interrupts = <a 2>;
+ interrupt-parent = <&mpic>;
+ };
+
+ mpic: interrupt-controller@fdf40000 {
+ #interrupt-cells = <2>;
+ #address-cells = <0>;
+ device_type = "open-pic";
+ compatible = "chrp,open-pic";
+ interrupt-controller;
+ reg = <fdf40000 40000>;
+ };
+
+ };
+
+ pci0: pci@fe800000 {
+ #address-cells = <3>;
+ #size-cells = <2>;
+ #interrupt-cells = <1>;
+ device_type = "pci";
+ compatible = "mpc10x-pci";
+ reg = <fe800000 1000>;
+ ranges = <01000000 0 0 fe000000 0 00c00000
+ 02000000 0 80000000 80000000 0 70000000>;
+ bus-range = <0 ff>;
+ clock-frequency = <d# 97553800>; /* Hz */
+ interrupt-parent = <&mpic>;
+ interrupt-map-mask = <f800 0 0 7>;
+ interrupt-map = <
+ /* IDSEL 15 - ETH */
+ 7800 0 0 1 &mpic 0 1
+ 7800 0 0 2 &mpic 0 1
+ 7800 0 0 3 &mpic 0 1
+ 7800 0 0 4 &mpic 0 1
+ >;
+ };
+
+ chosen {
+ linux,stdout-path = "/soc@80000000/serial@4500";
+ bootargs = "console=ttyS0,115200";
+ };
+
+};
--
1.5.4.rc0
^ permalink raw reply related
* [PATCH 2/3 v2] Add initial iomega StorCenter board port.
From: Jon Loeliger @ 2008-01-08 22:07 UTC (permalink / raw)
To: linuxppc-dev
Use cuImage bootwrapper until U-Boot port is completed.
Derived heavily from Linkstation port.
Signed-off-by: Andy Wilcox <andy@protium.com>
Signed-off-by: Jon Loeliger <jdl@jdl.com>
---
Fixed Kconfig to select options rather than "depend on" them.
Fleshed out storcenter_restart() stub routines a bit.
arch/powerpc/boot/Makefile | 3 +-
arch/powerpc/boot/cuboot-824x.c | 52 +++++++
arch/powerpc/platforms/embedded6xx/Kconfig | 23 +++-
arch/powerpc/platforms/embedded6xx/Makefile | 1 +
arch/powerpc/platforms/embedded6xx/storcenter.c | 169 +++++++++++++++++++++++
5 files changed, 241 insertions(+), 7 deletions(-)
create mode 100644 arch/powerpc/boot/cuboot-824x.c
create mode 100644 arch/powerpc/platforms/embedded6xx/storcenter.c
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index d1e625c..a59b176 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -57,7 +57,7 @@ src-wlib := string.S crt0.S stdio.c main.c \
4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \
cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \
fsl-soc.c mpc8xx.c pq2.c
-src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \
+src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c \
cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \
@@ -196,6 +196,7 @@ image-$(CONFIG_PPC_EP88XC) += zImage.ep88xc
image-$(CONFIG_EP405) += zImage.ep405
image-$(CONFIG_8260) += cuImage.pq2
image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx
+image-$(CONFIG_STORCENTER) += cuImage.824x
image-$(CONFIG_PPC_83xx) += cuImage.83xx
image-$(CONFIG_PPC_85xx) += cuImage.85xx
image-$(CONFIG_MPC7448HPC2) += cuImage.hpc2
diff --git a/arch/powerpc/boot/cuboot-824x.c b/arch/powerpc/boot/cuboot-824x.c
new file mode 100644
index 0000000..4aa3eee
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-824x.c
@@ -0,0 +1,52 @@
+/*
+ * Old U-boot compatibility for 824x
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ * 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.
+ */
+
+#include "ops.h"
+#include "stdio.h"
+#include "cuboot.h"
+
+#define TARGET_824x
+#include "ppcboot.h"
+
+static bd_t bd;
+
+static void platform_fixups(void)
+{
+ void *soc;
+
+ dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
+ dt_fixup_mac_addresses(bd.bi_enetaddr);
+ dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
+
+ soc = find_node_by_devtype(NULL, "soc");
+ if (soc) {
+ void *serial = NULL;
+
+ setprop(soc, "bus-frequency", &bd.bi_busfreq,
+ sizeof(bd.bi_busfreq));
+
+ while ((serial = find_node_by_devtype(serial, "serial"))) {
+ if (get_parent(serial) != soc)
+ continue;
+
+ setprop(serial, "clock-frequency", &bd.bi_busfreq,
+ sizeof(bd.bi_busfreq));
+ }
+ }
+}
+
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+ unsigned long r6, unsigned long r7)
+{
+ CUBOOT_INIT();
+ fdt_init(_dtb_start);
+ serial_console_init();
+ platform_ops.fixups = platform_fixups;
+}
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig
index 8924095..6c80837 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -9,6 +9,8 @@ config LINKSTATION
select FSL_SOC
select PPC_UDBG_16550 if SERIAL_8250
select DEFAULT_UIMAGE
+ select MPC10X_OPENPIC
+ select MPC10X_BRIDGE
help
Select LINKSTATION if configuring for one of PPC- (MPC8241)
based NAS systems from Buffalo Technology. So far only
@@ -16,6 +18,19 @@ config LINKSTATION
Linkstation-I HD-HLAN and HD-HGLAN versions, and PPC-based
Terastation systems should be supported too.
+config STORCENTER
+ bool "IOMEGA StorCenter"
+ depends on EMBEDDED6xx
+ select MPIC
+ select FSL_SOC
+ select PPC_UDBG_16550 if SERIAL_8250
+ select WANT_DEVICE_TREE
+ select MPC10X_OPENPIC
+ select MPC10X_BRIDGE
+ help
+ Select STORCENTER if configuring for the iomega StorCenter
+ with an 8241 CPU in it.
+
config MPC7448HPC2
bool "Freescale MPC7448HPC2(Taiga)"
depends on EMBEDDED6xx
@@ -23,6 +38,7 @@ config MPC7448HPC2
select DEFAULT_UIMAGE
select PPC_UDBG_16550
select WANT_DEVICE_TREE
+ select TSI108_BRIDGE
help
Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga)
platform
@@ -33,6 +49,7 @@ config PPC_HOLLY
select TSI108_BRIDGE
select PPC_UDBG_16550
select WANT_DEVICE_TREE
+ select TSI108_BRIDGE
help
Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval
Board with TSI108/9 bridge (Hickory/Holly)
@@ -48,17 +65,13 @@ config PPC_PRPMC2800
config TSI108_BRIDGE
bool
- depends on MPC7448HPC2 || PPC_HOLLY
select PCI
select MPIC
select MPIC_WEIRD
- default y
config MPC10X_BRIDGE
bool
- depends on LINKSTATION
select PPC_INDIRECT_PCI
- default y
config MV64X60
bool
@@ -67,8 +80,6 @@ config MV64X60
config MPC10X_OPENPIC
bool
- depends on LINKSTATION
- default y
config MPC10X_STORE_GATHERING
bool "Enable MPC10x store gathering"
diff --git a/arch/powerpc/platforms/embedded6xx/Makefile b/arch/powerpc/platforms/embedded6xx/Makefile
index 844947c..06524d3 100644
--- a/arch/powerpc/platforms/embedded6xx/Makefile
+++ b/arch/powerpc/platforms/embedded6xx/Makefile
@@ -3,5 +3,6 @@
#
obj-$(CONFIG_MPC7448HPC2) += mpc7448_hpc2.o
obj-$(CONFIG_LINKSTATION) += linkstation.o ls_uart.o
+obj-$(CONFIG_STORCENTER) += storcenter.o
obj-$(CONFIG_PPC_HOLLY) += holly.o
obj-$(CONFIG_PPC_PRPMC2800) += prpmc2800.o
diff --git a/arch/powerpc/platforms/embedded6xx/storcenter.c b/arch/powerpc/platforms/embedded6xx/storcenter.c
new file mode 100644
index 0000000..593c74a
--- /dev/null
+++ b/arch/powerpc/platforms/embedded6xx/storcenter.c
@@ -0,0 +1,169 @@
+/*
+ * Board setup routines for the storcenter
+ *
+ * Copyright 2007 (C) Oyvind Repvik (nail@nslu2-linux.org)
+ * Copyright 2007 Andy Wilcox, Jon Loeliger
+ *
+ * Based on linkstation.c by G. Liakhovetski
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of
+ * any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/initrd.h>
+#include <linux/mtd/physmap.h>
+#include <linux/of_platform.h>
+
+#include <asm/time.h>
+#include <asm/prom.h>
+#include <asm/mpic.h>
+#include <asm/pci-bridge.h>
+
+#include "mpc10x.h"
+
+extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
+
+
+static __initdata struct of_device_id storcenter_of_bus[] = {
+ { .name = "soc", },
+ {},
+};
+
+static int __init storcenter_device_probe(void)
+{
+ of_platform_bus_probe(NULL, storcenter_of_bus, NULL);
+ return 0;
+}
+machine_device_initcall(storcenter, storcenter_device_probe);
+
+
+static int __init storcenter_add_bridge(struct device_node *dev)
+{
+#ifdef CONFIG_PCI
+ int len;
+ struct pci_controller *hose;
+ const int *bus_range;
+
+ printk("Adding PCI host bridge %s\n", dev->full_name);
+
+ hose = pcibios_alloc_controller(dev);
+ if (hose == NULL)
+ return -ENOMEM;
+
+ bus_range = of_get_property(dev, "bus-range", &len);
+ hose->first_busno = bus_range ? bus_range[0] : 0;
+ hose->last_busno = bus_range ? bus_range[1] : 0xff;
+
+ setup_indirect_pci(hose, MPC10X_MAPB_CNFG_ADDR, MPC10X_MAPB_CNFG_DATA, 0);
+
+ /* Interpret the "ranges" property */
+ /* This also maps the I/O region and sets isa_io/mem_base */
+ pci_process_bridge_OF_ranges(hose, dev, 1);
+#endif
+
+ return 0;
+}
+
+static void __init storcenter_setup_arch(void)
+{
+ struct device_node *np;
+
+ /* Lookup PCI host bridges */
+ for_each_compatible_node(np, "pci", "mpc10x-pci")
+ storcenter_add_bridge(np);
+
+ printk(KERN_INFO "IOMEGA StorCenter\n");
+}
+
+/*
+ * Interrupt setup and service. Interrrupts on the turbostation come
+ * from the four PCI slots plus onboard 8241 devices: I2C, DUART.
+ */
+static void __init storcenter_init_IRQ(void)
+{
+ struct mpic *mpic;
+ struct device_node *dnp;
+ const void *prop;
+ int size;
+ phys_addr_t paddr;
+
+ dnp = of_find_node_by_type(NULL, "open-pic");
+ if (dnp == NULL)
+ return;
+
+ prop = of_get_property(dnp, "reg", &size);
+ paddr = (phys_addr_t)of_translate_address(dnp, prop);
+ mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET,
+ 4, 32, " EPIC ");
+ BUG_ON(mpic == NULL);
+
+ /* PCI IRQs */
+ /*
+ * 2.6.12 patch:
+ * openpic_set_sources(0, 5, OpenPIC_Addr + 0x10200);
+ * openpic_set_sources(5, 2, OpenPIC_Addr + 0x11120);
+ * first_irq, num_irqs, __iomem first_ISR
+ * o_ss: i, src: 0, fdf50200
+ * o_ss: i, src: 1, fdf50220
+ * o_ss: i, src: 2, fdf50240
+ * o_ss: i, src: 3, fdf50260
+ * o_ss: i, src: 4, fdf50280
+ * o_ss: i, src: 5, fdf51120
+ * o_ss: i, src: 6, fdf51140
+ */
+ mpic_assign_isu(mpic, 0, paddr + 0x10200);
+ mpic_assign_isu(mpic, 1, paddr + 0x10220);
+ mpic_assign_isu(mpic, 2, paddr + 0x10240);
+ mpic_assign_isu(mpic, 3, paddr + 0x10260);
+ mpic_assign_isu(mpic, 4, paddr + 0x10280);
+ mpic_assign_isu(mpic, 5, paddr + 0x11120);
+ mpic_assign_isu(mpic, 6, paddr + 0x11140);
+
+ mpic_init(mpic);
+}
+
+static void storcenter_restart(char *cmd)
+{
+ local_irq_disable();
+
+ /* Set exception prefix high - to the firmware */
+ _nmask_and_or_msr(0, MSR_IP);
+
+ /* Wait for reset to happen */
+ for (;;) ;
+}
+
+static void storcenter_power_off(void)
+{
+ /* No way to shut power off with software */
+ local_irq_disable();
+ for (;;) ;
+ /* NOTREACHED */
+}
+
+static void storcenter_halt(void)
+{
+ storcenter_power_off();
+}
+
+static int __init storcenter_probe(void)
+{
+ unsigned long root = of_get_flat_dt_root();
+
+ return of_flat_dt_is_compatible(root, "storcenter");
+}
+
+define_machine(storcenter){
+ .name = "IOMEGA StorCenter",
+ .probe = storcenter_probe,
+ .setup_arch = storcenter_setup_arch,
+ .init_IRQ = storcenter_init_IRQ,
+ .get_irq = mpic_get_irq,
+ .restart = storcenter_restart,
+ .power_off = storcenter_power_off,
+ .halt = storcenter_halt,
+ .calibrate_decr = generic_calibrate_decr,
+};
--
1.5.4.rc0
^ permalink raw reply related
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