Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / mach-rockchip / rk3036 / rk3036.c
index 481af8a934493f7ab7a7b9d7d0011f0d5a78da51..e9e020ff3f5862c0ceb621b9cfd6b90c0ee7fd68 100644 (file)
@@ -2,9 +2,15 @@
 /*
  * (C) Copyright 2019 Rockchip Electronics Co., Ltd
  */
+
+#include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch-rockchip/grf_rk3036.h>
 #include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/sdram_rk3036.h>
+
+DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 void board_debug_uart_init(void)
@@ -36,3 +42,16 @@ void board_debug_uart_init(void)
                     GPIO1C2_UART2_SIN << GPIO1C2_SHIFT);
 }
 #endif
+
+#if !CONFIG_IS_ENABLED(RAM)
+/*
+ * When CONFIG_RAM is enabled, the dram_init() function is implemented
+ * in sdram.c.
+ */
+int dram_init(void)
+{
+       gd->ram_size = sdram_size();
+
+       return 0;
+}
+#endif