nvram: ensure that NVRAM configuration is separate from NVRAM node creation
As part of this separation we can also move "update-nvram" directly to the NVRAM node bindings. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
This commit is contained in:
parent
29c8d2c339
commit
f4d68d907a
|
@ -91,6 +91,7 @@ void macio_nvram_init(const char *path, phys_addr_t addr)
|
||||||
nvram_size = macio_nvram_size();
|
nvram_size = macio_nvram_size();
|
||||||
|
|
||||||
nvram = (char*)addr + nvram_offset;
|
nvram = (char*)addr + nvram_offset;
|
||||||
|
nvconf_init();
|
||||||
snprintf(buf, sizeof(buf), "%s", path);
|
snprintf(buf, sizeof(buf), "%s", path);
|
||||||
dnode = nvram_init(buf);
|
dnode = nvram_init(buf);
|
||||||
set_int_property(dnode, "#bytes", arch_nvram_size() );
|
set_int_property(dnode, "#bytes", arch_nvram_size() );
|
||||||
|
|
|
@ -186,8 +186,6 @@ nvconf_init( void )
|
||||||
nvram.data = malloc( nvram.size );
|
nvram.data = malloc( nvram.size );
|
||||||
arch_nvram_get( nvram.data );
|
arch_nvram_get( nvram.data );
|
||||||
|
|
||||||
bind_func( "update-nvram", update_nvram );
|
|
||||||
|
|
||||||
for( ;; ) {
|
for( ;; ) {
|
||||||
nvpart_t *p = NULL;
|
nvpart_t *p = NULL;
|
||||||
int err;
|
int err;
|
||||||
|
@ -309,6 +307,7 @@ NODE_METHODS( nvram ) = {
|
||||||
{ "read", (void*)nvram_read },
|
{ "read", (void*)nvram_read },
|
||||||
{ "write", (void*)nvram_write },
|
{ "write", (void*)nvram_write },
|
||||||
{ "seek", (void*)nvram_seek },
|
{ "seek", (void*)nvram_seek },
|
||||||
|
{ "update-nvram", (void*)update_nvram },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -322,8 +321,6 @@ nvram_init( const char *path )
|
||||||
|
|
||||||
fword("new-device");
|
fword("new-device");
|
||||||
|
|
||||||
nvconf_init();
|
|
||||||
|
|
||||||
ph = get_cur_dev();
|
ph = get_cur_dev();
|
||||||
|
|
||||||
push_str("nvram");
|
push_str("nvram");
|
||||||
|
|
Loading…
Reference in New Issue