Skip to contentSkip to conversation

sparc32 use empty_slot for missing RAM

PATCH In review Artyom Tarasenko 2 participants 2 messages Apr 16, 2010 – Apr 17, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 sparc32 use empty_slot for missing RAM

use empty_slot device for the RAM which is not installed

Models without ECC don't trap when missing ram is accessed.

---
 Makefile.target |    2 +-
 hw/sun4m.c      |    7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
Makefile.target +1 -1
index 95c9d23..6362927 100644
@@ -248,7 +248,7 @@ obj-sparc-y += cirrus_vga.o
 else
 obj-sparc-y = sun4m.o lance.o tcx.o sun4m_iommu.o slavio_intctl.o
 obj-sparc-y += slavio_timer.o slavio_misc.o sparc32_dma.o
-obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o
+obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o empty_slot.o
 endif
 
 obj-arm-y = integratorcp.o versatilepb.o arm_pic.o arm_timer.o
hw/sun4m.c +6 -1
index 90e661d..fb49af5 100644
@@ -36,6 +36,7 @@
 #include "isa.h"
 #include "fw_cfg.h"
 #include "escc.h"
+#include "empty_slot.h"
 #include "qdev-addr.h"
 #include "loader.h"
 #include "elf.h"
@@ -820,7 +821,11 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
 
     /* set up devices */
     ram_init(0, RAM_size, hwdef->max_mem);
-
+	/* models without ECC don't trap when missing ram is accessed */
+	if(!hwdef->ecc_base) {
+        empty_slot_init(RAM_size, hwdef->max_mem - RAM_size);
+    }
+	
     prom_init(hwdef->slavio_base, bios_name);
 
     slavio_intctl = slavio_intctl_init(hwdef->intctl_base,
Signature · 1 line
1.6.6.1
#1 lore raw
Quoted 10 lines · Artyom Tarasenko

use empty_slot device for the RAM which is not installed

Models without ECC don't trap when missing ram is accessed.

---

  Makefile.target |    2 +-
  hw/sun4m.c      |    7 ++++++-
  2 files changed, 7 insertions(+), 2 deletions(-)
Quoted 11 lines

diff --git a/Makefile.target b/Makefile.target
index 95c9d23..6362927 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -248,7 +248,7 @@ obj-sparc-y += cirrus_vga.o
else
obj-sparc-y = sun4m.o lance.o tcx.o sun4m_iommu.o slavio_intctl.o obj-sparc-y += slavio_timer.o slavio_misc.o sparc32_dma.o
-obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o +obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o empty_slot.o
endif

The device could be compiled once, so please use instead Makefile.objs, conditional to CONFIG_EMPTY_SLOT which gets defined in default-configs/sparc-softmmu.mak.

On the other hand, the device is not used by other boards yet, so there is no benefit at this point.

Quoted 15 lines

obj-arm-y = integratorcp.o versatilepb.o arm_pic.o arm_timer.o
diff --git a/hw/sun4m.c b/hw/sun4m.c
index 90e661d..fb49af5 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -36,6 +36,7 @@
#include "isa.h"
#include "fw_cfg.h"
#include "escc.h"
+#include "empty_slot.h"
#include "qdev-addr.h"
#include "loader.h"
#include "elf.h"
@@ -820,7 +821,11 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,

Quoted 5 lines
     /* set up devices */
     ram_init(0, RAM_size, hwdef->max_mem);

-
+ /* models without ECC don't trap when missing ram is accessed */
+ if(!hwdef->ecc_base) {

The indentation seems to be off and there should be a space between 'if' and '('.

Quoted 11 lines

+ empty_slot_init(RAM_size, hwdef->max_mem - RAM_size);
+ }
+

     prom_init(hwdef->slavio_base, bios_name);

     slavio_intctl = slavio_intctl_init(hwdef->intctl_base,

--
1.6.6.1