Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
19ebec9f
Commit
19ebec9f
authored
Aug 24, 2021
by
André Przywara
Committed by
TrustedFirmware Code Review
Aug 24, 2021
Browse files
Merge "fix(rpi4): drop /memreserve/ region" into integration
parents
acfe3be2
5d2793a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
plat/rpi/rpi4/rpi4_bl31_setup.c
View file @
19ebec9f
...
...
@@ -201,6 +201,44 @@ void bl31_plat_arch_setup(void)
enable_mmu_el3
(
0
);
}
/*
* Remove the FDT /memreserve/ entry that covers the region at the very
* beginning of memory (if that exists). This is where the secondaries
* originally spin, but we pull them out there.
* Having overlapping /reserved-memory and /memreserve/ regions confuses
* the Linux kernel, so we need to get rid of this one.
*/
static
void
remove_spintable_memreserve
(
void
*
dtb
)
{
uint64_t
addr
,
size
;
int
regions
=
fdt_num_mem_rsv
(
dtb
);
int
i
;
for
(
i
=
0
;
i
<
regions
;
i
++
)
{
if
(
fdt_get_mem_rsv
(
dtb
,
i
,
&
addr
,
&
size
)
!=
0
)
{
return
;
}
if
(
size
==
0U
)
{
return
;
}
/* We only look for the region at the beginning of DRAM. */
if
(
addr
!=
0U
)
{
continue
;
}
/*
* Currently the region in the existing DTs is exactly 4K
* in size. Should this value ever change, there is probably
* a reason for that, so inform the user about this.
*/
if
(
size
==
4096U
)
{
fdt_del_mem_rsv
(
dtb
,
i
);
return
;
}
WARN
(
"Keeping unknown /memreserve/ region at 0, size: %lld
\n
"
,
size
);
}
}
static
void
rpi4_prepare_dtb
(
void
)
{
void
*
dtb
=
(
void
*
)
rpi4_get_dtb_address
();
...
...
@@ -227,7 +265,11 @@ static void rpi4_prepare_dtb(void)
return
;
}
/* Reserve memory used by Trusted Firmware. */
/*
* Remove the original reserved region (used for the spintable), and
* replace it with a region describing the whole of Trusted Firmware.
*/
remove_spintable_memreserve
(
dtb
);
if
(
fdt_add_reserved_memory
(
dtb
,
"atf@0"
,
0
,
0x80000
))
WARN
(
"Failed to add reserved memory nodes to DT.
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment