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