Skip to contentSkip to conversation

sparc32_dma: correctly initialize ledma base address

Qemu-devel Bob Breuer 4 participants 7 messages Aug 11, 2011 – Aug 26, 2011

lore
Share & tools
lore

Bob Breuer

author
#0 lore raw

The ledma base address defaults to 0xff000000 on reset. This fixes a bug with Solaris and SS-20 OBP when boot net is skipped.

---

hw/sparc32_dma.c +3 -0
index e75694b..61812fb 100644
@@ -252,6 +252,9 @@ static void dma_reset(DeviceState *d)
 
     memset(s->dmaregs, 0, DMA_SIZE);
     s->dmaregs[0] = DMA_VER;
+    if (s->is_ledma) {
+        s->dmaregs[3] = 0xff000000;
+    }
 }
 
 static const VMStateDescription vmstate_dma = {
#1 lore raw
Quoted 11 lines · Bob Breuer

The ledma base address defaults to 0xff000000 on reset. This fixes a bug with Solaris and SS-20 OBP when boot net is skipped.

---

hw/sparc32_dma.c +0 -0
index e75694b..61812fb 100644

hw/sparc32_dma.c static void dma_reset(DeviceState *d) · line 260

Quoted 9 lines
hw/sparc32_dma.c +3 -0
@@ -252,6 +252,9 @@ static void dma_reset(DeviceState *d)
 
      memset(s->dmaregs, 0, DMA_SIZE);
      s->dmaregs[0] = DMA_VER;
+    if (s->is_ledma) {
+        s->dmaregs[3] = 0xff000000;
+    }
  }
 
  static const VMStateDescription vmstate_dma = {

Oh that's interesting indeed. This corresponds to the fix I added to OpenBIOS here: http://lists.openbios.org/pipermail/openbios/2011-April/006350.html.

I guess that we should just assume a fixed address of 0xff000000 based upon the evidence we have to date.

ATB,

Mark.

Signature · 7 lines
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
author
#2 lore raw
Quoted 21 lines · Mark Cave-Ayland
Quoted 19 lines · Bob Breuer

The ledma base address defaults to 0xff000000 on reset. This fixes a bug with Solaris and SS-20 OBP when boot net is skipped.

---

hw/sparc32_dma.c +3 -0
index e75694b..61812fb 100644
@@ -252,6 +252,9 @@ static void dma_reset(DeviceState *d)
 
      memset(s->dmaregs, 0, DMA_SIZE);
      s->dmaregs[0] = DMA_VER;
+    if (s->is_ledma) {
+        s->dmaregs[3] = 0xff000000;
+    }
  }
 
Quoted 9 lines

hw/sparc32_dma.c static void dma_reset(DeviceState *d) · line 260

Quoted 1 line
hw/sparc32_dma.c +0 -0
  static const VMStateDescription vmstate_dma = {

Oh that's interesting indeed. This corresponds to the fix I added to OpenBIOS here:
http://lists.openbios.org/pipermail/openbios/2011-April/006350.html.

I guess that we should just assume a fixed address of 0xff000000 based upon the evidence we have to date.

Depends on the rom. The SS-5 rom always sets it correctly, whereas the SS-20 rom only sets it when you do "boot net". Also, this is just the top 8 bits of the address. The DMA2 documentation[1] for E_BASE_ADDR states that these upper address bits default to 0xff, even though it seems to incorrectly define it as bits 7:0 in the register instead of 31:24.

If you follow Artyom's blog, at [2] it was assumed that the bogus dbri device was the culprit (which is also why I went down the path of implementing the dbri device), when in reality, the selftest failure was preventing "boot net" from running and fixing the ledma register settings.

Bob

[1] http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/DMA2.txt
[2] http://tyom.blogspot.com/2010/05/sx-framebuffer-emulation.html

#3 lore raw
Quoted 6 lines · Bob Breuer

Depends on the rom. The SS-5 rom always sets it correctly, whereas the SS-20 rom only sets it when you do "boot net". Also, this is just the top 8 bits of the address. The DMA2 documentation[1] for E_BASE_ADDR states that these upper address bits default to 0xff, even though it seems to incorrectly define it as bits 7:0 in the register instead of 31:24.

Nice one - looks like I missed this when reading the documentation. At least the choice of default address now makes sense.

Quoted 5 lines

If you follow Artyom's blog, at [2] it was assumed that the bogus dbri device was the culprit (which is also why I went down the path of implementing the dbri device), when in reality, the selftest failure was preventing "boot net" from running and fixing the ledma register settings.

Okay - I think I see ;) In that case, I'd say this patch should be applied if Blue hasn't already done it (*sigh* I really miss the git web interface on qemu.org).

ATB,

Mark.

Signature · 7 lines
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
author
#4 lore raw
Quoted 11 lines · Mark Cave-Ayland
Quoted 6 lines · Bob Breuer

