Browse Source

smbios: add smbios to emap

In this commit, when we pass emap entry with mem_size < 1MB, we set bit31 to 1
in mem_size to indicate the value in bit30~bit0 is Byte in unit, not MByte
master
huang pei 11 years ago
committed by wanghongmei
parent
commit
8fcccaa7e4
  1. 15
      Targets/Bonito3a780e/Bonito/tgt_machdep.c
  2. 19
      Targets/Bonito3aserver/Bonito/tgt_machdep.c
  3. 19
      Targets/Bonito3c780e/Bonito/tgt_machdep.c
  4. 25
      Targets/Bonito3cserver/Bonito/tgt_machdep.c

15
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 <sys/ioccom.h>
@ -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);

19
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 <sys/ioccom.h>
@ -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);
}

19
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 <sys/ioccom.h>
@ -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);
}

25
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 <sys/ioccom.h>
@ -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;

Loading…
Cancel
Save