Commit e9cd36f5 authored by Manish Pandey's avatar Manish Pandey Committed by TrustedFirmware Code Review
Browse files

Merge changes Id7bdbc9b,Ia813e051,I2c437380,I736724cc,I454fb40a, ... into integration

* changes:
  renesas: rzg: Add support to identify EK874 RZ/G2E board
  drivers: renesas: common: watchdog: Add support for RZ/G2E
  drivers: renesas: rzg: Add QoS support for RZ/G2E
  drivers: renesas: rzg: Add PFC support for RZ/G2E
  drivers: renesas: common: Add support for DRAM initialization on RZ/G2E SoC
  renesas: rzg: Add support to identify HopeRun HiHope RZ/G2N board
  drivers: renesas: common: emmc: Select eMMC channel for RZ/G2N SoC
  drivers: renesas: rzg: Add QoS support for RZ/G2N
  drivers: renesas: rzg: Add PFC support for RZ/G2N
  drivers: renesas: common: Add support for DRAM initialization on RZ/G2N SoC
  renesas: rzg: Add support to identify HopeRun HiHope RZ/G2H board
  drivers: renesas: common: emmc: Select eMMC channel for RZ/G2H SoC
  drivers: renesas: rzg: Add QoS support for RZ/G2H
  drivers: renesas: rzg: Add PFC support for RZ/G2H
  drivers: renesas: common: Add support for DRAM initialization on RZ/G2H SoC
  drivers: renesas: rzg: Switch using common ddr code
  drivers: renesas: ddr: Move to common
