sdram_print_dram_type() and sdram_detect_dbw() only handled types up to
LPDDR4.  Adding RK3576 with LPDDR5 exposes two gaps:

1. sdram_print_dram_type(): LPDDR4X (8) and LPDDR5 (9) fell through to
   "Unknown Device".  Add the missing cases.

2. sdram_detect_dbw(): the fixed-dbw=1 branch covered DDR3 and LPDDR4
   but not LPDDR4X or LPDDR5 (both use x16 dies → dbw=1).  Extend the
   condition to include the new types.

LPDDR4X and LPDDR5 enum values are already defined in sdram.h as 8
and 9 respectively.

Signed-off-by: Johan Axelsson <[email protected]>
---
 drivers/ram/rockchip/sdram_common.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/ram/rockchip/sdram_common.c 
b/drivers/ram/rockchip/sdram_common.c
index b7a8fce607c..777e1044b40 100644
--- a/drivers/ram/rockchip/sdram_common.c
+++ b/drivers/ram/rockchip/sdram_common.c
@@ -29,6 +29,12 @@ void sdram_print_dram_type(unsigned char dramtype)
        case LPDDR4:
                printascii("LPDDR4");
                break;
+       case LPDDR4X:
+               printascii("LPDDR4X");
+               break;
+       case LPDDR5:
+               printascii("LPDDR5");
+               break;
        default:
                printascii("Unknown Device");
                break;
@@ -285,13 +291,14 @@ int sdram_detect_bg(struct sdram_cap_info *cap_info,
        return 0;
 }
 
-/* detect dbw for ddr3,lpddr2,lpddr3,lpddr4 */
+/* detect dbw for ddr3,lpddr2,lpddr3,lpddr4,lpddr4x,lpddr5 */
 int sdram_detect_dbw(struct sdram_cap_info *cap_info, u32 dram_type)
 {
        u32 row, col, bk, bw, cs_cap, cs;
        u32 die_bw_0 = 0, die_bw_1 = 0;
 
-       if (dram_type == DDR3 || dram_type == LPDDR4) {
+       if (dram_type == DDR3 || dram_type == LPDDR4 ||
+           dram_type == LPDDR4X || dram_type == LPDDR5) {
                cap_info->dbw = 1;
        } else if (dram_type == LPDDR3 || dram_type == LPDDR2) {
                row = cap_info->cs0_row;
-- 
2.45.1.windows.1


Reply via email to