]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ram: rockchip: Add common ddr type configs
authorJagan Teki <jagan@amarulasolutions.com>
Wed, 14 Dec 2022 17:50:48 +0000 (23:20 +0530)
committerKever Yang <kever.yang@rock-chips.com>
Mon, 16 Jan 2023 10:01:10 +0000 (18:01 +0800)
We have common ddr types in rockchip or in general. So use
the common ddr type names instead of per Rockchip SoC to
avoid confusion.

The respective ddr type names will use on the associated
ddr SoC driver as these drivers are built per SoC at a time.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
15 files changed:
board/engicam/px30_core/Kconfig
configs/khadas-edge-captain-rk3399_defconfig
configs/khadas-edge-rk3399_defconfig
configs/khadas-edge-v-rk3399_defconfig
configs/leez-rk3399_defconfig
configs/nanopi-r4s-rk3399_defconfig
configs/pinebook-pro-rk3399_defconfig
configs/roc-pc-mezzanine-rk3399_defconfig
configs/roc-pc-rk3399_defconfig
configs/rock-pi-4-rk3399_defconfig
configs/rock-pi-4c-rk3399_defconfig
configs/rockpro64-rk3399_defconfig
drivers/ram/rockchip/Kconfig
drivers/ram/rockchip/sdram_px30.c
drivers/ram/rockchip/sdram_rk3399.c

index a03be78369c996ab7cc5b778aa72aa938340b7b5..924c30f3e170fb21d0a85c038e81dcb966da612f 100644 (file)
@@ -11,6 +11,6 @@ config SYS_CONFIG_NAME
 
 config BOARD_SPECIFIC_OPTIONS # dummy
        def_bool y
-       select RAM_PX30_DDR4 
+       select RAM_ROCKCHIP_DDR4
 
 endif
index 754fd4e3c6d5257936e4a1a5b38623d445592f4a..f6e90bf392e7d8960d79efdb0696ec4c63225faf 100644 (file)
@@ -53,7 +53,7 @@ CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_PWM=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
-CONFIG_RAM_RK3399_LPDDR4=y
+CONFIG_RAM_ROCKCHIP_LPDDR4=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550_MEM32=y
index 7518f7f2edef846a14c46bf2462e48d7efbcc24b..f74963cad6a4caca2734b91c197af2694becc1a1 100644 (file)
@@ -52,7 +52,7 @@ CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_PWM=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
-CONFIG_RAM_RK3399_LPDDR4=y
+CONFIG_RAM_ROCKCHIP_LPDDR4=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550_MEM32=y
index 4c4301a9e7c52b0c28a4e4f3a9cbb3c9cb45d778..3abfef15fc8ab9177f0b9417bb2f7c0105ad84bf 100644 (file)
@@ -53,7 +53,7 @@ CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_PWM=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
-CONFIG_RAM_RK3399_LPDDR4=y
+CONFIG_RAM_ROCKCHIP_LPDDR4=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550_MEM32=y
index 5a958ee36a3f787e08c34aa4611e44a8dcb8acd9..bee55f8165b7eeac39791f971ee143bec7bc0f2d 100644 (file)
@@ -48,7 +48,7 @@ CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_PWM=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
-CONFIG_RAM_RK3399_LPDDR4=y
+CONFIG_RAM_ROCKCHIP_LPDDR4=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550_MEM32=y
index 40a45a0f4bbe54cca24c0294cf80056130ef7b12..0ef5486f82fb8cdcb956ac4972be474f9e5bfb08 100644 (file)
@@ -49,7 +49,7 @@ CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_PWM=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
-CONFIG_RAM_RK3399_LPDDR4=y
+CONFIG_RAM_ROCKCHIP_LPDDR4=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550_MEM32=y
index dfbf5e70f4a18726c709b6c0f8d39e8e913cff9b..c885cbaf5a121399ed0f14ff05d01161af7f92cf 100644 (file)
@@ -74,7 +74,7 @@ CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_PWM=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
-CONFIG_RAM_RK3399_LPDDR4=y
+CONFIG_RAM_ROCKCHIP_LPDDR4=y
 CONFIG_DM_RESET=y
 CONFIG_DM_RNG=y
 CONFIG_RNG_ROCKCHIP=y
index e800110c92566b2e65a25425dd97f378073ad00d..00239c2582428b8a82a453e33fa81cfb7149a93f 100644 (file)
@@ -69,7 +69,7 @@ CONFIG_REGULATOR_PWM=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
 # CONFIG_RAM_ROCKCHIP_DEBUG is not set
-CONFIG_RAM_RK3399_LPDDR4=y
+CONFIG_RAM_ROCKCHIP_LPDDR4=y
 CONFIG_DM_RESET=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
index d68e03fba4fe74d9fb0724f3a1babeefc60dc5cb..ed70ce0cddd1f1e3cd2765e2d44c3866f854c217 100644 (file)
@@ -68,7 +68,7 @@ CONFIG_REGULATOR_PWM=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
 # CONFIG_RAM_ROCKCHIP_DEBUG is not set
-CONFIG_RAM_RK3399_LPDDR4=y
+CONFIG_RAM_ROCKCHIP_LPDDR4=y
 CONFIG_DM_RESET=y
 CONFIG_DM_RNG=y
 CONFIG_RNG_ROCKCHIP=y
index 7c49ccd064d017fb3b55a2aac92dfd7905eb72f6..ac182eeef0fb0a42727c3d4d42dcd8f0d29ebdaa 100644 (file)
@@ -64,7 +64,7 @@ CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_PWM=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
-CONFIG_RAM_RK3399_LPDDR4=y
+CONFIG_RAM_ROCKCHIP_LPDDR4=y
 CONFIG_DM_RESET=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
index 4f61a0ff661a9557bd997c0d9644a2df117ce88b..292436b6378e5f70c8f48ca33c75e34357c0de66 100644 (file)
@@ -64,7 +64,7 @@ CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_PWM=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
-CONFIG_RAM_RK3399_LPDDR4=y
+CONFIG_RAM_ROCKCHIP_LPDDR4=y
 CONFIG_DM_RESET=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
index 5b8d678f6bb5e46cb2dc89da624c3f69b8e13a58..6422b9fa7f747dff4539b42695d8f4d14f2ada2c 100644 (file)
@@ -71,7 +71,7 @@ CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_PWM=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
-CONFIG_RAM_RK3399_LPDDR4=y
+CONFIG_RAM_ROCKCHIP_LPDDR4=y
 CONFIG_DM_RESET=y
 CONFIG_DM_RNG=y
 CONFIG_RNG_ROCKCHIP=y
index c29d5e8b38cf4b010c0f1f1d88b4f0cc03a09f42..67c63ecba0470f72f2d8bc56082ef00efef46e13 100644 (file)
@@ -11,9 +11,10 @@ config ROCKCHIP_SDRAM_COMMON
        help
          This enable sdram common driver
 
+if RAM_ROCKCHIP
+
 config RAM_ROCKCHIP_DEBUG
        bool "Rockchip ram drivers debugging"
-       depends on RAM_ROCKCHIP
        default y
        help
          This enables debugging ram driver API's for the platforms
@@ -22,31 +23,28 @@ config RAM_ROCKCHIP_DEBUG
          This is an option for developers to understand the ram drivers
          initialization, configurations and etc.
 
-config RAM_PX30_DDR4
-       bool "DDR4 support for Rockchip PX30"
-       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
+config RAM_ROCKCHIP_DDR4
+       bool "DDR4 support for Rockchip SoCs"
        help
          This enables DDR4 sdram support instead of the default DDR3 support
-         on Rockchip PC30 SoCs.
+         on Rockchip SoCs.
 