Depends on the rom. The SS-5 rom always sets it correctly, whereas the SS-20 rom only sets it when you do "boot net". Also, this is just the top 8 bits of the address. The DMA2 documentation[1] for E_BASE_ADDR states that these upper address bits default to 0xff, even though it seems to incorrectly define it as bits 7:0 in the register instead of 31:24.

Nice one - looks like I missed this when reading the documentation. At least the choice of default address now makes sense.

It might also make sense to modify the dma address calculations to use only the top 8 bits from ledma. Not sure if anything will care about that though.

Quoted 9 lines
Quoted 5 lines

If you follow Artyom's blog, at [2] it was assumed that the bogus dbri device was the culprit (which is also why I went down the path of implementing the dbri device), when in reality, the selftest failure was preventing "boot net" from running and fixing the ledma register settings.

Okay - I think I see ;) In that case, I'd say this patch should be applied if Blue hasn't already done it (*sigh* I really miss the git web interface on qemu.org).

http://repo.or.cz/w/qemu.git might be the next best thing, not sure if there is a mirroring delay with it or not.

Bob

#5 lore raw
Quoted 10 lines · Bob Breuer
Quoted 9 lines · Mark Cave-Ayland
Quoted 6 lines · Bob Breuer

Depends on the rom.  The SS-5 rom always sets it correctly, whereas the SS-20 rom only sets it when you do "boot net".  Also, this is just the top 8 bits of the address.  The DMA2 documentation[1] for E_BASE_ADDR states that these upper address bits default to 0xff, even though it seems to incorrectly define it as bits 7:0 in the register instead of 31:24.

Quoted 6 lines
Quoted 2 lines

Nice one - looks like I missed this when reading the documentation. At least the choice of default address now makes sense.

It might also make sense to modify the dma address calculations to use only the top 8 bits from ledma.  Not sure if anything will care about that though.

But both ibiblio doc for MACIO and Sun4M System Architecture manual specify low bits 7:0.

Quoted 9 lines
Quoted 9 lines
Quoted 5 lines

If you follow Artyom's blog, at [2] it was assumed that the bogus dbri device was the culprit (which is also why I went down the path of implementing the dbri device), when in reality, the selftest failure was preventing "boot net" from running and fixing the ledma register settings.

Okay - I think I see ;)  In that case, I'd say this patch should be applied if Blue hasn't already done it (*sigh* I really miss the git web interface on qemu.org).

I haven't applied the patches because OpenBIOS still can't boot due to the SCSI commits and I'd like to get that resolved first. I think ESP driver in OpenBIOS is buggy this time.

Quoted 2 lines

http://repo.or.cz/w/qemu.git  might be the next best thing, not sure if there is a mirroring delay with it or not.

Right, the web interface situation annoys me too.

#6 lore raw
In reply to Bob Breuer
Quoted 39 lines · Bob Breuer
Quoted 21 lines · Mark Cave-Ayland
Quoted 19 lines · Bob Breuer

The ledma base address defaults to 0xff000000 on reset.  This fixes a bug with Solaris and SS-20 OBP when boot net is skipped.

---

hw/sparc32_dma.c +3 -0
index e75694b..61812fb 100644
@@ -252,6 +252,9 @@ static void dma_reset(DeviceState *d)
 
       memset(s->dmaregs, 0, DMA_SIZE);
       s->dmaregs[0] = DMA_VER;
+    if (s->is_ledma) {
+        s->dmaregs[3] = 0xff000000;
+    }
   }
 
Quoted 9 lines

hw/sparc32_dma.c static void dma_reset(DeviceState *d) · line 260

Quoted 1 line
hw/sparc32_dma.c +0 -0
   static const VMStateDescription vmstate_dma = {

Oh that's interesting indeed. This corresponds to the fix I added to OpenBIOS here:
http://lists.openbios.org/pipermail/openbios/2011-April/006350.html.

I guess that we should just assume a fixed address of 0xff000000 based upon the evidence we have to date.

Depends on the rom.  The SS-5 rom always sets it correctly, whereas the SS-20 rom only sets it when you do "boot net".  Also, this is just the top 8 bits of the address.  The DMA2 documentation[1] for E_BASE_ADDR states that these upper address bits default to 0xff, even though it seems to incorrectly define it as bits 7:0 in the register instead of 31:24.

Quoted 5 lines

If you follow Artyom's blog, at [2] it was assumed that the bogus dbri device was the culprit (which is also why I went down the path of implementing the dbri device), when in reality, the selftest failure was preventing "boot net" from running and fixing the ledma register settings.

Ops. Apologises for sending you in the wrong direction.
To my defence - are you sure the dbri stub is completely unnecessary? I vaguely remember that the initialization routine had no surrounding guard code. Completely missing dbri seemed to abort the further initialization at least for the devices in the same slot.

Artyom

Quoted 6 lines

Bob

[1] http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/DMA2.txt
[2] http://tyom.blogspot.com/2010/05/sx-framebuffer-emulation.html

Signature · 4 lines
Regards,
Artyom Tarasenko

solaris/sparc under qemu blog: http://tyom.blogspot.com/