summaryrefslogtreecommitdiff
path: root/arch/arm/mach-socfpga/spl_s10.c
diff options
context:
space:
mode:
authorLey Foon Tan <ley.foon.tan@intel.com>2019-05-06 04:56:01 +0300
committerMarek Vasut <marex@denx.de>2019-05-06 13:44:17 +0300
commit6bf238a46192bf9164da4548178d657dde4e1c96 (patch)
tree0913f06b09797e4ac3bcd228004b53a89826295e /arch/arm/mach-socfpga/spl_s10.c
parentbc179908769637cb800ad8c111290e7cae6ead79 (diff)
downloadu-boot-6bf238a46192bf9164da4548178d657dde4e1c96.tar.xz
arm: socfpga: Move Stratix 10 SDRAM driver to DM
Convert Stratix 10 SDRAM driver to device model. Get rid of call to socfpga_per_reset() and use reset framework. SPL is changed from calling function in SDRAM driver directly to just probing UCLASS_RAM. Move sdram_s10.h from arch to driver/ddr/altera directory. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Diffstat (limited to 'arch/arm/mach-socfpga/spl_s10.c')
-rw-r--r--arch/arm/mach-socfpga/spl_s10.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/arm/mach-socfpga/spl_s10.c b/arch/arm/mach-socfpga/spl_s10.c
index a141ffe82a..ec65e1ce64 100644
--- a/arch/arm/mach-socfpga/spl_s10.c
+++ b/arch/arm/mach-socfpga/spl_s10.c
@@ -15,9 +15,9 @@
#include <asm/arch/firewall_s10.h>
#include <asm/arch/mailbox_s10.h>
#include <asm/arch/reset_manager.h>
-#include <asm/arch/sdram_s10.h>
#include <asm/arch/system_manager.h>
#include <watchdog.h>
+#include <dm/uclass.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -175,11 +175,15 @@ void board_init_f(ulong dummy)
clrbits_le32(CCU_REG_ADDR(CCU_IOM_MPRT_ADMASK_MEM_RAM0),
CCU_ADMASK_P_MASK | CCU_ADMASK_NS_MASK);
- debug("DDR: Initializing Hard Memory Controller\n");
- if (sdram_mmr_init_full(0)) {
- puts("DDR: Initialization failed.\n");
- hang();
- }
+#if CONFIG_IS_ENABLED(ALTERA_SDRAM)
+ struct udevice *dev;
+
+ ret = uclass_get_device(UCLASS_RAM, 0, &dev);
+ if (ret) {
+ debug("DRAM init failed: %d\n", ret);
+ hang();
+ }
+#endif
mbox_init();