1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017 Microchip
4 * Wenyou Yang <wenyou.yang@microchip.com>
14 #include <video_console.h>
17 #include <asm/arch/clk.h>
19 DECLARE_GLOBAL_DATA_PTR;
21 int at91_video_show_board_info(void)
23 struct vidconsole_priv *priv;
24 ulong dram_size, nand_size;
28 char *corp = "Microchip Technology Inc.\n";
30 struct udevice *dev, *con;
35 len += sprintf(&buf[len], "%s\n", U_BOOT_VERSION);
36 memcpy(&buf[len], corp, strlen(corp));
38 len += sprintf(&buf[len], "%s CPU at %s MHz\n", get_cpu_name(),
39 strmhz(temp, get_cpu_clk_rate()));
42 for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
43 dram_size += gd->bd->bi_dram[i].size;
46 #ifdef CONFIG_NAND_ATMEL
47 for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
48 nand_size += get_nand_dev_by_index(i)->size;
51 len += sprintf(&buf[len], "%ld MB SDRAM, %ld MB NAND\n",
52 dram_size >> 20, nand_size >> 20);
54 ret = uclass_get_device(UCLASS_VIDEO, 0, &dev);
58 microchip_logo_info(&logo_info);
59 ret = video_bmp_display(dev, logo_info.logo_addr,
60 logo_info.logo_x_offset,
61 logo_info.logo_y_offset, false);
65 ret = uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con);
69 priv = dev_get_uclass_priv(con);
70 vidconsole_position_cursor(con, 0, (logo_info.logo_height +
71 priv->y_charsize - 1) / priv->y_charsize);
72 for (s = buf, i = 0; i < len; s++, i++)
73 vidconsole_put_char(con, *s);