Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28709
b: refs/heads/master
c: d4ad66f
h: refs/heads/master
i:
  28707: 183ae73
v: v3
  • Loading branch information
Jeremy Kerr authored and Paul Mackerras committed May 19, 2006
1 parent 71ccdb2 commit 0b1a13b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ae5b2801a0beb10a55a7ebd5140482e2f84c3fa
refs/heads/master: d4ad66faecc4dd9f3db14e0b013741a6f867b089
22 changes: 22 additions & 0 deletions trunk/arch/powerpc/kernel/prom_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,3 +548,25 @@ int of_pci_address_to_resource(struct device_node *dev, int bar,
return __of_address_to_resource(dev, addrp, size, flags, r);
}
EXPORT_SYMBOL_GPL(of_pci_address_to_resource);

void of_parse_dma_window(struct device_node *dn, unsigned char *dma_window_prop,
unsigned long *busno, unsigned long *phys, unsigned long *size)
{
u32 *dma_window, cells;
unsigned char *prop;

dma_window = (u32 *)dma_window_prop;

/* busno is always one cell */
*busno = *(dma_window++);

prop = get_property(dn, "ibm,#dma-address-cells", NULL);
cells = prop ? *(u32 *)prop : prom_n_addr_cells(dn);
*phys = of_read_addr(dma_window, cells);

dma_window += cells;

prop = get_property(dn, "ibm,#dma-size-cells", NULL);
cells = prop ? *(u32 *)prop : prom_n_size_cells(dn);
*size = of_read_addr(dma_window, cells);
}
6 changes: 6 additions & 0 deletions trunk/include/asm-powerpc/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ extern int of_address_to_resource(struct device_node *dev, int index,
extern int of_pci_address_to_resource(struct device_node *dev, int bar,
struct resource *r);

/* Parse the ibm,dma-window property of an OF node into the busno, phys and
* size parameters.
*/
void of_parse_dma_window(struct device_node *dn, unsigned char *dma_window_prop,
unsigned long *busno, unsigned long *phys, unsigned long *size);

extern void kdump_move_device_tree(void);

#endif /* __KERNEL__ */
Expand Down

0 comments on commit 0b1a13b

Please sign in to comment.