2011-11-15 14:49:55 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Functions for omap5 based boards.
|
|
|
|
*
|
|
|
|
* (C) Copyright 2011
|
|
|
|
* Texas Instruments, <www.ti.com>
|
|
|
|
*
|
|
|
|
* Author :
|
|
|
|
* Aneesh V <aneesh@ti.com>
|
|
|
|
* Steve Sakoman <steve@sakoman.com>
|
|
|
|
* Sricharan <r.sricharan@ti.com>
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2011-11-15 14:49:55 +00:00
|
|
|
*/
|
|
|
|
#include <common.h>
|
|
|
|
#include <asm/armv7.h>
|
|
|
|
#include <asm/arch/cpu.h>
|
|
|
|
#include <asm/arch/sys_proto.h>
|
2013-05-30 02:54:32 +00:00
|
|
|
#include <asm/arch/clock.h>
|
2011-11-15 14:49:55 +00:00
|
|
|
#include <asm/sizes.h>
|
|
|
|
#include <asm/utils.h>
|
|
|
|
#include <asm/arch/gpio.h>
|
2012-05-22 00:03:25 +00:00
|
|
|
#include <asm/emif.h>
|
2013-04-24 00:41:22 +00:00
|
|
|
#include <asm/omap_common.h>
|
2011-11-15 14:49:55 +00:00
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2013-04-24 00:41:22 +00:00
|
|
|
u32 *const omap_si_rev = (u32 *)OMAP_SRAM_SCRATCH_OMAP_REV;
|
2011-11-15 14:49:55 +00:00
|
|
|
|
2013-06-21 10:54:25 +00:00
|
|
|
static struct gpio_bank gpio_bank_54xx[8] = {
|
2011-11-15 14:49:55 +00:00
|
|
|
{ (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 },
|
2013-06-21 10:54:25 +00:00
|
|
|
{ (void *)OMAP54XX_GPIO7_BASE, METHOD_GPIO_24XX },
|
|
|
|
{ (void *)OMAP54XX_GPIO8_BASE, METHOD_GPIO_24XX },
|
2011-11-15 14:49:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const struct gpio_bank *const omap_gpio_bank = gpio_bank_54xx;
|
|
|
|
|
|
|
|
#ifdef CONFIG_SPL_BUILD
|
2012-05-22 00:03:23 +00:00
|
|
|
/* LPDDR2 specific IO settings */
|
|
|
|
static void io_settings_lpddr2(void)
|
|
|
|
{
|
2013-02-04 04:22:05 +00:00
|
|
|
const struct ctrl_ioregs *ioregs;
|
|
|
|
|
|
|
|
get_ioregs(&ioregs);
|
|
|
|
writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch1_0);
|
|
|
|
writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch1_1);
|
|
|
|
writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch2_0);
|
|
|
|
writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch2_1);
|
|
|
|
writel(ioregs->ctrl_lpddr2ch, (*ctrl)->control_lpddr2ch1_0);
|
|
|
|
writel(ioregs->ctrl_lpddr2ch, (*ctrl)->control_lpddr2ch1_1);
|
|
|
|
writel(ioregs->ctrl_ddrio_0, (*ctrl)->control_ddrio_0);
|
|
|
|
writel(ioregs->ctrl_ddrio_1, (*ctrl)->control_ddrio_1);
|
|
|
|
writel(ioregs->ctrl_ddrio_2, (*ctrl)->control_ddrio_2);
|
2012-05-22 00:03:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* DDR3 specific IO settings */
|
|
|
|
static void io_settings_ddr3(void)
|
|
|
|
{
|
|
|
|
u32 io_settings = 0;
|
2013-02-04 04:22:05 +00:00
|
|
|
const struct ctrl_ioregs *ioregs;
|
2012-05-22 00:03:23 +00:00
|
|
|
|
2013-02-04 04:22:05 +00:00
|
|
|
get_ioregs(&ioregs);
|
|
|
|
writel(ioregs->ctrl_ddr3ch, (*ctrl)->control_ddr3ch1_0);
|
|
|
|
writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch1_0);
|
|
|
|
writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch1_1);
|
2012-05-22 00:03:23 +00:00
|
|
|
|
2013-02-04 04:22:05 +00:00
|
|
|
writel(ioregs->ctrl_ddr3ch, (*ctrl)->control_ddr3ch2_0);
|
|
|
|
writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch2_0);
|
|
|
|
writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch2_1);
|
2012-05-22 00:03:23 +00:00
|
|
|
|
2013-02-04 04:22:05 +00:00
|
|
|
writel(ioregs->ctrl_ddrio_0, (*ctrl)->control_ddrio_0);
|
|
|
|
writel(ioregs->ctrl_ddrio_1, (*ctrl)->control_ddrio_1);
|
|
|
|
writel(ioregs->ctrl_ddrio_2, (*ctrl)->control_ddrio_2);
|
2012-05-22 00:03:23 +00:00
|
|
|
|
|
|
|
/* omap5432 does not use lpddr2 */
|
2013-02-04 04:22:05 +00:00
|
|
|
writel(ioregs->ctrl_lpddr2ch, (*ctrl)->control_lpddr2ch1_0);
|
|
|
|
writel(ioregs->ctrl_lpddr2ch, (*ctrl)->control_lpddr2ch1_1);
|
2012-05-22 00:03:23 +00:00
|
|
|
|
2013-02-04 04:22:05 +00:00
|
|
|
writel(ioregs->ctrl_emif_sdram_config_ext,
|
|
|
|
(*ctrl)->control_emif1_sdram_config_ext);
|
|
|
|
writel(ioregs->ctrl_emif_sdram_config_ext,
|
|
|
|
(*ctrl)->control_emif2_sdram_config_ext);
|
2012-05-22 00:03:23 +00:00
|
|
|
|
2013-05-30 03:19:39 +00:00
|
|
|
if (is_omap54xx()) {
|
|
|
|
/* Disable DLL select */
|
|
|
|
io_settings = (readl((*ctrl)->control_port_emif1_sdram_config)
|
2012-05-22 00:03:23 +00:00
|
|
|
& 0xFFEFFFFF);
|
2013-05-30 03:19:39 +00:00
|
|
|
writel(io_settings,
|
|
|
|
(*ctrl)->control_port_emif1_sdram_config);
|
2012-05-22 00:03:23 +00:00
|
|
|
|
2013-05-30 03:19:39 +00:00
|
|
|
io_settings = (readl((*ctrl)->control_port_emif2_sdram_config)
|
2012-05-22 00:03:23 +00:00
|
|
|
& 0xFFEFFFFF);
|
2013-05-30 03:19:39 +00:00
|
|
|
writel(io_settings,
|
|
|
|
(*ctrl)->control_port_emif2_sdram_config);
|
|
|
|
} else {
|
|
|
|
writel(ioregs->ctrl_ddr_ctrl_ext_0,
|
|
|
|
(*ctrl)->control_ddr_control_ext_0);
|
|
|
|
}
|
2012-05-22 00:03:23 +00:00
|
|
|
}
|
|
|
|
|
2011-11-15 14:49:55 +00:00
|
|
|
/*
|
|
|
|
* Some tuning of IOs for optimal power and performance
|
|
|
|
*/
|
|
|
|
void do_io_settings(void)
|
|
|
|
{
|
2012-03-12 02:25:36 +00:00
|
|
|
u32 io_settings = 0, mask = 0;
|
|
|
|
|
|
|
|
/* Impedance settings EMMC, C2C 1,2, hsi2 */
|
|
|
|
mask = (ds_mask << 2) | (ds_mask << 8) |
|
|
|
|
(ds_mask << 16) | (ds_mask << 18);
|
2013-02-04 04:22:04 +00:00
|
|
|
io_settings = readl((*ctrl)->control_smart1io_padconf_0) &
|
2012-03-12 02:25:36 +00:00
|
|
|
(~mask);
|
|
|
|
io_settings |= (ds_60_ohm << 8) | (ds_45_ohm << 16) |
|
|
|
|
(ds_45_ohm << 18) | (ds_60_ohm << 2);
|
2013-02-04 04:22:04 +00:00
|
|
|
writel(io_settings, (*ctrl)->control_smart1io_padconf_0);
|
2012-03-12 02:25:36 +00:00
|
|
|
|
|
|
|
/* Impedance settings Mcspi2 */
|
|
|
|
mask = (ds_mask << 30);
|
2013-02-04 04:22:04 +00:00
|
|
|
io_settings = readl((*ctrl)->control_smart1io_padconf_1) &
|
2012-03-12 02:25:36 +00:00
|
|
|
(~mask);
|
|
|
|
io_settings |= (ds_60_ohm << 30);
|
2013-02-04 04:22:04 +00:00
|
|
|
writel(io_settings, (*ctrl)->control_smart1io_padconf_1);
|
2012-03-12 02:25:36 +00:00
|
|
|
|
|
|
|
/* Impedance settings C2C 3,4 */
|
|
|
|
mask = (ds_mask << 14) | (ds_mask << 16);
|
2013-02-04 04:22:04 +00:00
|
|
|
io_settings = readl((*ctrl)->control_smart1io_padconf_2) &
|
2012-03-12 02:25:36 +00:00
|
|
|
(~mask);
|
|
|
|
io_settings |= (ds_45_ohm << 14) | (ds_45_ohm << 16);
|
2013-02-04 04:22:04 +00:00
|
|
|
writel(io_settings, (*ctrl)->control_smart1io_padconf_2);
|
2012-03-12 02:25:36 +00:00
|
|
|
|
|
|
|
/* Slew rate settings EMMC, C2C 1,2 */
|
|
|
|
mask = (sc_mask << 8) | (sc_mask << 16) | (sc_mask << 18);
|
2013-02-04 04:22:04 +00:00
|
|
|
io_settings = readl((*ctrl)->control_smart2io_padconf_0) &
|
2012-03-12 02:25:36 +00:00
|
|
|
(~mask);
|
|
|
|
io_settings |= (sc_fast << 8) | (sc_na << 16) | (sc_na << 18);
|
2013-02-04 04:22:04 +00:00
|
|
|
writel(io_settings, (*ctrl)->control_smart2io_padconf_0);
|
2012-03-12 02:25:36 +00:00
|
|
|
|
|
|
|
/* Slew rate settings hsi2, Mcspi2 */
|
|
|
|
mask = (sc_mask << 24) | (sc_mask << 28);
|
2013-02-04 04:22:04 +00:00
|
|
|
io_settings = readl((*ctrl)->control_smart2io_padconf_1) &
|
2012-03-12 02:25:36 +00:00
|
|
|
(~mask);
|
|
|
|
io_settings |= (sc_fast << 28) | (sc_fast << 24);
|
2013-02-04 04:22:04 +00:00
|
|
|
writel(io_settings, (*ctrl)->control_smart2io_padconf_1);
|
2012-03-12 02:25:36 +00:00
|
|
|
|
|
|
|
/* Slew rate settings C2C 3,4 */
|
|
|
|
mask = (sc_mask << 16) | (sc_mask << 18);
|
2013-02-04 04:22:04 +00:00
|
|
|
io_settings = readl((*ctrl)->control_smart2io_padconf_2) &
|
2012-03-12 02:25:36 +00:00
|
|
|
(~mask);
|
|
|
|
io_settings |= (sc_na << 16) | (sc_na << 18);
|
2013-02-04 04:22:04 +00:00
|
|
|
writel(io_settings, (*ctrl)->control_smart2io_padconf_2);
|
2012-03-12 02:25:36 +00:00
|
|
|
|
|
|
|
/* impedance and slew rate settings for usb */
|
|
|
|
mask = (usb_i_mask << 29) | (usb_i_mask << 26) | (usb_i_mask << 23) |
|
|
|
|
(usb_i_mask << 20) | (usb_i_mask << 17) | (usb_i_mask << 14);
|
2013-02-04 04:22:04 +00:00
|
|
|
io_settings = readl((*ctrl)->control_smart3io_padconf_1) &
|
2012-03-12 02:25:36 +00:00
|
|
|
(~mask);
|
|
|
|
io_settings |= (ds_60_ohm << 29) | (ds_60_ohm << 26) |
|
|
|
|
(ds_60_ohm << 23) | (sc_fast << 20) |
|
|
|
|
(sc_fast << 17) | (sc_fast << 14);
|
2013-02-04 04:22:04 +00:00
|
|
|
writel(io_settings, (*ctrl)->control_smart3io_padconf_1);
|
2012-03-12 02:25:36 +00:00
|
|
|
|
2013-02-04 04:21:59 +00:00
|
|
|
if (emif_sdram_type() == EMIF_SDRAM_TYPE_LPDDR2)
|
2012-05-22 00:03:23 +00:00
|
|
|
io_settings_lpddr2();
|
|
|
|
else
|
|
|
|
io_settings_ddr3();
|
2011-11-15 14:49:55 +00:00
|
|
|
}
|
2013-02-12 01:33:45 +00:00
|
|
|
|
|
|
|
static const struct srcomp_params srcomp_parameters[NUM_SYS_CLKS] = {
|
|
|
|
{0x45, 0x1}, /* 12 MHz */
|
|
|
|
{-1, -1}, /* 13 MHz */
|
|
|
|
{0x63, 0x2}, /* 16.8 MHz */
|
|
|
|
{0x57, 0x2}, /* 19.2 MHz */
|
|
|
|
{0x20, 0x1}, /* 26 MHz */
|
|
|
|
{-1, -1}, /* 27 MHz */
|
|
|
|
{0x41, 0x3} /* 38.4 MHz */
|
|
|
|
};
|
|
|
|
|
|
|
|
void srcomp_enable(void)
|
|
|
|
{
|
|
|
|
u32 srcomp_value, mul_factor, div_factor, clk_val, i;
|
|
|
|
u32 sysclk_ind = get_sys_clk_index();
|
|
|
|
u32 omap_rev = omap_revision();
|
|
|
|
|
2013-05-30 03:19:32 +00:00
|
|
|
if (!is_omap54xx())
|
|
|
|
return;
|
|
|
|
|
2013-02-12 01:33:45 +00:00
|
|
|
mul_factor = srcomp_parameters[sysclk_ind].multiply_factor;
|
|
|
|
div_factor = srcomp_parameters[sysclk_ind].divide_factor;
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
srcomp_value = readl((*ctrl)->control_srcomp_north_side + i*4);
|
|
|
|
srcomp_value &=
|
|
|
|
~(MULTIPLY_FACTOR_XS_MASK | DIVIDE_FACTOR_XS_MASK);
|
|
|
|
srcomp_value |= (mul_factor << MULTIPLY_FACTOR_XS_SHIFT) |
|
|
|
|
(div_factor << DIVIDE_FACTOR_XS_SHIFT);
|
|
|
|
writel(srcomp_value, (*ctrl)->control_srcomp_north_side + i*4);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((omap_rev == OMAP5430_ES1_0) || (omap_rev == OMAP5432_ES1_0)) {
|
|
|
|
clk_val = readl((*prcm)->cm_coreaon_io_srcomp_clkctrl);
|
|
|
|
clk_val |= OPTFCLKEN_SRCOMP_FCLK_MASK;
|
|
|
|
writel(clk_val, (*prcm)->cm_coreaon_io_srcomp_clkctrl);
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
srcomp_value =
|
|
|
|
readl((*ctrl)->control_srcomp_north_side + i*4);
|
|
|
|
srcomp_value &= ~PWRDWN_XS_MASK;
|
|
|
|
writel(srcomp_value,
|
|
|
|
(*ctrl)->control_srcomp_north_side + i*4);
|
|
|
|
|
|
|
|
while (((readl((*ctrl)->control_srcomp_north_side + i*4)
|
|
|
|
& SRCODE_READ_XS_MASK) >>
|
|
|
|
SRCODE_READ_XS_SHIFT) == 0)
|
|
|
|
;
|
|
|
|
|
|
|
|
srcomp_value =
|
|
|
|
readl((*ctrl)->control_srcomp_north_side + i*4);
|
|
|
|
srcomp_value &= ~OVERRIDE_XS_MASK;
|
|
|
|
writel(srcomp_value,
|
|
|
|
(*ctrl)->control_srcomp_north_side + i*4);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
srcomp_value = readl((*ctrl)->control_srcomp_east_side_wkup);
|
|
|
|
srcomp_value &= ~(MULTIPLY_FACTOR_XS_MASK |
|
|
|
|
DIVIDE_FACTOR_XS_MASK);
|
|
|
|
srcomp_value |= (mul_factor << MULTIPLY_FACTOR_XS_SHIFT) |
|
|
|
|
(div_factor << DIVIDE_FACTOR_XS_SHIFT);
|
|
|
|
writel(srcomp_value, (*ctrl)->control_srcomp_east_side_wkup);
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
srcomp_value =
|
|
|
|
readl((*ctrl)->control_srcomp_north_side + i*4);
|
|
|
|
srcomp_value |= SRCODE_OVERRIDE_SEL_XS_MASK;
|
|
|
|
writel(srcomp_value,
|
|
|
|
(*ctrl)->control_srcomp_north_side + i*4);
|
|
|
|
|
|
|
|
srcomp_value =
|
|
|
|
readl((*ctrl)->control_srcomp_north_side + i*4);
|
|
|
|
srcomp_value &= ~OVERRIDE_XS_MASK;
|
|
|
|
writel(srcomp_value,
|
|
|
|
(*ctrl)->control_srcomp_north_side + i*4);
|
|
|
|
}
|
|
|
|
|
|
|
|
srcomp_value =
|
|
|
|
readl((*ctrl)->control_srcomp_east_side_wkup);
|
|
|
|
srcomp_value |= SRCODE_OVERRIDE_SEL_XS_MASK;
|
|
|
|
writel(srcomp_value, (*ctrl)->control_srcomp_east_side_wkup);
|
|
|
|
|
|
|
|
srcomp_value =
|
|
|
|
readl((*ctrl)->control_srcomp_east_side_wkup);
|
|
|
|
srcomp_value &= ~OVERRIDE_XS_MASK;
|
|
|
|
writel(srcomp_value, (*ctrl)->control_srcomp_east_side_wkup);
|
|
|
|
|
|
|
|
clk_val = readl((*prcm)->cm_coreaon_io_srcomp_clkctrl);
|
|
|
|
clk_val |= OPTFCLKEN_SRCOMP_FCLK_MASK;
|
|
|
|
writel(clk_val, (*prcm)->cm_coreaon_io_srcomp_clkctrl);
|
|
|
|
|
|
|
|
clk_val = readl((*prcm)->cm_wkupaon_io_srcomp_clkctrl);
|
|
|
|
clk_val |= OPTFCLKEN_SRCOMP_FCLK_MASK;
|
|
|
|
writel(clk_val, (*prcm)->cm_wkupaon_io_srcomp_clkctrl);
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
while (((readl((*ctrl)->control_srcomp_north_side + i*4)
|
|
|
|
& SRCODE_READ_XS_MASK) >>
|
|
|
|
SRCODE_READ_XS_SHIFT) == 0)
|
|
|
|
;
|
|
|
|
|
|
|
|
srcomp_value =
|
|
|
|
readl((*ctrl)->control_srcomp_north_side + i*4);
|
|
|
|
srcomp_value &= ~SRCODE_OVERRIDE_SEL_XS_MASK;
|
|
|
|
writel(srcomp_value,
|
|
|
|
(*ctrl)->control_srcomp_north_side + i*4);
|
|
|
|
}
|
|
|
|
|
|
|
|
while (((readl((*ctrl)->control_srcomp_east_side_wkup) &
|
|
|
|
SRCODE_READ_XS_MASK) >> SRCODE_READ_XS_SHIFT) == 0)
|
|
|
|
;
|
|
|
|
|
|
|
|
srcomp_value =
|
|
|
|
readl((*ctrl)->control_srcomp_east_side_wkup);
|
|
|
|
srcomp_value &= ~SRCODE_OVERRIDE_SEL_XS_MASK;
|
|
|
|
writel(srcomp_value, (*ctrl)->control_srcomp_east_side_wkup);
|
|
|
|
}
|
|
|
|
}
|
2011-11-15 14:49:55 +00:00
|
|
|
#endif
|
|
|
|
|
2012-05-22 00:03:25 +00:00
|
|
|
void config_data_eye_leveling_samples(u32 emif_base)
|
|
|
|
{
|
2013-11-08 12:10:37 +00:00
|
|
|
const struct ctrl_ioregs *ioregs;
|
|
|
|
|
|
|
|
get_ioregs(&ioregs);
|
|
|
|
|
2012-05-22 00:03:25 +00:00
|
|
|
/*EMIF_SDRAM_CONFIG_EXT-Read data eye leveling no of samples =4*/
|
|
|
|
if (emif_base == EMIF1_BASE)
|
2013-11-08 12:10:37 +00:00
|
|
|
writel(ioregs->ctrl_emif_sdram_config_ext_final,
|
|
|
|
(*ctrl)->control_emif1_sdram_config_ext);
|
2012-05-22 00:03:25 +00:00
|
|
|
else if (emif_base == EMIF2_BASE)
|
2013-11-08 12:10:37 +00:00
|
|
|
writel(ioregs->ctrl_emif_sdram_config_ext_final,
|
|
|
|
(*ctrl)->control_emif2_sdram_config_ext);
|
2012-05-22 00:03:25 +00:00
|
|
|
}
|
|
|
|
|
2011-11-15 14:49:55 +00:00
|
|
|
void init_omap_revision(void)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* For some of the ES2/ES1 boards ID_CODE is not reliable:
|
|
|
|
* Also, ES1 and ES2 have different ARM revisions
|
|
|
|
* So use ARM revision for identification
|
|
|
|
*/
|
|
|
|
unsigned int rev = cortex_rev();
|
|
|
|
|
2013-02-12 01:33:41 +00:00
|
|
|
switch (readl(CONTROL_ID_CODE)) {
|
|
|
|
case OMAP5430_CONTROL_ID_CODE_ES1_0:
|
|
|
|
*omap_si_rev = OMAP5430_ES1_0;
|
|
|
|
if (rev == MIDR_CORTEX_A15_R2P2)
|
|
|
|
*omap_si_rev = OMAP5430_ES2_0;
|
|
|
|
break;
|
|
|
|
case OMAP5432_CONTROL_ID_CODE_ES1_0:
|
|
|
|
*omap_si_rev = OMAP5432_ES1_0;
|
|
|
|
if (rev == MIDR_CORTEX_A15_R2P2)
|
|
|
|
*omap_si_rev = OMAP5432_ES2_0;
|
|
|
|
break;
|
|
|
|
case OMAP5430_CONTROL_ID_CODE_ES2_0:
|
|
|
|
*omap_si_rev = OMAP5430_ES2_0;
|
|
|
|
break;
|
|
|
|
case OMAP5432_CONTROL_ID_CODE_ES2_0:
|
|
|
|
*omap_si_rev = OMAP5432_ES2_0;
|
2012-03-12 02:25:39 +00:00
|
|
|
break;
|
2013-02-12 21:29:03 +00:00
|
|
|
case DRA752_CONTROL_ID_CODE_ES1_0:
|
|
|
|
*omap_si_rev = DRA752_ES1_0;
|
|
|
|
break;
|
2011-11-15 14:49:55 +00:00
|
|
|
default:
|
2012-03-12 02:25:40 +00:00
|
|
|
*omap_si_rev = OMAP5430_SILICON_ID_INVALID;
|
2011-11-15 14:49:55 +00:00
|
|
|
}
|
|
|
|
}
|
2012-03-12 02:25:52 +00:00
|
|
|
|
|
|
|
void reset_cpu(ulong ignored)
|
|
|
|
{
|
|
|
|
u32 omap_rev = omap_revision();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* WARM reset is not functional in case of OMAP5430 ES1.0 soc.
|
|
|
|
* So use cold reset in case instead.
|
|
|
|
*/
|
|
|
|
if (omap_rev == OMAP5430_ES1_0)
|
2013-02-17 23:33:37 +00:00
|
|
|
writel(PRM_RSTCTRL_RESET << 0x1, (*prcm)->prm_rstctrl);
|
2012-03-12 02:25:52 +00:00
|
|
|
else
|
2013-02-17 23:33:37 +00:00
|
|
|
writel(PRM_RSTCTRL_RESET, (*prcm)->prm_rstctrl);
|
|
|
|
}
|
|
|
|
|
|
|
|
u32 warm_reset(void)
|
|
|
|
{
|
|
|
|
return readl((*prcm)->prm_rstst) & PRM_RSTST_WARM_RESET_MASK;
|
2012-03-12 02:25:52 +00:00
|
|
|
}
|
2013-04-17 20:49:40 +00:00
|
|
|
|
|
|
|
void setup_warmreset_time(void)
|
|
|
|
{
|
|
|
|
u32 rst_time, rst_val;
|
|
|
|
|
|
|
|
#ifndef CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC
|
|
|
|
rst_time = CONFIG_DEFAULT_OMAP_RESET_TIME_MAX_USEC;
|
|
|
|
#else
|
|
|
|
rst_time = CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC;
|
|
|
|
#endif
|
|
|
|
rst_time = usec_to_32k(rst_time) << RSTTIME1_SHIFT;
|
|
|
|
|
|
|
|
if (rst_time > RSTTIME1_MASK)
|
|
|
|
rst_time = RSTTIME1_MASK;
|
|
|
|
|
|
|
|
rst_val = readl((*prcm)->prm_rsttime) & ~RSTTIME1_MASK;
|
|
|
|
rst_val |= rst_time;
|
|
|
|
writel(rst_val, (*prcm)->prm_rsttime);
|
|
|
|
}
|