1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2013 Samsung Electronics
4 * Przemyslaw Marczak <p.marczak@samsung.com>
11 #include <asm/global_data.h>
12 #include <linux/delay.h>
13 #include <samsung/misc.h>
18 #include <linux/sizes.h>
19 #include <asm/arch/cpu.h>
21 #include <linux/input.h>
24 * Use #ifdef to work around conflicting headers while we wait for this to be
25 * converted to driver model.
27 #ifdef CONFIG_DM_PMIC_MAX77686
28 #include <power/max77686_pmic.h>
30 #ifdef CONFIG_DM_PMIC_MAX8998
31 #include <power/max8998_pmic.h>
33 #ifdef CONFIG_PMIC_MAX8997
34 #include <power/max8997_pmic.h>
36 #include <power/pmic.h>
39 DECLARE_GLOBAL_DATA_PTR;
41 #ifdef CONFIG_SET_DFU_ALT_INFO
42 void set_dfu_alt_info(char *interface, char *devstr)
44 size_t buf_size = CFG_SET_DFU_ALT_BUF_LEN;
45 ALLOC_CACHE_ALIGN_BUFFER(char, buf, buf_size);
46 char *alt_info = "Settings not found!";
47 char *status = "error!\n";
52 puts("DFU alt info setting: ");
54 alt_setting = get_dfu_alt_boot(interface, devstr);
56 env_set("dfu_alt_boot", alt_setting);
57 offset = snprintf(buf, buf_size, "%s", alt_setting);
60 alt_setting = get_dfu_alt_system(interface, devstr);
67 offset += snprintf(buf + offset, buf_size - offset,
68 "%s%s", alt_sep, alt_setting);
76 env_set("dfu_alt_info", alt_info);
81 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
82 void set_board_info(void)
86 snprintf(info, ARRAY_SIZE(info), "%u.%u", (s5p_cpu_rev & 0xf0) >> 4,
88 env_set("soc_rev", info);
90 snprintf(info, ARRAY_SIZE(info), "%x", s5p_cpu_id);
91 env_set("soc_id", info);
93 #ifdef CONFIG_REVISION_TAG
94 snprintf(info, ARRAY_SIZE(info), "%x", get_board_rev());
95 env_set("board_rev", info);
97 #ifdef CONFIG_OF_LIBFDT
98 const char *bdtype = "";
99 const char *bdname = CONFIG_SYS_BOARD;
101 #ifdef CONFIG_BOARD_TYPES
102 bdtype = get_board_type();
106 sprintf(info, "%s%s", bdname, bdtype);
107 env_set("board_name", info);
109 snprintf(info, ARRAY_SIZE(info), "%s%x-%s%s.dtb",
110 CONFIG_SYS_SOC, s5p_cpu_id, bdname, bdtype);
111 env_set("fdtfile", info);
114 #endif /* CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG */
116 #ifdef CONFIG_CMD_BMP
122 addr = panel_info.logo_addr;
124 pr_err("There is no logo data.\n");
128 if (panel_info.vl_width >= panel_info.logo_width) {
129 x = ((panel_info.vl_width - panel_info.logo_width) >> 1);
130 x += panel_info.logo_x_offset; /* For X center align */
133 printf("Warning: image width is bigger than display width\n");
136 if (panel_info.vl_height >= panel_info.logo_height) {
137 y = ((panel_info.vl_height - panel_info.logo_height) >> 1);
138 y += panel_info.logo_y_offset; /* For Y center align */
141 printf("Warning: image height is bigger than display height\n");
144 bmp_display(addr, x, y);
146 #endif /* CONFIG_CMD_BMP */