[OpenBIOS] [PATCH 6/6] SPARC64: add model to hwdefs array and set it to a suitable value

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sun Jul 27 22:44:47 CEST 2014


At the moment we are probably closest to an Ultra250 with an UltraSPARC-IIi
processor and PCI bus. This property is checked by NetBSD during boot.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 openbios-devel/arch/sparc64/openbios.c |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/openbios-devel/arch/sparc64/openbios.c b/openbios-devel/arch/sparc64/openbios.c
index 9cc1ac2..9ca0851 100644
--- a/openbios-devel/arch/sparc64/openbios.c
+++ b/openbios-devel/arch/sparc64/openbios.c
@@ -47,6 +47,7 @@ static uint8_t idprom[NVRAM_IDPROM_SIZE];
 
 struct hwdef {
     pci_arch_t pci;
+    const char *model;
     uint16_t machine_id_low, machine_id_high;
 };
 
@@ -67,11 +68,14 @@ static const struct hwdef hwdefs[] = {
             .io_len = 0x10000,
             .irqs = { 0, 1, 2, 3 },
         },
+        .model = "SUNW,501-4681",
         .machine_id_low = 0,
         .machine_id_high = 255,
     },
 };
 
+static const struct hwdef *hwdef = NULL;
+
 struct cpudef {
     unsigned long iu_version;
     const char *name;
@@ -570,6 +574,8 @@ extern volatile uint64_t *obp_ticks_pointer;
 static void
 arch_init( void )
 {
+	phandle_t ph;
+	
 	openbios_init();
 	modules_init();
 #ifdef CONFIG_DRIVER_PCI
@@ -578,6 +584,15 @@ arch_init( void )
         nvconf_init();
         device_end();
 
+        /* Set the model name */
+        ph = find_dev("/");
+        PUSH(pointer2cell(hwdef->model));
+        PUSH(strlen(hwdef->model));
+        fword("encode-string");
+        push_str("model");
+        PUSH_ph(ph);
+        fword("set-property");
+
         /* Point to the Forth obp-ticks variable */
         fword("obp-ticks");
         obp_ticks_pointer = cell2pointer(POP());
@@ -594,8 +609,6 @@ int openbios(void)
 {
         unsigned int i;
         uint16_t machine_id;
-        const struct hwdef *hwdef = NULL;
-
 
         for (i = 0; i < sizeof(hwdefs) / sizeof(struct hwdef); i++) {
             isa_io_base = hwdefs[i].pci.io_base;
-- 
1.7.10.4




More information about the OpenBIOS mailing list