X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=arch%2Fpowerpc%2Fboot%2Fops.h;h=321e2f5afe714007443e4c8a39bad2f011c7e04e;hb=2be508d847392e431759e370d21cea9412848758;hp=a180b6505f477c8e1422be0ba64eadeeed1d5ff5;hpb=dcf397f037f52add9945eced57ca300ab6a4413c;p=linux-2.6-omap-h63xx.git diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h index a180b6505f4..321e2f5afe7 100644 --- a/arch/powerpc/boot/ops.h +++ b/arch/powerpc/boot/ops.h @@ -46,6 +46,8 @@ struct dt_ops { void *(*find_node_by_prop_value)(const void *prev, const char *propname, const char *propval, int proplen); + void *(*find_node_by_compatible)(const void *prev, + const char *compat); unsigned long (*finalize)(void); char *(*get_path)(const void *phandle, char *buf, int len); }; @@ -79,7 +81,7 @@ struct loader_info { extern struct loader_info loader_info; void start(void); -int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device); +void fdt_init(void *blob); int serial_console_init(void); int ns16550_console_init(void *devp, struct serial_console_data *scdp); int mpsc_console_init(void *devp, struct serial_console_data *scdp); @@ -93,6 +95,7 @@ int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size); int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr); int dt_is_compatible(void *node, const char *compat); void dt_get_reg_format(void *node, u32 *naddr, u32 *nsize); +int dt_get_virtual_reg(void *node, void **addr, int nres); static inline void *finddevice(const char *name) { @@ -159,9 +162,32 @@ static inline void *find_node_by_devtype(const void *prev, return find_node_by_prop_value_str(prev, "device_type", type); } +static inline void *find_node_by_alias(const char *alias) +{ + void *devp = finddevice("/aliases"); + + if (devp) { + char path[MAX_PATH_LEN]; + if (getprop(devp, alias, path, MAX_PATH_LEN) > 0) + return finddevice(path); + } + + return NULL; +} + +static inline void *find_node_by_compatible(const void *prev, + const char *compat) +{ + if (dt_ops.find_node_by_compatible) + return dt_ops.find_node_by_compatible(prev, compat); + + return NULL; +} + void dt_fixup_memory(u64 start, u64 size); void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq); void dt_fixup_clock(const char *path, u32 freq); +void dt_fixup_mac_address_by_alias(const char *alias, const u8 *addr); void dt_fixup_mac_address(u32 index, const u8 *addr); void __dt_fixup_mac_addresses(u32 startindex, ...); #define dt_fixup_mac_addresses(...) \