All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ram: rockchip: px30: add a config-based ddr selection
@ 2020-10-01 18:40 Heiko Stuebner
  2020-10-02  2:09 ` Simon Glass
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Heiko Stuebner @ 2020-10-01 18:40 UTC (permalink / raw)
  To: u-boot

From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>

The SRAM on the PX30 is not big enough to hold multiple DDR configs
so it needs to be selected during build.

So far simply the DDR3 config was always selected and getting DDR4
or LPDDR2/3 initialized would require a code modification.

So add Kconfig options similar to RK3399 to allow selecting the DDR4
and LPDDR2/3 options instead, while DDR3 stays the default as before.

Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
---
 drivers/ram/rockchip/Kconfig      | 21 +++++++++++++++++++++
 drivers/ram/rockchip/sdram_px30.c |  8 ++++++++
 2 files changed, 29 insertions(+)

diff --git a/drivers/ram/rockchip/Kconfig b/drivers/ram/rockchip/Kconfig
index 8e97c2f49e..c459bbf5e2 100644
--- a/drivers/ram/rockchip/Kconfig
+++ b/drivers/ram/rockchip/Kconfig
@@ -22,6 +22,27 @@ config RAM_ROCKCHIP_DEBUG
 	  This is an option for developers to understand the ram drivers
 	  initialization, configurations and etc.
 
+config RAM_PX30_DDR4
+	bool "DDR3 support for Rockchip PX30"
+	depends on RAM_ROCKCHIP && ROCKCHIP_PX30
+	help
+	  This enables DDR4 sdram support instead of the default DDR3 support
+	  on Rockchip PC30 SoCs.
+
+config RAM_PX30_LPDDR2
+	bool "LPDDR2 support for Rockchip PX30"
+	depends on RAM_ROCKCHIP && ROCKCHIP_PX30
+	help
+	  This enables LPDDR2 sdram support instead of the default DDR3 support
+	  on Rockchip PC30 SoCs.
+
+config RAM_PX30_LPDDR3
+	bool "LPDDR3 support for Rockchip PX30"
+	depends on RAM_ROCKCHIP && ROCKCHIP_PX30
+	help
+	  This enables LPDDR3 sdram support instead of the default DDR3 support
+	  on Rockchip PC30 SoCs.
+
 config RAM_RK3399_LPDDR4
 	bool "LPDDR4 support for Rockchip RK3399"
 	depends on RAM_ROCKCHIP && ROCKCHIP_RK3399
diff --git a/drivers/ram/rockchip/sdram_px30.c b/drivers/ram/rockchip/sdram_px30.c
index fd5763d0a0..2f1f6e9c0c 100644
--- a/drivers/ram/rockchip/sdram_px30.c
+++ b/drivers/ram/rockchip/sdram_px30.c
@@ -125,7 +125,15 @@ u32 addrmap[][8] = {
 struct dram_info dram_info;
 
 struct px30_sdram_params sdram_configs[] = {
+#if defined(CONFIG_RAM_PX30_DDR4)
+#include	"sdram-px30-ddr4-detect-333.inc"
+#elif defined(CONFIG_RAM_PX30_LPDDR2)
+#include	"sdram-px30-lpddr2-detect-333.inc"
+#elif defined(CONFIG_RAM_PX30_LPDDR3)
+#include	"sdram-px30-lpddr3-detect-333.inc"
+#else
 #include	"sdram-px30-ddr3-detect-333.inc"
+#endif
 };
 
 struct ddr_phy_skew skew = {
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] ram: rockchip: px30: add a config-based ddr selection
  2020-10-01 18:40 [PATCH] ram: rockchip: px30: add a config-based ddr selection Heiko Stuebner
@ 2020-10-02  2:09 ` Simon Glass
  2020-10-02  5:58   ` Heiko Stübner
  2020-10-02 14:39   ` Jagan Teki
  2020-10-28 13:13 ` Jagan Teki
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 8+ messages in thread
From: Simon Glass @ 2020-10-02  2:09 UTC (permalink / raw)
  To: u-boot

Hi Heiko,

On Thu, 1 Oct 2020 at 12:40, Heiko Stuebner <heiko@sntech.de> wrote:
>
> From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
>
> The SRAM on the PX30 is not big enough to hold multiple DDR configs
> so it needs to be selected during build.
>
> So far simply the DDR3 config was always selected and getting DDR4
> or LPDDR2/3 initialized would require a code modification.
>
> So add Kconfig options similar to RK3399 to allow selecting the DDR4
> and LPDDR2/3 options instead, while DDR3 stays the default as before.
>
> Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> ---
>  drivers/ram/rockchip/Kconfig      | 21 +++++++++++++++++++++
>  drivers/ram/rockchip/sdram_px30.c |  8 ++++++++
>  2 files changed, 29 insertions(+)
>
> diff --git a/drivers/ram/rockchip/Kconfig b/drivers/ram/rockchip/Kconfig
> index 8e97c2f49e..c459bbf5e2 100644
> --- a/drivers/ram/rockchip/Kconfig
> +++ b/drivers/ram/rockchip/Kconfig
> @@ -22,6 +22,27 @@ config RAM_ROCKCHIP_DEBUG
>           This is an option for developers to understand the ram drivers
>           initialization, configurations and etc.
>
> +config RAM_PX30_DDR4
> +       bool "DDR3 support for Rockchip PX30"
> +       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> +       help
> +         This enables DDR4 sdram support instead of the default DDR3 support
> +         on Rockchip PC30 SoCs.
> +
> +config RAM_PX30_LPDDR2
> +       bool "LPDDR2 support for Rockchip PX30"
> +       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> +       help
> +         This enables LPDDR2 sdram support instead of the default DDR3 support
> +         on Rockchip PC30 SoCs.
> +
> +config RAM_PX30_LPDDR3
> +       bool "LPDDR3 support for Rockchip PX30"
> +       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> +       help
> +         This enables LPDDR3 sdram support instead of the default DDR3 support
> +         on Rockchip PC30 SoCs.
> +
>  config RAM_RK3399_LPDDR4
>         bool "LPDDR4 support for Rockchip RK3399"
>         depends on RAM_ROCKCHIP && ROCKCHIP_RK3399
> diff --git a/drivers/ram/rockchip/sdram_px30.c b/drivers/ram/rockchip/sdram_px30.c
> index fd5763d0a0..2f1f6e9c0c 100644
> --- a/drivers/ram/rockchip/sdram_px30.c
> +++ b/drivers/ram/rockchip/sdram_px30.c
> @@ -125,7 +125,15 @@ u32 addrmap[][8] = {
>  struct dram_info dram_info;
>
>  struct px30_sdram_params sdram_configs[] = {
> +#if defined(CONFIG_RAM_PX30_DDR4)
> +#include       "sdram-px30-ddr4-detect-333.inc"
> +#elif defined(CONFIG_RAM_PX30_LPDDR2)
> +#include       "sdram-px30-lpddr2-detect-333.inc"
> +#elif defined(CONFIG_RAM_PX30_LPDDR3)
> +#include       "sdram-px30-lpddr3-detect-333.inc"
> +#else
>  #include       "sdram-px30-ddr3-detect-333.inc"
> +#endif

How about putting this in the device tree? I think that would be a better place.

Regards,
Simon



>  };
>
>  struct ddr_phy_skew skew = {
> --
> 2.28.0
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] ram: rockchip: px30: add a config-based ddr selection
  2020-10-02  2:09 ` Simon Glass
