[U-Boot] [PATCH v2 1/4] mx6cuboxi: Add HDMI output support

From: Fabio Estevam fabio.estevam@freescale.com
Add HDMI output using PLL5 as the source for the IPU clocks, and accurate VESA timings.
These settings are based on the patch from Soeren Moch smoch@web.de submitted for the tbs2910 mx6 based board.
It allows the display to work properly at 1024x768@60.
This should make the hdmi output signal compatible with most if not all modern displays.
Signed-off-by: Jon Nettleton jon.nettleton@gmail.com Signed-off-by: Fabio Estevam fabio.estevam@freescale.com Reviewed-by: Tom Rini trini@konsulko.com Tested-by: Tom Rini trini@konsulko.com --- Changes since v1: - None
board/solidrun/mx6cuboxi/mx6cuboxi.c | 101 ++++++++++++++++++++++++++++++++++- include/configs/mx6cuboxi.h | 18 ++++++- 2 files changed, 117 insertions(+), 2 deletions(-)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c index d3a32c1..eab92f1 100644 --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c @@ -18,9 +18,11 @@ #include <asm/arch/imx-regs.h> #include <asm/arch/iomux.h> #include <asm/arch/mx6-pins.h> +#include <asm/arch/mxc_hdmi.h> #include <asm/errno.h> #include <asm/gpio.h> #include <asm/imx-common/iomux-v3.h> +#include <asm/imx-common/video.h> #include <mmc.h> #include <fsl_esdhc.h> #include <miiphy.h> @@ -159,10 +161,107 @@ int board_eth_init(bd_t *bis) return cpu_eth_init(bis); }
+#ifdef CONFIG_VIDEO_IPUV3 +static void do_enable_hdmi(struct display_info_t const *dev) +{ + imx_enable_hdmi_phy(); +} + +struct display_info_t const displays[] = { + { + .bus = -1, + .addr = 0, + .pixfmt = IPU_PIX_FMT_RGB24, + .detect = detect_hdmi, + .enable = do_enable_hdmi, + .mode = { + .name = "HDMI", + /* 1024x768@60Hz (VESA)*/ + .refresh = 60, + .xres = 1024, + .yres = 768, + .pixclock = 15384, + .left_margin = 160, + .right_margin = 24, + .upper_margin = 29, + .lower_margin = 3, + .hsync_len = 136, + .vsync_len = 6, + .sync = FB_SYNC_EXT, + .vmode = FB_VMODE_NONINTERLACED + } + } +}; + +size_t display_count = ARRAY_SIZE(displays); + +static int setup_display(void) +{ + struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + int reg; + int timeout = 100000; + + enable_ipu_clock(); + imx_setup_hdmi(); + + /* set video pll to 455MHz (24MHz * (37+11/12) / 2) */ + setbits_le32(&ccm->analog_pll_video, BM_ANADIG_PLL_VIDEO_POWERDOWN); + + reg = readl(&ccm->analog_pll_video); + reg &= ~BM_ANADIG_PLL_VIDEO_DIV_SELECT; + reg |= BF_ANADIG_PLL_VIDEO_DIV_SELECT(37); + reg &= ~BM_ANADIG_PLL_VIDEO_POST_DIV_SELECT; + reg |= BF_ANADIG_PLL_VIDEO_POST_DIV_SELECT(1); + writel(reg, &ccm->analog_pll_video); + + writel(BF_ANADIG_PLL_VIDEO_NUM_A(11), &ccm->analog_pll_video_num); + writel(BF_ANADIG_PLL_VIDEO_DENOM_B(12), &ccm->analog_pll_video_denom); + + reg &= ~BM_ANADIG_PLL_VIDEO_POWERDOWN; + writel(reg, &ccm->analog_pll_video); + + while (timeout--) + if (readl(&ccm->analog_pll_video) & BM_ANADIG_PLL_VIDEO_LOCK) + break; + if (timeout < 0) { + printf("Warning: video pll lock timeout!\n"); + return -ETIMEDOUT; + } + + reg = readl(&ccm->analog_pll_video); + reg |= BM_ANADIG_PLL_VIDEO_ENABLE; + reg &= ~BM_ANADIG_PLL_VIDEO_BYPASS; + writel(reg, &ccm->analog_pll_video); + + /* gate ipu1_di0_clk */ + clrbits_le32(&ccm->CCGR3, MXC_CCM_CCGR3_LDB_DI0_MASK); + + /* select video_pll clock / 7 for ipu1_di0_clk -> 65MHz pixclock */ + reg = readl(&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 |= (2 << MXC_CCM_CHSCCDR_IPU1_DI0_PRE_CLK_SEL_OFFSET) | + (6 << MXC_CCM_CHSCCDR_IPU1_DI0_PODF_OFFSET) | + (0 << MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET); + writel(reg, &ccm->chsccdr); + + /* enable ipu1_di0_clk */ + setbits_le32(&ccm->CCGR3, MXC_CCM_CCGR3_LDB_DI0_MASK); + + return 0; +} +#endif /* CONFIG_VIDEO_IPUV3 */ + int board_early_init_f(void) { + int ret = 0; setup_iomux_uart(); - return 0; + +#ifdef CONFIG_VIDEO_IPUV3 + ret = setup_display(); +#endif + return ret; }
int board_init(void) diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h index b569f34..207a2a6 100644 --- a/include/configs/mx6cuboxi.h +++ b/include/configs/mx6cuboxi.h @@ -27,7 +27,7 @@ #define CONFIG_IMX6_THERMAL #define CONFIG_SYS_GENERIC_BOARD
-#define CONFIG_SYS_MALLOC_LEN (2 * SZ_1M) +#define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M) #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_BOARD_LATE_INIT #define CONFIG_MXC_GPIO @@ -66,6 +66,22 @@ #define CONFIG_CONS_INDEX 1 #define CONFIG_BAUDRATE 115200
+/* Framebuffer */ +#define CONFIG_VIDEO +#define CONFIG_VIDEO_IPUV3 +#define CONFIG_IPUV3_CLK 260000000 +#define CONFIG_CFB_CONSOLE +#define CONFIG_VGA_AS_SINGLE_DEVICE +#define CONFIG_SYS_CONSOLE_IS_IN_ENV +#define CONFIG_VIDEO_BMP_RLE8 +#define CONFIG_SPLASH_SCREEN +#define CONFIG_SPLASH_SCREEN_ALIGN +#define CONFIG_BMP_16BPP +#define CONFIG_VIDEO_LOGO +#define CONFIG_VIDEO_BMP_LOGO +#define CONFIG_IMX_HDMI +#define CONFIG_IMX_VIDEO_SKIP + #define CONFIG_SYS_NO_FLASH
/* Command definition */

