From 1382648b6bef3921086abeadadbd9fbc54619ab1 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Sat, 6 Feb 2016 10:42:43 -0700 Subject: video: bcm2835: use bus_to_phys() on FB address The FB address is generated by the firmware running on the GPU/VideoCore and is a "bus" address. This address is the other side of an IOMMU from the ARM upon which U-Boot is running. Use bus_to_phys() to convert this to an ARM physical address. Without this, U-Boot seems to work just fine, but once the Linux kernel boots on an RPi2, accessing the FB memory often causes a hard system hang. This is related to: 122426d46e31 ARM: bcm2835: use phys_to_bus() for mbox 5c0beb5c58c8 usb: dwc2: use phys_to_bus/bus_to_phys 79340db7f1f6 ARM: bcm2835: implement phys_to_bus/bus_to_phys Signed-off-by: Stephen Warren diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c index 7867fe3..bff1fcb 100644 --- a/drivers/video/bcm2835.c +++ b/drivers/video/bcm2835.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -103,7 +104,8 @@ void lcd_ctrl_init(void *lcdbase) panel_info.vl_row = h; panel_info.vl_bpix = LCD_COLOR16; - gd->fb_base = msg_setup->allocate_buffer.body.resp.fb_address; + gd->fb_base = bus_to_phys( + msg_setup->allocate_buffer.body.resp.fb_address); } void lcd_enable(void) -- cgit v0.10.2 From a2931b30d287b709c09f0a4ee7c1d4c26bee69d5 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 6 Feb 2016 14:31:37 -0700 Subject: dm: video: Add a temporary work-around for old stdout var Boards with a saved environment may use 'lcd' in their stdout environment variable, expecting that this will enable output to the LCD. When the board moves to use driver model for video, this will no-longer work. Add a work-around to fix this. A warning messages is printed, and we will remove the work-around at the end of 2016. Signed-off-by: Simon Glass Acked-by: Anatolij Gustschin Tested-by: Stephen Warren diff --git a/common/console.c b/common/console.c index b3f5fdc..6a0d11b 100644 --- a/common/console.c +++ b/common/console.c @@ -650,6 +650,10 @@ struct stdio_dev *search_device(int flags, const char *name) struct stdio_dev *dev; dev = stdio_get_by_name(name); +#ifdef CONFIG_VIDCONSOLE_AS_LCD + if (!dev && !strcmp(name, "lcd")) + dev = stdio_get_by_name("vidconsole"); +#endif if (dev && (dev->flags & flags)) return dev; @@ -795,6 +799,10 @@ done: #ifndef CONFIG_SYS_CONSOLE_INFO_QUIET stdio_print_current_devices(); #endif /* CONFIG_SYS_CONSOLE_INFO_QUIET */ +#ifdef CONFIG_VIDCONSOLE_AS_LCD + if (strstr(stdoutname, "lcd")) + printf("Warning: Please change 'lcd' to 'vidconsole' in stdout/stderr environment vars\n"); +#endif #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE /* set the environment variables (will overwrite previous env settings) */ diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index fbc5d7c..19f9429 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -91,6 +91,16 @@ config CONSOLE_TRUETYPE_SIZE source "drivers/video/fonts/Kconfig" +config VIDCONSOLE_AS_LCD + bool "Use 'vidconsole' when 'lcd' is seen in stdout" + depends on DM_VIDEO + help + This is a work-around for boards which have 'lcd' in their stdout + environment variable, but have moved to use driver model for video. + In this case the console will no-longer work. While it is possible + to update the environment, the breakage may be confusing for users. + This option will be removed around the end of 2016. + config VIDEO_VESA bool "Enable VESA video driver support" default n -- cgit v0.10.2 From 6c88b51305d69b9728c56f27f363530a7f3d7e83 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 6 Feb 2016 14:31:38 -0700 Subject: video: tegra: Enable the 'lcd' env variable work-around Enable this option on all tegra boards. Signed-off-by: Simon Glass Acked-by: Anatolij Gustschin diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 0b2852c..3857243 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -13,6 +13,7 @@ config TEGRA_COMMON select DM_SPI select DM_SPI_FLASH select OF_CONTROL + select VIDCONSOLE_AS_LCD config TEGRA_ARMV7_COMMON bool "Tegra 32-bit common options" -- cgit v0.10.2