CBMEM: Drop parameters from cbmem_init()
The parameters can be dropped as initialisation always happens for the region resolved with cbmem_locate_table(). This is no longer referenced externally, make it static. Change-Id: Ia40350a5232dcbf30aca7b5998e7995114c44551 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/3565 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@google.com>
This commit is contained in:
parent
d50cdf108f
commit
625f103ae8
|
@ -137,7 +137,6 @@ void cbmem_late_set_table(uint64_t base, uint64_t size);
|
||||||
int cbmem_base_check(void);
|
int cbmem_base_check(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void cbmem_init(u64 baseaddr, u64 size);
|
|
||||||
int cbmem_reinit(void);
|
int cbmem_reinit(void);
|
||||||
|
|
||||||
void get_cbmem_table(uint64_t *base, uint64_t *size);
|
void get_cbmem_table(uint64_t *base, uint64_t *size);
|
||||||
|
|
|
@ -95,13 +95,16 @@ void cbmem_late_set_table(uint64_t base, uint64_t size)
|
||||||
* - suspend/resume backup memory
|
* - suspend/resume backup memory
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void cbmem_init(u64 baseaddr, u64 size)
|
#if CONFIG_EARLY_CBMEM_INIT || !defined(__PRE_RAM__)
|
||||||
|
static void cbmem_init(void)
|
||||||
{
|
{
|
||||||
|
uint64_t baseaddr, size;
|
||||||
struct cbmem_entry *cbmem_toc;
|
struct cbmem_entry *cbmem_toc;
|
||||||
cbmem_toc = (struct cbmem_entry *)(unsigned long)baseaddr;
|
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "Initializing CBMEM area to 0x%llx (%lld bytes)\n",
|
cbmem_locate_table(&baseaddr, &size);
|
||||||
baseaddr, size);
|
cbmem_trace_location(baseaddr, size, __FUNCTION__);
|
||||||
|
|
||||||
|
cbmem_toc = (struct cbmem_entry *)(unsigned long)baseaddr;
|
||||||
|
|
||||||
if (size < (64 * 1024)) {
|
if (size < (64 * 1024)) {
|
||||||
printk(BIOS_DEBUG, "Increase CBMEM size!\n");
|
printk(BIOS_DEBUG, "Increase CBMEM size!\n");
|
||||||
|
@ -117,6 +120,7 @@ void cbmem_init(u64 baseaddr, u64 size)
|
||||||
.size = size - CBMEM_TOC_RESERVED
|
.size = size - CBMEM_TOC_RESERVED
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int cbmem_reinit(void)
|
int cbmem_reinit(void)
|
||||||
{
|
{
|
||||||
|
@ -220,11 +224,8 @@ void *cbmem_find(u32 id)
|
||||||
/* Returns True if it was not initialized before. */
|
/* Returns True if it was not initialized before. */
|
||||||
int cbmem_initialize(void)
|
int cbmem_initialize(void)
|
||||||
{
|
{
|
||||||
uint64_t base = 0, size = 0;
|
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
|
|
||||||
cbmem_locate_table(&base, &size);
|
|
||||||
|
|
||||||
/* We expect the romstage to always initialize it. */
|
/* We expect the romstage to always initialize it. */
|
||||||
if (!cbmem_reinit()) {
|
if (!cbmem_reinit()) {
|
||||||
#if CONFIG_HAVE_ACPI_RESUME && !defined(__PRE_RAM__)
|
#if CONFIG_HAVE_ACPI_RESUME && !defined(__PRE_RAM__)
|
||||||
|
@ -232,7 +233,7 @@ int cbmem_initialize(void)
|
||||||
if (acpi_slp_type == 3 || acpi_slp_type == 2)
|
if (acpi_slp_type == 3 || acpi_slp_type == 2)
|
||||||
acpi_slp_type = 0;
|
acpi_slp_type = 0;
|
||||||
#endif
|
#endif
|
||||||
cbmem_init(base, size);
|
cbmem_init();
|
||||||
rv = 1;
|
rv = 1;
|
||||||
}
|
}
|
||||||
#ifndef __PRE_RAM__
|
#ifndef __PRE_RAM__
|
||||||
|
|
Loading…
Reference in New Issue