@ 2020-10-02  5:58   ` Heiko Stübner
  2020-10-02  9:18     ` Heiko Stübner
  2020-10-02 14:39   ` Jagan Teki
  1 sibling, 1 reply; 8+ messages in thread
From: Heiko Stübner @ 2020-10-02  5:58 UTC (permalink / raw)
  To: u-boot

Hi Simon,

Am Freitag, 2. Oktober 2020, 04:09:56 CEST schrieb Simon Glass:
> Hi Heiko,
> 
> On Thu, 1 Oct 2020 at 12:40, Heiko Stuebner <heiko@sntech.de> wrote:
> >
> > From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> >
> > The SRAM on the PX30 is not big enough to hold multiple DDR configs
> > so it needs to be selected during build.
> >
> > So far simply the DDR3 config was always selected and getting DDR4
> > or LPDDR2/3 initialized would require a code modification.
> >
> > So add Kconfig options similar to RK3399 to allow selecting the DDR4
> > and LPDDR2/3 options instead, while DDR3 stays the default as before.
> >
> > Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> > ---
> >  drivers/ram/rockchip/Kconfig      | 21 +++++++++++++++++++++
> >  drivers/ram/rockchip/sdram_px30.c |  8 ++++++++
> >  2 files changed, 29 insertions(+)
> >
> > diff --git a/drivers/ram/rockchip/Kconfig b/drivers/ram/rockchip/Kconfig
> > index 8e97c2f49e..c459bbf5e2 100644
> > --- a/drivers/ram/rockchip/Kconfig
> > +++ b/drivers/ram/rockchip/Kconfig
> > @@ -22,6 +22,27 @@ config RAM_ROCKCHIP_DEBUG
> >           This is an option for developers to understand the ram drivers
> >           initialization, configurations and etc.
> >
> > +config RAM_PX30_DDR4
> > +       bool "DDR3 support for Rockchip PX30"
> > +       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> > +       help
> > +         This enables DDR4 sdram support instead of the default DDR3 support
> > +         on Rockchip PC30 SoCs.
> > +
> > +config RAM_PX30_LPDDR2
> > +       bool "LPDDR2 support for Rockchip PX30"
> > +       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> > +       help
> > +         This enables LPDDR2 sdram support instead of the default DDR3 support
> > +         on Rockchip PC30 SoCs.
> > +
> > +config RAM_PX30_LPDDR3
> > +       bool "LPDDR3 support for Rockchip PX30"
> > +       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> > +       help
> > +         This enables LPDDR3 sdram support instead of the default DDR3 support
> > +         on Rockchip PC30 SoCs.
> > +
> >  config RAM_RK3399_LPDDR4
> >         bool "LPDDR4 support for Rockchip RK3399"
> >         depends on RAM_ROCKCHIP && ROCKCHIP_RK3399
> > diff --git a/drivers/ram/rockchip/sdram_px30.c b/drivers/ram/rockchip/sdram_px30.c
> > index fd5763d0a0..2f1f6e9c0c 100644
> > --- a/drivers/ram/rockchip/sdram_px30.c
> > +++ b/drivers/ram/rockchip/sdram_px30.c
> > @@ -125,7 +125,15 @@ u32 addrmap[][8] = {
> >  struct dram_info dram_info;
> >
> >  struct px30_sdram_params sdram_configs[] = {
> > +#if defined(CONFIG_RAM_PX30_DDR4)
> > +#include       "sdram-px30-ddr4-detect-333.inc"
> > +#elif defined(CONFIG_RAM_PX30_LPDDR2)
> > +#include       "sdram-px30-lpddr2-detect-333.inc"
> > +#elif defined(CONFIG_RAM_PX30_LPDDR3)
> > +#include       "sdram-px30-lpddr3-detect-333.inc"
> > +#else
> >  #include       "sdram-px30-ddr3-detect-333.inc"
> > +#endif
> 
> How about putting this in the device tree? I think that would be a better place.

On the PX30 the TPL does the ram initialization and the SRAM it runs in
is very limited, so the PX30-TPL doesn't even have devicetree support
available - hence the ram selection needs to selected at compiletime.

Even right now we're "dancing" very narrowly on the limit ;-)

Heiko

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] ram: rockchip: px30: add a config-based ddr selection
  2020-10-02  5:58   ` Heiko Stübner
