Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / board / alliedtelesis / x530 / x530.c
index b34ae51345470fa04a110cb4941931dce502ac21..c7438aeaf1488bc2a46b6796c6244b848921a41b 100644 (file)
@@ -6,8 +6,12 @@
 #include <common.h>
 #include <command.h>
 #include <dm.h>
+#include <env.h>
 #include <i2c.h>
+#include <init.h>
+#include <wdt.h>
 #include <asm/gpio.h>
+#include <linux/bitops.h>
 #include <linux/mbus.h>
 #include <linux/io.h>
 #include <asm/arch/cpu.h>
@@ -57,14 +61,18 @@ static struct mv_ddr_topology_map board_topology_map = {
            SPEED_BIN_DDR_1866M,        /* speed_bin */
            MV_DDR_DEV_WIDTH_16BIT,     /* sdram device width */
            MV_DDR_DIE_CAP_4GBIT,       /* die capacity */
-           MV_DDR_FREQ_933,            /* frequency */
+           MV_DDR_FREQ_SAR,            /* frequency */
            0, 0,                       /* cas_l cas_wl */
            MV_DDR_TEMP_LOW,            /* temperature */
            MV_DDR_TIM_2T} },           /* timing */
        BUS_MASK_32BIT_ECC,             /* subphys mask */
        MV_DDR_CFG_DEFAULT,             /* ddr configuration data source */
        { {0} },                        /* raw spd data */
-       {0}                             /* timing parameters */
+       {0},                            /* timing parameters */
+       { {0} },                        /* electrical configuration */
+       {0},                            /* electrical parameters */
+       0,                              /* Clock enable mask */
+       160                             /* Clock delay */
 };
 
 struct mv_ddr_topology_map *mv_ddr_topology_map_get(void)
@@ -88,6 +96,10 @@ int board_early_init_f(void)
        return 0;
 }
 
+void spl_board_init(void)
+{
+}
+
 int board_init(void)
 {
        /* address of boot parameters */
@@ -100,9 +112,18 @@ int board_init(void)
        /* DEV_READYn is not needed for NVS, ignore it when accessing CS1 */
        writel(0x00004001, MVEBU_DEV_BUS_BASE + 0xc8);
 
+       spl_board_init();
+
        return 0;
 }
 
+void arch_preboot_os(void)
+{
+#ifdef CONFIG_WATCHDOG
+       wdt_stop(gd->watchdog_dev);
+#endif
+}
+
 static int led_7seg_init(unsigned int segments)
 {
        int node;