From: Fabio Estevam fabio.estevam@freescale.com
Enable USB Host1 port.
Signed-off-by: Rabeeh Khoury rabeeh@solid-run.com Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- Changes since v1: - Remove USB ether options as suggested by Tom
board/solidrun/mx6cuboxi/mx6cuboxi.c | 26 ++++++++++++++++++++++++++ include/configs/mx6cuboxi.h | 10 ++++++++++ 2 files changed, 36 insertions(+)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c index eab92f1..9aa0259 100644 --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c @@ -31,6 +31,8 @@ #include <asm/io.h> #include <asm/arch/sys_proto.h> #include <spl.h> +#include <usb.h> +#include <usb/ehci-fsl.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -52,6 +54,7 @@ DECLARE_GLOBAL_DATA_PTR; PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
#define ETH_PHY_RESET IMX_GPIO_NR(4, 15) +#define USB_H1_VBUS IMX_GPIO_NR(1, 0)
int dram_init(void) { @@ -79,6 +82,10 @@ static iomux_v3_cfg_t const hb_cbi_sense[] = { IOMUX_PADS(PAD_EIM_DA4__GPIO3_IO04 | MUX_PAD_CTRL(UART_PAD_CTRL)), };
+static iomux_v3_cfg_t const usb_pads[] = { + IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | MUX_PAD_CTRL(NO_PAD_CTRL)), +}; + static void setup_iomux_uart(void) { SETUP_IOMUX_PADS(uart1_pads); @@ -253,6 +260,21 @@ static int setup_display(void) } #endif /* CONFIG_VIDEO_IPUV3 */
+#ifdef CONFIG_USB_EHCI_MX6 +static void setup_usb(void) +{ + SETUP_IOMUX_PADS(usb_pads); +} + +int board_ehci_hcd_init(int port) +{ + if (port == 1) + gpio_direction_output(USB_H1_VBUS, 1); + + return 0; +} +#endif + int board_early_init_f(void) { int ret = 0; @@ -261,6 +283,10 @@ int board_early_init_f(void) #ifdef CONFIG_VIDEO_IPUV3 ret = setup_display(); #endif + +#ifdef CONFIG_USB_EHCI_MX6 + setup_usb(); +#endif return ret; }
diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h index 207a2a6..34d24dc 100644 --- a/include/configs/mx6cuboxi.h +++ b/include/configs/mx6cuboxi.h @@ -82,6 +82,16 @@ #define CONFIG_IMX_HDMI #define CONFIG_IMX_VIDEO_SKIP
+/* USB */ +#define CONFIG_CMD_USB +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX6 +#define CONFIG_USB_STORAGE +#define CONFIG_EHCI_HCD_INIT_AFTER_RESET +#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) +#define CONFIG_MXC_USB_FLAGS 0 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 + #define CONFIG_SYS_NO_FLASH
/* Command definition */

On 2015-04-29, Fabio Estevam wrote:
Enable USB Host1 port.
Signed-off-by: Rabeeh Khoury rabeeh@solid-run.com Signed-off-by: Fabio Estevam fabio.estevam@freescale.com
Changes since v1:
- Remove USB ether options as suggested by Tom
Removing those options broke network boot. With this patch, u-boot reports:
Net: Phy 0 not found
And the dhcp command fails to get an ip address.
With both CONFIG_USB_HOST_ETHER and CONFIG_USB_ETHER_ASIX defined in mx6cuboxi.h, u-boot reports:
Net: FEC
And then the dhcp command works as expected...
Perhaps the CONFIG_USB*ETHER options conditionall enable some other feature that FEC depends on?
live well, vagrant

On Thu, Apr 30, 2015 at 6:26 PM, Vagrant Cascadian vagrant@aikidev.net wrote:
Removing those options broke network boot. With this patch, u-boot reports:
Net: Phy 0 not found
And the dhcp command fails to get an ip address.
With both CONFIG_USB_HOST_ETHER and CONFIG_USB_ETHER_ASIX defined in mx6cuboxi.h, u-boot reports:
Net: FEC
And then the dhcp command works as expected...
Perhaps the CONFIG_USB*ETHER options conditionall enable some other feature that FEC depends on?
Could you try?
=> setenv ethaddr => save => reset
TFTP transfer is working fine here.
Regards,
Fabio Estevam

On 2015-04-30, Fabio Estevam wrote:
On Thu, Apr 30, 2015 at 6:26 PM, Vagrant Cascadian vagrant@aikidev.net wrote:
Removing those options broke network boot. With this patch, u-boot reports:
Net: Phy 0 not found
And the dhcp command fails to get an ip address.
With both CONFIG_USB_HOST_ETHER and CONFIG_USB_ETHER_ASIX defined in mx6cuboxi.h, u-boot reports:
Net: FEC
And then the dhcp command works as expected...
Perhaps the CONFIG_USB*ETHER options conditionall enable some other feature that FEC depends on?
After trying this several times, that build of u-boot no longer works either.
Could you try?
=> setenv ethaddr => save => reset
No change.
TFTP transfer is working fine here.
It was working here too, and now it doesn't. I clearly misdiagnosed the cause...
live well, vagrant

