ARM: at91: sfr: implement DDR input buffers open function
authorEugen Hristev <eugen.hristev@microchip.com>
Thu, 8 Aug 2019 07:48:30 +0000 (07:48 +0000)
committerEugen Hristev <eugen.hristev@microchip.com>
Tue, 8 Oct 2019 06:16:11 +0000 (09:16 +0300)
Add a function in SFR implementation that will open the DDR input
buffers.
This can be called at DRAM initialization time.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
arch/arm/mach-at91/atmel_sfr.c
arch/arm/mach-at91/include/mach/at91_common.h

index 07bd8abe939313cd6644a5222545dc0965917a29..13cfba0ba0c0e9153c442ec29846bfbf4624cd07 100644 (file)
@@ -29,3 +29,14 @@ void configure_2nd_sram_as_l2_cache(void)
 }
 #endif
 
+void configure_ddrcfg_input_buffers(bool open)
+{
+       struct atmel_sfr *sfr = (struct atmel_sfr *)ATMEL_BASE_SFR;
+
+       if (open)
+               writel(ATMEL_SFR_DDRCFG_FDQIEN | ATMEL_SFR_DDRCFG_FDQSIEN,
+                      &sfr->ddrcfg);
+       else
+               writel(0, &sfr->ddrcfg);
+}
+
index df7d0e7051ff0b4805b2024b4614016d7e007277..e929b5e1d207e53286f0ddbd8f52b68014a45395 100644 (file)
@@ -35,6 +35,9 @@ void at91_disable_wdt(void);
 void matrix_init(void);
 void redirect_int_from_saic_to_aic(void);
 void configure_2nd_sram_as_l2_cache(void);
+#ifdef CONFIG_ATMEL_SFR
+void configure_ddrcfg_input_buffers(bool open);
+#endif
 
 int at91_set_ethaddr(int offset);
 int at91_video_show_board_info(void);