Skip to content

Commit 5159030

Browse files
Sukrut Bellarypraneethbajjuri
authored andcommitted
docs(u-boot): AM335X: Update splash screen details for 09.03.05.02
Update the splash screen details with defconfig changes to enable the splash screen with backlight. Add steps to test the splash screen. Add the reference output image on AM335x EVM. Signed-off-by: Sukrut Bellary <[email protected]>
1 parent 5e6ffe4 commit 5159030

File tree

2 files changed

+53
-224
lines changed

2 files changed

+53
-224
lines changed
1.82 MB
Loading
Lines changed: 53 additions & 224 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. http://processors.wiki.ti.com/index.php/Processor_SDK_Linux_U-Boot_Splash_Screen
2-
.. highlight:: c
31

42
U-Boot Splash Screen
53
==========================
@@ -10,247 +8,78 @@ U-Boot Splash Screen
108
.. rubric:: AM335x
119
:name: am335x
1210

13-
All the code below is based on Processor Linux SDK 03.02.00..05.
11+
A splash screen is an introductory screen the user sees over the display when the device boots up. Splash screens are typically used to provide feedback to the user that the board is booting up and to showcase
12+
the vendor logo, which helps with branding and identification of which boot image is used for the bootup.
13+
All the code related to u-boot splash screen support is based on Processor Linux SDK 09.03.05.02.
1414

15-
There is a frame buffer driver for am335x in the drivers/video directory
16-
called am3355x-fb.c. It makes calls to routines in board.c to set up the
17-
LCDC and frame buffer. To use it:
15+
For AM335x, the splash screen is enabled in u-boot which uses the LCDC driver.
16+
On AM335x EVM, the LCD backlight is controlled using enhanced Auxiliary(eCAP0) PWM.
17+
Enable the following configurations in :file:`configs/am335x_evm_defconfig` to use this.
1818

19-
Either create a new defconfig in the configs directory or just add
20-
SPLASH to CONFIG\_SYS\_EXTRA\_OPTIONS. In this example the
21-
am335x\_evm\_defconfig is copied into a new one called
22-
am335x\_evm\_splash\_defconfig.
19+
.. code-block:: kconfig
2320
24-
.. code-block:: text
21+
CONFIG_SPLASH_SCREEN=y
22+
CONFIG_SPLASH_SOURCE=y
23+
CONFIG_SPLASH_SCREEN_ALIGN=y
24+
CONFIG_HIDE_LOGO_VERSION=y
25+
CONFIG_AM335X_LCD=y
26+
CONFIG_VIDEO_BMP_GZIP=y
27+
CONFIG_BMP_24BPP=y
28+
CONFIG_BMP_32BPP=y
29+
CONFIG_BMP=y
30+
CONFIG_VIDEO=y
31+
CONFIG_CMD_BMP=y
32+
CONFIG_SYSCON=y
33+
CONFIG_REGMAP=y
34+
CONFIG_CLK_CCF=y
35+
CONFIG_CLK_TI_AM3_DPLL=y
36+
CONFIG_CLK_TI_DIVIDER=y
37+
CONFIG_CLK_TI_MUX=y
38+
CONFIG_DM_PWM=y
39+
CONFIG_BACKLIGHT_PWM=y
40+
CONFIG_PWM_TI_ECAP=y
2541
26-
CONFIG_TARGET_AM335X_EVM=y
27-
CONFIG_SPL_STACK_R_ADDR=0x82000000
28-
CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
29-
CONFIG_SPL=y
30-
CONFIG_SPL_STACK_R=y
31-
CONFIG_SYS_EXTRA_OPTIONS="NAND,SPLASH"
32-
CONFIG_HUSH_PARSER=y
33-
CONFIG_AUTOBOOT_KEYED=y
42+
If the user is using enhanced High Resolution PWM(eHRPWM) to control the display backlight,
43+
enable the following config.
3444