parents d8dc8c9e bcf43f04
/* /*
* 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 * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -9,11 +9,23 @@ ...@@ -9,11 +9,23 @@
#include <lib/mmio.h> #include <lib/mmio.h>
#if RCAR_LSI == RCAR_AUTO #if RCAR_LSI == RCAR_AUTO
#include "G2E/pfc_init_g2e.h"
#include "G2H/pfc_init_g2h.h"
#include "G2M/pfc_init_g2m.h" #include "G2M/pfc_init_g2m.h"
#include "G2N/pfc_init_g2n.h"
#endif /* RCAR_LSI == RCAR_AUTO */ #endif /* RCAR_LSI == RCAR_AUTO */
#if (RCAR_LSI == RZ_G2E)
#include "G2E/pfc_init_g2e.h"
#endif /* RCAR_LSI == RZ_G2N */
#if (RCAR_LSI == RZ_G2H)
#include "G2H/pfc_init_g2h.h"
#endif /* RCAR_LSI == RZ_G2H */
#if (RCAR_LSI == RZ_G2M) #if (RCAR_LSI == RZ_G2M)
#include "G2M/pfc_init_g2m.h" #include "G2M/pfc_init_g2m.h"
#endif /* RCAR_LSI == RZ_G2M */ #endif /* RCAR_LSI == RZ_G2M */
#if (RCAR_LSI == RZ_G2N)
#include "G2N/pfc_init_g2n.h"
#endif /* RCAR_LSI == RZ_G2N */
#include "rcar_def.h" #include "rcar_def.h"
#define PRR_PRODUCT_ERR(reg) \ #define PRR_PRODUCT_ERR(reg) \
...@@ -40,6 +52,15 @@ void rzg_pfc_init(void) ...@@ -40,6 +52,15 @@ void rzg_pfc_init(void)
case PRR_PRODUCT_M3: case PRR_PRODUCT_M3:
pfc_init_g2m(); pfc_init_g2m();
break; break;
case PRR_PRODUCT_H3:
pfc_init_g2h();
break;
case PRR_PRODUCT_M3N:
pfc_init_g2n();
break;
case PRR_PRODUCT_E3:
pfc_init_g2e();
break;
default: default:
PRR_PRODUCT_ERR(reg); PRR_PRODUCT_ERR(reg);
break; break;
...@@ -54,6 +75,27 @@ void rzg_pfc_init(void) ...@@ -54,6 +75,27 @@ void rzg_pfc_init(void)
pfc_init_g2m(); pfc_init_g2m();
#endif /* RCAR_LSI != RZ_G2M */ #endif /* RCAR_LSI != RZ_G2M */
break; break;
case PRR_PRODUCT_H3:
#if (RCAR_LSI != RZ_G2H)
PRR_PRODUCT_ERR(reg);
#else /* RCAR_LSI != RZ_G2H */
pfc_init_g2h();
#endif /* RCAR_LSI != RZ_G2H */
break;
case PRR_PRODUCT_M3N:
#if RCAR_LSI != RZ_G2N
PRR_PRODUCT_ERR(reg);
#else
pfc_init_g2n();
#endif /* RCAR_LSI != RZ_G2N */
break;
case PRR_PRODUCT_E3:
#if RCAR_LSI != RZ_G2E
PRR_PRODUCT_ERR(reg);
#else
pfc_init_g2e();
#endif
break;
default: default:
PRR_PRODUCT_ERR(reg); PRR_PRODUCT_ERR(reg);
break; break;
...@@ -65,6 +107,21 @@ void rzg_pfc_init(void) ...@@ -65,6 +107,21 @@ void rzg_pfc_init(void)
PRR_PRODUCT_ERR(reg); PRR_PRODUCT_ERR(reg);
} }
pfc_init_m3(); pfc_init_m3();
#elif (RCAR_LSI == RZ_G2H)
if ((reg & PRR_PRODUCT_MASK) != PRR_PRODUCT_H3) {
PRR_PRODUCT_ERR(reg);
}
pfc_init_g2h();
#elif (RCAR_LSI == RZ_G2N) /* G2N */
if ((reg & PRR_PRODUCT_MASK) != PRR_PRODUCT_M3N) {
PRR_PRODUCT_ERR(reg);
}
pfc_init_g2n();
#elif (RCAR_LSI == RZ_G2E)
if ((reg & PRR_PRODUCT_MASK) != PRR_PRODUCT_E3) {
PRR_PRODUCT_ERR(reg);
}
pfc_init_g2e();
#else /* RCAR_LSI == RZ_G2M */ #else /* RCAR_LSI == RZ_G2M */
#error "Don't have PFC initialize routine(unknown)." #error "Don't have PFC initialize routine(unknown)."
#endif /* RCAR_LSI == RZ_G2M */ #endif /* RCAR_LSI == RZ_G2M */
......
/*
* Copyright (c) 2021, Renesas Electronics Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdint.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include "qos_init_g2e_v10.h"
#include "../qos_common.h"
#include "../qos_reg.h"
#define RCAR_QOS_VERSION "rev.0.05"
#define REF_ARS_ARBSTOPCYCLE_G2E (((SL_INIT_SSLOTCLK_G2E) - 5U) << 16U)
#if RCAR_QOS_TYPE == RCAR_QOS_TYPE_DEFAULT
#if RCAR_REF_INT == RCAR_REF_DEFAULT
#include "qos_init_g2e_v10_mstat390.h"
#else
#include "qos_init_g2e_v10_mstat780.h"
#endif /* RCAR_REF_INT == RCAR_REF_DEFAULT */
#endif /* RCAR_QOS_TYPE == RCAR_QOS_TYPE_DEFAULT */
static const struct rcar_gen3_dbsc_qos_settings g2e_qos[] = {
/* BUFCAM settings */
{ DBSC_DBCAM0CNF1, 0x00043218U },
{ DBSC_DBCAM0CNF2, 0x000000F4U },
{ DBSC_DBSCHCNT0, 0x000F0037U },
{ DBSC_DBSCHSZ0, 0x00000001U },
{ DBSC_DBSCHRW0, 0x22421111U },
/* DDR3 */
{ DBSC_SCFCTST2, 0x012F1123U },
/* QoS Settings */
{ DBSC_DBSCHQOS00, 0x00000F00U },
{ DBSC_DBSCHQOS01, 0x00000B00U },
{ DBSC_DBSCHQOS02, 0x00000000U },
{ DBSC_DBSCHQOS03, 0x00000000U },
{ DBSC_DBSCHQOS40, 0x00000300U },
{ DBSC_DBSCHQOS41, 0x000002F0U },
{ DBSC_DBSCHQOS42, 0x00000200U },
{ DBSC_DBSCHQOS43, 0x00000100U },
{ DBSC_DBSCHQOS90, 0x00000100U },
{ DBSC_DBSCHQOS91, 0x000000F0U },
{ DBSC_DBSCHQOS92, 0x000000A0U },
{ DBSC_DBSCHQOS93, 0x00000040U },
{ DBSC_DBSCHQOS130, 0x00000100U },
{ DBSC_DBSCHQOS131, 0x000000F0U },
{ DBSC_DBSCHQOS132, 0x000000A0U },
{ DBSC_DBSCHQOS133, 0x00000040U },
{ DBSC_DBSCHQOS140, 0x000000C0U },
{ DBSC_DBSCHQOS141, 0x000000B0U },
{ DBSC_DBSCHQOS142, 0x00000080U },
{ DBSC_DBSCHQOS143, 0x00000040U },
{ DBSC_DBSCHQOS150, 0x00000040U },
{ DBSC_DBSCHQOS151, 0x00000030U },
{ DBSC_DBSCHQOS152, 0x00000020U },
{ DBSC_DBSCHQOS153, 0x00000010U },
};
void qos_init_g2e_v10(void)
{
rzg_qos_dbsc_setting(g2e_qos, ARRAY_SIZE(g2e_qos), true);
/* DRAM Split Address mapping */
#if RCAR_DRAM_SPLIT == RCAR_DRAM_SPLIT_4CH
#if RCAR_LSI == RCAR_RZ_G2E
#error "Don't set DRAM Split 4ch(G2E)"
#else
ERROR("DRAM Split 4ch not supported.(G2E)");
panic();
#endif
#elif (RCAR_DRAM_SPLIT == RCAR_DRAM_SPLIT_2CH)
#if RCAR_LSI == RCAR_RZ_G2E
#error "Don't set DRAM Split 2ch(G2E)"
#else
ERROR("DRAM Split 2ch not supported.(G2E)");
panic();
#endif
#else
NOTICE("BL2: DRAM Split is OFF\n");
#endif
#if !(RCAR_QOS_TYPE == RCAR_QOS_NONE)
#if RCAR_QOS_TYPE == RCAR_QOS_TYPE_DEFAULT
NOTICE("BL2: QoS is default setting(%s)\n", RCAR_QOS_VERSION);
#endif
#if RCAR_REF_INT == RCAR_REF_DEFAULT
NOTICE("BL2: DRAM refresh interval 3.9 usec\n");
#else
NOTICE("BL2: DRAM refresh interval 7.8 usec\n");
#endif
mmio_write_32(QOSCTRL_RAS, 0x00000020U);
mmio_write_64(QOSCTRL_DANN, 0x0404020002020201UL);
mmio_write_32(QOSCTRL_DANT, 0x00100804U);
mmio_write_32(QOSCTRL_FSS, 0x0000000AU);
mmio_write_32(QOSCTRL_INSFC, 0x06330001U);
mmio_write_32(QOSCTRL_EARLYR, 0x00000000U);
mmio_write_32(QOSCTRL_RACNT0, 0x00010003U);
mmio_write_32(QOSCTRL_SL_INIT, SL_INIT_REFFSSLOT |
SL_INIT_SLOTSSLOT | SL_INIT_SSLOTCLK_G2E);
mmio_write_32(QOSCTRL_REF_ARS, REF_ARS_ARBSTOPCYCLE_G2E);
/* QOSBW SRAM setting */
uint32_t i;
for (i = 0U; i < ARRAY_SIZE(mstat_fix); i++) {
mmio_write_64(QOSBW_FIX_QOS_BANK0 + i * 8U, mstat_fix[i]);
mmio_write_64(QOSBW_FIX_QOS_BANK1 + i * 8U, mstat_fix[i]);
}
for (i = 0U; i < ARRAY_SIZE(mstat_be); i++) {
mmio_write_64(QOSBW_BE_QOS_BANK0 + i * 8U, mstat_be[i]);
mmio_write_64(QOSBW_BE_QOS_BANK1 + i * 8U, mstat_be[i]);
}
/* RT bus Leaf setting */
mmio_write_32(RT_ACT0, 0x00000000U);
mmio_write_32(RT_ACT1, 0x00000000U);
/* CCI bus Leaf setting */
mmio_write_32(CPU_ACT0, 0x00000003U);
mmio_write_32(CPU_ACT1, 0x00000003U);
mmio_write_32(QOSCTRL_RAEN, 0x00000001U);
mmio_write_32(QOSCTRL_STATQC, 0x00000001U);
#else
NOTICE("BL2: QoS is None\n");
mmio_write_32(QOSCTRL_RAEN, 0x00000001U);
#endif
}
/*
* Copyright (c) 2021, Renesas Electronics Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef QOS_INIT_G2E_V10_H
#define QOS_INIT_G2E_V10_H
void qos_init_g2e_v10(void);
#endif /* QOS_INIT_G2E_V10_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment