[v3,17/18] ram: rk3399: Enable sdram debug functions

Message ID 20190715182856.21688-18-jagan@amarulasolutions.com
State New
Headers show
Series
  • ram: rk3399: Add rank detection
Related show

Commit Message

Jagan Teki July 15, 2019, 6:28 p.m. UTC
This would help to debug the sdram base parameters while
debugging existing chip or while supporting new sdram type.

It require explicit enablement of CONFIG_RAM_ROCKCHIP_DEBUG
for showing the debug prints.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 drivers/ram/rockchip/sdram_rk3399.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Kever Yang July 16, 2019, 7:49 a.m. UTC | #1
On 2019/7/16 上午2:28, Jagan Teki wrote:
> This would help to debug the sdram base parameters while
> debugging existing chip or while supporting new sdram type.
>
> It require explicit enablement of CONFIG_RAM_ROCKCHIP_DEBUG
> for showing the debug prints.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

Reviewed-by: Kever Yang <Kever.yang@rock-chips.com>

Thanks,
  - Kever
> ---
>   drivers/ram/rockchip/sdram_rk3399.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
> index b83955f94e..9a60c24135 100644
> --- a/drivers/ram/rockchip/sdram_rk3399.c
> +++ b/drivers/ram/rockchip/sdram_rk3399.c
> @@ -1251,6 +1251,8 @@ static unsigned char calculate_stride(struct rk3399_sdram_params *params)
>   		}
>   	}
>   
> +	sdram_print_stride(stride);
> +
>   	return stride;
>   }
>   
> @@ -1357,11 +1359,14 @@ static int sdram_init(struct dram_info *dram,
>   		debug("Channel ");
>   		debug(channel ? "1: " : "0: ");
>   
> +		sdram_print_ddr_info(cap_info, &params->base);
> +
>   		set_ddrconfig(chan, params, channel, cap_info->ddrconfig);
>   	}
>   
>   	if (params->base.num_channels == 0) {
>   		printf("%s: ", __func__);
> +		sdram_print_dram_type(params->base.dramtype);
>   		printf(" - %dMHz failed!\n", params->base.ddr_freq);
>   		return -EINVAL;
>   	}

Patch

diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
index b83955f94e..9a60c24135 100644
--- a/drivers/ram/rockchip/sdram_rk3399.c
+++ b/drivers/ram/rockchip/sdram_rk3399.c
@@ -1251,6 +1251,8 @@  static unsigned char calculate_stride(struct rk3399_sdram_params *params)
 		}
 	}
 
+	sdram_print_stride(stride);
+
 	return stride;
 }
 
@@ -1357,11 +1359,14 @@  static int sdram_init(struct dram_info *dram,
 		debug("Channel ");
 		debug(channel ? "1: " : "0: ");
 
+		sdram_print_ddr_info(cap_info, &params->base);
+
 		set_ddrconfig(chan, params, channel, cap_info->ddrconfig);
 	}
 
 	if (params->base.num_channels == 0) {
 		printf("%s: ", __func__);
+		sdram_print_dram_type(params->base.dramtype);
 		printf(" - %dMHz failed!\n", params->base.ddr_freq);
 		return -EINVAL;
 	}