coreboot_table.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * coreboot_table.h
  3. *
  4. * Internal header for coreboot table access.
  5. *
  6. * Copyright 2017 Google Inc.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License v2.0 as published by
  10. * the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. */
  17. #ifndef __COREBOOT_TABLE_H
  18. #define __COREBOOT_TABLE_H
  19. #include <linux/io.h>
  20. /* List of coreboot entry structures that is used */
  21. struct lb_cbmem_ref {
  22. uint32_t tag;
  23. uint32_t size;
  24. uint64_t cbmem_addr;
  25. };
  26. /* Coreboot table header structure */
  27. struct coreboot_table_header {
  28. char signature[4];
  29. u32 header_bytes;
  30. u32 header_checksum;
  31. u32 table_bytes;
  32. u32 table_checksum;
  33. u32 table_entries;
  34. };
  35. /* Retrieve coreboot table entry with tag *tag* and copy it to data */
  36. int coreboot_table_find(int tag, void *data, size_t data_size);
  37. /* Initialize coreboot table module given a pointer to iomem */
  38. int coreboot_table_init(void __iomem *ptr);
  39. /* Cleanup coreboot table module */
  40. int coreboot_table_exit(void);
  41. #endif /* __COREBOOT_TABLE_H */