public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] wandboard: Enable HDMI splashscreen
@ 2013-05-23 17:50 Fabio Estevam
  2013-05-23 17:50 ` [U-Boot] [PATCH 2/2] wandboard: Disable data cache Fabio Estevam
  2013-06-03 12:27 ` [U-Boot] [PATCH 1/2] wandboard: Enable HDMI splashscreen Stefano Babic
  0 siblings, 2 replies; 7+ messages in thread
From: Fabio Estevam @ 2013-05-23 17:50 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 board/wandboard/wandboard.c | 98 +++++++++++++++++++++++++++++++++++++++++++++
 include/configs/wandboard.h | 15 ++++++-
 2 files changed, 112 insertions(+), 1 deletion(-)

diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c
index bb98352..5666cbf 100644
--- a/board/wandboard/wandboard.c
+++ b/board/wandboard/wandboard.c
@@ -10,9 +10,11 @@
  */
 
 #include <asm/arch/clock.h>
+#include <asm/arch/crm_regs.h>
 #include <asm/arch/iomux.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/mx6-pins.h>
+#include <asm/arch/mxc_hdmi.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/gpio.h>
 #include <asm/imx-common/iomux-v3.h>
@@ -21,9 +23,11 @@
 #include <asm/sizes.h>
 #include <common.h>
 #include <fsl_esdhc.h>
+#include <ipu_pixfmt.h>
 #include <mmc.h>
 #include <miiphy.h>
 #include <netdev.h>
+#include <linux/fb.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -206,6 +210,88 @@ int board_phy_config(struct phy_device *phydev)
 	return 0;
 }
 
+#if defined(CONFIG_VIDEO_IPUV3)
+static void enable_hdmi(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);
+}
+
+static struct fb_videomode const hdmi = {
+	.name           = "HDMI",
+	.refresh        = 60,
+	.xres           = 1024,
+	.yres           = 768,
+	.pixclock       = 15385,
+	.left_margin    = 220,
+	.right_margin   = 40,
+	.upper_margin   = 21,
+	.lower_margin   = 7,
+	.hsync_len      = 60,
+	.vsync_len      = 10,
+	.sync           = FB_SYNC_EXT,
+	.vmode          = FB_VMODE_NONINTERLACED
+};
+
+int board_video_skip(void)
+{
+	int ret;
+
+	ret = ipuv3_fb_init(&hdmi, 0, IPU_PIX_FMT_RGB24);
+
+	if (ret)
+		printf("HDMI cannot be configured: %d\n", ret);
+
+	enable_hdmi();
+
+	return ret;
+}
+
+static void setup_display(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 IPU clock */
+	reg = readl(&mxc_ccm->CCGR3);
+	reg |= MXC_CCM_CCGR3_IPU1_IPU_DI0_OFFSET;
+	writel(reg, &mxc_ccm->CCGR3);
+
+	/* 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);
+
+	/* clear HDMI PHY reset */
+	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_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);
+	writel(reg, &mxc_ccm->chsccdr);
+}
+#endif /* CONFIG_VIDEO_IPUV3 */
+
 int board_eth_init(bd_t *bis)
 {
 	int ret;
@@ -222,9 +308,21 @@ int board_eth_init(bd_t *bis)
 int board_early_init_f(void)
 {
 	setup_iomux_uart();
+#if defined(CONFIG_VIDEO_IPUV3)
+	setup_display();
+#endif
 	return 0;
 }
 
+/*
+ * Do not overwrite the console
+ * Use always serial for U-Boot console
+ */
+int overwrite_console(void)
+{
+	return 1;
+}
+
 #ifdef CONFIG_CMD_BMODE
 static const struct boot_mode board_boot_modes[] = {
 	/* 4 bit bus width */
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index 9d7ec3f..d4ac086 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -29,7 +29,7 @@
 #define CONFIG_REVISION_TAG
 
 /* Size of malloc() pool */
-#define CONFIG_SYS_MALLOC_LEN		(3 * SZ_1M)
+#define CONFIG_SYS_MALLOC_LEN		(10 * SZ_1M)
 
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_BOARD_LATE_INIT
@@ -86,6 +86,19 @@
 #define CONFIG_PHYLIB
 #define CONFIG_PHY_ATHEROS
 
+/* Framebuffer */
+#define CONFIG_VIDEO
+#define CONFIG_VIDEO_IPUV3
+#define CONFIG_CFB_CONSOLE
+#define CONFIG_VGA_AS_SINGLE_DEVICE
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
+#define CONFIG_VIDEO_BMP_RLE8
+#define CONFIG_SPLASH_SCREEN
+#define CONFIG_BMP_16BPP
+#define CONFIG_VIDEO_LOGO
+#define CONFIG_IPUV3_CLK 260000000
+
 #if defined(CONFIG_MX6DL)
 #define CONFIG_DEFAULT_FDT_FILE		"imx6dl-wandboard.dtb"
 #elif defined(CONFIG_MX6S)
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] wandboard: Disable data cache
  2013-05-23 17:50 [U-Boot] [PATCH 1/2] wandboard: Enable HDMI splashscreen Fabio Estevam
@ 2013-05-23 17:50 ` Fabio Estevam
  2013-05-23 19:31   ` Anatolij Gustschin
  2013-05-23 21:12   ` Wolfgang Denk
  2013-06-03 12:27 ` [U-Boot] [PATCH 1/2] wandboard: Enable HDMI splashscreen Stefano Babic
  1 sibling, 2 replies; 7+ messages in thread
From: Fabio Estevam @ 2013-05-23 17:50 UTC (permalink / raw)
  To: u-boot

Currently HDMI framebuffer only works if we disable data cache.

Disable data cache until the proper fix is found.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Hi,

If someone has any suggestion for a proper fix, please let me know.

Thanks

 include/configs/wandboard.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index d4ac086..5a3f0fc 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -98,6 +98,7 @@
 #define CONFIG_BMP_16BPP
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_IPUV3_CLK 260000000
+#define CONFIG_SYS_DCACHE_OFF
 
 #if defined(CONFIG_MX6DL)
 #define CONFIG_DEFAULT_FDT_FILE		"imx6dl-wandboard.dtb"
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] wandboard: Disable data cache
  2013-05-23 17:50 ` [U-Boot] [PATCH 2/2] wandboard: Disable data cache Fabio Estevam
@ 2013-05-23 19:31   ` Anatolij Gustschin
  2013-05-23 19:37     ` Fabio Estevam
  2013-05-23 21:12   ` Wolfgang Denk
  1 sibling, 1 reply; 7+ messages in thread
