summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristine Gharzuzi <chrisg@marvell.com>2018-05-28 13:42:01 +0300
committerKostya Porotchkin <kostap@marvell.com>2018-05-29 17:20:26 +0300
commit80bbf68632003720cb2b37a8d0f9605e3df54a4d (patch)
treefe04bfac6833144c12e437b5fce8d25b7c00b82d
parent508fe6eff043d53eb99df4276bf1e709fc9b7e04 (diff)
plat: a8k: add function that retrieves chip revisionatf-v1.4-armada-18.06
- This function retrieves the AP id (i.e 806/807/810) - This function is needed since retrieving chip id will be used in multiple cases. Change-Id: I13775ed5919ff10ac99e368317f89b359642d658 Signed-off-by: Christine Gharzuzi <chrisg@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/55764 Reviewed-by: Kostya Porotchkin <kostap@marvell.com> Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/55885
-rw-r--r--plat/marvell/a8k/common/plat_ble_setup.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/plat/marvell/a8k/common/plat_ble_setup.c b/plat/marvell/a8k/common/plat_ble_setup.c
index b681e2e9..17dd5142 100644
--- a/plat/marvell/a8k/common/plat_ble_setup.c
+++ b/plat/marvell/a8k/common/plat_ble_setup.c
@@ -143,6 +143,17 @@
#define EFUSE_AP_LD0_CLUSTER_DOWN_OFFS 4
+/* Return the AP revision of the chip */
+static unsigned int ble_get_ap_type(void)
+{
+ unsigned int chip_rev_id;
+
+ chip_rev_id = mmio_read_32(MVEBU_CSS_GWD_CTRL_IIDR2_REG);
+ chip_rev_id = ((chip_rev_id & GWD_IIDR2_CHIP_ID_MASK) >> GWD_IIDR2_CHIP_ID_OFFSET);
+
+ return chip_rev_id;
+}
+
/******************************************************************************
* The routine allows to save the CCU and IO windows configuration during DRAM
* setup and restore them afterwards before exiting the BLE stage.
@@ -513,7 +524,6 @@ static void aro_to_pll(void)
int ble_plat_setup(int *skip)
{
int ret;
- unsigned int chip_rev_id;
/* Power down unused CPUs */
plat_marvell_early_cpu_powerdown();
@@ -540,11 +550,8 @@ int ble_plat_setup(int *skip)
/* Setup AVS */
ble_plat_svc_config();
- chip_rev_id = mmio_read_32(MVEBU_CSS_GWD_CTRL_IIDR2_REG);
- chip_rev_id = ((chip_rev_id & GWD_IIDR2_CHIP_ID_MASK) >> GWD_IIDR2_CHIP_ID_OFFSET);
-
/* work with PLL clock driver in AP807 */
- if (chip_rev_id == CHIP_ID_AP807)
+ if (ble_get_ap_type() == CHIP_ID_AP807)
aro_to_pll();
#if ARO_ENABLE