diff --git a/Targets/Bonito3a780e/Bonito/tgt_machdep.c b/Targets/Bonito3a780e/Bonito/tgt_machdep.c index f6b0945e..7eef41cd 100644 --- a/Targets/Bonito3a780e/Bonito/tgt_machdep.c +++ b/Targets/Bonito3a780e/Bonito/tgt_machdep.c @@ -41,6 +41,7 @@ unsigned int mem_size = 0; #include "../../../pmon/cmds/cmd_main/window.h" #include "../../../pmon/cmds/cmd_main/cmd_main.h" +#include "../../../pmon/common/smbios/smbios.h" // #include @@ -3082,15 +3083,19 @@ struct efi_memory_map_loongson * init_memory_map() emap->map[(entry)].mem_size = (size), \ (entry)++ - EMAP_ENTRY(i, 0, 1, 0x00200000, 0x0ee); + EMAP_ENTRY(i, 0, SYSTEM_RAM_LOW, 0x00200000, 0x0ee); + /* for entry with mem_size < 1M, we set bit31 to 1 to indicate + * that the unit in mem_size is Byte not MBype*/ + EMAP_ENTRY(i, 0, SMBIOS_TABLE, (SMBIOS_PHYSICAL_ADDRESS & 0x0fffffff), + (SMBIOS_SIZE_LIMIT|0x80000000)); if(size < 0x6f000000) - EMAP_ENTRY(i, 0, 2, 0x90000000, size >> 20); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x90000000, size >> 20); /*we waste 16MB here, because 780e TOM is 0xff0000000*/ else if (size > 0x70000000) { - EMAP_ENTRY(i, 0, 2, 0x90000000, 0x6f0); - EMAP_ENTRY(i, 0, 2, 0x100000000, (size - 0x70000000) >> 20); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x90000000, 0x6f0); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x100000000, (size - 0x70000000) >> 20); } else - EMAP_ENTRY(i, 0, 2, 0x90000000, 0x6f0); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x90000000, 0x6f0); diff --git a/Targets/Bonito3aserver/Bonito/tgt_machdep.c b/Targets/Bonito3aserver/Bonito/tgt_machdep.c index 591a5da6..c28ff874 100644 --- a/Targets/Bonito3aserver/Bonito/tgt_machdep.c +++ b/Targets/Bonito3aserver/Bonito/tgt_machdep.c @@ -44,6 +44,7 @@ unsigned int mem_size = 0; #include "../../../pmon/cmds/cmd_main/window.h" #include "../../../pmon/cmds/cmd_main/cmd_main.h" +#include "../../../pmon/common/smbios/smbios.h" // #include @@ -3087,19 +3088,23 @@ struct efi_memory_map_loongson * init_memory_map() emap->map[(entry)].mem_size = (size), \ (entry)++ - EMAP_ENTRY(i, 0, 1, 0x00200000, 0x0ee); + EMAP_ENTRY(i, 0, SYSTEM_RAM_LOW, 0x00200000, 0x0ee); + /* for entry with mem_size < 1M, we set bit31 to 1 to indicate + * that the unit in mem_size is Byte not MBype*/ + EMAP_ENTRY(i, 0, SMBIOS_TABLE, (SMBIOS_PHYSICAL_ADDRESS & 0x0fffffff), + (SMBIOS_SIZE_LIMIT|0x80000000)); if(size < 0x6f000000) - EMAP_ENTRY(i, 0, 2, 0x90000000, size >> 20); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x90000000, size >> 20); /*we waste 16MB here, because 780e TOM is 0xff0000000*/ else if (size > 0x70000000) { - EMAP_ENTRY(i, 0, 2, 0x90000000, 0x6f0); - EMAP_ENTRY(i, 0, 2, 0x100000000, (size - 0x70000000) >> 20); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x90000000, 0x6f0); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x100000000, (size - 0x70000000) >> 20); } else - EMAP_ENTRY(i, 0, 2, 0x90000000, 0x6f0); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x90000000, 0x6f0); if(memorysize_high_n1) { - EMAP_ENTRY(i, 1, 1, 0x100000000000L, 0x100); - EMAP_ENTRY(i, 1, 2, 0x100000000000L + 0x90000000, memorysize_high_n1 >> 20); + EMAP_ENTRY(i, 1, SYSTEM_RAM_LOW, 0x100000000000L, 0x100); + EMAP_ENTRY(i, 1, SYSTEM_RAM_HIGH, 0x100000000000L + 0x90000000, memorysize_high_n1 >> 20); } diff --git a/Targets/Bonito3c780e/Bonito/tgt_machdep.c b/Targets/Bonito3c780e/Bonito/tgt_machdep.c index 34ff8a73..e64e6732 100644 --- a/Targets/Bonito3c780e/Bonito/tgt_machdep.c +++ b/Targets/Bonito3c780e/Bonito/tgt_machdep.c @@ -41,6 +41,7 @@ #include "../../../pmon/cmds/cmd_main/window.h" #include "../../../pmon/cmds/cmd_main/cmd_main.h" +#include "../../../pmon/common/smbios/smbios.h" // #include @@ -3181,19 +3182,23 @@ struct efi_memory_map_loongson * init_memory_map() emap->map[(entry)].mem_size = (size), \ (entry)++ - EMAP_ENTRY(i, 0, 1, 0x00200000, 0x0ee); + EMAP_ENTRY(i, 0, SYSTEM_RAM_LOW, 0x00200000, 0x0ee); + /* for entry with mem_size < 1M, we set bit31 to 1 to indicate + * that the unit in mem_size is Byte not MBype*/ + EMAP_ENTRY(i, 0, SMBIOS_TABLE, (SMBIOS_PHYSICAL_ADDRESS & 0x0fffffff), + (SMBIOS_SIZE_LIMIT|0x80000000)); if(size < 0x6f000000) - EMAP_ENTRY(i, 0, 2, 0x90000000, size >> 20); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x90000000, size >> 20); /*we waste 16MB here, because 780e TOM is 0xff0000000*/ else if (size > 0x70000000) { - EMAP_ENTRY(i, 0, 2, 0x90000000, 0x6f0); - EMAP_ENTRY(i, 0, 2, 0x100000000, (size - 0x70000000) >> 20); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x90000000, 0x6f0); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x100000000, (size - 0x70000000) >> 20); } else - EMAP_ENTRY(i, 0, 2, 0x90000000, 0x6f0); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x90000000, 0x6f0); if(memorysize_high_n1) { - EMAP_ENTRY(i, 1, 1, 0x100000000000L, 0x100); - EMAP_ENTRY(i, 1, 2, 0x100000000000L + 0x90000000, memorysize_high_n1 >> 20); + EMAP_ENTRY(i, 1, SYSTEM_RAM_LOW, 0x100000000000L, 0x100); + EMAP_ENTRY(i, 1, SYSTEM_RAM_HIGH, 0x100000000000L + 0x90000000, memorysize_high_n1 >> 20); } diff --git a/Targets/Bonito3cserver/Bonito/tgt_machdep.c b/Targets/Bonito3cserver/Bonito/tgt_machdep.c index 42cda310..f155a43c 100644 --- a/Targets/Bonito3cserver/Bonito/tgt_machdep.c +++ b/Targets/Bonito3cserver/Bonito/tgt_machdep.c @@ -41,6 +41,7 @@ #include "../../../pmon/cmds/cmd_main/window.h" #include "../../../pmon/cmds/cmd_main/cmd_main.h" +#include "../../../pmon/common/smbios/smbios.h" // #include @@ -3101,27 +3102,31 @@ struct efi_memory_map_loongson * init_memory_map() emap->map[(entry)].mem_size = (size), \ (entry)++ - EMAP_ENTRY(i, 0, 1, 0x00200000, 0x0ee); + EMAP_ENTRY(i, 0, SYSTEM_RAM_LOW, 0x00200000, 0x0ee); + /* for entry with mem_size < 1M, we set bit31 to 1 to indicate + * that the unit in mem_size is Byte not MBype*/ + EMAP_ENTRY(i, 0, SMBIOS_TABLE, (SMBIOS_PHYSICAL_ADDRESS & 0x0fffffff), + (SMBIOS_SIZE_LIMIT|0x80000000)); if(size < 0x6f000000) - EMAP_ENTRY(i, 0, 2, 0x90000000, size >> 20); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x90000000, size >> 20); /*we waste 16MB here, because 780e TOM is 0xff0000000*/ else if (size > 0x70000000) { - EMAP_ENTRY(i, 0, 2, 0x90000000, 0x6f0); - EMAP_ENTRY(i, 0, 2, 0x100000000, (size - 0x70000000) >> 20); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x90000000, 0x6f0); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x100000000, (size - 0x70000000) >> 20); } else - EMAP_ENTRY(i, 0, 2, 0x90000000, 0x6f0); + EMAP_ENTRY(i, 0, SYSTEM_RAM_HIGH, 0x90000000, 0x6f0); if(memorysize_high_n1) { - EMAP_ENTRY(i, 1, 1, 0x100000000000L, 0x100); + EMAP_ENTRY(i, 1, SYSTEM_RAM_LOW, 0x100000000000L, 0x100); EMAP_ENTRY(i, 1, 2, 0x100000000000L + 0x90000000, memorysize_high_n1 >> 20); } if(memorysize_high_n2) { - EMAP_ENTRY(i, 2, 1, 0x200000000000L, 0x100); - EMAP_ENTRY(i, 2, 2, 0x200000000000L + 0x90000000, memorysize_high_n1 >> 20); + EMAP_ENTRY(i, 2, SYSTEM_RAM_LOW, 0x200000000000L, 0x100); + EMAP_ENTRY(i, 2, SYSTEM_RAM_HIGH, 0x200000000000L + 0x90000000, memorysize_high_n1 >> 20); } if(memorysize_high_n3) { - EMAP_ENTRY(i, 3, 1, 0x300000000000L, 0x100); - EMAP_ENTRY(i, 3, 2, 0x300000000000L + 0x90000000, memorysize_high_n1 >> 20); + EMAP_ENTRY(i, 3, SYSTEM_RAM_LOW, 0x300000000000L, 0x100); + EMAP_ENTRY(i, 3, SYSTEM_RAM_HIGH, 0x300000000000L + 0x90000000, memorysize_high_n1 >> 20); } emap->vers = 1;