mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
NetBSD and OpenBSD fixes:
- Correct timer and interrupt controller mappings - Add ESP clock frequency to avoid division by zero - CS4231 exists only in SS5 - Disable BPP for now, it's not emulated by Qemu anyway With these fixes, one NetBSD kernel even got to root device prompt on SS5. git-svn-id: svn://coreboot.org/openbios/openbios-devel@147 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -56,22 +56,14 @@ new-device
|
|||||||
: decode-unit decode-unit-sbus ;
|
: decode-unit decode-unit-sbus ;
|
||||||
finish-device
|
finish-device
|
||||||
|
|
||||||
" /iommu/sbus" find-device
|
[IFDEF] CONFIG_BPP
|
||||||
new-device
|
|
||||||
" SUNW,CS4231" device-name
|
|
||||||
" serial" device-type
|
|
||||||
5 encode-int 0 encode-int encode+ " intr" property
|
|
||||||
5 encode-int " interrupts" property
|
|
||||||
h# 3 encode-int h# 0c000000 encode-int encode+ h# 00000040 encode-int encode+ " reg" property
|
|
||||||
" audio" encode-string " alias" property
|
|
||||||
finish-device
|
|
||||||
|
|
||||||
" /iommu/sbus" find-device
|
" /iommu/sbus" find-device
|
||||||
new-device
|
new-device
|
||||||
" SUNW,bpp" device-name
|
" SUNW,bpp" device-name
|
||||||
h# 4 encode-int h# 0c800000 encode-int encode+ h# 0000001c encode-int encode+ " reg" property
|
h# 4 encode-int h# 0c800000 encode-int encode+ h# 0000001c encode-int encode+ " reg" property
|
||||||
h# 33 encode-int 0 encode-int encode+ " intr" property
|
h# 33 encode-int 0 encode-int encode+ " intr" property
|
||||||
finish-device
|
finish-device
|
||||||
|
[THEN]
|
||||||
|
|
||||||
" /iommu/sbus" find-device
|
" /iommu/sbus" find-device
|
||||||
new-device
|
new-device
|
||||||
|
|||||||
@@ -491,6 +491,11 @@ ob_esp_init(unsigned int slot, unsigned long base, unsigned long offset)
|
|||||||
push_str("reg");
|
push_str("reg");
|
||||||
fword("property");
|
fword("property");
|
||||||
|
|
||||||
|
PUSH(0x02625a00);
|
||||||
|
fword("encode-int");
|
||||||
|
push_str("clock-frequency");
|
||||||
|
fword("property");
|
||||||
|
|
||||||
for (id = 0; id < 8; id++) {
|
for (id = 0; id < 8; id++) {
|
||||||
if (!esp->sd[id].present)
|
if (!esp->sd[id].present)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -859,8 +859,15 @@ ob_counter_init(unsigned long base, unsigned long offset)
|
|||||||
regs->l10_timer_limit = (((1000000/100) + 1) << 10);
|
regs->l10_timer_limit = (((1000000/100) + 1) << 10);
|
||||||
regs->cpu_timers[0].l14_timer_limit = 0;
|
regs->cpu_timers[0].l14_timer_limit = 0;
|
||||||
|
|
||||||
PUSH((unsigned long)regs);
|
for (i = 0; i < SUN4M_NCPU; i++) {
|
||||||
|
PUSH((unsigned long)®s->cpu_timers[i]);
|
||||||
fword("encode-int");
|
fword("encode-int");
|
||||||
|
if (i != 0)
|
||||||
|
fword("encode+");
|
||||||
|
}
|
||||||
|
PUSH((unsigned long)®s->l10_timer_limit);
|
||||||
|
fword("encode-int");
|
||||||
|
fword("encode+");
|
||||||
push_str("address");
|
push_str("address");
|
||||||
fword("property");
|
fword("property");
|
||||||
|
|
||||||
@@ -905,10 +912,13 @@ ob_interrupt_init(unsigned long base, unsigned long offset)
|
|||||||
intregs->set = ~SUN4M_INT_MASKALL;
|
intregs->set = ~SUN4M_INT_MASKALL;
|
||||||
intregs->cpu_intregs[0].clear = ~0x17fff;
|
intregs->cpu_intregs[0].clear = ~0x17fff;
|
||||||
|
|
||||||
// Is this correct? It works for NetBSD at least
|
for (i = 0; i < SUN4M_NCPU; i++) {
|
||||||
PUSH((int)intregs);
|
PUSH((unsigned long)&intregs->cpu_intregs[i]);
|
||||||
fword("encode-int");
|
fword("encode-int");
|
||||||
PUSH((int)intregs);
|
if (i != 0)
|
||||||
|
fword("encode+");
|
||||||
|
}
|
||||||
|
PUSH((unsigned long)&intregs->tbt);
|
||||||
fword("encode-int");
|
fword("encode-int");
|
||||||
fword("encode+");
|
fword("encode+");
|
||||||
push_str("address");
|
push_str("address");
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
#define SBUS_SLOTS 16
|
#define SBUS_SLOTS 16
|
||||||
#define POWER_REGS 0x10
|
#define POWER_REGS 0x10
|
||||||
#define POWER_OFFSET 0x0a000000
|
#define POWER_OFFSET 0x0a000000
|
||||||
|
#define CS4231_REGS 0x40
|
||||||
|
#define CS4231_OFFSET 0x0c000000
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ob_sbus_node_init(unsigned long bus, unsigned long base)
|
ob_sbus_node_init(unsigned long bus, unsigned long base)
|
||||||
@@ -296,6 +298,51 @@ ob_power_init(unsigned int slot, unsigned long base)
|
|||||||
fword("finish-device");
|
fword("finish-device");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ob_cs4231_init(unsigned int slot, unsigned long base)
|
||||||
|
{
|
||||||
|
push_str("/iommu/sbus");
|
||||||
|
fword("find-device");
|
||||||
|
fword("new-device");
|
||||||
|
|
||||||
|
push_str("SUNW,CS4231");
|
||||||
|
fword("device-name");
|
||||||
|
|
||||||
|
push_str("serial");
|
||||||
|
fword("device-type");
|
||||||
|
|
||||||
|
PUSH(slot);
|
||||||
|
fword("encode-int");
|
||||||
|
PUSH(CS4231_OFFSET);
|
||||||
|
fword("encode-int");
|
||||||
|
fword("encode+");
|
||||||
|
PUSH(CS4231_REGS);
|
||||||
|
fword("encode-int");
|
||||||
|
fword("encode+");
|
||||||
|
push_str("reg");
|
||||||
|
fword("property");
|
||||||
|
|
||||||
|
PUSH(5);
|
||||||
|
fword("encode-int");
|
||||||
|
PUSH(0);
|
||||||
|
fword("encode-int");
|
||||||
|
fword("encode+");
|
||||||
|
push_str("intr");
|
||||||
|
fword("property");
|
||||||
|
|
||||||
|
PUSH(5);
|
||||||
|
fword("encode-int");
|
||||||
|
push_str("interrupts");
|
||||||
|
fword("property");
|
||||||
|
|
||||||
|
push_str("audio");
|
||||||
|
fword("encode-string");
|
||||||
|
push_str("alias");
|
||||||
|
fword("property");
|
||||||
|
|
||||||
|
fword("finish-device");
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ob_macio_init(unsigned int slot, unsigned long base, unsigned long offset)
|
ob_macio_init(unsigned int slot, unsigned long base, unsigned long offset)
|
||||||
{
|
{
|
||||||
@@ -327,7 +374,7 @@ sbus_probe_slot_ss5(unsigned int slot, unsigned long base)
|
|||||||
ob_tcx_init(slot, base);
|
ob_tcx_init(slot, base);
|
||||||
break;
|
break;
|
||||||
case 4: // SUNW,CS4231
|
case 4: // SUNW,CS4231
|
||||||
//ob_cs4231_init(slot, base);
|
ob_cs4231_init(slot, base);
|
||||||
break;
|
break;
|
||||||
case 5: // MACIO: le, esp, bpp, power-management
|
case 5: // MACIO: le, esp, bpp, power-management
|
||||||
ob_macio_init(slot, base, 0x08000000);
|
ob_macio_init(slot, base, 0x08000000);
|
||||||
|
|||||||
Reference in New Issue
Block a user