mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-10 00:26:34 +00:00
[PATCH] powerpc: Update OF address parsers
This updates the OF address parsers to return the IO flags indicating the type of address obtained. It also adds a PCI call for converting physical addresses that hit IO space into into IO tokens, and add routines that return the translated addresses into struct resource Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
parent
bb6b9b28d6
commit
d2dd482bc1
10 changed files with 251 additions and 36 deletions
|
@ -332,18 +332,14 @@ static void macio_setup_resources(struct macio_dev *dev,
|
|||
struct resource *parent_res)
|
||||
{
|
||||
struct device_node *np = dev->ofdev.node;
|
||||
u32 *addr;
|
||||
u64 size;
|
||||
struct resource r;
|
||||
int index;
|
||||
|
||||
for (index = 0; (addr = of_get_address(np, index, &size)) != NULL;
|
||||
index++) {
|
||||
for (index = 0; of_address_to_resource(np, index, &r) == 0; index++) {
|
||||
struct resource *res = &dev->resource[index];
|
||||
if (index >= MACIO_DEV_COUNT_RESOURCES)
|
||||
break;
|
||||
res->start = of_translate_address(np, addr);
|
||||
res->end = res->start + (unsigned long)size - 1;
|
||||
res->flags = IORESOURCE_MEM;
|
||||
*res = r;
|
||||
res->name = dev->ofdev.dev.bus_id;
|
||||
|
||||
if (macio_resource_quirks(np, res, index)) {
|
||||
|
@ -353,7 +349,7 @@ static void macio_setup_resources(struct macio_dev *dev,
|
|||
/* Currently, we consider failure as harmless, this may
|
||||
* change in the future, once I've found all the device
|
||||
* tree bugs in older machines & worked around them
|
||||
*/
|
||||
l */
|
||||
if (insert_resource(parent_res, res)) {
|
||||
printk(KERN_WARNING "Can't request resource "
|
||||
"%d for MacIO device %s\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue