imx-common: add board_video_skip
Subsystems (3)
PATCH v2 1/8 imx-common: add board_video_skip
this function is shared by several boards and thus can be factorized
---
v2 : rename display_num to display_count as requested by Eric Nelson
keep video.h as it will also contain common video functions such as detect_hdmi so it not tied only to video_skip.
arch/arm/imx-common/Makefile | 1 + arch/arm/imx-common/video.c | 55 +++++++++++++++++++++++++++++++++ arch/arm/include/asm/imx-common/video.h | 20 ++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 arch/arm/imx-common/video.c create mode 100644 arch/arm/include/asm/imx-common/video.h
arch/arm/imx-common/Makefile +1 -0
@@ -19,6 +19,7 @@ obj-y += misc.o endif ifeq ($(SOC),$(filter $(SOC),mx6)) obj-$(CONFIG_CMD_SATA) += sata.o +obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o endif obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
arch/arm/imx-common/video.c new file +55 -0
55 lines not on this page · raw message
arch/arm/include/asm/imx-common/video.h new file +20 -0
@@ -0,0 +1,20 @@ +/* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __IMX_VIDEO_H_ +#define __IMX_VIDEO_H_ + +#include <linux/fb.h> +#include <ipu_pixfmt.h> + +struct display_info_t { +int bus; +int addr; +int pixfmt; +int (*detect)(struct display_info_t const *dev); +void (*enable)(struct display_info_t const *dev); +struct fb_videomode mode; +}; + +#endif
Signature · 1 line
1.9.0
PATCH v2 2/8 nitrogen6x: use common board_video_skip
---
v2 : rename display_num to display_count as requested by Eric Nelson
board/boundary/nitrogen6x/nitrogen6x.c | 61 ++-------------------------------- include/configs/nitrogen6x.h | 1 + 2 files changed, 4 insertions(+), 58 deletions(-)
board/boundary/nitrogen6x/nitrogen6x.c +3 -58
@@ -19,13 +19,12 @@#include <asm/imx-common/mxc_i2c.h> #include <asm/imx-common/sata.h> #include <asm/imx-common/boot_mode.h> +#include <asm/imx-common/video.h> #include <mmc.h> #include <fsl_esdhc.h> #include <micrel.h> #include <miiphy.h> #include <netdev.h> -#include <linux/fb.h> -#include <ipu_pixfmt.h> #include <asm/arch/crm_regs.h> #include <asm/arch/mxc_hdmi.h> #include <i2c.h>
@@ -446,16 +445,6 @@ static iomux_v3_cfg_t const rgb_pads[] = { MX6_PAD_DISP0_DAT23__IPU1_DISP0_DATA23, }; -struct display_info_t { -int bus; -int addr; -int pixfmt; -int (*detect)(struct display_info_t const *dev); -void (*enable)(struct display_info_t const *dev); -struct fb_videomode mode; -}; - -static int detect_hdmi (struct display_info_t const *dev) {struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR ;
@@ -492,7 +481,7 @@ static void enable_rgb(struct display_info_t const *dev)gpio_direction_output (RGB_BACKLIGHT_GP ,1 ); } -static struct display_info_t const displays[] = {{ +struct display_info_t const displays[] = {{ .bus =-1 , .addr =0 , .pixfmt =IPU_PIX_FMT_RGB24 ,
@@ -573,51 +562,7 @@ static struct display_info_t const displays[] = {{ .sync = 0, .vmode = FB_VMODE_NONINTERLACED } } }; - -int board_video_skip (void ) -{ -int i; -int ret; -char const *panel =getenv ("panel" ); -if (!panel) { -for (i =0 ; i <ARRAY_SIZE (displays); i++) { -struct display_info_t const *dev = displays+i; -if (dev->detect (dev)) { - panel = dev->mode.name; -printf ("auto-detected panel %s\n" , panel); -break ; - } - } -if (!panel) { - panel = displays[0 ].mode.name; -printf ("No panel detected: default to %s\n" , panel); - i =0 ; - } - }else { -for (i =0 ; i <ARRAY_SIZE (displays); i++) { -if (!strcmp (panel, displays[i].mode.name)) -break ; - } - } -if (i <ARRAY_SIZE (displays)) { - ret =ipuv3_fb_init (&displays[i].mode,0 , - displays[i].pixfmt); -if (!ret) { - displays[i].enable (displays+i); -printf ("Display: %s (%ux%u)\n" , - displays[i].mode.name, - displays[i].mode.xres, - displays[i].mode.yres); - }else { -printf ("LCD %s cannot be configured: %d\n" , - displays[i].mode.name, ret); - } - }else { -printf ("unsupported panel %s\n" , panel); - ret = -EINVAL ; - } -return (0 != ret); -} +size_t display_count =ARRAY_SIZE (displays);static void setup_display (void ) {
include/configs/nitrogen6x.h +1 -0
@@ -141,6 +141,7 @@#define CONFIG_CMD_HDMIDETECT #define CONFIG_CONSOLE_MUX #define CONFIG_IMX_HDMI +#define CONFIG_IMX_VIDEO_SKIP /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE
Signature · 1 line
1.9.0
PATCH v2 2/8 nitrogen6x: use common board_video_skip
Quoted 3 lines · Eric B?nard
Signed-off-by Eric B?nard <[email protected]>Acked-by Eric Nelson <[email protected]>---
Applied to u-boot-imx, -next branch, thanks !
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 v2 3/8 mx6sabresd: use common board_video_skip
In reply to Eric Bénard---
v2 : rename display_num to display_count as requested by Eric Nelson
board/freescale/mx6sabresd/mx6sabresd.c | 59 ++------------------------------- include/configs/mx6sabresd.h | 1 + 2 files changed, 4 insertions(+), 56 deletions(-)
board/freescale/mx6sabresd/mx6sabresd.c +3 -56
@@ -14,14 +14,13 @@#include <asm/gpio.h> #include <asm/imx-common/iomux-v3.h> #include <asm/imx-common/boot_mode.h> +#include <asm/imx-common/video.h> #include <mmc.h> #include <fsl_esdhc.h> #include <miiphy.h> #include <netdev.h> #include <asm/arch/mxc_hdmi.h> #include <asm/arch/crm_regs.h> -#include <linux/fb.h> -#include <ipu_pixfmt.h> #include <asm/io.h> #include <asm/arch/sys_proto.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -255,14 +254,6 @@ int board_phy_config(struct phy_device *phydev) }#if defined(CONFIG_VIDEO_IPUV3 ) -struct display_info_t { -int bus; -int addr; -int pixfmt; -int (*detect)(struct display_info_t const *dev); -void (*enable)(struct display_info_t const *dev); -struct fb_videomode mode; -};static int detect_hdmi (struct display_info_t const *dev) {
@@ -299,7 +290,7 @@ static void enable_lvds(struct display_info_t const *dev)writel (reg, &iomux->gpr[2 ]); } -static struct display_info_t const displays[] = {{ +struct display_info_t const displays[] = {{ .bus =-1 , .addr =0 , .pixfmt =IPU_PIX_FMT_RGB666 ,
@@ -340,51 +331,7 @@ static struct display_info_t const displays[] = {{ .sync = FB_SYNC_EXT, .vmode = FB_VMODE_NONINTERLACED } } }; - -int board_video_skip (void ) -{ -int i; -int ret; -char const *panel =getenv ("panel" ); -if (!panel) { -for (i =0 ; i <ARRAY_SIZE (displays); i++) { -struct display_info_t const *dev = displays+i; -if (dev->detect && dev->detect (dev)) { - panel = dev->mode.name; -printf ("auto-detected panel %s\n" , panel); -break ; - } - } -if (!panel) { - panel = displays[0 ].mode.name; -printf ("No panel detected: default to %s\n" , panel); - i =0 ; - } - }else { -for (i =0 ; i <ARRAY_SIZE (displays); i++) { -if (!strcmp (panel, displays[i].mode.name)) -break ; - } - } -if (i <ARRAY_SIZE (displays)) { - ret =ipuv3_fb_init (&displays[i].mode,0 , - displays[i].pixfmt); -if (!ret) { - displays[i].enable (displays+i); -printf ("Display: %s (%ux%u)\n" , - displays[i].mode.name, - displays[i].mode.xres, - displays[i].mode.yres); - }else -printf ("LCD %s cannot be configured: %d\n" , - displays[i].mode.name, ret); - }else { -printf ("unsupported panel %s\n" , panel); -return -EINVAL ; - } - -return 0 ; -} +size_t display_count =ARRAY_SIZE (displays);static void setup_display (void ) {
include/configs/mx6sabresd.h +1 -0
@@ -47,5 +47,6 @@#define CONFIG_VIDEO_BMP_LOGO #define CONFIG_IPUV3_CLK 260000000#define CONFIG_IMX_HDMI +#define CONFIG_IMX_VIDEO_SKIP #endif /* __MX6QSABRESD_CONFIG_H */
Signature · 1 line
1.9.0
PATCH v2 3/8 mx6sabresd: use common board_video_skip
Quoted 2 lines · Eric B?nard
Signed-off-by Eric B?nard <[email protected]>---
Applied to u-boot-imx, -next branch, thanks !
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 v2 4/8 RiOTboard and MarSBoard: add new boards support
In reply to Eric BénardRiOTboard is produced by Embest/Element 14 and is based on i.MX6 Solo The following features are tested :
- UART2 (console)
- eMMC
- SDCard
- uSDCard
- Ethernet
- USB Host (through 4 ports hub)
- HDMI output
- I2C 1/2/3
- LVDS TFT with LCD8000-97C from Embest/Element 14
Boot on eMMC and through USB loader are tested.
For more informations on this board : http://www.riotboard.org/
MarSBoard is produced by Embest/Element 14 and is based on i.MX6 Dual The following features are tested :
- UART2 (console)
- eMMC
- uSDCard
- Ethernet
- USB Host (through 2 ports hub)
- HDMI output
- I2C 1/2
- SPI NOR Flash
- LVDS TFT with LCD8000-97C from Embest/Element 14
Boot on SPI NOR and through USB loader are tested.
For more informations on this board :
http://www.embest-tech.com/shop/star/marsboard.html
Both boards are supported by the same code base as they are based on a common trunk of schematics.
---
v2 : rename display_num to display_count as requested by Eric Nelson
remove last BOARD_IS_RIOT in embestmx6boards.h which was preventing CONFIG_SUPPORT_EMMC_BOOT to be defined.
board/embest/mx6boards/Makefile | 9 + board/embest/mx6boards/mx6boards.c | 607 +++++++++++++++++++++++++++++++++++++ boards.cfg | 2 + include/configs/embestmx6boards.h | 336 ++++++++++++++++++++ 4 files changed, 954 insertions(+) create mode 100644 board/embest/mx6boards/Makefile create mode 100644 board/embest/mx6boards/mx6boards.c create mode 100644 include/configs/embestmx6boards.h
board/embest/mx6boards/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# +# Copyright (C) 2007, Guennadi Liakhovetski <[email protected]> +# +# (C) Copyright 2011 Freescale Semiconductor, Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := mx6boards.o
board/embest/mx6boards/mx6boards.c new file +607 -0
607 lines not on this page · raw message
boards.cfg +2 -0
@@ -323,6 +323,8 @@ Active arm armv7 mx6 freescale mx6sabresd Active arm armv7 mx6 freescale mx6sabresd mx6qsabresd mx6sabresd:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg,MX6Q Fabio Estevam <[email protected]> Active arm armv7 mx6 freescale mx6slevk mx6slevk mx6slevk:IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL Fabio Estevam <[email protected]> Active arm armv7 mx6 solidrun hummingboard hummingboard_solo hummingboard:IMX_CONFIG=board/solidrun/hummingboard/solo.cfg,MX6S,DDR_MB=512 Jon Nettleton <[email protected]> +Active arm armv7 mx6 embest mx6boards riotboard embestmx6boards:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s1g.cfg,MX6S,DDR_MB=1024,ENV_IS_IN_MMC Eric B?nard <[email protected]> +Active arm armv7 mx6 embest mx6boards marsboard embestmx6boards:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX6Q,DDR_MB=1024,ENV_IS_IN_SPI_FLASH Eric B?nard <[email protected]> Active arm armv7 omap3 - overo omap3_overo - Steve Sakoman <[email protected]> Active arm armv7 omap3 - pandora omap3_pandora - Grazvydas Ignotas <[email protected]> Active arm armv7 omap3 8dtech eco5pk eco5pk - Raphael Assenat <[email protected]>
include/configs/embestmx6boards.h new file +336 -0
336 lines not on this page · raw message
Signature · 1 line
1.9.0
PATCH v2 4/8 RiOTboard and MarSBoard: add new boards support
Quoted 33 lines · Eric B?nard
RiOTboard is produced by Embest/Element 14 and is based on i.MX6 Solo The following features are tested :
- UART2 (console)
- eMMC
- SDCard
- uSDCard
- Ethernet
- USB Host (through 4 ports hub)
- HDMI output
- I2C 1/2/3
- LVDS TFT with LCD8000-97C from Embest/Element 14Boot on eMMC and through USB loader are tested.
For more informations on this board : http://www.riotboard.org/
MarSBoard is produced by Embest/Element 14 and is based on i.MX6 Dual The following features are tested :
- UART2 (console)
- eMMC
- uSDCard
- Ethernet
- USB Host (through 2 ports hub)
- HDMI output
- I2C 1/2
- SPI NOR Flash
- LVDS TFT with LCD8000-97C from Embest/Element 14Boot on SPI NOR and through USB loader are tested.
For more informations on this board :
http://www.embest-tech.com/shop/star/marsboard.html
Quoted 6 lines
Both boards are supported by the same code base as they are based on a common trunk of schematics.
Signed-off-by Eric B?nard <[email protected]>Acked-by Stefano Babic <[email protected]>---
Applied to u-boot-imx, -next branch, thanks !
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 v2 5/8 imx-common/video: add detect_hdmi
In reply to Eric Bénardthis function is used by several board together with board_video_skip to detect if hdmi is plugged is order to select the display to use. So move it in imx-common to share it.
---
v2: no change
arch/arm/imx-common/video.c | 10 ++++++++++ arch/arm/include/asm/imx-common/video.h | 4 ++++ 2 files changed, 14 insertions(+)
arch/arm/imx-common/video.c +10 -0
@@ -53,3 +53,13 @@ int board_video_skip(void)return 0 ; } + +#ifdef CONFIG_IMX_HDMI +#include <asm/arch/mxc_hdmi.h> +#include <asm/io.h> +int detect_hdmi (struct display_info_t const *dev) +{ +struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR ; +return readb (&hdmi->phy_stat0) &HDMI_DVI_STAT ; +} +#endif
arch/arm/include/asm/imx-common/video.h +4 -0
@@ -17,4 +17,8 @@ struct display_info_t { struct fb_videomode mode; }; +#ifdef CONFIG_IMX_HDMI +extern int detect_hdmi (struct display_info_t const *dev); +#endif +#endif
Signature · 1 line
1.9.0
PATCH v2 5/8 imx-common/video: add detect_hdmi
Quoted 6 lines · Eric B?nard
this function is used by several board together with
board_video_skipto detect if hdmi is plugged is order to select the display to use. So move it in imx-common to share it.Signed-off-by Eric B?nard <[email protected]>---
Applied to u-boot-imx, -next branch, thanks !
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 v2 6/8 nitrogen6x: use common detect_hdmi
In reply to Eric Bénard---
v2: no change
board/boundary/nitrogen6x/nitrogen6x.c | 6 ------ 1 file changed, 6 deletions(-)
board/boundary/nitrogen6x/nitrogen6x.c +0 -6
@@ -445,12 +445,6 @@ static iomux_v3_cfg_t const rgb_pads[] = { MX6_PAD_DISP0_DAT23__IPU1_DISP0_DATA23, }; -static int detect_hdmi (struct display_info_t const *dev) -{ -struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR ; -return readb (&hdmi->phy_stat0) &HDMI_DVI_STAT ; -} -static void do_enable_hdmi (struct display_info_t const *dev) {imx_enable_hdmi_phy ();
Signature · 1 line
1.9.0
PATCH v2 6/8 nitrogen6x: use common detect_hdmi
Quoted 2 lines · Eric B?nard
Signed-off-by Eric B?nard <[email protected]>---
Applied to u-boot-imx, -next branch, thanks !
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 v2 7/8 mx6sabresd: use common detect_hdmi
In reply to Eric Bénard---
v2: no change
board/freescale/mx6sabresd/mx6sabresd.c | 8 -------- 1 file changed, 8 deletions(-)
board/freescale/mx6sabresd/mx6sabresd.c +0 -8
@@ -254,14 +254,6 @@ int board_phy_config(struct phy_device *phydev) }#if defined(CONFIG_VIDEO_IPUV3 ) - -static int detect_hdmi (struct display_info_t const *dev) -{ -struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR ; -return readb (&hdmi->phy_stat0) &HDMI_DVI_STAT ; -} - -static void disable_lvds (struct display_info_t const *dev) {struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR ;
Signature · 1 line
1.9.0
PATCH v2 7/8 mx6sabresd: use common detect_hdmi
Quoted 2 lines · Eric B?nard
Signed-off-by Eric B?nard <[email protected]>---
Applied to u-boot-imx, -next branch, thanks !
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 v2 8/8 embest/mx6boards: use common detect_hdmi
In reply to Eric Bénard---
v2: no change
board/embest/mx6boards/mx6boards.c | 6 ------ 1 file changed, 6 deletions(-)
board/embest/mx6boards/mx6boards.c +0 -6
@@ -392,12 +392,6 @@ static void disable_lvds(struct display_info_t const *dev) IOMUXC_GPR2_LVDS_CH0_MODE_MASK); } -static int detect_hdmi (struct display_info_t const *dev) -{ -struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR ; -return readb (&hdmi->phy_stat0) &HDMI_DVI_STAT ; -} -static void do_enable_hdmi (struct display_info_t const *dev) {disable_lvds (dev);
Signature · 1 line
1.9.0
PATCH v2 8/8 embest/mx6boards: use common detect_hdmi
Quoted 2 lines · Eric B?nard
Signed-off-by Eric B?nard <[email protected]>---
Applied to u-boot-imx, -next branch, thanks !
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 v2 1/8 imx-common: add board_video_skip
In reply to Eric BénardQuoted 6 lines · Eric B?nard
this function is shared by several boards and thus can be factorized
Signed-off-by Eric B?nard <[email protected]>Acked-by Eric Nelson <[email protected]>Acked-by Stefano Babic <[email protected]>---
Applied to u-boot-imx, -next branch, thanks !
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 =====================================================================