aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/ops.h
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2007-08-20 13:40:02 -0400
committerPaul Mackerras <paulus@samba.org>2007-08-22 01:37:09 -0400
commite5d8d54db25790524da34b0143f4e0176fb7677b (patch)
tree5424562c9dd166eadd10b58d38ea9b3ce1a68ae0 /arch/powerpc/boot/ops.h
parent0b195812dfbccc2ac33e17b35b899dd4fea7611f (diff)
[POWERPC] bootwrapper: Add PowerQUICC II (82xx with CPM) cuboot support
This allows booting on legacy, non-device-tree aware versions of U-boot. It also fixes up the hardware to match the PCI and chipselect information in the device tree, as u-boot is inconsistent in setting these up correctly (or at all). Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot/ops.h')
-rw-r--r--arch/powerpc/boot/ops.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h
index e4b6139d2d6e..45c2268d5c56 100644
--- a/arch/powerpc/boot/ops.h
+++ b/arch/powerpc/boot/ops.h
@@ -89,6 +89,7 @@ extern void flush_cache(void *, unsigned long);
89int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size); 89int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size);
90int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr); 90int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr);
91int dt_is_compatible(void *node, const char *compat); 91int dt_is_compatible(void *node, const char *compat);
92void dt_get_reg_format(void *node, u32 *naddr, u32 *nsize);
92 93
93static inline void *finddevice(const char *name) 94static inline void *finddevice(const char *name)
94{ 95{
@@ -206,4 +207,12 @@ extern char _initrd_end[];
206extern char _dtb_start[]; 207extern char _dtb_start[];
207extern char _dtb_end[]; 208extern char _dtb_end[];
208 209
210static inline __attribute__((const))
211int __ilog2_u32(u32 n)
212{
213 int bit;
214 asm ("cntlzw %0,%1" : "=r" (bit) : "r" (n));
215 return 31 - bit;
216}
217
209#endif /* _PPC_BOOT_OPS_H_ */ 218#endif /* _PPC_BOOT_OPS_H_ */