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 Aug 17, 2013
2 parents 425faf7 + 326ea98 commit 9ed887c
Show file tree
Hide file tree
Showing 28 changed files with 601 additions and 1,966 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,6 @@ Jason Liu <r64343@freescale.com>
mx53evk i.MX53
mx53loco i.MX53
mx6qarm2 i.MX6Q
mx6qsabrelite i.MX6Q

Enric Balletbo i Serra <eballetbo@iseebcn.com>

Expand Down Expand Up @@ -1072,6 +1071,7 @@ Pali Rohár <pali.rohar@gmail.com>
nokia_rx51 ARM ARMV7 (OMAP34xx SoC)

Eric Nelson <eric.nelson@boundarydevices.com>
mx6qsabrelite i.MX6Q 1GB
nitrogen6dl i.MX6DL 1GB
nitrogen6dl2g i.MX6DL 2GB
nitrogen6q i.MX6Q/6D 1GB
Expand Down
15 changes: 15 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -2629,6 +2629,21 @@ CBFS (Coreboot Filesystem) support
Note: There is also a sha1sum command, which should perhaps
be deprecated in favour of 'hash sha1'.

- Freescale i.MX specific commands:
CONFIG_CMD_HDMIDETECT
This enables 'hdmidet' command which returns true if an
HDMI monitor is detected. This command is i.MX 6 specific.

CONFIG_CMD_BMODE
This enables the 'bmode' (bootmode) command for forcing
a boot from specific media.

This is useful for forcing the ROM's usb downloader to
activate upon a watchdog reset which is nice when iterating
on U-Boot. Using the reset button or running bmode normal
will set it back to normal. This command currently
supports i.MX53 and i.MX6.

- Signing support:
CONFIG_RSA

Expand Down
8 changes: 8 additions & 0 deletions arch/arm/cpu/armv7/mx6/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,14 @@ int do_mx6_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 0;
}

void enable_ipu_clock(void)
{
struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
int reg;
reg = readl(&mxc_ccm->CCGR3);
reg |= MXC_CCM_CCGR3_IPU1_IPU_DI0_OFFSET;
writel(reg, &mxc_ccm->CCGR3);
}
/***************************************************/

