usbdebug: Fix reserve in CAR

We need sizeof(struct ehci_dbg_info) of 88 but only
reserved 64 bytes. If usbdebug_hw_init() was called
late in romstage, for some builds it would corrupt
CAR_GLOBALs like console_inited variable and stop
logging anything.

Also change pointer initialisation such that
glob_dbg_info will hit garbage collection for
PRE_RAM stages.

Change-Id: Ib49fca781e55619179aa8888e2d859560e050876
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/31174
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Kyösti Mälkki
2019-01-31 08:29:32 +02:00
parent 909be6a7d8
commit f88208e0ac
3 changed files with 17 additions and 8 deletions

View File

@@ -67,7 +67,8 @@
_car_drivers_storage_end = .;
#endif
_car_ehci_dbg_info_start = .;
. += 64;
/* Reserve sizeof(struct ehci_dbg_info). */
. += 88;
_car_ehci_dbg_info_end = .;
/* _car_global_start and _car_global_end provide symbols to per-stage
* variables that are not shared like the timestamp and the pre-ram

View File

@@ -35,6 +35,9 @@ extern char _car_stack_end[];
#define _car_stack_size (_car_stack_end - _car_stack_start)
extern char _car_ehci_dbg_info_start[];
extern char _car_ehci_dbg_info_end[];
#define _car_ehci_dbg_info_size \
(_car_ehci_dbg_info_end - _car_ehci_dbg_info_start)
/*
* The _car_relocatable_data_[start|end] symbols cover CAR data which is