aboutsummaryrefslogtreecommitdiff
path: root/include/phb3.h
diff options
context:
space:
mode:
authorPhilippe Bergheaud <felix@linux.vnet.ibm.com>2016-04-01 14:27:57 +0200
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-04-27 15:06:11 +1000
commitc27ead751a1cd6541e98dc2b490ac453613e8d69 (patch)
tree8e33f6615917bc1a5b35c36deeeeb7c623d29f5d /include/phb3.h
parent451b69d489112ef61d99199bec6c5eaf3a946127 (diff)
downloadskiboot-c27ead751a1cd6541e98dc2b490ac453613e8d69.zip
skiboot-c27ead751a1cd6541e98dc2b490ac453613e8d69.tar.gz
skiboot-c27ead751a1cd6541e98dc2b490ac453613e8d69.tar.bz2
phb3: Load CAPP ucode to both CAPP units on Naples
Venice and Murano have only one capp unit, that can be mapped to phb0, phb1 or phb2. Naples has two capp units, that are statically mapped, capp unit 0 on phb0 and capp unit 1 on phb1. The capp ucode must be loaded once onto each capp unit. This patch replaces the boolean chip->capp_ucode_loaded by a bitmap, and sets the bit corresponding to the phb index to indicate that ucode has been loaded. The macro CAPP_UCODE_LOADED(chip, phb) returns the value of the phb index bit. The xscom register addresses of capp unit 0 are identical to the register addresses of the single capp unit of Venice and Murano. The addresses of the Naples capp unit 1 are equal to the addresses of capp unit 0 + 0x180. This patch introduces the macro PHB3_CAPP_REG_OFFSET(p), that returns the following xscom register address offsets: 0x0 for the Venice capp unit 0x0 for the Murano capp unit 0x0 for Naples capp unit 0 0x180 for Naples capp unit 1 The offset is added to the register address at each xscom_write, in order to operate on the right capp unit. Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include/phb3.h')
-rw-r--r--include/phb3.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/phb3.h b/include/phb3.h
index 44ac52b..5728650 100644
--- a/include/phb3.h
+++ b/include/phb3.h
@@ -314,6 +314,17 @@ struct phb3 {
struct phb phb;
};
+#define PHB3_IS_NAPLES(p) ((p)->rev == PHB3_REV_NAPLES_DD10)
+
+/*
+ * Venice/Murano have one CAPP unit, that can be attached to PHB0,1 or 2.
+ * Naples has two CAPP units: CAPP0 attached to PHB0, CAPP1 attached to PHB1.
+ */
+#define PHB3_CAPP_MAX_PHB_INDEX(p) (PHB3_IS_NAPLES(p) ? 1 : 2)
+
+#define PHB3_CAPP_REG_OFFSET(p) \
+ ((p)->index && PHB3_IS_NAPLES(p) ? CAPP1_REG_OFFSET : 0x0)
+
static inline struct phb3 *phb_to_phb3(struct phb *phb)
{
return container_of(phb, struct phb3, phb);