- fix [hv]sync active vs back porch in dw_mipi_dsi
- simplefb rotation support - support splash as raw image from MMC - enhancements to Truetype console (multiple fonts and sizes) - drop old LCD support -----BEGIN PGP SIGNATURE----- iGwEABECACwWIQSC4hxrSoIUVfFO0kRM6ATMmsalXAUCY17nfA4cYWd1c3RAZGVu eC5kZQAKCRBM6ATMmsalXPPoAJ0UYyt3kwslUlAJhOC+KU9UlYnVuwCbBXIQyBua K5clq+GyxXfaDl2Hnvc= =XXVp -----END PGP SIGNATURE----- Merge tag 'video-20221030' of https://source.denx.de/u-boot/custodians/u-boot-video - fix [hv]sync active vs back porch in dw_mipi_dsi - simplefb rotation support - support splash as raw image from MMC - enhancements to Truetype console (multiple fonts and sizes) - drop old LCD support
This commit is contained in:
commit
218e2c45af
348 changed files with 1152 additions and 6206 deletions
|
@ -1466,8 +1466,6 @@ M: Anatolij Gustschin <agust@denx.de>
|
|||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-video.git
|
||||
F: drivers/video/
|
||||
F: common/lcd*.c
|
||||
F: include/lcd*.h
|
||||
F: include/video*.h
|
||||
|
||||
VirtIO
|
||||
|
|
74
README
74
README
|
@ -770,80 +770,6 @@ The following options need to be configured:
|
|||
- Keyboard Support:
|
||||
See Kconfig help for available keyboard drivers.
|
||||
|
||||
- LCD Support: CONFIG_LCD
|
||||
|
||||
Define this to enable LCD support (for output to LCD
|
||||
display); also select one of the supported displays
|
||||
by defining one of these:
|
||||
|
||||
CONFIG_NEC_NL6448AC33:
|
||||
|
||||
NEC NL6448AC33-18. Active, color, single scan.
|
||||
|
||||
CONFIG_NEC_NL6448BC20
|
||||
|
||||
NEC NL6448BC20-08. 6.5", 640x480.
|
||||
Active, color, single scan.
|
||||
|
||||
CONFIG_NEC_NL6448BC33_54
|
||||
|
||||
NEC NL6448BC33-54. 10.4", 640x480.
|
||||
Active, color, single scan.
|
||||
|
||||
CONFIG_SHARP_16x9
|
||||
|
||||
Sharp 320x240. Active, color, single scan.
|
||||
It isn't 16x9, and I am not sure what it is.
|
||||
|
||||
CONFIG_SHARP_LQ64D341
|
||||
|
||||
Sharp LQ64D341 display, 640x480.
|
||||
Active, color, single scan.
|
||||
|
||||
CONFIG_HLD1045
|
||||
|
||||
HLD1045 display, 640x480.
|
||||
Active, color, single scan.
|
||||
|
||||
CONFIG_OPTREX_BW
|
||||
|
||||
Optrex CBL50840-2 NF-FW 99 22 M5
|
||||
or
|
||||
Hitachi LMG6912RPFC-00T
|
||||
or
|
||||
Hitachi SP14Q002
|
||||
|
||||
320x240. Black & white.
|
||||
|
||||
CONFIG_LCD_ALIGNMENT
|
||||
|
||||
Normally the LCD is page-aligned (typically 4KB). If this is
|
||||
defined then the LCD will be aligned to this value instead.
|
||||
For ARM it is sometimes useful to use MMU_SECTION_SIZE
|
||||
here, since it is cheaper to change data cache settings on
|
||||
a per-section basis.
|
||||
|
||||
|
||||
CONFIG_LCD_ROTATION
|
||||
|
||||
Sometimes, for example if the display is mounted in portrait
|
||||
mode or even if it's mounted landscape but rotated by 180degree,
|
||||
we need to rotate our content of the display relative to the
|
||||
framebuffer, so that user can read the messages which are
|
||||
printed out.
|
||||
Once CONFIG_LCD_ROTATION is defined, the lcd_console will be
|
||||
initialized with a given rotation from "vl_rot" out of
|
||||
"vidinfo_t" which is provided by the board specific code.
|
||||
The value for vl_rot is coded as following (matching to
|
||||
fbcon=rotate:<n> linux-kernel commandline):
|
||||
0 = no rotation respectively 0 degree
|
||||
1 = 90 degree rotation
|
||||
2 = 180 degree rotation
|
||||
3 = 270 degree rotation
|
||||
|
||||
If CONFIG_LCD_ROTATION is not defined, the console will be
|
||||
initialized with 0degree rotation.
|
||||
|
||||
- MII/PHY support:
|
||||
CONFIG_PHY_CLOCK_FREQ (ppc4xx)
|
||||
|
||||
|
|
|
@ -5,14 +5,7 @@
|
|||
|
||||
#include <common.h>
|
||||
#include <api_public.h>
|
||||
#include <lcd.h>
|
||||
#include <log.h>
|
||||
#include <video_font.h> /* Get font width and height */
|
||||
|
||||
/* lcd.h needs BMP_LOGO_HEIGHT to calculate CONSOLE_ROWS */
|
||||
#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
|
||||
#include <bmp_logo.h>
|
||||
#endif
|
||||
|
||||
/* TODO(clchiou): add support of video device */
|
||||
|
||||
|
@ -26,14 +19,6 @@ int display_get_info(int type, struct display_info *di)
|
|||
debug("%s: unsupport display device type: %d\n",
|
||||
__FILE__, type);
|
||||
return API_ENODEV;
|
||||
#ifdef CONFIG_LCD
|
||||
case DISPLAY_TYPE_LCD:
|
||||
di->pixel_width = panel_info.vl_col;
|
||||
di->pixel_height = panel_info.vl_row;
|
||||
di->screen_rows = lcd_get_screen_rows();
|
||||
di->screen_cols = lcd_get_screen_columns();
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
di->type = type;
|
||||
|
@ -44,16 +29,9 @@ int display_draw_bitmap(ulong bitmap, int x, int y)
|
|||
{
|
||||
if (!bitmap)
|
||||
return API_EINVAL;
|
||||
#ifdef CONFIG_LCD
|
||||
return lcd_display_bitmap(bitmap, x, y);
|
||||
#else
|
||||
return API_ENODEV;
|
||||
#endif
|
||||
}
|
||||
|
||||
void display_clear(void)
|
||||
{
|
||||
#ifdef CONFIG_LCD
|
||||
lcd_clear();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -251,7 +251,7 @@ config X86
|
|||
imply DM_SPI
|
||||
imply DM_SPI_FLASH
|
||||
imply DM_USB
|
||||
imply DM_VIDEO
|
||||
imply VIDEO
|
||||
imply SYSRESET
|
||||
imply SPL_SYSRESET
|
||||
imply SYSRESET_X86
|
||||
|
|
|
@ -1040,7 +1040,7 @@ config ARCH_APPLE
|
|||
select DM_SERIAL
|
||||
select DM_SPI
|
||||
select DM_USB
|
||||
select DM_VIDEO
|
||||
select VIDEO
|
||||
select IOMMU
|
||||
select LINUX_KERNEL_IMAGE_HEADER
|
||||
select OF_BOARD_SETUP
|
||||
|
|
|
@ -99,42 +99,3 @@ void at91_mci_hw_init(void)
|
|||
|
||||
at91_periph_clk_enable(ATMEL_ID_HSMCI0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LCD
|
||||
void at91_lcd_hw_init(void)
|
||||
{
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 24, 0); /* LCDDPWR */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 26, 0); /* LCDVSYNC */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 27, 0); /* LCDHSYNC */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 28, 0); /* LCDDOTCK */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 29, 0); /* LCDDEN */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 30, 0); /* LCDDOTCK */
|
||||
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 0, 0); /* LCDD0 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 1, 0); /* LCDD1 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 2, 0); /* LCDD2 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 3, 0); /* LCDD3 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 4, 0); /* LCDD4 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 5, 0); /* LCDD5 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 6, 0); /* LCDD6 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 7, 0); /* LCDD7 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 8, 0); /* LCDD8 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 9, 0); /* LCDD9 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 10, 0); /* LCDD10 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 11, 0); /* LCDD11 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 12, 0); /* LCDD12 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 13, 0); /* LCDD13 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 14, 0); /* LCDD14 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 15, 0); /* LCDD15 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 16, 0); /* LCDD16 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 17, 0); /* LCDD17 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 18, 0); /* LCDD18 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 19, 0); /* LCDD19 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 20, 0); /* LCDD20 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 21, 0); /* LCDD21 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 22, 0); /* LCDD22 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTC, 23, 0); /* LCDD23 */
|
||||
|
||||
at91_periph_clk_enable(ATMEL_ID_LCDC);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -170,39 +170,6 @@ void at91_gmac_hw_init(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD
|
||||
void at91_lcd_hw_init(void)
|
||||
{
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 24, 0); /* LCDPWM */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 25, 0); /* LCDDISP */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 26, 0); /* LCDVSYNC */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 27, 0); /* LCDHSYNC */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 28, 0); /* LCDDOTCK */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 29, 0); /* LCDDEN */
|
||||
|
||||
/* The lower 16-bit of LCD only available on Port A */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 0, 0); /* LCDD0 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 1, 0); /* LCDD1 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 2, 0); /* LCDD2 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 3, 0); /* LCDD3 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 4, 0); /* LCDD4 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 5, 0); /* LCDD5 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 6, 0); /* LCDD6 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 7, 0); /* LCDD7 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 8, 0); /* LCDD8 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 9, 0); /* LCDD9 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 10, 0); /* LCDD10 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 11, 0); /* LCDD11 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 12, 0); /* LCDD12 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 13, 0); /* LCDD13 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 14, 0); /* LCDD14 */
|
||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 15, 0); /* LCDD15 */
|
||||
|
||||
/* Enable clock */
|
||||
at91_periph_clk_enable(ATMEL_ID_LCDC);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_GADGET_ATMEL_USBA
|
||||
void at91_udp_hw_init(void)
|
||||
{
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include <linux/list.h>
|
||||
#include <linux/fb.h>
|
||||
#include <lcd.h>
|
||||
|
||||
#define PANEL_NAME_SIZE (32)
|
||||
|
||||
|
|
|
@ -310,7 +310,7 @@ void arch_preboot_os(void)
|
|||
/* disable video before launching O/S */
|
||||
ipuv3_fb_shutdown();
|
||||
#endif
|
||||
#if defined(CONFIG_VIDEO_MXS) && !defined(CONFIG_DM_VIDEO)
|
||||
#if defined(CONFIG_VIDEO_MXS) && !defined(CONFIG_VIDEO)
|
||||
lcdif_power_down();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -249,7 +249,7 @@ config TARGET_KOSAGI_NOVENA
|
|||
select DM_MMC
|
||||
select PCI
|
||||
select DM_SCSI
|
||||
select DM_VIDEO
|
||||
select VIDEO
|
||||
select OF_CONTROL
|
||||
select SUPPORT_SPL
|
||||
imply CMD_DM
|
||||
|
|
|
@ -598,7 +598,7 @@ const struct boot_mode soc_boot_modes[] = {
|
|||
void reset_misc(void)
|
||||
{
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
#if defined(CONFIG_VIDEO_MXS) && !defined(CONFIG_DM_VIDEO)
|
||||
#if defined(CONFIG_VIDEO_MXS) && !defined(CONFIG_VIDEO)
|
||||
lcdif_power_down();
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -447,7 +447,7 @@ int boot_mode_getprisec(void)
|
|||
void reset_misc(void)
|
||||
{
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
#if defined(CONFIG_VIDEO_MXS) && !defined(CONFIG_DM_VIDEO)
|
||||
#if defined(CONFIG_VIDEO_MXS) && !defined(CONFIG_VIDEO)
|
||||
lcdif_power_down();
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -8,14 +8,7 @@
|
|||
#ifndef _NX__DISPLAY_DEV_H_
|
||||
#define _NX__DISPLAY_DEV_H_
|
||||
|
||||
#if !defined(CONFIG_DM_VIDEO) && defined(CONFIG_LCD)
|
||||
#include <lcd.h>
|
||||
#endif
|
||||
|
||||
struct nx_display_dev {
|
||||
#if !defined(CONFIG_DM_VIDEO) && defined(CONFIG_LCD)
|
||||
vidinfo_t *panel_info;
|
||||
#endif
|
||||
unsigned long base;
|
||||
int module;
|
||||
struct dp_sync_info sync;
|
||||
|
|
|
@ -94,8 +94,8 @@ config TARGET_AM335X_GUARDIAN
|
|||
select DM
|
||||
select DM_SERIAL
|
||||
select DM_GPIO
|
||||
select DM_VIDEO
|
||||
select DM_PANEL_HX8238D
|
||||
select VIDEO
|
||||
select PANEL_HX8238D
|
||||
|
||||
config TARGET_AM335X_SL50
|
||||
bool "Support am335x_sl50"
|
||||
|
|
|
@ -227,10 +227,6 @@ void enable_basic_clocks(void)
|
|||
&cmper->usb0clkctrl,
|
||||
&cmper->emiffwclkctrl,
|
||||
&cmper->emifclkctrl,
|
||||
#if CONFIG_IS_ENABLED(AM335X_LCD) && !CONFIG_IS_ENABLED(DM_VIDEO)
|
||||
&cmper->lcdclkctrl,
|
||||
&cmper->lcdcclkstctrl,
|
||||
#endif
|
||||
0
|
||||
};
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ static int do_stm32prog(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||
}
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_DM_VIDEO))
|
||||
if (IS_ENABLED(CONFIG_VIDEO))
|
||||
enable_vidconsole();
|
||||
|
||||
data = (struct stm32prog_data *)malloc(sizeof(*data));
|
||||
|
|
|
@ -788,7 +788,7 @@ config VIDEO_SUNXI
|
|||
depends on !MACH_SUN9I
|
||||
depends on !MACH_SUN50I
|
||||
depends on !SUN50I_GEN_H6
|
||||
select DM_VIDEO
|
||||
select VIDEO
|
||||
select DISPLAY
|
||||
imply VIDEO_DT_SIMPLEFB
|
||||
default y
|
||||
|
@ -853,7 +853,7 @@ config VIDEO_LCD_MODE
|
|||
|
||||
config VIDEO_LCD_DCLK_PHASE
|
||||
int "LCD panel display clock phase"
|
||||
depends on VIDEO_SUNXI || DM_VIDEO
|
||||
depends on VIDEO_SUNXI || VIDEO
|
||||
default 1
|
||||
range 0 3
|
||||
---help---
|
||||
|
@ -928,7 +928,7 @@ config SUNXI_DE2
|
|||
config VIDEO_DE2
|
||||
bool "Display Engine 2 video driver"
|
||||
depends on SUNXI_DE2
|
||||
select DM_VIDEO
|
||||
select VIDEO
|
||||
select DISPLAY
|
||||
select VIDEO_DW_HDMI
|
||||
imply VIDEO_DT_SIMPLEFB
|
||||
|
|
|
@ -134,7 +134,7 @@ int board_init(void)
|
|||
#endif
|
||||
|
||||
/* Init is handled automatically in the driver-model case */
|
||||
#if defined(CONFIG_DM_VIDEO)
|
||||
#if defined(CONFIG_VIDEO)
|
||||
pin_mux_display();
|
||||
#endif
|
||||
/* boot param addr */
|
||||
|
@ -158,7 +158,7 @@ int board_init(void)
|
|||
pin_mux_usb();
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_DM_VIDEO)
|
||||
#if defined(CONFIG_VIDEO)
|
||||
board_id = tegra_board_id();
|
||||
err = tegra_lcd_pmic_init(board_id);
|
||||
if (err) {
|
||||
|
|
|
@ -703,7 +703,7 @@ config VBT_ADDR
|
|||
|
||||
config VIDEO_FSP
|
||||
bool "Enable FSP framebuffer driver support"
|
||||
depends on HAVE_VBT && DM_VIDEO
|
||||
depends on HAVE_VBT && VIDEO
|
||||
help
|
||||
Turn on this option to enable a framebuffer driver when U-Boot is
|
||||
using Video BIOS Table (VBT) image for FSP firmware to initialize
|
||||
|
|
|
@ -164,21 +164,12 @@ int board_late_init(void)
|
|||
br_resetc_bmode();
|
||||
|
||||
/* setup othbootargs for bootvx-command (vxWorks bootline) */
|
||||
#ifdef CONFIG_LCD
|
||||
snprintf(othbootargs, sizeof(othbootargs),
|
||||
"u=vxWorksFTP pw=vxWorks o=0x%08x;0x%08x;0x%08x;0x%08x",
|
||||
(u32)gd->fb_base - 0x20,
|
||||
(u32)env_get_ulong("vx_memtop", 16, gd->fb_base - 0x20),
|
||||
(u32)env_get_ulong("vx_romfsbase", 16, 0),
|
||||
(u32)env_get_ulong("vx_romfssize", 16, 0));
|
||||
#else
|
||||
snprintf(othbootargs, sizeof(othbootargs),
|
||||
"u=vxWorksFTP pw=vxWorks o=0x%08x;0x%08x;0x%08x;0x%08x",
|
||||
(u32)gd->relocaddr,
|
||||
(u32)env_get_ulong("vx_memtop", 16, gd->relocaddr),
|
||||
(u32)env_get_ulong("vx_romfsbase", 16, 0),
|
||||
(u32)env_get_ulong("vx_romfssize", 16, 0));
|
||||
#endif
|
||||
env_set("othbootargs", othbootargs);
|
||||
/*
|
||||
* reset VBAR registers to its reset location, VxWorks 6.9.3.2 does
|
||||
|
|
|
@ -23,14 +23,8 @@
|
|||
#define BMODE_PME 12
|
||||
#define BMODE_DIAG 15
|
||||
|
||||
#if CONFIG_IS_ENABLED(LCD) && !CONFIG_IS_ENABLED(DM_VIDEO)
|
||||
#include <lcd.h>
|
||||
#define LCD_SETCURSOR(x, y) lcd_position_cursor(x, y)
|
||||
#define LCD_PUTS(x) lcd_puts(x)
|
||||
#else
|
||||
#define LCD_SETCURSOR(x, y)
|
||||
#define LCD_PUTS(x)
|
||||
#endif /* CONFIG_LCD */
|
||||
|
||||
static const char *bootmodeascii[16] = {
|
||||
"BOOT", "reserved", "reserved", "reserved",
|
||||
|
|
|
@ -11,12 +11,6 @@
|
|||
#ifndef _BUR_COMMON_H_
|
||||
#define _BUR_COMMON_H_
|
||||
|
||||
#if !CONFIG_IS_ENABLED(DM_VIDEO)
|
||||
#include <../../../drivers/video/ti/am335x-fb.h>
|
||||
|
||||
int load_lcdtiming(struct am335x_lcdpanel *panel);
|
||||
#endif
|
||||
|
||||
void br_summaryscreen(void);
|
||||
void pmicsetup(u32 mpupll, unsigned int bus);
|
||||
void enable_uart0_pin_mux(void);
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <env.h>
|
||||
#include <fdtdec.h>
|
||||
#include <i2c.h>
|
||||
#include <lcd.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <linux/delay.h>
|
||||
#include "bur_common.h"
|
||||
|
@ -22,230 +21,6 @@
|
|||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* --------------------------------------------------------------------------*/
|
||||
#if defined(CONFIG_LCD) && defined(CONFIG_AM335X_LCD) && \
|
||||
!defined(CONFIG_DM_VIDEO) && !defined(CONFIG_SPL_BUILD)
|
||||
#include <asm/arch/hardware.h>
|
||||
#include <asm/arch/cpu.h>
|
||||
#include <asm/gpio.h>
|
||||
#include <power/tps65217.h>
|
||||
#include "../../../drivers/video/ti/am335x-fb.h"
|
||||
|
||||
void lcdbacklight(int on)
|
||||
{
|
||||
unsigned int driver = env_get_ulong("ds1_bright_drv", 16, 0UL);
|
||||
unsigned int bright = env_get_ulong("ds1_bright_def", 10, 50);
|
||||
unsigned int pwmfrq = env_get_ulong("ds1_pwmfreq", 10, ~0UL);
|
||||
unsigned int tmp;
|
||||
struct gptimer *timerhw;
|
||||
|
||||
if (on)
|
||||
bright = bright != ~0UL ? bright : 50;
|
||||
else
|
||||
bright = 0;
|
||||
|
||||
switch (driver) {
|
||||
case 2:
|
||||
timerhw = (struct gptimer *)DM_TIMER5_BASE;
|
||||
break;
|
||||
default:
|
||||
timerhw = (struct gptimer *)DM_TIMER6_BASE;
|
||||
}
|
||||
|
||||
switch (driver) {
|
||||
case 0: /* PMIC LED-Driver */
|
||||
/* brightness level */
|
||||
tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
|
||||
TPS65217_WLEDCTRL2, bright, 0xFF);
|
||||
/* current sink */
|
||||
tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
|
||||
TPS65217_WLEDCTRL1,
|
||||
bright != 0 ? 0x0A : 0x02,
|
||||
0xFF);
|
||||
break;
|
||||
case 1:
|
||||
case 2: /* PWM using timer */
|
||||
if (pwmfrq != ~0UL) {
|
||||
timerhw->tiocp_cfg = TCFG_RESET;
|
||||
udelay(10);
|
||||
while (timerhw->tiocp_cfg & TCFG_RESET)
|
||||
;
|
||||
tmp = ~0UL-(V_OSCK/pwmfrq); /* bottom value */
|
||||
timerhw->tldr = tmp;
|
||||
timerhw->tcrr = tmp;
|
||||
tmp = tmp + ((V_OSCK/pwmfrq)/100) * bright;
|
||||
timerhw->tmar = tmp;
|
||||
timerhw->tclr = (TCLR_PT | (2 << TCLR_TRG_SHIFT) |
|
||||
TCLR_CE | TCLR_AR | TCLR_ST);
|
||||
} else {
|
||||
puts("invalid pwmfrq in env/dtb! skip PWM-setup.\n");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
puts("no suitable backlightdriver in env/dtb!\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int load_lcdtiming(struct am335x_lcdpanel *panel)
|
||||
{
|
||||
struct am335x_lcdpanel pnltmp;
|
||||
|
||||
pnltmp.hactive = env_get_ulong("ds1_hactive", 10, ~0UL);
|
||||
pnltmp.vactive = env_get_ulong("ds1_vactive", 10, ~0UL);
|
||||
pnltmp.bpp = env_get_ulong("ds1_bpp", 10, ~0UL);
|
||||
pnltmp.hfp = env_get_ulong("ds1_hfp", 10, ~0UL);
|
||||
pnltmp.hbp = env_get_ulong("ds1_hbp", 10, ~0UL);
|
||||
pnltmp.hsw = env_get_ulong("ds1_hsw", 10, ~0UL);
|
||||
pnltmp.vfp = env_get_ulong("ds1_vfp", 10, ~0UL);
|
||||
pnltmp.vbp = env_get_ulong("ds1_vbp", 10, ~0UL);
|
||||
pnltmp.vsw = env_get_ulong("ds1_vsw", 10, ~0UL);
|
||||
pnltmp.pxl_clk = env_get_ulong("ds1_pxlclk", 10, ~0UL);
|
||||
pnltmp.pol = env_get_ulong("ds1_pol", 16, ~0UL);
|
||||
pnltmp.pup_delay = env_get_ulong("ds1_pupdelay", 10, ~0UL);
|
||||
pnltmp.pon_delay = env_get_ulong("ds1_tondelay", 10, ~0UL);
|
||||
panel_info.vl_rot = env_get_ulong("ds1_rotation", 10, 0);
|
||||
|
||||
if (
|
||||
~0UL == (pnltmp.hactive) ||
|
||||
~0UL == (pnltmp.vactive) ||
|
||||
~0UL == (pnltmp.bpp) ||
|
||||
~0UL == (pnltmp.hfp) ||
|
||||
~0UL == (pnltmp.hbp) ||
|
||||
~0UL == (pnltmp.hsw) ||
|
||||
~0UL == (pnltmp.vfp) ||
|
||||
~0UL == (pnltmp.vbp) ||
|
||||
~0UL == (pnltmp.vsw) ||
|
||||
~0UL == (pnltmp.pxl_clk) ||
|
||||
~0UL == (pnltmp.pol) ||
|
||||
~0UL == (pnltmp.pup_delay) ||
|
||||
~0UL == (pnltmp.pon_delay)
|
||||
) {
|
||||
puts("lcd-settings in env/dtb incomplete!\n");
|
||||
printf("display-timings:\n"
|
||||
"================\n"
|
||||
"hactive: %d\n"
|
||||
"vactive: %d\n"
|
||||
"bpp : %d\n"
|
||||
"hfp : %d\n"
|
||||
"hbp : %d\n"
|
||||
"hsw : %d\n"
|
||||
"vfp : %d\n"
|
||||
"vbp : %d\n"
|
||||
"vsw : %d\n"
|
||||
"pxlclk : %d\n"
|
||||
"pol : 0x%08x\n"
|
||||
"pondly : %d\n",
|
||||
pnltmp.hactive, pnltmp.vactive, pnltmp.bpp,
|
||||
pnltmp.hfp, pnltmp.hbp, pnltmp.hsw,
|
||||
pnltmp.vfp, pnltmp.vbp, pnltmp.vsw,
|
||||
pnltmp.pxl_clk, pnltmp.pol, pnltmp.pon_delay);
|
||||
|
||||
return -1;
|
||||
}
|
||||
debug("lcd-settings in env complete, taking over.\n");
|
||||
memcpy((void *)panel,
|
||||
(void *)&pnltmp,
|
||||
sizeof(struct am335x_lcdpanel));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void br_summaryscreen_printenv(char *prefix,
|
||||
char *name, char *altname,
|
||||
char *suffix)
|
||||
{
|
||||
char *envval = env_get(name);
|
||||
if (0 != envval) {
|
||||
lcd_printf("%s %s %s", prefix, envval, suffix);
|
||||
} else if (0 != altname) {
|
||||
envval = env_get(altname);
|
||||
if (0 != envval)
|
||||
lcd_printf("%s %s %s", prefix, envval, suffix);
|
||||
} else {
|
||||
lcd_printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
void br_summaryscreen(void)
|
||||
{
|
||||
br_summaryscreen_printenv(" - B&R -", "br_orderno", 0, "-\n");
|
||||
br_summaryscreen_printenv(" Serial/Rev :", "br_serial", 0, "\n");
|
||||
br_summaryscreen_printenv(" MAC1 :", "br_mac1", "ethaddr", "\n");
|
||||
br_summaryscreen_printenv(" MAC2 :", "br_mac2", 0, "\n");
|
||||
lcd_puts(" Bootloader : " PLAIN_VERSION "\n");
|
||||
lcd_puts("\n");
|
||||
}
|
||||
|
||||
void lcdpower(int on)
|
||||
{
|
||||
u32 pin, swval, i;
|
||||
char buf[16] = { 0 };
|
||||
|
||||
pin = env_get_ulong("ds1_pwr", 16, ~0UL);
|
||||
|
||||
if (pin == ~0UL) {
|
||||
puts("no pwrpin in dtb/env, cannot powerup display!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (pin != 0) {
|
||||
snprintf(buf, sizeof(buf), "ds1_pwr#%d", i);
|
||||
if (gpio_request(pin & 0x7F, buf) != 0) {
|
||||
printf("%s: not able to request gpio %s",
|
||||
__func__, buf);
|
||||
continue;
|
||||
}
|
||||
swval = pin & 0x80 ? 0 : 1;
|
||||
if (on)
|
||||
gpio_direction_output(pin & 0x7F, swval);
|
||||
else
|
||||
gpio_direction_output(pin & 0x7F, !swval);
|
||||
|
||||
debug("switched pin %d to %d\n", pin & 0x7F, swval);
|
||||
}
|
||||
pin >>= 8;
|
||||
}
|
||||
}
|
||||
|
||||
vidinfo_t panel_info = {
|
||||
.vl_col = 1366, /*
|
||||
* give full resolution for allocating enough
|
||||
* memory
|
||||
*/
|
||||
.vl_row = 768,
|
||||
.vl_bpix = 5,
|
||||
.priv = 0
|
||||
};
|
||||
|
||||
void lcd_ctrl_init(void *lcdbase)
|
||||
{
|
||||
struct am335x_lcdpanel lcd_panel;
|
||||
|
||||
memset(&lcd_panel, 0, sizeof(struct am335x_lcdpanel));
|
||||
if (load_lcdtiming(&lcd_panel) != 0)
|
||||
return;
|
||||
|
||||
lcd_panel.panel_power_ctrl = &lcdpower;
|
||||
|
||||
if (0 != am335xfb_init(&lcd_panel))
|
||||
printf("ERROR: failed to initialize video!");
|
||||
/*
|
||||
* modifiy panel info to 'real' resolution, to operate correct with
|
||||
* lcd-framework.
|
||||
*/
|
||||
panel_info.vl_col = lcd_panel.hactive;
|
||||
panel_info.vl_row = lcd_panel.vactive;
|
||||
|
||||
lcd_set_flush_dcache(1);
|
||||
}
|
||||
|
||||
void lcd_enable(void)
|
||||
{
|
||||
br_summaryscreen();
|
||||
lcdbacklight(1);
|
||||
}
|
||||
#endif /* CONFIG_LCD */
|
||||
|
||||
int ft_board_setup(void *blob, struct bd_info *bd)
|
||||
{
|
||||
|
|
|
@ -21,11 +21,6 @@
|
|||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#if IS_ENABLED(CONFIG_VIDEO_VCXK)
|
||||
extern unsigned long display_width;
|
||||
extern unsigned long display_height;
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
int checkboard (void)
|
||||
|
@ -184,84 +179,7 @@ void __led_set(led_id_t mask, int state)
|
|||
MCFGPTA_GPTPORT &= ~(1 << 3);
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_VIDEO_VCXK)
|
||||
int drv_video_init(void)
|
||||
{
|
||||
char *s;
|
||||
#ifdef CONFIG_SPLASH_SCREEN
|
||||
unsigned long splash;
|
||||
#endif
|
||||
printf("Init Video as ");
|
||||
s = env_get("displaywidth");
|
||||
if (s != NULL)
|
||||
display_width = dectoul(s, NULL);
|
||||
else
|
||||
display_width = 256;
|
||||
|
||||
s = env_get("displayheight");
|
||||
if (s != NULL)
|
||||
display_height = dectoul(s, NULL);
|
||||
else
|
||||
display_height = 256;
|
||||
|
||||
printf("%lu x %lu pixel matrix\n", display_width, display_height);
|
||||
|
||||
MCFCCM_CCR &= ~MCFCCM_CCR_SZEN;
|
||||
MCFGPIO_PEPAR &= ~MCFGPIO_PEPAR_PEPA2;
|
||||
|
||||
vcxk_init(display_width, display_height);
|
||||
|
||||
#ifdef CONFIG_SPLASH_SCREEN
|
||||
s = env_get("splashimage");
|
||||
if (s != NULL) {
|
||||
splash = hextoul(s, NULL);
|
||||
vcxk_acknowledge_wait();
|
||||
video_display_bitmap(splash, 0, 0);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#if IS_ENABLED(CONFIG_VIDEO_VCXK)
|
||||
int do_brightness(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||
{
|
||||
int rcode = 0;
|
||||
ulong side;
|
||||
ulong bright;
|
||||
|
||||
switch (argc) {
|
||||
case 3:
|
||||
side = dectoul(argv[1], NULL);
|
||||
bright = dectoul(argv[2], NULL);
|
||||
if ((side >= 0) && (side <= 3) &&
|
||||
(bright >= 0) && (bright <= 1000)) {
|
||||
vcxk_setbrightness(side, bright);
|
||||
rcode = 0;
|
||||
} else {
|
||||
printf("parameters out of range\n");
|
||||
printf("Usage:\n%s\n", cmdtp->usage);
|
||||
rcode = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf("Usage:\n%s\n", cmdtp->usage);
|
||||
rcode = 1;
|
||||
break;
|
||||
}
|
||||
return rcode;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
U_BOOT_CMD(
|
||||
bright, 3, 0, do_brightness,
|
||||
"sets the display brightness\n",
|
||||
" <side> <0..1000>\n side: 0/3=both; 1=first; 2=second\n"
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
/* EOF EB+MCF-EV123.c */
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
* Author: Fabio Estevam <fabio.estevam@freescale.com>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <bmp_layout.h>
|
||||
#include <command.h>
|
||||
#include <image.h>
|
||||
#include <init.h>
|
||||
|
@ -33,12 +35,12 @@
|
|||
#include <i2c.h>
|
||||
#include <micrel.h>
|
||||
#include <miiphy.h>
|
||||
#include <lcd.h>
|
||||
#include <led.h>
|
||||
#include <power/pmic.h>
|
||||
#include <power/regulator.h>
|
||||
#include <power/da9063_pmic.h>
|
||||
#include <splash.h>
|
||||
#include <video.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <asm/arch/at91_rstc.h>
|
||||
#include <asm/arch/clk.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
#include <lcd.h>
|
||||
#include <atmel_lcdc.h>
|
||||
#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_DRIVER_DM9000)
|
||||
#include <net.h>
|
||||
|
@ -133,97 +132,6 @@ static void at91sam9261ek_dm9000_hw_init(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD
|
||||
vidinfo_t panel_info = {
|
||||
.vl_col = 240,
|
||||
.vl_row = 320,
|
||||
.vl_clk = 4965000,
|
||||
.vl_sync = ATMEL_LCDC_INVLINE_INVERTED |
|
||||
ATMEL_LCDC_INVFRAME_INVERTED,
|
||||
.vl_bpix = 3,
|
||||
.vl_tft = 1,
|
||||
.vl_hsync_len = 5,
|
||||
.vl_left_margin = 1,
|
||||
.vl_right_margin = 33,
|
||||
.vl_vsync_len = 1,
|
||||
.vl_upper_margin = 1,
|
||||
.vl_lower_margin = 0,
|
||||
.mmio = ATMEL_BASE_LCDC,
|
||||
};
|
||||
|
||||
void lcd_enable(void)
|
||||
{
|
||||
at91_set_gpio_value(AT91_PIN_PA12, 0); /* power up */
|
||||
}
|
||||
|
||||
void lcd_disable(void)
|
||||
{
|
||||
at91_set_gpio_value(AT91_PIN_PA12, 1); /* power down */
|
||||
}
|
||||
|
||||
static void at91sam9261ek_lcd_hw_init(void)
|
||||
{
|
||||
at91_set_A_periph(AT91_PIN_PB1, 0); /* LCDHSYNC */
|
||||
at91_set_A_periph(AT91_PIN_PB2, 0); /* LCDDOTCK */
|
||||
at91_set_A_periph(AT91_PIN_PB3, 0); /* LCDDEN */
|
||||
at91_set_A_periph(AT91_PIN_PB4, 0); /* LCDCC */
|
||||
at91_set_A_periph(AT91_PIN_PB7, 0); /* LCDD2 */
|
||||
at91_set_A_periph(AT91_PIN_PB8, 0); /* LCDD3 */
|
||||
at91_set_A_periph(AT91_PIN_PB9, 0); /* LCDD4 */
|
||||
at91_set_A_periph(AT91_PIN_PB10, 0); /* LCDD5 */
|
||||
at91_set_A_periph(AT91_PIN_PB11, 0); /* LCDD6 */
|
||||
at91_set_A_periph(AT91_PIN_PB12, 0); /* LCDD7 */
|
||||
at91_set_A_periph(AT91_PIN_PB15, 0); /* LCDD10 */
|
||||
at91_set_A_periph(AT91_PIN_PB16, 0); /* LCDD11 */
|
||||
at91_set_A_periph(AT91_PIN_PB17, 0); /* LCDD12 */
|
||||
at91_set_A_periph(AT91_PIN_PB18, 0); /* LCDD13 */
|
||||
at91_set_A_periph(AT91_PIN_PB19, 0); /* LCDD14 */
|
||||
at91_set_A_periph(AT91_PIN_PB20, 0); /* LCDD15 */
|
||||
at91_set_B_periph(AT91_PIN_PB23, 0); /* LCDD18 */
|
||||
at91_set_B_periph(AT91_PIN_PB24, 0); /* LCDD19 */
|
||||
at91_set_B_periph(AT91_PIN_PB25, 0); /* LCDD20 */
|
||||
at91_set_B_periph(AT91_PIN_PB26, 0); /* LCDD21 */
|
||||
at91_set_B_periph(AT91_PIN_PB27, 0); /* LCDD22 */
|
||||
at91_set_B_periph(AT91_PIN_PB28, 0); /* LCDD23 */
|
||||
|
||||
at91_system_clk_enable(AT91_PMC_HCK1);
|
||||
|
||||
/* For 9G10EK, let U-Boot allocate the framebuffer in SDRAM */
|
||||
#ifdef CONFIG_AT91SAM9261EK
|
||||
gd->fb_base = ATMEL_BASE_SRAM;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LCD_INFO
|
||||
#include <nand.h>
|
||||
#include <version.h>
|
||||
|
||||
void lcd_show_board_info(void)
|
||||
{
|
||||
ulong dram_size, nand_size;
|
||||
int i;
|
||||
char temp[32];
|
||||
|
||||
lcd_printf ("%s\n", U_BOOT_VERSION);
|
||||
lcd_printf ("(C) 2008 ATMEL Corp\n");
|
||||
lcd_printf ("at91support@atmel.com\n");
|
||||
lcd_printf ("%s CPU at %s MHz\n",
|
||||
ATMEL_CPU_NAME,
|
||||
strmhz(temp, get_cpu_clk_rate()));
|
||||
|
||||
dram_size = 0;
|
||||
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
|
||||
dram_size += gd->bd->bi_dram[i].size;
|
||||
nand_size = 0;
|
||||
for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
|
||||
nand_size += get_nand_dev_by_index(i)->size;
|
||||
lcd_printf (" %ld MB SDRAM, %ld MB NAND\n",
|
||||
dram_size >> 20,
|
||||
nand_size >> 20 );
|
||||
}
|
||||
#endif /* CONFIG_LCD_INFO */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_UART_BOARD_INIT
|
||||
void board_debug_uart_init(void)
|
||||
{
|
||||
|
@ -255,9 +163,6 @@ int board_init(void)
|
|||
#endif
|
||||
#ifdef CONFIG_DRIVER_DM9000
|
||||
at91sam9261ek_dm9000_hw_init();
|
||||
#endif
|
||||
#ifdef CONFIG_LCD
|
||||
at91sam9261ek_lcd_hw_init();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include <asm/io.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include <lcd.h>
|
||||
#include <atmel_lcdc.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
|
@ -77,110 +76,6 @@ static void at91sam9263ek_nand_hw_init(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD
|
||||
vidinfo_t panel_info = {
|
||||
.vl_col = 240,
|
||||
.vl_row = 320,
|
||||
.vl_clk = 4965000,
|
||||
.vl_sync = ATMEL_LCDC_INVLINE_INVERTED |
|
||||
ATMEL_LCDC_INVFRAME_INVERTED,
|
||||
.vl_bpix = 3,
|
||||
.vl_tft = 1,
|
||||
.vl_hsync_len = 5,
|
||||
.vl_left_margin = 1,
|
||||
.vl_right_margin = 33,
|
||||
.vl_vsync_len = 1,
|
||||
.vl_upper_margin = 1,
|
||||
.vl_lower_margin = 0,
|
||||
.mmio = ATMEL_BASE_LCDC,
|
||||
};
|
||||
|
||||
void lcd_enable(void)
|
||||
{
|
||||
at91_set_pio_value(AT91_PIO_PORTA, 30, 1); /* power up */
|
||||
}
|
||||
|
||||
void lcd_disable(void)
|
||||
{
|
||||
at91_set_pio_value(AT91_PIO_PORTA, 30, 0); /* power down */
|
||||
}
|
||||
|
||||
static void at91sam9263ek_lcd_hw_init(void)
|
||||
{
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 1, 0); /* LCDHSYNC */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 2, 0); /* LCDDOTCK */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 3, 0); /* LCDDEN */
|
||||
at91_set_b_periph(AT91_PIO_PORTB, 9, 0); /* LCDCC */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 6, 0); /* LCDD2 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 7, 0); /* LCDD3 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 8, 0); /* LCDD4 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 9, 0); /* LCDD5 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 10, 0); /* LCDD6 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 11, 0); /* LCDD7 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 14, 0); /* LCDD10 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 15, 0); /* LCDD11 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 16, 0); /* LCDD12 */
|
||||
at91_set_b_periph(AT91_PIO_PORTC, 12, 0); /* LCDD13 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 18, 0); /* LCDD14 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 19, 0); /* LCDD15 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 22, 0); /* LCDD18 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 23, 0); /* LCDD19 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 24, 0); /* LCDD20 */
|
||||
at91_set_b_periph(AT91_PIO_PORTC, 17, 0); /* LCDD21 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 26, 0); /* LCDD22 */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 27, 0); /* LCDD23 */
|
||||
|
||||
at91_periph_clk_enable(ATMEL_ID_LCDC);
|
||||
gd->fb_base = ATMEL_BASE_SRAM0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LCD_INFO
|
||||
#include <nand.h>
|
||||
#include <version.h>
|
||||
|
||||
#ifdef CONFIG_MTD_NOR_FLASH
|
||||
#include <flash.h>
|
||||
#endif
|
||||
|
||||
void lcd_show_board_info(void)
|
||||
{
|
||||
ulong dram_size, nand_size;
|
||||
#ifdef CONFIG_MTD_NOR_FLASH
|
||||
ulong flash_size;
|
||||
#endif
|
||||
int i;
|
||||
char temp[32];
|
||||
|
||||
lcd_printf ("%s\n", U_BOOT_VERSION);
|
||||
lcd_printf ("(C) 2008 ATMEL Corp\n");
|
||||
lcd_printf ("at91support@atmel.com\n");
|
||||
lcd_printf ("%s CPU at %s MHz\n",
|
||||
ATMEL_CPU_NAME,
|
||||
strmhz(temp, get_cpu_clk_rate()));
|
||||
|
||||
dram_size = 0;
|
||||
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
|
||||
dram_size += gd->bd->bi_dram[i].size;
|
||||
nand_size = 0;
|
||||
for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
|
||||
nand_size += get_nand_dev_by_index(i)->size;
|
||||
#ifdef CONFIG_MTD_NOR_FLASH
|
||||
flash_size = 0;
|
||||
for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++)
|
||||
flash_size += flash_info[i].size;
|
||||
#endif
|
||||
lcd_printf (" %ld MB SDRAM, %ld MB NAND",
|
||||
dram_size >> 20,
|
||||
nand_size >> 20 );
|
||||
#ifdef CONFIG_MTD_NOR_FLASH
|
||||
lcd_printf (",\n %ld MB NOR",
|
||||
flash_size >> 20);
|
||||
#endif
|
||||
lcd_puts ("\n");
|
||||
}
|
||||
#endif /* CONFIG_LCD_INFO */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_UART_BOARD_INIT
|
||||
void board_debug_uart_init(void)
|
||||
{
|
||||
|
@ -207,9 +102,6 @@ int board_init(void)
|
|||
#endif
|
||||
#ifdef CONFIG_USB_OHCI_NEW
|
||||
at91_uhp_hw_init();
|
||||
#endif
|
||||
#ifdef CONFIG_LCD
|
||||
at91sam9263ek_lcd_hw_init();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <asm/arch/at91_common.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
#include <asm/arch/clk.h>
|
||||
#include <lcd.h>
|
||||
#include <linux/mtd/rawnand.h>
|
||||
#include <atmel_lcdc.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
@ -149,105 +148,6 @@ static void at91sam9m10g45ek_usb_hw_init(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD
|
||||
|
||||
vidinfo_t panel_info = {
|
||||
.vl_col = 480,
|
||||
.vl_row = 272,
|
||||
.vl_clk = 9000000,
|
||||
.vl_sync = ATMEL_LCDC_INVLINE_NORMAL |
|
||||
ATMEL_LCDC_INVFRAME_NORMAL,
|
||||
.vl_bpix = 3,
|
||||
.vl_tft = 1,
|
||||
.vl_hsync_len = 45,
|
||||
.vl_left_margin = 1,
|
||||
.vl_right_margin = 1,
|
||||
.vl_vsync_len = 1,
|
||||
.vl_upper_margin = 40,
|
||||
.vl_lower_margin = 1,
|
||||
.mmio = ATMEL_BASE_LCDC,
|
||||
};
|
||||
|
||||
|
||||
void lcd_enable(void)
|
||||
{
|
||||
at91_set_A_periph(AT91_PIN_PE6, 1); /* power up */
|
||||
}
|
||||
|
||||
void lcd_disable(void)
|
||||
{
|
||||
at91_set_A_periph(AT91_PIN_PE6, 0); /* power down */
|
||||
}
|
||||
|
||||
static void at91sam9m10g45ek_lcd_hw_init(void)
|
||||
{
|
||||
at91_set_A_periph(AT91_PIN_PE0, 0); /* LCDDPWR */
|
||||
at91_set_A_periph(AT91_PIN_PE2, 0); /* LCDCC */
|
||||
at91_set_A_periph(AT91_PIN_PE3, 0); /* LCDVSYNC */
|
||||
at91_set_A_periph(AT91_PIN_PE4, 0); /* LCDHSYNC */
|
||||
at91_set_A_periph(AT91_PIN_PE5, 0); /* LCDDOTCK */
|
||||
|
||||
at91_set_A_periph(AT91_PIN_PE7, 0); /* LCDD0 */
|
||||
at91_set_A_periph(AT91_PIN_PE8, 0); /* LCDD1 */
|
||||
at91_set_A_periph(AT91_PIN_PE9, 0); /* LCDD2 */
|
||||
at91_set_A_periph(AT91_PIN_PE10, 0); /* LCDD3 */
|
||||
at91_set_A_periph(AT91_PIN_PE11, 0); /* LCDD4 */
|
||||
at91_set_A_periph(AT91_PIN_PE12, 0); /* LCDD5 */
|
||||
at91_set_A_periph(AT91_PIN_PE13, 0); /* LCDD6 */
|
||||
at91_set_A_periph(AT91_PIN_PE14, 0); /* LCDD7 */
|
||||
at91_set_A_periph(AT91_PIN_PE15, 0); /* LCDD8 */
|
||||
at91_set_A_periph(AT91_PIN_PE16, 0); /* LCDD9 */
|
||||
at91_set_A_periph(AT91_PIN_PE17, 0); /* LCDD10 */
|
||||
at91_set_A_periph(AT91_PIN_PE18, 0); /* LCDD11 */
|
||||
at91_set_A_periph(AT91_PIN_PE19, 0); /* LCDD12 */
|
||||
at91_set_B_periph(AT91_PIN_PE20, 0); /* LCDD13 */
|
||||
at91_set_A_periph(AT91_PIN_PE21, 0); /* LCDD14 */
|
||||
at91_set_A_periph(AT91_PIN_PE22, 0); /* LCDD15 */
|
||||
at91_set_A_periph(AT91_PIN_PE23, 0); /* LCDD16 */
|
||||
at91_set_A_periph(AT91_PIN_PE24, 0); /* LCDD17 */
|
||||
at91_set_A_periph(AT91_PIN_PE25, 0); /* LCDD18 */
|
||||
at91_set_A_periph(AT91_PIN_PE26, 0); /* LCDD19 */
|
||||
at91_set_A_periph(AT91_PIN_PE27, 0); /* LCDD20 */
|
||||
at91_set_B_periph(AT91_PIN_PE28, 0); /* LCDD21 */
|
||||
at91_set_A_periph(AT91_PIN_PE29, 0); /* LCDD22 */
|
||||
at91_set_A_periph(AT91_PIN_PE30, 0); /* LCDD23 */
|
||||
|
||||
at91_periph_clk_enable(ATMEL_ID_LCDC);
|
||||
|
||||
/* board specific(not enough SRAM) */
|
||||
gd->fb_base = 0x73E00000;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LCD_INFO
|
||||
#include <nand.h>
|
||||
#include <version.h>
|
||||
|
||||
void lcd_show_board_info(void)
|
||||
{
|
||||
ulong dram_size, nand_size;
|
||||
int i;
|
||||
char temp[32];
|
||||
|
||||
lcd_printf ("%s\n", U_BOOT_VERSION);
|
||||
lcd_printf ("(C) 2008 ATMEL Corp\n");
|
||||
lcd_printf ("at91support@atmel.com\n");
|
||||
lcd_printf ("%s CPU at %s MHz\n",
|
||||
ATMEL_CPU_NAME,
|
||||
strmhz(temp, get_cpu_clk_rate()));
|
||||
|
||||
dram_size = 0;
|
||||
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
|
||||
dram_size += gd->bd->bi_dram[i].size;
|
||||
nand_size = 0;
|
||||
for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
|
||||
nand_size += get_nand_dev_by_index(i)->size;
|
||||
lcd_printf (" %ld MB SDRAM, %ld MB NAND\n",
|
||||
dram_size >> 20,
|
||||
nand_size >> 20 );
|
||||
}
|
||||
#endif /* CONFIG_LCD_INFO */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_UART_BOARD_INIT
|
||||
void board_debug_uart_init(void)
|
||||
{
|
||||
|
@ -275,9 +175,6 @@ int board_init(void)
|
|||
#endif
|
||||
#ifdef CONFIG_CMD_USB
|
||||
at91sam9m10g45ek_usb_hw_init();
|
||||
#endif
|
||||
#ifdef CONFIG_LCD
|
||||
at91sam9m10g45ek_lcd_hw_init();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -17,15 +17,9 @@
|
|||
#include <asm/arch/at91_pio.h>
|
||||
#include <asm/arch/clk.h>
|
||||
#include <debug_uart.h>
|
||||
#include <lcd.h>
|
||||
#include <atmel_hlcdc.h>
|
||||
#include <netdev.h>
|
||||
|
||||
#ifdef CONFIG_LCD_INFO
|
||||
#include <nand.h>
|
||||
#include <version.h>
|
||||
#endif
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -81,60 +75,6 @@ static void at91sam9n12ek_nand_hw_init(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD
|
||||
vidinfo_t panel_info = {
|
||||
.vl_col = 480,
|
||||
.vl_row = 272,
|
||||
.vl_clk = 9000000,
|
||||
.vl_bpix = LCD_BPP,
|
||||
.vl_sync = 0,
|
||||
.vl_tft = 1,
|
||||
.vl_hsync_len = 5,
|
||||
.vl_left_margin = 8,
|
||||
.vl_right_margin = 43,
|
||||
.vl_vsync_len = 10,
|
||||
.vl_upper_margin = 4,
|
||||
.vl_lower_margin = 12,
|
||||
.mmio = ATMEL_BASE_LCDC,
|
||||
};
|
||||
|
||||
void lcd_enable(void)
|
||||
{
|
||||
at91_set_pio_output(AT91_PIO_PORTC, 25, 0); /* power up */
|
||||
}
|
||||
|
||||
void lcd_disable(void)
|
||||
{
|
||||
at91_set_pio_output(AT91_PIO_PORTC, 25, 1); /* power down */
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LCD_INFO
|
||||
void lcd_show_board_info(void)
|
||||
{
|
||||
ulong dram_size, nand_size;
|
||||
int i;
|
||||
char temp[32];
|
||||
|
||||
lcd_printf("%s\n", U_BOOT_VERSION);
|
||||
lcd_printf("ATMEL Corp\n");
|
||||
lcd_printf("at91@atmel.com\n");
|
||||
lcd_printf("%s CPU at %s MHz\n",
|
||||
ATMEL_CPU_NAME,
|
||||
strmhz(temp, get_cpu_clk_rate()));
|
||||
|
||||
dram_size = 0;
|
||||
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
|
||||
dram_size += gd->bd->bi_dram[i].size;
|
||||
nand_size = 0;
|
||||
for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
|
||||
nand_size += get_nand_dev_by_index(i)->size;
|
||||
lcd_printf(" %ld MB SDRAM, %ld MB NAND\n",
|
||||
dram_size >> 20,
|
||||
nand_size >> 20);
|
||||
}
|
||||
#endif /* CONFIG_LCD_INFO */
|
||||
#endif /* CONFIG_LCD */
|
||||
|
||||
#ifdef CONFIG_USB_ATMEL
|
||||
void at91sam9n12ek_usb_hw_init(void)
|
||||
{
|
||||
|
@ -165,10 +105,6 @@ int board_init(void)
|
|||
at91sam9n12ek_nand_hw_init();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD
|
||||
at91_lcd_hw_init();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_ATMEL
|
||||
at91sam9n12ek_usb_hw_init();
|
||||
#endif
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include <asm/arch/clk.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
|
||||
#include <lcd.h>
|
||||
#include <atmel_lcdc.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
@ -75,90 +74,6 @@ static void at91sam9rlek_nand_hw_init(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD
|
||||
vidinfo_t panel_info = {
|
||||
.vl_col = 240,
|
||||
.vl_row = 320,
|
||||
.vl_clk = 4965000,
|
||||
.vl_sync = ATMEL_LCDC_INVLINE_INVERTED |
|
||||
ATMEL_LCDC_INVFRAME_INVERTED,
|
||||
.vl_bpix = 3,
|
||||
.vl_tft = 1,
|
||||
.vl_hsync_len = 5,
|
||||
.vl_left_margin = 1,
|
||||
.vl_right_margin = 33,
|
||||
.vl_vsync_len = 1,
|
||||
.vl_upper_margin = 1,
|
||||
.vl_lower_margin = 0,
|
||||
.mmio = ATMEL_BASE_LCDC,
|
||||
};
|
||||
|
||||
void lcd_enable(void)
|
||||
{
|
||||
at91_set_gpio_value(AT91_PIN_PA30, 0); /* power up */
|
||||
}
|
||||
|
||||
void lcd_disable(void)
|
||||
{
|
||||
at91_set_gpio_value(AT91_PIN_PA30, 1); /* power down */
|
||||
}
|
||||
static void at91sam9rlek_lcd_hw_init(void)
|
||||
{
|
||||
at91_set_B_periph(AT91_PIN_PC1, 0); /* LCDPWR */
|
||||
at91_set_A_periph(AT91_PIN_PC5, 0); /* LCDHSYNC */
|
||||
at91_set_A_periph(AT91_PIN_PC6, 0); /* LCDDOTCK */
|
||||
at91_set_A_periph(AT91_PIN_PC7, 0); /* LCDDEN */
|
||||
at91_set_A_periph(AT91_PIN_PC3, 0); /* LCDCC */
|
||||
at91_set_B_periph(AT91_PIN_PC9, 0); /* LCDD3 */
|
||||
at91_set_B_periph(AT91_PIN_PC10, 0); /* LCDD4 */
|
||||
at91_set_B_periph(AT91_PIN_PC11, 0); /* LCDD5 */
|
||||
at91_set_B_periph(AT91_PIN_PC12, 0); /* LCDD6 */
|
||||
at91_set_B_periph(AT91_PIN_PC13, 0); /* LCDD7 */
|
||||
at91_set_B_periph(AT91_PIN_PC15, 0); /* LCDD11 */
|
||||
at91_set_B_periph(AT91_PIN_PC16, 0); /* LCDD12 */
|
||||
at91_set_B_periph(AT91_PIN_PC17, 0); /* LCDD13 */
|
||||
at91_set_B_periph(AT91_PIN_PC18, 0); /* LCDD14 */
|
||||
at91_set_B_periph(AT91_PIN_PC19, 0); /* LCDD15 */
|
||||
at91_set_B_periph(AT91_PIN_PC20, 0); /* LCDD18 */
|
||||
at91_set_B_periph(AT91_PIN_PC21, 0); /* LCDD19 */
|
||||
at91_set_B_periph(AT91_PIN_PC22, 0); /* LCDD20 */
|
||||
at91_set_B_periph(AT91_PIN_PC23, 0); /* LCDD21 */
|
||||
at91_set_B_periph(AT91_PIN_PC24, 0); /* LCDD22 */
|
||||
at91_set_B_periph(AT91_PIN_PC25, 0); /* LCDD23 */
|
||||
|
||||
at91_periph_clk_enable(ATMEL_ID_LCDC);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LCD_INFO
|
||||
#include <nand.h>
|
||||
#include <version.h>
|
||||
|
||||
void lcd_show_board_info(void)
|
||||
{
|
||||
ulong dram_size, nand_size;
|
||||
int i;
|
||||
char temp[32];
|
||||
|
||||
lcd_printf ("%s\n", U_BOOT_VERSION);
|
||||
lcd_printf ("(C) 2008 ATMEL Corp\n");
|
||||
lcd_printf ("at91support@atmel.com\n");
|
||||
lcd_printf ("%s CPU at %s MHz\n",
|
||||
ATMEL_CPU_NAME,
|
||||
strmhz(temp, get_cpu_clk_rate()));
|
||||
|
||||
dram_size = 0;
|
||||
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
|
||||
dram_size += gd->bd->bi_dram[i].size;
|
||||
nand_size = 0;
|
||||
for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
|
||||
nand_size += get_nand_dev_by_index(i)->size;
|
||||
lcd_printf (" %ld MB SDRAM, %ld MB NAND\n",
|
||||
dram_size >> 20,
|
||||
nand_size >> 20 );
|
||||
}
|
||||
#endif /* CONFIG_LCD_INFO */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_UART_BOARD_INIT
|
||||
void board_debug_uart_init(void)
|
||||
{
|
||||
|
@ -182,9 +97,6 @@ int board_init(void)
|
|||
|
||||
#ifdef CONFIG_CMD_NAND
|
||||
at91sam9rlek_nand_hw_init();
|
||||
#endif
|
||||
#ifdef CONFIG_LCD
|
||||
at91sam9rlek_lcd_hw_init();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ static void at91sam9x5ek_nand_hw_init(void)
|
|||
#ifdef CONFIG_BOARD_LATE_INIT
|
||||
int board_late_init(void)
|
||||
{
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
at91_video_show_board_info();
|
||||
#endif
|
||||
at91_prepare_cpu_var();
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
obj-y += board.o
|
||||
obj-$(CONFIG_I2C_EEPROM) += mac_eeprom.o
|
||||
obj-$(CONFIG_SPI_FLASH_SFDP_SUPPORT) += mac-spi-nor.o
|
||||
obj-$(CONFIG_DM_VIDEO) += video_display.o
|
||||
obj-$(CONFIG_VIDEO) += video_display.o
|
||||
|
|
|
@ -39,7 +39,7 @@ static void board_usb_hw_init(void)
|
|||
#ifdef CONFIG_BOARD_LATE_INIT
|
||||
int board_late_init(void)
|
||||
{
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
at91_video_show_board_info();
|
||||
#endif
|
||||
at91_pda_detect();
|
||||
|
|
|
@ -32,7 +32,7 @@ static void rgb_leds_init(void)
|
|||
#ifdef CONFIG_BOARD_LATE_INIT
|
||||
int board_late_init(void)
|
||||
{
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
at91_video_show_board_info();
|
||||
#endif
|
||||
at91_pda_detect();
|
||||
|
|
|
@ -38,7 +38,7 @@ static void board_usb_hw_init(void)
|
|||
#ifdef CONFIG_BOARD_LATE_INIT
|
||||
int board_late_init(void)
|
||||
{
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
at91_video_show_board_info();
|
||||
#endif
|
||||
at91_pda_detect();
|
||||
|
|
|
@ -186,7 +186,7 @@ int board_late_init(void)
|
|||
strcat(name, "ek.dtb");
|
||||
env_set("dtb_name", name);
|
||||
#endif
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
at91_video_show_board_info();
|
||||
#endif
|
||||
return 0;
|
||||
|
|
|
@ -76,7 +76,7 @@ static void sama5d4_xplained_usb_hw_init(void)
|
|||
int board_late_init(void)
|
||||
{
|
||||
at91_pda_detect();
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
at91_video_show_board_info();
|
||||
#endif
|
||||
return 0;
|
||||
|
|
|
@ -74,7 +74,7 @@ static void sama5d4ek_usb_hw_init(void)
|
|||
#ifdef CONFIG_BOARD_LATE_INIT
|
||||
int board_late_init(void)
|
||||
{
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
at91_video_show_board_info();
|
||||
#endif
|
||||
return 0;
|
||||
|
|
|
@ -4,4 +4,4 @@
|
|||
# Patrick Bruenn <p.bruenn@beckhoff.com>
|
||||
|
||||
obj-y += mx53cx9020.o
|
||||
obj-$(CONFIG_DM_VIDEO) += mx53cx9020_video.o
|
||||
obj-$(CONFIG_VIDEO) += mx53cx9020_video.o
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <dm.h>
|
||||
#include <env.h>
|
||||
#include <init.h>
|
||||
#include <lcd.h>
|
||||
#include <net.h>
|
||||
#ifndef CONFIG_DM_ETH
|
||||
#include <netdev.h>
|
||||
|
@ -140,7 +139,7 @@ static void lcd_splash(int width, int height)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
static void at91sam9g45_lcd_hw_init(void)
|
||||
{
|
||||
at91_set_A_periph(AT91_PIN_PE0, 0); /* LCDDPWR */
|
||||
|
@ -338,7 +337,7 @@ int board_init(void)
|
|||
at91_mci_hw_init();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
at91sam9g45_lcd_hw_init();
|
||||
at91_set_A_periph(AT91_PIN_PE6, 1); /* power up */
|
||||
|
||||
|
|
|
@ -254,74 +254,6 @@ void lcdbacklight_en(void)
|
|||
brightness != 0 ? 0x0A : 0x02, 0xFF);
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_AM335X_LCD)
|
||||
static void splash_screen(void)
|
||||
{
|
||||
struct udevice *video_dev;
|
||||
struct udevice *console_dev;
|
||||
struct video_priv *vid_priv;
|
||||
struct mtd_info *mtd;
|
||||
size_t len;
|
||||
int ret;
|
||||
|
||||
struct mtd_device *mtd_dev;
|
||||
struct part_info *part;
|
||||
u8 pnum;
|
||||
|
||||
ret = uclass_get_device(UCLASS_VIDEO, 0, &video_dev);
|
||||
if (ret != 0) {
|
||||
debug("video device not found\n");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
vid_priv = dev_get_uclass_priv(video_dev);
|
||||
mtdparts_init();
|
||||
|
||||
if (find_dev_and_part(SPLASH_SCREEN_NAND_PART, &mtd_dev, &pnum, &part)) {
|
||||
debug("Could not find nand partition\n");
|
||||
goto splash_screen_text;
|
||||
}
|
||||
|
||||
mtd = get_nand_dev_by_index(mtd_dev->id->num);
|
||||
if (!mtd) {
|
||||
debug("MTD partition is not valid\n");
|
||||
goto splash_screen_text;
|
||||
}
|
||||
|
||||
len = SPLASH_SCREEN_BMP_FILE_SIZE;
|
||||
ret = nand_read_skip_bad(mtd, part->offset, &len, NULL,
|
||||
SPLASH_SCREEN_BMP_FILE_SIZE,
|
||||
(u_char *)SPLASH_SCREEN_BMP_LOAD_ADDR);
|
||||
if (ret != 0) {
|
||||
debug("Reading NAND partition failed\n");
|
||||
goto splash_screen_text;
|
||||
}
|
||||
|
||||
ret = video_bmp_display(video_dev, SPLASH_SCREEN_BMP_LOAD_ADDR, 0, 0, false);
|
||||
if (ret != 0) {
|
||||
debug("No valid bmp image found!!\n");
|
||||
goto splash_screen_text;
|
||||
} else {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
splash_screen_text:
|
||||
vid_priv->colour_fg = CONSOLE_COLOR_RED;
|
||||
vid_priv->colour_bg = CONSOLE_COLOR_BLACK;
|
||||
|
||||
if (!uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &console_dev)) {
|
||||
debug("Found console\n");
|
||||
vidconsole_position_cursor(console_dev, 17, 7);
|
||||
vidconsole_put_string(console_dev, SPLASH_SCREEN_TEXT);
|
||||
} else {
|
||||
debug("No console device found\n");
|
||||
}
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_AM335X_LCD */
|
||||
|
||||
int board_late_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
@ -340,8 +272,6 @@ int board_late_init(void)
|
|||
return 0;
|
||||
|
||||
lcdbacklight_en();
|
||||
if (IS_ENABLED(CONFIG_AM335X_LCD))
|
||||
splash_screen();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ void pin_mux_mmc(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
/* this is a weak define that we are overriding */
|
||||
void pin_mux_display(void)
|
||||
{
|
||||
|
|
|
@ -6,5 +6,4 @@
|
|||
|
||||
obj-y += common.o
|
||||
obj-$(CONFIG_$(SPL_)SYS_I2C_LEGACY) += eeprom.o
|
||||
obj-$(CONFIG_LCD) += omap3_display.o
|
||||
obj-$(CONFIG_SMC911X) += omap3_smc911x.o
|
||||
|
|
|
@ -1,452 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2012 - 2013 CompuLab, Ltd. <www.compulab.co.il>
|
||||
*
|
||||
* Authors: Nikita Kiryanov <nikita@compulab.co.il>
|
||||
*
|
||||
* Parsing code based on linux/drivers/video/pxafb.c
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/io.h>
|
||||
#include <env.h>
|
||||
#include <stdio_dev.h>
|
||||
#include <asm/arch/dss.h>
|
||||
#include <lcd.h>
|
||||
#include <scf0403_lcd.h>
|
||||
#include <asm/arch-omap3/dss.h>
|
||||
|
||||
enum display_type {
|
||||
NONE,
|
||||
DVI,
|
||||
DVI_CUSTOM,
|
||||
DATA_IMAGE, /* #define CONFIG_SCF0403_LCD to use */
|
||||
};
|
||||
|
||||
#define CMAP_ADDR 0x80100000
|
||||
|
||||
/*
|
||||
* The frame buffer is allocated before we have the chance to parse user input.
|
||||
* To make sure enough memory is allocated for all resolutions, we define
|
||||
* vl_{col | row} to the maximal resolution supported by OMAP3.
|
||||
*/
|
||||
vidinfo_t panel_info = {
|
||||
.vl_col = 1400,
|
||||
.vl_row = 1050,
|
||||
.vl_bpix = LCD_BPP,
|
||||
.cmap = (ushort *)CMAP_ADDR,
|
||||
};
|
||||
|
||||
static struct panel_config panel_cfg;
|
||||
static enum display_type lcd_def;
|
||||
|
||||
/*
|
||||
* A note on DVI presets;
|
||||
* U-Boot can convert 8 bit BMP data to 16 bit BMP data, and OMAP DSS can
|
||||
* convert 16 bit data into 24 bit data. Thus, GFXFORMAT_RGB16 allows us to
|
||||
* support two BMP types with one setting.
|
||||
*/
|
||||
static const struct panel_config preset_dvi_640X480 = {
|
||||
.lcd_size = PANEL_LCD_SIZE(640, 480),
|
||||
.timing_h = DSS_HBP(48) | DSS_HFP(16) | DSS_HSW(96),
|
||||
.timing_v = DSS_VBP(33) | DSS_VFP(10) | DSS_VSW(2),
|
||||
.pol_freq = DSS_IHS | DSS_IVS | DSS_IPC,
|
||||
.divisor = 12 | (1 << 16),
|
||||
.data_lines = LCD_INTERFACE_24_BIT,
|
||||
.panel_type = ACTIVE_DISPLAY,
|
||||
.load_mode = 2,
|
||||
.gfx_format = GFXFORMAT_RGB16,
|
||||
};
|
||||
|
||||
static const struct panel_config preset_dvi_800X600 = {
|
||||
.lcd_size = PANEL_LCD_SIZE(800, 600),
|
||||
.timing_h = DSS_HBP(88) | DSS_HFP(40) | DSS_HSW(128),
|
||||
.timing_v = DSS_VBP(23) | DSS_VFP(1) | DSS_VSW(4),
|
||||
.pol_freq = DSS_IHS | DSS_IVS | DSS_IPC,
|
||||
.divisor = 8 | (1 << 16),
|
||||
.data_lines = LCD_INTERFACE_24_BIT,
|
||||
.panel_type = ACTIVE_DISPLAY,
|
||||
.load_mode = 2,
|
||||
.gfx_format = GFXFORMAT_RGB16,
|
||||
};
|
||||
|
||||
static const struct panel_config preset_dvi_1024X768 = {
|
||||
.lcd_size = PANEL_LCD_SIZE(1024, 768),
|
||||
.timing_h = DSS_HBP(160) | DSS_HFP(24) | DSS_HSW(136),
|
||||
.timing_v = DSS_VBP(29) | DSS_VFP(3) | DSS_VSW(6),
|
||||
.pol_freq = DSS_IHS | DSS_IVS | DSS_IPC,
|
||||
.divisor = 5 | (1 << 16),
|
||||
.data_lines = LCD_INTERFACE_24_BIT,
|
||||
.panel_type = ACTIVE_DISPLAY,
|
||||
.load_mode = 2,
|
||||
.gfx_format = GFXFORMAT_RGB16,
|
||||
};
|
||||
|
||||
static const struct panel_config preset_dvi_1152X864 = {
|
||||
.lcd_size = PANEL_LCD_SIZE(1152, 864),
|
||||
.timing_h = DSS_HBP(256) | DSS_HFP(64) | DSS_HSW(128),
|
||||
.timing_v = DSS_VBP(32) | DSS_VFP(1) | DSS_VSW(3),
|
||||
.pol_freq = DSS_IHS | DSS_IVS | DSS_IPC,
|
||||
.divisor = 4 | (1 << 16),
|
||||
.data_lines = LCD_INTERFACE_24_BIT,
|
||||
.panel_type = ACTIVE_DISPLAY,
|
||||
.load_mode = 2,
|
||||
.gfx_format = GFXFORMAT_RGB16,
|
||||
};
|
||||
|
||||
static const struct panel_config preset_dvi_1280X960 = {
|
||||
.lcd_size = PANEL_LCD_SIZE(1280, 960),
|
||||
.timing_h = DSS_HBP(312) | DSS_HFP(96) | DSS_HSW(112),
|
||||
.timing_v = DSS_VBP(36) | DSS_VFP(1) | DSS_VSW(3),
|
||||
.pol_freq = DSS_IHS | DSS_IVS | DSS_IPC,
|
||||
.divisor = 3 | (1 << 16),
|
||||
.data_lines = LCD_INTERFACE_24_BIT,
|
||||
.panel_type = ACTIVE_DISPLAY,
|
||||
.load_mode = 2,
|
||||
.gfx_format = GFXFORMAT_RGB16,
|
||||
};
|
||||
|
||||
static const struct panel_config preset_dvi_1280X1024 = {
|
||||
.lcd_size = PANEL_LCD_SIZE(1280, 1024),
|
||||
.timing_h = DSS_HBP(248) | DSS_HFP(48) | DSS_HSW(112),
|
||||
.timing_v = DSS_VBP(38) | DSS_VFP(1) | DSS_VSW(3),
|
||||
.pol_freq = DSS_IHS | DSS_IVS | DSS_IPC,
|
||||
.divisor = 3 | (1 << 16),
|
||||
.data_lines = LCD_INTERFACE_24_BIT,
|
||||
.panel_type = ACTIVE_DISPLAY,
|
||||
.load_mode = 2,
|
||||
.gfx_format = GFXFORMAT_RGB16,
|
||||
};
|
||||
|
||||
static const struct panel_config preset_dataimage_480X800 = {
|
||||
.lcd_size = PANEL_LCD_SIZE(480, 800),
|
||||
.timing_h = DSS_HBP(2) | DSS_HFP(2) | DSS_HSW(2),
|
||||
.timing_v = DSS_VBP(17) | DSS_VFP(20) | DSS_VSW(3),
|
||||
.pol_freq = DSS_IVS | DSS_IHS | DSS_IPC | DSS_ONOFF,
|
||||
.divisor = 10 | (1 << 10),
|
||||
.data_lines = LCD_INTERFACE_18_BIT,
|
||||
.panel_type = ACTIVE_DISPLAY,
|
||||
.load_mode = 2,
|
||||
.gfx_format = GFXFORMAT_RGB16,
|
||||
};
|
||||
|
||||
/*
|
||||
* set_resolution_params()
|
||||
*
|
||||
* Due to usage of multiple display related APIs resolution data is located in
|
||||
* more than one place. This function updates them all.
|
||||
*/
|
||||
static void set_resolution_params(int x, int y)
|
||||
{
|
||||
panel_cfg.lcd_size = PANEL_LCD_SIZE(x, y);
|
||||
panel_info.vl_col = x;
|
||||
panel_info.vl_row = y;
|
||||
lcd_line_length = (panel_info.vl_col * NBITS(panel_info.vl_bpix)) / 8;
|
||||
}
|
||||
|
||||
static void set_preset(const struct panel_config preset, int x_res, int y_res)
|
||||
{
|
||||
panel_cfg = preset;
|
||||
set_resolution_params(x_res, y_res);
|
||||
}
|
||||
|
||||
static enum display_type set_dvi_preset(const struct panel_config preset,
|
||||
int x_res, int y_res)
|
||||
{
|
||||
set_preset(preset, x_res, y_res);
|
||||
return DVI;
|
||||
}
|
||||
|
||||
static enum display_type set_dataimage_preset(const struct panel_config preset,
|
||||
int x_res, int y_res)
|
||||
{
|
||||
set_preset(preset, x_res, y_res);
|
||||
return DATA_IMAGE;
|
||||
}
|
||||
|
||||
/*
|
||||
* parse_mode() - parse the mode parameter of custom lcd settings
|
||||
*
|
||||
* @mode: <res_x>x<res_y>
|
||||
*
|
||||
* Returns -1 on error, 0 on success.
|
||||
*/
|
||||
static int parse_mode(const char *mode)
|
||||
{
|
||||
unsigned int modelen = strlen(mode);
|
||||
int res_specified = 0;
|
||||
unsigned int xres = 0, yres = 0;
|
||||
int yres_specified = 0;
|
||||
int i;
|
||||
|
||||
for (i = modelen - 1; i >= 0; i--) {
|
||||
switch (mode[i]) {
|
||||
case 'x':
|
||||
if (!yres_specified) {
|
||||
yres = simple_strtoul(&mode[i + 1], NULL, 0);
|
||||
yres_specified = 1;
|
||||
} else {
|
||||
goto done_parsing;
|
||||
}
|
||||
|
||||
break;
|
||||
case '0' ... '9':
|
||||
break;
|
||||
default:
|
||||
goto done_parsing;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < 0 && yres_specified) {
|
||||
xres = simple_strtoul(mode, NULL, 0);
|
||||
res_specified = 1;
|
||||
}
|
||||
|
||||
done_parsing:
|
||||
if (res_specified) {
|
||||
set_resolution_params(xres, yres);
|
||||
} else {
|
||||
printf("LCD: invalid mode: %s\n", mode);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define PIXEL_CLK_NUMERATOR (26 * 432 / 39)
|
||||
/*
|
||||
* parse_pixclock() - Parse the pixclock parameter of custom lcd settings
|
||||
*
|
||||
* @pixclock: the desired pixel clock
|
||||
*
|
||||
* Returns -1 on error, 0 on success.
|
||||
*
|
||||
* Handling the pixel_clock:
|
||||
*
|
||||
* Pixel clock is defined in the OMAP35x TRM as follows:
|
||||
* pixel_clock =
|
||||
* (SYS_CLK * 2 * PRCM.CM_CLKSEL2_PLL[18:8]) /
|
||||
* (DSS.DISPC_DIVISOR[23:16] * DSS.DISPC_DIVISOR[6:0] *
|
||||
* PRCM.CM_CLKSEL_DSS[4:0] * (PRCM.CM_CLKSEL2_PLL[6:0] + 1))
|
||||
*
|
||||
* In practice, this means that in order to set the
|
||||
* divisor for the desired pixel clock one needs to
|
||||
* solve the following equation:
|
||||
*
|
||||
* 26 * 432 / (39 * <pixel_clock>) = DSS.DISPC_DIVISOR[6:0]
|
||||
*
|
||||
* NOTE: the explicit equation above is reduced. Do not
|
||||
* try to infer anything from these numbers.
|
||||
*/
|
||||
static int parse_pixclock(char *pixclock)
|
||||
{
|
||||
int divisor, pixclock_val;
|
||||
char *pixclk_start = pixclock;
|
||||
|
||||
pixclock_val = dectoul(pixclock, &pixclock);
|
||||
divisor = DIV_ROUND_UP(PIXEL_CLK_NUMERATOR, pixclock_val);
|
||||
/* 0 and 1 are illegal values for PCD */
|
||||
if (divisor <= 1)
|
||||
divisor = 2;
|
||||
|
||||
panel_cfg.divisor = divisor | (1 << 16);
|
||||
if (pixclock[0] != '\0') {
|
||||
printf("LCD: invalid value for pixclock:%s\n", pixclk_start);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* parse_setting() - parse a single setting of custom lcd parameters
|
||||
*
|
||||
* @setting: The custom lcd setting <name>:<value>
|
||||
*
|
||||
* Returns -1 on failure, 0 on success.
|
||||
*/
|
||||
static int parse_setting(char *setting)
|
||||
{
|
||||
int num_val;
|
||||
char *setting_start = setting;
|
||||
|
||||
if (!strncmp(setting, "mode:", 5)) {
|
||||
return parse_mode(setting + 5);
|
||||
} else if (!strncmp(setting, "pixclock:", 9)) {
|
||||
return parse_pixclock(setting + 9);
|
||||
} else if (!strncmp(setting, "left:", 5)) {
|
||||
num_val = simple_strtoul(setting + 5, &setting, 0);
|
||||
panel_cfg.timing_h |= DSS_HBP(num_val);
|
||||
} else if (!strncmp(setting, "right:", 6)) {
|
||||
num_val = simple_strtoul(setting + 6, &setting, 0);
|
||||
panel_cfg.timing_h |= DSS_HFP(num_val);
|
||||
} else if (!strncmp(setting, "upper:", 6)) {
|
||||
num_val = simple_strtoul(setting + 6, &setting, 0);
|
||||
panel_cfg.timing_v |= DSS_VBP(num_val);
|
||||
} else if (!strncmp(setting, "lower:", 6)) {
|
||||
num_val = simple_strtoul(setting + 6, &setting, 0);
|
||||
panel_cfg.timing_v |= DSS_VFP(num_val);
|
||||
} else if (!strncmp(setting, "hsynclen:", 9)) {
|
||||
num_val = simple_strtoul(setting + 9, &setting, 0);
|
||||
panel_cfg.timing_h |= DSS_HSW(num_val);
|
||||
} else if (!strncmp(setting, "vsynclen:", 9)) {
|
||||
num_val = simple_strtoul(setting + 9, &setting, 0);
|
||||
panel_cfg.timing_v |= DSS_VSW(num_val);
|
||||
} else if (!strncmp(setting, "hsync:", 6)) {
|
||||
if (simple_strtoul(setting + 6, &setting, 0) == 0)
|
||||
panel_cfg.pol_freq |= DSS_IHS;
|
||||
else
|
||||
panel_cfg.pol_freq &= ~DSS_IHS;
|
||||
} else if (!strncmp(setting, "vsync:", 6)) {
|
||||
if (simple_strtoul(setting + 6, &setting, 0) == 0)
|
||||
panel_cfg.pol_freq |= DSS_IVS;
|
||||
else
|
||||
panel_cfg.pol_freq &= ~DSS_IVS;
|
||||
} else if (!strncmp(setting, "outputen:", 9)) {
|
||||
if (simple_strtoul(setting + 9, &setting, 0) == 0)
|
||||
panel_cfg.pol_freq |= DSS_IEO;
|
||||
else
|
||||
panel_cfg.pol_freq &= ~DSS_IEO;
|
||||
} else if (!strncmp(setting, "pixclockpol:", 12)) {
|
||||
if (simple_strtoul(setting + 12, &setting, 0) == 0)
|
||||
panel_cfg.pol_freq |= DSS_IPC;
|
||||
else
|
||||
panel_cfg.pol_freq &= ~DSS_IPC;
|
||||
} else if (!strncmp(setting, "active", 6)) {
|
||||
panel_cfg.panel_type = ACTIVE_DISPLAY;
|
||||
return 0; /* Avoid sanity check below */
|
||||
} else if (!strncmp(setting, "passive", 7)) {
|
||||
panel_cfg.panel_type = PASSIVE_DISPLAY;
|
||||
return 0; /* Avoid sanity check below */
|
||||
} else if (!strncmp(setting, "display:", 8)) {
|
||||
if (!strncmp(setting + 8, "dvi", 3)) {
|
||||
lcd_def = DVI_CUSTOM;
|
||||
return 0; /* Avoid sanity check below */
|
||||
}
|
||||
} else {
|
||||
printf("LCD: unknown option %s\n", setting_start);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (setting[0] != '\0') {
|
||||
printf("LCD: invalid value for %s\n", setting_start);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* env_parse_customlcd() - parse custom lcd params from an environment variable.
|
||||
*
|
||||
* @custom_lcd_params: The environment variable containing the lcd params.
|
||||
*
|
||||
* Returns -1 on failure, 0 on success.
|
||||
*/
|
||||
static int parse_customlcd(char *custom_lcd_params)
|
||||
{
|
||||
char params_cpy[160];
|
||||
char *setting;
|
||||
|
||||
strncpy(params_cpy, custom_lcd_params, 160);
|
||||
setting = strtok(params_cpy, ",");
|
||||
while (setting) {
|
||||
if (parse_setting(setting) < 0)
|
||||
return -1;
|
||||
|
||||
setting = strtok(NULL, ",");
|
||||
}
|
||||
|
||||
/* Currently we don't support changing this via custom lcd params */
|
||||
panel_cfg.data_lines = LCD_INTERFACE_24_BIT;
|
||||
panel_cfg.gfx_format = GFXFORMAT_RGB16; /* See dvi predefines note */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* env_parse_displaytype() - parse display type.
|
||||
*
|
||||
* Parses the environment variable "displaytype", which contains the
|
||||
* name of the display type or preset, in which case it applies its
|
||||
* configurations.
|
||||
*
|
||||
* Returns the type of display that was specified.
|
||||
*/
|
||||
static enum display_type env_parse_displaytype(char *displaytype)
|
||||
{
|
||||
if (!strncmp(displaytype, "dvi640x480", 10))
|
||||
return set_dvi_preset(preset_dvi_640X480, 640, 480);
|
||||
else if (!strncmp(displaytype, "dvi800x600", 10))
|
||||
return set_dvi_preset(preset_dvi_800X600, 800, 600);
|
||||
else if (!strncmp(displaytype, "dvi1024x768", 11))
|
||||
return set_dvi_preset(preset_dvi_1024X768, 1024, 768);
|
||||
else if (!strncmp(displaytype, "dvi1152x864", 11))
|
||||
return set_dvi_preset(preset_dvi_1152X864, 1152, 864);
|
||||
else if (!strncmp(displaytype, "dvi1280x960", 11))
|
||||
return set_dvi_preset(preset_dvi_1280X960, 1280, 960);
|
||||
else if (!strncmp(displaytype, "dvi1280x1024", 12))
|
||||
return set_dvi_preset(preset_dvi_1280X1024, 1280, 1024);
|
||||
else if (!strncmp(displaytype, "dataimage480x800", 16))
|
||||
return set_dataimage_preset(preset_dataimage_480X800, 480, 800);
|
||||
|
||||
return NONE;
|
||||
}
|
||||
|
||||
void lcd_ctrl_init(void *lcdbase)
|
||||
{
|
||||
struct prcm *prcm = (struct prcm *)PRCM_BASE;
|
||||
char *custom_lcd;
|
||||
char *displaytype = env_get("displaytype");
|
||||
|
||||
if (displaytype == NULL)
|
||||
return;
|
||||
|
||||
lcd_def = env_parse_displaytype(displaytype);
|
||||
/* If we did not recognize the preset, check if it's an env variable */
|
||||
if (lcd_def == NONE) {
|
||||
custom_lcd = env_get(displaytype);
|
||||
if (custom_lcd == NULL || parse_customlcd(custom_lcd) < 0)
|
||||
return;
|
||||
}
|
||||
|
||||
panel_cfg.frame_buffer = lcdbase;
|
||||
omap3_dss_panel_config(&panel_cfg);
|
||||
/*
|
||||
* Pixel clock is defined with many divisions and only few
|
||||
* multiplications of the system clock. Since DSS FCLK divisor is set
|
||||
* to 16 by default, we need to set it to a smaller value, like 3
|
||||
* (chosen via trial and error).
|
||||
*/
|
||||
clrsetbits_le32(&prcm->clksel_dss, 0xF, 3);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SCF0403_LCD
|
||||
static void scf0403_enable(void)
|
||||
{
|
||||
gpio_direction_output(58, 1);
|
||||
scf0403_init(157);
|
||||
}
|
||||
#else
|
||||
static inline void scf0403_enable(void) {}
|
||||
#endif
|
||||
|
||||
void lcd_enable(void)
|
||||
{
|
||||
switch (lcd_def) {
|
||||
case NONE:
|
||||
return;
|
||||
case DVI:
|
||||
case DVI_CUSTOM:
|
||||
gpio_direction_output(54, 0); /* Turn on DVI */
|
||||
break;
|
||||
case DATA_IMAGE:
|
||||
scf0403_enable();
|
||||
break;
|
||||
}
|
||||
|
||||
omap3_dss_enable();
|
||||
}
|
||||
|
||||
void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue) {}
|
|
@ -112,7 +112,7 @@ int board_init(void)
|
|||
}
|
||||
|
||||
/* When sync with M33 is failed, use local driver to set for video */
|
||||
if (sync != 0 && IS_ENABLED(CONFIG_DM_VIDEO)) {
|
||||
if (sync != 0 && IS_ENABLED(CONFIG_VIDEO)) {
|
||||
mipi_dsi_mux_panel();
|
||||
mipi_dsi_panel_backlight();
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ int board_phy_config(struct phy_device *phydev)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
static iomux_v3_cfg_t const lcd_pads[] = {
|
||||
/* Use GPIO for Brightness adjustment, duty cycle = period. */
|
||||
MX6_PAD_GPIO1_IO08__GPIO1_IO08 | MUX_PAD_CTRL(NO_PAD_CTRL),
|
||||
|
|
|
@ -7,4 +7,4 @@
|
|||
# Jason Liu <r64343@freescale.com>
|
||||
|
||||
obj-y += mx53ppd.o
|
||||
obj-$(CONFIG_DM_VIDEO) += mx53ppd_video.o
|
||||
obj-$(CONFIG_VIDEO) += mx53ppd_video.o
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include <asm/arch/sama5d4.h>
|
||||
#include <atmel_hlcdc.h>
|
||||
#include <atmel_mci.h>
|
||||
#include <lcd.h>
|
||||
#include <mmc.h>
|
||||
#include <net.h>
|
||||
#include <netdev.h>
|
||||
|
|
|
@ -358,7 +358,7 @@ int board_late_init(void)
|
|||
return 0;
|
||||
|
||||
addr = hextoul(s, NULL);
|
||||
dst = malloc(CONFIG_SYS_VIDEO_LOGO_MAX_SIZE);
|
||||
dst = malloc(CONFIG_VIDEO_LOGO_MAX_SIZE);
|
||||
if (!dst)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -366,8 +366,8 @@ int board_late_init(void)
|
|||
if (ret < 0)
|
||||
goto splasherr;
|
||||
|
||||
len = CONFIG_SYS_VIDEO_LOGO_MAX_SIZE;
|
||||
ret = gunzip(dst + 2, CONFIG_SYS_VIDEO_LOGO_MAX_SIZE - 2,
|
||||
len = CONFIG_VIDEO_LOGO_MAX_SIZE;
|
||||
ret = gunzip(dst + 2, CONFIG_VIDEO_LOGO_MAX_SIZE - 2,
|
||||
(uchar *)addr, &len);
|
||||
if (ret) {
|
||||
printf("Error: no valid bmp or bmp.gz image at %lx\n", addr);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <lcd.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/funcmux.h>
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include <fdt_support.h>
|
||||
#include <fdt_simplefb.h>
|
||||
#include <init.h>
|
||||
#include <lcd.h>
|
||||
#include <memalign.h>
|
||||
#include <mmc.h>
|
||||
#include <asm/gpio.h>
|
||||
|
|
|
@ -69,115 +69,6 @@ static void pm9263_nand_hw_init(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD
|
||||
|
||||
#ifdef CONFIG_LCD_IN_PSRAM
|
||||
|
||||
#define PSRAM_CRE_PIN AT91_PIO_PORTB, 29
|
||||
#define PSRAM_CTRL_REG (PHYS_PSRAM + PHYS_PSRAM_SIZE - 2)
|
||||
|
||||
/* Initialize the PSRAM memory */
|
||||
static int pm9263_lcd_hw_psram_init(void)
|
||||
{
|
||||
unsigned long csa;
|
||||
struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC1;
|
||||
struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX;
|
||||
|
||||
/* Enable CS3 3.3v, no pull-ups */
|
||||
csa = readl(&matrix->csa[1]) | AT91_MATRIX_CSA_DBPUC |
|
||||
AT91_MATRIX_CSA_VDDIOMSEL_3_3V;
|
||||
|
||||
writel(csa, &matrix->csa[1]);
|
||||
|
||||
/* Configure SMC1 CS0 for PSRAM - 16-bit */
|
||||
writel(AT91_SMC_SETUP_NWE(0) | AT91_SMC_SETUP_NCS_WR(0) |
|
||||
AT91_SMC_SETUP_NRD(0) | AT91_SMC_SETUP_NCS_RD(0),
|
||||
&smc->cs[0].setup);
|
||||
|
||||
writel(AT91_SMC_PULSE_NWE(7) | AT91_SMC_PULSE_NCS_WR(7) |
|
||||
AT91_SMC_PULSE_NRD(2) | AT91_SMC_PULSE_NCS_RD(7),
|
||||
&smc->cs[0].pulse);
|
||||
|
||||
writel(AT91_SMC_CYCLE_NWE(8) | AT91_SMC_CYCLE_NRD(8),
|
||||
&smc->cs[0].cycle);
|
||||
|
||||
writel(AT91_SMC_MODE_DBW_16 | AT91_SMC_MODE_PMEN | AT91_SMC_MODE_PS_32,
|
||||
&smc->cs[0].mode);
|
||||
|
||||
/* setup PB29 as output */
|
||||
at91_set_pio_output(PSRAM_CRE_PIN, 1);
|
||||
|
||||
at91_set_pio_value(PSRAM_CRE_PIN, 0); /* set PSRAM_CRE_PIN to '0' */
|
||||
|
||||
/* PSRAM: write BCR */
|
||||
readw(PSRAM_CTRL_REG);
|
||||
readw(PSRAM_CTRL_REG);
|
||||
writew(1, PSRAM_CTRL_REG); /* 0 - RCR,1 - BCR */
|
||||
writew(0x9d4f, PSRAM_CTRL_REG); /* write the BCR */
|
||||
|
||||
/* write RCR of the PSRAM */
|
||||
readw(PSRAM_CTRL_REG);
|
||||
readw(PSRAM_CTRL_REG);
|
||||
writew(0, PSRAM_CTRL_REG); /* 0 - RCR,1 - BCR */
|
||||
/* set RCR; 0x10-async mode,0x90-page mode */
|
||||
writew(0x90, PSRAM_CTRL_REG);
|
||||
|
||||
/*
|
||||
* test to see if the PSRAM is MT45W2M16A or MT45W2M16B
|
||||
* MT45W2M16B - CRE must be 0
|
||||
* MT45W2M16A - CRE must be 1
|
||||
*/
|
||||
writew(0x1234, PHYS_PSRAM);
|
||||
writew(0x5678, PHYS_PSRAM + 2);
|
||||
|
||||
/* test if the chip is MT45W2M16B */
|
||||
if ((readw(PHYS_PSRAM) != 0x1234) || (readw(PHYS_PSRAM+2) != 0x5678)) {
|
||||
/* try with CRE=1 (MT45W2M16A) */
|
||||
at91_set_pio_value(PSRAM_CRE_PIN, 1); /* set PSRAM_CRE_PIN to '1' */
|
||||
|
||||
/* write RCR of the PSRAM */
|
||||
readw(PSRAM_CTRL_REG);
|
||||
readw(PSRAM_CTRL_REG);
|
||||
writew(0, PSRAM_CTRL_REG); /* 0 - RCR,1 - BCR */
|
||||
/* set RCR;0x10-async mode,0x90-page mode */
|
||||
writew(0x90, PSRAM_CTRL_REG);
|
||||
|
||||
|
||||
writew(0x1234, PHYS_PSRAM);
|
||||
writew(0x5678, PHYS_PSRAM+2);
|
||||
if ((readw(PHYS_PSRAM) != 0x1234)
|
||||
|| (readw(PHYS_PSRAM + 2) != 0x5678))
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
/* Bus matrix */
|
||||
writel(AT91_MATRIX_PRA_M5(3), &matrix->pr[5].a);
|
||||
writel(CONFIG_PSRAM_SCFG, &matrix->scfg[5]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void pm9263_lcd_hw_init(void)
|
||||
{
|
||||
/* Power Control */
|
||||
at91_set_pio_output(AT91_PIO_PORTA, 22, 1);
|
||||
at91_set_pio_value(AT91_PIO_PORTA, 22, 0); /* power down */
|
||||
|
||||
#ifdef CONFIG_LCD_IN_PSRAM
|
||||
/* initialize the PSRAM */
|
||||
int stat = pm9263_lcd_hw_psram_init();
|
||||
|
||||
gd->fb_base = (stat == 0) ? PHYS_PSRAM : ATMEL_BASE_SRAM0;
|
||||
#else
|
||||
gd->fb_base = ATMEL_BASE_SRAM0;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif /* CONFIG_LCD */
|
||||
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
return 0;
|
||||
|
@ -196,9 +87,6 @@ int board_init(void)
|
|||
#endif
|
||||
#ifdef CONFIG_USB_OHCI_NEW
|
||||
at91_uhp_hw_init();
|
||||
#endif
|
||||
#ifdef CONFIG_LCD
|
||||
pm9263_lcd_hw_init();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include <asm/arch/pinmux.h>
|
||||
#include <asm/arch/power.h>
|
||||
#include <asm/arch/system.h>
|
||||
#include <lcd.h>
|
||||
#include <i2c.h>
|
||||
#include <mmc.h>
|
||||
#include <stdio_dev.h>
|
||||
|
@ -262,10 +261,6 @@ int misc_init_r(void)
|
|||
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
|
||||
set_board_info();
|
||||
#endif
|
||||
#ifdef CONFIG_LCD_MENU
|
||||
keys_init();
|
||||
check_boot_mode();
|
||||
#endif
|
||||
#ifdef CONFIG_CMD_BMP
|
||||
if (panel_info.logo_on)
|
||||
draw_logo();
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <env.h>
|
||||
#include <lcd.h>
|
||||
#include <libtizen.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <linux/delay.h>
|
||||
|
@ -114,345 +113,6 @@ void set_board_info(void)
|
|||
}
|
||||
#endif /* CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG */
|
||||
|
||||
#ifdef CONFIG_LCD_MENU
|
||||
static int power_key_pressed(u32 reg)
|
||||
{
|
||||
struct udevice *dev;
|
||||
int ret;
|
||||
u32 status;
|
||||
u32 mask;
|
||||
|
||||
if (IS_ENABLED(CONFIG_TARGET_TRATS))
|
||||
ret = pmic_get("max8997-pmic", &dev);
|
||||
else if (IS_ENABLED(CONFIG_TARGET_TRATS2))
|
||||
ret = pmic_get("max77686-pmic", &dev);
|
||||
else if (IS_ENABLED(CONFIG_TARGET_S5PC210_UNIVERSAL))
|
||||
ret = pmic_get("max8998-pmic", &dev);
|
||||
else
|
||||
return 0;
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (reg == KEY_PWR_STATUS_REG)
|
||||
mask = KEY_PWR_STATUS_MASK;
|
||||
else
|
||||
mask = KEY_PWR_INTERRUPT_MASK;
|
||||
|
||||
status = pmic_reg_read(dev, reg);
|
||||
if (status < 0)
|
||||
return status;
|
||||
|
||||
return !!(status & mask);
|
||||
}
|
||||
|
||||
static int key_pressed(int key)
|
||||
{
|
||||
int value;
|
||||
|
||||
switch (key) {
|
||||
case KEY_POWER:
|
||||
value = power_key_pressed(KEY_PWR_INTERRUPT_REG);
|
||||
break;
|
||||
case KEY_VOLUMEUP:
|
||||
value = !gpio_get_value(KEY_VOL_UP_GPIO);
|
||||
break;
|
||||
case KEY_VOLUMEDOWN:
|
||||
value = !gpio_get_value(KEY_VOL_DOWN_GPIO);
|
||||
break;
|
||||
default:
|
||||
value = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LCD
|
||||
static int check_keys(void)
|
||||
{
|
||||
int keys = 0;
|
||||
|
||||
if (key_pressed(KEY_POWER))
|
||||
keys += KEY_POWER;
|
||||
if (key_pressed(KEY_VOLUMEUP))
|
||||
keys += KEY_VOLUMEUP;
|
||||
if (key_pressed(KEY_VOLUMEDOWN))
|
||||
keys += KEY_VOLUMEDOWN;
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
/*
|
||||
* 0 BOOT_MODE_INFO
|
||||
* 1 BOOT_MODE_THOR
|
||||
* 2 BOOT_MODE_UMS
|
||||
* 3 BOOT_MODE_DFU
|
||||
* 4 BOOT_MODE_EXIT
|
||||
*/
|
||||
static char *
|
||||
mode_name[BOOT_MODE_EXIT + 1][2] = {
|
||||
{"DEVICE", ""},
|
||||
{"THOR", "thor"},
|
||||
{"UMS", "ums"},
|
||||
{"DFU", "dfu"},
|
||||
{"GPT", "gpt"},
|
||||
{"ENV", "env"},
|
||||
{"EXIT", ""},
|
||||
};
|
||||
|
||||
static char *
|
||||
mode_info[BOOT_MODE_EXIT + 1] = {
|
||||
"info",
|
||||
"downloader",
|
||||
"mass storage",
|
||||
"firmware update",
|
||||
"restore",
|
||||
"default",
|
||||
"and run normal boot"
|
||||
};
|
||||
|
||||
static char *
|
||||
mode_cmd[BOOT_MODE_EXIT + 1] = {
|
||||
"",
|
||||
"thor 0 mmc 0",
|
||||
"ums 0 mmc 0",
|
||||
"dfu 0 mmc 0",
|
||||
"gpt write mmc 0 $partitions",
|
||||
"env default -a; saveenv",
|
||||
"",
|
||||
};
|
||||
|
||||
static void display_board_info(void)
|
||||
{
|
||||
#ifdef CONFIG_MMC
|
||||
struct mmc *mmc = find_mmc_device(0);
|
||||
#endif
|
||||
vidinfo_t *vid = &panel_info;
|
||||
|
||||
lcd_position_cursor(4, 4);
|
||||
|
||||
lcd_printf("%s\n\t", U_BOOT_VERSION);
|
||||
lcd_puts("\n\t\tBoard Info:\n");
|
||||
#ifdef CONFIG_SYS_BOARD
|
||||
lcd_printf("\tBoard name: %s\n", CONFIG_SYS_BOARD);
|
||||
#endif
|
||||
#ifdef CONFIG_REVISION_TAG
|
||||
lcd_printf("\tBoard rev: %u\n", get_board_rev());
|
||||
#endif
|
||||
lcd_printf("\tDRAM banks: %u\n", CONFIG_NR_DRAM_BANKS);
|
||||
lcd_printf("\tDRAM size: %u MB\n", gd->ram_size / SZ_1M);
|
||||
|
||||
#ifdef CONFIG_MMC
|
||||
if (mmc) {
|
||||
if (!mmc->capacity)
|
||||
mmc_init(mmc);
|
||||
|
||||
lcd_printf("\teMMC size: %llu MB\n", mmc->capacity / SZ_1M);
|
||||
}
|
||||
#endif
|
||||
if (vid)
|
||||
lcd_printf("\tDisplay resolution: %u x % u\n",
|
||||
vid->vl_col, vid->vl_row);
|
||||
|
||||
lcd_printf("\tDisplay BPP: %u\n", 1 << vid->vl_bpix);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int mode_leave_menu(int mode)
|
||||
{
|
||||
#ifdef CONFIG_LCD
|
||||
char *exit_option;
|
||||
char *exit_reset = "reset";
|
||||
char *exit_back = "back";
|
||||
struct cmd_tbl *cmd;
|
||||
int cmd_result;
|
||||
int leave;
|
||||
|
||||
lcd_clear();
|
||||
|
||||
switch (mode) {
|
||||
case BOOT_MODE_EXIT:
|
||||
return 1;
|
||||
case BOOT_MODE_INFO:
|
||||
display_board_info();
|
||||
exit_option = exit_back;
|
||||
leave = 0;
|
||||
break;
|
||||
default:
|
||||
cmd = find_cmd(mode_name[mode][1]);
|
||||
if (cmd) {
|
||||
printf("Enter: %s %s\n", mode_name[mode][0],
|
||||
mode_info[mode]);
|
||||
lcd_printf("\n\n\t%s %s\n", mode_name[mode][0],
|
||||
mode_info[mode]);
|
||||
lcd_puts("\n\tDo not turn off device before finish!\n");
|
||||
|
||||
cmd_result = run_command(mode_cmd[mode], 0);
|
||||
|
||||
if (cmd_result == CMD_RET_SUCCESS) {
|
||||
printf("Command finished\n");
|
||||
lcd_clear();
|
||||
lcd_printf("\n\n\t%s finished\n",
|
||||
mode_name[mode][0]);
|
||||
|
||||
exit_option = exit_reset;
|
||||
leave = 1;
|
||||
} else {
|
||||
printf("Command error\n");
|
||||
lcd_clear();
|
||||
lcd_printf("\n\n\t%s command error\n",
|
||||
mode_name[mode][0]);
|
||||
|
||||
exit_option = exit_back;
|
||||
leave = 0;
|
||||
}
|
||||
} else {
|
||||
lcd_puts("\n\n\tThis mode is not supported.\n");
|
||||
exit_option = exit_back;
|
||||
leave = 0;
|
||||
}
|
||||
}
|
||||
|
||||
lcd_printf("\n\n\tPress POWER KEY to %s\n", exit_option);
|
||||
|
||||
/* Clear PWR button Rising edge interrupt status flag */
|
||||
power_key_pressed(KEY_PWR_INTERRUPT_REG);
|
||||
|
||||
/* Wait for PWR key */
|
||||
while (!key_pressed(KEY_POWER))
|
||||
mdelay(1);
|
||||
|
||||
lcd_clear();
|
||||
return leave;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LCD
|
||||
static void display_download_menu(int mode)
|
||||
{
|
||||
char *selection[BOOT_MODE_EXIT + 1];
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= BOOT_MODE_EXIT; i++)
|
||||
selection[i] = "[ ]";
|
||||
|
||||
selection[mode] = "[=>]";
|
||||
|
||||
lcd_clear();
|
||||
lcd_printf("\n\n\t\tDownload Mode Menu\n\n");
|
||||
|
||||
for (i = 0; i <= BOOT_MODE_EXIT; i++)
|
||||
lcd_printf("\t%s %s - %s\n\n", selection[i],
|
||||
mode_name[i][0], mode_info[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void download_menu(void)
|
||||
{
|
||||
#ifdef CONFIG_LCD
|
||||
int mode = 0;
|
||||
int last_mode = 0;
|
||||
int run;
|
||||
int key = 0;
|
||||
int timeout = 15; /* sec */
|
||||
int i;
|
||||
|
||||
display_download_menu(mode);
|
||||
|
||||
lcd_puts("\n");
|
||||
|
||||
/* Start count if no key is pressed */
|
||||
while (check_keys())
|
||||
continue;
|
||||
|
||||
while (timeout--) {
|
||||
lcd_printf("\r\tNormal boot will start in: %2.d seconds.",
|
||||
timeout);
|
||||
|
||||
/* about 1000 ms in for loop */
|
||||
for (i = 0; i < 10; i++) {
|
||||
mdelay(100);
|
||||
key = check_keys();
|
||||
if (key)
|
||||
break;
|
||||
}
|
||||
if (key)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!key) {
|
||||
lcd_clear();
|
||||
return;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
run = 0;
|
||||
|
||||
if (mode != last_mode)
|
||||
display_download_menu(mode);
|
||||
|
||||
last_mode = mode;
|
||||
mdelay(200);
|
||||
|
||||
key = check_keys();
|
||||
switch (key) {
|
||||
case KEY_POWER:
|
||||
run = 1;
|
||||
break;
|
||||
case KEY_VOLUMEUP:
|
||||
if (mode > 0)
|
||||
mode--;
|
||||
break;
|
||||
case KEY_VOLUMEDOWN:
|
||||
if (mode < BOOT_MODE_EXIT)
|
||||
mode++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (run) {
|
||||
if (mode_leave_menu(mode))
|
||||
run_command("reset", 0);
|
||||
|
||||
display_download_menu(mode);
|
||||
}
|
||||
}
|
||||
|
||||
lcd_clear();
|
||||
#endif
|
||||
}
|
||||
|
||||
void check_boot_mode(void)
|
||||
{
|
||||
int pwr_key;
|
||||
|
||||
pwr_key = power_key_pressed(KEY_PWR_STATUS_REG);
|
||||
if (!pwr_key)
|
||||
return;
|
||||
|
||||
/* Clear PWR button Rising edge interrupt status flag */
|
||||
power_key_pressed(KEY_PWR_INTERRUPT_REG);
|
||||
|
||||
if (key_pressed(KEY_VOLUMEUP))
|
||||
download_menu();
|
||||
else if (key_pressed(KEY_VOLUMEDOWN))
|
||||
mode_leave_menu(BOOT_MODE_THOR);
|
||||
}
|
||||
|
||||
void keys_init(void)
|
||||
{
|
||||
/* Set direction to input */
|
||||
gpio_request(KEY_VOL_UP_GPIO, "volume-up");
|
||||
gpio_request(KEY_VOL_DOWN_GPIO, "volume-down");
|
||||
gpio_direction_input(KEY_VOL_UP_GPIO);
|
||||
gpio_direction_input(KEY_VOL_DOWN_GPIO);
|
||||
}
|
||||
#endif /* CONFIG_LCD_MENU */
|
||||
|
||||
#ifdef CONFIG_CMD_BMP
|
||||
void draw_logo(void)
|
||||
{
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
#include <common.h>
|
||||
#include <env.h>
|
||||
#include <lcd.h>
|
||||
#include <log.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/gpio.h>
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <lcd.h>
|
||||
#include <log.h>
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/arch/pinmux.h>
|
||||
|
@ -282,24 +281,3 @@ int g_dnl_board_usb_cable_connected(void)
|
|||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* LCD
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_LCD
|
||||
int mipi_power(void)
|
||||
{
|
||||
#if !CONFIG_IS_ENABLED(DM_I2C) /* TODO(maintainer): Convert to driver model */
|
||||
struct pmic *p = pmic_get("MAX77686_PMIC");
|
||||
|
||||
/* LDO8 VMIPI_1.0V_AP */
|
||||
max77686_set_ldo_mode(p, 8, OPMODE_ON);
|
||||
/* LDO10 VMIPI_1.8V_AP */
|
||||
max77686_set_ldo_mode(p, 10, OPMODE_ON);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* LCD */
|
||||
|
|
|
@ -9,14 +9,12 @@
|
|||
#include <env.h>
|
||||
#include <log.h>
|
||||
#include <spi.h>
|
||||
#include <lcd.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/arch/adc.h>
|
||||
#include <asm/arch/pinmux.h>
|
||||
#include <asm/arch/watchdog.h>
|
||||
#include <ld9040.h>
|
||||
#include <linux/delay.h>
|
||||
#include <power/pmic.h>
|
||||
#include <usb.h>
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <init.h>
|
||||
#include <lcd.h>
|
||||
#include <log.h>
|
||||
#include <miiphy.h>
|
||||
#include <phy_interface.h>
|
||||
|
|
|
@ -130,7 +130,6 @@ option in the defconfig
|
|||
@@ -67,3 +67,4 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
|
||||
CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
|
||||
CONFIG_CI_UDC=y
|
||||
CONFIG_VIDEO=y
|
||||
+CONFIG_SPL_OS_BOOT=y
|
||||
|
||||
Then rebuild U-Boot:
|
||||
|
|
|
@ -175,7 +175,7 @@ int board_early_init_f(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
void setup_lcd(void)
|
||||
{
|
||||
gpio_request(IMX_GPIO_NR(1, 11), "lcd_brightness");
|
||||
|
@ -192,7 +192,7 @@ int board_init(void)
|
|||
/* address of boot parameters */
|
||||
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
|
||||
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
setup_lcd();
|
||||
#endif
|
||||
#ifdef CONFIG_FEC_MXC
|
||||
|
|
|
@ -67,7 +67,7 @@ static void setup_gpmi_nand(void)
|
|||
}
|
||||
#endif /* CONFIG_NAND_MXS */
|
||||
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
static const iomux_v3_cfg_t backlight_pads[] = {
|
||||
/* Backlight On */
|
||||
MX6_PAD_JTAG_TMS__GPIO1_IO11 | MUX_PAD_CTRL(NO_PAD_CTRL),
|
||||
|
@ -195,7 +195,7 @@ int board_late_init(void)
|
|||
}
|
||||
#endif /* CONFIG_CMD_USB_SDP */
|
||||
|
||||
#if defined(CONFIG_DM_VIDEO)
|
||||
#if defined(CONFIG_VIDEO)
|
||||
setup_lcd();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ static void setup_gpmi_nand(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
static iomux_v3_cfg_t const backlight_pads[] = {
|
||||
/* Backlight On */
|
||||
MX7D_PAD_SD1_WP__GPIO5_IO1 | MUX_PAD_CTRL(NO_PAD_CTRL),
|
||||
|
@ -134,7 +134,7 @@ static int setup_lcd(void)
|
|||
*/
|
||||
void board_preboot_os(void)
|
||||
{
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
gpio_direction_output(GPIO_PWM_A, 1);
|
||||
gpio_direction_output(GPIO_BL_ON, 0);
|
||||
#endif
|
||||
|
@ -334,7 +334,7 @@ int board_fix_fdt(void *rw_fdt_blob)
|
|||
#if defined(CONFIG_BOARD_LATE_INIT)
|
||||
int board_late_init(void)
|
||||
{
|
||||
#if defined(CONFIG_DM_VIDEO)
|
||||
#if defined(CONFIG_VIDEO)
|
||||
setup_lcd();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <init.h>
|
||||
#include <linux/libfdt.h>
|
||||
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
#ifdef CONFIG_VIDEO
|
||||
#include <bmp_logo.h>
|
||||
#include <dm.h>
|
||||
#include <splash.h>
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include <log.h>
|
||||
#include <malloc.h>
|
||||
#include <mapmem.h>
|
||||
#include <lcd.h>
|
||||
#include <net.h>
|
||||
#include <fdt_support.h>
|
||||
#include <video.h>
|
||||
|
@ -1519,7 +1518,7 @@ void handle_pxe_menu(struct pxe_context *ctx, struct pxe_menu *cfg)
|
|||
/* display BMP if available */
|
||||
if (cfg->bmp) {
|
||||
if (get_relfile(ctx, cfg->bmp, image_load_addr, NULL)) {
|
||||
#if defined(CONFIG_DM_VIDEO)
|
||||
#if defined(CONFIG_VIDEO)
|
||||
struct udevice *dev;
|
||||
|
||||
err = uclass_first_device_err(UCLASS_VIDEO, &dev);
|
||||
|
|
16
cmd/Kconfig
16
cmd/Kconfig
|
@ -1877,7 +1877,7 @@ menu "Misc commands"
|
|||
|
||||
config CMD_BMP
|
||||
bool "Enable 'bmp' command"
|
||||
depends on LCD || DM_VIDEO || VIDEO
|
||||
depends on VIDEO
|
||||
help
|
||||
This provides a way to obtain information about a BMP-format image
|
||||
and to display it. BMP (which presumably stands for BitMaP) is a
|
||||
|
@ -1939,7 +1939,7 @@ config CMD_CONITRACE
|
|||
|
||||
config CMD_CLS
|
||||
bool "Enable clear screen command 'cls'"
|
||||
default y if LCD
|
||||
default y if LCD || DM_VIDEO
|
||||
help
|
||||
Enable the 'cls' command which clears the screen contents
|
||||
on video frame buffer.
|
||||
|
@ -2161,6 +2161,18 @@ config CMD_UUID
|
|||
The two commands are very similar except for the endianness of the
|
||||
output.
|
||||
|
||||
config CMD_VIDCONSOLE
|
||||
bool "lcdputs and setcurs"
|
||||
depends on VIDEO
|
||||
default y
|
||||
help
|
||||
Enabling this will provide 'setcurs' and 'lcdputs' commands which
|
||||
support cursor positioning and drawing strings on the video
|
||||
console (framebuffer).
|
||||
|
||||
The name 'lcdputs' is a bit of a misnomer, but so named because the
|
||||
video device is often an LCD.
|
||||
|
||||
endmenu
|
||||
|
||||
source "cmd/ti/Kconfig"
|
||||
|
|
|
@ -74,6 +74,7 @@ obj-$(CONFIG_CMD_EXT2) += ext2.o
|
|||
obj-$(CONFIG_CMD_FAT) += fat.o
|
||||
obj-$(CONFIG_CMD_FDT) += fdt.o
|
||||
obj-$(CONFIG_CMD_SQUASHFS) += sqfs.o
|
||||
obj-$(CONFIG_CONSOLE_TRUETYPE) += font.o
|
||||
obj-$(CONFIG_CMD_FLASH) += flash.o
|
||||
obj-$(CONFIG_CMD_FPGA) += fpga.o
|
||||
obj-$(CONFIG_CMD_FPGAD) += fpgad.o
|
||||
|
@ -178,6 +179,8 @@ obj-$(CONFIG_CMD_WDT) += wdt.o
|
|||
obj-$(CONFIG_CMD_LZMADEC) += lzmadec.o
|
||||
obj-$(CONFIG_CMD_UFS) += ufs.o
|
||||
obj-$(CONFIG_CMD_USB) += usb.o disk.o
|
||||
obj-$(CONFIG_CMD_VIDCONSOLE) += video.o
|
||||
|
||||
obj-$(CONFIG_CMD_FASTBOOT) += fastboot.o
|
||||
obj-$(CONFIG_CMD_FS_UUID) += fs_uuid.o
|
||||
|
||||
|
|
|
@ -122,11 +122,8 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
|||
bdinfo_print_num_l("fdt_blob", (ulong)gd->fdt_blob);
|
||||
bdinfo_print_num_l("new_fdt", (ulong)gd->new_fdt);
|
||||
bdinfo_print_num_l("fdt_size", (ulong)gd->fdt_size);
|
||||
if (IS_ENABLED(CONFIG_DM_VIDEO))
|
||||
if (IS_ENABLED(CONFIG_VIDEO))
|
||||
show_video_info();
|
||||
#if defined(CONFIG_LCD)
|
||||
bdinfo_print_num_l("FB base ", gd->fb_base);
|
||||
#endif
|
||||
#if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
|
||||
bdinfo_print_num_l("multi_dtb_fit", (ulong)gd->multi_dtb_fit);
|
||||
#endif
|
||||
|
|
42
cmd/bmp.c
42
cmd/bmp.c
|
@ -14,7 +14,6 @@
|
|||
#include <dm.h>
|
||||
#include <gzip.h>
|
||||
#include <image.h>
|
||||
#include <lcd.h>
|
||||
#include <log.h>
|
||||
#include <malloc.h>
|
||||
#include <mapmem.h>
|
||||
|
@ -48,27 +47,24 @@ struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
|
|||
/*
|
||||
* Decompress bmp image
|
||||
*/
|
||||
len = CONFIG_SYS_VIDEO_LOGO_MAX_SIZE;
|
||||
len = CONFIG_VIDEO_LOGO_MAX_SIZE;
|
||||
/* allocate extra 3 bytes for 32-bit-aligned-address + 2 alignment */
|
||||
dst = malloc(CONFIG_SYS_VIDEO_LOGO_MAX_SIZE + 3);
|
||||
if (dst == NULL) {
|
||||
dst = malloc(CONFIG_VIDEO_LOGO_MAX_SIZE + 3);
|
||||
if (!dst) {
|
||||
puts("Error: malloc in gunzip failed!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bmp = dst;
|
||||
|
||||
/* align to 32-bit-aligned-address + 2 */
|
||||
bmp = (struct bmp_image *)((((uintptr_t)dst + 1) & ~3) + 2);
|
||||
bmp = dst + 2;
|
||||
|
||||
if (gunzip(bmp, CONFIG_SYS_VIDEO_LOGO_MAX_SIZE, map_sysmem(addr, 0),
|
||||
&len) != 0) {
|
||||
if (gunzip(bmp, CONFIG_VIDEO_LOGO_MAX_SIZE, map_sysmem(addr, 0),
|
||||
&len)) {
|
||||
free(dst);
|
||||
return NULL;
|
||||
}
|
||||
if (len == CONFIG_SYS_VIDEO_LOGO_MAX_SIZE)
|
||||
puts("Image could be truncated"
|
||||
" (increase CONFIG_SYS_VIDEO_LOGO_MAX_SIZE)!\n");
|
||||
if (len == CONFIG_VIDEO_LOGO_MAX_SIZE)
|
||||
puts("Image could be truncated (increase CONFIG_VIDEO_LOGO_MAX_SIZE)!\n");
|
||||
|
||||
/*
|
||||
* Check for bmp mark 'BM'
|
||||
|
@ -224,21 +220,9 @@ static int bmp_info(ulong addr)
|
|||
return(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Subroutine: bmp_display
|
||||
*
|
||||
* Description: Display bmp file located in memory
|
||||
*
|
||||
* Inputs: addr address of the bmp file
|
||||
*
|
||||
* Return: None
|
||||
*
|
||||
*/
|
||||
int bmp_display(ulong addr, int x, int y)
|
||||
{
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
struct udevice *dev;
|
||||
#endif
|
||||
int ret;
|
||||
struct bmp_image *bmp = map_sysmem(addr, 0);
|
||||
void *bmp_alloc_addr = NULL;
|
||||
|
@ -254,23 +238,15 @@ int bmp_display(ulong addr, int x, int y)
|
|||
}
|
||||
addr = map_to_sysmem(bmp);
|
||||
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
ret = uclass_first_device_err(UCLASS_VIDEO, &dev);
|
||||
if (!ret) {
|
||||
bool align = false;
|
||||
|
||||
if (CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN) ||
|
||||
x == BMP_ALIGN_CENTER ||
|
||||
y == BMP_ALIGN_CENTER)
|
||||
if (x == BMP_ALIGN_CENTER || y == BMP_ALIGN_CENTER)
|
||||
align = true;
|
||||
|
||||
ret = video_bmp_display(dev, addr, x, y, align);
|
||||
}
|
||||
#elif defined(CONFIG_LCD)
|
||||
ret = lcd_display_bitmap(addr, x, y);
|
||||
#else
|
||||
# error bmp_display() requires CONFIG_LCD
|
||||
#endif
|
||||
|
||||
if (bmp_alloc_addr)
|
||||
free(bmp_alloc_addr);
|
||||
|
|
|
@ -19,7 +19,7 @@ static int do_video_clear(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||
|
||||
/* Send clear screen and home */
|
||||
printf(CSI "2J" CSI "1;1H");
|
||||
if (CONFIG_IS_ENABLED(DM_VIDEO) && !CONFIG_IS_ENABLED(VIDEO_ANSI)) {
|
||||
if (CONFIG_IS_ENABLED(VIDEO) && !CONFIG_IS_ENABLED(VIDEO_ANSI)) {
|
||||
if (uclass_first_device_err(UCLASS_VIDEO, &dev))
|
||||
return CMD_RET_FAILURE;
|
||||
if (video_clear(dev))
|
||||
|
|
81
cmd/font.c
Normal file
81
cmd/font.c
Normal file
|
@ -0,0 +1,81 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* video commands
|
||||
*
|
||||
* Copyright 2022 Google LLC
|
||||
* Written by Simon Glass <sjg@chromium.org>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <dm.h>
|
||||
#include <video.h>
|
||||
#include <video_console.h>
|
||||
|
||||
static int do_font_list(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
vidconsole_list_fonts();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int do_font_select(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
struct udevice *dev;
|
||||
const char *name;
|
||||
uint size = 0;
|
||||
int ret;
|
||||
|
||||
if (argc < 2)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev))
|
||||
return CMD_RET_FAILURE;
|
||||
name = argv[1];
|
||||
if (argc == 3)
|
||||
size = dectoul(argv[2], NULL);
|
||||
ret = vidconsole_select_font(dev, name, size);
|
||||
if (ret) {
|
||||
printf("Failed (error %d)\n", ret);
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
static int do_font_size(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
struct udevice *dev;
|
||||
uint size;
|
||||
int ret;
|
||||
|
||||
if (argc != 2)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev))
|
||||
return CMD_RET_FAILURE;
|
||||
|
||||
size = dectoul(argv[1], NULL);
|
||||
ret = vidconsole_select_font(dev, NULL, size);
|
||||
if (ret) {
|
||||
printf("Failed (error %d)\n", ret);
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_SYS_LONGHELP
|
||||
static char font_help_text[] =
|
||||
"list - list available fonts\n"
|
||||
"font select <name> [<size>] - select font to use\n"
|
||||
"font size <size> - select font size to";
|
||||
#endif
|
||||
|
||||
U_BOOT_CMD_WITH_SUBCMDS(font, "Fonts", font_help_text,
|
||||
U_BOOT_SUBCMD_MKENT(list, 1, 1, do_font_list),
|
||||
U_BOOT_SUBCMD_MKENT(select, 3, 1, do_font_select),
|
||||
U_BOOT_SUBCMD_MKENT(size, 2, 1, do_font_size));
|
61
cmd/video.c
Normal file
61
cmd/video.c
Normal file
|
@ -0,0 +1,61 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* video commands
|
||||
*
|
||||
* Copyright 2022 Google LLC
|
||||
* Written by Simon Glass <sjg@chromium.org>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <dm.h>
|
||||
#include <video.h>
|
||||
#include <video_console.h>
|
||||
|
||||
static int do_video_setcursor(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
unsigned int col, row;
|
||||
struct udevice *dev;
|
||||
|
||||
if (argc != 3)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev))
|
||||
return CMD_RET_FAILURE;
|
||||
col = dectoul(argv[1], NULL);
|
||||
row = dectoul(argv[2], NULL);
|
||||
vidconsole_position_cursor(dev, col, row);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int do_video_puts(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
struct udevice *dev;
|
||||
int ret;
|
||||
|
||||
if (argc != 2)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev))
|
||||
return CMD_RET_FAILURE;
|
||||
ret = vidconsole_put_string(dev, argv[1]);
|
||||
if (!ret)
|
||||
ret = video_sync(dev->parent, false);
|
||||
|
||||
return ret ? CMD_RET_FAILURE : 0;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
setcurs, 3, 1, do_video_setcursor,
|
||||
"set cursor position within screen",
|
||||
" <col> <row> in character"
|
||||
);
|
||||
|
||||
U_BOOT_CMD(
|
||||
lcdputs, 2, 1, do_video_puts,
|
||||
"print string on video framebuffer",
|
||||
" <string>"
|
||||
);
|
|
@ -194,7 +194,7 @@ config CONSOLE_FLUSH_SUPPORT
|
|||
|
||||
config CONSOLE_MUX
|
||||
bool "Enable console multiplexing"
|
||||
default y if DM_VIDEO || VIDEO || LCD
|
||||
default y if VIDEO || VIDEO || LCD
|
||||
help
|
||||
This allows multiple devices to be used for each console 'file'.
|
||||
For example, stdout can be set to go to serial and video.
|
||||
|
|
|
@ -35,10 +35,6 @@ obj-$(CONFIG_I2C_EDID) += edid.o
|
|||
obj-$(CONFIG_KALLSYMS) += kallsyms.o
|
||||
obj-y += splash.o
|
||||
obj-$(CONFIG_SPLASH_SOURCE) += splash_source.o
|
||||
ifndef CONFIG_DM_VIDEO
|
||||
obj-$(CONFIG_LCD) += lcd.o lcd_console.o
|
||||
endif
|
||||
obj-$(CONFIG_LCD_ROTATION) += lcd_console_rotation.o
|
||||
obj-$(CONFIG_MENU) += menu.o
|
||||
obj-$(CONFIG_UPDATE_COMMON) += update.o
|
||||
obj-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <i2c.h>
|
||||
#include <init.h>
|
||||
#include <initcall.h>
|
||||
#include <lcd.h>
|
||||
#include <log.h>
|
||||
#include <malloc.h>
|
||||
#include <mapmem.h>
|
||||
|
@ -409,22 +408,18 @@ __weak int arch_reserve_mmu(void)
|
|||
|
||||
static int reserve_video(void)
|
||||
{
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
ulong addr;
|
||||
int ret;
|
||||
if (IS_ENABLED(CONFIG_VIDEO)) {
|
||||
ulong addr;
|
||||
int ret;
|
||||
|
||||
addr = gd->relocaddr;
|
||||
ret = video_reserve(&addr);
|
||||
if (ret)
|
||||
return ret;
|
||||
debug("Reserving %luk for video at: %08lx\n",
|
||||
((unsigned long)gd->relocaddr - addr) >> 10, addr);
|
||||
gd->relocaddr = addr;
|
||||
#elif defined(CONFIG_LCD)
|
||||
/* reserve memory for LCD display (always full pages) */
|
||||
gd->relocaddr = lcd_setmem(gd->relocaddr);
|
||||
gd->fb_base = gd->relocaddr;
|
||||
#endif
|
||||
addr = gd->relocaddr;
|
||||
ret = video_reserve(&addr);
|
||||
if (ret)
|
||||
return ret;
|
||||
debug("Reserving %luk for video at: %08lx\n",
|
||||
((unsigned long)gd->relocaddr - addr) >> 10, addr);
|
||||
gd->relocaddr = addr;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <lcd.h>
|
||||
#include <fdt_support.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <linux/libfdt.h>
|
||||
|
@ -22,7 +21,6 @@ static int fdt_simplefb_configure_node(void *blob, int off)
|
|||
int bpix; /* log2 of bits per pixel */
|
||||
const char *name;
|
||||
ulong fb_base;
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
struct video_uc_plat *plat;
|
||||
struct video_priv *uc_priv;
|
||||
struct udevice *dev;
|
||||
|
@ -37,12 +35,6 @@ static int fdt_simplefb_configure_node(void *blob, int off)
|
|||
ysize = uc_priv->ysize;
|
||||
bpix = uc_priv->bpix;
|
||||
fb_base = plat->base;
|
||||
#else
|
||||
xsize = lcd_get_pixel_width();
|
||||
ysize = lcd_get_pixel_height();
|
||||
bpix = LCD_BPP;
|
||||
fb_base = gd->fb_base;
|
||||
#endif
|
||||
switch (bpix) {
|
||||
case 4: /* VIDEO_BPP16 */
|
||||
name = "r5g6b5";
|
||||
|
@ -90,7 +82,7 @@ int fdt_simplefb_enable_existing_node(void *blob)
|
|||
return fdt_simplefb_configure_node(blob, off);
|
||||
}
|
||||
|
||||
#if CONFIG_IS_ENABLED(DM_VIDEO)
|
||||
#if CONFIG_IS_ENABLED(VIDEO)
|
||||
int fdt_simplefb_enable_and_mem_rsv(void *blob)
|
||||
{
|
||||
struct fdt_memory mem;
|
||||
|
|
|
@ -1740,35 +1740,6 @@ int fdt_set_status_by_pathf(void *fdt, enum fdt_status status, const char *fmt,
|
|||
return fdt_set_node_status(fdt, offset, status);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_LCD)
|
||||
int fdt_add_edid(void *blob, const char *compat, unsigned char *edid_buf)
|
||||
{
|
||||
int noff;
|
||||
int ret;
|
||||
|
||||
noff = fdt_node_offset_by_compatible(blob, -1, compat);
|
||||
if (noff != -FDT_ERR_NOTFOUND) {
|
||||
debug("%s: %s\n", fdt_get_name(blob, noff, 0), compat);
|
||||
add_edid:
|
||||
ret = fdt_setprop(blob, noff, "edid", edid_buf, 128);
|
||||
if (ret == -FDT_ERR_NOSPACE) {
|
||||
ret = fdt_increase_size(blob, 512);
|
||||
if (!ret)
|
||||
goto add_edid;
|
||||
else
|
||||
goto err_size;
|
||||
} else if (ret < 0) {
|
||||
printf("Can't add property: %s\n", fdt_strerror(ret));
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
err_size:
|
||||
printf("Can't increase blob size: %s\n", fdt_strerror(ret));
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Verify the physical address of device tree node for a given alias
|
||||
*
|
||||
|
|
578
common/lcd.c
578
common/lcd.c
|
@ -1,578 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Common LCD routines
|
||||
*
|
||||
* (C) Copyright 2001-2002
|
||||
* Wolfgang Denk, DENX Software Engineering -- wd@denx.de
|
||||
*/
|
||||
|
||||
/* #define DEBUG */
|
||||
#include <config.h>
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <cpu_func.h>
|
||||
#include <env_callback.h>
|
||||
#include <log.h>
|
||||
#include <asm/cache.h>
|
||||
#include <init.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <linux/types.h>
|
||||
#include <stdio_dev.h>
|
||||
#include <lcd.h>
|
||||
#include <mapmem.h>
|
||||
#include <watchdog.h>
|
||||
#include <asm/unaligned.h>
|
||||
#include <splash.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/unaligned.h>
|
||||
#include <video_font.h>
|
||||
|
||||
#ifdef CONFIG_LCD_LOGO
|
||||
#include <bmp_logo.h>
|
||||
#include <bmp_logo_data.h>
|
||||
#if (CONSOLE_COLOR_WHITE >= BMP_LOGO_OFFSET) && (LCD_BPP != LCD_COLOR16)
|
||||
#error Default Color Map overlaps with Logo Color Map
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_LCD_ALIGNMENT
|
||||
#define CONFIG_LCD_ALIGNMENT PAGE_SIZE
|
||||
#endif
|
||||
|
||||
#if (LCD_BPP != LCD_COLOR8) && (LCD_BPP != LCD_COLOR16) && \
|
||||
(LCD_BPP != LCD_COLOR32)
|
||||
#error Unsupported LCD BPP.
|
||||
#endif
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
static int lcd_init(void *lcdbase);
|
||||
static void lcd_logo(void);
|
||||
static void lcd_setfgcolor(int color);
|
||||
static void lcd_setbgcolor(int color);
|
||||
|
||||
static int lcd_color_fg;
|
||||
static int lcd_color_bg;
|
||||
int lcd_line_length;
|
||||
char lcd_is_enabled = 0;
|
||||
static void *lcd_base; /* Start of framebuffer memory */
|
||||
static char lcd_flush_dcache; /* 1 to flush dcache after each lcd update */
|
||||
|
||||
/* Flush LCD activity to the caches */
|
||||
void lcd_sync(void)
|
||||
{
|
||||
/*
|
||||
* flush_dcache_range() is declared in common.h but it seems that some
|
||||
* architectures do not actually implement it. Is there a way to find
|
||||
* out whether it exists? For now, ARM is safe.
|
||||
*/
|
||||
#if defined(CONFIG_ARM) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
|
||||
int line_length;
|
||||
|
||||
if (lcd_flush_dcache)
|
||||
flush_dcache_range((ulong)lcd_base,
|
||||
(ulong)(lcd_base + lcd_get_size(&line_length)));
|
||||
#endif
|
||||
}
|
||||
|
||||
void lcd_set_flush_dcache(int flush)
|
||||
{
|
||||
lcd_flush_dcache = (flush != 0);
|
||||
}
|
||||
|
||||
static void lcd_stub_putc(struct stdio_dev *dev, const char c)
|
||||
{
|
||||
lcd_putc(c);
|
||||
}
|
||||
|
||||
static void lcd_stub_puts(struct stdio_dev *dev, const char *s)
|
||||
{
|
||||
lcd_puts(s);
|
||||
}
|
||||
|
||||
/*
|
||||
* With most lcd drivers the line length is set up
|
||||
* by calculating it from panel_info parameters. Some
|
||||
* drivers need to calculate the line length differently,
|
||||
* so make the function weak to allow overriding it.
|
||||
*/
|
||||
__weak int lcd_get_size(int *line_length)
|
||||
{
|
||||
*line_length = (panel_info.vl_col * NBITS(panel_info.vl_bpix)) / 8;
|
||||
return *line_length * panel_info.vl_row;
|
||||
}
|
||||
|
||||
int drv_lcd_init(void)
|
||||
{
|
||||
struct stdio_dev lcddev;
|
||||
int rc;
|
||||
|
||||
lcd_base = map_sysmem(gd->fb_base, 0);
|
||||
|
||||
lcd_init(lcd_base);
|
||||
|
||||
/* Device initialization */
|
||||
memset(&lcddev, 0, sizeof(lcddev));
|
||||
|
||||
strcpy(lcddev.name, "lcd");
|
||||
lcddev.ext = 0; /* No extensions */
|
||||
lcddev.flags = DEV_FLAGS_OUTPUT; /* Output only */
|
||||
lcddev.putc = lcd_stub_putc; /* 'putc' function */
|
||||
lcddev.puts = lcd_stub_puts; /* 'puts' function */
|
||||
|
||||
rc = stdio_register(&lcddev);
|
||||
|
||||
return (rc == 0) ? 1 : rc;
|
||||
}
|
||||
|
||||
void lcd_clear(void)
|
||||
{
|
||||
int bg_color;
|
||||
__maybe_unused ulong addr;
|
||||
static int do_splash = 1;
|
||||
#if LCD_BPP == LCD_COLOR8
|
||||
/* Setting the palette */
|
||||
lcd_setcolreg(CONSOLE_COLOR_BLACK, 0, 0, 0);
|
||||
lcd_setcolreg(CONSOLE_COLOR_RED, 0xFF, 0, 0);
|
||||
lcd_setcolreg(CONSOLE_COLOR_GREEN, 0, 0xFF, 0);
|
||||
lcd_setcolreg(CONSOLE_COLOR_YELLOW, 0xFF, 0xFF, 0);
|
||||
lcd_setcolreg(CONSOLE_COLOR_BLUE, 0, 0, 0xFF);
|
||||
lcd_setcolreg(CONSOLE_COLOR_MAGENTA, 0xFF, 0, 0xFF);
|
||||
lcd_setcolreg(CONSOLE_COLOR_CYAN, 0, 0xFF, 0xFF);
|
||||
lcd_setcolreg(CONSOLE_COLOR_GREY, 0xAA, 0xAA, 0xAA);
|
||||
lcd_setcolreg(CONSOLE_COLOR_WHITE, 0xFF, 0xFF, 0xFF);
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SYS_WHITE_ON_BLACK
|
||||
lcd_setfgcolor(CONSOLE_COLOR_BLACK);
|
||||
lcd_setbgcolor(CONSOLE_COLOR_WHITE);
|
||||
bg_color = CONSOLE_COLOR_WHITE;
|
||||
#else
|
||||
lcd_setfgcolor(CONSOLE_COLOR_WHITE);
|
||||
lcd_setbgcolor(CONSOLE_COLOR_BLACK);
|
||||
bg_color = CONSOLE_COLOR_BLACK;
|
||||
#endif /* CONFIG_SYS_WHITE_ON_BLACK */
|
||||
|
||||
/* set framebuffer to background color */
|
||||
#if (LCD_BPP != LCD_COLOR32)
|
||||
memset((char *)lcd_base, bg_color, lcd_line_length * panel_info.vl_row);
|
||||
#else
|
||||
u32 *ppix = lcd_base;
|
||||
u32 i;
|
||||
for (i = 0;
|
||||
i < (lcd_line_length * panel_info.vl_row)/NBYTES(panel_info.vl_bpix);
|
||||
i++) {
|
||||
*ppix++ = bg_color;
|
||||
}
|
||||
#endif
|
||||
/* setup text-console */
|
||||
debug("[LCD] setting up console...\n");
|
||||
lcd_init_console(lcd_base,
|
||||
panel_info.vl_col,
|
||||
panel_info.vl_row,
|
||||
panel_info.vl_rot);
|
||||
/* Paint the logo and retrieve LCD base address */
|
||||
debug("[LCD] Drawing the logo...\n");
|
||||
if (do_splash) {
|
||||
if (splash_display() == 0) {
|
||||
do_splash = 0;
|
||||
lcd_sync();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
lcd_logo();
|
||||
#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
|
||||
addr = (ulong)lcd_base + BMP_LOGO_HEIGHT * lcd_line_length;
|
||||
lcd_init_console((void *)addr, panel_info.vl_col,
|
||||
panel_info.vl_row, panel_info.vl_rot);
|
||||
#endif
|
||||
lcd_sync();
|
||||
}
|
||||
|
||||
static int lcd_init(void *lcdbase)
|
||||
{
|
||||
debug("[LCD] Initializing LCD frambuffer at %p\n", lcdbase);
|
||||
lcd_ctrl_init(lcdbase);
|
||||
|
||||
/*
|
||||
* lcd_ctrl_init() of some drivers (i.e. bcm2835 on rpi) ignores
|
||||
* the 'lcdbase' argument and uses custom lcd base address
|
||||
* by setting up gd->fb_base. Check for this condition and fixup
|
||||
* 'lcd_base' address.
|
||||
*/
|
||||
if (map_to_sysmem(lcdbase) != gd->fb_base)
|
||||
lcd_base = map_sysmem(gd->fb_base, 0);
|
||||
|
||||
debug("[LCD] Using LCD frambuffer at %p\n", lcd_base);
|
||||
|
||||
lcd_get_size(&lcd_line_length);
|
||||
lcd_is_enabled = 1;
|
||||
lcd_clear();
|
||||
lcd_enable();
|
||||
|
||||
/* Initialize the console */
|
||||
lcd_set_col(0);
|
||||
#ifdef CONFIG_LCD_INFO_BELOW_LOGO
|
||||
lcd_set_row(7 + BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT);
|
||||
#else
|
||||
lcd_set_row(1); /* leave 1 blank line below logo */
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is called early in the system initialization to grab memory
|
||||
* for the LCD controller.
|
||||
* Returns new address for monitor, after reserving LCD buffer memory
|
||||
*
|
||||
* Note that this is running from ROM, so no write access to global data.
|
||||
*/
|
||||
ulong lcd_setmem(ulong addr)
|
||||
{
|
||||
ulong size;
|
||||
int line_length;
|
||||
|
||||
debug("LCD panel info: %d x %d, %d bit/pix\n", panel_info.vl_col,
|
||||
panel_info.vl_row, NBITS(panel_info.vl_bpix));
|
||||
|
||||
size = lcd_get_size(&line_length);
|
||||
|
||||
/* Round up to nearest full page, or MMU section if defined */
|
||||
size = ALIGN(size, CONFIG_LCD_ALIGNMENT);
|
||||
addr = ALIGN(addr - CONFIG_LCD_ALIGNMENT + 1, CONFIG_LCD_ALIGNMENT);
|
||||
|
||||
/* Allocate pages for the frame buffer. */
|
||||
addr -= size;
|
||||
|
||||
debug("Reserving %ldk for LCD Framebuffer at: %08lx\n",
|
||||
size >> 10, addr);
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
static void lcd_setfgcolor(int color)
|
||||
{
|
||||
lcd_color_fg = color;
|
||||
}
|
||||
|
||||
int lcd_getfgcolor(void)
|
||||
{
|
||||
return lcd_color_fg;
|
||||
}
|
||||
|
||||
static void lcd_setbgcolor(int color)
|
||||
{
|
||||
lcd_color_bg = color;
|
||||
}
|
||||
|
||||
int lcd_getbgcolor(void)
|
||||
{
|
||||
return lcd_color_bg;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LCD_LOGO
|
||||
__weak void lcd_logo_set_cmap(void)
|
||||
{
|
||||
int i;
|
||||
ushort *cmap = configuration_get_cmap();
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(bmp_logo_palette); ++i)
|
||||
*cmap++ = bmp_logo_palette[i];
|
||||
}
|
||||
|
||||
void lcd_logo_plot(int x, int y)
|
||||
{
|
||||
ushort i, j;
|
||||
uchar *bmap = &bmp_logo_bitmap[0];
|
||||
unsigned bpix = NBITS(panel_info.vl_bpix);
|
||||
uchar *fb = (uchar *)(lcd_base + y * lcd_line_length + x * bpix / 8);
|
||||
ushort *fb16;
|
||||
|
||||
debug("Logo: width %d height %d colors %d\n",
|
||||
BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, BMP_LOGO_COLORS);
|
||||
|
||||
if (bpix < 12) {
|
||||
schedule();
|
||||
lcd_logo_set_cmap();
|
||||
schedule();
|
||||
|
||||
for (i = 0; i < BMP_LOGO_HEIGHT; ++i) {
|
||||
memcpy(fb, bmap, BMP_LOGO_WIDTH);
|
||||
bmap += BMP_LOGO_WIDTH;
|
||||
fb += panel_info.vl_col;
|
||||
}
|
||||
}
|
||||
else { /* true color mode */
|
||||
u16 col16;
|
||||
fb16 = (ushort *)fb;
|
||||
for (i = 0; i < BMP_LOGO_HEIGHT; ++i) {
|
||||
for (j = 0; j < BMP_LOGO_WIDTH; j++) {
|
||||
col16 = bmp_logo_palette[(bmap[j]-16)];
|
||||
fb16[j] =
|
||||
((col16 & 0x000F) << 1) |
|
||||
((col16 & 0x00F0) << 3) |
|
||||
((col16 & 0x0F00) << 4);
|
||||
}
|
||||
bmap += BMP_LOGO_WIDTH;
|
||||
fb16 += panel_info.vl_col;
|
||||
}
|
||||
}
|
||||
|
||||
schedule();
|
||||
lcd_sync();
|
||||
}
|
||||
#else
|
||||
static inline void lcd_logo_plot(int x, int y) {}
|
||||
#endif /* CONFIG_LCD_LOGO */
|
||||
|
||||
#if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
|
||||
#ifdef CONFIG_SPLASH_SCREEN_ALIGN
|
||||
|
||||
static void splash_align_axis(int *axis, unsigned long panel_size,
|
||||
unsigned long picture_size)
|
||||
{
|
||||
unsigned long panel_picture_delta = panel_size - picture_size;
|
||||
unsigned long axis_alignment;
|
||||
|
||||
if (*axis == BMP_ALIGN_CENTER)
|
||||
axis_alignment = panel_picture_delta / 2;
|
||||
else if (*axis < 0)
|
||||
axis_alignment = panel_picture_delta + *axis + 1;
|
||||
else
|
||||
return;
|
||||
|
||||
*axis = max(0, (int)axis_alignment);
|
||||
}
|
||||
#endif
|
||||
|
||||
__weak void fb_put_byte(uchar **fb, uchar **from)
|
||||
{
|
||||
*(*fb)++ = *(*from)++;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BMP_16BPP)
|
||||
__weak void fb_put_word(uchar **fb, uchar **from)
|
||||
{
|
||||
*(*fb)++ = *(*from)++;
|
||||
*(*fb)++ = *(*from)++;
|
||||
}
|
||||
#endif /* CONFIG_BMP_16BPP */
|
||||
|
||||
__weak void lcd_set_cmap(struct bmp_image *bmp, unsigned colors)
|
||||
{
|
||||
int i;
|
||||
struct bmp_color_table_entry cte;
|
||||
ushort *cmap = configuration_get_cmap();
|
||||
|
||||
for (i = 0; i < colors; ++i) {
|
||||
cte = bmp->color_table[i];
|
||||
*cmap = (((cte.red) << 8) & 0xf800) |
|
||||
(((cte.green) << 3) & 0x07e0) |
|
||||
(((cte.blue) >> 3) & 0x001f);
|
||||
cmap++;
|
||||
}
|
||||
}
|
||||
|
||||
int lcd_display_bitmap(ulong bmp_image, int x, int y)
|
||||
{
|
||||
ushort *cmap_base = NULL;
|
||||
ushort i, j;
|
||||
uchar *fb;
|
||||
struct bmp_image *bmp = (struct bmp_image *)map_sysmem(bmp_image, 0);
|
||||
uchar *bmap;
|
||||
ushort padded_width;
|
||||
unsigned long width, height, byte_width;
|
||||
unsigned long pwidth = panel_info.vl_col;
|
||||
unsigned colors, bpix, bmp_bpix;
|
||||
int hdr_size;
|
||||
struct bmp_color_table_entry *palette;
|
||||
|
||||
if (!bmp || !(bmp->header.signature[0] == 'B' &&
|
||||
bmp->header.signature[1] == 'M')) {
|
||||
printf("Error: no valid bmp image at %lx\n", bmp_image);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
palette = bmp->color_table;
|
||||
width = get_unaligned_le32(&bmp->header.width);
|
||||
height = get_unaligned_le32(&bmp->header.height);
|
||||
bmp_bpix = get_unaligned_le16(&bmp->header.bit_count);
|
||||
hdr_size = get_unaligned_le16(&bmp->header.size);
|
||||
debug("hdr_size=%d, bmp_bpix=%d\n", hdr_size, bmp_bpix);
|
||||
|
||||
colors = 1 << bmp_bpix;
|
||||
|
||||
bpix = NBITS(panel_info.vl_bpix);
|
||||
|
||||
if (bpix != 1 && bpix != 8 && bpix != 16 && bpix != 32) {
|
||||
printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
|
||||
bpix, bmp_bpix);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* We support displaying 8bpp BMPs on 16bpp LCDs
|
||||
* and displaying 24bpp BMPs on 32bpp LCDs
|
||||
* */
|
||||
if (bpix != bmp_bpix &&
|
||||
!(bmp_bpix == 8 && bpix == 16) &&
|
||||
!(bmp_bpix == 24 && bpix == 32)) {
|
||||
printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
|
||||
bpix, get_unaligned_le16(&bmp->header.bit_count));
|
||||
return 1;
|
||||
}
|
||||
|
||||
debug("Display-bmp: %d x %d with %d colors, display %d\n",
|
||||
(int)width, (int)height, (int)colors, 1 << bpix);
|
||||
|
||||
if (bmp_bpix == 8)
|
||||
lcd_set_cmap(bmp, colors);
|
||||
|
||||
padded_width = (width & 0x3 ? (width & ~0x3) + 4 : width);
|
||||
|
||||
#ifdef CONFIG_SPLASH_SCREEN_ALIGN
|
||||
splash_align_axis(&x, pwidth, width);
|
||||
splash_align_axis(&y, panel_info.vl_row, height);
|
||||
#endif /* CONFIG_SPLASH_SCREEN_ALIGN */
|
||||
|
||||
if ((x + width) > pwidth)
|
||||
width = pwidth - x;
|
||||
if ((y + height) > panel_info.vl_row)
|
||||
height = panel_info.vl_row - y;
|
||||
|
||||
bmap = (uchar *)bmp + get_unaligned_le32(&bmp->header.data_offset);
|
||||
fb = (uchar *)(lcd_base +
|
||||
(y + height - 1) * lcd_line_length + x * bpix / 8);
|
||||
|
||||
switch (bmp_bpix) {
|
||||
case 1:
|
||||
case 8: {
|
||||
cmap_base = configuration_get_cmap();
|
||||
|
||||
if (bpix != 16)
|
||||
byte_width = width;
|
||||
else
|
||||
byte_width = width * 2;
|
||||
|
||||
for (i = 0; i < height; ++i) {
|
||||
schedule();
|
||||
for (j = 0; j < width; j++) {
|
||||
if (bpix != 16) {
|
||||
fb_put_byte(&fb, &bmap);
|
||||
} else {
|
||||
struct bmp_color_table_entry *entry;
|
||||
uint val;
|
||||
|
||||
if (cmap_base) {
|
||||
val = cmap_base[*bmap];
|
||||
} else {
|
||||
entry = &palette[*bmap];
|
||||
val = entry->blue >> 3 |
|
||||
entry->green >> 2 << 5 |
|
||||
entry->red >> 3 << 11;
|
||||
}
|
||||
*(uint16_t *)fb = val;
|
||||
bmap++;
|
||||
fb += sizeof(uint16_t) / sizeof(*fb);
|
||||
}
|
||||
}
|
||||
bmap += (padded_width - width);
|
||||
fb -= byte_width + lcd_line_length;
|
||||
}
|
||||
break;
|
||||
}
|
||||
#if defined(CONFIG_BMP_16BPP)
|
||||
case 16:
|
||||
for (i = 0; i < height; ++i) {
|
||||
schedule();
|
||||
for (j = 0; j < width; j++)
|
||||
fb_put_word(&fb, &bmap);
|
||||
|
||||
bmap += (padded_width - width) * 2;
|
||||
fb -= width * 2 + lcd_line_length;
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_BMP_16BPP */
|
||||
#if defined(CONFIG_BMP_24BPP)
|
||||
case 24:
|
||||
for (i = 0; i < height; ++i) {
|
||||
for (j = 0; j < width; j++) {
|
||||
*(fb++) = *(bmap++);
|
||||
*(fb++) = *(bmap++);
|
||||
*(fb++) = *(bmap++);
|
||||
*(fb++) = 0;
|
||||
}
|
||||
fb -= lcd_line_length + width * (bpix / 8);
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_BMP_24BPP */
|
||||
#if defined(CONFIG_BMP_32BPP)
|
||||
case 32:
|
||||
for (i = 0; i < height; ++i) {
|
||||
for (j = 0; j < width; j++) {
|
||||
*(fb++) = *(bmap++);
|
||||
*(fb++) = *(bmap++);
|
||||
*(fb++) = *(bmap++);
|
||||
*(fb++) = *(bmap++);
|
||||
}
|
||||
fb -= lcd_line_length + width * (bpix / 8);
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_BMP_32BPP */
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
||||
lcd_sync();
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void lcd_logo(void)
|
||||
{
|
||||
lcd_logo_plot(0, 0);
|
||||
|
||||
#ifdef CONFIG_LCD_INFO
|
||||
lcd_set_col(LCD_INFO_X / VIDEO_FONT_WIDTH);
|
||||
lcd_set_row(LCD_INFO_Y / VIDEO_FONT_HEIGHT);
|
||||
lcd_show_board_info();
|
||||
#endif /* CONFIG_LCD_INFO */
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPLASHIMAGE_GUARD
|
||||
static int on_splashimage(const char *name, const char *value, enum env_op op,
|
||||
int flags)
|
||||
{
|
||||
ulong addr;
|
||||
int aligned;
|
||||
|
||||
if (op == env_op_delete)
|
||||
return 0;
|
||||
|
||||
addr = hextoul(value, NULL);
|
||||
/* See README.displaying-bmps */
|
||||
aligned = (addr % 4 == 2);
|
||||
if (!aligned) {
|
||||
printf("Invalid splashimage value. Value must be 16 bit aligned, but not 32 bit aligned\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_ENV_CALLBACK(splashimage, on_splashimage);
|
||||
#endif
|
||||
|
||||
int lcd_get_pixel_width(void)
|
||||
{
|
||||
return panel_info.vl_col;
|
||||
}
|
||||
|
||||
int lcd_get_pixel_height(void)
|
||||
{
|
||||
return panel_info.vl_row;
|
||||
}
|
|
@ -1,260 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2001-2015
|
||||
* DENX Software Engineering -- wd@denx.de
|
||||
* Compulab Ltd - http://compulab.co.il/
|
||||
* Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <lcd.h>
|
||||
#include <log.h>
|
||||
#include <serial.h>
|
||||
#include <video_font.h> /* Get font data, width and height */
|
||||
#if defined(CONFIG_LCD_LOGO)
|
||||
#include <bmp_logo.h>
|
||||
#endif
|
||||
|
||||
static struct console_t cons;
|
||||
|
||||
void lcd_set_col(short col)
|
||||
{
|
||||
cons.curr_col = col;
|
||||
}
|
||||
|
||||
void lcd_set_row(short row)
|
||||
{
|
||||
cons.curr_row = row;
|
||||
}
|
||||
|
||||
void lcd_position_cursor(unsigned col, unsigned row)
|
||||
{
|
||||
cons.curr_col = min_t(short, col, cons.cols - 1);
|
||||
cons.curr_row = min_t(short, row, cons.rows - 1);
|
||||
}
|
||||
|
||||
int lcd_get_screen_rows(void)
|
||||
{
|
||||
return cons.rows;
|
||||
}
|
||||
|
||||
int lcd_get_screen_columns(void)
|
||||
{
|
||||
return cons.cols;
|
||||
}
|
||||
|
||||
static void lcd_putc_xy0(struct console_t *pcons, ushort x, ushort y, char c)
|
||||
{
|
||||
int fg_color = lcd_getfgcolor();
|
||||
int bg_color = lcd_getbgcolor();
|
||||
int i, row;
|
||||
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
|
||||
y * pcons->lcdsizex +
|
||||
x;
|
||||
|
||||
for (row = 0; row < VIDEO_FONT_HEIGHT; row++) {
|
||||
uchar bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
|
||||
for (i = 0; i < VIDEO_FONT_WIDTH; ++i) {
|
||||
*dst++ = (bits & 0x80) ? fg_color : bg_color;
|
||||
bits <<= 1;
|
||||
}
|
||||
dst += (pcons->lcdsizex - VIDEO_FONT_WIDTH);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void console_setrow0(struct console_t *pcons, u32 row, int clr)
|
||||
{
|
||||
int i;
|
||||
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
|
||||
row * VIDEO_FONT_HEIGHT *
|
||||
pcons->lcdsizex;
|
||||
|
||||
for (i = 0; i < (VIDEO_FONT_HEIGHT * pcons->lcdsizex); i++)
|
||||
*dst++ = clr;
|
||||
}
|
||||
|
||||
static inline void console_moverow0(struct console_t *pcons,
|
||||
u32 rowdst, u32 rowsrc)
|
||||
{
|
||||
int i;
|
||||
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
|
||||
rowdst * VIDEO_FONT_HEIGHT *
|
||||
pcons->lcdsizex;
|
||||
|
||||
fbptr_t *src = (fbptr_t *)pcons->fbbase +
|
||||
rowsrc * VIDEO_FONT_HEIGHT *
|
||||
pcons->lcdsizex;
|
||||
|
||||
for (i = 0; i < (VIDEO_FONT_HEIGHT * pcons->lcdsizex); i++)
|
||||
*dst++ = *src++;
|
||||
}
|
||||
|
||||
static inline void console_back(void)
|
||||
{
|
||||
if (--cons.curr_col < 0) {
|
||||
cons.curr_col = cons.cols - 1;
|
||||
if (--cons.curr_row < 0)
|
||||
cons.curr_row = 0;
|
||||
}
|
||||
|
||||
cons.fp_putc_xy(&cons,
|
||||
cons.curr_col * VIDEO_FONT_WIDTH,
|
||||
cons.curr_row * VIDEO_FONT_HEIGHT, ' ');
|
||||
}
|
||||
|
||||
static inline void console_newline(void)
|
||||
{
|
||||
const int rows = CONFIG_CONSOLE_SCROLL_LINES;
|
||||
int bg_color = lcd_getbgcolor();
|
||||
int i;
|
||||
|
||||
cons.curr_col = 0;
|
||||
|
||||
/* Check if we need to scroll the terminal */
|
||||
if (++cons.curr_row >= cons.rows) {
|
||||
for (i = 0; i < cons.rows-rows; i++)
|
||||
cons.fp_console_moverow(&cons, i, i+rows);
|
||||
for (i = 0; i < rows; i++)
|
||||
cons.fp_console_setrow(&cons, cons.rows-i-1, bg_color);
|
||||
cons.curr_row -= rows;
|
||||
}
|
||||
lcd_sync();
|
||||
}
|
||||
|
||||
void console_calc_rowcol(struct console_t *pcons, u32 sizex, u32 sizey)
|
||||
{
|
||||
pcons->cols = sizex / VIDEO_FONT_WIDTH;
|
||||
#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
|
||||
pcons->rows = (pcons->lcdsizey - BMP_LOGO_HEIGHT);
|
||||
pcons->rows /= VIDEO_FONT_HEIGHT;
|
||||
#else
|
||||
pcons->rows = sizey / VIDEO_FONT_HEIGHT;
|
||||
#endif
|
||||
}
|
||||
|
||||
void __weak lcd_init_console_rot(struct console_t *pcons)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void lcd_init_console(void *address, int vl_cols, int vl_rows, int vl_rot)
|
||||
{
|
||||
memset(&cons, 0, sizeof(cons));
|
||||
cons.fbbase = address;
|
||||
|
||||
cons.lcdsizex = vl_cols;
|
||||
cons.lcdsizey = vl_rows;
|
||||
cons.lcdrot = vl_rot;
|
||||
|
||||
cons.fp_putc_xy = &lcd_putc_xy0;
|
||||
cons.fp_console_moverow = &console_moverow0;
|
||||
cons.fp_console_setrow = &console_setrow0;
|
||||
console_calc_rowcol(&cons, cons.lcdsizex, cons.lcdsizey);
|
||||
|
||||
lcd_init_console_rot(&cons);
|
||||
|
||||
debug("lcd_console: have %d/%d col/rws on scr %dx%d (%d deg rotated)\n",
|
||||
cons.cols, cons.rows, cons.lcdsizex, cons.lcdsizey, vl_rot);
|
||||
}
|
||||
|
||||
void lcd_putc(const char c)
|
||||
{
|
||||
if (!lcd_is_enabled) {
|
||||
serial_putc(c);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
switch (c) {
|
||||
case '\r':
|
||||
cons.curr_col = 0;
|
||||
return;
|
||||
case '\n':
|
||||
console_newline();
|
||||
|
||||
return;
|
||||
case '\t': /* Tab (8 chars alignment) */
|
||||
cons.curr_col += 8;
|
||||
cons.curr_col &= ~7;
|
||||
|
||||
if (cons.curr_col >= cons.cols)
|
||||
console_newline();
|
||||
|
||||
return;
|
||||
case '\b':
|
||||
console_back();
|
||||
|
||||
return;
|
||||
default:
|
||||
cons.fp_putc_xy(&cons,
|
||||
cons.curr_col * VIDEO_FONT_WIDTH,
|
||||
cons.curr_row * VIDEO_FONT_HEIGHT, c);
|
||||
if (++cons.curr_col >= cons.cols)
|
||||
console_newline();
|
||||
}
|
||||
}
|
||||
|
||||
void lcd_puts(const char *s)
|
||||
{
|
||||
if (!lcd_is_enabled) {
|
||||
serial_puts(s);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
while (*s)
|
||||
lcd_putc(*s++);
|
||||
|
||||
lcd_sync();
|
||||
}
|
||||
|
||||
void lcd_printf(const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[CONFIG_SYS_PBSIZE];
|
||||
|
||||
va_start(args, fmt);
|
||||
vsprintf(buf, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
lcd_puts(buf);
|
||||
}
|
||||
|
||||
static int do_lcd_setcursor(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
unsigned int col, row;
|
||||
|
||||
if (argc != 3)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
col = dectoul(argv[1], NULL);
|
||||
row = dectoul(argv[2], NULL);
|
||||
lcd_position_cursor(col, row);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int do_lcd_puts(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
if (argc != 2)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
lcd_puts(argv[1]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
setcurs, 3, 1, do_lcd_setcursor,
|
||||
"set cursor position within screen",
|
||||
" <col> <row> in character"
|
||||
);
|
||||
|
||||
U_BOOT_CMD(
|
||||
lcdputs, 2, 1, do_lcd_puts,
|
||||
"print string on lcd-framebuffer",
|
||||
" <string>"
|
||||
);
|
|
@ -1,194 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2015
|
||||
* Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <lcd.h>
|
||||
#include <video_font.h> /* Get font data, width and height */
|
||||
|
||||
static void lcd_putc_xy90(struct console_t *pcons, ushort x, ushort y, char c)
|
||||
{
|
||||
int fg_color = lcd_getfgcolor();
|
||||
int bg_color = lcd_getbgcolor();
|
||||
int col, i;
|
||||
|
||||
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
|
||||
(x+1) * pcons->lcdsizex -
|
||||
y;
|
||||
|
||||
uchar msk = 0x80;
|
||||
uchar *pfont = video_fontdata + c * VIDEO_FONT_HEIGHT;
|
||||
for (col = 0; col < VIDEO_FONT_WIDTH; ++col) {
|
||||
for (i = 0; i < VIDEO_FONT_HEIGHT; ++i)
|
||||
*dst-- = (*(pfont + i) & msk) ? fg_color : bg_color;
|
||||
msk >>= 1;
|
||||
dst += (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void console_setrow90(struct console_t *pcons, u32 row, int clr)
|
||||
{
|
||||
int i, j;
|
||||
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
|
||||
pcons->lcdsizex -
|
||||
row*VIDEO_FONT_HEIGHT+1;
|
||||
|
||||
for (j = 0; j < pcons->lcdsizey; j++) {
|
||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
||||
*dst-- = clr;
|
||||
dst += (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void console_moverow90(struct console_t *pcons,
|
||||
u32 rowdst, u32 rowsrc)
|
||||
{
|
||||
int i, j;
|
||||
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
|
||||
pcons->lcdsizex -
|
||||
(rowdst*VIDEO_FONT_HEIGHT+1);
|
||||
|
||||
fbptr_t *src = (fbptr_t *)pcons->fbbase +
|
||||
pcons->lcdsizex -
|
||||
(rowsrc*VIDEO_FONT_HEIGHT+1);
|
||||
|
||||
for (j = 0; j < pcons->lcdsizey; j++) {
|
||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
||||
*dst-- = *src--;
|
||||
src += (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
|
||||
dst += (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
|
||||
}
|
||||
}
|
||||
static void lcd_putc_xy180(struct console_t *pcons, ushort x, ushort y, char c)
|
||||
{
|
||||
int fg_color = lcd_getfgcolor();
|
||||
int bg_color = lcd_getbgcolor();
|
||||
int i, row;
|
||||
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
|
||||
pcons->lcdsizex +
|
||||
pcons->lcdsizey * pcons->lcdsizex -
|
||||
y * pcons->lcdsizex -
|
||||
(x+1);
|
||||
|
||||
for (row = 0; row < VIDEO_FONT_HEIGHT; row++) {
|
||||
uchar bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
|
||||
|
||||
for (i = 0; i < VIDEO_FONT_WIDTH; ++i) {
|
||||
*dst-- = (bits & 0x80) ? fg_color : bg_color;
|
||||
bits <<= 1;
|
||||
}
|
||||
dst -= (pcons->lcdsizex - VIDEO_FONT_WIDTH);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void console_setrow180(struct console_t *pcons, u32 row, int clr)
|
||||
{
|
||||
int i;
|
||||
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
|
||||
(pcons->rows-row-1) * VIDEO_FONT_HEIGHT *
|
||||
pcons->lcdsizex;
|
||||
|
||||
for (i = 0; i < (VIDEO_FONT_HEIGHT * pcons->lcdsizex); i++)
|
||||
*dst++ = clr;
|
||||
}
|
||||
|
||||
static inline void console_moverow180(struct console_t *pcons,
|
||||
u32 rowdst, u32 rowsrc)
|
||||
{
|
||||
int i;
|
||||
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
|
||||
(pcons->rows-rowdst-1) * VIDEO_FONT_HEIGHT *
|
||||
pcons->lcdsizex;
|
||||
|
||||
fbptr_t *src = (fbptr_t *)pcons->fbbase +
|
||||
(pcons->rows-rowsrc-1) * VIDEO_FONT_HEIGHT *
|
||||
pcons->lcdsizex;
|
||||
|
||||
for (i = 0; i < (VIDEO_FONT_HEIGHT * pcons->lcdsizex); i++)
|
||||
*dst++ = *src++;
|
||||
}
|
||||
|
||||
static void lcd_putc_xy270(struct console_t *pcons, ushort x, ushort y, char c)
|
||||
{
|
||||
int fg_color = lcd_getfgcolor();
|
||||
int bg_color = lcd_getbgcolor();
|
||||
int i, col;
|
||||
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
|
||||
pcons->lcdsizey * pcons->lcdsizex -
|
||||
(x+1) * pcons->lcdsizex +
|
||||
y;
|
||||
|
||||
uchar msk = 0x80;
|
||||
uchar *pfont = video_fontdata + c * VIDEO_FONT_HEIGHT;
|
||||
for (col = 0; col < VIDEO_FONT_WIDTH; ++col) {
|
||||
for (i = 0; i < VIDEO_FONT_HEIGHT; ++i)
|
||||
*dst++ = (*(pfont + i) & msk) ? fg_color : bg_color;
|
||||
msk >>= 1;
|
||||
dst -= (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void console_setrow270(struct console_t *pcons, u32 row, int clr)
|
||||
{
|
||||
int i, j;
|
||||
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
|
||||
row*VIDEO_FONT_HEIGHT;
|
||||
|
||||
for (j = 0; j < pcons->lcdsizey; j++) {
|
||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
||||
*dst++ = clr;
|
||||
dst += (pcons->lcdsizex - VIDEO_FONT_HEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void console_moverow270(struct console_t *pcons,
|
||||
u32 rowdst, u32 rowsrc)
|
||||
{
|
||||
int i, j;
|
||||
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
|
||||
rowdst*VIDEO_FONT_HEIGHT;
|
||||
|
||||
fbptr_t *src = (fbptr_t *)pcons->fbbase +
|
||||
rowsrc*VIDEO_FONT_HEIGHT;
|
||||
|
||||
for (j = 0; j < pcons->lcdsizey; j++) {
|
||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
||||
*dst++ = *src++;
|
||||
src += (pcons->lcdsizex - VIDEO_FONT_HEIGHT);
|
||||
dst += (pcons->lcdsizex - VIDEO_FONT_HEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
static void console_calc_rowcol_rot(struct console_t *pcons)
|
||||
{
|
||||
if (pcons->lcdrot == 1 || pcons->lcdrot == 3)
|
||||
console_calc_rowcol(pcons, pcons->lcdsizey, pcons->lcdsizex);
|
||||
else
|
||||
console_calc_rowcol(pcons, pcons->lcdsizex, pcons->lcdsizey);
|
||||
}
|
||||
|
||||
void lcd_init_console_rot(struct console_t *pcons)
|
||||
{
|
||||
if (pcons->lcdrot == 0) {
|
||||
return;
|
||||
} else if (pcons->lcdrot == 1) {
|
||||
pcons->fp_putc_xy = &lcd_putc_xy90;
|
||||
pcons->fp_console_moverow = &console_moverow90;
|
||||
pcons->fp_console_setrow = &console_setrow90;
|
||||
} else if (pcons->lcdrot == 2) {
|
||||
pcons->fp_putc_xy = &lcd_putc_xy180;
|
||||
pcons->fp_console_moverow = &console_moverow180;
|
||||
pcons->fp_console_setrow = &console_setrow180;
|
||||
} else if (pcons->lcdrot == 3) {
|
||||
pcons->fp_putc_xy = &lcd_putc_xy270;
|
||||
pcons->fp_console_moverow = &console_moverow270;
|
||||
pcons->fp_console_setrow = &console_setrow270;
|
||||
} else {
|
||||
printf("%s: invalid framebuffer rotation (%d)!\n",
|
||||
__func__, pcons->lcdrot);
|
||||
return;
|
||||
}
|
||||
console_calc_rowcol_rot(pcons);
|
||||
}
|
|
@ -24,7 +24,7 @@
|
|||
#include <display_options.h>
|
||||
#include <env.h>
|
||||
#include <splash.h>
|
||||
#include <lcd.h>
|
||||
#include <video.h>
|
||||
|
||||
static struct splash_location default_splash_locations[] = {
|
||||
{
|
||||
|
@ -39,6 +39,12 @@ static struct splash_location default_splash_locations[] = {
|
|||
.flags = SPLASH_STORAGE_FS,
|
||||
.devpart = "0:1",
|
||||
},
|
||||
{
|
||||
.name = "mmc_raw",
|
||||
.storage = SPLASH_STORAGE_MMC,
|
||||
.flags = SPLASH_STORAGE_RAW,
|
||||
.devpart = "0:1",
|
||||
},
|
||||
{
|
||||
.name = "usb_fs",
|
||||
.storage = SPLASH_STORAGE_USB,
|
||||
|
@ -113,7 +119,7 @@ void splash_get_pos(int *x, int *y)
|
|||
}
|
||||
#endif /* CONFIG_SPLASH_SCREEN_ALIGN */
|
||||
|
||||
#if defined(CONFIG_DM_VIDEO) && !defined(CONFIG_HIDE_LOGO_VERSION)
|
||||
#if defined(CONFIG_VIDEO) && !defined(CONFIG_HIDE_LOGO_VERSION)
|
||||
|
||||
#ifdef CONFIG_VIDEO_LOGO
|
||||
#include <bmp_logo.h>
|
||||
|
@ -145,12 +151,11 @@ void splash_display_banner(void)
|
|||
vidconsole_put_string(dev, buf);
|
||||
vidconsole_position_cursor(dev, 0, row);
|
||||
}
|
||||
#endif /* CONFIG_DM_VIDEO && !CONFIG_HIDE_LOGO_VERSION */
|
||||
#endif /* CONFIG_VIDEO && !CONFIG_HIDE_LOGO_VERSION */
|
||||
|
||||
/*
|
||||
* Common function to show a splash image if env("splashimage") is set.
|
||||
* Is used for both dm_video and lcd video stacks. For additional
|
||||
* details please refer to doc/README.splashprepare.
|
||||
* For additional details please refer to doc/README.splashprepare.
|
||||
*/
|
||||
#if defined(CONFIG_SPLASH_SCREEN) && defined(CONFIG_CMD_BMP)
|
||||
int splash_display(void)
|
||||
|
@ -176,7 +181,7 @@ int splash_display(void)
|
|||
if (x || y)
|
||||
goto end;
|
||||
|
||||
#if defined(CONFIG_DM_VIDEO) && !defined(CONFIG_HIDE_LOGO_VERSION)
|
||||
#if defined(CONFIG_VIDEO) && !defined(CONFIG_HIDE_LOGO_VERSION)
|
||||
splash_display_banner();
|
||||
#endif
|
||||
end:
|
||||
|
|
|
@ -65,6 +65,30 @@ static int splash_nand_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
|
|||
}
|
||||
#endif
|
||||
|
||||
static int splash_mmc_read_raw(u32 bmp_load_addr, struct splash_location *location,
|
||||
size_t read_size)
|
||||
{
|
||||
struct disk_partition partition;
|
||||
struct blk_desc *desc;
|
||||
lbaint_t blkcnt;
|
||||
int ret, n;
|
||||
|
||||
if (!IS_ENABLED(CONFIG_CMD_MMC)) {
|
||||
debug("%s: mmc support not available\n", __func__);
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
ret = part_get_info_by_dev_and_name_or_num("mmc", location->devpart, &desc,
|
||||
&partition, 1);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
blkcnt = DIV_ROUND_UP(read_size, partition.blksz);
|
||||
n = blk_dread(desc, partition.start, blkcnt, (void *)(uintptr_t)bmp_load_addr);
|
||||
|
||||
return (n == blkcnt) ? 0 : -EIO;
|
||||
}
|
||||
|
||||
static int splash_storage_read_raw(struct splash_location *location,
|
||||
u32 bmp_load_addr, size_t read_size)
|
||||
{
|
||||
|
@ -75,6 +99,8 @@ static int splash_storage_read_raw(struct splash_location *location,
|
|||
|
||||
offset = location->offset;
|
||||
switch (location->storage) {
|
||||
case SPLASH_STORAGE_MMC:
|
||||
return splash_mmc_read_raw(bmp_load_addr, location, read_size);
|
||||
case SPLASH_STORAGE_NAND:
|
||||
return splash_nand_read_raw(bmp_load_addr, offset, read_size);
|
||||
case SPLASH_STORAGE_SF:
|
||||
|
@ -422,6 +448,7 @@ int splash_source_load(struct splash_location *locations, uint size)
|
|||
{
|
||||
struct splash_location *splash_location;
|
||||
char *env_splashimage_value;
|
||||
char *devpart;
|
||||
u32 bmp_load_addr;
|
||||
|
||||
env_splashimage_value = env_get("splashimage");
|
||||
|
@ -438,6 +465,10 @@ int splash_source_load(struct splash_location *locations, uint size)
|
|||
if (!splash_location)
|
||||
return -EINVAL;
|
||||
|
||||
devpart = env_get("splashdevpart");
|
||||
if (devpart)
|
||||
splash_location->devpart = devpart;
|
||||
|
||||
if (splash_location->flags == SPLASH_STORAGE_RAW)
|
||||
return splash_load_raw(splash_location, bmp_load_addr);
|
||||
else if (splash_location->flags == SPLASH_STORAGE_FS)
|
||||
|
|
|
@ -200,7 +200,7 @@ struct stdio_dev *stdio_get_by_name(const char *name)
|
|||
if (strcmp(sdev->name, name) == 0)
|
||||
return sdev;
|
||||
}
|
||||
if (IS_ENABLED(CONFIG_DM_VIDEO)) {
|
||||
if (IS_ENABLED(CONFIG_VIDEO)) {
|
||||
/*
|
||||
* We did not find a suitable stdio device. If there is a video
|
||||
* driver with a name starting with 'vidconsole', we can try
|
||||
|
@ -340,7 +340,7 @@ int stdio_add_devices(void)
|
|||
#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY)
|
||||
i2c_init_all();
|
||||
#endif
|
||||
if (IS_ENABLED(CONFIG_DM_VIDEO)) {
|
||||
if (IS_ENABLED(CONFIG_VIDEO)) {
|
||||
/*
|
||||
* If the console setting is not in environment variables then
|
||||
* console_init_r() will not be calling iomux_doenv() (which
|
||||
|
@ -366,11 +366,6 @@ int stdio_add_devices(void)
|
|||
if (IS_ENABLED(CONFIG_SPLASH_SCREEN) &&
|
||||
IS_ENABLED(CONFIG_CMD_BMP))
|
||||
splash_display();
|
||||
} else {
|
||||
if (IS_ENABLED(CONFIG_LCD))
|
||||
drv_lcd_init();
|
||||
if (IS_ENABLED(CONFIG_VIDEO_VCXK))
|
||||
drv_video_init();
|
||||
}
|
||||
|
||||
drv_system_init();
|
||||
|
|
|
@ -131,7 +131,6 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0451
|
|||
CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
|
||||
CONFIG_USB_ETHER=y
|
||||
CONFIG_SYS_WHITE_ON_BLACK=y
|
||||
CONFIG_AM335X_LCD=y
|
||||
CONFIG_BMP_16BPP=y
|
||||
CONFIG_SPL_WDT=y
|
||||
# CONFIG_SPL_USE_TINY_PRINTF is not set
|
||||
|
|
|
@ -113,7 +113,7 @@ CONFIG_SYSRESET=y
|
|||
CONFIG_SYSRESET_WATCHDOG=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
CONFIG_VIDEO_LOGO=y
|
||||
CONFIG_SYS_WHITE_ON_BLACK=y
|
||||
CONFIG_DISPLAY=y
|
||||
|
|
|
@ -113,7 +113,7 @@ CONFIG_SYSRESET=y
|
|||
CONFIG_SYSRESET_WATCHDOG=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
CONFIG_VIDEO_LOGO=y
|
||||
CONFIG_SYS_WHITE_ON_BLACK=y
|
||||
CONFIG_DISPLAY=y
|
||||
|
|
|
@ -71,7 +71,7 @@ CONFIG_ATMEL_PIT_TIMER=y
|
|||
CONFIG_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
# CONFIG_VIDEO_BPP8 is not set
|
||||
# CONFIG_VIDEO_BPP32 is not set
|
||||
CONFIG_ATMEL_HLCD=y
|
||||
|
|
|
@ -68,7 +68,7 @@ CONFIG_ATMEL_PIT_TIMER=y
|
|||
CONFIG_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
# CONFIG_VIDEO_BPP8 is not set
|
||||
# CONFIG_VIDEO_BPP32 is not set
|
||||
CONFIG_ATMEL_HLCD=y
|
||||
|
|
|
@ -70,7 +70,7 @@ CONFIG_ATMEL_PIT_TIMER=y
|
|||
CONFIG_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
# CONFIG_VIDEO_BPP8 is not set
|
||||
# CONFIG_VIDEO_BPP32 is not set
|
||||
CONFIG_ATMEL_HLCD=y
|
||||
|
|
|
@ -72,7 +72,7 @@ CONFIG_ATMEL_PIT_TIMER=y
|
|||
CONFIG_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
# CONFIG_VIDEO_BPP8 is not set
|
||||
# CONFIG_VIDEO_BPP32 is not set
|
||||
CONFIG_ATMEL_HLCD=y
|
||||
|
|
|
@ -61,7 +61,7 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0xfada
|
|||
CONFIG_USB_GADGET_DWC2_OTG=y
|
||||
CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y
|
||||
CONFIG_USB_GADGET_DOWNLOAD=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
# CONFIG_VIDEO_BPP8 is not set
|
||||
# CONFIG_VIDEO_BPP16 is not set
|
||||
CONFIG_SYS_WHITE_ON_BLACK=y
|
||||
|
|
|
@ -62,7 +62,7 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0xfada
|
|||
CONFIG_USB_GADGET_DWC2_OTG=y
|
||||
CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y
|
||||
CONFIG_USB_GADGET_DOWNLOAD=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
# CONFIG_VIDEO_BPP8 is not set
|
||||
# CONFIG_VIDEO_BPP16 is not set
|
||||
CONFIG_SYS_WHITE_ON_BLACK=y
|
||||
|
|
|
@ -62,7 +62,7 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0xfada
|
|||
CONFIG_USB_GADGET_DWC2_OTG=y
|
||||
CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y
|
||||
CONFIG_USB_GADGET_DOWNLOAD=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
# CONFIG_VIDEO_BPP8 is not set
|
||||
# CONFIG_VIDEO_BPP16 is not set
|
||||
CONFIG_SYS_WHITE_ON_BLACK=y
|
||||
|
|
|
@ -62,7 +62,7 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0xfada
|
|||
CONFIG_USB_GADGET_DWC2_OTG=y
|
||||
CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y
|
||||
CONFIG_USB_GADGET_DOWNLOAD=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
# CONFIG_VIDEO_BPP8 is not set
|
||||
# CONFIG_VIDEO_BPP16 is not set
|
||||
CONFIG_SYS_WHITE_ON_BLACK=y
|
||||
|
|
|
@ -99,7 +99,7 @@ CONFIG_USB=y
|
|||
# CONFIG_SPL_DM_USB is not set
|
||||
CONFIG_USB_DWC2=y
|
||||
CONFIG_ROCKCHIP_USB2_PHY=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
# CONFIG_VIDEO_BPP8 is not set
|
||||
CONFIG_DISPLAY=y
|
||||
CONFIG_VIDEO_ROCKCHIP=y
|
||||
|
|
|
@ -110,7 +110,7 @@ CONFIG_USB_ETHER_ASIX88179=y
|
|||
CONFIG_USB_ETHER_MCS7830=y
|
||||
CONFIG_USB_ETHER_RTL8152=y
|
||||
CONFIG_USB_ETHER_SMSC95XX=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
CONFIG_DISPLAY=y
|
||||
CONFIG_VIDEO_ROCKCHIP=y
|
||||
CONFIG_VIDEO_ROCKCHIP_MAX_XRES=1280
|
||||
|
|
|
@ -106,7 +106,7 @@ CONFIG_USB=y
|
|||
# CONFIG_SPL_DM_USB is not set
|
||||
CONFIG_USB_DWC2=y
|
||||
CONFIG_ROCKCHIP_USB2_PHY=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
# CONFIG_VIDEO_BPP8 is not set
|
||||
CONFIG_CONSOLE_TRUETYPE=y
|
||||
CONFIG_DISPLAY=y
|
||||
|
|
|
@ -111,7 +111,7 @@ CONFIG_USB_ETHER_ASIX88179=y
|
|||
CONFIG_USB_ETHER_MCS7830=y
|
||||
CONFIG_USB_ETHER_RTL8152=y
|
||||
CONFIG_USB_ETHER_SMSC95XX=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
CONFIG_DISPLAY=y
|
||||
CONFIG_VIDEO_ROCKCHIP=y
|
||||
CONFIG_VIDEO_ROCKCHIP_MAX_XRES=2400
|
||||
|
|
|
@ -105,7 +105,7 @@ CONFIG_USB=y
|
|||
# CONFIG_SPL_DM_USB is not set
|
||||
CONFIG_USB_DWC2=y
|
||||
CONFIG_ROCKCHIP_USB2_PHY=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
# CONFIG_VIDEO_BPP8 is not set
|
||||
CONFIG_DISPLAY=y
|
||||
CONFIG_VIDEO_ROCKCHIP=y
|
||||
|
|
|
@ -101,7 +101,7 @@ CONFIG_USB=y
|
|||
# CONFIG_SPL_DM_USB is not set
|
||||
CONFIG_USB_DWC2=y
|
||||
CONFIG_ROCKCHIP_USB2_PHY=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
# CONFIG_VIDEO_BPP8 is not set
|
||||
CONFIG_CONSOLE_TRUETYPE=y
|
||||
CONFIG_DISPLAY=y
|
||||
|
|
|
@ -112,7 +112,7 @@ CONFIG_MXC_SPI=y
|
|||
CONFIG_USB=y
|
||||
CONFIG_USB_KEYBOARD=y
|
||||
CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_VIDEO=y
|
||||
CONFIG_VIDEO_LOGO=y
|
||||
CONFIG_VIDEO_IPUV3=y
|
||||
CONFIG_SPLASH_SCREEN=y
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue