+// SPDX-License-Identifier: GPL-2.0+
/*
* Common LCD routines
*
* (C) Copyright 2001-2002
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
/* #define DEBUG */
#include <config.h>
#include <common.h>
#include <command.h>
+#include <cpu_func.h>
#include <env_callback.h>
+#include <log.h>
+#include <asm/cache.h>
+#include <init.h>
+#include <asm/global_data.h>
#include <linux/types.h>
#include <stdio_dev.h>
#include <lcd.h>
* architectures do not actually implement it. Is there a way to find
* out whether it exists? For now, ARM is safe.
*/
-#if defined(CONFIG_ARM) && !defined(CONFIG_SYS_DCACHE_OFF)
+#if defined(CONFIG_ARM) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
int line_length;
if (lcd_flush_dcache)
void lcd_clear(void)
{
int bg_color;
- char *s;
- ulong addr;
+ __maybe_unused ulong addr;
static int do_splash = 1;
#if LCD_BPP == LCD_COLOR8
/* Setting the palette */
/* Paint the logo and retrieve LCD base address */
debug("[LCD] Drawing the logo...\n");
if (do_splash) {
- s = env_get("splashimage");
- if (s) {
+ if (splash_display() == 0) {
do_splash = 0;
- addr = simple_strtoul(s, NULL, 16);
- if (lcd_splash(addr) == 0) {
- lcd_sync();
- return;
- }
+ lcd_sync();
+ return;
}
}
lcd_sync();
}
-static int do_lcd_clear(cmd_tbl_t *cmdtp, int flag, int argc,
- char *const argv[])
-{
- lcd_clear();
- return 0;
-}
-U_BOOT_CMD(cls, 1, 1, do_lcd_clear, "clear screen", "");
-
static int lcd_init(void *lcdbase)
{
debug("[LCD] Initializing LCD frambuffer at %p\n", lcdbase);
#if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
#ifdef CONFIG_SPLASH_SCREEN_ALIGN
-#define BMP_ALIGN_CENTER 0x7FFF
static void splash_align_axis(int *axis, unsigned long panel_size,
unsigned long picture_size)
unsigned long pwidth = panel_info.vl_col;
unsigned colors, bpix, bmp_bpix;
int hdr_size;
- struct bmp_color_table_entry *palette = bmp->color_table;
+ struct bmp_color_table_entry *palette;
if (!bmp || !(bmp->header.signature[0] == 'B' &&
bmp->header.signature[1] == 'M')) {
return 1;
}
+ palette = bmp->color_table;
width = get_unaligned_le32(&bmp->header.width);
height = get_unaligned_le32(&bmp->header.height);
bmp_bpix = get_unaligned_le16(&bmp->header.bit_count);
if (op == env_op_delete)
return 0;
- addr = simple_strtoul(value, NULL, 16);
+ addr = hextoul(value, NULL);
/* See README.displaying-bmps */
aligned = (addr % 4 == 2);
if (!aligned) {