Re: [U-Boot] [PATCH V2 2/2] i.MX6: mx6qsabrelite: Add splash screen support
Thanks Stefano, On 09/18/2012 07:42 AM, Stefano Babic wrote: On 18/09/2012 16:02, Eric Nelson wrote: Hi Fabio and Stefano, While trying to understand this, I wonder whether the use of overwrite_console() addresses Wolfgang's original concern. I think the suggestion was to set the preboot variable to change things: Wolfgang's first concern was to avoid to hardcode variable inside the code, as it was done in the original mx51 / mx53 code (and not only in i.MX boards). #define CONFIG_PREBOOT "setenv stdout serial" This makes sense if you want maintain the possibility that u-boot output is displayed on the LCD. Is this really the case ? Sometimes it is. We have customers of SABRE Lite that are new to embedded who have had to purchase serial adapters upon receiving their boards, though this is rare. The other main use case is simpler: a serial port isn't hooked up during boot (i.e. in a production environment). In production, it would be more convenient to hook up a USB keyboard if needed. In most cases, we want to display a splashscreen, while the console is still managed by serial line. If this is the case, adding overwrite_console() tells video subsystem to not change the stdout variable, and then it is not required to set it back to serial neither in code nor with the help of the preboot variable. The has the benefit of allowing saveenv to completely overwrite the decision. Am I over-thinking this? It depends if you want also U-Boot's output on the display or only a picture. I'll rework the patch with overwrite_console() and keep these options in mind. Thanks for the tips. Regards, Eric ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 2/2] i.MX6: mx6qsabrelite: Add splash screen support
On 18/09/2012 16:02, Eric Nelson wrote: > > Hi Fabio and Stefano, > > While trying to understand this, I wonder whether the > use of overwrite_console() addresses Wolfgang's original > concern. > > I think the suggestion was to set the preboot variable > to change things: Wolfgang's first concern was to avoid to hardcode variable inside the code, as it was done in the original mx51 / mx53 code (and not only in i.MX boards). > > #define CONFIG_PREBOOT "setenv stdout serial" This makes sense if you want maintain the possibility that u-boot output is displayed on the LCD. Is this really the case ? In most cases, we want to display a splashscreen, while the console is still managed by serial line. If this is the case, adding overwrite_console() tells video subsystem to not change the stdout variable, and then it is not required to set it back to serial neither in code nor with the help of the preboot variable. > The has the benefit of allowing saveenv to completely > overwrite the decision. > > Am I over-thinking this? It depends if you want also U-Boot's output on the display or only a picture. 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: sba...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 2/2] i.MX6: mx6qsabrelite: Add splash screen support
On 09/17/2012 04:43 PM, Fabio Estevam wrote: Hi Eric, On Mon, Sep 17, 2012 at 8:14 PM, Eric Nelson wrote: Adds support for the Hannstar 1024 x 768 LVDS panel (Freescale part number MCIMX-LVDS1) to SABRE-Lite board. This commit is a rebase Fabio Estevan's patch from 5/31 to s/Estevan/Estevam +int board_late_init(void) +{ + setenv("stdout", "serial"); + return 0; +} Please see my previous comment on v1 about this. Wolfgang nacked this method and Stefano has proposed a nice way for keeping the console in serial. Check mx53loco and mx51evk. Hi Fabio and Stefano, While trying to understand this, I wonder whether the use of overwrite_console() addresses Wolfgang's original concern. I think the suggestion was to set the preboot variable to change things: #define CONFIG_PREBOOT "setenv stdout serial" The has the benefit of allowing saveenv to completely overwrite the decision. Am I over-thinking this? Please advise, Eric ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 2/2] i.MX6: mx6qsabrelite: Add splash screen support
On 18/09/2012 15:28, Eric Nelson wrote: > > Do you have a reference to the patch so I can follow precedent? See http://patchwork.ozlabs.org/patch/177403/ Check changes in .h. 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: sba...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 2/2] i.MX6: mx6qsabrelite: Add splash screen support
Thanks for the review, Stefano. On 09/18/2012 12:47 AM, Stefano Babic wrote: On 18/09/2012 01:14, Eric Nelson wrote: Hi Eric, Adds support for the Hannstar 1024 x 768 LVDS panel (Freescale part number MCIMX-LVDS1) to SABRE-Lite board. This commit is a rebase Fabio Estevan's patch from 5/31 to u-boot-video/master: http://patchwork.ozlabs.org/patch/162206/ Modifications include: removal of i2c setup (unneeded) cleanup of lcd_iomux to use struct mxc_ccm_reg and anatop_regs and associated constants All this stuff should not be part of the commit message, because it is more or less a changelog. Should you also include Fabio's signed-off ? Okay. I'll take it out of V3. I didn't include Fabio's sign off because he hadn't seen this yet and I changed a fair amount of code. Signed-off-by: Eric Nelson --- arch/arm/include/asm/arch-mx6/crm_regs.h |4 + board/freescale/mx6qsabrelite/mx6qsabrelite.c | 90 + include/configs/mx6qsabrelite.h | 14 - 3 files changed, 107 insertions(+), 1 deletions(-) diff --git a/arch/arm/include/asm/arch-mx6/crm_regs.h b/arch/arm/include/asm/arch-mx6/crm_regs.h index 8388e38..cffc0a1 100644 --- a/arch/arm/include/asm/arch-mx6/crm_regs.h +++ b/arch/arm/include/asm/arch-mx6/crm_regs.h @@ -294,6 +294,10 @@ struct mxc_ccm_reg { #define MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_MASK (0x7) #define MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET 0 +#define CHSCCDR_CLK_SEL_LDB_DI03 +#define CHSCCDR_PODF_DIVIDE_BY_3 2 +#define CHSCCDR_IPU_PRE_CLK_540M_PFD 5 + /* Define the bits in register CSCDR2 */ #define MXC_CCM_CSCDR2_ECSPI_CLK_PODF_MASK(0x3F<< 19) #define MXC_CCM_CSCDR2_ECSPI_CLK_PODF_OFFSET 19 diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index 4b4e89b..1632e7b 100644 --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c @@ -36,6 +36,9 @@ #include #include #include +#include +#include +#include DECLARE_GLOBAL_DATA_PTR; #define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \ @@ -195,6 +198,10 @@ static iomux_v3_cfg_t button_pads[] = { MX6Q_PAD_GPIO_18__GPIO_7_13 | MUX_PAD_CTRL(BUTTON_PAD_CTRL), }; +iomux_v3_cfg_t lcd_gpio[] = { + MX6Q_PAD_SD1_CMD__GPIO_1_18 | MUX_PAD_CTRL(NO_PAD_CTRL), +}; + static void setup_iomux_enet(void) { gpio_direction_output(IMX_GPIO_NR(3, 23), 0); @@ -372,10 +379,84 @@ int setup_sata(void) } #endif +static struct fb_videomode lvds_xga = { + .name = "Hannstar-XGA", + .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 +}; + +void lcd_iomux(void) +{ + struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR; + + int reg; + /* Turn on GPIO backlight */ + imx_iomux_v3_setup_multiple_pads(lcd_gpio, ARRAY_SIZE(lcd_gpio)); + gpio_direction_output(18, 1); + + /* Turn on LDB0,IPU,IPU DI0 clocks */ + reg = __raw_readl(&mxc_ccm->CCGR3); + reg |= 0x300F; + writel(reg,&mxc_ccm->CCGR3); I think we can add constants for these - at least for these constants, you could drop the not useful defines with offset like MXC_CCM_CCGR5_CGx_OFFSET. There is already a patch (not yet merged) for MX5, we should then doing the same for MX6. Do you have a reference to the patch so I can follow precedent? + + /* set PFD3_FRAC to 0x13 == 455 MHz (480*18)/0x13 */ + writel(0x3F00,&anatop->pfd_480_clr); + writel(0x1300,&anatop->pfd_480_set); Add constants for these. They are not already defined, but they are added when needed, see for example ehci-mx6.c Ok. + + /* set LDB0, LDB1 clk select to 011/011 */ + reg = readl(&mxc_ccm->cs2cdr); + reg&= ~(MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK +|MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK); + reg |= (3cscmr2); + reg |= MXC_CCM_CSCMR2_LDB_DI0_IPU_DIV; + 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); + /* derive clock from LDB_DI0 */ + /* divide by 3 */ + /* derive clock from 540M PFD */ Wrong style for a multiline comment Noted. These are leftovers I used while hand decoding
Re: [U-Boot] [PATCH V2 2/2] i.MX6: mx6qsabrelite: Add splash screen support
On 18/09/2012 01:14, Eric Nelson wrote: Hi Eric, > Adds support for the Hannstar 1024 x 768 LVDS panel (Freescale part > number MCIMX-LVDS1) to SABRE-Lite board. > > This commit is a rebase Fabio Estevan's patch from 5/31 to > u-boot-video/master: > http://patchwork.ozlabs.org/patch/162206/ > > Modifications include: > removal of i2c setup (unneeded) > cleanup of lcd_iomux to use struct mxc_ccm_reg and anatop_regs > and associated constants > All this stuff should not be part of the commit message, because it is more or less a changelog. Should you also include Fabio's signed-off ? > Signed-off-by: Eric Nelson > --- > arch/arm/include/asm/arch-mx6/crm_regs.h |4 + > board/freescale/mx6qsabrelite/mx6qsabrelite.c | 90 > + > include/configs/mx6qsabrelite.h | 14 - > 3 files changed, 107 insertions(+), 1 deletions(-) > > diff --git a/arch/arm/include/asm/arch-mx6/crm_regs.h > b/arch/arm/include/asm/arch-mx6/crm_regs.h > index 8388e38..cffc0a1 100644 > --- a/arch/arm/include/asm/arch-mx6/crm_regs.h > +++ b/arch/arm/include/asm/arch-mx6/crm_regs.h > @@ -294,6 +294,10 @@ struct mxc_ccm_reg { > #define MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_MASK(0x7) > #define MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET 0 > > +#define CHSCCDR_CLK_SEL_LDB_DI0 3 > +#define CHSCCDR_PODF_DIVIDE_BY_3 2 > +#define CHSCCDR_IPU_PRE_CLK_540M_PFD 5 > + > /* Define the bits in register CSCDR2 */ > #define MXC_CCM_CSCDR2_ECSPI_CLK_PODF_MASK (0x3F << 19) > #define MXC_CCM_CSCDR2_ECSPI_CLK_PODF_OFFSET 19 > diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c > b/board/freescale/mx6qsabrelite/mx6qsabrelite.c > index 4b4e89b..1632e7b 100644 > --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c > +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c > @@ -36,6 +36,9 @@ > #include > #include > #include > +#include > +#include > +#include > DECLARE_GLOBAL_DATA_PTR; > > #define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \ > @@ -195,6 +198,10 @@ static iomux_v3_cfg_t button_pads[] = { > MX6Q_PAD_GPIO_18__GPIO_7_13 | MUX_PAD_CTRL(BUTTON_PAD_CTRL), > }; > > +iomux_v3_cfg_t lcd_gpio[] = { > + MX6Q_PAD_SD1_CMD__GPIO_1_18 | MUX_PAD_CTRL(NO_PAD_CTRL), > +}; > + > static void setup_iomux_enet(void) > { > gpio_direction_output(IMX_GPIO_NR(3, 23), 0); > @@ -372,10 +379,84 @@ int setup_sata(void) > } > #endif > > +static struct fb_videomode lvds_xga = { > + .name = "Hannstar-XGA", > + .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 > +}; > + > +void lcd_iomux(void) > +{ > + struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; > + struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR; > + > + int reg; > + /* Turn on GPIO backlight */ > + imx_iomux_v3_setup_multiple_pads(lcd_gpio, ARRAY_SIZE(lcd_gpio)); > + gpio_direction_output(18, 1); > + > + /* Turn on LDB0,IPU,IPU DI0 clocks */ > + reg = __raw_readl(&mxc_ccm->CCGR3); > + reg |= 0x300F; > + writel(reg, &mxc_ccm->CCGR3); I think we can add constants for these - at least for these constants, you could drop the not useful defines with offset like MXC_CCM_CCGR5_CGx_OFFSET. There is already a patch (not yet merged) for MX5, we should then doing the same for MX6. > + > + /* set PFD3_FRAC to 0x13 == 455 MHz (480*18)/0x13 */ > + writel(0x3F00, &anatop->pfd_480_clr); > + writel(0x1300, &anatop->pfd_480_set); Add constants for these. They are not already defined, but they are added when needed, see for example ehci-mx6.c > + > + /* set LDB0, LDB1 clk select to 011/011 */ > + reg = readl(&mxc_ccm->cs2cdr); > + reg &= ~(MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK > + |MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK); > + reg |= (3< + |(3< + writel(reg, &mxc_ccm->cs2cdr); > + > + reg = readl(&mxc_ccm->cscmr2); > + reg |= MXC_CCM_CSCMR2_LDB_DI0_IPU_DIV; > + 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); > + /* derive clock from LDB_DI0 */ > + /* divide by 3 */ > + /* derive clock from 540M PFD */ Wrong style for a multiline comment > + reg |= (CHSCCDR_CLK_SEL_LDB_DI0 > + < + |(CHSCCDR_PODF_DIVIDE_BY_3 > + < + |(CHSCCDR_IPU_PRE_CLK_540M_PFD > +
Re: [U-Boot] [PATCH V2 2/2] i.MX6: mx6qsabrelite: Add splash screen support
On 09/17/2012 05:08 PM, Eric Nelson wrote: Hi Fabio, On 09/17/2012 04:43 PM, Fabio Estevam wrote: Hi Eric, +int board_late_init(void) +{ + setenv("stdout", "serial"); + return 0; +} Please see my previous comment on v1 about this. Wolfgang nacked this method and Stefano has proposed a nice way for keeping the console in serial. Check mx53loco and mx51evk. Thanks. I'll look into it. Like this? http://lists.denx.de/pipermail/u-boot/2012-August/129967.html ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 2/2] i.MX6: mx6qsabrelite: Add splash screen support
On Mon, Sep 17, 2012 at 9:43 PM, Eric Nelson wrote: > Like this? > http://lists.denx.de/pipermail/u-boot/2012-August/129967.html Yes, correct. Regards, Fabio Estevam ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 2/2] i.MX6: mx6qsabrelite: Add splash screen support
Hi Fabio, On 09/17/2012 04:43 PM, Fabio Estevam wrote: Hi Eric, On Mon, Sep 17, 2012 at 8:14 PM, Eric Nelson wrote: Adds support for the Hannstar 1024 x 768 LVDS panel (Freescale part number MCIMX-LVDS1) to SABRE-Lite board. This commit is a rebase Fabio Estevan's patch from 5/31 to s/Estevan/Estevam Oops, sorry... +int board_late_init(void) +{ + setenv("stdout", "serial"); + return 0; +} Please see my previous comment on v1 about this. Wolfgang nacked this method and Stefano has proposed a nice way for keeping the console in serial. Check mx53loco and mx51evk. Thanks. I'll look into it. I'll also look into this: http://lists.denx.de/pipermail/u-boot/2012-July/129556.html Regards, Eric ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 2/2] i.MX6: mx6qsabrelite: Add splash screen support
Hi Eric, On Mon, Sep 17, 2012 at 8:14 PM, Eric Nelson wrote: > Adds support for the Hannstar 1024 x 768 LVDS panel (Freescale part > number MCIMX-LVDS1) to SABRE-Lite board. > > This commit is a rebase Fabio Estevan's patch from 5/31 to s/Estevan/Estevam > +int board_late_init(void) > +{ > + setenv("stdout", "serial"); > + return 0; > +} Please see my previous comment on v1 about this. Wolfgang nacked this method and Stefano has proposed a nice way for keeping the console in serial. Check mx53loco and mx51evk. Regards, Fabio Estevam ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 2/2] i.MX6: mx6qsabrelite: Add splash screen support
Adds support for the Hannstar 1024 x 768 LVDS panel (Freescale part number MCIMX-LVDS1) to SABRE-Lite board. This commit is a rebase Fabio Estevan's patch from 5/31 to u-boot-video/master: http://patchwork.ozlabs.org/patch/162206/ Modifications include: removal of i2c setup (unneeded) cleanup of lcd_iomux to use struct mxc_ccm_reg and anatop_regs and associated constants Signed-off-by: Eric Nelson --- arch/arm/include/asm/arch-mx6/crm_regs.h |4 + board/freescale/mx6qsabrelite/mx6qsabrelite.c | 90 + include/configs/mx6qsabrelite.h | 14 - 3 files changed, 107 insertions(+), 1 deletions(-) diff --git a/arch/arm/include/asm/arch-mx6/crm_regs.h b/arch/arm/include/asm/arch-mx6/crm_regs.h index 8388e38..cffc0a1 100644 --- a/arch/arm/include/asm/arch-mx6/crm_regs.h +++ b/arch/arm/include/asm/arch-mx6/crm_regs.h @@ -294,6 +294,10 @@ struct mxc_ccm_reg { #define MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_MASK (0x7) #define MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET0 +#define CHSCCDR_CLK_SEL_LDB_DI03 +#define CHSCCDR_PODF_DIVIDE_BY_3 2 +#define CHSCCDR_IPU_PRE_CLK_540M_PFD 5 + /* Define the bits in register CSCDR2 */ #define MXC_CCM_CSCDR2_ECSPI_CLK_PODF_MASK (0x3F << 19) #define MXC_CCM_CSCDR2_ECSPI_CLK_PODF_OFFSET 19 diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index 4b4e89b..1632e7b 100644 --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c @@ -36,6 +36,9 @@ #include #include #include +#include +#include +#include DECLARE_GLOBAL_DATA_PTR; #define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \ @@ -195,6 +198,10 @@ static iomux_v3_cfg_t button_pads[] = { MX6Q_PAD_GPIO_18__GPIO_7_13 | MUX_PAD_CTRL(BUTTON_PAD_CTRL), }; +iomux_v3_cfg_t lcd_gpio[] = { + MX6Q_PAD_SD1_CMD__GPIO_1_18 | MUX_PAD_CTRL(NO_PAD_CTRL), +}; + static void setup_iomux_enet(void) { gpio_direction_output(IMX_GPIO_NR(3, 23), 0); @@ -372,10 +379,84 @@ int setup_sata(void) } #endif +static struct fb_videomode lvds_xga = { + .name = "Hannstar-XGA", + .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 +}; + +void lcd_iomux(void) +{ + struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR; + + int reg; + /* Turn on GPIO backlight */ + imx_iomux_v3_setup_multiple_pads(lcd_gpio, ARRAY_SIZE(lcd_gpio)); + gpio_direction_output(18, 1); + + /* Turn on LDB0,IPU,IPU DI0 clocks */ + reg = __raw_readl(&mxc_ccm->CCGR3); + reg |= 0x300F; + writel(reg, &mxc_ccm->CCGR3); + + /* set PFD3_FRAC to 0x13 == 455 MHz (480*18)/0x13 */ + writel(0x3F00, &anatop->pfd_480_clr); + writel(0x1300, &anatop->pfd_480_set); + + /* set LDB0, LDB1 clk select to 011/011 */ + reg = readl(&mxc_ccm->cs2cdr); + reg &= ~(MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK +|MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK); + reg |= (3cscmr2); + reg |= MXC_CCM_CSCMR2_LDB_DI0_IPU_DIV; + 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); + /* derive clock from LDB_DI0 */ + /* divide by 3 */ + /* derive clock from 540M PFD */ + reg |= (CHSCCDR_CLK_SEL_LDB_DI0 +