xref: /OK3568_Linux_fs/u-boot/include/splash.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright (C) 2013, Boundary Devices <info@boundarydevices.com>
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * See file CREDITS for list of people who contributed to this
5*4882a593Smuzhiyun  * project.
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * This program is free software; you can redistribute it and/or
8*4882a593Smuzhiyun  * modify it under the terms of the GNU General Public License as
9*4882a593Smuzhiyun  * published by the Free Software Foundation; either version 2 of
10*4882a593Smuzhiyun  * the License, or (at your option) any later version.
11*4882a593Smuzhiyun  *
12*4882a593Smuzhiyun  * This program is distributed in the hope that it will be useful,
13*4882a593Smuzhiyun  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14*4882a593Smuzhiyun  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
15*4882a593Smuzhiyun  * GNU General Public License for more details.
16*4882a593Smuzhiyun  *
17*4882a593Smuzhiyun  * You should have received a copy of the GNU General Public License
18*4882a593Smuzhiyun  * along with this program; if not, write to the Free Software
19*4882a593Smuzhiyun  * Foundation, Inc., http://www.fsf.org/about/contact/
20*4882a593Smuzhiyun  */
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun #ifndef _SPLASH_H_
23*4882a593Smuzhiyun #define _SPLASH_H_
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun #include <errno.h>
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun enum splash_storage {
28*4882a593Smuzhiyun 	SPLASH_STORAGE_NAND,
29*4882a593Smuzhiyun 	SPLASH_STORAGE_SF,
30*4882a593Smuzhiyun 	SPLASH_STORAGE_MMC,
31*4882a593Smuzhiyun 	SPLASH_STORAGE_USB,
32*4882a593Smuzhiyun 	SPLASH_STORAGE_SATA,
33*4882a593Smuzhiyun };
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun enum splash_flags {
36*4882a593Smuzhiyun 	SPLASH_STORAGE_RAW, /* Stored in raw memory */
37*4882a593Smuzhiyun 	SPLASH_STORAGE_FS,  /* Stored within a file system */
38*4882a593Smuzhiyun 	SPLASH_STORAGE_FIT, /* Stored inside a FIT image */
39*4882a593Smuzhiyun };
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun struct splash_location {
42*4882a593Smuzhiyun 	char *name;
43*4882a593Smuzhiyun 	enum splash_storage storage;
44*4882a593Smuzhiyun 	enum splash_flags flags;
45*4882a593Smuzhiyun 	u32 offset;	/* offset from start of storage */
46*4882a593Smuzhiyun 	char *devpart;  /* Use the load command dev:part conventions */
47*4882a593Smuzhiyun 	char *mtdpart;	/* MTD partition for ubi part */
48*4882a593Smuzhiyun 	char *ubivol;	/* UBI volume-name for ubifsmount */
49*4882a593Smuzhiyun };
50*4882a593Smuzhiyun 
51*4882a593Smuzhiyun #ifdef CONFIG_SPLASH_SOURCE
52*4882a593Smuzhiyun int splash_source_load(struct splash_location *locations, uint size);
53*4882a593Smuzhiyun #else
splash_source_load(struct splash_location * locations,uint size)54*4882a593Smuzhiyun static inline int splash_source_load(struct splash_location *locations,
55*4882a593Smuzhiyun 				     uint size)
56*4882a593Smuzhiyun {
57*4882a593Smuzhiyun 	return 0;
58*4882a593Smuzhiyun }
59*4882a593Smuzhiyun #endif
60*4882a593Smuzhiyun 
61*4882a593Smuzhiyun int splash_screen_prepare(void);
62*4882a593Smuzhiyun 
63*4882a593Smuzhiyun #ifdef CONFIG_SPLASH_SCREEN_ALIGN
64*4882a593Smuzhiyun void splash_get_pos(int *x, int *y);
65*4882a593Smuzhiyun #else
splash_get_pos(int * x,int * y)66*4882a593Smuzhiyun static inline void splash_get_pos(int *x, int *y) { }
67*4882a593Smuzhiyun #endif
68*4882a593Smuzhiyun 
69*4882a593Smuzhiyun #if defined(CONFIG_SPLASH_SCREEN) && defined(CONFIG_LCD)
70*4882a593Smuzhiyun int lcd_splash(ulong addr);
71*4882a593Smuzhiyun #else
lcd_splash(ulong addr)72*4882a593Smuzhiyun static inline int lcd_splash(ulong addr)
73*4882a593Smuzhiyun {
74*4882a593Smuzhiyun 	return -ENOSYS;
75*4882a593Smuzhiyun }
76*4882a593Smuzhiyun #endif
77*4882a593Smuzhiyun 
78*4882a593Smuzhiyun #define BMP_ALIGN_CENTER	0x7FFF
79*4882a593Smuzhiyun 
80*4882a593Smuzhiyun #endif
81