Skip to content

Commit

Permalink
Merge branch 'u-boot-imx/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 Mar 15, 2013
2 parents c44bb3a + 19a0f7f commit 6579d15
Show file tree
Hide file tree
Showing 77 changed files with 5,683 additions and 2,758 deletions.
8 changes: 8 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,14 @@ Pali Rohár <pali.rohar@gmail.com>

nokia_rx51 ARM ARMV7 (OMAP34xx SoC)

Eric Nelson <eric.nelson@boundarydevices.com>
nitrogen6dl i.MX6DL 1GB
nitrogen6dl2g i.MX6DL 2GB
nitrogen6q i.MX6Q/6D 1GB
nitrogen6q2g i.MX6Q/6D 2GB
nitrogen6s i.MX6S 512MB
nitrogen6s1g i.MX6S 1GB

-------------------------------------------------------------------------

Unknown / orphaned boards:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,8 @@ $(obj)u-boot.img: $(obj)u-boot.bin
sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
-d $< $@

$(OBJTREE)/u-boot.imx : $(obj)u-boot.bin $(SUBDIR_TOOLS) depend
$(MAKE) -C $(SRCTREE)/arch/arm/imx-common $@
$(obj)u-boot.imx: $(obj)u-boot.bin depend
$(MAKE) -C $(SRCTREE)/arch/arm/imx-common $(OBJTREE)/u-boot.imx

$(obj)u-boot.kwb: $(obj)u-boot.bin
$(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/cpu/arm926ejs/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT)

ifneq ($(CONFIG_IMX_CONFIG),)

ALL-y += $(OBJTREE)/u-boot.imx
ALL-y += $(obj)u-boot.imx

endif
3 changes: 2 additions & 1 deletion arch/arm/cpu/arm926ejs/mxs/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ static uint32_t mxs_get_sspclk(enum mxs_sspclock ssp)
void mxs_set_ssp_busclock(unsigned int bus, uint32_t freq)
{
struct mxs_ssp_regs *ssp_regs;
const uint32_t sspclk = mxs_get_sspclk(bus);
const enum mxs_sspclock clk = mxs_ssp_clock_by_bus(bus);
const uint32_t sspclk = mxs_get_sspclk(clk);
uint32_t reg;
uint32_t divide, rate, tgtclk;

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/cpu/arm926ejs/mxs/mxs_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void early_delay(int delay);

void mxs_power_init(void);

#ifdef CONFIG_SPL_MX28_PSWITCH_WAIT
#ifdef CONFIG_SPL_MXS_PSWITCH_WAIT
void mxs_power_wait_pswitch(void);
#else
static inline void mxs_power_wait_pswitch(void) { }
Expand Down
16 changes: 14 additions & 2 deletions arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <config.h>
#include <asm/io.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/sys_proto.h>
#include <linux/compiler.h>

#include "mxs_init.h"
Expand Down Expand Up @@ -119,6 +120,10 @@ static void initialize_dram_values(void)
writel(dram_vals[i], MXS_DRAM_BASE + (4 * i));

#ifdef CONFIG_MX23
/*
* Enable tRAS lockout in HW_DRAM_CTL08 ; it must be the last
* element to be set
*/
writel((1 << 24), MXS_DRAM_BASE + (4 * 8));
#endif
}
Expand Down Expand Up @@ -229,21 +234,28 @@ static void mx23_mem_setup_vddmem(void)
struct mxs_power_regs *power_regs =
(struct mxs_power_regs *)MXS_POWER_BASE;

