[OpenBIOS] Fix double nvram entry on newworld

Amadeusz Sławiński amade at asmblr.net
Wed Jan 30 11:29:06 CET 2013


Fix double nvram entry on newworld

There are two nvram entries on newworld (for example qemu -M mac99)

The first one (nvram at fff04000) has initialized .properties while the
other one has words.

0 > dev / ls
...
fff75e24 pci at f2000000
fff77848 nvram at fff04000
fff778e0 nvram
 ok
0 > dev /nvram at fff04000  ok
0 > words
 ok
0 > .properties
name                      "nvram"
#bytes                    2000
reg                       fff04000   00004000
device_type               "nvram"
compatible                "nvram,flash"
 ok
0 > dev /nvram at 0  ok
0 > words close open seek write read size
 ok
0 > .properties
name                      "nvram"
 ok

This patch fixes initialization, so only one node is created
containing both .properties and words.

0 > dev / ls
...
fff75e24 pci at f2000000
fff77868 nvram at fff04000
 ok
0 > dev /nvram at fff04000  ok
0 > words close open seek write read size
 ok
0 > .properties
name                      "nvram"
#bytes                    2000
reg                       fff04000   00004000
device_type               "nvram"
compatible                "nvram,flash"
 ok

Signed-off-by: Amadeusz Sławiński <amade at asmblr.net>

diff -uNr a/drivers/macio.c b/drivers/macio.c
--- a/drivers/macio.c   2013-01-28 12:16:54.849868216 +0100
+++ b/drivers/macio.c   2013-01-28 12:17:27.595867493 +0100
@@ -57,12 +57,6 @@
         } else {
                 nvram_offset = NW_IO_NVRAM_OFFSET;
                 nvram_size = NW_IO_NVRAM_SIZE;
-                push_str("/");
-                fword("find-device");
-                fword("new-device");
-                push_str("nvram");
-                fword("device-name");
-                fword("finish-device");
         }
        nvram = (char*)addr + nvram_offset;
         snprintf(buf, sizeof(buf), "%s/nvram", path);



More information about the OpenBIOS mailing list