diff options
author | Scott Wood <scottwood@freescale.com> | 2007-09-14 20:24:02 +0200 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-10-04 18:02:34 +0200 |
commit | 96fca1dea8f32e96668d55727d66416fdd67360b (patch) | |
tree | 2e7c810fd76475d9c9cbb17af4ef6d99c82513e1 /arch/powerpc/boot/cuboot-pq2.c | |
parent | [POWERPC] mpc8272ads: Change references from 82xx_ADS to 8272_ADS. (diff) | |
download | linux-96fca1dea8f32e96668d55727d66416fdd67360b.tar.xz linux-96fca1dea8f32e96668d55727d66416fdd67360b.zip |
[POWERPC] Document local bus nodes in the device tree, and update cuboot-pq2.
The localbus node is used to describe devices that are connected via a chip
select or similar mechanism. The advantages over placing the devices under
the root node are that it can be probed without probing other random things
under the root, and that the description of which chip select a given device
uses can be used to set up mappings if the firmware failed to do so in a
useful manner.
cuboot-pq2 is updated to match the binding; previously, it called itself
chipselect rather than localbus, and used phandle linkage between the
actual bus node and the control node (the current agreement is to simply use
the fully-qualified address of the control registers, and ignore the overlap
with the IMMR node).
Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/boot/cuboot-pq2.c')
-rw-r--r-- | arch/powerpc/boot/cuboot-pq2.c | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/arch/powerpc/boot/cuboot-pq2.c b/arch/powerpc/boot/cuboot-pq2.c index 470ffacb8373..61574f3272dd 100644 --- a/arch/powerpc/boot/cuboot-pq2.c +++ b/arch/powerpc/boot/cuboot-pq2.c @@ -44,22 +44,21 @@ struct pci_range pci_ranges_buf[MAX_PROP_LEN / sizeof(struct pci_range)]; * some don't set up the PCI PIC at all, so we assume the device tree is * sane and update the BRx registers appropriately. * - * For any node defined as compatible with fsl,pq2-chipselect, - * #address/#size must be 2/1 for chipselect bus, 1/1 for parent bus, - * and ranges must be for whole chip selects. + * For any node defined as compatible with fsl,pq2-localbus, + * #address/#size must be 2/1 for the localbus, and 1/1 for the parent bus. + * Ranges must be for whole chip selects. */ static void update_cs_ranges(void) { - u32 ctrl_ph; - void *ctrl_node, *bus_node, *parent_node; + void *bus_node, *parent_node; u32 *ctrl_addr; unsigned long ctrl_size; u32 naddr, nsize; int len; int i; - bus_node = finddevice("/chipselect"); - if (!bus_node || !dt_is_compatible(bus_node, "fsl,pq2-chipselect")) + bus_node = finddevice("/localbus"); + if (!bus_node || !dt_is_compatible(bus_node, "fsl,pq2-localbus")) return; dt_get_reg_format(bus_node, &naddr, &nsize); @@ -74,19 +73,7 @@ static void update_cs_ranges(void) if (naddr != 1 || nsize != 1) goto err; - len = getprop(bus_node, "fsl,ctrl", &ctrl_ph, 4); - if (len != 4) - goto err; - - ctrl_node = find_node_by_prop_value(NULL, "linux,phandle", - (char *)&ctrl_ph, 4); - if (!ctrl_node) - goto err; - - if (!dt_is_compatible(ctrl_node, "fsl,pq2-chipselect-ctrl")) - goto err; - - if (!dt_xlate_reg(ctrl_node, 0, (unsigned long *)&ctrl_addr, + if (!dt_xlate_reg(bus_node, 0, (unsigned long *)&ctrl_addr, &ctrl_size)) goto err; @@ -123,7 +110,7 @@ static void update_cs_ranges(void) return; err: - printf("Bad /chipselect or fsl,pq2-chipselect-ctrl node\r\n"); + printf("Bad /localbus node\r\n"); } /* Older u-boots don't set PCI up properly. Update the hardware to match |