summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2013-06-22 14:05:28 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2013-09-11 07:19:36 +0200
commit95c39c28a3d4beb10143ad9c749241fcbdbfb2dc (patch)
tree536ec1b23e8591d7179f228a39e6984697edbc73 /src
parentf9f74afdd7b39c12d399a900f3af326a33c87387 (diff)
downloadcoreboot-95c39c28a3d4beb10143ad9c749241fcbdbfb2dc.tar.xz
CBMEM ARM: Prefer get_cbmem_table() over cbmem_late_set_table()
Implementing get_cbmem_table() allows initializing CBMEM earlier. Change-Id: I973f3a84dd9aaa2839959df5dda22909fdb9edeb Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/3560 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/pit/mainboard.c10
-rw-r--r--src/mainboard/google/snow/mainboard.c10
2 files changed, 8 insertions, 12 deletions
diff --git a/src/mainboard/google/pit/mainboard.c b/src/mainboard/google/pit/mainboard.c
index 7dd8388596..b91040cc3f 100644
--- a/src/mainboard/google/pit/mainboard.c
+++ b/src/mainboard/google/pit/mainboard.c
@@ -221,14 +221,12 @@ static void mainboard_init(device_t dev)
// gpio_info();
}
-static void setup_cbmem(void)
+void get_cbmem_table(uint64_t *base, uint64_t *size)
{
- u64 size = CONFIG_COREBOOT_TABLES_SIZE;
- u64 base = CONFIG_SYS_SDRAM_BASE +
+ *size = CONFIG_COREBOOT_TABLES_SIZE;
+ *base = CONFIG_SYS_SDRAM_BASE +
((unsigned)CONFIG_DRAM_SIZE_MB << 20ULL) -
CONFIG_COREBOOT_TABLES_SIZE;
- cbmem_late_set_table(base, size);
- cbmem_init(base, size);
}
static void mainboard_enable(device_t dev)
@@ -236,7 +234,7 @@ static void mainboard_enable(device_t dev)
dev->ops->init = &mainboard_init;
/* set up coreboot tables */
- setup_cbmem();
+ cbmem_initialize();
/* set up dcache and MMU */
/* FIXME: this should happen via resource allocator */
diff --git a/src/mainboard/google/snow/mainboard.c b/src/mainboard/google/snow/mainboard.c
index 8805be5fb7..93cc303cbc 100644
--- a/src/mainboard/google/snow/mainboard.c
+++ b/src/mainboard/google/snow/mainboard.c
@@ -262,14 +262,12 @@ static void mainboard_init(device_t dev)
// gpio_info();
}
-static void setup_cbmem(void)
+void get_cbmem_table(uint64_t *base, uint64_t *size)
{
- u64 size = CONFIG_COREBOOT_TABLES_SIZE;
- u64 base = CONFIG_SYS_SDRAM_BASE +
+ *size = CONFIG_COREBOOT_TABLES_SIZE;
+ *base = CONFIG_SYS_SDRAM_BASE +
((unsigned)CONFIG_DRAM_SIZE_MB << 20ULL) -
CONFIG_COREBOOT_TABLES_SIZE;
- cbmem_late_set_table(base, size);
- cbmem_init(base, size);
}
static void mainboard_enable(device_t dev)
@@ -277,7 +275,7 @@ static void mainboard_enable(device_t dev)
dev->ops->init = &mainboard_init;
/* set up coreboot tables */
- setup_cbmem();
+ cbmem_initialize();
/* set up dcache and MMU */
/* FIXME: this should happen via resource allocator */