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:
Mark Cave-Ayland 2019-08-18 21:16:50 +01:00
parent 29c8d2c339
commit f4d68d907a
2 changed files with 2 additions and 4 deletions

View File

@ -91,6 +91,7 @@ void macio_nvram_init(const char *path, phys_addr_t addr)
nvram_size = macio_nvram_size();
nvram = (char*)addr + nvram_offset;
nvconf_init();
snprintf(buf, sizeof(buf), "%s", path);
dnode = nvram_init(buf);
set_int_property(dnode, "#bytes", arch_nvram_size() );

View File

@ -186,8 +186,6 @@ nvconf_init( void )
nvram.data = malloc( nvram.size );
arch_nvram_get( nvram.data );
bind_func( "update-nvram", update_nvram );
for( ;; ) {
nvpart_t *p = NULL;
int err;
@ -309,6 +307,7 @@ NODE_METHODS( nvram ) = {
{ "read", (void*)nvram_read },
{ "write", (void*)nvram_write },
{ "seek", (void*)nvram_seek },
{ "update-nvram", (void*)update_nvram },
};
@ -322,8 +321,6 @@ nvram_init( const char *path )
fword("new-device");
nvconf_init();
ph = get_cur_dev();
push_str("nvram");