Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _PPC_BOOT_OF_H_
0003 #define _PPC_BOOT_OF_H_
0004 
0005 #include "swab.h"
0006 
0007 typedef void *phandle;
0008 typedef u32 ihandle;
0009 
0010 void of_init(void *promptr);
0011 int of_call_prom(const char *service, int nargs, int nret, ...);
0012 unsigned int of_claim(unsigned long virt, unsigned long size,
0013     unsigned long align);
0014 void *of_vmlinux_alloc(unsigned long size);
0015 void of_exit(void);
0016 void *of_finddevice(const char *name);
0017 int of_getprop(const void *phandle, const char *name, void *buf,
0018            const int buflen);
0019 int of_setprop(const void *phandle, const char *name, const void *buf,
0020            const int buflen);
0021 
0022 /* Console functions */
0023 void of_console_init(void);
0024 
0025 typedef u16         __be16;
0026 typedef u32         __be32;
0027 typedef u64         __be64;
0028 
0029 #ifdef __LITTLE_ENDIAN__
0030 #define cpu_to_be16(x) swab16(x)
0031 #define be16_to_cpu(x) swab16(x)
0032 #define cpu_to_be32(x) swab32(x)
0033 #define be32_to_cpu(x) swab32(x)
0034 #define cpu_to_be64(x) swab64(x)
0035 #define be64_to_cpu(x) swab64(x)
0036 #else
0037 #define cpu_to_be16(x) (x)
0038 #define be16_to_cpu(x) (x)
0039 #define cpu_to_be32(x) (x)
0040 #define be32_to_cpu(x) (x)
0041 #define cpu_to_be64(x) (x)
0042 #define be64_to_cpu(x) (x)
0043 #endif
0044 
0045 #define PROM_ERROR (-1u)
0046 
0047 #endif /* _PPC_BOOT_OF_H_ */