mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-19 02:54:24 +00:00
Merge "fix(gpt): fix RME GPT library bug" into integration
This commit is contained in:
commit
85b9401bc0
1 changed files with 12 additions and 6 deletions
|
@ -700,8 +700,8 @@ static uintptr_t get_l1_end_pa(uintptr_t cur_pa, uintptr_t end_pa)
|
||||||
* Return
|
* Return
|
||||||
* Address of next granule in range.
|
* Address of next granule in range.
|
||||||
*/
|
*/
|
||||||
static uintptr_t fill_l1_cont_desc(uint64_t *l1, uintptr_t first,
|
__unused static uintptr_t fill_l1_cont_desc(uint64_t *l1, uintptr_t first,
|
||||||
size_t length, unsigned int gpi)
|
size_t length, unsigned int gpi)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Look up table for contiguous blocks and descriptors.
|
* Look up table for contiguous blocks and descriptors.
|
||||||
|
@ -826,8 +826,10 @@ static uintptr_t fill_l1_gran_desc(uint64_t *l1, uintptr_t first,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Helper function to fill out GPI entries in a single L1 table.
|
* Helper function to fill out GPI entries in a single L1 table.
|
||||||
* This function fills out an entire L1 table with either Contiguous
|
* This function fills out an entire L1 table with either Granules or Contiguous
|
||||||
* or Granules descriptors depending on region length and alignment.
|
* (RME_GPT_MAX_BLOCK != 0) descriptors depending on region length and alignment.
|
||||||
|
* Note. If RME_GPT_MAX_BLOCK == 0, then the L1 tables are filled with regular
|
||||||
|
* Granules descriptors.
|
||||||
*
|
*
|
||||||
* Parameters
|
* Parameters
|
||||||
* l1 Pointer to L1 table to fill out
|
* l1 Pointer to L1 table to fill out
|
||||||
|
@ -844,13 +846,14 @@ static void fill_l1_tbl(uint64_t *l1, uintptr_t first, uintptr_t last,
|
||||||
assert((last & (GPT_PGS_ACTUAL_SIZE(gpt_config.p) - 1UL)) == 0UL);
|
assert((last & (GPT_PGS_ACTUAL_SIZE(gpt_config.p) - 1UL)) == 0UL);
|
||||||
assert(GPT_L0_IDX(first) == GPT_L0_IDX(last));
|
assert(GPT_L0_IDX(first) == GPT_L0_IDX(last));
|
||||||
|
|
||||||
|
#if (RME_GPT_MAX_BLOCK != 0)
|
||||||
while (first < last) {
|
while (first < last) {
|
||||||
/* Region length */
|
/* Region length */
|
||||||
size_t length = last - first + GPT_PGS_ACTUAL_SIZE(gpt_config.p);
|
size_t length = last - first + GPT_PGS_ACTUAL_SIZE(gpt_config.p);
|
||||||
|
|
||||||
if (length < SZ_2M) {
|
if (length < SZ_2M) {
|
||||||
/*
|
/*
|
||||||
* Fill with Granule descriptor in case of
|
* Fill with Granule descriptors in case of
|
||||||
* region length < 2MB.
|
* region length < 2MB.
|
||||||
*/
|
*/
|
||||||
first = fill_l1_gran_desc(l1, first, last, gpi);
|
first = fill_l1_gran_desc(l1, first, last, gpi);
|
||||||
|
@ -874,7 +877,10 @@ static void fill_l1_tbl(uint64_t *l1, uintptr_t first, uintptr_t last,
|
||||||
first = fill_l1_gran_desc(l1, first, new_last, gpi);
|
first = fill_l1_gran_desc(l1, first, new_last, gpi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
/* Fill with Granule descriptors */
|
||||||
|
first = fill_l1_gran_desc(l1, first, last, gpi);
|
||||||
|
#endif
|
||||||
assert(first == (last + GPT_PGS_ACTUAL_SIZE(gpt_config.p)));
|
assert(first == (last + GPT_PGS_ACTUAL_SIZE(gpt_config.p)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue