ARM: mxs: Various MX23 adjustments
Subsystems (5)
cover ARM: mxs: Various MX23 adjustments
This patchset implements support for two boards which I have. They have some specific hardware requirements, so they are a nice benchmark for U-Boot on MXS. The patchset can be broken into two parts:
First six patches add support for SanDisk Sansa Fuze+ and Creative X-Fi3, both boards based on STMP3780. Note that the i.MX23 is a rebranded STMP3780 with updated BootROM.
The second part, consisting of five patches, adds smaller 4x6 font pulled from Linux kernel and fixes CFB console to handle this font correctly.
NOTE: This patchset depends on http://patchwork.ozlabs.org/patch/263488/ ,
which will hopefully be applied shortly.
Marek Vasut (11):
dma: apbh: Add special circular mode for LCD
video: Allocate the MXSFB framebuffer aligned
video: Add System-Mode configuration hook into mxsfb
video: Implement continuous screen refresh for SmartLCD into mxsfb
ARM: mxs: Add Creative ZEN XFi3 board
ARM: mxs: Add SanDisk Sansa Fuze+ board
video: Encapsulate font in video_font_data.h
video: Add small 4x6 font from Linux
video: Fix cfb_console for 4-bit wide font
ARM: mxs: Enable 4x6 font for X-Fi3
ARM: mxs: Enable 4x6 font for Fuze+
MAINTAINERS | 2 + arch/arm/include/asm/imx-common/dma.h | 2 + arch/powerpc/cpu/mpc8xx/video.c | 1 - board/creative/xfi3/Makefile | 47 + board/creative/xfi3/spl_boot.c | 150 +++ board/creative/xfi3/xfi3.c | 221 +++ board/sandisk/sansa_fuze_plus/Makefile | 47 + board/sandisk/sansa_fuze_plus/sfp.c | 386 ++++++ board/sandisk/sansa_fuze_plus/spl_boot.c | 155 +++ boards.cfg | 2 + common/lcd.c | 1 - drivers/dma/apbh_dma.c | 22 + drivers/video/cfb_console.c | 22 +- drivers/video/mxsfb.c | 45 +- drivers/video/sed156x.c | 1 - include/configs/sansa_fuze_plus.h | 84 ++ include/configs/xfi3.h | 83 ++ include/video_font.h | 9 +- include/video_font_4x6.h | 2154 ++++++++++++++++++++++++++++++ include/video_font_data.h | 5 + 20 files changed, 3430 insertions(+), 9 deletions(-) create mode 100644 board/creative/xfi3/Makefile create mode 100644 board/creative/xfi3/spl_boot.c create mode 100644 board/creative/xfi3/xfi3.c create mode 100644 board/sandisk/sansa_fuze_plus/Makefile create mode 100644 board/sandisk/sansa_fuze_plus/sfp.c create mode 100644 board/sandisk/sansa_fuze_plus/spl_boot.c create mode 100644 include/configs/sansa_fuze_plus.h create mode 100644 include/configs/xfi3.h create mode 100644 include/video_font_4x6.h
Signature · 1 line
1.7.10.4
PATCH 1/11 dma: apbh: Add special circular mode for LCD
Add special function that executes a specially crafted circular DMA descriptor. The function doesn't wait for the descriptor to finish the transfer, since the descritor never finishes. This is useful when operating a SmartLCD through the LCDIF interface, as the LCDIF does not give us any means to have continuous refresh of the SmartLCD. Instead, the RUN bit in the LCDIF CTRL register must be triggered manually. This can be worked around by starting an DMA transfer which continuously sets the RUN bit. This function allows starting exactly such transfer.
--- arch/arm/include/asm/imx-common/dma.h | 2 ++ drivers/dma/apbh_dma.c | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+)
arch/arm/include/asm/imx-common/dma.h +2 -0
@@ -174,4 +174,6 @@ void mxs_dma_init(void);int mxs_dma_init_channel (int chan);int mxs_dma_release (int chan); +void mxs_dma_circ_start (int chan,struct mxs_dma_desc *pdesc); +#endif /* __DMA_H__ */
drivers/dma/apbh_dma.c +22 -0
@@ -557,6 +557,28 @@ int mxs_dma_go(int chan) }/* +* Execute a continuously running circular DMA descriptor. +* NOTE: This is not intended for general use, but rather +* for the LCD driver in Smart-LCD mode. It allows +* continuous triggering of the RUN bit there. +*/ +void mxs_dma_circ_start (int chan,struct mxs_dma_desc *pdesc) +{ +struct mxs_apbh_regs *apbh_regs = + (struct mxs_apbh_regs *)MXS_APBH_BASE ; + +mxs_dma_flush_desc (pdesc); + +mxs_dma_enable_irq (chan,1 ); + +writel (mxs_dma_cmd_address (pdesc), + &apbh_regs->ch[chan].hw_apbh_ch_nxtcmdar); +writel (1 , &apbh_regs->ch[chan].hw_apbh_ch_sema); +writel (1 << (chan +APBH_CTRL0_CLKGATE_CHANNEL_OFFSET ), + &apbh_regs->hw_apbh_ctrl0_clr); +} + +/* * Initialize the DMA hardware */ void mxs_dma_init (void )
Signature · 1 line
1.7.10.4
PATCH 1/11 dma: apbh: Add special circular mode for LCD
Quoted 15 lines · On Tue, 30 Jul 2013 23:37:51 +0200 Marek Vasut <[email protected]> wrote:
Add special function that executes a specially crafted circular DMA descriptor. The function doesn't wait for the descriptor to finish the transfer, since the descritor never finishes. This is useful when operating a SmartLCD through the LCDIF interface, as the LCDIF does not give us any means to have continuous refresh of the SmartLCD. Instead, the RUN bit in the LCDIF CTRL register must be triggered manually. This can be worked around by starting an DMA transfer which continuously sets the RUN bit. This function allows starting exactly such transfer.
Signed-off-by Marek Vasut <[email protected]>Cc Anatolij Gustschin <[email protected]>Cc Fabio Estevam <[email protected]>Cc Otavio Salvador <[email protected]>Cc Stefano Babic <[email protected]>
Quoted 4 lines
--- arch/arm/include/asm/imx-common/dma.h | 2 ++ drivers/dma/apbh_dma.c | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+)
Applied to u-boot-video/master. Thanks!
Anatolij
PATCH 2/11 video: Allocate the MXSFB framebuffer aligned
In reply to Marek VasutAllocate the framebuffer aligned so it can be flushed and the flush_dcache_range() function won't complain.
--- drivers/video/mxsfb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/video/mxsfb.c +2 -1
@@ -174,7 +174,8 @@ void *video_hw_init(void) panel.memSize = mode.xres * mode.yres * panel.gdfBytesPP;/* Allocate framebuffer */ - fb =malloc (panel.memSize); + fb =memalign (ARCH_DMA_MINALIGN , +roundup (panel.memSize,ARCH_DMA_MINALIGN ));if (!fb) {printf ("MXSFB: Error allocating framebuffer!\n" );return NULL ;
Signature · 1 line
1.7.10.4
PATCH 2/11 video: Allocate the MXSFB framebuffer aligned
Quoted 11 lines · On Tue, 30 Jul 2013 23:37:52 +0200 Marek Vasut <[email protected]> wrote:
Allocate the framebuffer aligned so it can be flushed and the
flush_dcache_range()function won't complain.Signed-off-by Marek Vasut <[email protected]>Cc Anatolij Gustschin <[email protected]>Cc Fabio Estevam <[email protected]>Cc Otavio Salvador <[email protected]>Cc Stefano Babic <[email protected]>--- drivers/video/mxsfb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to u-boot-video/master. Thanks!
Anatolij
PATCH 3/11 video: Add System-Mode configuration hook into mxsfb
In reply to Marek VasutAdd hook that allow configuring SmartLCD attached the MXS LCDIF controller operating in System-Mode. This hook can be overriden by a platform-specific SmartLCD programming routine, which writes the SmartLCD specific values into it's registers.
Also, this patch makes sure the SYNC signals are off for the SmartLCD case.
--- drivers/video/mxsfb.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/video/mxsfb.c +16 -0
@@ -34,6 +34,17 @@static GraphicDevice panel; +/** +* mxsfb_system_setup() - Fine-tune LCDIF configuration +* +* This function is used to adjust the LCDIF configuration. This is usually +* needed when driving the controller in System-Mode to operate an 8080 or +* 6800 connected SmartLCD. +*/ +__weak void mxsfb_system_setup (void ) +{ +} +/* * DENX M28EVK: * setenv videomode
@@ -88,6 +99,9 @@ static void mxs_lcd_init(GraphicDevice *panel,writel (valid_data <<LCDIF_CTRL1_BYTE_PACKING_FORMAT_OFFSET , ®s->hw_lcdif_ctrl1); + +mxsfb_system_setup (); +writel ((mode->yres <<LCDIF_TRANSFER_COUNT_V_COUNT_OFFSET ) | mode->xres, ®s->hw_lcdif_transfer_count);
@@ -115,8 +129,10 @@ static void mxs_lcd_init(GraphicDevice *panel,/* Flush FIFO first */ writel (LCDIF_CTRL1_FIFO_CLEAR , ®s->hw_lcdif_ctrl1_set); +#ifndef CONFIG_VIDEO_MXS_MODE_SYSTEM /* Sync signals ON */ setbits_le32 (®s->hw_lcdif_vdctrl4,LCDIF_VDCTRL4_SYNC_SIGNALS_ON ); +#endif /* FIFO cleared */ writel (LCDIF_CTRL1_FIFO_CLEAR , ®s->hw_lcdif_ctrl1_clr);
Signature · 1 line
1.7.10.4
PATCH 3/11 video: Add System-Mode configuration hook into mxsfb
Quoted 50 lines · Marek Vasut
Add hook that allow configuring SmartLCD attached the MXS LCDIF controller operating in System-Mode. This hook can be overriden by a platform-specific SmartLCD programming routine, which writes the SmartLCD specific values into it's registers.
Also, this patch makes sure the SYNC signals are off for the SmartLCD case.
Signed-off-by Marek Vasut <[email protected]>Cc Anatolij Gustschin <[email protected]>Cc Fabio Estevam <[email protected]>Cc Otavio Salvador <[email protected]>Cc Stefano Babic <[email protected]>--- drivers/video/mxsfb.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)drivers/video/mxsfb.c +14
-0@@ -34,6 +34,17 @@static GraphicDevice panel; +/** +* mxsfb_system_setup() - Fine-tune LCDIF configuration +* +* This function is used to adjust the LCDIF configuration. This is usually +* needed when driving the controller in System-Mode to operate an 8080 or +* 6800 connected SmartLCD. +*/ +__weak void mxsfb_system_setup (void ) +{ +} +/* * DENX M28EVK: * setenv videomode @@ -88,6 +99,9 @@ static void mxs_lcd_init(GraphicDevice *panel,writel (valid_data <<LCDIF_CTRL1_BYTE_PACKING_FORMAT_OFFSET , ®s->hw_lcdif_ctrl1); + +mxsfb_system_setup (); +writel ((mode->yres <<LCDIF_TRANSFER_COUNT_V_COUNT_OFFSET ) | mode->xres, ®s->hw_lcdif_transfer_count);
drivers/video/mxsfb.c static void mxs_lcd_init(GraphicDevice *panel, · line 132
Quoted 4 lines
drivers/video/mxsfb.c +1
-0@@ -115,8 +129,10 @@ static void mxs_lcd_init(GraphicDevice *panel,/* Flush FIFO first */ writel (LCDIF_CTRL1_FIFO_CLEAR , ®s->hw_lcdif_ctrl1_set); +#ifndef CONFIG_VIDEO_MXS_MODE_SYSTEM
Mode system or System mode?
Quoted 9 lines
drivers/video/mxsfb.c +1
-1/* Sync signals ON */ setbits_le32 (®s->hw_lcdif_vdctrl4,LCDIF_VDCTRL4_SYNC_SIGNALS_ON ); +#endif /* FIFO cleared */ writel (LCDIF_CTRL1_FIFO_CLEAR , ®s->hw_lcdif_ctrl1_clr); --1.7.10.4
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
PATCH 3/11 video: Add System-Mode configuration hook into mxsfb
Dear Otavio Salvador,
Quoted 59 lines · Marek Vasut
Quoted 58 lines
Add hook that allow configuring SmartLCD attached the MXS LCDIF controller operating in System-Mode. This hook can be overriden by a platform-specific SmartLCD programming routine, which writes the SmartLCD specific values into it's registers.
Also, this patch makes sure the SYNC signals are off for the SmartLCD case.
Signed-off-by Marek Vasut <[email protected]>Cc Anatolij Gustschin <[email protected]>Cc Fabio Estevam <[email protected]>Cc Otavio Salvador <[email protected]>Cc Stefano Babic <[email protected]>---
drivers/video/mxsfb.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)drivers/video/mxsfb.c +4
-0@@ -34,6 +34,17 @@static GraphicDevice panel; +/** +* mxsfb_system_setup() - Fine-tune LCDIF configuration +* +* This function is used to adjust the LCDIF configuration. This is usually + * needed when driving the controller in System-Mode to operate an 8080 or + * 6800 connected SmartLCD.
+ */drivers/video/mxsfb.c +7
-0+__weak void mxsfb_system_setup (void ) +{ +} +/* * DENX M28EVK: * setenv videomode @@ -88,6 +99,9 @@ static void mxs_lcd_init(GraphicDevice *panel,writel (valid_data <<LCDIF_CTRL1_BYTE_PACKING_FORMAT_OFFSET , ®s->hw_lcdif_ctrl1); + +mxsfb_system_setup (); +writel((mode->yres << LCDIF_TRANSFER_COUNT_V_COUNT_OFFSET) | mode->xres, ®s->hw_lcdif_transfer_count);
Quoted 8 lines
drivers/video/mxsfb.c static void mxs_lcd_init(GraphicDevice *panel, · line 133
Quoted 6 lines
drivers/video/mxsfb.c +1
-0@@ -115,8 +129,10 @@ static void mxs_lcd_init(GraphicDevice *panel,/* Flush FIFO first */ writel (LCDIF_CTRL1_FIFO_CLEAR , ®s->hw_lcdif_ctrl1_set); +#ifndef CONFIG_VIDEO_MXS_MODE_SYSTEM Mode system or System mode?
This is a name of configuration macro, CONFIG_VIDEO_MXS_MODE_SYSTEM . Otherwise I do not understand what you are asking about.
Best regards,
Marek Vasut
PATCH 3/11 video: Add System-Mode configuration hook into mxsfb
Quoted 66 lines · Marek Vasut
Dear Otavio Salvador,
Quoted 64 lines · Marek Vasut
Quoted 63 lines
Add hook that allow configuring SmartLCD attached the MXS LCDIF controller operating in System-Mode. This hook can be overriden by a platform-specific SmartLCD programming routine, which writes the SmartLCD specific values into it's registers.
Also, this patch makes sure the SYNC signals are off for the SmartLCD case.
Signed-off-by Marek Vasut <[email protected]>Cc Anatolij Gustschin <[email protected]>Cc Fabio Estevam <[email protected]>Cc Otavio Salvador <[email protected]>Cc Stefano Babic <[email protected]>---
drivers/video/mxsfb.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)drivers/video/mxsfb.c +4
-0@@ -34,6 +34,17 @@static GraphicDevice panel; +/** +* mxsfb_system_setup() - Fine-tune LCDIF configuration +* +* This function is used to adjust the LCDIF configuration. This is usually + * needed when driving the controller in System-Mode to operate an 8080 or + * 6800 connected SmartLCD.
+ */drivers/video/mxsfb.c +7
-0+__weak void mxsfb_system_setup (void ) +{ +} +/* * DENX M28EVK: * setenv videomode @@ -88,6 +99,9 @@ static void mxs_lcd_init(GraphicDevice *panel,writel (valid_data <<LCDIF_CTRL1_BYTE_PACKING_FORMAT_OFFSET , ®s->hw_lcdif_ctrl1); + +mxsfb_system_setup (); +writel((mode->yres << LCDIF_TRANSFER_COUNT_V_COUNT_OFFSET) | mode->xres, ®s->hw_lcdif_transfer_count);drivers/video/mxsfb.c +0
-0@@ -115,8 +129,10 @@ static void mxs_lcd_init(GraphicDevice *panel,/* Flush FIFO first */ writel (LCDIF_CTRL1_FIFO_CLEAR , ®s->hw_lcdif_ctrl1_set);
Quoted 6 lines
Quoted 3 lines
drivers/video/mxsfb.c static void mxs_lcd_init(GraphicDevice *panel, · line 132
Quoted 1 line
drivers/video/mxsfb.c +1
-0+#ifndef CONFIG_VIDEO_MXS_MODE_SYSTEM Mode system or System mode?
This is a name of configuration macro,
CONFIG_VIDEO_MXS_MODE_SYSTEM. Otherwise I do not understand what you are asking about.
I got this but accordingly to your commitlog it should be CONFIG_VIDEO_MXS_SYSTEM_MODE to match the description. Any reason to not use this name?
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
PATCH 3/11 video: Add System-Mode configuration hook into mxsfb
Dear Otavio Salvador,
Quoted 71 lines · Marek Vasut
Quoted 70 lines
Dear Otavio Salvador,
Quoted 67 lines · Marek Vasut
Quoted 59 lines
Add hook that allow configuring SmartLCD attached the MXS LCDIF controller operating in System-Mode. This hook can be overriden by a platform-specific SmartLCD programming routine, which writes the SmartLCD specific values into it's registers.
Also, this patch makes sure the SYNC signals are off for the SmartLCD case.
Signed-off-by Marek Vasut <[email protected]>Cc Anatolij Gustschin <[email protected]>Cc Fabio Estevam <[email protected]>Cc Otavio Salvador <[email protected]>Cc Stefano Babic <[email protected]>---
drivers/video/mxsfb.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)drivers/video/mxsfb.c +4
-0@@ -34,6 +34,17 @@static GraphicDevice panel; +/** +* mxsfb_system_setup() - Fine-tune LCDIF configuration +* +* This function is used to adjust the LCDIF configuration. This is usually + * needed when driving the controller in System-Mode to operate an 8080 or + * 6800 connected SmartLCD.
+ */drivers/video/mxsfb.c +7
-0+__weak void mxsfb_system_setup (void ) +{ +} +/* * DENX M28EVK: * setenv videomode @@ -88,6 +99,9 @@ static void mxs_lcd_init(GraphicDevice *panel,writel (valid_data <<LCDIF_CTRL1_BYTE_PACKING_FORMAT_OFFSET , ®s->hw_lcdif_ctrl1); + +mxsfb_system_setup (); +writel((mode->yres << LCDIF_TRANSFER_COUNT_V_COUNT_OFFSET) | mode->xres, ®s->hw_lcdif_transfer_count);drivers/video/mxsfb.c static void mxs_lcd_init(GraphicDevice *panel, · line 133
Quoted 5 lines
drivers/video/mxsfb.c +1
-0@@ -115,8 +129,10 @@ static void mxs_lcd_init(GraphicDevice *panel,/* Flush FIFO first */ writel (LCDIF_CTRL1_FIFO_CLEAR , ®s->hw_lcdif_ctrl1_set); +#ifndef CONFIG_VIDEO_MXS_MODE_SYSTEM Mode system or System mode?
Quoted 6 lines
Quoted 2 lines
This is a name of configuration macro,
CONFIG_VIDEO_MXS_MODE_SYSTEM. Otherwise I do not understand what you are asking about.I got this but accordingly to your commitlog it should be
CONFIG_VIDEO_MXS_SYSTEM_MODEto match the description. Any reason to not use this name?
Sorry, is this name of the macro mentioned in the commit log anywhere? I don't see it there. I believe grepping for CONFIG_VIDEO_MXS_MODE will make it easier in the future -- if we were to support more modes -- to find all occurances of such conditionals.
Best regards,
Marek Vasut
PATCH 3/11 video: Add System-Mode configuration hook into mxsfb
In reply to Marek VasutHi Marek,
Quoted 26 lines · Marek Vasut
Add hook that allow configuring SmartLCD attached the MXS LCDIF controller operating in System-Mode. This hook can be overriden by a platform-specific SmartLCD programming routine, which writes the SmartLCD specific values into it's registers.
Also, this patch makes sure the SYNC signals are off for the SmartLCD case.
Signed-off-by Marek Vasut <[email protected]>Cc Anatolij Gustschin <[email protected]>Cc Fabio Estevam <[email protected]>Cc Otavio Salvador <[email protected]>Cc Stefano Babic <[email protected]>--- drivers/video/mxsfb.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)drivers/video/mxsfb.c +1
-0@@ -34,6 +34,17 @@static GraphicDevice panel; +/**
drivers/video/mxsfb.c line 47
Quoted 10 lines
drivers/video/mxsfb.c +10
-0+* mxsfb_system_setup() - Fine-tune LCDIF configuration +* +* This function is used to adjust the LCDIF configuration. This is usually +* needed when driving the controller in System-Mode to operate an 8080 or +* 6800 connected SmartLCD. +*/ +__weak void mxsfb_system_setup (void ) +{ +} +
We have no easy way to know if a function is declared weak, but generally a lot of weak functions are board specific.
Try to use the same naming schema, and rename this one as board_mxfb_setup() (or something like that).
Or better: why cannot we use board_video_init(), as this name is already used by other SOCs ?
Quoted 14 lines
drivers/video/mxsfb.c +3
-0/* * DENX M28EVK: * setenv videomode @@ -88,6 +99,9 @@ static void mxs_lcd_init(GraphicDevice *panel,writel (valid_data <<LCDIF_CTRL1_BYTE_PACKING_FORMAT_OFFSET , ®s->hw_lcdif_ctrl1); + +mxsfb_system_setup (); +writel ((mode->yres <<LCDIF_TRANSFER_COUNT_V_COUNT_OFFSET ) | mode->xres, ®s->hw_lcdif_transfer_count);
drivers/video/mxsfb.c static void mxs_lcd_init(GraphicDevice *panel, · line 135
Quoted 7 lines
drivers/video/mxsfb.c +2
-0@@ -115,8 +129,10 @@ static void mxs_lcd_init(GraphicDevice *panel,/* Flush FIFO first */ writel (LCDIF_CTRL1_FIFO_CLEAR , ®s->hw_lcdif_ctrl1_set); +#ifndef CONFIG_VIDEO_MXS_MODE_SYSTEM /* Sync signals ON */ setbits_le32 (®s->hw_lcdif_vdctrl4,LCDIF_VDCTRL4_SYNC_SIGNALS_ON ); +#endif
Question: is there anything wrong to move it into mxsfb_system_setup() ? I would prefer to avoid adding a new not documented CONFIG_ only to set a bit...
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== 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 =====================================================================
PATCH 3/11 video: Add System-Mode configuration hook into mxsfb
Dear Stefano Babic,
Quoted 44 lines
Hi Marek,
Quoted 33 lines · Marek Vasut
Add hook that allow configuring SmartLCD attached the MXS LCDIF controller operating in System-Mode. This hook can be overriden by a platform-specific SmartLCD programming routine, which writes the SmartLCD specific values into it's registers.
Also, this patch makes sure the SYNC signals are off for the SmartLCD case.
Signed-off-by Marek Vasut <[email protected]>Cc Anatolij Gustschin <[email protected]>Cc Fabio Estevam <[email protected]>Cc Otavio Salvador <[email protected]>Cc Stefano Babic <[email protected]>---
drivers/video/mxsfb.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)drivers/video/mxsfb.c +4
-0@@ -34,6 +34,17 @@static GraphicDevice panel; +/** +* mxsfb_system_setup() - Fine-tune LCDIF configuration +* +* This function is used to adjust the LCDIF configuration. This is usually + * needed when driving the controller in System-Mode to operate an 8080 or + * 6800 connected SmartLCD.
+ */drivers/video/mxsfb.c line 47
Quoted 4 lines
drivers/video/mxsfb.c +4
-0+__weak void mxsfb_system_setup (void ) +{ +} +We have no easy way to know if a function is declared weak, but generally a lot of weak functions are board specific.
Quoted 5 lines
Try to use the same naming schema, and rename this one as
board_mxfb_setup()(or something like that).Or better: why cannot we use
board_video_init(), as this name is already used by other SOCs ?
This is system-mode specific and needs to be called at this particular place.
Quoted 27 lines
Quoted 27 lines
/*
* DENX M28EVK:
* setenv videomodedrivers/video/mxsfb.c +3
-0@@ -88,6 +99,9 @@ static void mxs_lcd_init(GraphicDevice *panel,writel (valid_data <<LCDIF_CTRL1_BYTE_PACKING_FORMAT_OFFSET , ®s->hw_lcdif_ctrl1); + +mxsfb_system_setup (); +drivers/video/mxsfb.c +1
-0writel ((mode->yres <<LCDIF_TRANSFER_COUNT_V_COUNT_OFFSET ) | mode->xres, ®s->hw_lcdif_transfer_count);@@ -115,8 +129,10 @@ static void mxs_lcd_init(GraphicDevice *panel,/* Flush FIFO first */ writel (LCDIF_CTRL1_FIFO_CLEAR , ®s->hw_lcdif_ctrl1_set); +#ifndef CONFIG_VIDEO_MXS_MODE_SYSTEM
Quoted 8 lines
drivers/video/mxsfb.c static void mxs_lcd_init(GraphicDevice *panel,
Quoted 4 lines
drivers/video/mxsfb.c +1
-0/* Sync signals ON */ setbits_le32 (®s->hw_lcdif_vdctrl4,LCDIF_VDCTRL4_SYNC_SIGNALS_ON ); +#endif Question: is there anything wrong to move it into
mxsfb_system_setup()? I would prefer to avoid adding a new not documentedCONFIG_only to set a bit...
Yes, the order in which the LCD is configured must be preserved as-is.
Best regards,
Marek Vasut
PATCH 3/11 video: Add System-Mode configuration hook into mxsfb
Hi Marek,
Quoted 7 lines · Marek Vasut
Quoted 4 lines
Question: is there anything wrong to move it into
mxsfb_system_setup()? I would prefer to avoid adding a new not documentedCONFIG_only to set a bit...Yes, the order in which the LCD is configured must be preserved as-is.
Ok, understood - sometimes is not possible to suimplify.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== 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 =====================================================================
PATCH 3/11 video: Add System-Mode configuration hook into mxsfb
Dear Stefano Babic,
Quoted 10 lines
Hi Marek,
Quoted 5 lines · Marek Vasut
Quoted 3 lines
Question: is there anything wrong to move it into
mxsfb_system_setup()? I would prefer to avoid adding a new not documentedCONFIG_only to set a bit...Yes, the order in which the LCD is configured must be preserved as-is.
Ok, understood - sometimes is not possible to suimplify.
I believe SmartLCDs should be considered a crime against hardware design (and transitively an offense against software engineers' human rights). Just my 5 cents ...
Best regards,
Marek Vasut
PATCH 3/11 video: Add System-Mode configuration hook into mxsfb
In reply to Marek VasutQuoted 8 lines · On Tue, 30 Jul 2013 23:37:53 +0200 Marek Vasut <[email protected]> wrote:
Add hook that allow configuring SmartLCD attached the MXS LCDIF controller operating in System-Mode. This hook can be overriden by a platform-specific SmartLCD programming routine, which writes the SmartLCD specific values into it's registers.
Also, this patch makes sure the SYNC signals are off for the SmartLCD case.
Quoted 8 lines
Signed-off-by Marek Vasut <[email protected]>Cc Anatolij Gustschin <[email protected]>Cc Fabio Estevam <[email protected]>Cc Otavio Salvador <[email protected]>Cc Stefano Babic <[email protected]>--- drivers/video/mxsfb.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
Applied to u-boot-video/master. Thanks!
Anatolij
PATCH 4/11 video: Implement continuous screen refresh for SmartLCD into mxsfb
In reply to Marek VasutThe LCDIF interface doesn't give us any means to do continuous refresh when driving a SmartLCD. To work this around, we produce a special circular DMA descriptor, which only writes the HW_LCDIF_CTRL0 register and sets the RUN bit.
--- drivers/video/mxsfb.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
drivers/video/mxsfb.c +26 -0
@@ -28,11 +28,14 @@#include <asm/errno.h> #include <asm/io.h> +#include <asm/imx-common/dma.h> +#include "videomodes.h" #define PS2KHZ (ps) (1000000000UL / (ps))static GraphicDevice panel; +struct mxs_dma_desc desc;/** * mxsfb_system_setup() - Fine-tune LCDIF configuration
@@ -207,5 +210,28 @@ void *video_hw_init(void)/* Start framebuffer */ mxs_lcd_init (&panel, &mode, bpp); +#ifdef CONFIG_VIDEO_MXS_MODE_SYSTEM +/* +* If the LCD runs in system mode, the LCD refresh has to be triggered +* manually by setting the RUN bit in HW_LCDIF_CTRL register. To avoid +* having to set this bit manually after every single change in the +* framebuffer memory, we set up specially crafted circular DMA, which +* sets the RUN bit, then waits until it gets cleared and repeats this +* infinitelly. This way, we get smooth continuous updates of the LCD. +*/ +struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE ; + +memset (&desc,0 ,sizeof (struct mxs_dma_desc )); + desc.address = (dma_addr_t)&desc; + desc.cmd.data =MXS_DMA_DESC_COMMAND_NO_DMAXFER |MXS_DMA_DESC_CHAIN | +MXS_DMA_DESC_WAIT4END | + (1 <<MXS_DMA_DESC_PIO_WORDS_OFFSET ); + desc.cmd.pio_words[0 ] =readl (®s->hw_lcdif_ctrl) |LCDIF_CTRL_RUN ; + desc.cmd.next = (uint32_t )&desc.cmd; + +/* Execute the DMA chain. */ +mxs_dma_circ_start (MXS_DMA_CHANNEL_AHB_APBH_LCDIF , &desc); +#endif +return (void *)&panel; }
Signature · 1 line
1.7.10.4
PATCH 4/11 video: Implement continuous screen refresh for SmartLCD into mxsfb
Quoted 5 lines · On Tue, 30 Jul 2013 23:37:54 +0200 Marek Vasut <[email protected]> wrote:
The LCDIF interface doesn't give us any means to do continuous refresh when driving a SmartLCD. To work this around, we produce a special circular DMA descriptor, which only writes the
HW_LCDIF_CTRL0register and sets the RUN bit.
Quoted 8 lines
Signed-off-by Marek Vasut <[email protected]>Cc Anatolij Gustschin <[email protected]>Cc Fabio Estevam <[email protected]>Cc Otavio Salvador <[email protected]>Cc Stefano Babic <[email protected]>--- drivers/video/mxsfb.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
Applied to u-boot-video/master. Thanks!
Anatolij
PATCH 5/11 ARM: mxs: Add Creative ZEN XFi3 board
In reply to Marek VasutAdd STMP3780-based XFi3 board. This board is a small PMP device sporting a CPU which was later rebranded to i.MX233 . Currently supported is USB gadget mode and both external SD and internal Phison SD-NAND bridge .
--- MAINTAINERS | 1 + board/creative/xfi3/Makefile | 47 +++++++++ board/creative/xfi3/spl_boot.c | 150 +++++++++++++++++++++++++++ board/creative/xfi3/xfi3.c | 221 ++++++++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/xfi3.h | 82 +++++++++++++++ 6 files changed, 502 insertions(+) create mode 100644 board/creative/xfi3/Makefile create mode 100644 board/creative/xfi3/spl_boot.c create mode 100644 board/creative/xfi3/xfi3.c create mode 100644 include/configs/xfi3.h
MAINTAINERS +1 -0
@@ -968,6 +968,7 @@ Marek Vasut <[email protected]> vpac270 xscale/pxa zipitz2 xscale/pxa mx23_olinuxino i.MX23 + xfi3 i.MX23 m28evk i.MX28 sc_sps_1 i.MX28 m53evk i.MX53
board/creative/xfi3/Makefile new file +47 -0
47 lines not on this page · raw message
board/creative/xfi3/spl_boot.c new file +150 -0
150 lines not on this page · raw message
board/creative/xfi3/xfi3.c new file +221 -0
221 lines not on this page · raw message
boards.cfg +1 -0
@@ -198,6 +198,7 @@ zmx25 arm arm926ejs zmx25 syteco imx27lite arm arm926ejs imx27lite logicpd mx27 magnesium arm arm926ejs imx27lite logicpd mx27 mx23_olinuxino arm arm926ejs mx23_olinuxino olimex mxs mx23_olinuxino +xfi3 arm arm926ejs xfi3 creative mxs xfi3 apx4devkit arm arm926ejs apx4devkit bluegiga mxs apx4devkit mx23evk arm arm926ejs mx23evk freescale mxs mx23evk m28evk arm arm926ejs m28evk denx mxs m28evk
include/configs/xfi3.h new file +82 -0
82 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 5/11 ARM: mxs: Add Creative ZEN XFi3 board
Quoted 438 lines · Marek Vasut
Add STMP3780-based XFi3 board. This board is a small PMP device sporting a CPU which was later rebranded to i.MX233 . Currently supported is USB gadget mode and both external SD and internal Phison SD-NAND bridge .
Signed-off-by Marek Vasut <[email protected]>Cc Fabio Estevam <[email protected]>Cc Otavio Salvador <[email protected]>Cc Stefano Babic <[email protected]>--- MAINTAINERS | 1 + board/creative/xfi3/Makefile | 47 +++++++++ board/creative/xfi3/spl_boot.c | 150 +++++++++++++++++++++++++++ board/creative/xfi3/xfi3.c | 221 ++++++++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/xfi3.h | 82 +++++++++++++++ 6 files changed, 502 insertions(+) create mode 100644 board/creative/xfi3/Makefile create mode 100644 board/creative/xfi3/spl_boot.c create mode 100644 board/creative/xfi3/xfi3.c create mode 100644 include/configs/xfi3.hMAINTAINERS +1
-0@@ -968,6 +968,7 @@ Marek Vasut <[email protected]> vpac270 xscale/pxa zipitz2 xscale/pxa mx23_olinuxino i.MX23 + xfi3 i.MX23 m28evk i.MX28 sc_sps_1 i.MX28 m53evk i.MX53board/creative/xfi3/Makefile new file +47
-0@@ -0,0 +1,47 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd at denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +ifndef CONFIG_SPL_BUILD +COBJS := xfi3.o +else +COBJS := spl_boot.o +endif + +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +$(LIB): $(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################board/creative/xfi3/spl_boot.c new file +150
-0@@ -0,0 +1,150 @@ +/* +* Creative ZEN X-Fi3 setup +* +* Copyright (C) 2013 Marek Vasut <[email protected]> +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#include <common.h> +#include <config.h> +#include <asm/io.h> +#include <asm/arch/iomux-mx23.h> +#include <asm/arch/imx-regs.h> +#include <asm/arch/sys_proto.h> + +#define MUX_CONFIG_EMI (MXS_PAD_1V8 | MXS_PAD_12MA | MXS_PAD_PULLUP) +#define MUX_CONFIG_SSP (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP) +#define MUX_CONFIG_LCD (MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL) + +const iomux_cfg_t iomux_setup[] = { +/* EMI */ +MX23_PAD_EMI_D00__EMI_D00 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D01__EMI_D01 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D02__EMI_D02 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D03__EMI_D03 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D04__EMI_D04 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D05__EMI_D05 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D06__EMI_D06 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D07__EMI_D07 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D08__EMI_D08 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D09__EMI_D09 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D10__EMI_D10 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D11__EMI_D11 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D12__EMI_D12 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D13__EMI_D13 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D14__EMI_D14 |MUX_CONFIG_EMI , +MX23_PAD_EMI_D15__EMI_D15 |MUX_CONFIG_EMI , +MX23_PAD_EMI_DQM0__EMI_DQM0 |MUX_CONFIG_EMI , +MX23_PAD_EMI_DQM1__EMI_DQM1 |MUX_CONFIG_EMI , +MX23_PAD_EMI_DQS0__EMI_DQS0 |MUX_CONFIG_EMI , +MX23_PAD_EMI_DQS1__EMI_DQS1 |MUX_CONFIG_EMI , +MX23_PAD_EMI_CLK__EMI_CLK |MUX_CONFIG_EMI , +MX23_PAD_EMI_CLKN__EMI_CLKN |MUX_CONFIG_EMI , + +MX23_PAD_EMI_A00__EMI_A00 |MUX_CONFIG_EMI , +MX23_PAD_EMI_A01__EMI_A01 |MUX_CONFIG_EMI , +MX23_PAD_EMI_A02__EMI_A02 |MUX_CONFIG_EMI , +MX23_PAD_EMI_A03__EMI_A03 |MUX_CONFIG_EMI , +MX23_PAD_EMI_A04__EMI_A04 |MUX_CONFIG_EMI , +MX23_PAD_EMI_A05__EMI_A05 |MUX_CONFIG_EMI , +MX23_PAD_EMI_A06__EMI_A06 |MUX_CONFIG_EMI , +MX23_PAD_EMI_A07__EMI_A07 |MUX_CONFIG_EMI , +MX23_PAD_EMI_A08__EMI_A08 |MUX_CONFIG_EMI , +MX23_PAD_EMI_A09__EMI_A09 |MUX_CONFIG_EMI , +MX23_PAD_EMI_A10__EMI_A10 |MUX_CONFIG_EMI , +MX23_PAD_EMI_A11__EMI_A11 |MUX_CONFIG_EMI , +MX23_PAD_EMI_A12__EMI_A12 |MUX_CONFIG_EMI , +MX23_PAD_EMI_BA0__EMI_BA0 |MUX_CONFIG_EMI , +MX23_PAD_EMI_BA1__EMI_BA1 |MUX_CONFIG_EMI , + +MX23_PAD_EMI_CASN__EMI_CASN |MUX_CONFIG_EMI , +MX23_PAD_EMI_CE0N__EMI_CE0N |MUX_CONFIG_EMI , +MX23_PAD_EMI_CE1N__EMI_CE1N |MUX_CONFIG_EMI , +MX23_PAD_EMI_CKE__EMI_CKE |MUX_CONFIG_EMI , +MX23_PAD_EMI_RASN__EMI_RASN |MUX_CONFIG_EMI , +MX23_PAD_EMI_WEN__EMI_WEN |MUX_CONFIG_EMI , + +MX23_PAD_LCD_D00__LCD_D00 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D01__LCD_D01 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D02__LCD_D02 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D03__LCD_D03 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D04__LCD_D04 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D05__LCD_D05 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D06__LCD_D06 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D07__LCD_D07 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D08__LCD_D08 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D09__LCD_D09 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D10__LCD_D10 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D11__LCD_D11 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D12__LCD_D12 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D13__LCD_D13 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D14__LCD_D14 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D15__LCD_D15 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D16__LCD_D16 |MUX_CONFIG_LCD , +MX23_PAD_LCD_D17__LCD_D17 |MUX_CONFIG_LCD , +MX23_PAD_LCD_RESET__LCD_RESET |MUX_CONFIG_LCD , +MX23_PAD_LCD_RS__LCD_RS |MUX_CONFIG_LCD , +MX23_PAD_LCD_WR__LCD_WR |MUX_CONFIG_LCD , +MX23_PAD_LCD_CS__LCD_CS |MUX_CONFIG_LCD , +MX23_PAD_LCD_ENABLE__LCD_ENABLE |MUX_CONFIG_LCD , +MX23_PAD_LCD_VSYNC__LCD_VSYNC |MUX_CONFIG_LCD , + +MX23_PAD_SSP1_CMD__SSP1_CMD |MUX_CONFIG_SSP , +MX23_PAD_SSP1_DETECT__GPIO_2_1 |MUX_CONFIG_SSP , +MX23_PAD_SSP1_DATA0__SSP1_DATA0 |MUX_CONFIG_SSP , +MX23_PAD_SSP1_DATA1__SSP1_DATA1 |MUX_CONFIG_SSP , +MX23_PAD_SSP1_DATA2__SSP1_DATA2 |MUX_CONFIG_SSP , +MX23_PAD_SSP1_DATA3__SSP1_DATA3 |MUX_CONFIG_SSP , +MX23_PAD_SSP1_SCK__SSP1_SCK |MUX_CONFIG_SSP , +MX23_PAD_GPMI_D07__GPIO_0_7 |MUX_CONFIG_SSP , + +MX23_PAD_GPMI_D00__SSP2_DATA0 |MUX_CONFIG_SSP , +MX23_PAD_GPMI_D01__SSP2_DATA1 |MUX_CONFIG_SSP , +MX23_PAD_GPMI_D02__SSP2_DATA2 |MUX_CONFIG_SSP , +MX23_PAD_GPMI_D03__SSP2_DATA3 |MUX_CONFIG_SSP , +MX23_PAD_GPMI_RDY1__SSP2_CMD |MUX_CONFIG_SSP , +MX23_PAD_GPMI_WRN__SSP2_SCK |MUX_CONFIG_SSP , + +/* PWM -- FIXME */ +MX23_PAD_PWM2__GPIO_1_28 |MXS_PAD_3V3 |MXS_PAD_12MA |MXS_PAD_PULLUP , +}; + +void mxs_adjust_memory_params (uint32_t *dram_vals) +{ +/* mDDR configuration values */ +const uint32_t regs[] = { +0x01010001 ,0x00010000 ,0x01000000 ,0x00000001 , +0x00010101 ,0x00000001 ,0x00010000 ,0x01000001 , +0x01010000 ,0x00000001 ,0x07000200 ,0x04070203 , +0x02020002 ,0x06070a02 ,0x0d000201 ,0x0305000d , +0x02080800 ,0x19330f0a ,0x1f1f1c00 ,0x020a1313 , +0x03061323 ,0x0000000a ,0x00080008 ,0x00200020 , +0x00200020 ,0x00200020 ,0x000003f7 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000020 ,0x00000000 , +0x001023cd ,0x20410010 ,0x00006665 ,0x00000000 , +0x00000101 ,0x00000001 ,0x00000000 ,0x00000000 , + }; +memcpy (dram_vals, regs,sizeof (regs)); +} + +void board_init_ll (void ) +{ +mxs_common_spl_init (iomux_setup,ARRAY_SIZE (iomux_setup)); +}board/creative/xfi3/xfi3.c new file +189
-0@@ -0,0 +1,221 @@ +/* +* Creative ZEN X-Fi3 board +* +* Copyright (C) 2013 Marek Vasut <[email protected]> +* +* Hardware investigation done by: +* +* Amaury Pouly <[email protected]> +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#include <common.h> +#include <errno.h> +#include <asm/gpio.h> +#include <asm/io.h> +#include <asm/arch/iomux-mx23.h> +#include <asm/arch/imx-regs.h> +#include <asm/arch/clock.h> +#include <asm/arch/sys_proto.h> + +DECLARE_GLOBAL_DATA_PTR ; + +/* +* Functions +*/ +int board_early_init_f (void ) +{ +/* IO0 clock at 480MHz */ +mxs_set_ioclk (MXC_IOCLK0 ,480000 ); + +/* SSP0 clock at 96MHz */ +mxs_set_sspclk (MXC_SSPCLK0 ,96000 ,0 ); + +return 0 ; +} + +int dram_init (void ) +{ +return mxs_dram_init (); +} + +#ifdef CONFIG_CMD_MMC +static int xfi3_mmc_cd (int id) +{ +switch (id) { +case 0 : +/* The SSP_DETECT is inverted on this board. */ +return gpio_get_value (MX23_PAD_SSP1_DETECT__GPIO_2_1 ); +case 1 : +/* Phison bridge always present */ +return 1 ; +default : +return 0 ; + } +} + +int board_mmc_init (bd_t *bis) +{ +int ret; + +/* MicroSD slot */ +gpio_direction_input (MX23_PAD_SSP1_DETECT__GPIO_2_1 ); +gpio_direction_output (MX23_PAD_GPMI_D07__GPIO_0_7 ,0 ); + ret =mxsmmc_initialize (bis,0 ,NULL , xfi3_mmc_cd); +if (ret) +return ret; + +/* Phison SD-NAND bridge */ + ret =mxsmmc_initialize (bis,1 ,NULL , xfi3_mmc_cd); + +return ret; +} +#endif + +#ifdef CONFIG_VIDEO_MXS +static int mxsfb_write_byte (uint32_t payload,const unsigned int data) +{ +struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE ; +const unsigned int timeout =0x10000 ; + +if (mxs_wait_mask_clr (®s->hw_lcdif_ctrl_reg,LCDIF_CTRL_RUN , + timeout)) +return -ETIMEDOUT ; + +writel ((1 <<LCDIF_TRANSFER_COUNT_V_COUNT_OFFSET ) | + (1 <<LCDIF_TRANSFER_COUNT_H_COUNT_OFFSET ), + ®s->hw_lcdif_transfer_count); + +writel (LCDIF_CTRL_DATA_SELECT |LCDIF_CTRL_RUN , + ®s->hw_lcdif_ctrl_clr); + +if (data) +writel (LCDIF_CTRL_DATA_SELECT , ®s->hw_lcdif_ctrl_set); + +writel (LCDIF_CTRL_RUN , ®s->hw_lcdif_ctrl_set); + +if (mxs_wait_mask_clr (®s->hw_lcdif_lcdif_stat_reg,1 <<29 , + timeout)) +return -ETIMEDOUT ; + +writel (payload, ®s->hw_lcdif_data); +return mxs_wait_mask_clr (®s->hw_lcdif_ctrl_reg,LCDIF_CTRL_RUN , + timeout); +} + +static void mxsfb_write_register (uint32_t reg,uint32_t data) +{ +mxsfb_write_byte (reg,0 ); +mxsfb_write_byte (data,1 ); +} + +void mxsfb_system_setup (void ) +{ +struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE ; + +/* Switch the LCDIF into System-Mode */ +writel (LCDIF_CTRL_LCDIF_MASTER |LCDIF_CTRL_DOTCLK_MODE | +LCDIF_CTRL_BYPASS_COUNT , ®s->hw_lcdif_ctrl_clr); + +/* Restart the SmartLCD controller */ +mdelay (50 ); +writel (1 , ®s->hw_lcdif_ctrl1_set); +mdelay (50 ); +writel (1 , ®s->hw_lcdif_ctrl1_clr); +mdelay (50 ); +writel (1 , ®s->hw_lcdif_ctrl1_set); +mdelay (50 ); + +/* Program the SmartLCD controller */ +writel (LCDIF_CTRL1_RECOVER_ON_UNDERFLOW , ®s->hw_lcdif_ctrl1_set); + +writel (0x03030202 , ®s->hw_lcdif_timing); + +mxsfb_write_register (1 ,0x01c ); + +mxsfb_write_register (2 ,0x100 ); +/* 0x30 flips the LCD */ +mxsfb_write_register (3 ,0x1038 ); +mxsfb_write_register (8 ,0x808 ); +/* This can possibly contain 0x111 */ +mxsfb_write_register (0xc ,0x0 ); +mxsfb_write_register (0xf ,0xc01 ); +mxsfb_write_register (0x20 ,0 ); +mxsfb_write_register (0x21 ,0 ); +mdelay (30 ); +mxsfb_write_register (0x10 ,0xa00 ); +mxsfb_write_register (0x11 ,0x1038 ); +mdelay (30 ); +mxsfb_write_register (0x12 ,0x1010 ); +mxsfb_write_register (0x13 ,0x50 ); +mxsfb_write_register (0x14 ,0x4f58 ); +mxsfb_write_register (0x30 ,0 ); +mxsfb_write_register (0x31 ,0xdb ); +mxsfb_write_register (0x32 ,0 ); +mxsfb_write_register (0x33 ,0 ); +mxsfb_write_register (0x34 ,0xdb ); +mxsfb_write_register (0x35 ,0 ); +mxsfb_write_register (0x36 ,0xaf ); +mxsfb_write_register (0x37 ,0 ); +mxsfb_write_register (0x38 ,0xdb ); +mxsfb_write_register (0x39 ,0 ); +mxsfb_write_register (0x50 ,0 ); +mxsfb_write_register (0x51 ,0x705 ); +mxsfb_write_register (0x52 ,0xe0a ); +mxsfb_write_register (0x53 ,0x300 ); +mxsfb_write_register (0x54 ,0xa0e ); +mxsfb_write_register (0x55 ,0x507 ); +mxsfb_write_register (0x56 ,0 ); +mxsfb_write_register (0x57 ,3 ); +mxsfb_write_register (0x58 ,0x90a ); +mxsfb_write_register (0x59 ,0xa09 ); +mdelay (30 );
board/creative/xfi3/xfi3.c line 199
Quoted 10 lines
board/creative/xfi3/xfi3.c new file +10
-0+mxsfb_write_register (7 ,0x1017 ); +mdelay (40 ); +mxsfb_write_register (0x36 ,0xaf ); +mxsfb_write_register (0x37 ,0 ); +mxsfb_write_register (0x38 ,0xdb ); +mxsfb_write_register (0x39 ,0 ); +mxsfb_write_register (0x20 ,0 ); +mxsfb_write_register (0x21 ,0 ); +/* Turn on Framebuffer Upload Mode */ +mxsfb_write_byte (0x22 ,0 );
Where does those values come from?
Quoted 122 lines
board/creative/xfi3/xfi3.c new file +21
-0+writel (LCDIF_CTRL_LCDIF_MASTER |LCDIF_CTRL_DATA_SELECT , + ®s->hw_lcdif_ctrl_set); +} +#endif + +int board_init (void ) +{ +/* Adress of boot parameters */ + gd->bd->bi_boot_params =PHYS_SDRAM_1 +0x100 ; + +/* Turn on PWM backlight */ +gpio_direction_output (MX23_PAD_PWM2__GPIO_1_28 ,1 ); + +return 0 ; +} + +int board_eth_init (bd_t *bis) +{ +usb_eth_initialize (bis); +return 0 ; +}boards.cfg +1
-0@@ -198,6 +198,7 @@ zmx25 arm arm926ejs zmx25 syteco imx27lite arm arm926ejs imx27lite logicpd mx27 magnesium arm arm926ejs imx27lite logicpd mx27 mx23_olinuxino arm arm926ejs mx23_olinuxino olimex mxs mx23_olinuxino +xfi3 arm arm926ejs xfi3 creative mxs xfi3 apx4devkit arm arm926ejs apx4devkit bluegiga mxs apx4devkit mx23evk arm arm926ejs mx23evk freescale mxs mx23evk m28evk arm arm926ejs m28evk denx mxs m28evkinclude/configs/xfi3.h new file +82
-1@@ -0,0 +1,82 @@ +/* +* Copyright (C) 2013 Marek Vasut <[email protected]> +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ +#ifndef __CONFIGS_XFI3_H__ +#define __CONFIGS_XFI3_H__ + +/* System configurations */ +#define CONFIG_MX23 /* i.MX23 SoC */ +#define CONFIG_MACH_TYPE 0xffffffff + +/* U-Boot Commands */ +#define CONFIG_SYS_NO_FLASH +#include <config_cmd_default.h> +#define CONFIG_DISPLAY_CPUINFO +#define CONFIG_DOS_PARTITION + +#define CONFIG_CMD_CACHE +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_FAT +#define CONFIG_CMD_GPIO +#define CONFIG_CMD_MMC +#define CONFIG_CMD_PING +#define CONFIG_CMD_USB +#define CONFIG_VIDEO + +/* Memory configuration */ +#define CONFIG_NR_DRAM_BANKS 1/* 1 bank of DRAM */ +#define PHYS_SDRAM_1 0x40000000/* Base address */ +#define PHYS_SDRAM_1_SIZE 0x08000000/* Max 128 MB RAM */ +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 + +/* Environment */ +#define CONFIG_ENV_SIZE (16 * 1024) +#define CONFIG_ENV_IS_NOWHERE +#define CONFIG_ENV_OVERWRITE + +/* Booting Linux */ +#define CONFIG_BOOTDELAY 3 +#define CONFIG_BOOTFILE "uImage" +#define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 " +#define CONFIG_LOADADDR 0x42000000 +#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR + +/* LCD */ +#ifdef CONFIG_VIDEO +#define CONFIG_VIDEO_MXS_MODE_SYSTEM +#define CONFIG_SYS_BLACK_IN_WRITE +#define LCD_BPP LCD_COLOR16 +#endif + +/* USB */ +#ifdef CONFIG_CMD_USB +#define CONFIG_EHCI_MXS_PORT0 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 1 + +#define CONFIG_MV_UDC /* ChipIdea CI13xxx UDC */ +#define CONFIG_USB_GADGET_DUALSPEED + +#define CONFIG_USB_ETHER +#define CONFIG_USB_ETH_CDC +#define CONFIG_NETCONSOLE +#endif + +/* The rest of the configuration is shared */ +#include <configs/mxs.h> + +#endif /* __CONFIGS_XFI3_H__ */ --
Quoted 2 lines
1.7.10.4
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
PATCH 5/11 ARM: mxs: Add Creative ZEN XFi3 board
Dear Otavio Salvador,
[...]
Quoted 10 lines
board/creative/xfi3/xfi3.c line 199
Quoted 8 lines
board/creative/xfi3/xfi3.c new file +8
-0+mxsfb_write_register (0x36 ,0xaf ); +mxsfb_write_register (0x37 ,0 ); +mxsfb_write_register (0x38 ,0xdb ); +mxsfb_write_register (0x39 ,0 ); +mxsfb_write_register (0x20 ,0 ); +mxsfb_write_register (0x21 ,0 ); +/* Turn on Framebuffer Upload Mode */ +mxsfb_write_byte (0x22 ,0 );Where does those values come from?
The panel datasheet and from Amaury.
[...]
It'd be nice if you learnt to cut down the email to the relevant part only when replying.
Best regards,
Marek Vasut
PATCH 5/11 ARM: mxs: Add Creative ZEN XFi3 board
Quoted 13 lines · Marek Vasut
Dear Otavio Salvador,
[...]
Quoted 9 lines
Quoted 8 lines
board/creative/xfi3/xfi3.c new file +8
-0+mxsfb_write_register (0x36 ,0xaf ); +mxsfb_write_register (0x37 ,0 ); +mxsfb_write_register (0x38 ,0xdb ); +mxsfb_write_register (0x39 ,0 ); +mxsfb_write_register (0x20 ,0 ); +mxsfb_write_register (0x21 ,0 ); +/* Turn on Framebuffer Upload Mode */ +mxsfb_write_byte (0x22 ,0 );
Quoted 8 lines
Quoted 1 line
Where does those values come from?
The panel datasheet and from Amaury.
[...]
It'd be nice if you learnt to cut down the email to the relevant part only when replying.
Couldn't this use macros to make it easier to read or at least a comment informing where to find those?
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
PATCH 5/11 ARM: mxs: Add Creative ZEN XFi3 board
Dear Otavio Salvador,
Quoted 16 lines · Marek Vasut
Quoted 15 lines
Dear Otavio Salvador,
[...]
Quoted 10 lines
board/creative/xfi3/xfi3.c line 199
Quoted 8 lines
board/creative/xfi3/xfi3.c new file +8
-0+mxsfb_write_register (0x36 ,0xaf ); +mxsfb_write_register (0x37 ,0 ); +mxsfb_write_register (0x38 ,0xdb ); +mxsfb_write_register (0x39 ,0 ); +mxsfb_write_register (0x20 ,0 ); +mxsfb_write_register (0x21 ,0 ); +/* Turn on Framebuffer Upload Mode */ +mxsfb_write_byte (0x22 ,0 );Where does those values come from?
Quoted 8 lines
Quoted 6 lines
The panel datasheet and from Amaury.
[...]
It'd be nice if you learnt to cut down the email to the relevant part only when replying.
Couldn't this use macros to make it easier to read
What kind of macros ? Using function call allows the compiler to do type- checking on the data, so no, using macro would be sub-par.
Quoted 2 lines
or at least a
comment informing where to find those?
See OTM2201A datasheet for the finer details, yet it will be useless for you since this is rather device-specific configuration.
Best regards,
Marek Vasut
PATCH 5/11 ARM: mxs: Add Creative ZEN XFi3 board
Quoted 27 lines · Marek Vasut
Dear Otavio Salvador,
Quoted 16 lines · Marek Vasut
Quoted 15 lines
Dear Otavio Salvador,
[...]
Quoted 10 lines
board/creative/xfi3/xfi3.c line 199
Quoted 8 lines
board/creative/xfi3/xfi3.c new file +8
-0+mxsfb_write_register (0x36 ,0xaf ); +mxsfb_write_register (0x37 ,0 ); +mxsfb_write_register (0x38 ,0xdb ); +mxsfb_write_register (0x39 ,0 ); +mxsfb_write_register (0x20 ,0 ); +mxsfb_write_register (0x21 ,0 ); +/* Turn on Framebuffer Upload Mode */ +mxsfb_write_byte (0x22 ,0 );Where does those values come from?
Quoted 8 lines
Quoted 6 lines
The panel datasheet and from Amaury.
[...]
It'd be nice if you learnt to cut down the email to the relevant part only when replying.
Couldn't this use macros to make it easier to read
Quoted 8 lines
What kind of macros ? Using function call allows the compiler to do type- checking on the data, so no, using macro would be sub-par.
Quoted 2 lines
or at least a
comment informing where to find those?See OTM2201A datasheet for the finer details, yet it will be useless for you since this is rather device-specific configuration.
A comment giving the datasheet name where those were took would be good.
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
PATCH 5/11 ARM: mxs: Add Creative ZEN XFi3 board
In reply to Marek VasutHello Marek,
Am 30.07.2013 23:37, schrieb Marek Vasut:
Quoted 22 lines
Add STMP3780-based XFi3 board. This board is a small PMP device sporting a CPU which was later rebranded to i.MX233 . Currently supported is USB gadget mode and both external SD and internal Phison SD-NAND bridge .
Signed-off-by Marek Vasut<[email protected]>Cc Fabio Estevam<[email protected]>Cc Otavio Salvador<[email protected]>Cc Stefano Babic<[email protected]>--- MAINTAINERS | 1 + board/creative/xfi3/Makefile | 47 +++++++++ board/creative/xfi3/spl_boot.c | 150 +++++++++++++++++++++++++++ board/creative/xfi3/xfi3.c | 221 ++++++++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/xfi3.h | 82 +++++++++++++++ 6 files changed, 502 insertions(+)create mode 100644 board/creative/xfi3/Makefile create mode 100644
board/creative/xfi3/spl_boot.ccreate mode 100644board/creative/xfi3/xfi3.ccreate mode 100644include/configs/xfi3.h
[...]
Quoted 17 lines
board/creative/xfi3/Makefile new file +11
-0@@ -0,0 +1,47 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd at denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version.
board/creative/xfi3/Makefile line 21
Quoted 10 lines
board/creative/xfi3/Makefile new file +10
-0+# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA
Please use for new files SPDX-License-Identifier, thanks. Please fix globally
[...]
bye,
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 5/11 ARM: mxs: Add Creative ZEN XFi3 board
Dear Heiko Schocher,
Quoted 51 lines
Hello Marek,
Am 30.07.2013 23:37, schrieb Marek Vasut:
Quoted 23 lines
Add STMP3780-based XFi3 board. This board is a small PMP device sporting a CPU which was later rebranded to i.MX233 . Currently supported is USB gadget mode and both external SD and internal Phison SD-NAND bridge .
Signed-off-by Marek Vasut<[email protected]>Cc Fabio Estevam<[email protected]>Cc Otavio Salvador<[email protected]>Cc Stefano Babic<[email protected]>---
MAINTAINERS | 1 + board/creative/xfi3/Makefile | 47 +++++++++ board/creative/xfi3/spl_boot.c | 150 +++++++++++++++++++++++++++ board/creative/xfi3/xfi3.c | 221 ++++++++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/xfi3.h | 82 +++++++++++++++ 6 files changed, 502 insertions(+)create mode 100644 board/creative/xfi3/Makefile create mode 100644
board/creative/xfi3/spl_boot.ccreate mode 100644board/creative/xfi3/xfi3.ccreate mode 100644include/configs/xfi3.h[...]
Quoted 22 lines
board/creative/xfi3/Makefile new file +16
-0@@ -0,0 +1,47 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd at denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details.
Quoted 8 lines
board/creative/xfi3/Makefile line 21
Quoted 5 lines
board/creative/xfi3/Makefile new file +5
-0+# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USAPlease use for new files SPDX-License-Identifier, thanks. Please fix globally
Fixed for both, thanks!
Best regards,
Marek Vasut
PATCH 5/11 ARM: mxs: Add Creative ZEN XFi3 board
In reply to Marek VasutHi Marek,
Quoted 52 lines · Marek Vasut
Add STMP3780-based XFi3 board. This board is a small PMP device sporting a CPU which was later rebranded to i.MX233 . Currently supported is USB gadget mode and both external SD and internal Phison SD-NAND bridge .
Signed-off-by Marek Vasut <[email protected]>Cc Fabio Estevam <[email protected]>Cc Otavio Salvador <[email protected]>Cc Stefano Babic <[email protected]>--- MAINTAINERS | 1 + board/creative/xfi3/Makefile | 47 +++++++++ board/creative/xfi3/spl_boot.c | 150 +++++++++++++++++++++++++++ board/creative/xfi3/xfi3.c | 221 ++++++++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/xfi3.h | 82 +++++++++++++++ 6 files changed, 502 insertions(+) create mode 100644 board/creative/xfi3/Makefile create mode 100644 board/creative/xfi3/spl_boot.c create mode 100644 board/creative/xfi3/xfi3.c create mode 100644 include/configs/xfi3.hMAINTAINERS +1
-0@@ -968,6 +968,7 @@ Marek Vasut <[email protected]> vpac270 xscale/pxa zipitz2 xscale/pxa mx23_olinuxino i.MX23 + xfi3 i.MX23 m28evk i.MX28 sc_sps_1 i.MX28 m53evk i.MX53board/creative/xfi3/Makefile new file +12
-0@@ -0,0 +1,47 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd at denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +#
board/creative/xfi3/Makefile line 22
Quoted 10 lines
board/creative/xfi3/Makefile new file +10
-0+# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +#
Please use new licence style with SPDX identifier. Fix it globally.
Quoted 286 lines
board/creative/xfi3/Makefile new file +151
-0+++ b/board/creative/xfi3/spl_boot.c@@ -0,0 +1,150 @@ +/* + * Creative ZEN X-Fi3 setup + * + * Copyright (C) 2013 Marek Vasut <[email protected]> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> +#include <config.h> +#include <asm/io.h> +#include <asm/arch/iomux-mx23.h> +#include <asm/arch/imx-regs.h> +#include <asm/arch/sys_proto.h> + +#define MUX_CONFIG_EMI (MXS_PAD_1V8 | MXS_PAD_12MA | MXS_PAD_PULLUP) +#define MUX_CONFIG_SSP (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP) +#define MUX_CONFIG_LCD (MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL) + +const iomux_cfg_t iomux_setup[] = { + /* EMI */ + MX23_PAD_EMI_D00__EMI_D00 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D01__EMI_D01 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D02__EMI_D02 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D03__EMI_D03 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D04__EMI_D04 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D05__EMI_D05 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D06__EMI_D06 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D07__EMI_D07 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D08__EMI_D08 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D09__EMI_D09 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D10__EMI_D10 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D11__EMI_D11 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D12__EMI_D12 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D13__EMI_D13 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D14__EMI_D14 | MUX_CONFIG_EMI, + MX23_PAD_EMI_D15__EMI_D15 | MUX_CONFIG_EMI, + MX23_PAD_EMI_DQM0__EMI_DQM0 | MUX_CONFIG_EMI, + MX23_PAD_EMI_DQM1__EMI_DQM1 | MUX_CONFIG_EMI, + MX23_PAD_EMI_DQS0__EMI_DQS0 | MUX_CONFIG_EMI, + MX23_PAD_EMI_DQS1__EMI_DQS1 | MUX_CONFIG_EMI, + MX23_PAD_EMI_CLK__EMI_CLK | MUX_CONFIG_EMI, + MX23_PAD_EMI_CLKN__EMI_CLKN | MUX_CONFIG_EMI, + + MX23_PAD_EMI_A00__EMI_A00 | MUX_CONFIG_EMI, + MX23_PAD_EMI_A01__EMI_A01 | MUX_CONFIG_EMI, + MX23_PAD_EMI_A02__EMI_A02 | MUX_CONFIG_EMI, + MX23_PAD_EMI_A03__EMI_A03 | MUX_CONFIG_EMI, + MX23_PAD_EMI_A04__EMI_A04 | MUX_CONFIG_EMI, + MX23_PAD_EMI_A05__EMI_A05 | MUX_CONFIG_EMI, + MX23_PAD_EMI_A06__EMI_A06 | MUX_CONFIG_EMI, + MX23_PAD_EMI_A07__EMI_A07 | MUX_CONFIG_EMI, + MX23_PAD_EMI_A08__EMI_A08 | MUX_CONFIG_EMI, + MX23_PAD_EMI_A09__EMI_A09 | MUX_CONFIG_EMI, + MX23_PAD_EMI_A10__EMI_A10 | MUX_CONFIG_EMI, + MX23_PAD_EMI_A11__EMI_A11 | MUX_CONFIG_EMI, + MX23_PAD_EMI_A12__EMI_A12 | MUX_CONFIG_EMI, + MX23_PAD_EMI_BA0__EMI_BA0 | MUX_CONFIG_EMI, + MX23_PAD_EMI_BA1__EMI_BA1 | MUX_CONFIG_EMI, + + MX23_PAD_EMI_CASN__EMI_CASN | MUX_CONFIG_EMI, + MX23_PAD_EMI_CE0N__EMI_CE0N | MUX_CONFIG_EMI, + MX23_PAD_EMI_CE1N__EMI_CE1N | MUX_CONFIG_EMI, + MX23_PAD_EMI_CKE__EMI_CKE | MUX_CONFIG_EMI, + MX23_PAD_EMI_RASN__EMI_RASN | MUX_CONFIG_EMI, + MX23_PAD_EMI_WEN__EMI_WEN | MUX_CONFIG_EMI, + + MX23_PAD_LCD_D00__LCD_D00 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D01__LCD_D01 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D02__LCD_D02 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D03__LCD_D03 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D04__LCD_D04 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D05__LCD_D05 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D06__LCD_D06 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D07__LCD_D07 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D08__LCD_D08 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D09__LCD_D09 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D10__LCD_D10 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D11__LCD_D11 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D12__LCD_D12 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D13__LCD_D13 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D14__LCD_D14 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D15__LCD_D15 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D16__LCD_D16 | MUX_CONFIG_LCD, + MX23_PAD_LCD_D17__LCD_D17 | MUX_CONFIG_LCD, + MX23_PAD_LCD_RESET__LCD_RESET | MUX_CONFIG_LCD, + MX23_PAD_LCD_RS__LCD_RS | MUX_CONFIG_LCD, + MX23_PAD_LCD_WR__LCD_WR | MUX_CONFIG_LCD, + MX23_PAD_LCD_CS__LCD_CS | MUX_CONFIG_LCD, + MX23_PAD_LCD_ENABLE__LCD_ENABLE | MUX_CONFIG_LCD, + MX23_PAD_LCD_VSYNC__LCD_VSYNC | MUX_CONFIG_LCD, + + MX23_PAD_SSP1_CMD__SSP1_CMD | MUX_CONFIG_SSP, + MX23_PAD_SSP1_DETECT__GPIO_2_1 | MUX_CONFIG_SSP, + MX23_PAD_SSP1_DATA0__SSP1_DATA0 | MUX_CONFIG_SSP, + MX23_PAD_SSP1_DATA1__SSP1_DATA1 | MUX_CONFIG_SSP, + MX23_PAD_SSP1_DATA2__SSP1_DATA2 | MUX_CONFIG_SSP, + MX23_PAD_SSP1_DATA3__SSP1_DATA3 | MUX_CONFIG_SSP, + MX23_PAD_SSP1_SCK__SSP1_SCK | MUX_CONFIG_SSP, + MX23_PAD_GPMI_D07__GPIO_0_7 | MUX_CONFIG_SSP, + + MX23_PAD_GPMI_D00__SSP2_DATA0 | MUX_CONFIG_SSP, + MX23_PAD_GPMI_D01__SSP2_DATA1 | MUX_CONFIG_SSP, + MX23_PAD_GPMI_D02__SSP2_DATA2 | MUX_CONFIG_SSP, + MX23_PAD_GPMI_D03__SSP2_DATA3 | MUX_CONFIG_SSP, + MX23_PAD_GPMI_RDY1__SSP2_CMD | MUX_CONFIG_SSP, + MX23_PAD_GPMI_WRN__SSP2_SCK | MUX_CONFIG_SSP, + + /* PWM -- FIXME */ + MX23_PAD_PWM2__GPIO_1_28 | MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_PULLUP, +}; + +void mxs_adjust_memory_params(uint32_t *dram_vals) +{ + /* mDDR configuration values */ + const uint32_t regs[] = { + 0x01010001, 0x00010000, 0x01000000, 0x00000001, + 0x00010101, 0x00000001, 0x00010000, 0x01000001, + 0x01010000, 0x00000001, 0x07000200, 0x04070203, + 0x02020002, 0x06070a02, 0x0d000201, 0x0305000d, + 0x02080800, 0x19330f0a, 0x1f1f1c00, 0x020a1313, + 0x03061323, 0x0000000a, 0x00080008, 0x00200020, + 0x00200020, 0x00200020, 0x000003f7, 0x00000000, + 0x00000000, 0x00000000, 0x00000020, 0x00000000, + 0x001023cd, 0x20410010, 0x00006665, 0x00000000, + 0x00000101, 0x00000001, 0x00000000, 0x00000000, + }; + memcpy(dram_vals, regs, sizeof(regs)); +} + +void board_init_ll(void) +{ + mxs_common_spl_init(iomux_setup, ARRAY_SIZE(iomux_setup)); +}board/creative/xfi3/xfi3.c new file +128
-0@@ -0,0 +1,221 @@ +/* +* Creative ZEN X-Fi3 board +* +* Copyright (C) 2013 Marek Vasut <[email protected]> +* +* Hardware investigation done by: +* +* Amaury Pouly <[email protected]> +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#include <common.h> +#include <errno.h> +#include <asm/gpio.h> +#include <asm/io.h> +#include <asm/arch/iomux-mx23.h> +#include <asm/arch/imx-regs.h> +#include <asm/arch/clock.h> +#include <asm/arch/sys_proto.h> + +DECLARE_GLOBAL_DATA_PTR ; + +/* +* Functions +*/ +int board_early_init_f (void ) +{ +/* IO0 clock at 480MHz */ +mxs_set_ioclk (MXC_IOCLK0 ,480000 ); + +/* SSP0 clock at 96MHz */ +mxs_set_sspclk (MXC_SSPCLK0 ,96000 ,0 ); + +return 0 ; +} + +int dram_init (void ) +{ +return mxs_dram_init (); +} + +#ifdef CONFIG_CMD_MMC +static int xfi3_mmc_cd (int id) +{ +switch (id) { +case 0 : +/* The SSP_DETECT is inverted on this board. */ +return gpio_get_value (MX23_PAD_SSP1_DETECT__GPIO_2_1 ); +case 1 : +/* Phison bridge always present */ +return 1 ; +default : +return 0 ; + } +} + +int board_mmc_init (bd_t *bis) +{ +int ret; + +/* MicroSD slot */ +gpio_direction_input (MX23_PAD_SSP1_DETECT__GPIO_2_1 ); +gpio_direction_output (MX23_PAD_GPMI_D07__GPIO_0_7 ,0 ); + ret =mxsmmc_initialize (bis,0 ,NULL , xfi3_mmc_cd); +if (ret) +return ret; + +/* Phison SD-NAND bridge */ + ret =mxsmmc_initialize (bis,1 ,NULL , xfi3_mmc_cd); + +return ret; +} +#endif + +#ifdef CONFIG_VIDEO_MXS +static int mxsfb_write_byte (uint32_t payload,const unsigned int data) +{ +struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE ; +const unsigned int timeout =0x10000 ; + +if (mxs_wait_mask_clr (®s->hw_lcdif_ctrl_reg,LCDIF_CTRL_RUN , + timeout)) +return -ETIMEDOUT ; + +writel ((1 <<LCDIF_TRANSFER_COUNT_V_COUNT_OFFSET ) | + (1 <<LCDIF_TRANSFER_COUNT_H_COUNT_OFFSET ), + ®s->hw_lcdif_transfer_count); + +writel (LCDIF_CTRL_DATA_SELECT |LCDIF_CTRL_RUN , + ®s->hw_lcdif_ctrl_clr); + +if (data) +writel (LCDIF_CTRL_DATA_SELECT , ®s->hw_lcdif_ctrl_set); + +writel (LCDIF_CTRL_RUN , ®s->hw_lcdif_ctrl_set); + +if (mxs_wait_mask_clr (®s->hw_lcdif_lcdif_stat_reg,1 <<29 , + timeout)) +return -ETIMEDOUT ; + +writel (payload, ®s->hw_lcdif_data); +return mxs_wait_mask_clr (®s->hw_lcdif_ctrl_reg,LCDIF_CTRL_RUN , + timeout); +} + +static void mxsfb_write_register (uint32_t reg,uint32_t data) +{ +mxsfb_write_byte (reg,0 ); +mxsfb_write_byte (data,1 ); +} +
board/creative/xfi3/xfi3.c line 138
Quoted 10 lines
board/creative/xfi3/xfi3.c new file +10
-0+void mxsfb_system_setup (void ) +{ +struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE ; + +/* Switch the LCDIF into System-Mode */ +writel (LCDIF_CTRL_LCDIF_MASTER |LCDIF_CTRL_DOTCLK_MODE | +LCDIF_CTRL_BYPASS_COUNT , ®s->hw_lcdif_ctrl_clr); + +/* Restart the SmartLCD controller */ +mdelay (50 );
Nothing again, but 50mS is a lot of time and this sums up in the whole function making a big delay. Really needed ?
Quoted 13 lines
board/creative/xfi3/xfi3.c new file +13
-0+writel (1 , ®s->hw_lcdif_ctrl1_set); +mdelay (50 ); +writel (1 , ®s->hw_lcdif_ctrl1_clr); +mdelay (50 ); +writel (1 , ®s->hw_lcdif_ctrl1_set); +mdelay (50 ); + +/* Program the SmartLCD controller */ +writel (LCDIF_CTRL1_RECOVER_ON_UNDERFLOW , ®s->hw_lcdif_ctrl1_set); + +writel (0x03030202 , ®s->hw_lcdif_timing); + +mxsfb_write_register (1 ,0x01c );
board/creative/xfi3/xfi3.c line 161
Quoted 10 lines
board/creative/xfi3/xfi3.c new file +10
-0+ +mxsfb_write_register (2 ,0x100 ); +/* 0x30 flips the LCD */ +mxsfb_write_register (3 ,0x1038 ); +mxsfb_write_register (8 ,0x808 ); +/* This can possibly contain 0x111 */ +mxsfb_write_register (0xc ,0x0 ); +mxsfb_write_register (0xf ,0xc01 ); +mxsfb_write_register (0x20 ,0 ); +mxsfb_write_register (0x21 ,0 );
There is a kind of magic here. Any way to get #defines or some explanation ? I admit that the comment "This can possibly contain 0x111 *" does not help me a lot ;-)
Quoted 38 lines
board/creative/xfi3/xfi3.c new file +38
-0+mdelay (30 ); +mxsfb_write_register (0x10 ,0xa00 ); +mxsfb_write_register (0x11 ,0x1038 ); +mdelay (30 ); +mxsfb_write_register (0x12 ,0x1010 ); +mxsfb_write_register (0x13 ,0x50 ); +mxsfb_write_register (0x14 ,0x4f58 ); +mxsfb_write_register (0x30 ,0 ); +mxsfb_write_register (0x31 ,0xdb ); +mxsfb_write_register (0x32 ,0 ); +mxsfb_write_register (0x33 ,0 ); +mxsfb_write_register (0x34 ,0xdb ); +mxsfb_write_register (0x35 ,0 ); +mxsfb_write_register (0x36 ,0xaf ); +mxsfb_write_register (0x37 ,0 ); +mxsfb_write_register (0x38 ,0xdb ); +mxsfb_write_register (0x39 ,0 ); +mxsfb_write_register (0x50 ,0 ); +mxsfb_write_register (0x51 ,0x705 ); +mxsfb_write_register (0x52 ,0xe0a ); +mxsfb_write_register (0x53 ,0x300 ); +mxsfb_write_register (0x54 ,0xa0e ); +mxsfb_write_register (0x55 ,0x507 ); +mxsfb_write_register (0x56 ,0 ); +mxsfb_write_register (0x57 ,3 ); +mxsfb_write_register (0x58 ,0x90a ); +mxsfb_write_register (0x59 ,0xa09 ); +mdelay (30 ); +mxsfb_write_register (7 ,0x1017 ); +mdelay (40 ); +mxsfb_write_register (0x36 ,0xaf ); +mxsfb_write_register (0x37 ,0 ); +mxsfb_write_register (0x38 ,0xdb ); +mxsfb_write_register (0x39 ,0 ); +mxsfb_write_register (0x20 ,0 ); +mxsfb_write_register (0x21 ,0 ); +/* Turn on Framebuffer Upload Mode */ +mxsfb_write_byte (0x22 ,0 );
board/creative/xfi3/xfi3.c line 209
Quoted 10 lines
board/creative/xfi3/xfi3.c new file +10
-0+ +writel (LCDIF_CTRL_LCDIF_MASTER |LCDIF_CTRL_DATA_SELECT , + ®s->hw_lcdif_ctrl_set); +} +#endif + +int board_init (void ) +{ +/* Adress of boot parameters */ + gd->bd->bi_boot_params =PHYS_SDRAM_1 +0x100 ;
Complete OT: these two lines are in each board and often a board_init() is written only for them. Maybe we can drop them putting the code global. I have not seen a board where bi_boot_params is not set to RAM address + 0x100.
boards.cfg zmx25 arm arm926ejs zmx25 syteco · line 201
Quoted 9 lines
boards.cfg +1
-0@@ -198,6 +198,7 @@ zmx25 arm arm926ejs zmx25 syteco imx27lite arm arm926ejs imx27lite logicpd mx27 magnesium arm arm926ejs imx27lite logicpd mx27 mx23_olinuxino arm arm926ejs mx23_olinuxino olimex mxs mx23_olinuxino +xfi3 arm arm926ejs xfi3 creative mxs xfi3
Entries here are not sorted. Can you fix it, please ? Thanks !
Quoted 79 lines
include/configs/xfi3.h new file +72
-0@@ -0,0 +1,82 @@ +/* +* Copyright (C) 2013 Marek Vasut <[email protected]> +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ +#ifndef __CONFIGS_XFI3_H__ +#define __CONFIGS_XFI3_H__ + +/* System configurations */ +#define CONFIG_MX23 /* i.MX23 SoC */ +#define CONFIG_MACH_TYPE 0xffffffff + +/* U-Boot Commands */ +#define CONFIG_SYS_NO_FLASH +#include <config_cmd_default.h> +#define CONFIG_DISPLAY_CPUINFO +#define CONFIG_DOS_PARTITION + +#define CONFIG_CMD_CACHE +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_FAT +#define CONFIG_CMD_GPIO +#define CONFIG_CMD_MMC +#define CONFIG_CMD_PING +#define CONFIG_CMD_USB +#define CONFIG_VIDEO + +/* Memory configuration */ +#define CONFIG_NR_DRAM_BANKS 1/* 1 bank of DRAM */ +#define PHYS_SDRAM_1 0x40000000/* Base address */ +#define PHYS_SDRAM_1_SIZE 0x08000000/* Max 128 MB RAM */ +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 + +/* Environment */ +#define CONFIG_ENV_SIZE (16 * 1024) +#define CONFIG_ENV_IS_NOWHERE +#define CONFIG_ENV_OVERWRITE + +/* Booting Linux */ +#define CONFIG_BOOTDELAY 3 +#define CONFIG_BOOTFILE "uImage" +#define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 " +#define CONFIG_LOADADDR 0x42000000 +#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR + +/* LCD */ +#ifdef CONFIG_VIDEO +#define CONFIG_VIDEO_MXS_MODE_SYSTEM +#define CONFIG_SYS_BLACK_IN_WRITE +#define LCD_BPP LCD_COLOR16 +#endif + +/* USB */ +#ifdef CONFIG_CMD_USB +#define CONFIG_EHCI_MXS_PORT0 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 1 + +#define CONFIG_MV_UDC /* ChipIdea CI13xxx UDC */ +#define CONFIG_USB_GADGET_DUALSPEED
include/configs/xfi3.h line 82
Quoted 10 lines
include/configs/xfi3.h new file +10
-0+ +#define CONFIG_USB_ETHER +#define CONFIG_USB_ETH_CDC +#define CONFIG_NETCONSOLE +#endif + +/* The rest of the configuration is shared */ +#include <configs/mxs.h> + +#endif /* __CONFIGS_XFI3_H__ */
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== 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 =====================================================================
PATCH 5/11 ARM: mxs: Add Creative ZEN XFi3 board
Dear Stefano Babic,
[...]
Quoted 17 lines
Quoted 17 lines
board/creative/xfi3/Makefile new file +16
-0@@ -0,0 +1,47 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd at denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details.
Quoted 8 lines
board/creative/xfi3/Makefile line 22
Quoted 6 lines
board/creative/xfi3/Makefile new file +6
-0+# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +#Please use new licence style with SPDX identifier. Fix it globally.
Fixed in my tree already, thanks.
[...]
Quoted 5 lines
Quoted 5 lines
board/creative/xfi3/xfi3.c new file +5
-0+void mxsfb_system_setup (void ) +{ +struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE ; + +/* Switch the LCDIF into System-Mode */
Quoted 8 lines
board/creative/xfi3/xfi3.c line 138
Quoted 5 lines
board/creative/xfi3/xfi3.c new file +5
-0+writel (LCDIF_CTRL_LCDIF_MASTER |LCDIF_CTRL_DOTCLK_MODE | +LCDIF_CTRL_BYPASS_COUNT , ®s->hw_lcdif_ctrl_clr); + +/* Restart the SmartLCD controller */ +mdelay (50 );Nothing again, but 50mS is a lot of time and this sums up in the whole function making a big delay. Really needed ?
Yeah, I had these smartLCDs (just for the record).
Quoted 19 lines
Quoted 19 lines
board/creative/xfi3/xfi3.c new file +19
-0+writel (1 , ®s->hw_lcdif_ctrl1_set); +mdelay (50 ); +writel (1 , ®s->hw_lcdif_ctrl1_clr); +mdelay (50 ); +writel (1 , ®s->hw_lcdif_ctrl1_set); +mdelay (50 ); + +/* Program the SmartLCD controller */ +writel (LCDIF_CTRL1_RECOVER_ON_UNDERFLOW , ®s->hw_lcdif_ctrl1_set); + +writel (0x03030202 , ®s->hw_lcdif_timing); + +mxsfb_write_register (1 ,0x01c ); + +mxsfb_write_register (2 ,0x100 ); +/* 0x30 flips the LCD */ +mxsfb_write_register (3 ,0x1038 ); +mxsfb_write_register (8 ,0x808 ); +/* This can possibly contain 0x111 */
Quoted 8 lines
board/creative/xfi3/xfi3.c line 161
Quoted 4 lines
board/creative/xfi3/xfi3.c new file +4
-0+mxsfb_write_register (0xc ,0x0 ); +mxsfb_write_register (0xf ,0xc01 ); +mxsfb_write_register (0x20 ,0 ); +mxsfb_write_register (0x21 ,0 );There is a kind of magic here. Any way to get #defines or some explanation ? I admit that the comment "This can possibly contain
0x111*" does not help me a lot ;-)
No, I won't transcript the datasheet here, I see no added value. I added comment that this stuff is pulled from the OTM2201A datasheet so the reader can look the meaning of the registers up.
Quoted 45 lines
Quoted 45 lines
board/creative/xfi3/xfi3.c new file +45
-0+mdelay (30 ); +mxsfb_write_register (0x10 ,0xa00 ); +mxsfb_write_register (0x11 ,0x1038 ); +mdelay (30 ); +mxsfb_write_register (0x12 ,0x1010 ); +mxsfb_write_register (0x13 ,0x50 ); +mxsfb_write_register (0x14 ,0x4f58 ); +mxsfb_write_register (0x30 ,0 ); +mxsfb_write_register (0x31 ,0xdb ); +mxsfb_write_register (0x32 ,0 ); +mxsfb_write_register (0x33 ,0 ); +mxsfb_write_register (0x34 ,0xdb ); +mxsfb_write_register (0x35 ,0 ); +mxsfb_write_register (0x36 ,0xaf ); +mxsfb_write_register (0x37 ,0 ); +mxsfb_write_register (0x38 ,0xdb ); +mxsfb_write_register (0x39 ,0 ); +mxsfb_write_register (0x50 ,0 ); +mxsfb_write_register (0x51 ,0x705 ); +mxsfb_write_register (0x52 ,0xe0a ); +mxsfb_write_register (0x53 ,0x300 ); +mxsfb_write_register (0x54 ,0xa0e ); +mxsfb_write_register (0x55 ,0x507 ); +mxsfb_write_register (0x56 ,0 ); +mxsfb_write_register (0x57 ,3 ); +mxsfb_write_register (0x58 ,0x90a ); +mxsfb_write_register (0x59 ,0xa09 ); +mdelay (30 ); +mxsfb_write_register (7 ,0x1017 ); +mdelay (40 ); +mxsfb_write_register (0x36 ,0xaf ); +mxsfb_write_register (0x37 ,0 ); +mxsfb_write_register (0x38 ,0xdb ); +mxsfb_write_register (0x39 ,0 ); +mxsfb_write_register (0x20 ,0 ); +mxsfb_write_register (0x21 ,0 ); +/* Turn on Framebuffer Upload Mode */ +mxsfb_write_byte (0x22 ,0 ); + +writel (LCDIF_CTRL_LCDIF_MASTER |LCDIF_CTRL_DATA_SELECT , + ®s->hw_lcdif_ctrl_set); +} +#endif + +int board_init (void )
Quoted 8 lines
board/creative/xfi3/xfi3.c line 209
Quoted 3 lines
board/creative/xfi3/xfi3.c new file +3
-0+{ +/* Adress of boot parameters */ + gd->bd->bi_boot_params =PHYS_SDRAM_1 +0x100 ;Complete OT: these two lines are in each board and often a
board_init()is written only for them. Maybe we can drop them putting the code global. I have not seen a board wherebi_boot_paramsis not set to RAM address +0x100.
Very valid point, feel free to submit a patch and CC me on that!
Quoted 13 lines
Quoted 13 lines
boards.cfg +0
-0@@ -198,6 +198,7 @@ zmx25 arm arm926ejszmx25 syteco
imx27lite arm arm926ejs imx27lite
logicpd mx27 magnesium arm arm926ejs
imx27lite logicpd mx27mx23_olinuxino
arm arm926ejsmx23_olinuxinoolimex
mxsmx23_olinuxino
Quoted 4 lines
Quoted 2 lines
+xfi3 arm arm926ejs xfi3
creative mxs xfi3Entries here are not sorted. Can you fix it, please ? Thanks !
AARGH, they got unsorted by mx23evk already :-E~ Will add a patch to fix this and then keep this sorted in these patches here.
PATCH 5/11 ARM: mxs: Add Creative ZEN XFi3 board
In reply to Marek VasutDear Marek,
Quoted 1 line · In message <[email protected]> you wrote:
...
board/creative/xfi3/xfi3.c line 149
Quoted 4 lines
board/creative/xfi3/xfi3.c new file +4
-0+/* Program the SmartLCD controller */ +writel (LCDIF_CTRL1_RECOVER_ON_UNDERFLOW , ®s->hw_lcdif_ctrl1_set); + +writel (0x03030202 , ®s->hw_lcdif_timing);
Please don't use such magic numbers.
Quoted 37 lines
board/creative/xfi3/xfi3.c new file +37
-0+mxsfb_write_register (1 ,0x01c ); + +mxsfb_write_register (2 ,0x100 ); +/* 0x30 flips the LCD */ +mxsfb_write_register (3 ,0x1038 ); +mxsfb_write_register (8 ,0x808 ); +/* This can possibly contain 0x111 */ +mxsfb_write_register (0xc ,0x0 ); +mxsfb_write_register (0xf ,0xc01 ); +mxsfb_write_register (0x20 ,0 ); +mxsfb_write_register (0x21 ,0 ); +mdelay (30 ); +mxsfb_write_register (0x10 ,0xa00 ); +mxsfb_write_register (0x11 ,0x1038 ); +mdelay (30 ); +mxsfb_write_register (0x12 ,0x1010 ); +mxsfb_write_register (0x13 ,0x50 ); +mxsfb_write_register (0x14 ,0x4f58 ); +mxsfb_write_register (0x30 ,0 ); +mxsfb_write_register (0x31 ,0xdb ); +mxsfb_write_register (0x32 ,0 ); +mxsfb_write_register (0x33 ,0 ); +mxsfb_write_register (0x34 ,0xdb ); +mxsfb_write_register (0x35 ,0 ); +mxsfb_write_register (0x36 ,0xaf ); +mxsfb_write_register (0x37 ,0 ); +mxsfb_write_register (0x38 ,0xdb ); +mxsfb_write_register (0x39 ,0 ); +mxsfb_write_register (0x50 ,0 ); +mxsfb_write_register (0x51 ,0x705 ); +mxsfb_write_register (0x52 ,0xe0a ); +mxsfb_write_register (0x53 ,0x300 ); +mxsfb_write_register (0x54 ,0xa0e ); +mxsfb_write_register (0x55 ,0x507 ); +mxsfb_write_register (0x56 ,0 ); +mxsfb_write_register (0x57 ,3 ); +mxsfb_write_register (0x58 ,0x90a );
board/creative/xfi3/xfi3.c line 197
Quoted 10 lines
board/creative/xfi3/xfi3.c new file +10
-0+mxsfb_write_register (0x59 ,0xa09 ); +mdelay (30 ); +mxsfb_write_register (7 ,0x1017 ); +mdelay (40 ); +mxsfb_write_register (0x36 ,0xaf ); +mxsfb_write_register (0x37 ,0 ); +mxsfb_write_register (0x38 ,0xdb ); +mxsfb_write_register (0x39 ,0 ); +mxsfb_write_register (0x20 ,0 ); +mxsfb_write_register (0x21 ,0 );
This is terrible. WHy don't you use an array for these values, and then a simple loop to program the (register,value) pairs? That would not only be much easier to read and to maintain but also result in smaller code...
Quoted 1 line
+#define
CONFIG_MACH_TYPE0xffffffff
NAK. Please use a proper value.
Best regards,
Wolfgang Denk
Signature · 4 lines
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 God made the integers; all else is the work of Man. - Kronecker
PATCH 5/11 ARM: mxs: Add Creative ZEN XFi3 board
Dear Wolfgang Denk,
Quoted 4 lines
Dear Marek,
In message <[email protected]> you wrote:
Quoted 8 lines
...
board/creative/xfi3/xfi3.c line 149
Quoted 4 lines
board/creative/xfi3/xfi3.c new file +4
-0+/* Program the SmartLCD controller */ +writel (LCDIF_CTRL1_RECOVER_ON_UNDERFLOW , ®s->hw_lcdif_ctrl1_set); + +writel (0x03030202 , ®s->hw_lcdif_timing);Please don't use such magic numbers.
Fixed
[...]
Quoted 9 lines
board/creative/xfi3/xfi3.c line 197
Quoted 4 lines
board/creative/xfi3/xfi3.c new file +4
-0+mxsfb_write_register (0x38 ,0xdb ); +mxsfb_write_register (0x39 ,0 ); +mxsfb_write_register (0x20 ,0 ); +mxsfb_write_register (0x21 ,0 );This is terrible. WHy don't you use an array for these values, and then a simple loop to program the (register,value) pairs? That would not only be much easier to read and to maintain but also result in smaller code...
True, fixed.
Quoted 3 lines
Quoted 1 line
+#define
CONFIG_MACH_TYPE0xffffffffNAK. Please use a proper value.
Removed altogether, we use only DT here.
Best regards,
Marek Vasut
PATCH 6/11 ARM: mxs: Add SanDisk Sansa Fuze+ board
In reply to Marek VasutAdd STMP3780-based Sansa Fuze+ board. This board is a small PMP device sporting a CPU which was later rebranded to i.MX233 . Currently supported is USB gadget mode and MMC .
--- MAINTAINERS | 1 + board/sandisk/sansa_fuze_plus/Makefile | 47 ++++ board/sandisk/sansa_fuze_plus/sfp.c | 386 ++++++++++++++++++++++++++++++ board/sandisk/sansa_fuze_plus/spl_boot.c | 155 ++++++++++++ boards.cfg | 1 + include/configs/sansa_fuze_plus.h | 83 +++++++ 6 files changed, 673 insertions(+) create mode 100644 board/sandisk/sansa_fuze_plus/Makefile create mode 100644 board/sandisk/sansa_fuze_plus/sfp.c create mode 100644 board/sandisk/sansa_fuze_plus/spl_boot.c create mode 100644 include/configs/sansa_fuze_plus.h
MAINTAINERS +1 -0
@@ -969,6 +969,7 @@ Marek Vasut <[email protected]> zipitz2 xscale/pxa mx23_olinuxino i.MX23 xfi3 i.MX23 + sansa_fuze_plus i.MX23 m28evk i.MX28 sc_sps_1 i.MX28 m53evk i.MX53
board/sandisk/sansa_fuze_plus/Makefile new file +47 -0
47 lines not on this page · raw message
board/sandisk/sansa_fuze_plus/sfp.c new file +386 -0
386 lines not on this page · raw message
board/sandisk/sansa_fuze_plus/spl_boot.c new file +155 -0
155 lines not on this page · raw message
boards.cfg +1 -0
@@ -199,6 +199,7 @@ imx27lite arm arm926ejs imx27lite logicpd magnesium arm arm926ejs imx27lite logicpd mx27 mx23_olinuxino arm arm926ejs mx23_olinuxino olimex mxs mx23_olinuxino xfi3 arm arm926ejs xfi3 creative mxs xfi3 +sansa_fuze_plus arm arm926ejs sansa_fuze_plus sandisk mxs sansa_fuze_plus apx4devkit arm arm926ejs apx4devkit bluegiga mxs apx4devkit mx23evk arm arm926ejs mx23evk freescale mxs mx23evk m28evk arm arm926ejs m28evk denx mxs m28evk
include/configs/sansa_fuze_plus.h new file +83 -0
83 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 6/11 ARM: mxs: Add SanDisk Sansa Fuze+ board
Dear Marek Vasut,
Quoted 18 lines · In message <[email protected]> you wrote:
board/sandisk/sansa_fuze_plus/Makefile new file +11
-0@@ -0,0 +1,47 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd at denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version.
board/sandisk/sansa_fuze_plus/Makefile line 21
Quoted 10 lines
board/sandisk/sansa_fuze_plus/Makefile new file +10
-0+# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA
Please fix the whole series to use SPDX License IDs instead.
Best regards,
Wolfgang Denk
Signature · 5 lines
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 Der Horizont vieler Menschen ist ein Kreis mit Radius Null -- und das nennen sie ihren Standpunkt.
PATCH 6/11 ARM: mxs: Add SanDisk Sansa Fuze+ board
Dear Wolfgang Denk,
Quoted 24 lines
Dear Marek Vasut,
Quoted 21 lines · In message <[email protected]> you wrote:
(quoted diff) +0
-0b/board/sandisk/sansa_fuze_plus/Makefile new file mode 100644 index 0000000..5e46e4c
board/sandisk/sansa_fuze_plus/Makefile new file +15
-0@@ -0,0 +1,47 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd at denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Quoted 8 lines
board/sandisk/sansa_fuze_plus/Makefile line 21
Quoted 6 lines
board/sandisk/sansa_fuze_plus/Makefile new file +6
-0+# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USAPlease fix the whole series to use SPDX License IDs instead.
Fixed
Best regards,
Marek Vasut
PATCH 7/11 video: Encapsulate font in video_font_data.h
In reply to Marek VasutThis patch moves all the font configuration values into video_font_data.h so they are all in the right place with the font. The video_font.h now only includes video_font_data.h and will allow us to select and include different font once more fonts are added.
--- arch/powerpc/cpu/mpc8xx/video.c | 1 - common/lcd.c | 1 - drivers/video/cfb_console.c | 1 - drivers/video/sed156x.c | 1 - include/video_font.h | 5 +---- include/video_font_data.h | 5 +++++ 6 files changed, 6 insertions(+), 8 deletions(-)
arch/powerpc/cpu/mpc8xx/video.c +0 -1
@@ -125,7 +125,6 @@ DECLARE_GLOBAL_DATA_PTR;/************************************************************************/ #include <video_font.h> /* Get font data, width and height */ -#include <video_font_data.h> #ifdef CONFIG_VIDEO_LOGO #include <video_logo.h> /* Get logo data, width and height */
common/lcd.c +0 -1
@@ -67,7 +67,6 @@/* ** FONT DATA */ /************************************************************************/ #include <video_font.h> /* Get font data, width and height */ -#include <video_font_data.h> /************************************************************************/ /* ** LOGO DATA */
drivers/video/cfb_console.c +0 -1
@@ -213,7 +213,6 @@#include <linux/types.h> #include <stdio_dev.h> #include <video_font.h> -#include <video_font_data.h> #if defined(CONFIG_CMD_DATE )#include <rtc.h>
drivers/video/sed156x.c +0 -1
@@ -41,7 +41,6 @@/* include the font data */ #include <video_font.h> -#include <video_font_data.h> #if VIDEO_FONT_WIDTH !=8 ||VIDEO_FONT_HEIGHT !=16 #error Expecting VIDEO_FONT_WIDTH == 8 && VIDEO_FONT_HEIGHT == 16
include/video_font.h +1 -4
@@ -24,9 +24,6 @@#ifndef _VIDEO_FONT_#define _VIDEO_FONT_ -#define VIDEO_FONT_CHARS 256 -#define VIDEO_FONT_WIDTH 8 -#define VIDEO_FONT_HEIGHT 16 -#define VIDEO_FONT_SIZE (VIDEO_FONT_CHARS * VIDEO_FONT_HEIGHT) +#include <video_font_data.h> #endif /* _VIDEO_FONT_ */
include/video_font_data.h +5 -0
@@ -24,6 +24,11 @@#ifndef _VIDEO_FONT_DATA_#define _VIDEO_FONT_DATA_ +#define VIDEO_FONT_CHARS 256 +#define VIDEO_FONT_WIDTH 8 +#define VIDEO_FONT_HEIGHT 16 +#define VIDEO_FONT_SIZE (VIDEO_FONT_CHARS * VIDEO_FONT_HEIGHT) +static unsigned char video_fontdata[VIDEO_FONT_SIZE ] = { /* 0 0x00 '^@' */
Signature · 1 line
1.7.10.4
PATCH 7/11 video: Encapsulate font in video_font_data.h
Hi,
Quoted 4 lines · On Tue, 30 Jul 2013 23:37:57 +0200 Marek Vasut <[email protected]> wrote:
This patch moves all the font configuration values into
video_font_data.hso they are all in the right place with the font. Thevideo_font.hnow only includesvideo_font_data.hand will allow us to select and include different font once more fonts are added.
this patch adds a warning:
Configuring for mcc200 board...
text data bss dec hex filename
202480 19924 286272 508676 7c304 ./u-boot/home/ag/u-boot/u-boot-video/include/video_font_data.h:16:22: warning: 'video_fontdata' defined but not used [-Wunused-variable]
and commit d3983ee85 did this video_font.h split. Any idea how we should handle it?
Thanks,
Anatolij
PATCH 7/11 video: Encapsulate font in video_font_data.h
Dear Anatolij Gustschin,
Quoted 12 lines
Hi,
On Tue, 30 Jul 2013 23:37:57 +0200
Quoted 4 lines · Marek Vasut
This patch moves all the font configuration values into
video_font_data.hso they are all in the right place with the font. Thevideo_font.hnow only includesvideo_font_data.hand will allow us to select and include different font once more fonts are added.this patch adds a warning:
Quoted 8 lines
Configuring for mcc200 board...
text data bss dec hex filename
202480 19924 286272 508676 7c304 ./u-boot/home/ag/u-boot/u-boot-video/include/video_font_data.h:16:22: warning:
'video_fontdata' defined but not used [-Wunused-variable]and commit
d3983ee85did thisvideo_font.hsplit. Any idea how we should handle it?
Dang. What about adding __maybe_ununsed for the video_fontdata ?
Best regards,
Marek Vasut
PATCH 7/11 video: Encapsulate font in video_font_data.h
In reply to Marek VasutHi,
Quoted 7 lines · On Tue, 30 Jul 2013 23:37:57 +0200 Marek Vasut <[email protected]> wrote:
This patch moves all the font configuration values into
video_font_data.hso they are all in the right place with the font. Thevideo_font.hnow only includesvideo_font_data.hand will allow us to select and include different font once more fonts are added.Signed-off-by Marek Vasut <[email protected]>Cc Anatolij Gustschin <[email protected]>
Quoted 8 lines
--- arch/powerpc/cpu/mpc8xx/video.c | 1 - common/lcd.c | 1 - drivers/video/cfb_console.c | 1 - drivers/video/sed156x.c | 1 - include/video_font.h | 5 +---- include/video_font_data.h | 5 +++++ 6 files changed, 6 insertions(+), 8 deletions(-)
Applied to u-boot-video/master after fixing warning.
Thanks,
Anatolij
PATCH 8/11 video: Add small 4x6 font from Linux
In reply to Marek VasutThis font is based on Linux drivers/video/console/font_mini_4x6.c as of commit:
commit bcfbeecea11c15e243f076d37d637c2598aff4fe
Author: Bjarni Ingi Gislason <[email protected]> Date: Sun Aug 12 15:05:10 2012 +0000
drivers: console: font_: Change a glyph from "broken bar" to "vertical line"
I removed these lines as they are useless in U-Boot:
#include <linux/font.h>
#define FONTDATAMAX 1536
Whole "const struct font_desc font_mini_4x6" block
This patch also adds a new configuration option to select this smaller font, CONFIG_VIDEO_FONT_4X6 , but this is disabled by default. The default setting is the regular "large" font.
--- include/video_font.h | 4 + include/video_font_4x6.h | 2154 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2158 insertions(+) create mode 100644 include/video_font_4x6.h
include/video_font.h +4 -0
@@ -24,6 +24,10 @@#ifndef _VIDEO_FONT_#define _VIDEO_FONT_ +#ifdef CONFIG_VIDEO_FONT_4X6 +#include <video_font_4x6.h> +#else #include <video_font_data.h> +#endif #endif /* _VIDEO_FONT_ */
include/video_font_4x6.h new file +2154 -0
2,154 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 8/11 video: Add small 4x6 font from Linux
Quoted 17 lines · On Tue, 30 Jul 2013 23:37:58 +0200 Marek Vasut <[email protected]> wrote:
This font is based on Linux
drivers/video/console/font_mini_4x6.cas of commit:commit
bcfbeecea11c15e243f076d37d637c2598aff4feAuthor: Bjarni Ingi Gislason <[email protected]> Date: Sun Aug 12 15:05:10 2012 +0000drivers: console:
font_: Change a glyph from "broken bar" to "vertical line"I removed these lines as they are useless in U-Boot:
#include <linux/font.h>
#define FONTDATAMAX 1536
Whole "const structfont_descfont_mini_4x6" blockThis patch also adds a new configuration option to select this smaller font,
CONFIG_VIDEO_FONT_4X6, but this is disabled by default. The default setting is the regular "large" font.
Quoted 7 lines
Signed-off-by Marek Vasut <[email protected]>Cc Anatolij Gustschin <[email protected]>--- include/video_font.h | 4 + include/video_font_4x6.h | 2154 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2158 insertions(+) create mode 100644 include/video_font_4x6.h
Applied to u-boot-video/master. Thanks!
Anatolij
PATCH 9/11 video: Fix cfb_console for 4-bit wide font
In reply to Marek VasutThe cfb_console can't handle 4-bit wide font properly, since with 4-bit wide font, all 8 bits are drawn. Unbreak the video_drawchars() function to correctly render 4-bits only on such fonts.
--- drivers/video/cfb_console.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/video/cfb_console.c +21 -0
@@ -467,6 +467,10 @@ static void video_drawchars(int xx, int yy, unsigned char *s, int count) ((u32 *) dest)[0 ] = (video_font_draw_table8[bits >>4 ] & eorx) ^ bgx; + +if (VIDEO_FONT_WIDTH ==4 ) +continue ; + ((u32 *) dest)[1 ] = (video_font_draw_table8[bits &15 ] & eorx) ^ bgx;
@@ -492,6 +496,10 @@ static void video_drawchars(int xx, int yy, unsigned char *s, int count)SHORTSWAP32 ((video_font_draw_table15 [bits >>4 &3 ] & eorx) ^ bgx); + +if (VIDEO_FONT_WIDTH ==4 ) +continue ; + ((u32 *) dest)[2 ] = SHORTSWAP32((video_font_draw_table15 [bits >> 2 & 3] & eorx) ^
@@ -522,6 +530,10 @@ static void video_drawchars(int xx, int yy, unsigned char *s, int count)SHORTSWAP32 ((video_font_draw_table16 [bits >>4 &3 ] & eorx) ^ bgx); + +if (VIDEO_FONT_WIDTH ==4 ) +continue ; + ((u32 *) dest)[2 ] = SHORTSWAP32((video_font_draw_table16 [bits >> 2 & 3] & eorx) ^
@@ -556,6 +568,11 @@ static void video_drawchars(int xx, int yy, unsigned char *s, int count) ((u32 *) dest)[3 ] =SWAP32 ((video_font_draw_table32 [bits >>4 ][3 ] & eorx) ^ bgx); + + +if (VIDEO_FONT_WIDTH ==4 ) +continue ; + ((u32 *) dest)[4 ] =SWAP32 ((video_font_draw_table32 [bits &15 ][0 ] & eorx) ^ bgx);
@@ -591,6 +608,10 @@ static void video_drawchars(int xx, int yy, unsigned char *s, int count) ((u32 *) dest)[2 ] = (video_font_draw_table24[bits >>4 ][2 ] & eorx) ^ bgx; + +if (VIDEO_FONT_WIDTH ==4 ) +continue ; + ((u32 *) dest)[3 ] = (video_font_draw_table24[bits &15 ][0 ] & eorx) ^ bgx;
Signature · 1 line
1.7.10.4
PATCH 9/11 video: Fix cfb_console for 4-bit wide font
Quoted 9 lines · On Tue, 30 Jul 2013 23:37:59 +0200 Marek Vasut <[email protected]> wrote:
The
cfb_consolecan't handle 4-bit wide font properly, since with 4-bit wide font, all 8 bits are drawn. Unbreak thevideo_drawchars()function to correctly render 4-bits only on such fonts.Signed-off-by Marek Vasut <[email protected]>Cc Anatolij Gustschin <[email protected]>--- drivers/video/cfb_console.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
Applied to u-boot-video/master. Thanks!
Anatolij
PATCH 10/11 ARM: mxs: Enable 4x6 font for X-Fi3
In reply to Marek VasutThis device has a very small screen and thus can benefit from using smaller font. Enable it.
--- include/configs/xfi3.h | 1 + 1 file changed, 1 insertion(+)
include/configs/xfi3.h +1 -0
@@ -58,6 +58,7 @@/* LCD */ #ifdef CONFIG_VIDEO +#define CONFIG_VIDEO_FONT_4X6 #define CONFIG_VIDEO_MXS_MODE_SYSTEM #define CONFIG_SYS_BLACK_IN_WRITE #define LCD_BPP LCD_COLOR16
Signature · 1 line
1.7.10.4
PATCH 10/11 ARM: mxs: Enable 4x6 font for X-Fi3
Quoted 17 lines · Marek Vasut
This device has a very small screen and thus can benefit from using smaller font. Enable it.
Signed-off-by Marek Vasut <[email protected]>Cc Fabio Estevam <[email protected]>Cc Otavio Salvador <[email protected]>Cc Stefano Babic <[email protected]>--- include/configs/xfi3.h | 1 + 1 file changed, 1 insertion(+)include/configs/xfi3.h +0
-0
include/configs/xfi3.h line 64
Quoted 7 lines
include/configs/xfi3.h +1
-0@@ -58,6 +58,7 @@/* LCD */ #ifdef CONFIG_VIDEO +#define CONFIG_VIDEO_FONT_4X6 #define CONFIG_VIDEO_MXS_MODE_SYSTEM #define CONFIG_SYS_BLACK_IN_WRITE #define LCD_BPP LCD_COLOR16
This patch should be squashed with 5/11 because you add a new file.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== 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 =====================================================================
PATCH 10/11 ARM: mxs: Enable 4x6 font for X-Fi3
Dear Stefano Babic,
Quoted 22 lines · Marek Vasut
Quoted 21 lines
This device has a very small screen and thus can benefit from using smaller font. Enable it.
Signed-off-by Marek Vasut <[email protected]>Cc Fabio Estevam <[email protected]>Cc Otavio Salvador <[email protected]>Cc Stefano Babic <[email protected]>---
include/configs/xfi3.h | 1 + 1 file changed, 1 insertion(+)include/configs/xfi3.h +0
-0@@ -58,6 +58,7 @@/* LCD */ #ifdef CONFIG_VIDEO
Quoted 7 lines
Quoted 5 lines
include/configs/xfi3.h +1
-0+#define CONFIG_VIDEO_FONT_4X6 #define CONFIG_VIDEO_MXS_MODE_SYSTEM #define
CONFIG_SYS_BLACK_IN_WRITE
#defineLCD_BPPLCD_COLOR16This patch should be squashed with 5/11 because you add a new file.
I explicitly keep it this way , see the cover letter. You could apply first 6 patches and after Anatolij checks the font stuff, the rest can be applied. Or if I do get an ACK from Anatolij, I will squash them, yes.
Best regards,
Marek Vasut
PATCH 10/11 ARM: mxs: Enable 4x6 font for X-Fi3
Hi Marek,
Quoted 6 lines · Marek Vasut
Quoted 2 lines
This patch should be squashed with 5/11 because you add a new file.
I explicitly keep it this way , see the cover letter. You could apply first 6 patches and after Anatolij checks the font stuff, the rest can be applied. Or if I do get an ACK from Anatolij, I will squash them, yes.
Ok, fine. We will wait for Anatolji's ACK.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== 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 =====================================================================
PATCH 11/11 ARM: mxs: Enable 4x6 font for Fuze+
In reply to Marek VasutThis device has a very small screen and thus can benefit from using smaller font. Enable it.
--- include/configs/sansa_fuze_plus.h | 1 + 1 file changed, 1 insertion(+)
include/configs/sansa_fuze_plus.h +1 -0
@@ -59,6 +59,7 @@/* LCD */ #ifdef CONFIG_VIDEO +#define CONFIG_VIDEO_FONT_4X6 #define CONFIG_VIDEO_MXS_MODE_SYSTEM #define CONFIG_SYS_BLACK_IN_WRITE #define LCD_BPP LCD_COLOR16
Signature · 1 line
1.7.10.4