diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/at91_gpio.c | 29 | ||||
-rw-r--r-- | drivers/video/Kconfig | 8 | ||||
-rw-r--r-- | drivers/video/console_normal.c | 10 | ||||
-rw-r--r-- | drivers/video/vidconsole-uclass.c | 6 | ||||
-rw-r--r-- | drivers/video/video-uclass.c | 4 | ||||
-rw-r--r-- | drivers/video/video_bmp.c | 12 |
6 files changed, 50 insertions, 19 deletions
diff --git a/drivers/gpio/at91_gpio.c b/drivers/gpio/at91_gpio.c index 965becf77a..dbfed72c61 100644 --- a/drivers/gpio/at91_gpio.c +++ b/drivers/gpio/at91_gpio.c @@ -556,6 +556,28 @@ static int at91_gpio_get_function(struct udevice *dev, unsigned offset) return GPIOF_INPUT; } +static const char *at91_get_bank_name(uint32_t base_addr) +{ + switch (base_addr) { + case ATMEL_BASE_PIOA: + return "PIOA"; + case ATMEL_BASE_PIOB: + return "PIOB"; + case ATMEL_BASE_PIOC: + return "PIOC"; +#if (ATMEL_PIO_PORTS > 3) + case ATMEL_BASE_PIOD: + return "PIOD"; +#if (ATMEL_PIO_PORTS > 4) + case ATMEL_BASE_PIOE: + return "PIOE"; +#endif +#endif + } + + return "undefined"; +} + static const struct dm_gpio_ops gpio_at91_ops = { .direction_input = at91_gpio_direction_input, .direction_output = at91_gpio_direction_output, @@ -582,14 +604,15 @@ static int at91_gpio_probe(struct udevice *dev) clk_free(&clk); - uc_priv->bank_name = plat->bank_name; - uc_priv->gpio_count = GPIO_PER_BANK; - #if CONFIG_IS_ENABLED(OF_CONTROL) plat->base_addr = (uint32_t)devfdt_get_addr_ptr(dev); #endif + plat->bank_name = at91_get_bank_name(plat->base_addr); port->regs = (struct at91_port *)plat->base_addr; + uc_priv->bank_name = plat->bank_name; + uc_priv->gpio_count = GPIO_PER_BANK; + return 0; } diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 805713c08b..4cde0acbf6 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -38,7 +38,7 @@ config BACKLIGHT_GPIO config VIDEO_BPP8 bool "Support 8-bit-per-pixel displays" depends on DM_VIDEO - default y if DM_VIDEO + default n help Support drawing text and bitmaps onto a 8-bit-per-pixel display. Enabling this will include code to support this display. Without @@ -48,7 +48,7 @@ config VIDEO_BPP8 config VIDEO_BPP16 bool "Support 16-bit-per-pixel displays" depends on DM_VIDEO - default y if DM_VIDEO + default n help Support drawing text and bitmaps onto a 16-bit-per-pixel display. Enabling this will include code to support this display. Without @@ -58,7 +58,7 @@ config VIDEO_BPP16 config VIDEO_BPP32 bool "Support 32-bit-per-pixel displays" depends on DM_VIDEO - default y if DM_VIDEO + default n help Support drawing text and bitmaps onto a 32-bit-per-pixel display. Enabling this will include code to support this display. Without @@ -68,7 +68,7 @@ config VIDEO_BPP32 config VIDEO_ANSI bool "Support ANSI escape sequences in video console" depends on DM_VIDEO - default y if DM_VIDEO + default n help Enable ANSI escape sequence decoding for a more fully functional console. diff --git a/drivers/video/console_normal.c b/drivers/video/console_normal.c index 7f01ee9424..2f25af7332 100644 --- a/drivers/video/console_normal.c +++ b/drivers/video/console_normal.c @@ -16,9 +16,9 @@ static int console_normal_set_row(struct udevice *dev, uint row, int clr) { struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); - void *line; - int pixels = VIDEO_FONT_HEIGHT * vid_priv->xsize; - int i; + void * __maybe_unused line; + int __maybe_unused pixels = VIDEO_FONT_HEIGHT * vid_priv->xsize; + int __maybe_unused i; line = vid_priv->fb + row * VIDEO_FONT_HEIGHT * vid_priv->line_length; switch (vid_priv->bpix) { @@ -76,7 +76,7 @@ static int console_normal_putc_xy(struct udevice *dev, uint x_frac, uint y, struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev); struct udevice *vid = dev->parent; struct video_priv *vid_priv = dev_get_uclass_priv(vid); - int i, row; + int __maybe_unused i, row; void *line = vid_priv->fb + y * vid_priv->line_length + VID_TO_PIXEL(x_frac) * VNBYTES(vid_priv->bpix); @@ -85,7 +85,7 @@ static int console_normal_putc_xy(struct udevice *dev, uint x_frac, uint y, for (row = 0; row < VIDEO_FONT_HEIGHT; row++) { unsigned int idx = (u8)ch * VIDEO_FONT_HEIGHT + row; - uchar bits = video_fontdata[idx]; + uchar __maybe_unused bits = video_fontdata[idx]; switch (vid_priv->bpix) { #ifdef CONFIG_VIDEO_BPP8 diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index af88588904..c690eceeaa 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -116,6 +116,7 @@ static void vidconsole_newline(struct udevice *dev) video_sync(dev->parent, false); } +#if CONFIG_IS_ENABLED(VIDEO_BPP16) || CONFIG_IS_ENABLED(VIDEO_BPP32) static const struct vid_rgb colors[VID_COLOR_COUNT] = { { 0x00, 0x00, 0x00 }, /* black */ { 0xc0, 0x00, 0x00 }, /* red */ @@ -134,18 +135,23 @@ static const struct vid_rgb colors[VID_COLOR_COUNT] = { { 0x00, 0xff, 0xff }, /* bright cyan */ { 0xff, 0xff, 0xff }, /* white */ }; +#endif u32 vid_console_color(struct video_priv *priv, unsigned int idx) { switch (priv->bpix) { +#if CONFIG_IS_ENABLED(VIDEO_BPP16) case VIDEO_BPP16: return ((colors[idx].r >> 3) << 11) | ((colors[idx].g >> 2) << 5) | ((colors[idx].b >> 3) << 0); +#endif +#if CONFIG_IS_ENABLED(VIDEO_BPP32) case VIDEO_BPP32: return (colors[idx].r << 16) | (colors[idx].g << 8) | (colors[idx].b << 0); +#endif default: /* * For unknown bit arrangements just support diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index f660c5205e..5ea7568fa4 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -92,6 +92,7 @@ int video_clear(struct udevice *dev) struct video_priv *priv = dev_get_uclass_priv(dev); switch (priv->bpix) { +#ifdef CONFIG_VIDEO_BPP16 case VIDEO_BPP16: { u16 *ppix = priv->fb; u16 *end = priv->fb + priv->fb_size; @@ -100,6 +101,8 @@ int video_clear(struct udevice *dev) *ppix++ = priv->colour_bg; break; } +#endif +#ifdef CONFIG_VIDEO_BPP32 case VIDEO_BPP32: { u32 *ppix = priv->fb; u32 *end = priv->fb + priv->fb_size; @@ -108,6 +111,7 @@ int video_clear(struct udevice *dev) *ppix++ = priv->colour_bg; break; } +#endif default: memset(priv->fb, priv->colour_bg, priv->fb_size); break; diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c index 193f37d275..8768228029 100644 --- a/drivers/video/video_bmp.c +++ b/drivers/video/video_bmp.c @@ -40,18 +40,16 @@ static void draw_encoded_bitmap(ushort **fbp, ushort col, int cnt) static void video_display_rle8_bitmap(struct udevice *dev, struct bmp_image *bmp, ushort *cmap, - uchar *fb, int x_off, int y_off) + uchar *fb, int x_off, int y_off, + ulong width, ulong height) { struct video_priv *priv = dev_get_uclass_priv(dev); uchar *bmap; - ulong width, height; ulong cnt, runlen; int x, y; int decode = 1; debug("%s\n", __func__); - width = get_unaligned_le32(&bmp->header.width); - height = get_unaligned_le32(&bmp->header.height); bmap = (uchar *)bmp + get_unaligned_le32(&bmp->header.data_offset); x = 0; @@ -157,8 +155,8 @@ __weak void fb_put_word(uchar **fb, uchar **from) static void video_splash_align_axis(int *axis, unsigned long panel_size, unsigned long picture_size) { - unsigned long panel_picture_delta = panel_size - picture_size; - unsigned long axis_alignment; + long panel_picture_delta = panel_size - picture_size; + long axis_alignment; if (*axis == BMP_ALIGN_CENTER) axis_alignment = panel_picture_delta / 2; @@ -277,7 +275,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, return -EPROTONOSUPPORT; } video_display_rle8_bitmap(dev, bmp, cmap_base, fb, x, - y); + y, width, height); break; } #endif |