Author: blueswirl Date: 2007-05-17 21:16:06 +0200 (Thu, 17 May 2007) New Revision: 147
Modified: openbios-devel/arch/sparc32/tree.fs openbios-devel/drivers/esp.c openbios-devel/drivers/obio.c openbios-devel/drivers/sbus.c Log: 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.
Modified: openbios-devel/arch/sparc32/tree.fs =================================================================== --- openbios-devel/arch/sparc32/tree.fs 2007-05-17 19:07:21 UTC (rev 146) +++ openbios-devel/arch/sparc32/tree.fs 2007-05-17 19:16:06 UTC (rev 147) @@ -56,22 +56,14 @@ : decode-unit decode-unit-sbus ; finish-device
+[IFDEF] CONFIG_BPP " /iommu/sbus" find-device 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 -new-device " SUNW,bpp" device-name 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 finish-device +[THEN]
" /iommu/sbus" find-device new-device
Modified: openbios-devel/drivers/esp.c =================================================================== --- openbios-devel/drivers/esp.c 2007-05-17 19:07:21 UTC (rev 146) +++ openbios-devel/drivers/esp.c 2007-05-17 19:16:06 UTC (rev 147) @@ -491,6 +491,11 @@ push_str("reg"); fword("property");
+ PUSH(0x02625a00); + fword("encode-int"); + push_str("clock-frequency"); + fword("property"); + for (id = 0; id < 8; id++) { if (!esp->sd[id].present) continue;
Modified: openbios-devel/drivers/obio.c =================================================================== --- openbios-devel/drivers/obio.c 2007-05-17 19:07:21 UTC (rev 146) +++ openbios-devel/drivers/obio.c 2007-05-17 19:16:06 UTC (rev 147) @@ -859,8 +859,15 @@ regs->l10_timer_limit = (((1000000/100) + 1) << 10); 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"); + if (i != 0) + fword("encode+"); + } + PUSH((unsigned long)®s->l10_timer_limit); fword("encode-int"); + fword("encode+"); push_str("address"); fword("property");
@@ -905,11 +912,14 @@ intregs->set = ~SUN4M_INT_MASKALL; intregs->cpu_intregs[0].clear = ~0x17fff;
- // Is this correct? It works for NetBSD at least - PUSH((int)intregs); + for (i = 0; i < SUN4M_NCPU; i++) { + PUSH((unsigned long)&intregs->cpu_intregs[i]); + fword("encode-int"); + if (i != 0) + fword("encode+"); + } + PUSH((unsigned long)&intregs->tbt); fword("encode-int"); - PUSH((int)intregs); - fword("encode-int"); fword("encode+"); push_str("address"); fword("property");
Modified: openbios-devel/drivers/sbus.c =================================================================== --- openbios-devel/drivers/sbus.c 2007-05-17 19:07:21 UTC (rev 146) +++ openbios-devel/drivers/sbus.c 2007-05-17 19:16:06 UTC (rev 147) @@ -22,6 +22,8 @@ #define SBUS_SLOTS 16 #define POWER_REGS 0x10 #define POWER_OFFSET 0x0a000000 +#define CS4231_REGS 0x40 +#define CS4231_OFFSET 0x0c000000
static void ob_sbus_node_init(unsigned long bus, unsigned long base) @@ -297,6 +299,51 @@ }
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 ob_macio_init(unsigned int slot, unsigned long base, unsigned long offset) { // All devices were integrated to NCR89C100, see @@ -327,7 +374,7 @@ ob_tcx_init(slot, base); break; case 4: // SUNW,CS4231 - //ob_cs4231_init(slot, base); + ob_cs4231_init(slot, base); break; case 5: // MACIO: le, esp, bpp, power-management ob_macio_init(slot, base, 0x08000000);