feat(plat/rcar3): use PRR cut to determine DRAM size on M3

The new M3 DRAM size can be determined by the PRR cut version.
Read the PRR cut version, and if it is older than cut 30, use
legacy DRAM size scheme, else report 8GB in 2GBx4 2ch split.

Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> # Fix DRAM size judgment by PRR register, reword commit message
Change-Id: Ib83176d0d09cab5cae0119ba462e42c66c642798
This commit is contained in:
Toshiyuki Ogasahara 2021-07-12 19:05:06 +09:00 committed by Marek Vasut
parent 2892fedaf2
commit 42ffd279dd

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020, Renesas Electronics Corporation. All rights reserved.
* Copyright (c) 2018-2021, Renesas Electronics Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -705,6 +705,7 @@ static void bl2_advertise_dram_size(uint32_t product)
[4] = 0x600000000ULL,
[6] = 0x700000000ULL,
};
uint32_t cut = mmio_read_32(RCAR_PRR) & PRR_CUT_MASK;
switch (product) {
case PRR_PRODUCT_H3:
@ -730,15 +731,21 @@ static void bl2_advertise_dram_size(uint32_t product)
break;
case PRR_PRODUCT_M3:
if (cut < PRR_PRODUCT_30) {
#if (RCAR_GEN3_ULCB == 1)
/* 2GB(1GBx2 2ch split) */
dram_config[1] = 0x40000000ULL;
dram_config[5] = 0x40000000ULL;
/* 2GB(1GBx2 2ch split) */
dram_config[1] = 0x40000000ULL;
dram_config[5] = 0x40000000ULL;
#else
/* 4GB(2GBx2 2ch split) */
dram_config[1] = 0x80000000ULL;
dram_config[5] = 0x80000000ULL;
/* 4GB(2GBx2 2ch split) */
dram_config[1] = 0x80000000ULL;
dram_config[5] = 0x80000000ULL;
#endif
} else {
/* 8GB(2GBx4 2ch split) */
dram_config[1] = 0x100000000ULL;
dram_config[5] = 0x100000000ULL;
}
break;
case PRR_PRODUCT_M3N: