From b7b5302af73764c659346ba90f4933bf4502b64a Mon Sep 17 00:00:00 2001 From: Chris Smart Date: Tue, 29 Nov 2016 14:18:48 +1100 Subject: mambo: fake NVRAM support This re-configures the Mambo platform to use the new fake NVRAM introduced by Jack Miller in commit: mambo: Add Fake NVRAM driver An existing NVRAM file can be loaded by pointing SKIBOOT_NVRAM environment variable to the file when running Mambo. If no NVRAM file is provided, the default is set to 256Kb and will be formatted automatically by Skiboot on boot, e.g.: [ 0.000975501,5 ] NVRAM: Size is 256 KB [ 0.002292860,3 ] NVRAM: Partition at offset 0x0 has incorrect 0 length [ 0.002298792,3 ] NVRAM: Re-initializing (size: 0x00040000) This has been tested in Mambo, on bare metal Linux, as well as OpenPower BMC machines. Signed-off-by: Chris Smart Signed-off-by: Stewart Smith --- platforms/mambo/mambo.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'platforms') diff --git a/platforms/mambo/mambo.c b/platforms/mambo/mambo.c index 8d4820f..663164d 100644 --- a/platforms/mambo/mambo.c +++ b/platforms/mambo/mambo.c @@ -281,21 +281,6 @@ static void __attribute__((noreturn)) mambo_terminate(const char *msg __unused) for (;;) ; } -static int mambo_nvram_info(uint32_t *total_size) -{ - *total_size = 0x100000; - return OPAL_SUCCESS; -} - -static int mambo_nvram_start_read(void *dst, uint32_t src, uint32_t len) -{ - memset(dst+src, 0, len); - - nvram_read_complete(true); - - return OPAL_SUCCESS; -} - static int mambo_heartbeat_time(void) { /* @@ -311,9 +296,10 @@ DECLARE_PLATFORM(mambo) = { .init = mambo_platform_init, .cec_power_down = mambo_cec_power_down, .terminate = mambo_terminate, - .nvram_info = mambo_nvram_info, - .nvram_start_read = mambo_nvram_start_read, .start_preload_resource = flash_start_preload_resource, .resource_loaded = flash_resource_loaded, .heartbeat_time = mambo_heartbeat_time, + .nvram_info = fake_nvram_info, + .nvram_start_read = fake_nvram_start_read, + .nvram_write = fake_nvram_write, }; -- cgit v1.1