Skip to content

Commit

Permalink
Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-aribaud-u-boot committed May 11, 2013
2 parents c1b43ac + 47c6ea0 commit cac423a
Show file tree
Hide file tree
Showing 85 changed files with 1,561 additions and 422 deletions.
3 changes: 2 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ Enric Balletbo i Serra <eballetbo@iseebcn.com>
igep0020 ARM ARMV7 (OMAP3xx SoC)
igep0030 ARM ARMV7 (OMAP3xx SoC)
igep0032 ARM ARMV7 (OMAP3xx SoC)
igep0033 ARM ARMV7 (AM33xx Soc)

Eric Benard <eric@eukrea.com>

Expand Down Expand Up @@ -684,7 +685,7 @@ Simon Guinot <simon.guinot@sequanux.org>

Igor Grinberg <grinberg@compulab.co.il>

cm-t35 ARM ARMV7 (OMAP3xx Soc)
cm_t35 ARM ARMV7 (OMAP3xx Soc)

Stefan Herbrechtsmeier <stefan@code.herbrechtsmeier.net>

Expand Down
4 changes: 4 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -3340,6 +3340,10 @@ Configuration Settings:
offset _bss_start_ofs from CONFIG_SYS_TEXT_BASE, rather than
directly. You should not need to touch this setting.

- CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC (OMAP only)
This is set by OMAP boards for the max time that reset should
be asserted. See doc/README.omap-reset-time for details on how
the value can be calulated on a given board.

The following definitions that deal with the placement and management
of environment data (variable area); in general, we support the
Expand Down
8 changes: 8 additions & 0 deletions arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
#include <asm/arch/emif_defs.h>
#include <asm/arch/pll_defs.h>

void davinci_enable_uart0(void)
{
lpsc_on(DAVINCI_LPSC_UART0);

/* Bringup UART0 out of reset */
REG(UART0_PWREMU_MGMT) = 0x00006001;
}