@ 2020-10-02  9:18     ` Heiko Stübner
  0 siblings, 0 replies; 8+ messages in thread
From: Heiko Stübner @ 2020-10-02  9:18 UTC (permalink / raw)
  To: u-boot

Hi Simon,

Am Freitag, 2. Oktober 2020, 07:58:35 CEST schrieb Heiko St?bner:
> Am Freitag, 2. Oktober 2020, 04:09:56 CEST schrieb Simon Glass:
> > On Thu, 1 Oct 2020 at 12:40, Heiko Stuebner <heiko@sntech.de> wrote:
> > >
> > > From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> > >
> > > The SRAM on the PX30 is not big enough to hold multiple DDR configs
> > > so it needs to be selected during build.
> > >
> > > So far simply the DDR3 config was always selected and getting DDR4
> > > or LPDDR2/3 initialized would require a code modification.
> > >
> > > So add Kconfig options similar to RK3399 to allow selecting the DDR4
> > > and LPDDR2/3 options instead, while DDR3 stays the default as before.
> > >
> > > Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> > > ---
> > >  drivers/ram/rockchip/Kconfig      | 21 +++++++++++++++++++++
> > >  drivers/ram/rockchip/sdram_px30.c |  8 ++++++++
> > >  2 files changed, 29 insertions(+)
> > >
> > > diff --git a/drivers/ram/rockchip/Kconfig b/drivers/ram/rockchip/Kconfig
> > > index 8e97c2f49e..c459bbf5e2 100644
> > > --- a/drivers/ram/rockchip/Kconfig
> > > +++ b/drivers/ram/rockchip/Kconfig
> > > @@ -22,6 +22,27 @@ config RAM_ROCKCHIP_DEBUG
> > >           This is an option for developers to understand the ram drivers
> > >           initialization, configurations and etc.
> > >
> > > +config RAM_PX30_DDR4
> > > +       bool "DDR3 support for Rockchip PX30"
> > > +       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> > > +       help
> > > +         This enables DDR4 sdram support instead of the default DDR3 support
> > > +         on Rockchip PC30 SoCs.
> > > +
> > > +config RAM_PX30_LPDDR2
> > > +       bool "LPDDR2 support for Rockchip PX30"
> > > +       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> > > +       help
> > > +         This enables LPDDR2 sdram support instead of the default DDR3 support
> > > +         on Rockchip PC30 SoCs.
> > > +
> > > +config RAM_PX30_LPDDR3
> > > +       bool "LPDDR3 support for Rockchip PX30"
> > > +       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> > > +       help
> > > +         This enables LPDDR3 sdram support instead of the default DDR3 support
> > > +         on Rockchip PC30 SoCs.
> > > +
> > >  config RAM_RK3399_LPDDR4
> > >         bool "LPDDR4 support for Rockchip RK3399"
> > >         depends on RAM_ROCKCHIP && ROCKCHIP_RK3399
> > > diff --git a/drivers/ram/rockchip/sdram_px30.c b/drivers/ram/rockchip/sdram_px30.c
> > > index fd5763d0a0..2f1f6e9c0c 100644
> > > --- a/drivers/ram/rockchip/sdram_px30.c
> > > +++ b/drivers/ram/rockchip/sdram_px30.c
> > > @@ -125,7 +125,15 @@ u32 addrmap[][8] = {
> > >  struct dram_info dram_info;
> > >
> > >  struct px30_sdram_params sdram_configs[] = {
> > > +#if defined(CONFIG_RAM_PX30_DDR4)
> > > +#include       "sdram-px30-ddr4-detect-333.inc"
> > > +#elif defined(CONFIG_RAM_PX30_LPDDR2)
> > > +#include       "sdram-px30-lpddr2-detect-333.inc"
> > > +#elif defined(CONFIG_RAM_PX30_LPDDR3)
> > > +#include       "sdram-px30-lpddr3-detect-333.inc"
> > > +#else
> > >  #include       "sdram-px30-ddr3-detect-333.inc"
> > > +#endif
> > 
> > How about putting this in the device tree? I think that would be a better place.
> 
> On the PX30 the TPL does the ram initialization and the SRAM it runs in
> is very limited, so the PX30-TPL doesn't even have devicetree support
> available - hence the ram selection needs to selected at compiletime.
> 
> Even right now we're "dancing" very narrowly on the limit ;-)

Just to provide some more detail, in the PX30-TPL there is neither
devicetree nor driver model support and of the 10240bytes of
available sram, the current TPL binary already uses 10184 bytes.

So right now we have a whopping 56 bytes still available, which doesn't
leave wiggleroom at all and I actually need to hope that uboot stays
on its diet ;-) .


Heiko

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] ram: rockchip: px30: add a config-based ddr selection
  2020-10-02  2:09 ` Simon Glass
  2020-10-02  5:58   ` Heiko Stübner
@ 2020-10-02 14:39   ` Jagan Teki
  1 sibling, 0 replies; 8+ messages in thread
