From 92ac73e4c2579444ee5017f37aa61e116ccf15c9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 1 Oct 2016 20:04:50 -0600 Subject: rockchip: rk3036: Move rockchip_get_cru() out of the driver This function is called from outside the driver. It should be placed into common SoC code. Move it. Also rename the driver symbol to be more consistent with the other rockchip clock drivers. Signed-off-by: Simon Glass Reviewed-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/cru_rk3036.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/arch-rockchip/cru_rk3036.h b/arch/arm/include/asm/arch-rockchip/cru_rk3036.h index 7ecc8ee71c..aaef4b9d73 100644 --- a/arch/arm/include/asm/arch-rockchip/cru_rk3036.h +++ b/arch/arm/include/asm/arch-rockchip/cru_rk3036.h @@ -24,6 +24,12 @@ #define PERI_HCLK_HZ 148500000 #define PERI_PCLK_HZ 74250000 +/* Private data for the clock driver - used by rockchip_get_cru() */ +struct rk3036_clk_priv { + struct rk3036_cru *cru; + ulong rate; +}; + struct rk3036_cru { struct rk3036_pll { unsigned int con0; -- cgit From c8a6bc968312f572cc84e3928ae5a293f2454849 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 1 Oct 2016 20:04:51 -0600 Subject: rockchip: rk3399: Move rockchip_get_cru() out of the driver This function is called from outside the driver. It should be placed into common SoC code. Move it. Also rename the driver symbol to be more consistent with the other rockchip clock drivers. Signed-off-by: Simon Glass Reviewed-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/cru_rk3399.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/arch-rockchip/cru_rk3399.h b/arch/arm/include/asm/arch-rockchip/cru_rk3399.h index 6776e484b7..98fba2bd75 100644 --- a/arch/arm/include/asm/arch-rockchip/cru_rk3399.h +++ b/arch/arm/include/asm/arch-rockchip/cru_rk3399.h @@ -9,6 +9,12 @@ #include +/* Private data for the clock driver - used by rockchip_get_cru() */ +struct rk3399_clk_priv { + struct rk3399_cru *cru; + ulong rate; +}; + struct rk3399_pmucru { u32 ppll_con[6]; u32 reserved[0x1a]; -- cgit From 5564ed5dd980c1e67780fb6a7fdbe29fd76174ed Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 1 Oct 2016 20:04:52 -0600 Subject: rockchip: rk3288: Move rockchip_get_cru() out of the driver This function is called from outside the driver. It should be placed into common SoC code. Move it. Signed-off-by: Simon Glass Reviewed-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/cru_rk3288.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/arch-rockchip/cru_rk3288.h b/arch/arm/include/asm/arch-rockchip/cru_rk3288.h index 8a8ca9c9aa..d575f4a163 100644 --- a/arch/arm/include/asm/arch-rockchip/cru_rk3288.h +++ b/arch/arm/include/asm/arch-rockchip/cru_rk3288.h @@ -25,6 +25,13 @@ #define PERI_HCLK_HZ 148500000 #define PERI_PCLK_HZ 74250000 +/* Private data for the clock driver - used by rockchip_get_cru() */ +struct rk3288_clk_priv { + struct rk3288_grf *grf; + struct rk3288_cru *cru; + ulong rate; +}; + struct rk3288_cru { struct rk3288_pll { u32 con0; -- cgit From 7d6c78f5731e71c7619c621c4c7e30c56f0fd9bf Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Fri, 7 Oct 2016 17:47:58 +0800 Subject: rk3288: sdram: auto-detect the capacity Add support for rk3288 dram capacity auto detect, support DDR3 and LPDDR3, DDR2 is not supported. The program will automatically detect: - channel number - rank number - column address number - row address number The dts file do not need to describe those info after apply this patch. Signed-off-by: Kever Yang Tested-by: Simon Glass Tested-by: Vagrant Cascadian Tested-by: Vagrant Cascadian --- arch/arm/include/asm/arch-rockchip/sdram.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/arch-rockchip/sdram.h b/arch/arm/include/asm/arch-rockchip/sdram.h index 82c3d07cbb..d7d67baa68 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram.h +++ b/arch/arm/include/asm/arch-rockchip/sdram.h @@ -16,6 +16,11 @@ enum { }; struct rk3288_sdram_channel { + /* + * bit width in address, eg: + * 8 banks using 3 bit to address, + * 2 cs using 1 bit to address. + */ u8 rank; u8 col; u8 bk; @@ -87,6 +92,16 @@ struct rk3288_base_params { u32 ddrconfig; u32 ddr_freq; u32 dramtype; + /* + * DDR Stride is address mapping for DRAM space + * Stride Ch 0 range Ch1 range Total + * 0x00 0-256MB 256MB-512MB 512MB + * 0x05 0-1GB 0-1GB 1GB + * 0x09 0-2GB 0-2GB 2GB + * 0x0d 0-4GB 0-4GB 4GB + * 0x17 N/A 0-4GB 4GB + * 0x1a 0-4GB 4GB-8GB 8GB + */ u32 stride; u32 odt; }; -- cgit