Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113096
b: refs/heads/master
c: 5280267
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Sep 3, 2008
1 parent dca2fdf commit 1cc21a7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 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: 9723f38eb53eac9a851210b629555a37afa3f15c
refs/heads/master: 5280267c1dddb8d413595b87dc406624bb497946
26 changes: 22 additions & 4 deletions trunk/arch/sparc/kernel/of_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,27 @@ static int __init build_one_resource(struct device_node *parent,
return 1;
}

static int __init use_1to1_mapping(struct device_node *pp)
{
/* If we have a ranges property in the parent, use it. */
if (of_find_property(pp, "ranges", NULL) != NULL)
return 0;

/* Some SBUS devices use intermediate nodes to express
* hierarchy within the device itself. These aren't
* real bus nodes, and don't have a 'ranges' property.
* But, we should still pass the translation work up
* to the SBUS itself.
*/
if (!strcmp(pp->name, "dma") ||
!strcmp(pp->name, "espdma") ||
!strcmp(pp->name, "ledma") ||
!strcmp(pp->name, "lebuffer"))
return 0;

return 1;
}

static int of_resource_verbose;

static void __init build_device_resources(struct of_device *op,
Expand Down Expand Up @@ -389,10 +410,7 @@ static void __init build_device_resources(struct of_device *op,

memcpy(addr, reg, na * 4);

/* If the immediate parent has no ranges property to apply,
* just use a 1<->1 mapping.
*/
if (of_find_property(pp, "ranges", NULL) == NULL) {
if (use_1to1_mapping(pp)) {
result = of_read_addr(addr, na);
goto build_res;
}
Expand Down
11 changes: 10 additions & 1 deletion trunk/arch/sparc64/kernel/of_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,17 @@ static int __init use_1to1_mapping(struct device_node *pp)

/* If the parent is the dma node of an ISA bus, pass
* the translation up to the root.
*
* Some SBUS devices use intermediate nodes to express
* hierarchy within the device itself. These aren't
* real bus nodes, and don't have a 'ranges' property.
* But, we should still pass the translation work up
* to the SBUS itself.
*/
if (!strcmp(pp->name, "dma"))
if (!strcmp(pp->name, "dma") ||
!strcmp(pp->name, "espdma") ||
!strcmp(pp->name, "ledma") ||
!strcmp(pp->name, "lebuffer"))
return 0;

/* Similarly for all PCI bridges, if we get this far
Expand Down

0 comments on commit 1cc21a7

Please sign in to comment.