olpc_ofw.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_X86_OLPC_OFW_H
  3. #define _ASM_X86_OLPC_OFW_H
  4. /* index into the page table containing the entry OFW occupies */
  5. #define OLPC_OFW_PDE_NR 1022
  6. #define OLPC_OFW_SIG 0x2057464F /* aka "OFW " */
  7. #ifdef CONFIG_OLPC
  8. extern bool olpc_ofw_is_installed(void);
  9. /* run an OFW command by calling into the firmware */
  10. #define olpc_ofw(name, args, res) \
  11. __olpc_ofw((name), ARRAY_SIZE(args), args, ARRAY_SIZE(res), res)
  12. extern int __olpc_ofw(const char *name, int nr_args, const void **args, int nr_res,
  13. void **res);
  14. /* determine whether OFW is available and lives in the proper memory */
  15. extern void olpc_ofw_detect(void);
  16. /* install OFW's pde permanently into the kernel's pgtable */
  17. extern void setup_olpc_ofw_pgd(void);
  18. /* check if OFW was detected during boot */
  19. extern bool olpc_ofw_present(void);
  20. extern void olpc_dt_build_devicetree(void);
  21. #else /* !CONFIG_OLPC */
  22. static inline void olpc_ofw_detect(void) { }
  23. static inline void setup_olpc_ofw_pgd(void) { }
  24. static inline void olpc_dt_build_devicetree(void) { }
  25. #endif /* !CONFIG_OLPC */
  26. #endif /* _ASM_X86_OLPC_OFW_H */