aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/ops.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/boot/ops.h')
-rw-r--r--arch/powerpc/boot/ops.h36
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};
51extern struct dt_ops dt_ops; 52extern 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);
82int serial_console_init(void); 83int serial_console_init(void);
83int ns16550_console_init(void *devp, struct serial_console_data *scdp); 84int ns16550_console_init(void *devp, struct serial_console_data *scdp);
84int mpsc_console_init(void *devp, struct serial_console_data *scdp); 85int mpsc_console_init(void *devp, struct serial_console_data *scdp);
86int cpm_console_init(void *devp, struct serial_console_data *scdp);
87int mpc5200_psc_console_init(void *devp, struct serial_console_data *scdp);
88int uartlite_console_init(void *devp, struct serial_console_data *scdp);
85void *simple_alloc_init(char *base, unsigned long heap_size, 89void *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);
87extern void flush_cache(void *, unsigned long); 91extern void flush_cache(void *, unsigned long);
88int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size); 92int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size);
89int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr); 93int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr);
94int dt_is_compatible(void *node, const char *compat);
95void dt_get_reg_format(void *node, u32 *naddr, u32 *nsize);
90 96
91static inline void *finddevice(const char *name) 97static inline void *finddevice(const char *name)
92{ 98{
@@ -156,6 +162,7 @@ static inline void *find_node_by_devtype(const void *prev,
156void dt_fixup_memory(u64 start, u64 size); 162void dt_fixup_memory(u64 start, u64 size);
157void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq); 163void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq);
158void dt_fixup_clock(const char *path, u32 freq); 164void dt_fixup_clock(const char *path, u32 freq);
165void dt_fixup_mac_address(u32 index, const u8 *addr);
159void __dt_fixup_mac_addresses(u32 startindex, ...); 166void __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
177static 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
170static inline void *malloc(unsigned long size) 185static 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
209extern unsigned long timebase_period_ns;
210void udelay(long delay);
211
212extern char _start[];
213extern char __bss_start[];
214extern char _end[];
215extern char _vmlinux_start[];
216extern char _vmlinux_end[];
217extern char _initrd_start[];
218extern char _initrd_end[];
219extern char _dtb_start[];
220extern char _dtb_end[];
221
222static inline __attribute__((const))
223int __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_ */