[OpenBIOS] r198 - openbios-devel/arch/sparc64
svn at openbios.org
svn at openbios.org
Sat Jul 12 11:41:09 CEST 2008
Author: blueswirl
Date: 2008-07-12 11:41:08 +0200 (Sat, 12 Jul 2008)
New Revision: 198
Modified:
openbios-devel/arch/sparc64/openbios.c
openbios-devel/arch/sparc64/tree.fs
Log:
Add a CPU node
Modified: openbios-devel/arch/sparc64/openbios.c
===================================================================
--- openbios-devel/arch/sparc64/openbios.c 2008-07-11 23:21:43 UTC (rev 197)
+++ openbios-devel/arch/sparc64/openbios.c 2008-07-12 09:41:08 UTC (rev 198)
@@ -40,6 +40,47 @@
const char *name;
};
+static void cpu_generic_init(const struct cpudef *cpu)
+{
+ unsigned long iu_version;
+
+ push_str("/");
+ fword("find-device");
+
+ fword("new-device");
+
+ push_str(cpu->name);
+ fword("device-name");
+
+ push_str("cpu");
+ fword("device-type");
+
+ asm("rdpr %%ver, %0\n"
+ : "=r"(iu_version) :);
+
+ PUSH((iu_version >> 48) & 0xff);
+ fword("encode-int");
+ push_str("manufacturer#");
+ fword("property");
+
+ PUSH((iu_version >> 32) & 0xff);
+ fword("encode-int");
+ push_str("implementation#");
+ fword("property");
+
+ PUSH((iu_version >> 24) & 0xff);
+ fword("encode-int");
+ push_str("mask#");
+ fword("property");
+
+ PUSH(9);
+ fword("encode-int");
+ push_str("sparc-version");
+ fword("property");
+
+ fword("finish-device");
+}
+
static const struct cpudef sparc_defs[] = {
{
.iu_version = (0x04ULL << 48) | (0x02ULL << 32),
@@ -166,6 +207,8 @@
printk("CPUs: %x", nv_info.nb_cpus);
cpu = id_cpu();
+ //cpu->initfn();
+ cpu_generic_init(cpu);
printk(" x %s\n", cpu->name);
}
Modified: openbios-devel/arch/sparc64/tree.fs
===================================================================
--- openbios-devel/arch/sparc64/tree.fs 2008-07-11 23:21:43 UTC (rev 197)
+++ openbios-devel/arch/sparc64/tree.fs 2008-07-12 09:41:08 UTC (rev 198)
@@ -2,6 +2,7 @@
" /" find-device
2 encode-int " #address-cells" property
1 encode-int " #size-cells" property
+ " sun4u" encode-string " compatible" property
\ : encode-unit encode-unit-sbus ;
\ : decode-unit decode-unit-sbus ;
More information about the OpenBIOS
mailing list