35-
In include/configs/am335x\_evm.h, add support for the splash screen,
36-
LCDC, and gzipped bitmaps.
3745

38-
::
46+
.. code-block:: kconfig
3947
40-
/* Splash scrren support */
41-
#ifdef CONFIG_SPLASH
42-
#define CONFIG_AM335X_LCD
43-
#define CONFIG_LCD
44-
#define CONFIG_LCD_NOSTDOUT
45-
#define CONFIG_SYS_WHITE_ON_BLACK
46-
#define LCD_BPP LCD_COLOR16
48+
CONFIG_CLK_TI_GATE=y
4749
48-
#define CONFIG_VIDEO_BMP_GZIP
49-
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (1366*767*4)
50-
#define CONFIG_CMD_UNZIP
51-
#define CONFIG_CMD_BMP
52-
#define CONFIG_BMP_16BPP
53-
#endif
50+
.. rubric:: Features supported
5451

55-
In arch/arm/cpu/armv7/am33xx/clock\_am33xx.c enable the LCDC clocks.
52+
The following features are supported and validated on am335x EVM:
5653

57-
::
54+
#. Supports 32, 24, and 8 bits per pixel BMP image.
55+
#. Supports displaying only BMP and compressed BMP images(gzip).
56+
#. Supports MMC as bmp image sources.
5857

59-
&cmrtc->rtcclkctrl,
60-
&cmper->usb0clkctrl,
61-
&cmper->emiffwclkctrl,
62-
&cmper->emifclkctrl,
63-
&cmper->lcdclkctrl,
64-
&cmper->lcdcclkstctrl,
65-
&cmper->epwmss2clkctrl,
66-
0
58+
.. rubric:: Display Image using U-Boot command line
59+
:name: Display Image
6760

68-
In board.c add includes for mmc, fat, lcd, and the frame buffer.
61+
To test the display and video driver in U-Boot, run the following commands at the U-Boot console:
6962

70-
::
63+
.. code-block:: console
7164
72-
#include <libfdt.h>
73-
#include <fdt_support.h>
74-
#include <mmc.h>
75-
#include <fat.h>
76-
#include <lcd.h>
77-
#include <../../../drivers/video/am335x-fb.h>
65+
#To see all the files in your boot partition, run
66+
=> ls mmc 0
7867
79-
This example code is based on the AM335x Starter Kit. A GPIO controls
80-
the backlight so use GPIO\_TO\_PIN to define the GPIO.
68+
#To load the image
69+
=> fatload mmc 0 $loadaddr ti_logo_414x97_32bpp.bmp.gz
8170
82-
::
71+
#To display the image
72+
=> bmp display $loadaddr m m
8373
84-
#define GPIO_ETH1_MODE GPIO_TO_PIN(1, 26)
74+
The above command will display an image at the center of the screen as shown below.
8575

86-
/* GPIO that controls backlight on EVM-SK */
87-
#define GPIO_BACKLIGHT_EN GPIO_TO_PIN(3, 17)
76+
.. Image:: /images/AM335x_evm_uboot_splash_screen.jpg
77+
:width: 600
8878

89-
In board\_late\_init call the splash screen routine.
79+
User can use the custom image to display the splash screen.
9080

91-
::
81+
.. code-block:: console
9282
93-
#if !defined(CONFIG_SPL_BUILD)
94-
splash_screen();
95-
/* try reading mac address from efuse */
96-
mac_lo = readl(&cdev->macid0l);
97-
mac_hi = readl(&cdev->macid0h);
98-
99-
The following routines enable the backlight, load the LCD timings (this
100-
example is based on Starter Kit), power on the LCD and enable it, then
101-
finally the splash screen code that registers a fat file system on mmc0.
102-
The gzipped bitmap is named splash.bmp.gz and is displayed with
103-
bmp\_display.
104-
105-
.. code-block:: text
106-
107-
#if defined(CONFIG_LCD) && defined(CONFIG_AM335X_LCD) && \
108-
 !defined(CONFIG_SPL_BUILD)
