Graeme Russ | 1bab104 | 2010-04-24 00:05:49 +1000 | [diff] [blame] | 1 | #ifndef _ASM_X86_E820_H |
| 2 | #define _ASM_X86_E820_H |
Graeme Russ | 1bab104 | 2010-04-24 00:05:49 +1000 | [diff] [blame] | 3 | |
Bin Meng | 27947c9 | 2015-04-21 12:21:35 +0800 | [diff] [blame] | 4 | #define E820MAX 128 /* number of entries in E820MAP */ |
Graeme Russ | 1bab104 | 2010-04-24 00:05:49 +1000 | [diff] [blame] | 5 | |
| 6 | #define E820_RAM 1 |
| 7 | #define E820_RESERVED 2 |
| 8 | #define E820_ACPI 3 |
| 9 | #define E820_NVS 4 |
| 10 | #define E820_UNUSABLE 5 |
Simon Glass | aad0d76 | 2020-09-05 14:50:50 -0600 | [diff] [blame] | 11 | #define E820_COUNT 6 /* Number of types */ |
Graeme Russ | 1bab104 | 2010-04-24 00:05:49 +1000 | [diff] [blame] | 12 | |
Graeme Russ | 1bab104 | 2010-04-24 00:05:49 +1000 | [diff] [blame] | 13 | #ifndef __ASSEMBLY__ |
| 14 | #include <linux/types.h> |
Bin Meng | 27947c9 | 2015-04-21 12:21:35 +0800 | [diff] [blame] | 15 | |
Bin Meng | 4b8fc74 | 2018-04-11 22:02:11 -0700 | [diff] [blame] | 16 | struct e820_entry { |
Graeme Russ | 1bab104 | 2010-04-24 00:05:49 +1000 | [diff] [blame] | 17 | __u64 addr; /* start of memory segment */ |
| 18 | __u64 size; /* size of memory segment */ |
| 19 | __u32 type; /* type of memory segment */ |
| 20 | } __attribute__((packed)); |
| 21 | |
Graeme Russ | 1bab104 | 2010-04-24 00:05:49 +1000 | [diff] [blame] | 22 | #define ISA_START_ADDRESS 0xa0000 |
| 23 | #define ISA_END_ADDRESS 0x100000 |
| 24 | |
Simon Glass | 02c5120 | 2021-03-15 18:00:23 +1300 | [diff] [blame] | 25 | /* Implementation-defined function to install an e820 map */ |
Bin Meng | 3838d71 | 2018-04-11 22:02:10 -0700 | [diff] [blame] | 26 | unsigned int install_e820_map(unsigned int max_entries, |
Bin Meng | 4b8fc74 | 2018-04-11 22:02:11 -0700 | [diff] [blame] | 27 | struct e820_entry *); |
Simon Glass | 02c5120 | 2021-03-15 18:00:23 +1300 | [diff] [blame] | 28 | |
| 29 | /** |
| 30 | * cb_install_e820_map() - Install e820 map provided by coreboot sysinfo |
| 31 | * |
| 32 | * This should be used when booting from coreboot, since in that case the |
| 33 | * memory areas are provided by coreboot in its sysinfo. |
| 34 | * |
| 35 | * @max_entries: Maximum number of entries to write |
| 36 | * @entries: Place to put entires |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 37 | * Return: number of entries written |
Simon Glass | 02c5120 | 2021-03-15 18:00:23 +1300 | [diff] [blame] | 38 | */ |
| 39 | unsigned int cb_install_e820_map(unsigned int max_entries, |
| 40 | struct e820_entry *entries); |
| 41 | |
Simon Glass | dd23446 | 2020-09-22 12:45:29 -0600 | [diff] [blame] | 42 | #endif /* __ASSEMBLY__ */ |
Bin Meng | a489963 | 2015-10-07 20:19:10 -0700 | [diff] [blame] | 43 | |
Graeme Russ | 1bab104 | 2010-04-24 00:05:49 +1000 | [diff] [blame] | 44 | #endif /* _ASM_X86_E820_H */ |