aboutsummaryrefslogtreecommitdiff
path: root/drivers/renesas
diff options
context:
space:
mode:
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>2020-12-21 13:51:58 +0000
committerLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>2021-04-20 16:17:50 +0100
commitec3e2f67191558ae80005154455c592b93844045 (patch)
tree7e5f5d43f1d8537b71e07e9408c523c6f94e9bfa /drivers/renesas
parent4a6f4d2ec5232d01a611b42ec65e8269994c9c7b (diff)
downloadtrusted-firmware-a-ec3e2f67191558ae80005154455c592b93844045.tar.gz
renesas: rzg: Add support to identify HopeRun HiHope RZ/G2H board
Add support to identify HopeRun HiHope RZ/G2H board. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Change-Id: I6b28350ef50595fea9a1b1b7353fcabaeb935970
Diffstat (limited to 'drivers/renesas')
-rw-r--r--drivers/renesas/rzg/board/board.c28
-rw-r--r--drivers/renesas/rzg/board/board.h3
2 files changed, 20 insertions, 11 deletions
diff --git a/drivers/renesas/rzg/board/board.c b/drivers/renesas/rzg/board/board.c
index cfbb047194..5c99ba9b61 100644
--- a/drivers/renesas/rzg/board/board.c
+++ b/drivers/renesas/rzg/board/board.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Renesas Electronics Corporation. All rights reserved.
+ * Copyright (c) 2020-2021, Renesas Electronics Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -13,7 +13,11 @@
#include "rcar_def.h"
#ifndef BOARD_DEFAULT
+#if (RCAR_LSI == RZ_G2H)
+#define BOARD_DEFAULT (BOARD_HIHOPE_RZ_G2H << BOARD_CODE_SHIFT)
+#else
#define BOARD_DEFAULT (BOARD_HIHOPE_RZ_G2M << BOARD_CODE_SHIFT)
+#endif /* RCAR_LSI == RZ_G2H */
#endif /* BOARD_DEFAULT */
#define BOARD_CODE_MASK (0xF8U)
@@ -27,9 +31,11 @@
#define GP5_25_BIT (0x01U << 25)
#define HM_ID { 0x10U, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU }
+#define HH_ID HM_ID
const char *g_board_tbl[] = {
[BOARD_HIHOPE_RZ_G2M] = "HiHope RZ/G2M",
+ [BOARD_HIHOPE_RZ_G2H] = "HiHope RZ/G2H",
[BOARD_UNKNOWN] = "unknown"
};
@@ -38,6 +44,7 @@ void rzg_get_board_type(uint32_t *type, uint32_t *rev)
static uint8_t board_id = BOARD_ID_UNKNOWN;
const uint8_t board_tbl[][8] = {
[BOARD_HIHOPE_RZ_G2M] = HM_ID,
+ [BOARD_HIHOPE_RZ_G2H] = HH_ID,
};
uint32_t reg, boardInfo;
@@ -50,15 +57,16 @@ void rzg_get_board_type(uint32_t *type, uint32_t *rev)
if (*type >= ARRAY_SIZE(board_tbl)) {
/* no revision information, set Rev0.0. */
*rev = 0;
+ return;
+ }
+
+ reg = mmio_read_32(RCAR_PRR);
+ if ((reg & PRR_CUT_MASK) == RCAR_M3_CUT_VER11) {
+ *rev = board_tbl[*type][(uint8_t)(board_id & BOARD_REV_MASK)];
} else {
- reg = mmio_read_32(RCAR_PRR);
- if ((reg & PRR_CUT_MASK) == RCAR_M3_CUT_VER11) {
- *rev = board_tbl[*type][(uint8_t)(board_id & BOARD_REV_MASK)];
- } else {
- boardInfo = mmio_read_32(GPIO_INDT5) &
- (GP5_19_BIT | GP5_21_BIT);
- *rev = (((boardInfo & GP5_19_BIT) >> 14) |
- ((boardInfo & GP5_21_BIT) >> 17)) + 0x30U;
- }
+ reg = mmio_read_32(GPIO_INDT5);
+ boardInfo = reg & (GP5_19_BIT | GP5_21_BIT);
+ *rev = (((boardInfo & GP5_19_BIT) >> 14) |
+ ((boardInfo & GP5_21_BIT) >> 17)) + 0x30U;
}
}
diff --git a/drivers/renesas/rzg/board/board.h b/drivers/renesas/rzg/board/board.h
index c0c3d0cda3..9a3fc1ffe6 100644
--- a/drivers/renesas/rzg/board/board.h
+++ b/drivers/renesas/rzg/board/board.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Renesas Electronics Corporation. All rights reserved.
+ * Copyright (c) 2020-2021, Renesas Electronics Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -9,6 +9,7 @@
enum rzg2_board_id {
BOARD_HIHOPE_RZ_G2M = 0,
+ BOARD_HIHOPE_RZ_G2H,
BOARD_UNKNOWN
};