109-
void lcdbacklight(int on)
110-
{
111-
gpio_request(GPIO_BACKLIGHT_EN, "backlight_en");
112-
if (on)
113-
gpio_direction_output(GPIO_BACKLIGHT_EN, 0);
114-
else
115-
gpio_direction_output(GPIO_BACKLIGHT_EN, 1);
116-
}
117-
118-
int load_lcdtiming(struct am335x_lcdpanel *panel)
119-
{
120-
struct am335x_lcdpanel pnltmp;
121-
122-
pnltmp.hactive = 480;
123-
pnltmp.vactive = 272;
124-
pnltmp.bpp = 16;
125-
pnltmp.hfp = 8;
126-
pnltmp.hbp = 43;
127-
pnltmp.hsw = 4;
128-
pnltmp.vfp = 4;
129-
pnltmp.vbp = 12;
130-
pnltmp.vsw = 10;
131-
pnltmp.pxl_clk_div = 2;
132-
pnltmp.pol = 0;
133-
pnltmp.pup_delay = 1;
134-
pnltmp.pon_delay = 1;
135-
panel_info.vl_rot = 0;
136-
137-
memcpy((void *)panel, (void *)&pnltmp, sizeof(struct am335x_lcdpanel));
138-
139-
return 0;
140-
}
141-
142-
void lcdpower(int on)
143-
{
144-
lcd_enable();
145-
}
146-
147-
vidinfo_t panel_info = {
148-
.vl_col = 480,
149-
.vl_row = 272,
150-
.vl_bpix = 4,
151-
.priv = 0
152-
};
153-
154-
void lcd_ctrl_init(void *lcdbase)
155-
{
156-
struct am335x_lcdpanel lcd_panel;
157-
158-
memset(&lcd_panel, 0, sizeof(struct am335x_lcdpanel));
159-
if (load_lcdtiming(&lcd_panel) != 0)
160-
return;
161-
162-
lcd_panel.panel_power_ctrl = &lcdpower;
163-
164-
if (am335xfb_init(&lcd_panel) != 0)
165-
printf("ERROR: failed to initialize video!");
166-
167-
/* Modify panel into to real resolution */
168-
panel_info.vl_col = lcd_panel.hactive;
169-
panel_info.vl_row = lcd_panel.vactive;
170-
171-
// lcd_set_flush_dcache(1);
172-
}
173-
174-
void lcd_enable(void)
175-
{
176-
lcdbacklight(1);
177-
}
178-
179-
void splash_screen(void)
180-
{
181-
struct mmc *mmc = NULL;
182-
int err;
183-
184-
mmc = find_mmc_device(0);
185-
if (!mmc)
186-
printf("Error finding mmc device\n");
187-
188-
mmc_init(mmc);
189-
190-
err = fat_register_device(&mmc->block_dev,
191-
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION);
192-
193-
if (!err) {
194-
err = file_fat_read("splash.bmp.gz", (void *)0x82000000, 0);
195-
bmp_display(0x82000000, 0, 0);
196-
}
197-
}
198-
#endif
199-
200-
In mux.c define the LCDC pin mux.
201-
202-
::
203-
204-
#ifdef CONFIG_AM335X_LCD
205-
static struct module_pin_mux lcd_pin_mux[] = {
206-
{OFFSET(lcd_data0), (MODE(0) | PULLUDDIS)}, /* LCD-Data(0) */
207-
{OFFSET(lcd_data1), (MODE(0) | PULLUDDIS)}, /* LCD-Data(1) */
208-
{OFFSET(lcd_data2), (MODE(0) | PULLUDDIS)}, /* LCD-Data(2) */
209-
{OFFSET(lcd_data3), (MODE(0) | PULLUDDIS)}, /* LCD-Data(3) */
210-
{OFFSET(lcd_data4), (MODE(0) | PULLUDDIS)}, /* LCD-Data(4) */
211-
{OFFSET(lcd_data5), (MODE(0) | PULLUDDIS)}, /* LCD-Data(5) */
212-
{OFFSET(lcd_data6), (MODE(0) | PULLUDDIS)}, /* LCD-Data(6) */
213-
{OFFSET(lcd_data7), (MODE(0) | PULLUDDIS)}, /* LCD-Data(7) */
214-
{OFFSET(lcd_data8), (MODE(0) | PULLUDDIS)}, /* LCD-Data(8) */
215-
{OFFSET(lcd_data9), (MODE(0) | PULLUDDIS)}, /* LCD-Data(9) */
216-
{OFFSET(lcd_data10), (MODE(0) | PULLUDDIS)}, /* LCD-Data(10) */
217-
{OFFSET(lcd_data11), (MODE(0) | PULLUDDIS)}, /* LCD-Data(11) */
218-
{OFFSET(lcd_data12), (MODE(0) | PULLUDDIS)}, /* LCD-Data(12) */
219-
{OFFSET(lcd_data13), (MODE(0) | PULLUDDIS)}, /* LCD-Data(13) */
220-
{OFFSET(lcd_data14), (MODE(0) | PULLUDDIS)}, /* LCD-Data(14) */
221-
{OFFSET(lcd_data15), (MODE(0) | PULLUDDIS)}, /* LCD-Data(15) */
222-
{OFFSET(gpmc_ad8), (MODE(1) | PULLUDDIS)}, /* LCD-Data(16) */
223-
{OFFSET(gpmc_ad9), (MODE(1) | PULLUDDIS)}, /* LCD-Data(17) */
224-
{OFFSET(gpmc_ad10), (MODE(1) | PULLUDDIS)}, /* LCD-Data(18) */
225-
{OFFSET(gpmc_ad11), (MODE(1) | PULLUDDIS)}, /* LCD-Data(19) */
226-
{OFFSET(gpmc_ad12), (MODE(1) | PULLUDDIS)}, /* LCD-Data(20) */
227-
{OFFSET(gpmc_ad13), (MODE(1) | PULLUDDIS)}, /* LCD-Data(21) */
228-
{OFFSET(gpmc_ad14), (MODE(1) | PULLUDDIS)}, /* LCD-Data(22) */
229-
{OFFSET(gpmc_ad15), (MODE(1) | PULLUDDIS)}, /* LCD-Data(23) */
230-
{OFFSET(lcd_vsync), (MODE(0) | PULLUDDIS)}, /* LCD-VSync */
231-
{OFFSET(lcd_hsync), (MODE(0) | PULLUDDIS)}, /* LCD-HSync */
232-
{OFFSET(lcd_ac_bias_en), (MODE(0) | PULLUDDIS)},/* LCD-DE */
233-
{OFFSET(lcd_pclk), (MODE(0) | PULLUDDIS)}, /* LCD-CLK */
234-
235-
/* backlight */
236-
{OFFSET(mcasp0_ahclkr), (MODE(7) | PULLUDDIS)}, /* mcasp0_gpio */
237-
238-
{-1},
239-
};
240-
#endif
241-
242-
And enable the LCD.
243-
244-
::
245-
246-
} else if (board_is_evm_sk()) {
247-
/* Starter Kit EVM */
248-
configure_module_pin_mux(i2c1_pin_mux);
249-
configure_module_pin_mux(gpio0_7_pin_mux);
250-
configure_module_pin_mux(rgmii1_pin_mux);
251-
configure_module_pin_mux(mmc0_pin_mux_sk_evm);
252-
#ifdef CONFIG_AM335X_LCD
253-
configure_module_pin_mux(lcd_pin_mux);
254-
#endif
255-
} else if (board_is_bone_lt()) {
83+
#To get the BMP image info
84+
=> bmp info
25685

0 commit comments

Comments
 (0)