summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgal Liberman <igall@marvell.com>2017-05-10 16:21:26 +0300
committerKostya Porotchkin <kostap@marvell.com>2017-05-11 11:05:39 +0300
commit816e294f4ad2144c010b6c495f86d06293c83849 (patch)
treee8fb36c2ab230faca27fdf3cb00b5e5e702d001e
parenta4d4d25b7a632f2133de207742766797a0cd31df (diff)
cp110: add function to read cp110 revision
Change-Id: I8288e56954c3d31af5ffe7184c5b3a10ae491dee Signed-off-by: Igal Liberman <igall@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/39296 Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
-rw-r--r--include/drivers/marvell/mochi/cp110_setup.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/drivers/marvell/mochi/cp110_setup.h b/include/drivers/marvell/mochi/cp110_setup.h
index d49f4a97..489ce46d 100644
--- a/include/drivers/marvell/mochi/cp110_setup.h
+++ b/include/drivers/marvell/mochi/cp110_setup.h
@@ -43,6 +43,9 @@
#define MVEBU_DEVICE_REV_MASK (0xf << MVEBU_DEVICE_REV_OFFSET)
#define MVEBU_70X0_DEV_ID (0x7040)
#define MVEBU_80X0_DEV_ID (0x8040)
+#define MVEBU_CP110_REF_ID_A1 1
+#define MVEBU_CP110_REF_ID_A2 2
+
/*******************************************************************************
* RTC Configuration
@@ -81,6 +84,13 @@ static inline uint32_t cp110_device_id_get(void)
MVEBU_DEVICE_ID_MASK;
}
+static inline uint32_t cp110_rev_id_get(void)
+{
+ return (mmio_read_32(MVEBU_DEVICE_ID_REG) &
+ MVEBU_DEVICE_REV_MASK) >>
+ MVEBU_DEVICE_REV_OFFSET;
+}
+
void cp110_init(int cp_index);
void cp110_ble_init(int cp_index);