x86: Update mtrr command to support 64-bit values
The MTRR registers have 64-bit values. Update the command to use 64-bit values so that memory larger than 4GB can be handled. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
static int do_mtrr_set(int cpu_select, uint reg, int argc, char *const argv[])
|
static int do_mtrr_set(int cpu_select, uint reg, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
const char *typename = argv[0];
|
const char *typename = argv[0];
|
||||||
uint32_t start, size;
|
u64 start, size;
|
||||||
u64 base, mask;
|
u64 base, mask;
|
||||||
int type = -1;
|
int type = -1;
|
||||||
bool valid;
|
bool valid;
|
||||||
@@ -26,8 +26,8 @@ static int do_mtrr_set(int cpu_select, uint reg, int argc, char *const argv[])
|
|||||||
printf("Invalid type name %s\n", typename);
|
printf("Invalid type name %s\n", typename);
|
||||||
return CMD_RET_USAGE;
|
return CMD_RET_USAGE;
|
||||||
}
|
}
|
||||||
start = hextoul(argv[1], NULL);
|
start = hextoull(argv[1], NULL);
|
||||||
size = hextoul(argv[2], NULL);
|
size = hextoull(argv[2], NULL);
|
||||||
|
|
||||||
base = start | type;
|
base = start | type;
|
||||||
valid = native_read_msr(MTRR_PHYS_MASK_MSR(reg)) & MTRR_PHYS_MASK_VALID;
|
valid = native_read_msr(MTRR_PHYS_MASK_MSR(reg)) & MTRR_PHYS_MASK_VALID;
|
||||||
|
|||||||
Reference in New Issue
Block a user