From: Jagan Teki @ 2020-10-02 14:39 UTC (permalink / raw)
  To: u-boot

On Fri, Oct 2, 2020 at 7:40 AM Simon Glass <sjg@chromium.org> wrote:
>
> Hi Heiko,
>
> On Thu, 1 Oct 2020 at 12:40, Heiko Stuebner <heiko@sntech.de> wrote:
> >
> > From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> >
> > The SRAM on the PX30 is not big enough to hold multiple DDR configs
> > so it needs to be selected during build.
> >
> > So far simply the DDR3 config was always selected and getting DDR4
> > or LPDDR2/3 initialized would require a code modification.
> >
> > So add Kconfig options similar to RK3399 to allow selecting the DDR4
> > and LPDDR2/3 options instead, while DDR3 stays the default as before.
> >
> > Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> > ---
> >  drivers/ram/rockchip/Kconfig      | 21 +++++++++++++++++++++
> >  drivers/ram/rockchip/sdram_px30.c |  8 ++++++++
> >  2 files changed, 29 insertions(+)
> >
> > diff --git a/drivers/ram/rockchip/Kconfig b/drivers/ram/rockchip/Kconfig
> > index 8e97c2f49e..c459bbf5e2 100644
> > --- a/drivers/ram/rockchip/Kconfig
> > +++ b/drivers/ram/rockchip/Kconfig
> > @@ -22,6 +22,27 @@ config RAM_ROCKCHIP_DEBUG
> >           This is an option for developers to understand the ram drivers
> >           initialization, configurations and etc.
> >
> > +config RAM_PX30_DDR4
> > +       bool "DDR3 support for Rockchip PX30"
> > +       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> > +       help
> > +         This enables DDR4 sdram support instead of the default DDR3 support
> > +         on Rockchip PC30 SoCs.
> > +
> > +config RAM_PX30_LPDDR2
> > +       bool "LPDDR2 support for Rockchip PX30"
> > +       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> > +       help
> > +         This enables LPDDR2 sdram support instead of the default DDR3 support
> > +         on Rockchip PC30 SoCs.
> > +
> > +config RAM_PX30_LPDDR3
> > +       bool "LPDDR3 support for Rockchip PX30"
> > +       depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> > +       help
> > +         This enables LPDDR3 sdram support instead of the default DDR3 support
> > +         on Rockchip PC30 SoCs.
> > +
> >  config RAM_RK3399_LPDDR4
> >         bool "LPDDR4 support for Rockchip RK3399"
> >         depends on RAM_ROCKCHIP && ROCKCHIP_RK3399
> > diff --git a/drivers/ram/rockchip/sdram_px30.c b/drivers/ram/rockchip/sdram_px30.c
> > index fd5763d0a0..2f1f6e9c0c 100644
> > --- a/drivers/ram/rockchip/sdram_px30.c
> > +++ b/drivers/ram/rockchip/sdram_px30.c
> > @@ -125,7 +125,15 @@ u32 addrmap[][8] = {
> >  struct dram_info dram_info;
> >
> >  struct px30_sdram_params sdram_configs[] = {
> > +#if defined(CONFIG_RAM_PX30_DDR4)
> > +#include       "sdram-px30-ddr4-detect-333.inc"
> > +#elif defined(CONFIG_RAM_PX30_LPDDR2)
> > +#include       "sdram-px30-lpddr2-detect-333.inc"
> > +#elif defined(CONFIG_RAM_PX30_LPDDR3)
> > +#include       "sdram-px30-lpddr3-detect-333.inc"
> > +#else
> >  #include       "sdram-px30-ddr3-detect-333.inc"
> > +#endif
>
> How about putting this in the device tree? I think that would be a better place.

I did try this while support Engicam PX30.Core. Seems impossible to
drive with the timings via device tree.

With PLATDATA and disabled unused drivers in TPL, I still way behind
0x3000 bytes.

  MKIMAGE u-boot.itb
  MKIMAGE tpl/u-boot-tpl-rockchip.bin
Error: SPL image is too large (size 0x5800 than 0x2800)
Error: Bad parameters for image type

Jagan.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] ram: rockchip: px30: add a config-based ddr selection
  2020-10-01 18:40 [PATCH] ram: rockchip: px30: add a config-based ddr selection Heiko Stuebner
  2020-10-02  2:09 ` Simon Glass
@ 2020-10-28 13:13 ` Jagan Teki
  2020-10-30 10:11 ` Kever Yang
  2020-10-30 10:58 ` Philipp Tomsich
  3 siblings, 0 replies; 8+ messages in thread
From: Jagan Teki @ 2020-10-28 13:13 UTC (permalink / raw)
  To: u-boot

On Fri, Oct 2, 2020 at 12:10 AM Heiko Stuebner <heiko@sntech.de> wrote:
>
> From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
>
> The SRAM on the PX30 is not big enough to hold multiple DDR configs
> so it needs to be selected during build.
>
> So far simply the DDR3 config was always selected and getting DDR4
> or LPDDR2/3 initialized would require a code modification.
>
> So add Kconfig options similar to RK3399 to allow selecting the DDR4
> and LPDDR2/3 options instead, while DDR3 stays the default as before.
>
> Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> ---

Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] ram: rockchip: px30: add a config-based ddr selection
  2020-10-01 18:40 [PATCH] ram: rockchip: px30: add a config-based ddr selection Heiko Stuebner
  2020-10-02  2:09 ` Simon Glass
  2020-10-28 13:13 ` Jagan Teki
