Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67488
b: refs/heads/master
c: 96fca1d
h: refs/heads/master
v: v3
  • Loading branch information
Scott Wood authored and Kumar Gala committed Oct 4, 2007
1 parent 7b03b4d commit 0e221c6
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2d2294ae12827a97c9daa253f1ce99e7ae3195d7
refs/heads/master: 96fca1dea8f32e96668d55727d66416fdd67360b
38 changes: 38 additions & 0 deletions trunk/Documentation/powerpc/booting-without-of.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2017,6 +2017,44 @@ platforms are moved over to use the flattened-device-tree model.
fsl,cpm-command = <2e600000>;
};

m) Chipselect/Local Bus

Properties:
- name : Should be localbus
- #address-cells : Should be either two or three. The first cell is the
chipselect number, and the remaining cells are the
offset into the chipselect.
- #size-cells : Either one or two, depending on how large each chipselect
can be.
- ranges : Each range corresponds to a single chipselect, and cover
the entire access window as configured.

Example:
localbus@f0010100 {
compatible = "fsl,mpc8272ads-localbus",
"fsl,mpc8272-localbus",
"fsl,pq2-localbus";
#address-cells = <2>;
#size-cells = <1>;
reg = <f0010100 40>;

ranges = <0 0 fe000000 02000000
1 0 f4500000 00008000>;

flash@0,0 {
compatible = "jedec-flash";
reg = <0 0 2000000>;
bank-width = <4>;
device-width = <1>;
};

board-control@1,0 {
reg = <1 0 20>;
compatible = "fsl,mpc8272ads-bcsr";
};
};


More devices will be defined as this spec matures.

VII - Specifying interrupt information for devices
Expand Down
29 changes: 8 additions & 21 deletions trunk/arch/powerpc/boot/cuboot-pq2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0e221c6

Please sign in to comment.