#if defined(CONFIG_SYS_DA850_PLL_INIT)
void da850_waitloop(unsigned long loopcnt)
{
Expand Down
103 changes: 101 additions & 2 deletions arch/arm/cpu/armv7/am33xx/clock_ti814x.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ struct ad_pll {
#define OSC_SRC_CTRL (PLL_SUBSYS_BASE + 0x2C0)

/* PRCM */
#define ENET_CLKCTRL_CMPL 0x30000

#define CM_DEFAULT_BASE (PRCM_BASE + 0x0500)

struct cm_def {
Expand Down Expand Up @@ -183,7 +185,7 @@ struct cm_alwon {
unsigned int resv5[2];
unsigned int gpmcclkctrl;
unsigned int ethernet0clkctrl;
unsigned int resv6[1];
unsigned int ethernet1clkctrl;
unsigned int mpuclkctrl;
unsigned int debugssclkctrl;
unsigned int l3clkctrl;
Expand All @@ -203,9 +205,67 @@ struct cm_alwon {
unsigned int custefuseclkctrl;
};

#define SATA_PLL_BASE (CTRL_BASE + 0x0720)

struct sata_pll {
unsigned int pllcfg0;
unsigned int pllcfg1;
unsigned int pllcfg2;
unsigned int pllcfg3;
unsigned int pllcfg4;
unsigned int pllstatus;
unsigned int rxstatus;
unsigned int txstatus;
unsigned int testcfg;
};

#define SEL_IN_FREQ (0x1 << 31)
#define DIGCLRZ (0x1 << 30)
#define ENDIGLDO (0x1 << 4)
#define APLL_CP_CURR (0x1 << 3)
#define ENBGSC_REF (0x1 << 2)
#define ENPLLLDO (0x1 << 1)
#define ENPLL (0x1 << 0)

#define SATA_PLLCFG0_1 (SEL_IN_FREQ | ENBGSC_REF)
#define SATA_PLLCFG0_2 (SEL_IN_FREQ | ENDIGLDO | ENBGSC_REF)
#define SATA_PLLCFG0_3 (SEL_IN_FREQ | ENDIGLDO | ENBGSC_REF | ENPLLLDO)
#define SATA_PLLCFG0_4 (SEL_IN_FREQ | DIGCLRZ | ENDIGLDO | ENBGSC_REF | \
ENPLLLDO | ENPLL)

#define PLL_LOCK (0x1 << 0)

#define ENSATAMODE (0x1 << 31)
#define PLLREFSEL (0x1 << 30)
#define MDIVINT (0x4b << 18)
#define EN_CLKAUX (0x1 << 5)
#define EN_CLK125M (0x1 << 4)
#define EN_CLK100M (0x1 << 3)
#define EN_CLK50M (0x1 << 2)

#define SATA_PLLCFG1 (ENSATAMODE | \
PLLREFSEL | \
MDIVINT | \
EN_CLKAUX | \
EN_CLK125M | \
EN_CLK100M | \
EN_CLK50M)

#define DIGLDO_EN_CAPLESSMODE (0x1 << 22)
#define PLLDO_EN_LDO_STABLE (0x1 << 11)
#define PLLDO_EN_BUF_CUR (0x1 << 7)
#define PLLDO_EN_LP (0x1 << 6)
#define PLLDO_CTRL_TRIM_1_4V (0x10 << 1)

#define SATA_PLLCFG3 (DIGLDO_EN_CAPLESSMODE | \
PLLDO_EN_LDO_STABLE | \
PLLDO_EN_BUF_CUR | \
PLLDO_EN_LP | \
PLLDO_CTRL_TRIM_1_4V)

const struct cm_alwon *cmalwon = (struct cm_alwon *)CM_ALWON_BASE;
const struct cm_def *cmdef = (struct cm_def *)CM_DEFAULT_BASE;
const struct sata_pll *spll = (struct sata_pll *)SATA_PLL_BASE;

/*
* Enable the peripheral clock for required peripherals
Expand All @@ -221,6 +281,15 @@ static void enable_per_clocks(void)
writel(PRCM_MOD_EN, &cmalwon->mmchs1clkctrl);
while (readl(&cmalwon->mmchs1clkctrl) != PRCM_MOD_EN)
;

/* Ethernet */
writel(PRCM_MOD_EN, &cmalwon->ethclkstctrl);
writel(PRCM_MOD_EN, &cmalwon->ethernet0clkctrl);
while ((readl(&cmalwon->ethernet0clkctrl) & ENET_CLKCTRL_CMPL) != 0)
;
writel(PRCM_MOD_EN, &cmalwon->ethernet1clkctrl);
while ((readl(&cmalwon->ethernet1clkctrl) & ENET_CLKCTRL_CMPL) != 0)
;
}

/*
Expand Down Expand Up @@ -365,6 +434,35 @@ void ddr_pll_config(unsigned int ddrpll_m)
pll_config(DDR_PLL_BASE, DDR_N, DDR_M, DDR_M2, DDR_CLKCTRL, 1);
}

void sata_pll_config(void)
{
/*
* This sequence for configuring the SATA PLL
* resident in the control module is documented
* in TI8148 TRM section 21.3.1
*/
writel(SATA_PLLCFG1, &spll->pllcfg1);
udelay(50);

writel(SATA_PLLCFG3, &spll->pllcfg3);
udelay(50);

writel(SATA_PLLCFG0_1, &spll->pllcfg0);
udelay(50);

writel(SATA_PLLCFG0_2, &spll->pllcfg0);
udelay(50);

writel(SATA_PLLCFG0_3, &spll->pllcfg0);
udelay(50);

writel(SATA_PLLCFG0_4, &spll->pllcfg0);
udelay(50);

while (((readl(&spll->pllstatus) & PLL_LOCK) == 0))
;
}

void enable_emif_clocks(void) {};

void enable_dmm_clocks(void)
Expand Down Expand Up @@ -397,9 +495,10 @@ void pll_init()
/* Enable the control module */
writel(PRCM_MOD_EN, &cmalwon->controlclkctrl);

/* Configure PLLs */
mpu_pll_config();

l3_pll_config();
sata_pll_config();

