aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/f_sdp.c2
-rw-r--r--drivers/video/Kconfig7
-rw-r--r--drivers/video/console_truetype.c37
-rw-r--r--drivers/video/vidconsole-uclass.c33
4 files changed, 63 insertions, 16 deletions
diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
index 5ae5b62741..9ea43f29cf 100644
--- a/drivers/usb/gadget/f_sdp.c
+++ b/drivers/usb/gadget/f_sdp.c
@@ -868,7 +868,7 @@ static int sdp_handle_in_ep(struct spl_image_info *spl_image,
jump_to_image_no_args(&spl_image);
#else
/* In U-Boot, allow jumps to scripts */
- image_source_script(sdp_func->jmp_address, NULL, NULL);
+ cmd_source_script(sdp_func->jmp_address, NULL, NULL);
#endif
}
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index f539977d9b..440b161b84 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -112,10 +112,13 @@ config VIDEO_BPP32
config VIDEO_ANSI
bool "Support ANSI escape sequences in video console"
- default y
+ default y if EFI_LOADER
help
Enable ANSI escape sequence decoding for a more fully functional
- console.
+ console. Functionality includes changing the text colour and moving
+ the cursor. These date from the 1970s and are still widely used today
+ to control a text terminal. U-Boot implements these by decoding the
+ sequences and performing the appropriate operation.
config VIDEO_MIPI_DSI
bool "Support MIPI DSI interface"
diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c
index 6859c9fa11..9cac9a6de4 100644
--- a/drivers/video/console_truetype.c
+++ b/drivers/video/console_truetype.c
@@ -584,18 +584,24 @@ static struct font_info *console_truetype_find_font(void)
return NULL;
}
-void vidconsole_list_fonts(void)
+int console_truetype_get_font(struct udevice *dev, int seq,
+ struct vidfont_info *info)
{
struct font_info *tab;
+ int i;
- for (tab = font_table; tab->begin; tab++) {
- if (abs(tab->begin - tab->end) > 4)
- printf("%s\n", tab->name);
+ for (i = 0, tab = font_table; tab->begin; tab++, i++) {
+ if (i == seq && font_valid(tab)) {
+ info->name = tab->name;
+ return 0;
+ }
}
+
+ return -ENOENT;
}
/**
- * vidconsole_add_metrics() - Add a new font/size combination
+ * truetype_add_metrics() - Add a new font/size combination
*
* @dev: Video console device to update
* @font_name: Name of font
@@ -604,8 +610,8 @@ void vidconsole_list_fonts(void)
* @return 0 if OK, -EPERM if stbtt failed, -E2BIG if the the metrics table is
* full
*/
-static int vidconsole_add_metrics(struct udevice *dev, const char *font_name,
- uint font_size, const void *font_data)
+static int truetype_add_metrics(struct udevice *dev, const char *font_name,
+ uint font_size, const void *font_data)
{
struct console_tt_priv *priv = dev_get_priv(dev);
struct console_tt_metrics *met;
@@ -674,7 +680,8 @@ static void select_metrics(struct udevice *dev, struct console_tt_metrics *met)
vc_priv->tab_width_frac = VID_TO_POS(met->font_size) * 8 / 2;
}
-int vidconsole_select_font(struct udevice *dev, const char *name, uint size)
+static int truetype_select_font(struct udevice *dev, const char *name,
+ uint size)
{
struct console_tt_priv *priv = dev_get_priv(dev);
struct console_tt_metrics *met;
@@ -684,7 +691,7 @@ int vidconsole_select_font(struct udevice *dev, const char *name, uint size)
if (!size)
size = CONFIG_CONSOLE_TRUETYPE_SIZE;
if (!name)
- name = priv->cur_met->font_name;
+ name = font_table->name;
met = find_metrics(dev, name, size);
if (!met) {
@@ -693,8 +700,10 @@ int vidconsole_select_font(struct udevice *dev, const char *name, uint size)
!strcmp(name, tab->name)) {
int ret;
- ret = vidconsole_add_metrics(dev,
- tab->name, size, tab->begin);
+ ret = truetype_add_metrics(dev,
+ tab->name,
+ size,
+ tab->begin);
if (ret < 0)
return log_msg_ret("add", ret);
@@ -715,7 +724,7 @@ int vidconsole_select_font(struct udevice *dev, const char *name, uint size)
return 0;
}
-const char *vidconsole_get_font(struct udevice *dev, uint *sizep)
+const char *vidconsole_get_font_size(struct udevice *dev, uint *sizep)
{
struct console_tt_priv *priv = dev_get_priv(dev);
struct console_tt_metrics *met = priv->cur_met;
@@ -745,7 +754,7 @@ static int console_truetype_probe(struct udevice *dev)
return -EBFONT;
}
- ret = vidconsole_add_metrics(dev, tab->name, font_size, tab->begin);
+ ret = truetype_add_metrics(dev, tab->name, font_size, tab->begin);
if (ret < 0)
return log_msg_ret("add", ret);
priv->cur_met = &priv->metrics[ret];
@@ -763,6 +772,8 @@ struct vidconsole_ops console_truetype_ops = {
.set_row = console_truetype_set_row,
.backspace = console_truetype_backspace,
.entry_start = console_truetype_entry_start,
+ .get_font = console_truetype_get_font,
+ .select_font = truetype_select_font,
};
U_BOOT_DRIVER(vidconsole_truetype) = {
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index 6bdfb6e37d..aadd54bfd4 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -557,6 +557,39 @@ static void vidconsole_puts(struct stdio_dev *sdev, const char *s)
}
}
+void vidconsole_list_fonts(struct udevice *dev)
+{
+ struct vidfont_info info;
+ int ret, i;
+
+ for (i = 0, ret = 0; !ret; i++) {
+ ret = vidconsole_get_font(dev, i, &info);
+ if (!ret)
+ printf("%s\n", info.name);
+ }
+}
+
+int vidconsole_get_font(struct udevice *dev, int seq,
+ struct vidfont_info *info)
+{
+ struct vidconsole_ops *ops = vidconsole_get_ops(dev);
+
+ if (!ops->get_font)
+ return -ENOSYS;
+
+ return ops->get_font(dev, seq, info);
+}
+
+int vidconsole_select_font(struct udevice *dev, const char *name, uint size)
+{
+ struct vidconsole_ops *ops = vidconsole_get_ops(dev);
+
+ if (!ops->select_font)
+ return -ENOSYS;
+
+ return ops->select_font(dev, name, size);
+}
+
/* Set up the number of rows and colours (rotated drivers override this) */
static int vidconsole_pre_probe(struct udevice *dev)
{