aarch64: remove bogus os_border calculation
The artificial "os_border" doesn't exist in aarch64 state and is wrong for aarch32 state as well. Remove it. Change-Id: I7c673a1404b03aa78dbd505e115fa3a93f7ca05f Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
This commit is contained in:
parent
b69750fd0d
commit
40ce7374d3
|
@ -441,7 +441,7 @@ done:
|
|||
return retval;
|
||||
}
|
||||
|
||||
static int armv8_read_ttbcr(struct target *target)
|
||||
static __unused int armv8_read_ttbcr(struct target *target)
|
||||
{
|
||||
struct armv8_common *armv8 = target_to_armv8(target);
|
||||
struct arm_dpm *dpm = armv8->arm.dpm;
|
||||
|
@ -511,48 +511,18 @@ static int armv8_read_ttbcr(struct target *target)
|
|||
if (retval != ERROR_OK)
|
||||
goto done;
|
||||
|
||||
#if 0
|
||||
LOG_INFO("ttb1 %s ,ttb0_mask %llx",
|
||||
armv8->armv8_mmu.ttbr1_used ? "used" : "not used",
|
||||
armv8->armv8_mmu.ttbr0_mask);
|
||||
#endif
|
||||
if (armv8->armv8_mmu.ttbr1_used == 1) {
|
||||
LOG_INFO("TTBR0 access above %" PRIx64,
|
||||
(uint64_t)(armv8->armv8_mmu.ttbr0_mask));
|
||||
armv8->armv8_mmu.os_border = armv8->armv8_mmu.ttbr0_mask;
|
||||
} else {
|
||||
/* fix me , default is hard coded LINUX border */
|
||||
armv8->armv8_mmu.os_border = 0xc0000000;
|
||||
}
|
||||
if (armv8->armv8_mmu.ttbr1_used == 1)
|
||||
LOG_INFO("TTBR0 access above %" PRIx64, (uint64_t)(armv8->armv8_mmu.ttbr0_mask));
|
||||
|
||||
done:
|
||||
dpm->finish(dpm);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int armv8_4K_translate(struct target *target, target_addr_t va, target_addr_t *val)
|
||||
{
|
||||
LOG_ERROR("4K page Address translation need to add");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
|
||||
/* method adapted to cortex A : reused arm v4 v5 method*/
|
||||
int armv8_mmu_translate_va(struct target *target, target_addr_t va, target_addr_t *val)
|
||||
{
|
||||
int retval = ERROR_FAIL;
|
||||
struct armv8_common *armv8 = target_to_armv8(target);
|
||||
struct arm_dpm *dpm = armv8->arm.dpm;
|
||||
|
||||
retval = dpm->prepare(dpm);
|
||||
retval += armv8_read_ttbcr(target);
|
||||
if (retval != ERROR_OK)
|
||||
goto done;
|
||||
if (armv8->page_size == 0)
|
||||
return armv8_4K_translate(target, va, val);
|
||||
|
||||
done:
|
||||
dpm->finish(dpm);
|
||||
return ERROR_FAIL;
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
/* V8 method VA TO PA */
|
||||
|
|
|
@ -124,7 +124,6 @@ struct armv8_mmu_common {
|
|||
/* following field mmu working way */
|
||||
int32_t ttbr1_used; /* -1 not initialized, 0 no ttbr1 1 ttbr1 used and */
|
||||
uint64_t ttbr0_mask;/* masked to be used */
|
||||
uint32_t os_border;
|
||||
|
||||
uint32_t ttbcr; /* cache for ttbcr register */
|
||||
uint32_t ttbr_mask[2];
|
||||
|
|
Loading…
Reference in New Issue