writel((0x12 << POWER_VDDMEMCTRL_TRG_OFFSET) |
writel((0x10 << POWER_VDDMEMCTRL_TRG_OFFSET) |
POWER_VDDMEMCTRL_ENABLE_ILIMIT |
POWER_VDDMEMCTRL_ENABLE_LINREG |
POWER_VDDMEMCTRL_PULLDOWN_ACTIVE,
&power_regs->hw_power_vddmemctrl);

early_delay(10000);

writel((0x12 << POWER_VDDMEMCTRL_TRG_OFFSET) |
writel((0x10 << POWER_VDDMEMCTRL_TRG_OFFSET) |
POWER_VDDMEMCTRL_ENABLE_LINREG,
&power_regs->hw_power_vddmemctrl);
}

static void mx23_mem_init(void)
{
/*
* Reset/ungate the EMI block. This is essential, otherwise the system
* suffers from memory instability. This thing is mx23 specific and is
* no longer present on mx28.
*/
mxs_reset_block((struct mxs_register_32 *)MXS_EMI_BASE);

mx23_mem_setup_vddmem();

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/cpu/arm926ejs/mxs/spl_power_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ void mxs_power_init(void)
early_delay(1000);
}

#ifdef CONFIG_SPL_MX28_PSWITCH_WAIT
#ifdef CONFIG_SPL_MXS_PSWITCH_WAIT
void mxs_power_wait_pswitch(void)
{
struct mxs_power_regs *power_regs =
Expand Down
39 changes: 29 additions & 10 deletions arch/arm/cpu/arm926ejs/mxs/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
#include <asm/arch/sys_proto.h>

/* Maximum fixed count */
#define TIMER_LOAD_VAL 0xffffffff
#if defined(CONFIG_MX23)
#define TIMER_LOAD_VAL 0xffff
#elif defined(CONFIG_MX28)
#define TIMER_LOAD_VAL 0xffffffff
#endif

DECLARE_GLOBAL_DATA_PTR;

Expand All @@ -42,22 +46,22 @@ DECLARE_GLOBAL_DATA_PTR;
/*
* This driver uses 1kHz clock source.
*/
#define MX28_INCREMENTER_HZ 1000
#define MXS_INCREMENTER_HZ 1000

static inline unsigned long tick_to_time(unsigned long tick)
{
return tick / (MX28_INCREMENTER_HZ / CONFIG_SYS_HZ);
return tick / (MXS_INCREMENTER_HZ / CONFIG_SYS_HZ);
}

static inline unsigned long time_to_tick(unsigned long time)
{
return time * (MX28_INCREMENTER_HZ / CONFIG_SYS_HZ);
return time * (MXS_INCREMENTER_HZ / CONFIG_SYS_HZ);
}

/* Calculate how many ticks happen in "us" microseconds */
static inline unsigned long us_to_tick(unsigned long us)
{
return (us * MX28_INCREMENTER_HZ) / 1000000;
return (us * MXS_INCREMENTER_HZ) / 1000000;
}

int timer_init(void)
Expand All @@ -69,15 +73,23 @@ int timer_init(void)
mxs_reset_block(&timrot_regs->hw_timrot_rotctrl_reg);

/* Set fixed_count to 0 */
#if defined(CONFIG_MX23)
writel(0, &timrot_regs->hw_timrot_timcount0);
#elif defined(CONFIG_MX28)
writel(0, &timrot_regs->hw_timrot_fixed_count0);
#endif

/* Set UPDATE bit and 1Khz frequency */
writel(TIMROT_TIMCTRLn_UPDATE | TIMROT_TIMCTRLn_RELOAD |
TIMROT_TIMCTRLn_SELECT_1KHZ_XTAL,
&timrot_regs->hw_timrot_timctrl0);

/* Set fixed_count to maximal value */
#if defined(CONFIG_MX23)
writel(TIMER_LOAD_VAL - 1, &timrot_regs->hw_timrot_timcount0);
#elif defined(CONFIG_MX28)
writel(TIMER_LOAD_VAL, &timrot_regs->hw_timrot_fixed_count0);
#endif

return 0;
}
Expand All @@ -86,9 +98,16 @@ unsigned long long get_ticks(void)
{
struct mxs_timrot_regs *timrot_regs =
(struct mxs_timrot_regs *)MXS_TIMROT_BASE;
uint32_t now;

/* Current tick value */
uint32_t now = readl(&timrot_regs->hw_timrot_running_count0);
#if defined(CONFIG_MX23)
/* Upper bits are the valid ones. */
now = readl(&timrot_regs->hw_timrot_timcount0) >>
TIMROT_RUNNING_COUNTn_RUNNING_COUNT_OFFSET;
#elif defined(CONFIG_MX28)
now = readl(&timrot_regs->hw_timrot_running_count0);
#endif

if (lastdec >= now) {
/*
Expand Down Expand Up @@ -117,17 +136,17 @@ ulong get_timer(ulong base)
}

/* We use the HW_DIGCTL_MICROSECONDS register for sub-millisecond timer. */
#define MX28_HW_DIGCTL_MICROSECONDS 0x8001c0c0
#define MXS_HW_DIGCTL_MICROSECONDS 0x8001c0c0

void __udelay(unsigned long usec)
{
uint32_t old, new, incr;
uint32_t counter = 0;

old = readl(MX28_HW_DIGCTL_MICROSECONDS);
old = readl(MXS_HW_DIGCTL_MICROSECONDS);

while (counter < usec) {
new = readl(MX28_HW_DIGCTL_MICROSECONDS);
new = readl(MXS_HW_DIGCTL_MICROSECONDS);

/* Check if the timer wrapped. */
if (new < old) {
Expand All @@ -152,5 +171,5 @@ void __udelay(unsigned long usec)

ulong get_tbclk(void)
{
return MX28_INCREMENTER_HZ;
return MXS_INCREMENTER_HZ;
}
2 changes: 1 addition & 1 deletion arch/arm/cpu/armv7/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ COBJS += cache_v7.o
COBJS += cpu.o
COBJS += syslib.o

ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA),)
ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6),)
SOBJS += lowlevel_init.o
endif

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/cpu/armv7/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ PF_NO_UNALIGNED := $(call cc-option, -mno-unaligned-access,)
PLATFORM_NO_UNALIGNED := $(PF_NO_UNALIGNED)

ifneq ($(CONFIG_IMX_CONFIG),)
ALL-y += $(OBJTREE)/u-boot.imx
ALL-y += $(obj)u-boot.imx
endif
1 change: 0 additions & 1 deletion arch/arm/cpu/armv7/mx6/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(SOC).o

COBJS = soc.o clock.o
SOBJS = lowlevel_init.o

SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
Expand Down
35 changes: 0 additions & 35 deletions arch/arm/cpu/armv7/mx6/lowlevel_init.S

This file was deleted.

16 changes: 16 additions & 0 deletions arch/arm/cpu/armv7/mx6/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <asm/arch/clock.h>
#include <asm/arch/sys_proto.h>
#include <asm/imx-common/boot_mode.h>
#include <stdbool.h>

struct scu_regs {
u32 ctrl;
Expand Down Expand Up @@ -121,12 +122,23 @@ void set_vddsoc(u32 mv)
writel(reg, &anatop->reg_core);
}

static void imx_set_wdog_powerdown(bool enable)
{
struct wdog_regs *wdog1 = (struct wdog_regs *)WDOG1_BASE_ADDR;
struct wdog_regs *wdog2 = (struct wdog_regs *)WDOG2_BASE_ADDR;

/* Write to the PDE (Power Down Enable) bit */
writew(enable, &wdog1->wmcr);
writew(enable, &wdog2->wmcr);
}

int arch_cpu_init(void)
{
init_aips();

set_vddsoc(1200); /* Set VDDSOC to 1.2V */

imx_set_wdog_powerdown(false); /* Disable PDE bit of WMCR register */
return 0;
}

Expand Down Expand Up @@ -193,3 +205,7 @@ const struct boot_mode soc_boot_modes[] = {
{"esdhc4", MAKE_CFGVAL(0x40, 0x38, 0x00, 0x00)},
{NULL, 0},
};

void s_init(void)
{
}
12 changes: 12 additions & 0 deletions arch/arm/include/asm/arch-mx6/crm_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@
#ifndef __ARCH_ARM_MACH_MX6_CCM_REGS_H__
#define __ARCH_ARM_MACH_MX6_CCM_REGS_H__

#define CCM_CCGR0 0x020C4068
#define CCM_CCGR1 0x020C406c
#define CCM_CCGR2 0x020C4070
#define CCM_CCGR3 0x020C4074
#define CCM_CCGR4 0x020C4078
#define CCM_CCGR5 0x020C407c
#define CCM_CCGR6 0x020C4080

#define PMU_MISC2 0x020C8170

#ifndef __ASSEMBLY__
struct mxc_ccm_reg {
u32 ccr; /* 0x0000 */
u32 ccdr;
Expand Down Expand Up @@ -105,6 +116,7 @@ struct mxc_ccm_reg {
u32 analog_pfd_528_clr;
u32 analog_pfd_528_tog;
};
#endif

/* Define the bits in register CCR */
#define MXC_CCM_CCR_RBC_EN (1 << 27)
Expand Down
8 changes: 8 additions & 0 deletions arch/arm/include/asm/arch-mx6/imx-regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -601,5 +601,13 @@ struct iomuxc_base_regs {
u32 daisy[104]; /* 0x7b0..94c */
};

struct wdog_regs {
u16 wcr; /* Control */
u16 wsr; /* Service */
u16 wrsr; /* Reset Status */
u16 wicr; /* Interrupt Control */
u16 wmcr; /* Miscellaneous Control */
};

#endif /* __ASSEMBLER__*/
#endif /* __ASM_ARCH_MX6_IMX_REGS_H__ */
5 changes: 5 additions & 0 deletions arch/arm/include/asm/arch-mx6/iomux.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

#ifndef __ASM_ARCH_IOMUX_H__
#define __ASM_ARCH_IOMUX_H__

#define MX6_IOMUXC_GPR4 0x020e0010
#define MX6_IOMUXC_GPR6 0x020e0018
#define MX6_IOMUXC_GPR7 0x020e001c

/*
* IOMUXC_GPR13 bit fields
*/
Expand Down
Loading

0 comments on commit 6579d15

Please sign in to comment.