[OpenBIOS] [PATCH 2/2] sparc64: add a eeprom node to the device tree

Artyom Tarasenko atar4qemu at gmail.com
Sat Apr 27 09:13:44 CEST 2013


Add eeprom node to the device tree to make device visible for
the guest OS.

Signed-off-by: Artyom Tarasenko <atar4qemu at gmail.com>
---
 arch/sparc64/openbios.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/sparc64/openbios.c b/arch/sparc64/openbios.c
index 2e70a9d..22bcc39 100644
--- a/arch/sparc64/openbios.c
+++ b/arch/sparc64/openbios.c
@@ -450,6 +450,27 @@ void arch_nvram_get(char *data)
 
     ob_mmu_init(cpu->name, ram_size);
 
+    push_str("/pci at 1fe,0/ebus");
+    fword("find-device");
+    fword("new-device");
+    PUSH(0x000001fe);
+    fword("encode-int");
+    PUSH(0x02002000);
+    fword("encode-int");
+    fword("encode+");
+    PUSH(NVRAM_SIZE);
+    fword("encode-int");
+    fword("encode+");
+    push_str("reg");
+    fword("property");
+
+    push_str("mk48t59");
+    fword("model");
+
+    push_str("eeprom");
+    fword("device-name");
+    fword("finish-device");
+
     /* Setup nvram variables */
     push_str("/options");
     fword("find-device");
-- 
1.7.1




More information about the OpenBIOS mailing list