X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fppc%2Fsyslib%2Fprom.c;fp=arch%2Fppc%2Fsyslib%2Fprom.c;h=482f837fd37359b8dd5dcaab065e6cce1386cb4c;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=2c64ed627475d065f6607066b9350d2544c486ff;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/arch/ppc/syslib/prom.c b/arch/ppc/syslib/prom.c index 2c64ed627..482f837fd 100644 --- a/arch/ppc/syslib/prom.c +++ b/arch/ppc/syslib/prom.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -71,8 +70,6 @@ int use_of_interrupt_tree; struct device_node *dflt_interrupt_controller; int num_interrupt_controllers; -int pmac_newworld; - extern unsigned int rtas_entry; /* physical pointer */ extern struct device_node *allnodes; @@ -89,7 +86,7 @@ extern char cmd_line[512]; /* XXX */ extern boot_infos_t *boot_infos; unsigned long dev_tree_size; -void __openfirmware +void phys_call_rtas(int service, int nargs, int nret, ...) { va_list list; @@ -124,22 +121,13 @@ finish_device_tree(void) unsigned long mem = (unsigned long) klimit; struct device_node *np; - /* All newworld pmac machines and CHRPs now use the interrupt tree */ + /* All CHRPs now use the interrupt tree */ for (np = allnodes; np != NULL; np = np->allnext) { if (get_property(np, "interrupt-parent", NULL)) { use_of_interrupt_tree = 1; break; } } - if (_machine == _MACH_Pmac && use_of_interrupt_tree) - pmac_newworld = 1; - -#ifdef CONFIG_BOOTX_TEXT - if (boot_infos && pmac_newworld) { - prom_print("WARNING ! BootX/miBoot booting is not supported on this machine\n"); - prom_print(" You should use an Open Firmware bootloader\n"); - } -#endif /* CONFIG_BOOTX_TEXT */ if (use_of_interrupt_tree) { /* @@ -435,16 +423,10 @@ finish_node_interrupts(struct device_node *np, unsigned long mem_start) * those machines, we want to offset interrupts from the * second openpic by 128 -- BenH */ - if (_machine != _MACH_Pmac && num_interrupt_controllers > 1 + if (num_interrupt_controllers > 1 && ic != NULL && get_property(ic, "interrupt-parent", NULL) == NULL) offset = 16; - else if (_machine == _MACH_Pmac && num_interrupt_controllers > 1 - && ic != NULL && ic->parent != NULL) { - char *name = get_property(ic->parent, "name", NULL); - if (name && !strcmp(name, "u3")) - offset = 128; - } np->intrs[i].line = irq[0] + offset; if (n > 1) @@ -862,7 +844,7 @@ find_type_devices(const char *type) /* * Returns all nodes linked together */ -struct device_node * __openfirmware +struct device_node * find_all_nodes(void) { struct device_node *head, **prevp, *np; @@ -1165,7 +1147,7 @@ get_property(struct device_node *np, const char *name, int *lenp) /* * Add a property to a node */ -void __openfirmware +int prom_add_property(struct device_node* np, struct property* prop) { struct property **next = &np->properties; @@ -1174,10 +1156,12 @@ prom_add_property(struct device_node* np, struct property* prop) while (*next) next = &(*next)->next; *next = prop; + + return 0; } /* I quickly hacked that one, check against spec ! */ -static inline unsigned long __openfirmware +static inline unsigned long bus_space_to_resource_flags(unsigned int bus_space) { u8 space = (bus_space >> 24) & 0xf; @@ -1194,7 +1178,7 @@ bus_space_to_resource_flags(unsigned int bus_space) } } -static struct resource* __openfirmware +static struct resource* find_parent_pci_resource(struct pci_dev* pdev, struct address_range *range) { unsigned long mask; @@ -1224,7 +1208,7 @@ find_parent_pci_resource(struct pci_dev* pdev, struct address_range *range) * or other nodes attached to the root node. Ultimately, put some * link to resources in the OF node. */ -struct resource* __openfirmware +struct resource* request_OF_resource(struct device_node* node, int index, const char* name_postfix) { struct pci_dev* pcidev; @@ -1280,7 +1264,7 @@ fail: return NULL; } -int __openfirmware +int release_OF_resource(struct device_node* node, int index) { struct pci_dev* pcidev; @@ -1335,10 +1319,8 @@ release_OF_resource(struct device_node* node, int index) if (!res) return -ENODEV; - if (res->name) { - kfree(res->name); - res->name = NULL; - } + kfree(res->name); + res->name = NULL; release_resource(res); kfree(res); @@ -1346,7 +1328,7 @@ release_OF_resource(struct device_node* node, int index) } #if 0 -void __openfirmware +void print_properties(struct device_node *np) { struct property *pp; @@ -1400,7 +1382,7 @@ print_properties(struct device_node *np) static DEFINE_SPINLOCK(rtas_lock); /* this can be called after setup -- Cort */ -int __openfirmware +int call_rtas(const char *service, int nargs, int nret, unsigned long *outputs, ...) {