diff options
author | Chris Smart <distroguy@gmail.com> | 2016-11-29 14:18:48 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-12-13 17:00:38 +1100 |
commit | b7b5302af73764c659346ba90f4933bf4502b64a (patch) | |
tree | 6d39dd868e4f09f9170e5ec4e74d943eddd8bfec /platforms | |
parent | 67265323132888e8b12788542fc7b33b340cc28b (diff) | |
download | skiboot-b7b5302af73764c659346ba90f4933bf4502b64a.zip skiboot-b7b5302af73764c659346ba90f4933bf4502b64a.tar.gz skiboot-b7b5302af73764c659346ba90f4933bf4502b64a.tar.bz2 |
mambo: fake NVRAM support
This re-configures the Mambo platform to use the new fake NVRAM
introduced by Jack Miller <jack@codezen.org> 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 <chris@distroguy.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'platforms')
-rw-r--r-- | platforms/mambo/mambo.c | 20 |
1 files changed, 3 insertions, 17 deletions
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, }; |