From: Jagan Teki Subject: [PATCH] rockchip: rk3399: spl: Don't init dram if TPL enabled Date: Wed, 8 May 2019 12:09:56 +0530 Message-ID: <20190508063956.26549-1-jagan@amarulasolutions.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+glpar-linux-rockchip=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Simon Glass , Philipp Tomsich , Kever Yang , Akash Gajjar Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-amarula-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org, Jagan Teki , u-boot-0aAXYlwwYIKGBzrmiIFOJg@public.gmane.org List-Id: linux-rockchip.vger.kernel.org DRAM init would require in - TPL stage if target support TPL and - SPL stage if target support SPL alone So, don't initialize the dram in SPL if TPL defined and at the same time enable it if TPL undefined which is SPL alone. Tested in TPL and SPL supported boards. Signed-off-by: Jagan Teki --- arch/arm/mach-rockchip/rk3399-board-spl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c index 3eea73ef33..a439e09b61 100644 --- a/arch/arm/mach-rockchip/rk3399-board-spl.c +++ b/arch/arm/mach-rockchip/rk3399-board-spl.c @@ -198,11 +198,13 @@ void board_init_f(ulong dummy) return; } +#if !defined(SUPPORT_TPL) ret = uclass_get_device(UCLASS_RAM, 0, &dev); if (ret) { pr_err("DRAM init failed: %d\n", ret); return; } +#endif } #if defined(SPL_GPIO_SUPPORT) -- 2.18.0.321.gffc6fa0e3