CBMEM: Add LATE_CBMEM_INIT guards

Our target is to get rid of backup_top_of_ram() and get_top_of_ram()
entirely so only declare these with LATE_CBMEM_INIT=y.

Change-Id: I54f549fe774996f4d803f9ec527e0fac46f6576f
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/8749
Tested-by: build bot (Jenkins)
Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
This commit is contained in:
Kyösti Mälkki 2015-03-19 06:58:15 +02:00
parent e9424c593a
commit 4da487eae8
7 changed files with 22 additions and 1 deletions

View File

@ -30,6 +30,8 @@ int acpi_get_sleep_type(void)
return (int)tmp; return (int)tmp;
} }
#if IS_ENABLED(CONFIG_LATE_CBMEM_INIT)
#ifndef __PRE_RAM__ #ifndef __PRE_RAM__
void backup_top_of_ram(uint64_t ramtop) void backup_top_of_ram(uint64_t ramtop)
{ {
@ -57,3 +59,5 @@ unsigned long get_top_of_ram(void)
} }
return (unsigned long) xdata; return (unsigned long) xdata;
} }
#endif

View File

@ -24,6 +24,8 @@
#include <console/console.h> /* printk */ #include <console/console.h> /* printk */
#include <cbmem.h> #include <cbmem.h>
#if IS_ENABLED(CONFIG_LATE_CBMEM_INIT)
#define BIOSRAM_INDEX 0xcd4 #define BIOSRAM_INDEX 0xcd4
#define BIOSRAM_DATA 0xcd5 #define BIOSRAM_DATA 0xcd5
@ -37,6 +39,7 @@ void backup_top_of_ram(uint64_t ramtop)
nvram_pos++; nvram_pos++;
} }
} }
#endif
void lpc_read_resources(device_t dev) void lpc_read_resources(device_t dev)
{ {

View File

@ -30,6 +30,8 @@ int acpi_get_sleep_type(void)
return (int)tmp; return (int)tmp;
} }
#if IS_ENABLED(CONFIG_LATE_CBMEM_INIT)
#ifndef __PRE_RAM__ #ifndef __PRE_RAM__
void backup_top_of_ram(uint64_t ramtop) void backup_top_of_ram(uint64_t ramtop)
{ {
@ -57,3 +59,5 @@ unsigned long get_top_of_ram(void)
} }
return (unsigned long) xdata; return (unsigned long) xdata;
} }
#endif

View File

@ -728,6 +728,7 @@ int acpi_get_sleep_type(void)
return ((tmp & (7 << 10)) >> 10); return ((tmp & (7 << 10)) >> 10);
} }
#if IS_ENABLED(CONFIG_LATE_CBMEM_INIT)
unsigned long get_top_of_ram(void) unsigned long get_top_of_ram(void)
{ {
uint32_t xdata = 0; uint32_t xdata = 0;
@ -742,5 +743,6 @@ unsigned long get_top_of_ram(void)
} }
return (unsigned long) xdata; return (unsigned long) xdata;
} }
#endif
#endif #endif

View File

@ -88,6 +88,7 @@ int acpi_get_sleep_type(void)
return ((tmp & (7 << 10)) >> 10); return ((tmp & (7 << 10)) >> 10);
} }
#if IS_ENABLED(CONFIG_LATE_CBMEM_INIT)
void backup_top_of_ram(uint64_t ramtop) void backup_top_of_ram(uint64_t ramtop)
{ {
u32 dword = (u32) ramtop; u32 dword = (u32) ramtop;
@ -98,6 +99,7 @@ void backup_top_of_ram(uint64_t ramtop)
nvram_pos++; nvram_pos++;
} }
} }
#endif
static void sb700_lpc_read_resources(device_t dev) static void sb700_lpc_read_resources(device_t dev)
{ {

View File

@ -673,6 +673,7 @@ int acpi_get_sleep_type(void)
return ((tmp & (7 << 10)) >> 10); return ((tmp & (7 << 10)) >> 10);
} }
#if IS_ENABLED(CONFIG_LATE_CBMEM_INIT)
unsigned long get_top_of_ram(void) unsigned long get_top_of_ram(void)
{ {
uint32_t xdata = 0; uint32_t xdata = 0;
@ -687,5 +688,6 @@ unsigned long get_top_of_ram(void)
} }
return (unsigned long) xdata; return (unsigned long) xdata;
} }
#endif
#endif #endif

View File

@ -113,9 +113,13 @@ static void host_ctrl_enable_k8m8xx(struct device *dev) {
pci_write_config8(dev, 0xa6, 0x83); pci_write_config8(dev, 0xa6, 0x83);
} }
void backup_top_of_ram(uint64_t ramtop) {
#if IS_ENABLED(CONFIG_LATE_CBMEM_INIT)
void backup_top_of_ram(uint64_t ramtop)
{
outl((u32) ramtop, K8T890_NVRAM_IO_BASE+K8T890_NVRAM_TOP_OF_RAM); outl((u32) ramtop, K8T890_NVRAM_IO_BASE+K8T890_NVRAM_TOP_OF_RAM);
} }
#endif
static struct pci_operations lops_pci = { static struct pci_operations lops_pci = {
.set_subsystem = pci_dev_set_subsystem, .set_subsystem = pci_dev_set_subsystem,