So network works fine on the hummingboard i1 and i2ex, but the cubox i4pro is still inconsistant:
Net: Phy 0 not found PHY reset timed out FEC
It definitely worked at some point before. I used the same SD card on all three boards.
live well, vagrant

Hi Vagrant,
On Thu, Apr 30, 2015 at 8:50 PM, Vagrant Cascadian vagrant@aikidev.net wrote:
So network works fine on the hummingboard i1 and i2ex, but the cubox i4pro is still inconsistant:
Net: Phy 0 not found PHY reset timed out FEC
When you see this error: does U-boot warn you about the MAC address stored in the environment does not match the one read by the fuses?
I think if you use a clean environment (env default -f -a, or do the setenv ethaddr; save) then the MAC address will be re-read from the fuse and stored in the env. Then ethernet should work fine.
Regards,
Fabio Estevam

On 2015-04-30, Fabio Estevam wrote:
On Thu, Apr 30, 2015 at 8:50 PM, Vagrant Cascadian vagrant@aikidev.net wrote:
So network works fine on the hummingboard i1 and i2ex, but the cubox i4pro is still inconsistant:
Net: Phy 0 not found PHY reset timed out FEC
When you see this error: does U-boot warn you about the MAC address stored in the environment does not match the one read by the fuses?
No such warning. Rather than keep you guessing, here's the output on boot:
U-Boot 2015.04+dfsg1-2~20150430~5 (Apr 30 2015 - 20:46:44)
CPU: Freescale i.MX6Q rev1.2 at 792 MHz CPU: Temperature 17 C Reset cause: POR Board: MX6 Cubox-i DRAM: 2 GiB MMC: FSL_SDHC: 0 *** Warning - bad CRC, using default environment
No panel detected: default to HDMI Display: HDMI (1024x768) In: serial Out: vga Err: vga Net: Phy 0 not found PHY reset timed out FEC starting USB... USB0: Port not available. USB1: USB EHCI 1.00 scanning bus 1 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found Hit any key to stop autoboot: 0
I think if you use a clean environment (env default -f -a
Running "env default -f -a" resets the environment and clears out ethaddr (as well as board_name and board_rev, which can be tricky for findfdt), though I believe it is already using the default environment because of the message:
*** Warning - bad CRC, using default environment
But it doesn't really help with the ethernet changes.
or do the setenv ethaddr; save) then the MAC address will be re-read from the fuse and stored in the env. Then ethernet should work fine.
I'm guessing you mean "saveenv" and not "save".
"setenv ethaddr; saveenv ; reset" still fails to work.
I generally try to avoid using saveenv as it makes it harder to test the default environment when testing a new version of u-boot.
live well, vagrant

Hi Vagrant,
On 01/05/2015 07:50, Vagrant Cascadian wrote:
Net: Phy 0 not found PHY reset timed out FEC
ok, the PHY is not found, but I cannot understand how Fabio's changes dropping ASIX can be the cause. Have you reverted back U-Boot to V1 set of patchset to check again if it works ? It looks a completely unrelated cause.
Best regards, Stefano Babic

On Fri, May 1, 2015 at 4:33 AM, Stefano Babic sbabic@denx.de wrote:
Hi Vagrant,
On 01/05/2015 07:50, Vagrant Cascadian wrote:
Net: Phy 0 not found PHY reset timed out FEC
ok, the PHY is not found, but I cannot understand how Fabio's changes dropping ASIX can be the cause. Have you reverted back U-Boot to V1 set of patchset to check again if it works ? It looks a completely unrelated cause.
Yes, this is something I did not understand as well.
Vagrant, could you confirm that v1 did not have this FEC issue?
Thanks

On 2015-05-01, Stefano Babic wrote:
On 01/05/2015 07:50, Vagrant Cascadian wrote:
Net: Phy 0 not found PHY reset timed out FEC
ok, the PHY is not found, but I cannot understand how Fabio's changes dropping ASIX can be the cause. Have you reverted back U-Boot to V1 set of patchset to check again if it works ? It looks a completely unrelated cause.
I did revert back, and at first that seemed to fix it, but after more testing, the issue appears to be intermittent, and unrelated to the USB changes.
So my earlier Tested-By stands; I think it's worth applying.
live well, vagrant

On Fri, May 1, 2015 at 1:20 PM, Vagrant Cascadian vagrant@aikidev.net wrote:
I did revert back, and at first that seemed to fix it, but after more testing, the issue appears to be intermittent, and unrelated to the USB changes.
So my earlier Tested-By stands; I think it's worth applying.
Ok, thanks for the clarification.
I will try to reproduce/investigate this FEC/PHY issue next week.
Regards,
Fabio Estevam

On Fri, May 1, 2015 at 2:10 PM, Fabio Estevam festevam@gmail.com wrote:
On Fri, May 1, 2015 at 1:20 PM, Vagrant Cascadian vagrant@aikidev.net wrote:
I did revert back, and at first that seemed to fix it, but after more testing, the issue appears to be intermittent, and unrelated to the USB changes.
So my earlier Tested-By stands; I think it's worth applying.
Ok, thanks for the clarification.
I will try to reproduce/investigate this FEC/PHY issue next week.
Looking at Solid-run's tree they have the following commit that may be related to this PHY issue:
commit efc4835294122212052a8b8b2a23d14fa2b72177 Author: Rabeeh Khoury rabeeh@solid-run.com Date: Sat Jan 25 17:57:51 2014 +0200
fecmxc_initialize_multi change from phy id to phy mask
The fecmxc_initialize_multi now accepts phy address mask instead of a single phy address.
Modified otherboard that directly uses fecmxc_initialize_multi()
Modified also i.MX6 RXD0/RXD1 pad to pull down (they are also directly connected to the Atheros 8035/8030 although they should be functional only in the RMII mode - 8030).
Signed-off-by: Rabeeh Khoury rabeeh@solid-run.com

