1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-only 2*4882a593Smuzhiyun 3*4882a593Smuzhiyun /* 4*4882a593Smuzhiyun * Linux logo to be displayed on boot 5*4882a593Smuzhiyun * 6*4882a593Smuzhiyun * Copyright (C) 1996 Larry Ewing (lewing@isc.tamu.edu) 7*4882a593Smuzhiyun * Copyright (C) 1996,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 8*4882a593Smuzhiyun * Copyright (C) 2001 Greg Banks <gnb@alphalink.com.au> 9*4882a593Smuzhiyun * Copyright (C) 2001 Jan-Benedict Glaw <jbglaw@lug-owl.de> 10*4882a593Smuzhiyun * Copyright (C) 2003 Geert Uytterhoeven <geert@linux-m68k.org> 11*4882a593Smuzhiyun */ 12*4882a593Smuzhiyun 13*4882a593Smuzhiyun #include <linux/linux_logo.h> 14*4882a593Smuzhiyun #include <linux/stddef.h> 15*4882a593Smuzhiyun #include <linux/module.h> 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun #ifdef CONFIG_M68K 18*4882a593Smuzhiyun #include <asm/setup.h> 19*4882a593Smuzhiyun #endif 20*4882a593Smuzhiyun 21*4882a593Smuzhiyun static bool nologo; 22*4882a593Smuzhiyun module_param(nologo, bool, 0); 23*4882a593Smuzhiyun MODULE_PARM_DESC(nologo, "Disables startup logo"); 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun /* 26*4882a593Smuzhiyun * Logos are located in the initdata, and will be freed in kernel_init. 27*4882a593Smuzhiyun * Use late_init to mark the logos as freed to prevent any further use. 28*4882a593Smuzhiyun */ 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun static bool logos_freed; 31*4882a593Smuzhiyun fb_logo_late_init(void)32*4882a593Smuzhiyunstatic int __init fb_logo_late_init(void) 33*4882a593Smuzhiyun { 34*4882a593Smuzhiyun logos_freed = true; 35*4882a593Smuzhiyun return 0; 36*4882a593Smuzhiyun } 37*4882a593Smuzhiyun 38*4882a593Smuzhiyun late_initcall_sync(fb_logo_late_init); 39*4882a593Smuzhiyun 40*4882a593Smuzhiyun /* logo's are marked __initdata. Use __ref to tell 41*4882a593Smuzhiyun * modpost that it is intended that this function uses data 42*4882a593Smuzhiyun * marked __initdata. 43*4882a593Smuzhiyun */ fb_find_logo(int depth)44*4882a593Smuzhiyunconst struct linux_logo * __ref fb_find_logo(int depth) 45*4882a593Smuzhiyun { 46*4882a593Smuzhiyun const struct linux_logo *logo = NULL; 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun if (nologo || logos_freed) 49*4882a593Smuzhiyun return NULL; 50*4882a593Smuzhiyun 51*4882a593Smuzhiyun if (depth >= 1) { 52*4882a593Smuzhiyun #ifdef CONFIG_LOGO_LINUX_MONO 53*4882a593Smuzhiyun /* Generic Linux logo */ 54*4882a593Smuzhiyun logo = &logo_linux_mono; 55*4882a593Smuzhiyun #endif 56*4882a593Smuzhiyun #ifdef CONFIG_LOGO_SUPERH_MONO 57*4882a593Smuzhiyun /* SuperH Linux logo */ 58*4882a593Smuzhiyun logo = &logo_superh_mono; 59*4882a593Smuzhiyun #endif 60*4882a593Smuzhiyun } 61*4882a593Smuzhiyun 62*4882a593Smuzhiyun if (depth >= 4) { 63*4882a593Smuzhiyun #ifdef CONFIG_LOGO_LINUX_VGA16 64*4882a593Smuzhiyun /* Generic Linux logo */ 65*4882a593Smuzhiyun logo = &logo_linux_vga16; 66*4882a593Smuzhiyun #endif 67*4882a593Smuzhiyun #ifdef CONFIG_LOGO_SUPERH_VGA16 68*4882a593Smuzhiyun /* SuperH Linux logo */ 69*4882a593Smuzhiyun logo = &logo_superh_vga16; 70*4882a593Smuzhiyun #endif 71*4882a593Smuzhiyun } 72*4882a593Smuzhiyun 73*4882a593Smuzhiyun if (depth >= 8) { 74*4882a593Smuzhiyun #ifdef CONFIG_LOGO_LINUX_CLUT224 75*4882a593Smuzhiyun /* Generic Linux logo */ 76*4882a593Smuzhiyun logo = &logo_linux_clut224; 77*4882a593Smuzhiyun #endif 78*4882a593Smuzhiyun #ifdef CONFIG_LOGO_DEC_CLUT224 79*4882a593Smuzhiyun /* DEC Linux logo on MIPS/MIPS64 or ALPHA */ 80*4882a593Smuzhiyun logo = &logo_dec_clut224; 81*4882a593Smuzhiyun #endif 82*4882a593Smuzhiyun #ifdef CONFIG_LOGO_MAC_CLUT224 83*4882a593Smuzhiyun /* Macintosh Linux logo on m68k */ 84*4882a593Smuzhiyun if (MACH_IS_MAC) 85*4882a593Smuzhiyun logo = &logo_mac_clut224; 86*4882a593Smuzhiyun #endif 87*4882a593Smuzhiyun #ifdef CONFIG_LOGO_PARISC_CLUT224 88*4882a593Smuzhiyun /* PA-RISC Linux logo */ 89*4882a593Smuzhiyun logo = &logo_parisc_clut224; 90*4882a593Smuzhiyun #endif 91*4882a593Smuzhiyun #ifdef CONFIG_LOGO_SGI_CLUT224 92*4882a593Smuzhiyun /* SGI Linux logo on MIPS/MIPS64 */ 93*4882a593Smuzhiyun logo = &logo_sgi_clut224; 94*4882a593Smuzhiyun #endif 95*4882a593Smuzhiyun #ifdef CONFIG_LOGO_SUN_CLUT224 96*4882a593Smuzhiyun /* Sun Linux logo */ 97*4882a593Smuzhiyun logo = &logo_sun_clut224; 98*4882a593Smuzhiyun #endif 99*4882a593Smuzhiyun #ifdef CONFIG_LOGO_SUPERH_CLUT224 100*4882a593Smuzhiyun /* SuperH Linux logo */ 101*4882a593Smuzhiyun logo = &logo_superh_clut224; 102*4882a593Smuzhiyun #endif 103*4882a593Smuzhiyun } 104*4882a593Smuzhiyun return logo; 105*4882a593Smuzhiyun } 106*4882a593Smuzhiyun EXPORT_SYMBOL_GPL(fb_find_logo); 107