From: Eric Nelson <eric.nelson@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/2] mx6: Factor out common HDMI setup code
Date: Thu, 25 Jul 2013 09:31:01 -0700 [thread overview]
Message-ID: <51F152C5.5050006@boundarydevices.com> (raw)
In-Reply-To: <1374701744-5366-1-git-send-email-b45784@freescale.com>
Hi Pardeep,
On 07/24/2013 02:35 PM, Pardeep Kumar Singla wrote:
> Instead of duplicating HDMI setup code for every mx6 board, factor out the common code
>
> Signed-off-by: Pardeep Kumar Singla <b45784@freescale.com>
> ---
> Changes since v2:
> Added new function enable_ipu_clock() to separate the functinality of ipu clock from hdmi setup.
> Remove unnecessary include files.
>
> <snip>
>
> diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
> index 3c0d908..a724e66 100644
> --- a/arch/arm/cpu/armv7/mx6/clock.c
> +++ b/arch/arm/cpu/armv7/mx6/clock.c
> @@ -468,6 +468,14 @@ int do_mx6_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> return 0;
> }
>
> +void enable_ipu_clock()
If this is public, it should be declared in
arch/arm/include/asm/arch-mx6/clock.h
> +{
> + 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(
> diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
> index fc436fb..8f78d7e 100644
> --- a/arch/arm/cpu/armv7/mx6/soc.c
> +++ b/arch/arm/cpu/armv7/mx6/soc.c
>
> <snip>
>
> +
> +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;
> +
> + enable_ipu_clock();
I think this enabling belongs in the routines which call
imx_setup_hdmi(), since folks will (and probably have) create
custom boards based on those shells and this is also
required to support for LDB and RGB displays.
> +
> + /* 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);
>
> <snip>
>
> diff --git a/arch/arm/include/asm/arch-mx6/mxc_hdmi.h b/arch/arm/include/asm/arch-mx6/mxc_hdmi.h
> index 9dccb3f..5cd6aa6 100644
> --- a/arch/arm/include/asm/arch-mx6/mxc_hdmi.h
> +++ b/arch/arm/include/asm/arch-mx6/mxc_hdmi.h
> @@ -21,6 +21,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
> */
> diff --git a/board/boundary/nitrogen6x/nitrogen6x.c b/board/boundary/nitrogen6x/nitrogen6x.c
> index 8f0f9b8..45a8f7a 100644
> --- a/board/boundary/nitrogen6x/nitrogen6x.c
> +++ b/board/boundary/nitrogen6x/nitrogen6x.c
>
> <snip>
>
> @@ -653,25 +640,14 @@ 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;
>
This is probably where the enable_ipu_clock() call belongs.
> + imx_setup_hdmi();
> /* Turn on LDB0,IPU,IPU DI0 clocks */
Regards,
Eric
next prev parent reply other threads:[~2013-07-25 16:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-24 21:35 [U-Boot] [PATCH v3 1/2] mx6: Factor out common HDMI setup code Pardeep Kumar Singla
2013-07-24 21:35 ` [U-Boot] [PATCH v3 2/2] mx6qsabresd: Add splash screen support via HDMI Pardeep Kumar Singla
2013-07-25 16:31 ` Eric Nelson [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-07-24 21:30 [U-Boot] [PATCH v3 1/2] mx6: Factor out common HDMI setup code Pardeep Kumar Singla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51F152C5.5050006@boundarydevices.com \
--to=eric.nelson@boundarydevices.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox