]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/armv7/omap5/hwinit.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[karo-tx-uboot.git] / arch / arm / cpu / armv7 / omap5 / hwinit.c
index e192fea0ebccfd141bc37346f2f8e975003c74f4..1065891ae1f91ea5666ff0d6329ad40f2bc29cbb 100644 (file)
  *     Steve Sakoman   <steve@sakoman.com>
  *     Sricharan       <r.sricharan@ti.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 <asm/armv7.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/sys_proto.h>
-#include <asm/arch/clocks.h>
+#include <asm/arch/clock.h>
 #include <asm/sizes.h>
 #include <asm/utils.h>
 #include <asm/arch/gpio.h>
@@ -43,13 +27,15 @@ DECLARE_GLOBAL_DATA_PTR;
 
 u32 *const omap_si_rev = (u32 *)OMAP_SRAM_SCRATCH_OMAP_REV;
 
-static struct gpio_bank gpio_bank_54xx[6] = {
+static struct gpio_bank gpio_bank_54xx[8] = {
        { (void *)OMAP54XX_GPIO1_BASE, METHOD_GPIO_24XX },
        { (void *)OMAP54XX_GPIO2_BASE, METHOD_GPIO_24XX },
        { (void *)OMAP54XX_GPIO3_BASE, METHOD_GPIO_24XX },
        { (void *)OMAP54XX_GPIO4_BASE, METHOD_GPIO_24XX },
        { (void *)OMAP54XX_GPIO5_BASE, METHOD_GPIO_24XX },
        { (void *)OMAP54XX_GPIO6_BASE, METHOD_GPIO_24XX },
+       { (void *)OMAP54XX_GPIO7_BASE, METHOD_GPIO_24XX },
+       { (void *)OMAP54XX_GPIO8_BASE, METHOD_GPIO_24XX },
 };
 
 const struct gpio_bank *const omap_gpio_bank = gpio_bank_54xx;
@@ -100,16 +86,21 @@ static void io_settings_ddr3(void)
        writel(ioregs->ctrl_emif_sdram_config_ext,
               (*ctrl)->control_emif2_sdram_config_ext);
 
-       /* Disable DLL select */
-       io_settings = (readl((*ctrl)->control_port_emif1_sdram_config)
+       if (is_omap54xx()) {
+               /* Disable DLL select */
+               io_settings = (readl((*ctrl)->control_port_emif1_sdram_config)
                                                        & 0xFFEFFFFF);
-       writel(io_settings,
-               (*ctrl)->control_port_emif1_sdram_config);
+               writel(io_settings,
+                       (*ctrl)->control_port_emif1_sdram_config);
 
-       io_settings = (readl((*ctrl)->control_port_emif2_sdram_config)
+               io_settings = (readl((*ctrl)->control_port_emif2_sdram_config)
                                                        & 0xFFEFFFFF);
-       writel(io_settings,
-               (*ctrl)->control_port_emif2_sdram_config);
+               writel(io_settings,
+                       (*ctrl)->control_port_emif2_sdram_config);
+       } else {
+               writel(ioregs->ctrl_ddr_ctrl_ext_0,
+                               (*ctrl)->control_ddr_control_ext_0);
+       }
 }
 
 /*
@@ -201,6 +192,9 @@ void srcomp_enable(void)
        u32 sysclk_ind  = get_sys_clk_index();
        u32 omap_rev    = omap_revision();
 
+       if (!is_omap54xx())
+               return;
+
        mul_factor = srcomp_parameters[sysclk_ind].multiply_factor;
        div_factor = srcomp_parameters[sysclk_ind].divide_factor;