U_BOOT_CMD(
Expand Down
43 changes: 43 additions & 0 deletions arch/arm/cpu/armv7/mx6/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <asm/imx-common/boot_mode.h>
#include <asm/imx-common/dma.h>
#include <stdbool.h>
#include <asm/arch/mxc_hdmi.h>
#include <asm/arch/crm_regs.h>

struct scu_regs {
u32 ctrl;
Expand Down Expand Up @@ -212,3 +214,44 @@ const struct boot_mode soc_boot_modes[] = {
void s_init(void)
{
}

#ifdef CONFIG_IMX_HDMI
void imx_enable_hdmi_phy(void)
{
struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;
u8 reg;
reg = readb(&hdmi->phy_conf0);
reg |= HDMI_PHY_CONF0_PDZ_MASK;
writeb(reg, &hdmi->phy_conf0);
udelay(3000);
reg |= HDMI_PHY_CONF0_ENTMDS_MASK;
writeb(reg, &hdmi->phy_conf0);
udelay(3000);
reg |= HDMI_PHY_CONF0_GEN2_TXPWRON_MASK;
writeb(reg, &hdmi->phy_conf0);
writeb(HDMI_MC_PHYRSTZ_ASSERT, &hdmi->mc_phyrstz);
}

void imx_setup_hdmi(void)
{
struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;
int reg;

/* Turn on HDMI PHY clock */
reg = readl(&mxc_ccm->CCGR2);
reg |= MXC_CCM_CCGR2_HDMI_TX_IAHBCLK_MASK|
MXC_CCM_CCGR2_HDMI_TX_ISFRCLK_MASK;
writel(reg, &mxc_ccm->CCGR2);
writeb(HDMI_MC_PHYRSTZ_DEASSERT, &hdmi->mc_phyrstz);
reg = readl(&mxc_ccm->chsccdr);
reg &= ~(MXC_CCM_CHSCCDR_IPU1_DI0_PRE_CLK_SEL_MASK|
MXC_CCM_CHSCCDR_IPU1_DI0_PODF_MASK|
MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_MASK);
reg |= (CHSCCDR_PODF_DIVIDE_BY_3
<< MXC_CCM_CHSCCDR_IPU1_DI0_PODF_OFFSET)
|(CHSCCDR_IPU_PRE_CLK_540M_PFD
<< MXC_CCM_CHSCCDR_IPU1_DI0_PRE_CLK_SEL_OFFSET);
writel(reg, &mxc_ccm->chsccdr);
}
#endif
3 changes: 1 addition & 2 deletions arch/arm/imx-common/cmd_hdmidet.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
static int do_hdmidet(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;
u8 reg = readb(&hdmi->phy_stat0) & HDMI_PHY_HPD;
return (reg&HDMI_PHY_HPD) ? 0 : 1;
return (readb(&hdmi->phy_stat0) & HDMI_DVI_STAT) ? 0 : 1;
}

U_BOOT_CMD(hdmidet, 1, 1, do_hdmidet,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/include/asm/arch-mx6/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ void enable_ocotp_clk(unsigned char enable);
void enable_usboh3_clk(unsigned char enable);
int enable_sata_clock(void);
int enable_i2c_clk(unsigned char enable, unsigned i2c_num);

void enable_ipu_clock(void);
#endif /* __ASM_ARCH_CLOCK_H */
8 changes: 8 additions & 0 deletions arch/arm/include/asm/arch-mx6/mxc_hdmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
#ifndef __MXC_HDMI_H__
#define __MXC_HDMI_H__

#ifdef CONFIG_IMX_HDMI
void imx_enable_hdmi_phy(void);
void imx_setup_hdmi(void);
#endif

/*
* Hdmi controller registers
*/
Expand Down Expand Up @@ -884,6 +889,9 @@ enum {
HDMI_PHY_HPD = 0x02,
HDMI_PHY_TX_PHY_LOCK = 0x01,

/* Convenience macro RX_SENSE | HPD */
HDMI_DVI_STAT = 0xF2,

/* PHY_I2CM_SLAVE_ADDR field values */
HDMI_PHY_I2CM_SLAVE_ADDR_PHY_GEN2 = 0x69,
HDMI_PHY_I2CM_SLAVE_ADDR_HEAC_PHY = 0x49,
Expand Down
File renamed without changes.
46 changes: 8 additions & 38 deletions board/boundary/nitrogen6x/nitrogen6x.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,25 +461,12 @@ struct display_info_t {
static int detect_hdmi(struct display_info_t const *dev)
{
struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;
return readb(&hdmi->phy_stat0) & HDMI_PHY_HPD;
return readb(&hdmi->phy_stat0) & HDMI_DVI_STAT;
}

static void enable_hdmi(struct display_info_t const *dev)
static void do_enable_hdmi(struct display_info_t const *dev)
{
struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;
u8 reg;
printf("%s: setup HDMI monitor\n", __func__);
reg = readb(&hdmi->phy_conf0);
reg |= HDMI_PHY_CONF0_PDZ_MASK;
writeb(reg, &hdmi->phy_conf0);

udelay(3000);
reg |= HDMI_PHY_CONF0_ENTMDS_MASK;
writeb(reg, &hdmi->phy_conf0);
udelay(3000);
reg |= HDMI_PHY_CONF0_GEN2_TXPWRON_MASK;
writeb(reg, &hdmi->phy_conf0);
writeb(HDMI_MC_PHYRSTZ_ASSERT, &hdmi->mc_phyrstz);
imx_enable_hdmi_phy();
}

static int detect_i2c(struct display_info_t const *dev)
Expand Down Expand Up @@ -512,7 +499,7 @@ static struct display_info_t const displays[] = {{
.addr = 0,
.pixfmt = IPU_PIX_FMT_RGB24,
.detect = detect_hdmi,
.enable = enable_hdmi,
.enable = do_enable_hdmi,
.mode = {
.name = "HDMI",
.refresh = 60,
Expand Down Expand Up @@ -637,25 +624,15 @@ static void setup_display(void)
struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;

int reg;

enable_ipu_clock();
imx_setup_hdmi();
/* Turn on LDB0,IPU,IPU DI0 clocks */
reg = __raw_readl(&mxc_ccm->CCGR3);
reg |= MXC_CCM_CCGR3_IPU1_IPU_DI0_OFFSET
|MXC_CCM_CCGR3_LDB_DI0_MASK;
reg |= MXC_CCM_CCGR3_LDB_DI0_MASK;
writel(reg, &mxc_ccm->CCGR3);

/* Turn on HDMI PHY clock */
reg = __raw_readl(&mxc_ccm->CCGR2);
reg |= MXC_CCM_CCGR2_HDMI_TX_IAHBCLK_MASK
|MXC_CCM_CCGR2_HDMI_TX_ISFRCLK_MASK;
writel(reg, &mxc_ccm->CCGR2);

/* clear HDMI PHY reset */
writeb(HDMI_MC_PHYRSTZ_DEASSERT, &hdmi->mc_phyrstz);

/* set PFD1_FRAC to 0x13 == 455 MHz (480*18)/0x13 */
writel(ANATOP_PFD_480_PFD1_FRAC_MASK, &anatop->pfd_480_clr);
writel(0x13<<ANATOP_PFD_480_PFD1_FRAC_SHIFT, &anatop->pfd_480_set);
Expand All @@ -673,15 +650,8 @@ static void setup_display(void)
writel(reg, &mxc_ccm->cscmr2);

reg = readl(&mxc_ccm->chsccdr);
reg &= ~(MXC_CCM_CHSCCDR_IPU1_DI0_PRE_CLK_SEL_MASK
|MXC_CCM_CHSCCDR_IPU1_DI0_PODF_MASK
|MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_MASK);
reg |= (CHSCCDR_CLK_SEL_LDB_DI0
<<MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET)
|(CHSCCDR_PODF_DIVIDE_BY_3
<<MXC_CCM_CHSCCDR_IPU1_DI0_PODF_OFFSET)
|(CHSCCDR_IPU_PRE_CLK_540M_PFD
<<MXC_CCM_CHSCCDR_IPU1_DI0_PRE_CLK_SEL_OFFSET);
<<MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET);
writel(reg, &mxc_ccm->chsccdr);

reg = IOMUXC_GPR2_BGREF_RRMODE_EXTERNAL_RES
Expand Down
28 changes: 0 additions & 28 deletions board/freescale/mx6qsabrelite/Makefile

This file was deleted.

Loading

0 comments on commit 9ed887c

Please sign in to comment.