@ 2020-10-30 10:11 ` Kever Yang
  2020-10-30 10:58 ` Philipp Tomsich
  3 siblings, 0 replies; 8+ messages in thread
From: Kever Yang @ 2020-10-30 10:11 UTC (permalink / raw)
  To: u-boot


On 2020/10/2 ??2:40, Heiko Stuebner wrote:
> From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
>
> The SRAM on the PX30 is not big enough to hold multiple DDR configs
> so it needs to be selected during build.
>
> So far simply the DDR3 config was always selected and getting DDR4
> or LPDDR2/3 initialized would require a code modification.
>
> So add Kconfig options similar to RK3399 to allow selecting the DDR4
> and LPDDR2/3 options instead, while DDR3 stays the default as before.
>
> Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Reviewed-by: Kever Yang<kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
>   drivers/ram/rockchip/Kconfig      | 21 +++++++++++++++++++++
>   drivers/ram/rockchip/sdram_px30.c |  8 ++++++++
>   2 files changed, 29 insertions(+)
>
> diff --git a/drivers/ram/rockchip/Kconfig b/drivers/ram/rockchip/Kconfig
> index 8e97c2f49e..c459bbf5e2 100644
> --- a/drivers/ram/rockchip/Kconfig
> +++ b/drivers/ram/rockchip/Kconfig
> @@ -22,6 +22,27 @@ config RAM_ROCKCHIP_DEBUG
>   	  This is an option for developers to understand the ram drivers
>   	  initialization, configurations and etc.
>   
> +config RAM_PX30_DDR4
> +	bool "DDR3 support for Rockchip PX30"
> +	depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> +	help
> +	  This enables DDR4 sdram support instead of the default DDR3 support
> +	  on Rockchip PC30 SoCs.
> +
> +config RAM_PX30_LPDDR2
> +	bool "LPDDR2 support for Rockchip PX30"
> +	depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> +	help
> +	  This enables LPDDR2 sdram support instead of the default DDR3 support
> +	  on Rockchip PC30 SoCs.
> +
> +config RAM_PX30_LPDDR3
> +	bool "LPDDR3 support for Rockchip PX30"
> +	depends on RAM_ROCKCHIP && ROCKCHIP_PX30
> +	help
> +	  This enables LPDDR3 sdram support instead of the default DDR3 support
> +	  on Rockchip PC30 SoCs.
> +
>   config RAM_RK3399_LPDDR4
>   	bool "LPDDR4 support for Rockchip RK3399"
>   	depends on RAM_ROCKCHIP && ROCKCHIP_RK3399
> diff --git a/drivers/ram/rockchip/sdram_px30.c b/drivers/ram/rockchip/sdram_px30.c
> index fd5763d0a0..2f1f6e9c0c 100644
> --- a/drivers/ram/rockchip/sdram_px30.c
> +++ b/drivers/ram/rockchip/sdram_px30.c
> @@ -125,7 +125,15 @@ u32 addrmap[][8] = {
>   struct dram_info dram_info;
>   
>   struct px30_sdram_params sdram_configs[] = {
> +#if defined(CONFIG_RAM_PX30_DDR4)
> +#include	"sdram-px30-ddr4-detect-333.inc"
> +#elif defined(CONFIG_RAM_PX30_LPDDR2)
> +#include	"sdram-px30-lpddr2-detect-333.inc"
> +#elif defined(CONFIG_RAM_PX30_LPDDR3)
> +#include	"sdram-px30-lpddr3-detect-333.inc"
> +#else
>   #include	"sdram-px30-ddr3-detect-333.inc"
> +#endif
>   };
>   
>   struct ddr_phy_skew skew = {

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] ram: rockchip: px30: add a config-based ddr selection
  2020-10-01 18:40 [PATCH] ram: rockchip: px30: add a config-based ddr selection Heiko Stuebner
                   ` (2 preceding siblings ...)
  2020-10-30 10:11 ` Kever Yang
@ 2020-10-30 10:58 ` Philipp Tomsich
  3 siblings, 0 replies; 8+ messages in thread
From: Philipp Tomsich @ 2020-10-30 10:58 UTC (permalink / raw)
  To: u-boot



> On 01.10.2020, at 20:40, Heiko Stuebner <heiko@sntech.de> wrote:
> 
> From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> 
> The SRAM on the PX30 is not big enough to hold multiple DDR configs
> so it needs to be selected during build.
> 
> So far simply the DDR3 config was always selected and getting DDR4
> or LPDDR2/3 initialized would require a code modification.
> 
> So add Kconfig options similar to RK3399 to allow selecting the DDR4
> and LPDDR2/3 options instead, while DDR3 stays the default as before.
> 
> Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-10-30 10:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-01 18:40 [PATCH] ram: rockchip: px30: add a config-based ddr selection Heiko Stuebner
2020-10-02  2:09 ` Simon Glass
2020-10-02  5:58   ` Heiko Stübner
2020-10-02  9:18     ` Heiko Stübner
2020-10-02 14:39   ` Jagan Teki
2020-10-28 13:13 ` Jagan Teki
2020-10-30 10:11 ` Kever Yang
2020-10-30 10:58 ` Philipp Tomsich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.