summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHemanth Puranik <hemanth.puranik@stericsson.com>2011-08-03 10:29:10 +0530
committerRobert Marklund <robert.marklund@stericsson.com>2011-10-05 13:01:54 +0200
commit55f1590566e5148dfc8f98d177f43cb9841586b9 (patch)
treebe43f44ba4249f013e8545c6815908418f514836
parentaa5fa4862a6dfe86f3374cf346451f6e91e90133 (diff)
db5500-prcmu: print firmware version
ST-Ericsson Linux next: - ST-Ericsson ID: WP332193 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I71fa209ac9e2ec37d9dd320f310c79d1616ff852 Signed-off-by: Hemanth Puranik <hemanth.puranik@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/28167 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32511 Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com> Tested-by: Rabin VINCENT <rabin.vincent@stericsson.com>
-rw-r--r--drivers/mfd/db5500-prcmu.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/mfd/db5500-prcmu.c b/drivers/mfd/db5500-prcmu.c
index 3f46e32198f..7de44e471f9 100644
--- a/drivers/mfd/db5500-prcmu.c
+++ b/drivers/mfd/db5500-prcmu.c
@@ -30,6 +30,7 @@
#include <mach/db5500-regs.h>
#include "db5500-prcmu-regs.h"
+#define PRCMU_FW_VERSION_OFFSET 0xA4
#define PRCM_SW_RST_REASON (tcdm_base + 0xFF8) /* 2 bytes */
#define _PRCM_MB_HEADER (tcdm_base + 0xFE8)
@@ -424,6 +425,13 @@ struct clk_mgt {
u32 pllsw;
};
+/* PRCMU Firmware Details */
+static struct {
+ u16 board;
+ u8 fw_version;
+ u8 api_version;
+} prcmu_version;
+
static DEFINE_SPINLOCK(clk_mgt_lock);
#define CLK_MGT_ENTRY(_name)[PRCMU_##_name] = { \
@@ -1507,6 +1515,24 @@ static struct irq_chip prcmu_irq_chip = {
void __init db5500_prcmu_early_init(void)
{
unsigned int i;
+ void *tcpm_base = ioremap_nocache(U5500_PRCMU_TCPM_BASE, SZ_4K);
+
+ if (tcpm_base != NULL) {
+ int version_high, version_low;
+
+ version_high = readl(tcpm_base + PRCMU_FW_VERSION_OFFSET);
+ version_low = readl(tcpm_base + PRCMU_FW_VERSION_OFFSET + 4);
+ prcmu_version.board = (version_high >> 24) & 0xFF;
+ prcmu_version.fw_version = version_high & 0xFF;
+ prcmu_version.api_version = version_low & 0xFF;
+
+ pr_info("PRCMU Firmware Version: 0x%x\n",
+ prcmu_version.fw_version);
+ pr_info("PRCMU API Version: 0x%x\n",
+ prcmu_version.api_version);
+
+ iounmap(tcpm_base);
+ }
tcdm_base = __io_address(U5500_PRCMU_TCDM_BASE);
spin_lock_init(&mb0_transfer.lock);