ARMv7: Fix location of CBMEM console in romstage
The CBMEM console pointer in romstage is actually a zero byte array. This means CBMEM area has to live at the end of the allocations or else CBMEM console will overwrite whatever comes after it. Change-Id: Icc59e982b724a2d396370c3a5abd8898e08baf26 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: https://gerrit.chromium.org/gerrit/63997 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Commit-Queue: Stefan Reinauer <reinauer@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-on: http://review.coreboot.org/4428 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
parent
1f9f04e571
commit
fffbda5897
|
@ -60,19 +60,6 @@ SECTIONS
|
||||||
_erom = .;
|
_erom = .;
|
||||||
}
|
}
|
||||||
|
|
||||||
.car.data . (NOLOAD) : {
|
|
||||||
_car_data_start = .;
|
|
||||||
*(.car.global_data);
|
|
||||||
/* The cbmem_console section comes last to take advantage of
|
|
||||||
* a zero-sized array to hold the memconsole contents that
|
|
||||||
* grows to a bound of CONFIG_CONSOLE_CAR_BUFFER_SIZE. However,
|
|
||||||
* collisions within the cache-as-ram region cannot be
|
|
||||||
* statically checked because the cache-as-ram region usage is
|
|
||||||
* cpu/chipset dependent. */
|
|
||||||
*(.car.cbmem_console);
|
|
||||||
_car_data_end = .;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* bss does not contain data, it is just a space that should be zero
|
/* bss does not contain data, it is just a space that should be zero
|
||||||
* initialized on startup. (typically uninitialized global variables)
|
* initialized on startup. (typically uninitialized global variables)
|
||||||
* crt0.S fills between _bss and _ebss with zeroes.
|
* crt0.S fills between _bss and _ebss with zeroes.
|
||||||
|
@ -84,9 +71,35 @@ SECTIONS
|
||||||
*(.sbss)
|
*(.sbss)
|
||||||
*(COMMON)
|
*(COMMON)
|
||||||
}
|
}
|
||||||
|
|
||||||
_ebss = .;
|
_ebss = .;
|
||||||
|
|
||||||
|
.car.data . (NOLOAD) : {
|
||||||
|
. = ALIGN(8);
|
||||||
|
_car_data_start = .;
|
||||||
|
*(.car.global_data);
|
||||||
|
. = ALIGN(8);
|
||||||
|
/* The cbmem_console section comes last to take advantage of
|
||||||
|
* a zero-sized array to hold the memconsole contents that
|
||||||
|
* grows to a bound of CONFIG_CONSOLE_CAR_BUFFER_SIZE. However,
|
||||||
|
* collisions within the cache-as-ram region cannot be
|
||||||
|
* statically checked because the cache-as-ram region usage is
|
||||||
|
* cpu/chipset dependent. */
|
||||||
|
*(.car.cbmem_console);
|
||||||
|
_car_data_end = .;
|
||||||
|
}
|
||||||
|
|
||||||
_end = .;
|
_end = .;
|
||||||
|
|
||||||
|
/* TODO: check if we are running out of SRAM. Below check is not good
|
||||||
|
* enough though because SRAM has different size on different CPUs
|
||||||
|
* and not all SRAM is available to the romstage. On Exynos, some is
|
||||||
|
* used for BL1, the bootblock and the stack.
|
||||||
|
*
|
||||||
|
* _bogus = ASSERT((_end - _start + EXPECTED_CBMEM_CONSOLE_SIZE <= \
|
||||||
|
* 0x54000), "SRAM area is too full");
|
||||||
|
*/
|
||||||
|
|
||||||
/* Discard the sections we don't need/want */
|
/* Discard the sections we don't need/want */
|
||||||
/DISCARD/ : {
|
/DISCARD/ : {
|
||||||
*(.comment)
|
*(.comment)
|
||||||
|
|
Loading…
Reference in New Issue