/* Enable the required peripherals */
enable_per_clocks();
Expand Down
6 changes: 1 addition & 5 deletions arch/arm/cpu/armv7/am33xx/sys_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ u32 get_sysboot_value(void)
int print_cpuinfo(void)
{
char *cpu_s, *sec_s;
int arm_freq, ddr_freq;

switch (get_cpu_type()) {
case AM335X:
Expand Down Expand Up @@ -123,10 +122,7 @@ int print_cpuinfo(void)
sec_s = "?";
}

printf("%s-%s rev %d\n",
cpu_s, sec_s, get_cpu_rev());

/* TODO: Print ARM and DDR frequencies */
printf("%s-%s rev %d\n", cpu_s, sec_s, get_cpu_rev());

return 0;
}
Expand Down
8 changes: 7 additions & 1 deletion arch/arm/cpu/armv7/lowlevel_init.S
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ ENTRY(lowlevel_init)
*/
ldr sp, =CONFIG_SYS_INIT_SP_ADDR
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */

#ifdef CONFIG_SPL_BUILD
ldr r8, =gdata
#else
sub sp, #GD_SIZE
bic sp, sp, #7
mov r8, sp
#endif
/*
* Save the old lr(passed in ip) and the current lr to stack
*/
Expand Down
31 changes: 14 additions & 17 deletions arch/arm/cpu/armv7/omap-common/boot-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,17 @@
#include <asm/arch/mmc_host_def.h>
#include <asm/arch/sys_proto.h>

/*
* This is used to verify if the configuration header
* was executed by rom code prior to control of transfer
* to the bootloader. SPL is responsible for saving and
* passing the boot_params pointer to the u-boot.
*/
struct omap_boot_parameters boot_params __attribute__ ((section(".data")));
DECLARE_GLOBAL_DATA_PTR;

#ifdef CONFIG_SPL_BUILD
/*
* We use static variables because global data is not ready yet.
* Initialized data is available in SPL right from the beginning.
* We would not typically need to save these parameters in regular
* U-Boot. This is needed only in SPL at the moment.
*/
u32 omap_bootmode = MMCSD_MODE_FAT;

u32 spl_boot_device(void)
{
return (u32) (boot_params.omap_bootdevice);
return (u32) (gd->arch.omap_boot_params.omap_bootdevice);
}

u32 spl_boot_mode(void)
{
return omap_bootmode;
return gd->arch.omap_boot_params.omap_bootmode;
}

void spl_board_init(void)
Expand All @@ -73,4 +59,15 @@ int board_mmc_init(bd_t *bis)
}
return 0;
}

void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
{
typedef void __noreturn (*image_entry_noargs_t)(u32 *);
image_entry_noargs_t image_entry =
(image_entry_noargs_t) spl_image->entry_point;

debug("image entry point: 0x%X\n", spl_image->entry_point);
/* Pass the saved boot_params from rom code */
image_entry((u32 *)&gd->arch.omap_boot_params);
}
#endif
1 change: 1 addition & 0 deletions arch/arm/cpu/armv7/omap-common/clocks-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,7 @@ void prcm_init(void)
setup_non_essential_dplls();
enable_non_essential_clocks();
#endif
setup_warmreset_time();
break;
default:
break;
Expand Down
11 changes: 8 additions & 3 deletions arch/arm/cpu/armv7/omap-common/emif-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,11 @@ static void do_sdram_init(u32 base)
else
ddr3_init(base, regs);
}
if (warm_reset() && (emif_sdram_type() == EMIF_SDRAM_TYPE_DDR3)) {
set_lpmode_selfrefresh(base);
emif_reset_phy(base);
ddr3_leveling(base, regs);
}

/* Write to the shadow registers */
emif_update_timings(base, regs);
Expand Down Expand Up @@ -1262,10 +1267,10 @@ void sdram_init(void)
in_sdram = running_from_sdram();
debug("in_sdram = %d\n", in_sdram);

if (!(in_sdram || warm_reset())) {
if (sdram_type == EMIF_SDRAM_TYPE_LPDDR2)
if (!in_sdram) {
if ((sdram_type == EMIF_SDRAM_TYPE_LPDDR2) && !warm_reset())
bypass_dpll((*prcm)->cm_clkmode_dpll_core);
else
else if (sdram_type == EMIF_SDRAM_TYPE_DDR3)
writel(CM_DLL_CTRL_NO_OVERRIDE, (*prcm)->cm_dll_ctrl);
}

Expand Down
Loading

0 comments on commit cac423a

Please sign in to comment.