From: Anatolij Gustschin @ 2013-05-23 19:31 UTC (permalink / raw)
  To: u-boot

Hi Fabio,

On Thu, 23 May 2013 14:50:24 -0300
Fabio Estevam <fabio.estevam@freescale.com> wrote:

> Currently HDMI framebuffer only works if we disable data cache.
> 
> Disable data cache until the proper fix is found.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Hi,
> 
> If someone has any suggestion for a proper fix, please let me know.

There is a patch for a proper fix, queued in my video repo:

http://git.denx.de/?p=u-boot/u-boot-video.git;a=commit;h=db0d47dd433bc7ba60b927fb0ff6835758a8893d
 
Thanks,

Anatolij

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] wandboard: Disable data cache
  2013-05-23 19:31   ` Anatolij Gustschin
@ 2013-05-23 19:37     ` Fabio Estevam
  0 siblings, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2013-05-23 19:37 UTC (permalink / raw)
  To: u-boot

Hi Anatolij,

On Thu, May 23, 2013 at 4:31 PM, Anatolij Gustschin <agust@denx.de> wrote:

>
> There is a patch for a proper fix, queued in my video repo:
>
> http://git.denx.de/?p=u-boot/u-boot-video.git;a=commit;h=db0d47dd433bc7ba60b927fb0ff6835758a8893d

Excellent, just applied this patch,  kept dcache on and the splash can
be seen withour distortion.

Thanks,

Fabio Estevam

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] wandboard: Disable data cache
  2013-05-23 17:50 ` [U-Boot] [PATCH 2/2] wandboard: Disable data cache Fabio Estevam
  2013-05-23 19:31   ` Anatolij Gustschin
@ 2013-05-23 21:12   ` Wolfgang Denk
  2013-05-23 21:15     ` Fabio Estevam
  1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2013-05-23 21:12 UTC (permalink / raw)
  To: u-boot

Dear Fabio Estevam,

In message <1369331424-25835-2-git-send-email-fabio.estevam@freescale.com> you wrote:
> Currently HDMI framebuffer only works if we disable data cache.
> 
> Disable data cache until the proper fix is found.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Hi,
> 
> If someone has any suggestion for a proper fix, please let me know.

Even without a proper fix this should not be done unconditionally.
Please do this only when you actually have to, i. e. when really using
the HDMI framebuffer in a system.  It's not a good idea to let all
others suffer from that.

Also, I wonder if we should issue a warning then (at build time).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Gew?hnlich glaubt der Mensch,  wenn er nur Worte h?rt,  es m?sse sich
dabei doch auch was denken lassen.                 -- Goethe, Faust I

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] wandboard: Disable data cache
  2013-05-23 21:12   ` Wolfgang Denk
@ 2013-05-23 21:15     ` Fabio Estevam
  0 siblings, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2013-05-23 21:15 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

On Thu, May 23, 2013 at 6:12 PM, Wolfgang Denk <wd@denx.de> wrote:

> Even without a proper fix this should not be done unconditionally.
> Please do this only when you actually have to, i. e. when really using
> the HDMI framebuffer in a system.  It's not a good idea to let all
> others suffer from that.

Right, I should have marked this patch as RFC.

Anatolij kindly pointed me to a patch that solves the problem, so this
one can be discarded.

Regards,

Fabio Estevam

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 1/2] wandboard: Enable HDMI splashscreen
  2013-05-23 17:50 [U-Boot] [PATCH 1/2] wandboard: Enable HDMI splashscreen Fabio Estevam
  2013-05-23 17:50 ` [U-Boot] [PATCH 2/2] wandboard: Disable data cache Fabio Estevam
@ 2013-06-03 12:27 ` Stefano Babic
  1 sibling, 0 replies; 7+ messages in thread
From: Stefano Babic @ 2013-06-03 12:27 UTC (permalink / raw)
  To: u-boot

On 23/05/2013 19:50, Fabio Estevam wrote:
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic





-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-06-03 12:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-23 17:50 [U-Boot] [PATCH 1/2] wandboard: Enable HDMI splashscreen Fabio Estevam
2013-05-23 17:50 ` [U-Boot] [PATCH 2/2] wandboard: Disable data cache Fabio Estevam
2013-05-23 19:31   ` Anatolij Gustschin
2013-05-23 19:37     ` Fabio Estevam
2013-05-23 21:12   ` Wolfgang Denk
2013-05-23 21:15     ` Fabio Estevam
2013-06-03 12:27 ` [U-Boot] [PATCH 1/2] wandboard: Enable HDMI splashscreen Stefano Babic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox