sparc32: move /uuid property setup to openbios.c

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@843 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2010-08-08 19:54:06 +00:00
parent 7d13c41dad
commit a1f0883238
2 changed files with 26 additions and 22 deletions

View File

@@ -27,6 +27,7 @@
#define MEMORY_SIZE (128*1024) /* 16K ram for hosted system */ #define MEMORY_SIZE (128*1024) /* 16K ram for hosted system */
#define DICTIONARY_SIZE (256*1024) /* 256K for the dictionary */ #define DICTIONARY_SIZE (256*1024) /* 256K for the dictionary */
#define UUID_FMT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
static ucell *memory; static ucell *memory;
@@ -116,6 +117,29 @@ void mdelay(unsigned int msecs)
{ {
} }
/* Add /uuid */
static void setup_uuid(void)
{
static uint8_t qemu_uuid[16];
fw_cfg_read(FW_CFG_UUID, (char *)qemu_uuid, 16);
printk("UUID: " UUID_FMT "\n", qemu_uuid[0], qemu_uuid[1], qemu_uuid[2],
qemu_uuid[3], qemu_uuid[4], qemu_uuid[5], qemu_uuid[6],
qemu_uuid[7], qemu_uuid[8], qemu_uuid[9], qemu_uuid[10],
qemu_uuid[11], qemu_uuid[12], qemu_uuid[13], qemu_uuid[14],
qemu_uuid[15]);
push_str("/");
fword("find-device");
PUSH((long)&qemu_uuid);
PUSH(16);
fword("encode-bytes");
push_str("uuid");
fword("property");
}
static void init_memory(void) static void init_memory(void)
{ {
memory = malloc(MEMORY_SIZE); memory = malloc(MEMORY_SIZE);
@@ -208,6 +232,8 @@ arch_init( void )
bind_func("platform-boot", boot ); bind_func("platform-boot", boot );
bind_func("(go)", go ); bind_func("(go)", go );
setup_uuid();
} }
int openbios(void) int openbios(void)

View File

@@ -24,8 +24,6 @@
#include "arch/common/fw_cfg.h" #include "arch/common/fw_cfg.h"
#include "escc.h" #include "escc.h"
#define UUID_FMT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
#define PROMDEV_KBD 0 /* input from keyboard */ #define PROMDEV_KBD 0 /* input from keyboard */
#define PROMDEV_SCREEN 0 /* output to screen */ #define PROMDEV_SCREEN 0 /* output to screen */
#define PROMDEV_TTYA 1 /* in/out to ttya */ #define PROMDEV_TTYA 1 /* in/out to ttya */
@@ -637,8 +635,6 @@ id_machine(uint16_t machine_id)
for (;;); for (;;);
} }
static uint8_t qemu_uuid[16];
static void static void
ob_nvram_init(uint64_t base, uint64_t offset) ob_nvram_init(uint64_t base, uint64_t offset)
{ {
@@ -686,24 +682,6 @@ ob_nvram_init(uint64_t base, uint64_t offset)
fw_cfg_read(FW_CFG_NOGRAPHIC, &nographic, 1); fw_cfg_read(FW_CFG_NOGRAPHIC, &nographic, 1);
graphic_depth = fw_cfg_read_i16(FW_CFG_SUN4M_DEPTH); graphic_depth = fw_cfg_read_i16(FW_CFG_SUN4M_DEPTH);
// Add /uuid
fw_cfg_read(FW_CFG_UUID, (char *)qemu_uuid, 16);
printk("UUID: " UUID_FMT "\n", qemu_uuid[0], qemu_uuid[1], qemu_uuid[2],
qemu_uuid[3], qemu_uuid[4], qemu_uuid[5], qemu_uuid[6],
qemu_uuid[7], qemu_uuid[8], qemu_uuid[9], qemu_uuid[10],
qemu_uuid[11], qemu_uuid[12], qemu_uuid[13], qemu_uuid[14],
qemu_uuid[15]);
push_str("/");
fword("find-device");
PUSH((long)&qemu_uuid);
PUSH(16);
fword("encode-bytes");
push_str("uuid");
fword("property");
// Add /idprom // Add /idprom
push_str("/"); push_str("/");
fword("find-device"); fword("find-device");