-config RAM_PX30_LPDDR2
-       bool "LPDDR2 support for Rockchip PX30"
-       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
+config RAM_ROCKCHIP_LPDDR2
+       bool "LPDDR2 support for Rockchip SoCs"
        help
          This enables LPDDR2 sdram support instead of the default DDR3 support
-         on Rockchip PC30 SoCs.
+         on Rockchip SoCs.
 
-config RAM_PX30_LPDDR3
-       bool "LPDDR3 support for Rockchip PX30"
-       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
+config RAM_ROCKCHIP_LPDDR3
+       bool "LPDDR3 support for Rockchip SoCs"
        help
          This enables LPDDR3 sdram support instead of the default DDR3 support
-         on Rockchip PC30 SoCs.
+         on Rockchip SoCs.
 
-config RAM_RK3399_LPDDR4
-       bool "LPDDR4 support for Rockchip RK3399"
-       depends on RAM_ROCKCHIP && ROCKCHIP_RK3399
+config RAM_ROCKCHIP_LPDDR4
+       bool "LPDDR4 support for Rockchip SoCs"
        help
          This enables LPDDR4 sdram code support for the platforms based
-         on Rockchip RK3399 SoC.
+         on Rockchip SoCs.
 
+endif # RAM_ROCKCHIP
index 98b2593ac49fa86072c8cdb4b7566890614d56b3..86185149a968eac4be578a86657ced97a1166720 100644 (file)
@@ -125,11 +125,11 @@ u32 addrmap[][8] = {
 struct dram_info dram_info;
 
 struct px30_sdram_params sdram_configs[] = {
-#if defined(CONFIG_RAM_PX30_DDR4)
+#if defined(CONFIG_RAM_ROCKCHIP_DDR4)
 #include       "sdram-px30-ddr4-detect-333.inc"
-#elif defined(CONFIG_RAM_PX30_LPDDR2)
+#elif defined(CONFIG_RAM_ROCKCHIP_LPDDR2)
 #include       "sdram-px30-lpddr2-detect-333.inc"
-#elif defined(CONFIG_RAM_PX30_LPDDR3)
+#elif defined(CONFIG_RAM_ROCKCHIP_LPDDR3)
 #include       "sdram-px30-lpddr3-detect-333.inc"
 #else
 #include       "sdram-px30-ddr3-detect-333.inc"
index 136e4ede712297128418173b9f9e984e57633820..56fd863ca2c5d78183d2259cdc4681a4d3b7a413 100644 (file)
@@ -1625,7 +1625,7 @@ static void set_ddr_stride(struct rk3399_pmusgrf_regs *pmusgrf, u32 stride)
        rk_clrsetreg(&pmusgrf->soc_con4, 0x1f << 10, stride << 10);
 }
 
-#if !defined(CONFIG_RAM_RK3399_LPDDR4)
+#if !defined(CONFIG_RAM_ROCKCHIP_LPDDR4)
 static int data_training_first(struct dram_info *dram, u32 channel, u8 rank,
                               struct rk3399_sdram_params *params)
 {
@@ -2558,8 +2558,7 @@ static int lpddr4_set_rate(struct dram_info *dram,
 
        return 0;
 }
-
-#endif /* CONFIG_RAM_RK3399_LPDDR4 */
+#endif /* CONFIG_RAM_ROCKCHIP_LPDDR4 */
 
 /* CS0,n=1
  * CS1,n=2
@@ -3059,7 +3058,7 @@ static int conv_of_plat(struct udevice *dev)
 #endif
 
 static const struct sdram_rk3399_ops rk3399_ops = {
-#if !defined(CONFIG_RAM_RK3399_LPDDR4)
+#if !defined(CONFIG_RAM_ROCKCHIP_LPDDR4)
        .data_training_first = data_training_first,
        .set_rate_index = switch_to_phy_index1,
        .modify_param = modify_param,