aboutsummaryrefslogtreecommitdiff
path: root/hw/ast-bmc
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2018-02-28 16:46:10 +1030
committerStewart Smith <stewart@linux.ibm.com>2018-06-18 22:13:43 -0500
commitb09e48ffcdbffca97f7f6ebc2135a9e82dc5d9e9 (patch)
tree9c6472d49d3d5cbc579479caf22120b386d85179 /hw/ast-bmc
parentc032c5991207bf143dec38d6d0527fb1a1944fac (diff)
downloadskiboot-b09e48ffcdbffca97f7f6ebc2135a9e82dc5d9e9.zip
skiboot-b09e48ffcdbffca97f7f6ebc2135a9e82dc5d9e9.tar.gz
skiboot-b09e48ffcdbffca97f7f6ebc2135a9e82dc5d9e9.tar.bz2
astbmc: Enable mbox depending on scratch reg
P8 boxes can opt in for mbox pnor support if they set the scratch register bit to indicate it is supported. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hw/ast-bmc')
-rw-r--r--hw/ast-bmc/ast-io.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/ast-bmc/ast-io.c b/hw/ast-bmc/ast-io.c
index cd1aba2..964d415 100644
--- a/hw/ast-bmc/ast-io.c
+++ b/hw/ast-bmc/ast-io.c
@@ -116,6 +116,7 @@
*/
#define BMC_SIO_SCR29 0x29
+#define BMC_SIO_SCR29_MBOX 0x08
#define BMC_SIO_SCR29_MEMBOOT 0x10
enum {
@@ -427,6 +428,19 @@ bool ast_is_ahb_lpc_pnor(void)
return !(boot_flags & BMC_SIO_SCR29_MEMBOOT);
}
+bool ast_scratch_reg_is_mbox(void)
+{
+ uint8_t boot_version;
+ uint8_t boot_flags;
+
+ boot_version = bmc_sio_inb(BMC_SIO_SCR28);
+ if (boot_version != BOOT_FLAGS_VERSION)
+ return false;
+
+ boot_flags = bmc_sio_inb(BMC_SIO_SCR29);
+ return boot_flags & BMC_SIO_SCR29_MBOX;
+}
+
void ast_setup_ibt(uint16_t io_base, uint8_t irq)
{
uint32_t v;