3 #include <linux/kernel.h>
4 #include <linux/string.h>
5 #include <linux/ioport.h>
6 #include <linux/etherdevice.h>
7 #include <linux/of_address.h>
10 void of_parse_dma_window(struct device_node
*dn
, const __be32
*dma_window
,
11 unsigned long *busno
, unsigned long *phys
,
17 /* busno is always one cell */
18 *busno
= of_read_number(dma_window
, 1);
21 prop
= of_get_property(dn
, "ibm,#dma-address-cells", NULL
);
23 prop
= of_get_property(dn
, "#address-cells", NULL
);
25 cells
= prop
? of_read_number(prop
, 1) : of_n_addr_cells(dn
);
26 *phys
= of_read_number(dma_window
, cells
);
30 prop
= of_get_property(dn
, "ibm,#dma-size-cells", NULL
);
31 cells
= prop
? of_read_number(prop
, 1) : of_n_size_cells(dn
);
32 *size
= of_read_number(dma_window
, cells
);