ARM: am335x: Add phyCORE AM335x R2 support
[oweals/u-boot.git] / board / highbank / highbank.c
index e8132b842fc89634c44c732934510c9c76017ba5..996daffa1b64574fb13b8c1b5becbfa785d3a510 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2010-2011 Calxeda, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -35,6 +34,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+void cphy_disable_overrides(void);
+
 /*
  * Miscellaneous platform dependent initialisations
  */
@@ -62,9 +63,10 @@ void scsi_init(void)
 {
        u32 reg = readl(HB_SREG_A9_PWRDOM_STAT);
 
+       cphy_disable_overrides();
        if (reg & PWRDOM_STAT_SATA) {
                ahci_init((void __iomem *)HB_AHCI_BASE);
-               scsi_scan(1);
+               scsi_scan(true);
        }
 }
 #endif
@@ -77,11 +79,11 @@ int misc_init_r(void)
 
        boot_choice = readl(HB_SREG_A9_BOOT_SRC_STAT) & 0xff;
        sprintf(envbuffer, "bootcmd%d", boot_choice);
-       if (getenv(envbuffer)) {
+       if (env_get(envbuffer)) {
                sprintf(envbuffer, "run bootcmd%d", boot_choice);
-               setenv("bootcmd", envbuffer);
+               env_set("bootcmd", envbuffer);
        } else
-               setenv("bootcmd", "");
+               env_set("bootcmd", "");
 
        return 0;
 }
@@ -93,12 +95,6 @@ int dram_init(void)
        return 0;
 }
 
-void dram_init_banksize(void)
-{
-       gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
-       gd->bd->bi_dram[0].size =  PHYS_SDRAM_1_SIZE;
-}
-
 #if defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *fdt, bd_t *bd)
 {
@@ -136,3 +132,12 @@ void reset_cpu(ulong addr)
 
        wfi();
 }
+
+/*
+ * turn off the override before transferring control to Linux, since Linux
+ * may not support spread spectrum.
+ */
+void arch_preboot_os(void)
+{
+       cphy_disable_overrides();
+}