]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/armv7/omap-common/hwinit-common.c
armv7:TI: Add <asm/ti-common/sys_proto.h> and migrate omap_hw_init_context
[karo-tx-uboot.git] / arch / arm / cpu / armv7 / omap-common / hwinit-common.c
index 1645120de7af3587d75052da82095b0937e9698d..132454c7b4149354687f77002fe0c2f24ff1adff 100644 (file)
@@ -9,28 +9,12 @@
  *     Aneesh V        <aneesh@ti.com>
  *     Steve Sakoman   <steve@sakoman.com>
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
 #include <spl.h>
 #include <asm/arch/sys_proto.h>
-#include <asm/sizes.h>
+#include <linux/sizes.h>
 #include <asm/emif.h>
 #include <asm/omap_common.h>
 #include <linux/compiler.h>
@@ -59,16 +43,10 @@ static void set_mux_conf_regs(void)
                set_muxconf_regs_essential();
                break;
        case OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL:
-#ifdef CONFIG_SYS_ENABLE_PADS_ALL
-               set_muxconf_regs_non_essential();
-#endif
                break;
        case OMAP_INIT_CONTEXT_UBOOT_FROM_NOR:
        case OMAP_INIT_CONTEXT_UBOOT_AFTER_CH:
                set_muxconf_regs_essential();
-#ifdef CONFIG_SYS_ENABLE_PADS_ALL
-               set_muxconf_regs_non_essential();
-#endif
                break;
        }
 }
@@ -84,7 +62,7 @@ u32 cortex_rev(void)
        return rev;
 }
 
-void omap_rev_string(void)
+static void omap_rev_string(void)
 {
        u32 omap_rev = omap_revision();
        u32 soc_variant = (omap_rev & 0xF0000000) >> 28;
@@ -111,42 +89,6 @@ void __weak srcomp_enable(void)
 {
 }
 
-static void save_omap_boot_params(void)
-{
-       u32 rom_params = *((u32 *)OMAP_SRAM_SCRATCH_BOOT_PARAMS);
-       u8 boot_device;
-       u32 dev_desc, dev_data;
-
-       if ((rom_params <  NON_SECURE_SRAM_START) ||
-           (rom_params > NON_SECURE_SRAM_END))
-               return;
-
-       /*
-        * rom_params can be type casted to omap_boot_parameters and
-        * used. But it not correct to assume that romcode structure
-        * encoding would be same as u-boot. So use the defined offsets.
-        */
-       gd->arch.omap_boot_params.omap_bootdevice = boot_device =
-                                  *((u8 *)(rom_params + BOOT_DEVICE_OFFSET));
-
-       gd->arch.omap_boot_params.ch_flags =
-                               *((u8 *)(rom_params + CH_FLAGS_OFFSET));
-
-       if ((boot_device >= MMC_BOOT_DEVICES_START) &&
-           (boot_device <= MMC_BOOT_DEVICES_END)) {
-               if ((omap_hw_init_context() ==
-                                     OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL)) {
-                       gd->arch.omap_boot_params.omap_bootmode =
-                       *((u8 *)(rom_params + BOOT_MODE_OFFSET));
-               } else {
-                       dev_desc = *((u32 *)(rom_params + DEV_DESC_PTR_OFFSET));
-                       dev_data = *((u32 *)(dev_desc + DEV_DATA_PTR_OFFSET));
-                       gd->arch.omap_boot_params.omap_bootmode =
-                                       *((u32 *)(dev_data + BOOT_MODE_OFFSET));
-               }
-       }
-}
-
 #ifdef CONFIG_ARCH_CPU_INIT
 /*
  * SOC specific cpu init
@@ -202,8 +144,6 @@ void s_init(void)
 #endif
        prcm_init();
 #ifdef CONFIG_SPL_BUILD
-       timer_init();
-
        /* For regular u-boot sdram_init() is called from dram_init() */
        sdram_init();
 #endif
@@ -254,8 +194,8 @@ u32 omap_sdram_size(void)
                addr = section & EMIF_SYS_ADDR_MASK;
 
                /* See if the address is valid */
-               if ((addr >= DRAM_ADDR_SPACE_START) &&
-                   (addr < DRAM_ADDR_SPACE_END)) {
+               if ((addr >= TI_ARMV7_DRAM_ADDR_SPACE_START) &&
+                   (addr < TI_ARMV7_DRAM_ADDR_SPACE_END)) {
                        size = ((section & EMIF_SYS_SIZE_MASK) >>
                                   EMIF_SYS_SIZE_SHIFT);
                        size = 1 << size;
@@ -308,6 +248,7 @@ u32 get_device_type(void)
                                      (DEVICE_TYPE_MASK)) >> DEVICE_TYPE_SHIFT;
 }
 
+#if defined(CONFIG_DISPLAY_CPUINFO)
 /*
  * Print CPU information
  */
@@ -318,6 +259,8 @@ int print_cpuinfo(void)
 
        return 0;
 }
+#endif
+
 #ifndef CONFIG_SYS_DCACHE_OFF
 void enable_caches(void)
 {