Skip to content

Commit 0cbc0f5

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

File tree

2 files changed

+44
-229
lines changed

2 files changed

+44
-229
lines changed
1.82 MB
Loading

source/linux/Foundational_Components/U-Boot/Apps-Splash-Screen.rst

Lines changed: 44 additions & 229 deletions
Original file line numberDiff line numberDiff line change
@@ -10,247 +10,62 @@ U-Boot Splash Screen
1010
.. rubric:: AM335x
1111
:name: am335x
1212

13-
All the code below is based on Processor Linux SDK 03.02.00..05.
13+
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
14+
the vendor logo which helps with branding and identification of which boot image is being used for the bootup.
15+
All the code related to u-boto splash screen support is based on Processor Linux SDK 09.03.05.02.
1416

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:
17+
For AM335x, splash screen is enabled in u-boot which uses the LCDC driver.
18+
On AM335x evm, the LCD backlight is controlled using enhanced Auxiliary(eCAP0) PWM.
19+
To use this, enable following configurations in configs/am335x_evm_defconfig.
1820

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.
21+
.. code-block:: kconfig
2322
24-
.. code-block:: text
23+
CONFIG_SPLASH_SCREEN=y
24+
CONFIG_SPLASH_SOURCE=y
25+
CONFIG_SPLASH_SCREEN_ALIGN=y
26+
CONFIG_HIDE_LOGO_VERSION=y
27+
CONFIG_AM335X_LCD=y
28+
CONFIG_VIDEO_BMP_GZIP=y
29+
CONFIG_BMP_24BPP=y
30+
CONFIG_BMP_32BPP=y
31+
CONFIG_BMP=y
32+
CONFIG_VIDEO=y
33+
CONFIG_CMD_BMP=y
34+
CONFIG_SYSCON=y
35+
CONFIG_REGMAP=y
36+
CONFIG_CLK_CCF=y
37+
CONFIG_CLK_TI_AM3_DPLL=y
38+
CONFIG_CLK_TI_DIVIDER=y
39+
CONFIG_CLK_TI_MUX=y
40+
CONFIG_DM_PWM=y
41+
CONFIG_BACKLIGHT_PWM=y
42+
CONFIG_PWM_TI_ECAP=y
2543
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
44+
.. rubric:: Display Image using U-Boot command line
45+
:name: Display Image
3446

35-
In include/configs/am335x\_evm.h, add support for the splash screen,
36-
LCDC, and gzipped bitmaps.
47+
To test the display and video driver in U-Boot, run the following commands at U-Boot console:
3748

38-
::
49+
.. code-block:: console
3950
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
51+
#To see all the files in your boot partition run
52+
=> ls mmc 0
4753
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
54+
#To load image
55+
=> fatload mmc 0 $loadaddr ti_logo_414x97_32bpp.bmp.gz
5456
55-
In arch/arm/cpu/armv7/am33xx/clock\_am33xx.c enable the LCDC clocks.
57+
#To display image
58+
=> bmp display $loadaddr m m
5659
57-
::
60+
The above command will display an image at the centre of the screen as below
5861

59-
&cmrtc->rtcclkctrl,
60-
&cmper->usb0clkctrl,
61-
&cmper->emiffwclkctrl,
62-
&cmper->emifclkctrl,
63-
&cmper->lcdclkctrl,
64-
&cmper->lcdcclkstctrl,
65-
&cmper->epwmss2clkctrl,
66-
0
62+
.. Image:: /images/AM335x_evm_uboot_splash_screen.jpg
63+
:width: 600
6764

68-
In board.c add includes for mmc, fat, lcd, and the frame buffer.
65+
User can use the custom image to display the splash screen.
6966

70-
::
67+
.. code-block:: console
7168
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>
78-
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.
81-
82-
::
83-
84-
#define GPIO_ETH1_MODE GPIO_TO_PIN(1, 26)
85-
86-
/* GPIO that controls backlight on EVM-SK */
87-
#define GPIO_BACKLIGHT_EN GPIO_TO_PIN(3, 17)
88-
89-
In board\_late\_init call the splash screen routine.
90-
91-
::
92-
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()) {
69+
#To get the BMP image info
70+
=> bmp info
25671

0 commit comments

Comments
 (0)