mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Add a CPU node
git-svn-id: svn://coreboot.org/openbios/openbios-devel@198 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -40,6 +40,47 @@ struct cpudef {
|
|||||||
const char *name;
|
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[] = {
|
static const struct cpudef sparc_defs[] = {
|
||||||
{
|
{
|
||||||
.iu_version = (0x04ULL << 48) | (0x02ULL << 32),
|
.iu_version = (0x04ULL << 48) | (0x02ULL << 32),
|
||||||
@@ -166,6 +207,8 @@ void arch_nvram_get(char *data)
|
|||||||
|
|
||||||
printk("CPUs: %x", nv_info.nb_cpus);
|
printk("CPUs: %x", nv_info.nb_cpus);
|
||||||
cpu = id_cpu();
|
cpu = id_cpu();
|
||||||
|
//cpu->initfn();
|
||||||
|
cpu_generic_init(cpu);
|
||||||
printk(" x %s\n", cpu->name);
|
printk(" x %s\n", cpu->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
" /" find-device
|
" /" find-device
|
||||||
2 encode-int " #address-cells" property
|
2 encode-int " #address-cells" property
|
||||||
1 encode-int " #size-cells" property
|
1 encode-int " #size-cells" property
|
||||||
|
" sun4u" encode-string " compatible" property
|
||||||
|
|
||||||
\ : encode-unit encode-unit-sbus ;
|
\ : encode-unit encode-unit-sbus ;
|
||||||
\ : decode-unit decode-unit-sbus ;
|
\ : decode-unit decode-unit-sbus ;
|
||||||
|
|||||||
Reference in New Issue
Block a user