diff options
Diffstat (limited to 'arch/powerpc/boot/ops.h')
-rw-r--r-- | arch/powerpc/boot/ops.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h index 86077066cd7c..a180b6505f47 100644 --- a/arch/powerpc/boot/ops.h +++ b/arch/powerpc/boot/ops.h | |||
@@ -47,6 +47,7 @@ struct dt_ops { | |||
47 | const char *propname, | 47 | const char *propname, |
48 | const char *propval, int proplen); | 48 | const char *propval, int proplen); |
49 | unsigned long (*finalize)(void); | 49 | unsigned long (*finalize)(void); |
50 | char *(*get_path)(const void *phandle, char *buf, int len); | ||
50 | }; | 51 | }; |
51 | extern struct dt_ops dt_ops; | 52 | extern struct dt_ops dt_ops; |
52 | 53 | ||
@@ -82,11 +83,16 @@ int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device); | |||
82 | int serial_console_init(void); | 83 | int serial_console_init(void); |
83 | int ns16550_console_init(void *devp, struct serial_console_data *scdp); | 84 | int ns16550_console_init(void *devp, struct serial_console_data *scdp); |
84 | int mpsc_console_init(void *devp, struct serial_console_data *scdp); | 85 | int mpsc_console_init(void *devp, struct serial_console_data *scdp); |
86 | int cpm_console_init(void *devp, struct serial_console_data *scdp); | ||
87 | int mpc5200_psc_console_init(void *devp, struct serial_console_data *scdp); | ||
88 | int uartlite_console_init(void *devp, struct serial_console_data *scdp); | ||
85 | void *simple_alloc_init(char *base, unsigned long heap_size, | 89 | void *simple_alloc_init(char *base, unsigned long heap_size, |
86 | unsigned long granularity, unsigned long max_allocs); | 90 | unsigned long granularity, unsigned long max_allocs); |
87 | extern void flush_cache(void *, unsigned long); | 91 | extern void flush_cache(void *, unsigned long); |
88 | int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size); | 92 | int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size); |
89 | int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr); | 93 | int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr); |
94 | int dt_is_compatible(void *node, const char *compat); | ||
95 | void dt_get_reg_format(void *node, u32 *naddr, u32 *nsize); | ||
90 | 96 | ||
91 | static inline void *finddevice(const char *name) | 97 | static inline void *finddevice(const char *name) |
92 | { | 98 | { |
@@ -156,6 +162,7 @@ static inline void *find_node_by_devtype(const void *prev, | |||
156 | void dt_fixup_memory(u64 start, u64 size); | 162 | void dt_fixup_memory(u64 start, u64 size); |
157 | void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq); | 163 | void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq); |
158 | void dt_fixup_clock(const char *path, u32 freq); | 164 | void dt_fixup_clock(const char *path, u32 freq); |
165 | void dt_fixup_mac_address(u32 index, const u8 *addr); | ||
159 | void __dt_fixup_mac_addresses(u32 startindex, ...); | 166 | void __dt_fixup_mac_addresses(u32 startindex, ...); |
160 | #define dt_fixup_mac_addresses(...) \ | 167 | #define dt_fixup_mac_addresses(...) \ |
161 | __dt_fixup_mac_addresses(0, __VA_ARGS__, NULL) | 168 | __dt_fixup_mac_addresses(0, __VA_ARGS__, NULL) |
@@ -167,6 +174,14 @@ static inline void *find_node_by_linuxphandle(const u32 linuxphandle) | |||
167 | (char *)&linuxphandle, sizeof(u32)); | 174 | (char *)&linuxphandle, sizeof(u32)); |
168 | } | 175 | } |
169 | 176 | ||
177 | static inline char *get_path(const void *phandle, char *buf, int len) | ||
178 | { | ||
179 | if (dt_ops.get_path) | ||
180 | return dt_ops.get_path(phandle, buf, len); | ||
181 | |||
182 | return NULL; | ||
183 | } | ||
184 | |||
170 | static inline void *malloc(unsigned long size) | 185 | static inline void *malloc(unsigned long size) |
171 | { | 186 | { |
172 | return (platform_ops.malloc) ? platform_ops.malloc(size) : NULL; | 187 | return (platform_ops.malloc) ? platform_ops.malloc(size) : NULL; |
@@ -191,4 +206,25 @@ static inline void exit(void) | |||
191 | static char _bss_stack[size]; \ | 206 | static char _bss_stack[size]; \ |
192 | void *_platform_stack_top = _bss_stack + sizeof(_bss_stack); | 207 | void *_platform_stack_top = _bss_stack + sizeof(_bss_stack); |
193 | 208 | ||
209 | extern unsigned long timebase_period_ns; | ||
210 | void udelay(long delay); | ||
211 | |||
212 | extern char _start[]; | ||
213 | extern char __bss_start[]; | ||
214 | extern char _end[]; | ||
215 | extern char _vmlinux_start[]; | ||
216 | extern char _vmlinux_end[]; | ||
217 | extern char _initrd_start[]; | ||
218 | extern char _initrd_end[]; | ||
219 | extern char _dtb_start[]; | ||
220 | extern char _dtb_end[]; | ||
221 | |||
222 | static inline __attribute__((const)) | ||
223 | int __ilog2_u32(u32 n) | ||
224 | { | ||
225 | int bit; | ||
226 | asm ("cntlzw %0,%1" : "=r" (bit) : "r" (n)); | ||
227 | return 31 - bit; | ||
228 | } | ||
229 | |||
194 | #endif /* _PPC_BOOT_OPS_H_ */ | 230 | #endif /* _PPC_BOOT_OPS_H_ */ |