Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_X86_OLPC_OFW_H
0003 #define _ASM_X86_OLPC_OFW_H
0004 
0005 /* index into the page table containing the entry OFW occupies */
0006 #define OLPC_OFW_PDE_NR 1022
0007 
0008 #define OLPC_OFW_SIG 0x2057464F /* aka "OFW " */
0009 
0010 #ifdef CONFIG_OLPC
0011 
0012 extern bool olpc_ofw_is_installed(void);
0013 
0014 /* run an OFW command by calling into the firmware */
0015 #define olpc_ofw(name, args, res) \
0016     __olpc_ofw((name), ARRAY_SIZE(args), args, ARRAY_SIZE(res), res)
0017 
0018 extern int __olpc_ofw(const char *name, int nr_args, const void **args, int nr_res,
0019         void **res);
0020 
0021 /* determine whether OFW is available and lives in the proper memory */
0022 extern void olpc_ofw_detect(void);
0023 
0024 /* install OFW's pde permanently into the kernel's pgtable */
0025 extern void setup_olpc_ofw_pgd(void);
0026 
0027 /* check if OFW was detected during boot */
0028 extern bool olpc_ofw_present(void);
0029 
0030 extern void olpc_dt_build_devicetree(void);
0031 
0032 #else /* !CONFIG_OLPC */
0033 static inline void olpc_ofw_detect(void) { }
0034 static inline void setup_olpc_ofw_pgd(void) { }
0035 static inline void olpc_dt_build_devicetree(void) { }
0036 #endif /* !CONFIG_OLPC */
0037 
0038 #endif /* _ASM_X86_OLPC_OFW_H */