From e5d8d54db25790524da34b0143f4e0176fb7677b Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Tue, 21 Aug 2007 03:40:02 +1000 Subject: [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 Acked-by: David Gibson Signed-off-by: Paul Mackerras --- arch/powerpc/boot/ops.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'arch/powerpc/boot/ops.h') diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h index e4b6139d2d6..45c2268d5c5 100644 --- a/arch/powerpc/boot/ops.h +++ b/arch/powerpc/boot/ops.h @@ -89,6 +89,7 @@ extern void flush_cache(void *, unsigned long); 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); static inline void *finddevice(const char *name) { @@ -206,4 +207,12 @@ extern char _initrd_end[]; extern char _dtb_start[]; extern char _dtb_end[]; +static inline __attribute__((const)) +int __ilog2_u32(u32 n) +{ + int bit; + asm ("cntlzw %0,%1" : "=r" (bit) : "r" (n)); + return 31 - bit; +} + #endif /* _PPC_BOOT_OPS_H_ */ -- cgit v1.2.3