src/: Replace some __PRE_RAM__ use
Change-Id: Iaa56e7b98aad33eeb876edd7465c56c80fd1ac18 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35398 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
4a637802fa
commit
e3acc8fcf3
|
@ -22,11 +22,7 @@
|
||||||
#include <version.h>
|
#include <version.h>
|
||||||
|
|
||||||
/* Mutable console log level only allowed when RAM comes online. */
|
/* Mutable console log level only allowed when RAM comes online. */
|
||||||
#if defined(__PRE_RAM__)
|
#define CONSOLE_LEVEL_CONST !ENV_STAGE_HAS_DATA_SECTION
|
||||||
#define CONSOLE_LEVEL_CONST 1
|
|
||||||
#else
|
|
||||||
#define CONSOLE_LEVEL_CONST 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int console_inited CAR_GLOBAL;
|
static int console_inited CAR_GLOBAL;
|
||||||
static int console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
|
static int console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
|
||||||
|
|
|
@ -31,7 +31,6 @@ pci_devfn_t pci_ehci_dbg_dev(unsigned int hcd_idx);
|
||||||
u8 *pci_ehci_base_regs(pci_devfn_t dev);
|
u8 *pci_ehci_base_regs(pci_devfn_t dev);
|
||||||
void pci_ehci_dbg_set_port(pci_devfn_t dev, unsigned int port);
|
void pci_ehci_dbg_set_port(pci_devfn_t dev, unsigned int port);
|
||||||
|
|
||||||
#ifndef __PRE_RAM__
|
|
||||||
#if !CONFIG(USBDEBUG)
|
#if !CONFIG(USBDEBUG)
|
||||||
#define pci_ehci_read_resources pci_dev_read_resources
|
#define pci_ehci_read_resources pci_dev_read_resources
|
||||||
#else
|
#else
|
||||||
|
@ -46,6 +45,5 @@ void pci_ehci_dbg_set_port(pci_devfn_t dev, unsigned int port);
|
||||||
struct device;
|
struct device;
|
||||||
void pci_ehci_read_resources(struct device *dev);
|
void pci_ehci_read_resources(struct device *dev);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _PCI_EHCI_H_ */
|
#endif /* _PCI_EHCI_H_ */
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
ALIAS_REGION(cbfs_cache, preram_cbfs_cache) \
|
ALIAS_REGION(cbfs_cache, preram_cbfs_cache) \
|
||||||
ALIAS_REGION(cbfs_cache, postram_cbfs_cache)
|
ALIAS_REGION(cbfs_cache, postram_cbfs_cache)
|
||||||
|
|
||||||
#if defined(__PRE_RAM__)
|
#if ENV_ROMSTAGE_OR_BEFORE
|
||||||
#define PRERAM_CBFS_CACHE(addr, size) \
|
#define PRERAM_CBFS_CACHE(addr, size) \
|
||||||
REGION(preram_cbfs_cache, addr, size, 4) \
|
REGION(preram_cbfs_cache, addr, size, 4) \
|
||||||
ALIAS_REGION(preram_cbfs_cache, cbfs_cache)
|
ALIAS_REGION(preram_cbfs_cache, cbfs_cache)
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include <bootstate.h>
|
#include <bootstate.h>
|
||||||
#include <arch/cpu.h>
|
#include <arch/cpu.h>
|
||||||
|
|
||||||
#if CONFIG(COOP_MULTITASKING) && !defined(__SMM__) && !defined(__PRE_RAM__)
|
#if ENV_RAMSTAGE && CONFIG(COOP_MULTITASKING)
|
||||||
|
|
||||||
struct thread {
|
struct thread {
|
||||||
int id;
|
int id;
|
||||||
|
|
|
@ -51,16 +51,11 @@ _Static_assert(CONFIG_CONSOLE_CBMEM_BUFFER_SIZE <= MAX_SIZE,
|
||||||
|
|
||||||
static struct cbmem_console *cbmem_console_p CAR_GLOBAL;
|
static struct cbmem_console *cbmem_console_p CAR_GLOBAL;
|
||||||
|
|
||||||
#ifdef __PRE_RAM__
|
|
||||||
/*
|
/*
|
||||||
* While running from ROM, before DRAM is initialized, some area in cache as
|
* While running from ROM, before DRAM is initialized, some area in cache as
|
||||||
* RAM space is used for the console buffer storage. The size and location of
|
* RAM space is used for the console buffer storage. The size and location of
|
||||||
* the area are defined by the linker script with _(e)preram_cbmem_console.
|
* the area are defined by the linker script with _(e)preram_cbmem_console.
|
||||||
*/
|
*
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/*
|
|
||||||
* When running from RAM, some console output is generated before CBMEM is
|
* When running from RAM, some console output is generated before CBMEM is
|
||||||
* reinitialized. This static buffer is used to store that output temporarily,
|
* reinitialized. This static buffer is used to store that output temporarily,
|
||||||
* to be concatenated with the CBMEM console buffer contents accumulated
|
* to be concatenated with the CBMEM console buffer contents accumulated
|
||||||
|
@ -69,7 +64,6 @@ static struct cbmem_console *cbmem_console_p CAR_GLOBAL;
|
||||||
|
|
||||||
#define STATIC_CONSOLE_SIZE 1024
|
#define STATIC_CONSOLE_SIZE 1024
|
||||||
static u8 static_console[STATIC_CONSOLE_SIZE];
|
static u8 static_console[STATIC_CONSOLE_SIZE];
|
||||||
#endif
|
|
||||||
|
|
||||||
static struct cbmem_console *current_console(void)
|
static struct cbmem_console *current_console(void)
|
||||||
{
|
{
|
||||||
|
@ -107,14 +101,13 @@ static void init_console_ptr(void *storage, u32 total_space)
|
||||||
|
|
||||||
void cbmemc_init(void)
|
void cbmemc_init(void)
|
||||||
{
|
{
|
||||||
#ifdef __PRE_RAM__
|
if (ENV_ROMSTAGE_OR_BEFORE) {
|
||||||
/* Pre-RAM environments use special buffer placed by linker script. */
|
/* Pre-RAM environments use special buffer placed by linker script. */
|
||||||
init_console_ptr(_preram_cbmem_console,
|
init_console_ptr(_preram_cbmem_console, REGION_SIZE(preram_cbmem_console));
|
||||||
REGION_SIZE(preram_cbmem_console));
|
} else {
|
||||||
#else
|
/* Post-RAM uses static (BSS) buffer before CBMEM is reinitialized. */
|
||||||
/* Post-RAM uses static (BSS) buffer before CBMEM is reinitialized. */
|
init_console_ptr(static_console, sizeof(static_console));
|
||||||
init_console_ptr(static_console, sizeof(static_console));
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cbmemc_tx_byte(unsigned char data)
|
void cbmemc_tx_byte(unsigned char data)
|
||||||
|
|
|
@ -172,14 +172,13 @@ int cbmem_initialize_id_size(u32 id, u64 size)
|
||||||
if (imd_recover(imd))
|
if (imd_recover(imd))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
#if defined(__PRE_RAM__)
|
|
||||||
/*
|
/*
|
||||||
* Lock the imd in romstage on a recovery. The assumption is that
|
* Lock the imd in romstage on a recovery. The assumption is that
|
||||||
* if the imd area was recovered in romstage then S3 resume path
|
* if the imd area was recovered in romstage then S3 resume path
|
||||||
* is being taken.
|
* is being taken.
|
||||||
*/
|
*/
|
||||||
imd_lockdown(imd);
|
if (ENV_ROMSTAGE)
|
||||||
#endif
|
imd_lockdown(imd);
|
||||||
|
|
||||||
/* Add the specified range first */
|
/* Add the specified range first */
|
||||||
if (size)
|
if (size)
|
||||||
|
|
|
@ -108,7 +108,7 @@
|
||||||
*(.sdata);
|
*(.sdata);
|
||||||
*(.sdata.*);
|
*(.sdata.*);
|
||||||
|
|
||||||
#ifdef __PRE_RAM__
|
#if ENV_ROMSTAGE_OR_BEFORE
|
||||||
PROVIDE(_preram_cbmem_console = .);
|
PROVIDE(_preram_cbmem_console = .);
|
||||||
PROVIDE(_epreram_cbmem_console = _preram_cbmem_console);
|
PROVIDE(_epreram_cbmem_console = _preram_cbmem_console);
|
||||||
#elif ENV_RAMSTAGE
|
#elif ENV_RAMSTAGE
|
||||||
|
|
|
@ -36,7 +36,8 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define POLL_DELAY 100 /* 100us */
|
#define POLL_DELAY 100 /* 100us */
|
||||||
#if defined(__PRE_RAM__)
|
|
||||||
|
#ifdef __SIMPLE_DEVICE__
|
||||||
#define EMPTY_DEV 0
|
#define EMPTY_DEV 0
|
||||||
#else
|
#else
|
||||||
#define EMPTY_DEV NULL
|
#define EMPTY_DEV NULL
|
||||||
|
@ -68,7 +69,7 @@ reg_script_get_step(struct reg_script_context *ctx)
|
||||||
|
|
||||||
static struct resource *reg_script_get_resource(struct reg_script_context *ctx)
|
static struct resource *reg_script_get_resource(struct reg_script_context *ctx)
|
||||||
{
|
{
|
||||||
#if defined(__PRE_RAM__)
|
#ifdef __SIMPLE_DEVICE__
|
||||||
return NULL;
|
return NULL;
|
||||||
#else
|
#else
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
|
Loading…
Reference in New Issue