aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-11-30 12:21:34 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2014-12-01 14:57:44 +1100
commit9594a715b50c338f1261e88c12c120cf8e5b8bba (patch)
tree5e5a07267866843ae9b0077122300bc3396ee2e5 /hw
parent566f139cffdcef5d1ce679cc1a7cfd0c7cde3f78 (diff)
downloadskiboot-9594a715b50c338f1261e88c12c120cf8e5b8bba.zip
skiboot-9594a715b50c338f1261e88c12c120cf8e5b8bba.tar.gz
skiboot-9594a715b50c338f1261e88c12c120cf8e5b8bba.tar.bz2
Add tweaks to work in Mambo simulator
Mambo doesn't implement various things such as PBA SCOMs, LPC, ChipTOD, etc... It also provides a special console hook. This adds detection of Mambo via the /mambo node, and enables us to boot all the way to Linux. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/chiptod.c11
-rw-r--r--hw/homer.c2
-rw-r--r--hw/occ.c3
-rw-r--r--hw/slw.c6
-rw-r--r--hw/xscom.c10
5 files changed, 29 insertions, 3 deletions
diff --git a/hw/chiptod.c b/hw/chiptod.c
index 865ff82..daa67ef 100644
--- a/hw/chiptod.c
+++ b/hw/chiptod.c
@@ -19,6 +19,7 @@
*/
#include <skiboot.h>
#include <chiptod.h>
+#include <chip.h>
#include <xscom.h>
#include <io.h>
#include <cpu.h>
@@ -528,6 +529,9 @@ static void chiptod_sync_slave(void *data)
bool chiptod_wakeup_resync(void)
{
+ if (chiptod_primary < 0)
+ return 0;
+
lock(&chiptod_lock);
/* Apply base tfmr */
@@ -634,6 +638,9 @@ int chiptod_recover_tb_errors(void)
uint64_t tfmr;
int rc = 1;
+ if (chiptod_primary < 0)
+ return 0;
+
lock(&chiptod_lock);
/* Get fresh copy of TFMR */
@@ -774,6 +781,10 @@ void chiptod_init(u32 master_cpu)
struct cpu_thread *cpu0, *cpu;
bool sres;
+ /* Mambo doesn't simulate the chiptod */
+ if (is_mambo_chip)
+ return;
+
op_display(OP_LOG, OP_MOD_CHIPTOD, 0);
if (!chiptod_probe(master_cpu)) {
diff --git a/hw/homer.c b/hw/homer.c
index b8e51c5..6145e25 100644
--- a/hw/homer.c
+++ b/hw/homer.c
@@ -111,7 +111,7 @@ void homer_init(void)
{
struct proc_chip *chip;
- if (proc_gen != proc_gen_p8)
+ if (proc_gen != proc_gen_p8 || is_mambo_chip)
return;
/*
diff --git a/hw/occ.c b/hw/occ.c
index 5b3c3a6..e1eaf30 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -510,6 +510,9 @@ static struct fsp_client fsp_occ_client = {
void occ_send_dummy_interrupt(void)
{
+ /* Mambo chip doesn't do this */
+ if (is_mambo_chip)
+ return;
xscom_writeme(OCB_OCI_OCCMISC_OR,
OCB_OCI_OCIMISC_IRQ |
OCB_OCI_OCIMISC_IRQ_OPAL_DUMMY);
diff --git a/hw/slw.c b/hw/slw.c
index 68228a9..b72a0aa 100644
--- a/hw/slw.c
+++ b/hw/slw.c
@@ -513,6 +513,12 @@ static void add_cpu_idle_state_properties(void)
return;
}
+ /* Mambo currently misbehaves in nap mode vs. timebase, so let's
+ * disable idle states
+ */
+ if (is_mambo_chip)
+ return;
+
/*
* Chose the right state table for the chip
*
diff --git a/hw/xscom.c b/hw/xscom.c
index 98cbaec..1698135 100644
--- a/hw/xscom.c
+++ b/hw/xscom.c
@@ -435,9 +435,15 @@ int xscom_writeme(uint64_t pcb_addr, uint64_t val)
static void xscom_init_chip_info(struct proc_chip *chip)
{
uint64_t val;
- int64_t rc;
+ int64_t rc = 0;
- rc = xscom_read(chip->id, 0xf000f, &val);
+ /* Mambo chip model lacks the f000f register, just make
+ * something up (Murano DD2.1)
+ */
+ if (is_mambo_chip)
+ val = 0x221EF04980000000;
+ else
+ rc = xscom_read(chip->id, 0xf000f, &val);
if (rc) {
prerror("XSCOM: Error %lld reading 0xf000f register\n", rc);
/* We leave chip type to UNKNOWN */