Vagrant,
On Fri, May 1, 2015 at 5:20 PM, Fabio Estevam festevam@gmail.com wrote:
Looking at Solid-run's tree they have the following commit that may be related to this PHY issue:
I applied Rabeeh's patch on top of this v2 series and generated the two attached patches.
Could you please give them a try and let us know if it fixes the Ethernet PHY detect issue?
Regards,
Fabio Estevam

On 2015-05-01, Fabio Estevam wrote:
On Fri, May 1, 2015 at 5:20 PM, Fabio Estevam festevam@gmail.com wrote:
Looking at Solid-run's tree they have the following commit that may be related to this PHY issue:
I applied Rabeeh's patch on top of this v2 series and generated the two attached patches.
Could you please give them a try and let us know if it fixes the Ethernet PHY detect issue?
After some brief testing with these two patches, it seems to be working. After trying various methods (cold boot, reset from u-boot prompt several consecutive times, reboot from linux several times), it seems to consistantly detect the PHY.
Thanks for looking into it!
live well, vagrant
From c0078a4fe907f8c579924f89ee5ac48e40d84736 Mon Sep 17 00:00:00 2001 From: Fabio Estevam fabio.estevam@freescale.com Date: Fri, 1 May 2015 18:09:30 -0300 Subject: [PATCH 1/2] fec: Allow passing a phy mask in fecmxc_initialize_multi()
Instead of only accepting a fixed PHY address, allow passing a range of PHY addresses through a mask address.
Signed-off-by: Rabeeh Khoury rabeeh@solid-run.com Signed-off-by: Fabio Estevam fabio.estevam@freescale.com
board/denx/m28evk/m28evk.c | 4 ++-- board/freescale/mx28evk/mx28evk.c | 4 ++-- board/schulercontrol/sc_sps_1/sc_sps_1.c | 4 ++-- drivers/net/fec_mxc.c | 10 +++++----- include/netdev.h | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/board/denx/m28evk/m28evk.c b/board/denx/m28evk/m28evk.c index 33d38cf..7b4f67d 100644 --- a/board/denx/m28evk/m28evk.c +++ b/board/denx/m28evk/m28evk.c @@ -131,13 +131,13 @@ int board_eth_init(bd_t *bis) udelay(10000); #endif
- ret = fecmxc_initialize_multi(bis, 0, 0, MXS_ENET0_BASE);
- ret = fecmxc_initialize_multi(bis, 0, 1 << 0, MXS_ENET0_BASE); if (ret) { printf("FEC MXS: Unable to init FEC0\n"); return ret; }
- ret = fecmxc_initialize_multi(bis, 1, 3, MXS_ENET1_BASE);
- ret = fecmxc_initialize_multi(bis, 1, 1 << 3, MXS_ENET1_BASE); if (ret) { printf("FEC MXS: Unable to init FEC1\n"); return ret;
diff --git a/board/freescale/mx28evk/mx28evk.c b/board/freescale/mx28evk/mx28evk.c index 5005fe2..4cf9332 100644 --- a/board/freescale/mx28evk/mx28evk.c +++ b/board/freescale/mx28evk/mx28evk.c @@ -118,13 +118,13 @@ int board_eth_init(bd_t *bis) udelay(200); gpio_set_value(MX28_PAD_ENET0_RX_CLK__GPIO_4_13, 1);
- ret = fecmxc_initialize_multi(bis, 0, 0, MXS_ENET0_BASE);
- ret = fecmxc_initialize_multi(bis, 0, 1 << 0, MXS_ENET0_BASE); if (ret) { puts("FEC MXS: Unable to init FEC0\n"); return ret; }
- ret = fecmxc_initialize_multi(bis, 1, 3, MXS_ENET1_BASE);
- ret = fecmxc_initialize_multi(bis, 1, 1 << 3, MXS_ENET1_BASE); if (ret) { puts("FEC MXS: Unable to init FEC1\n"); return ret;
diff --git a/board/schulercontrol/sc_sps_1/sc_sps_1.c b/board/schulercontrol/sc_sps_1/sc_sps_1.c index 7f0b591..fdaa383 100644 --- a/board/schulercontrol/sc_sps_1/sc_sps_1.c +++ b/board/schulercontrol/sc_sps_1/sc_sps_1.c @@ -79,13 +79,13 @@ int board_eth_init(bd_t *bis) CLKCTRL_ENET_TIME_SEL_MASK, CLKCTRL_ENET_TIME_SEL_RMII_CLK | CLKCTRL_ENET_CLK_OUT_EN);
- ret = fecmxc_initialize_multi(bis, 0, 0, MXS_ENET0_BASE);
- ret = fecmxc_initialize_multi(bis, 0, 1 << 0, MXS_ENET0_BASE); if (ret) { printf("FEC MXS: Unable to init FEC0\n"); return ret; }
- ret = fecmxc_initialize_multi(bis, 1, 1, MXS_ENET1_BASE);
- ret = fecmxc_initialize_multi(bis, 1, 1 << 1, MXS_ENET1_BASE); if (ret) { printf("FEC MXS: Unable to init FEC1\n"); return ret;
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index b572470..9817df2 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -1077,7 +1077,7 @@ struct mii_dev *fec_get_miibus(uint32_t base_addr, int dev_id) return bus; }
-int fecmxc_initialize_multi(bd_t *bd, int dev_id, int phy_id, uint32_t addr) +int fecmxc_initialize_multi(bd_t *bd, int dev_id, uint32_t phy_mask, uint32_t addr) { uint32_t base_mii; struct mii_dev *bus = NULL; @@ -1095,19 +1095,19 @@ int fecmxc_initialize_multi(bd_t *bd, int dev_id, int phy_id, uint32_t addr) #else base_mii = addr; #endif
- debug("eth_init: fec_probe(bd, %i, %i) @ %08x\n", dev_id, phy_id, addr);
- debug("eth_init: fec_probe(bd, %i, %i) @ %08x\n", dev_id, phy_mask, addr); bus = fec_get_miibus(base_mii, dev_id); if (!bus) return -ENOMEM;
#ifdef CONFIG_PHYLIB
- phydev = phy_find_by_mask(bus, 1 << phy_id, PHY_INTERFACE_MODE_RGMII);
- phydev = phy_find_by_mask(bus, phy_mask, PHY_INTERFACE_MODE_RGMII); if (!phydev) { free(bus); return -ENOMEM; } ret = fec_probe(bd, dev_id, addr, bus, phydev);
#else
- ret = fec_probe(bd, dev_id, addr, bus, phy_id);
- ret = fec_probe(bd, dev_id, addr, bus, phy_mask);
#endif if (ret) { #ifdef CONFIG_PHYLIB @@ -1121,7 +1121,7 @@ int fecmxc_initialize_multi(bd_t *bd, int dev_id, int phy_id, uint32_t addr) #ifdef CONFIG_FEC_MXC_PHYADDR int fecmxc_initialize(bd_t *bd) {
- return fecmxc_initialize_multi(bd, -1, CONFIG_FEC_MXC_PHYADDR,
- return fecmxc_initialize_multi(bd, -1, 1 << CONFIG_FEC_MXC_PHYADDR, IMX_FEC_BASE);
} #endif diff --git a/include/netdev.h b/include/netdev.h index d96e1da..15c513d 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -49,7 +49,7 @@ int eth_3com_initialize (bd_t * bis); int ethoc_initialize(u8 dev_num, int base_addr); int fec_initialize (bd_t *bis); int fecmxc_initialize(bd_t *bis); -int fecmxc_initialize_multi(bd_t *bis, int dev_id, int phy_id, uint32_t addr); +int fecmxc_initialize_multi(bd_t *bis, int dev_id, uint32_t phy_mask, uint32_t addr); int ftgmac100_initialize(bd_t *bits); int ftmac100_initialize(bd_t *bits); int ftmac110_initialize(bd_t *bits); -- 1.9.1
From cc3a6625a4ddab8943c8d66f5dd0aac651e7c5e5 Mon Sep 17 00:00:00 2001 From: Fabio Estevam fabio.estevam@freescale.com Date: Fri, 1 May 2015 18:16:13 -0300 Subject: [PATCH 2/2] mx6cuboxi: Fix Ethernet PHY undetected problem
mx6cuboxi sometimes fails to recognize the Ethernet PHY:
Net: Phy 0 not found
The explanation comes from a patch from Rabeeh:
"Initialize the phy in address 0x0 or 0x4 (0x11 phy mask). The LED_ACT pin on the carrier-one boards had a pull down that forces the phy address to 0x0; where on CuBox-i and the production HummingBoard that pin is connected directly to LED that depending on the pull down strength of the LED it might be sampled as '0' or '1' thus the phy address might appear as either address 0x0 or 0x4."
Reported-by: Vagrant Cascadian vagrant@aikidev.net Signed-off-by: Rabeeh Khoury rabeeh@solid-run.com Signed-off-by: Fabio Estevam fabio.estevam@freescale.com
board/solidrun/mx6cuboxi/mx6cuboxi.c | 16 ++++++++++++++++ include/configs/mx6cuboxi.h | 1 - 2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c index 9aa0259..d1ba2dd 100644 --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c @@ -133,6 +133,8 @@ static iomux_v3_cfg_t const enet_pads[] = { IOMUX_PADS(PAD_RGMII_RD2__RGMII_RD2 | MUX_PAD_CTRL(ENET_PAD_CTRL)), IOMUX_PADS(PAD_RGMII_RD3__RGMII_RD3 | MUX_PAD_CTRL(ENET_PAD_CTRL)), IOMUX_PADS(PAD_RGMII_RX_CTL__RGMII_RX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL_PD)),
- IOMUX_PADS(PAD_ENET_RXD0__GPIO1_IO27 | MUX_PAD_CTRL(ENET_PAD_CTRL_PD)),
- IOMUX_PADS(PAD_ENET_RXD1__GPIO1_IO26 | MUX_PAD_CTRL(ENET_PAD_CTRL_PD)),
};
static void setup_iomux_enet(void) @@ -144,6 +146,20 @@ static void setup_iomux_enet(void) gpio_set_value(ETH_PHY_RESET, 1); }
+int fecmxc_initialize(bd_t *bd) +{
- /*
* Initialize the phy in address 0x0 or 0x4 (0x11 phy mask).
* The LED_ACT pin on the carrier-one boards had a pull down that
* forces the phy address to 0x0; where on CuBox-i and the production
* HummingBoard that pin is connected directly to LED that depending
* on the pull down strength of the LED it might be sampled
* as '0' or '1' thus the phy address might appear as either address
* 0x0 or 0x4.
*/
- return fecmxc_initialize_multi(bd, -1, 0x11, IMX_FEC_BASE);
+}
int board_phy_config(struct phy_device *phydev) { if (phydev->drv->config) diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h index 4e07f59..3759b3f 100644 --- a/include/configs/mx6cuboxi.h +++ b/include/configs/mx6cuboxi.h @@ -57,7 +57,6 @@ #define CONFIG_MII #define IMX_FEC_BASE ENET_BASE_ADDR #define CONFIG_FEC_XCV_TYPE RGMII -#define CONFIG_FEC_MXC_PHYADDR 0 #define CONFIG_PHYLIB #define CONFIG_PHY_ATHEROS
-- 1.9.1

Hi Fabio, Vagrant,
On 02/05/2015 02:07, Vagrant Cascadian wrote:
On 2015-05-01, Fabio Estevam wrote:
On Fri, May 1, 2015 at 5:20 PM, Fabio Estevam festevam@gmail.com wrote:
Looking at Solid-run's tree they have the following commit that may be related to this PHY issue:
I applied Rabeeh's patch on top of this v2 series and generated the two attached patches.
Could you please give them a try and let us know if it fixes the Ethernet PHY detect issue?
After some brief testing with these two patches, it seems to be working. After trying various methods (cold boot, reset from u-boot prompt several consecutive times, reboot from linux several times), it seems to consistantly detect the PHY.
Good work ! I apply V2, then. Can you also send to a ML the two additional patches from your previous e-mail ? They are not tracked properly by patchwork.
Thanks, Stefano

Hi Stefano and Vagrant,
On Sat, May 2, 2015 at 5:54 AM, Stefano Babic sbabic@denx.de wrote:
Good work ! I apply V2, then. Can you also send to a ML the two additional patches from your previous e-mail ? They are not tracked properly by patchwork.
Thanks for testing the patches, Vagrant.
I will submit them to the list next week after testing on a mx28evk. Just want to make sure FEC still works fine on that platform as well.
Regards,
Fabio Estevam

On Sat, May 2, 2015 at 11:12 AM, Fabio Estevam festevam@gmail.com wrote:
Hi Stefano and Vagrant,
On Sat, May 2, 2015 at 5:54 AM, Stefano Babic sbabic@denx.de wrote:
Good work ! I apply V2, then. Can you also send to a ML the two additional patches from your previous e-mail ? They are not tracked properly by patchwork.
Thanks for testing the patches, Vagrant.
I will submit them to the list next week after testing on a mx28evk. Just want to make sure FEC still works fine on that platform as well.
After thinking more about these patches, there is no need to touch the fec driver for allowing the PHY to be probed at a different address. We have phy_find_by_mask(), which suits for this exact purpose, so I will send a patch using the existing infrastructure.
Regards,
Fabio Estevam

On 04/05/2015 05:24, Fabio Estevam wrote:
On Sat, May 2, 2015 at 11:12 AM, Fabio Estevam festevam@gmail.com wrote:
Hi Stefano and Vagrant,
On Sat, May 2, 2015 at 5:54 AM, Stefano Babic sbabic@denx.de wrote:
Good work ! I apply V2, then. Can you also send to a ML the two additional patches from your previous e-mail ? They are not tracked properly by patchwork.
Thanks for testing the patches, Vagrant.
I will submit them to the list next week after testing on a mx28evk. Just want to make sure FEC still works fine on that platform as well.
After thinking more about these patches, there is no need to touch the fec driver for allowing the PHY to be probed at a different address. We have phy_find_by_mask(), which suits for this exact purpose, so I will send a patch using the existing infrastructure.
You're right, this is the best approach.
Best regards, Stefano Babic

On 2015-04-29, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
Enable USB Host1 port.
Signed-off-by: Rabeeh Khoury rabeeh@solid-run.com Signed-off-by: Fabio Estevam fabio.estevam@freescale.com
Changes since v1:
- Remove USB ether options as suggested by Tom
USB keyboard, USB hub and two USB sticks all worked.
Tested-By: Vagrant Cascadian vagrant@aikidev.net
board/solidrun/mx6cuboxi/mx6cuboxi.c | 26 ++++++++++++++++++++++++++ include/configs/mx6cuboxi.h | 10 ++++++++++ 2 files changed, 36 insertions(+)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c index eab92f1..9aa0259 100644 --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c @@ -31,6 +31,8 @@ #include <asm/io.h> #include <asm/arch/sys_proto.h> #include <spl.h> +#include <usb.h> +#include <usb/ehci-fsl.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -52,6 +54,7 @@ DECLARE_GLOBAL_DATA_PTR; PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
#define ETH_PHY_RESET IMX_GPIO_NR(4, 15) +#define USB_H1_VBUS IMX_GPIO_NR(1, 0)
int dram_init(void) { @@ -79,6 +82,10 @@ static iomux_v3_cfg_t const hb_cbi_sense[] = { IOMUX_PADS(PAD_EIM_DA4__GPIO3_IO04 | MUX_PAD_CTRL(UART_PAD_CTRL)), };
+static iomux_v3_cfg_t const usb_pads[] = {
- IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | MUX_PAD_CTRL(NO_PAD_CTRL)),
+};
static void setup_iomux_uart(void) { SETUP_IOMUX_PADS(uart1_pads); @@ -253,6 +260,21 @@ static int setup_display(void) } #endif /* CONFIG_VIDEO_IPUV3 */
+#ifdef CONFIG_USB_EHCI_MX6 +static void setup_usb(void) +{
- SETUP_IOMUX_PADS(usb_pads);
+}
+int board_ehci_hcd_init(int port) +{
- if (port == 1)
gpio_direction_output(USB_H1_VBUS, 1);
- return 0;
+} +#endif
int board_early_init_f(void) { int ret = 0; @@ -261,6 +283,10 @@ int board_early_init_f(void) #ifdef CONFIG_VIDEO_IPUV3 ret = setup_display(); #endif
+#ifdef CONFIG_USB_EHCI_MX6
- setup_usb();
+#endif return ret; }
diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h index 207a2a6..34d24dc 100644 --- a/include/configs/mx6cuboxi.h +++ b/include/configs/mx6cuboxi.h @@ -82,6 +82,16 @@ #define CONFIG_IMX_HDMI #define CONFIG_IMX_VIDEO_SKIP
+/* USB */ +#define CONFIG_CMD_USB +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX6 +#define CONFIG_USB_STORAGE +#define CONFIG_EHCI_HCD_INIT_AFTER_RESET +#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) +#define CONFIG_MXC_USB_FLAGS 0 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
#define CONFIG_SYS_NO_FLASH
/* Command definition */
1.9.1

On 30/04/2015 03:28, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
Enable USB Host1 port.
Signed-off-by: Rabeeh Khoury rabeeh@solid-run.com Signed-off-by: Fabio Estevam fabio.estevam@freescale.com
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

From: Fabio Estevam fabio.estevam@freescale.com
There are users of Cuboxi and Hummingboard that use these boards without connecting them to a USB/serial adapter.
Allow such usage by allowing the HDMI port to act as stdout and USB keyboard as stdin.
The serial console still also works as stdin/stdout.
Signed-off-by: Rabeeh Khoury rabeeh@solid-run.com Signed-off-by: Fabio Estevam fabio.estevam@freescale.com Reviewed-by: Tom Rini trini@konsulko.com --- Changes since v1: - None
include/configs/mx6cuboxi.h | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h index 34d24dc..4e07f59 100644 --- a/include/configs/mx6cuboxi.h +++ b/include/configs/mx6cuboxi.h @@ -81,6 +81,7 @@ #define CONFIG_VIDEO_BMP_LOGO #define CONFIG_IMX_HDMI #define CONFIG_IMX_VIDEO_SKIP +#define CONFIG_CONSOLE_MUX
/* USB */ #define CONFIG_CMD_USB @@ -91,6 +92,9 @@ #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) #define CONFIG_MXC_USB_FLAGS 0 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 +#define CONFIG_USB_KEYBOARD +#define CONFIG_SYS_USB_EVENT_POLL +#define CONFIG_PREBOOT "usb start"
#define CONFIG_SYS_NO_FLASH
@@ -113,6 +117,9 @@
#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG #define CONFIG_EXTRA_ENV_SETTINGS \ + "stdin=serial,usbkbd\0" \ + "stdout=serial,vga\0" \ + "stderr=serial,vga\0" \ "script=boot.scr\0" \ "image=zImage\0" \ "fdtfile=undefined\0" \

On 2015-04-29, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
There are users of Cuboxi and Hummingboard that use these boards without connecting them to a USB/serial adapter.
Allow such usage by allowing the HDMI port to act as stdout and USB keyboard as stdin.
The serial console still also works as stdin/stdout.
Signed-off-by: Rabeeh Khoury rabeeh@solid-run.com Signed-off-by: Fabio Estevam fabio.estevam@freescale.com Reviewed-by: Tom Rini trini@konsulko.com
Tested-by: Vagrant Cascadian vagrant@aikidev.net
Changes since v1:
- None
include/configs/mx6cuboxi.h | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h index 34d24dc..4e07f59 100644 --- a/include/configs/mx6cuboxi.h +++ b/include/configs/mx6cuboxi.h @@ -81,6 +81,7 @@ #define CONFIG_VIDEO_BMP_LOGO #define CONFIG_IMX_HDMI #define CONFIG_IMX_VIDEO_SKIP +#define CONFIG_CONSOLE_MUX
/* USB */ #define CONFIG_CMD_USB @@ -91,6 +92,9 @@ #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) #define CONFIG_MXC_USB_FLAGS 0 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 +#define CONFIG_USB_KEYBOARD +#define CONFIG_SYS_USB_EVENT_POLL +#define CONFIG_PREBOOT "usb start"
#define CONFIG_SYS_NO_FLASH
@@ -113,6 +117,9 @@
#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG #define CONFIG_EXTRA_ENV_SETTINGS \
- "stdin=serial,usbkbd\0" \
- "stdout=serial,vga\0" \
- "stderr=serial,vga\0" \ "script=boot.scr\0" \ "image=zImage\0" \ "fdtfile=undefined\0" \
-- 1.9.1

On 30/04/2015 03:28, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
There are users of Cuboxi and Hummingboard that use these boards without connecting them to a USB/serial adapter.
Allow such usage by allowing the HDMI port to act as stdout and USB keyboard as stdin.
The serial console still also works as stdin/stdout.
Signed-off-by: Rabeeh Khoury rabeeh@solid-run.com Signed-off-by: Fabio Estevam fabio.estevam@freescale.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

From: Fabio Estevam fabio.estevam@freescale.com
Let Solidrun's logo appear on Cuboxi and Hummingboard by default.
Signed-off-by: Rabeeh Khoury rabeeh@solid-run.com Signed-off-by: Fabio Estevam fabio.estevam@freescale.com Reviewed-by: Tom Rini trini@konsulko.com --- Changes since v1: - None
tools/logos/solidrun.bmp | Bin 0 -> 5558 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tools/logos/solidrun.bmp
diff --git a/tools/logos/solidrun.bmp b/tools/logos/solidrun.bmp new file mode 100644 index 0000000000000000000000000000000000000000..93db1f8f1649b1c2d81751b4403a9534b68d4167 GIT binary patch literal 5558 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
literal 0 HcmV?d00001

Hi Fabio,
On 30/04/2015 03:28, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
Let Solidrun's logo appear on Cuboxi and Hummingboard by default.
Signed-off-by: Rabeeh Khoury rabeeh@solid-run.com Signed-off-by: Fabio Estevam fabio.estevam@freescale.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot-imx, thanks !
I was not able to find the patch in patchwork. I do not know why, maybe it appears again after some time...
Best regards, Stefano Babic

On 2015-04-29, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
Add HDMI output using PLL5 as the source for the IPU clocks, and accurate VESA timings.
These settings are based on the patch from Soeren Moch smoch@web.de submitted for the tbs2910 mx6 based board.
It allows the display to work properly at 1024x768@60.
This should make the hdmi output signal compatible with most if not all modern displays.
Signed-off-by: Jon Nettleton jon.nettleton@gmail.com Signed-off-by: Fabio Estevam fabio.estevam@freescale.com Reviewed-by: Tom Rini trini@konsulko.com Tested-by: Tom Rini trini@konsulko.com
Tested-by: Vagrant Cascadian vagrant@aikidev.net
Changes since v1:
- None
board/solidrun/mx6cuboxi/mx6cuboxi.c | 101 ++++++++++++++++++++++++++++++++++- include/configs/mx6cuboxi.h | 18 ++++++- 2 files changed, 117 insertions(+), 2 deletions(-)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c index d3a32c1..eab92f1 100644 --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c @@ -18,9 +18,11 @@ #include <asm/arch/imx-regs.h> #include <asm/arch/iomux.h> #include <asm/arch/mx6-pins.h> +#include <asm/arch/mxc_hdmi.h> #include <asm/errno.h> #include <asm/gpio.h> #include <asm/imx-common/iomux-v3.h> +#include <asm/imx-common/video.h> #include <mmc.h> #include <fsl_esdhc.h> #include <miiphy.h> @@ -159,10 +161,107 @@ int board_eth_init(bd_t *bis) return cpu_eth_init(bis); }
+#ifdef CONFIG_VIDEO_IPUV3 +static void do_enable_hdmi(struct display_info_t const *dev) +{
- imx_enable_hdmi_phy();
+}
+struct display_info_t const displays[] = {
- {
.bus = -1,
.addr = 0,
.pixfmt = IPU_PIX_FMT_RGB24,
.detect = detect_hdmi,
.enable = do_enable_hdmi,
.mode = {
.name = "HDMI",
/* 1024x768@60Hz (VESA)*/
.refresh = 60,
.xres = 1024,
.yres = 768,
.pixclock = 15384,
.left_margin = 160,
.right_margin = 24,
.upper_margin = 29,
.lower_margin = 3,
.hsync_len = 136,
.vsync_len = 6,
.sync = FB_SYNC_EXT,
.vmode = FB_VMODE_NONINTERLACED
}
- }
+};
+size_t display_count = ARRAY_SIZE(displays);
+static int setup_display(void) +{
- struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
- int reg;
- int timeout = 100000;
- enable_ipu_clock();
- imx_setup_hdmi();
- /* set video pll to 455MHz (24MHz * (37+11/12) / 2) */
- setbits_le32(&ccm->analog_pll_video, BM_ANADIG_PLL_VIDEO_POWERDOWN);
- reg = readl(&ccm->analog_pll_video);
- reg &= ~BM_ANADIG_PLL_VIDEO_DIV_SELECT;
- reg |= BF_ANADIG_PLL_VIDEO_DIV_SELECT(37);
- reg &= ~BM_ANADIG_PLL_VIDEO_POST_DIV_SELECT;
- reg |= BF_ANADIG_PLL_VIDEO_POST_DIV_SELECT(1);
- writel(reg, &ccm->analog_pll_video);
- writel(BF_ANADIG_PLL_VIDEO_NUM_A(11), &ccm->analog_pll_video_num);
- writel(BF_ANADIG_PLL_VIDEO_DENOM_B(12), &ccm->analog_pll_video_denom);
- reg &= ~BM_ANADIG_PLL_VIDEO_POWERDOWN;
- writel(reg, &ccm->analog_pll_video);
- while (timeout--)
if (readl(&ccm->analog_pll_video) & BM_ANADIG_PLL_VIDEO_LOCK)
break;
- if (timeout < 0) {
printf("Warning: video pll lock timeout!\n");
return -ETIMEDOUT;
- }
- reg = readl(&ccm->analog_pll_video);
- reg |= BM_ANADIG_PLL_VIDEO_ENABLE;
- reg &= ~BM_ANADIG_PLL_VIDEO_BYPASS;
- writel(reg, &ccm->analog_pll_video);
- /* gate ipu1_di0_clk */
- clrbits_le32(&ccm->CCGR3, MXC_CCM_CCGR3_LDB_DI0_MASK);
- /* select video_pll clock / 7 for ipu1_di0_clk -> 65MHz pixclock */
- reg = readl(&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 |= (2 << MXC_CCM_CHSCCDR_IPU1_DI0_PRE_CLK_SEL_OFFSET) |
(6 << MXC_CCM_CHSCCDR_IPU1_DI0_PODF_OFFSET) |
(0 << MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET);
- writel(reg, &ccm->chsccdr);
- /* enable ipu1_di0_clk */
- setbits_le32(&ccm->CCGR3, MXC_CCM_CCGR3_LDB_DI0_MASK);
- return 0;
+} +#endif /* CONFIG_VIDEO_IPUV3 */
int board_early_init_f(void) {
- int ret = 0; setup_iomux_uart();
- return 0;
+#ifdef CONFIG_VIDEO_IPUV3
- ret = setup_display();
+#endif
- return ret;
}
int board_init(void) diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h index b569f34..207a2a6 100644 --- a/include/configs/mx6cuboxi.h +++ b/include/configs/mx6cuboxi.h @@ -27,7 +27,7 @@ #define CONFIG_IMX6_THERMAL #define CONFIG_SYS_GENERIC_BOARD
-#define CONFIG_SYS_MALLOC_LEN (2 * SZ_1M) +#define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M) #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_BOARD_LATE_INIT #define CONFIG_MXC_GPIO @@ -66,6 +66,22 @@ #define CONFIG_CONS_INDEX 1 #define CONFIG_BAUDRATE 115200
+/* Framebuffer */ +#define CONFIG_VIDEO +#define CONFIG_VIDEO_IPUV3 +#define CONFIG_IPUV3_CLK 260000000 +#define CONFIG_CFB_CONSOLE +#define CONFIG_VGA_AS_SINGLE_DEVICE +#define CONFIG_SYS_CONSOLE_IS_IN_ENV +#define CONFIG_VIDEO_BMP_RLE8 +#define CONFIG_SPLASH_SCREEN +#define CONFIG_SPLASH_SCREEN_ALIGN +#define CONFIG_BMP_16BPP +#define CONFIG_VIDEO_LOGO +#define CONFIG_VIDEO_BMP_LOGO +#define CONFIG_IMX_HDMI +#define CONFIG_IMX_VIDEO_SKIP
#define CONFIG_SYS_NO_FLASH
/* Command definition */
1.9.1

On 30/04/2015 03:28, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
Add HDMI output using PLL5 as the source for the IPU clocks, and accurate VESA timings.
These settings are based on the patch from Soeren Moch smoch@web.de submitted for the tbs2910 mx6 based board.
It allows the display to work properly at 1024x768@60.
This should make the hdmi output signal compatible with most if not all modern displays.
Signed-off-by: Jon Nettleton jon.nettleton@gmail.com Signed-off-by: Fabio Estevam fabio.estevam@freescale.com Reviewed-by: Tom Rini trini@konsulko.com Tested-by: Tom Rini trini@konsulko.com
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic
participants (3)
-
Fabio Estevam
-
Stefano Babic
-
Vagrant Cascadian