From a1f088323823be7931530e72647d7c714e832720 Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Sun, 8 Aug 2010 19:54:06 +0000 Subject: [PATCH] sparc32: move /uuid property setup to openbios.c Signed-off-by: Blue Swirl git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@843 f158a5a8-5612-0410-a976-696ce0be7e32 --- arch/sparc32/openbios.c | 26 ++++++++++++++++++++++++++ drivers/obio.c | 22 ---------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/arch/sparc32/openbios.c b/arch/sparc32/openbios.c index 60ee180..872d5d9 100644 --- a/arch/sparc32/openbios.c +++ b/arch/sparc32/openbios.c @@ -27,6 +27,7 @@ #define MEMORY_SIZE (128*1024) /* 16K ram for hosted system */ #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; @@ -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) { memory = malloc(MEMORY_SIZE); @@ -208,6 +232,8 @@ arch_init( void ) bind_func("platform-boot", boot ); bind_func("(go)", go ); + + setup_uuid(); } int openbios(void) diff --git a/drivers/obio.c b/drivers/obio.c index c0db4ff..4422f7c 100644 --- a/drivers/obio.c +++ b/drivers/obio.c @@ -24,8 +24,6 @@ #include "arch/common/fw_cfg.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_SCREEN 0 /* output to screen */ #define PROMDEV_TTYA 1 /* in/out to ttya */ @@ -637,8 +635,6 @@ id_machine(uint16_t machine_id) for (;;); } -static uint8_t qemu_uuid[16]; - static void 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); 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 push_str("/"); fword("find-device");