summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharles.park <charles.park@hardkernel.com>2020-07-13 10:41:36 +0300
committerJoy Cho <joy.cho@hardkernel.com>2020-12-02 10:24:54 +0300
commit48745a53b3416e23bcfb73a482523e6f7bb313a2 (patch)
tree57a681acddab21370bd9590335d98aefd309ee8e
parentb04675bbe773d61f9dc51f6cb64be03ee5c8236e (diff)
downloadu-boot-48745a53b3416e23bcfb73a482523e6f7bb313a2.tar.xz
ODROID-GO3 : 480x854 Frame buffer add for GO3.
Change-Id: I2656c0d94ceb5989378c611195d77c8bd7241394
-rw-r--r--drivers/video/console_normal.c8
-rw-r--r--drivers/video/console_rotate.c28
-rw-r--r--drivers/video/drm/Makefile2
-rw-r--r--drivers/video/drm/rockchip_display.c8
-rw-r--r--drivers/video/drm/rockchip_display.h2
-rw-r--r--drivers/video/drm/rockchip_display_cmds.c33
-rw-r--r--drivers/video/drm/rockchip_panel.c19
-rw-r--r--drivers/video/vidconsole-uclass.c2
-rw-r--r--drivers/video/video-uclass.c4
-rw-r--r--include/rockchip_display_cmds.h10
-rw-r--r--include/video_rockchip.h15
11 files changed, 77 insertions, 54 deletions
diff --git a/drivers/video/console_normal.c b/drivers/video/console_normal.c
index 553ff7e9af..e4f60ce477 100644
--- a/drivers/video/console_normal.c
+++ b/drivers/video/console_normal.c
@@ -14,7 +14,7 @@
#include <video_console.h>
#include <video_font.h> /* Get font data, width and height */
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
#include <rockchip_display_cmds.h>
#endif
@@ -47,7 +47,7 @@ static int console_normal_set_row(struct udevice *dev, uint row, int clr)
#endif
#ifdef CONFIG_VIDEO_BPP32
case VIDEO_BPP32: {
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
struct lcd_fb_bit *dst = line, *bg = lcd_getbg();
struct video_fb_bit *c = (struct video_fb_bit *)&clr;
if (!lcd_gettransp()) {
@@ -101,7 +101,7 @@ static int console_normal_putc_xy(struct udevice *dev, uint x_frac, uint y,
struct udevice *vid = dev->parent;
struct video_priv *vid_priv = dev_get_uclass_priv(vid);
int i, row;
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
void *line = vid_priv->fb + y * vid_priv->line_length +
VID_TO_PIXEL(x_frac) * 3;
#else
@@ -142,7 +142,7 @@ static int console_normal_putc_xy(struct udevice *dev, uint x_frac, uint y,
#endif
#ifdef CONFIG_VIDEO_BPP32
case VIDEO_BPP32: {
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
struct lcd_fb_bit *dst = line, *lfg, *lbg;
struct video_fb_bit *fg, *bg;
bool transp = lcd_gettransp();
diff --git a/drivers/video/console_rotate.c b/drivers/video/console_rotate.c
index 4d8e05511d..b770974e13 100644
--- a/drivers/video/console_rotate.c
+++ b/drivers/video/console_rotate.c
@@ -12,14 +12,14 @@
#include <video_console.h>
#include <video_font.h> /* Get font data, width and height */
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
#include <rockchip_display_cmds.h>
#endif
static int console_set_row_1(struct udevice *dev, uint row, int clr)
{
struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
int pbytes = 3;
#else
int pbytes = VNBYTES(vid_priv->bpix);
@@ -51,7 +51,7 @@ static int console_set_row_1(struct udevice *dev, uint row, int clr)
#endif
#ifdef CONFIG_VIDEO_BPP32
case VIDEO_BPP32: {
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
struct lcd_fb_bit *dst = line, *bg = lcd_getbg();
struct video_fb_bit *c = (struct video_fb_bit *)&clr;
@@ -93,7 +93,7 @@ static int console_move_rows_1(struct udevice *dev, uint rowdst, uint rowsrc,
struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);
void *dst;
void *src;
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
int pbytes = 3;
#else
int pbytes = VNBYTES(vid_priv->bpix);
@@ -119,7 +119,7 @@ static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, char ch)
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);
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
int pbytes = 3;
#else
int pbytes = VNBYTES(vid_priv->bpix);
@@ -160,7 +160,7 @@ static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, char ch)
#endif
#ifdef CONFIG_VIDEO_BPP32
case VIDEO_BPP32: {
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
struct lcd_fb_bit *dst = line, *lfg, *lbg;
struct video_fb_bit *fg, *bg;
bool transp = lcd_gettransp();
@@ -248,7 +248,7 @@ static int console_set_row_2(struct udevice *dev, uint row, int clr)
#endif
#ifdef CONFIG_VIDEO_BPP32
case VIDEO_BPP32: {
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
struct lcd_fb_bit *dst = line, *bg = lcd_getbg();
struct video_fb_bit *c = (struct video_fb_bit *)&clr;
@@ -311,7 +311,7 @@ static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, char ch)
if (x_frac + VID_TO_POS(vc_priv->x_charsize) > vc_priv->xsize_frac)
return -EAGAIN;
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
line = vid_priv->fb + (vid_priv->ysize - y - 1) *
vid_priv->line_length +
(vid_priv->xsize - VID_TO_PIXEL(x_frac) -
@@ -353,7 +353,7 @@ static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, char ch)
#endif
#ifdef CONFIG_VIDEO_BPP32
case VIDEO_BPP32: {
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
struct lcd_fb_bit *dst = line, *lfg, *lbg;
struct video_fb_bit *fg, *bg;
bool transp = lcd_gettransp();
@@ -414,7 +414,7 @@ static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, char ch)
static int console_set_row_3(struct udevice *dev, uint row, int clr)
{
struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
int pbytes = 3;
#else
int pbytes = VNBYTES(vid_priv->bpix);
@@ -445,7 +445,7 @@ static int console_set_row_3(struct udevice *dev, uint row, int clr)
#endif
#ifdef CONFIG_VIDEO_BPP32
case VIDEO_BPP32: {
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
struct lcd_fb_bit *dst = line, *bg = lcd_getbg();
struct video_fb_bit *c = (struct video_fb_bit *)&clr;
@@ -487,7 +487,7 @@ static int console_move_rows_3(struct udevice *dev, uint rowdst, uint rowsrc,
struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);
void *dst;
void *src;
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
int pbytes = 3;
#else
int pbytes = VNBYTES(vid_priv->bpix);
@@ -511,7 +511,7 @@ static int console_putc_xy_3(struct udevice *dev, uint x_frac, uint y, char ch)
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);
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
int pbytes = 3;
#else
int pbytes = VNBYTES(vid_priv->bpix);
@@ -552,7 +552,7 @@ static int console_putc_xy_3(struct udevice *dev, uint x_frac, uint y, char ch)
#endif
#ifdef CONFIG_VIDEO_BPP32
case VIDEO_BPP32: {
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
struct lcd_fb_bit *dst = line, *lfg, *lbg;
struct video_fb_bit *fg, *bg;
bool transp = lcd_gettransp();
diff --git a/drivers/video/drm/Makefile b/drivers/video/drm/Makefile
index da4f06bc63..5d82c1df18 100644
--- a/drivers/video/drm/Makefile
+++ b/drivers/video/drm/Makefile
@@ -20,4 +20,4 @@ obj-$(CONFIG_DRM_ROCKCHIP_LVDS) += rockchip_lvds.o
obj-$(CONFIG_DRM_ROCKCHIP_RGB) += rockchip_rgb.o
obj-$(CONFIG_DRM_ROCKCHIP_PANEL) += rockchip_panel.o
obj-$(CONFIG_DRM_ROCKCHIP_RK618) += rk618.o rk618_lvds.o
-obj-$(CONFIG_TARGET_ODROIDGO2) += rockchip_display_cmds.o
+obj-$(CONFIG_PLATFORM_ODROID_GOADV) += rockchip_display_cmds.o
diff --git a/drivers/video/drm/rockchip_display.c b/drivers/video/drm/rockchip_display.c
index 7163f45350..8ada2f356d 100644
--- a/drivers/video/drm/rockchip_display.c
+++ b/drivers/video/drm/rockchip_display.c
@@ -158,7 +158,7 @@ static void *get_display_buffer(int size)
return buf;
}
-#if !defined(CONFIG_TARGET_ODROIDGO2)
+#if !defined(CONFIG_PLATFORM_ODROID_GOADV)
static unsigned long get_display_size(void)
{
return memory_end - memory_start;
@@ -895,7 +895,7 @@ struct rockchip_logo_cache *find_or_alloc_logo_cache(const char *bmp)
return logo_cache;
}
-#if !defined(CONFIG_TARGET_ODROIDGO2)
+#if !defined(CONFIG_PLATFORM_ODROID_GOADV)
/* Note: used only for rkfb kernel driver */
static int load_kernel_bmp_logo(struct logo_info *logo, const char *bmp_name)
{
@@ -1419,7 +1419,7 @@ static int rockchip_display_probe(struct udevice *dev)
return 0;
}
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
#include <rockchip_display_cmds.h>
@@ -1586,7 +1586,7 @@ static int do_rockchip_show_bmp(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
unsigned long get_drm_memory(void)
{
return (memory_start - DRM_ROCKCHIP_FB_SIZE);
diff --git a/drivers/video/drm/rockchip_display.h b/drivers/video/drm/rockchip_display.h
index 59653fc9f5..f65b4a13c6 100644
--- a/drivers/video/drm/rockchip_display.h
+++ b/drivers/video/drm/rockchip_display.h
@@ -175,7 +175,7 @@ int display_send_mcu_cmd(struct display_state *state, u32 type, u32 val);
bool drm_mode_is_420(const struct drm_display_info *display,
struct drm_display_mode *mode);
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
unsigned long get_drm_memory(void);
struct display_state *get_display_state(void);
void set_display_state(struct display_state *state, bool enable);
diff --git a/drivers/video/drm/rockchip_display_cmds.c b/drivers/video/drm/rockchip_display_cmds.c
index ee0d02dc3f..2e45012176 100644
--- a/drivers/video/drm/rockchip_display_cmds.c
+++ b/drivers/video/drm/rockchip_display_cmds.c
@@ -1,6 +1,6 @@
/*----------------------------------------------------------------------------*/
/*
- ODROIDGO2 LCD control commands
+ ODROID-GOADV LCD control commands
*/
/*----------------------------------------------------------------------------*/
#include <asm/unaligned.h>
@@ -82,7 +82,6 @@ int lcd_init(void)
lcd->rot = lcd_getrot();
lcd->bpp = 24;
- lcd->bgr = true;
lcd->w = lcd->s->conn_state.mode.hdisplay;
lcd->h = lcd->s->conn_state.mode.vdisplay;
@@ -91,7 +90,12 @@ int lcd_init(void)
lcd->drm_fb_size = (lcd->w * lcd->h * lcd->bpp) >> 3;
lcd->s->crtc_state.format = ROCKCHIP_FMT_RGB888;
- lcd->s->crtc_state.rb_swap = lcd->bgr;
+#if defined(CONFIG_TARGET_ODROIDGO2)
+ lcd->s->crtc_state.rb_swap = true;
+#endif
+#if defined(CONFIG_TARGET_ODROIDGO3)
+ lcd->s->crtc_state.rb_swap = false;
+#endif
lcd->s->crtc_state.ymirror = 0;
lcd->s->crtc_state.src_w = lcd->s->crtc_state.crtc_w = lcd->w;
lcd->s->crtc_state.src_h = lcd->s->crtc_state.crtc_h = lcd->h;
@@ -325,14 +329,10 @@ int lcd_setfg(unsigned long r, unsigned long g, unsigned long b)
if (lcd == NULL)
return -ENODEV;
- if (lcd->bgr) {
- lcd->fg_color.r = (r > 255) ? 255 : r;
- lcd->fg_color.b = (b > 255) ? 255 : b;
- } else {
- lcd->fg_color.r = (r > 255) ? 255 : r;
- lcd->fg_color.b = (b > 255) ? 255 : b;
- }
+ lcd->fg_color.r = (r > 255) ? 255 : r;
lcd->fg_color.g = (g > 255) ? 255 : g;
+ lcd->fg_color.b = (b > 255) ? 255 : b;
+
return 0;
}
@@ -342,14 +342,10 @@ int lcd_setbg(unsigned long r, unsigned long g, unsigned long b)
if (lcd == NULL)
return -ENODEV;
- if (lcd->bgr) {
- lcd->bg_color.r = (r > 255) ? 255 : b;
- lcd->bg_color.b = (b > 255) ? 255 : r;
- } else {
- lcd->bg_color.r = (r > 255) ? 255 : r;
- lcd->bg_color.b = (b > 255) ? 255 : b;
- }
+ lcd->bg_color.r = (r > 255) ? 255 : r;
lcd->bg_color.g = (g > 255) ? 255 : g;
+ lcd->bg_color.b = (b > 255) ? 255 : b;
+
return 0;
}
@@ -443,6 +439,7 @@ int lcd_show_logo(void)
char *logo_fname;
if (lcd_init()) {
+ printf("%s : lcd init error!\n", __func__);
odroid_drop_errorlog("lcd init fail, check dtb file", 29);
odroid_alert_leds();
return -1;
@@ -561,7 +558,7 @@ static int do_lcd_cmds(cmd_tbl_t *cmdtp, int flag, int argc,
/*----------------------------------------------------------------------------*/
static char lcd_help_text[] = {
- " - for odroidgo2 lcd control commands\n"
+ " - for odroid-goadv lcd control commands\n"
"init - lcd screen initialize.(default rotate = 3)\n"
"init <rot(0~3)> - lcd screen initialize & rotate(0-4).\n"
"clear - lcd screen clear(bg color), move cursor position to 0, 0\n"
diff --git a/drivers/video/drm/rockchip_panel.c b/drivers/video/drm/rockchip_panel.c
index fba830fc54..19719141ba 100644
--- a/drivers/video/drm/rockchip_panel.c
+++ b/drivers/video/drm/rockchip_panel.c
@@ -252,6 +252,23 @@ static int rockchip_panel_send_dsi_cmds(struct mipi_dsi_device *dsi,
if (header->delay_ms)
mdelay(header->delay_ms);
+#if 0 // for lcd debug
+ {
+ int cnt, pos;
+ char *cmdp = (char *)desc->payload, cmdstr[256];
+
+ memset(cmdstr, 0x00, sizeof(cmdstr));
+
+ pos = sprintf(&cmdstr[0], "[cmd : %02X] ", cmdp[0]);
+
+ for(cnt = 1; cnt < header->payload_length; cnt++)
+ pos += sprintf(&cmdstr[pos], "%02X ", cmdp[cnt]);
+
+ pr_err("%s\n", cmdstr);
+ if (header->delay_ms)
+ pr_err("[delay(ms) : %d]\n", header->delay_ms);
+ }
+#endif
}
return 0;
@@ -268,7 +285,7 @@ static void panel_simple_prepare(struct rockchip_panel *panel)
return;
if (priv->power_supply) {
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
struct dm_regulator_uclass_platdata *uc_pdata;
uc_pdata = dev_get_uclass_platdata(priv->power_supply);
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index 5217f1017b..1af151ab95 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -225,7 +225,7 @@ void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row)
struct udevice *vid_dev = dev->parent;
struct video_priv *vid_priv = dev_get_uclass_priv(vid_dev);
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
/*
* In case of ROTATE clockwise and counter clockwise,
* swap x/y size
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index f6d3da4917..98894c8e1a 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -19,7 +19,7 @@
#ifdef CONFIG_SANDBOX
#include <asm/sdl.h>
#endif
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
#include <rockchip_display_cmds.h>
#endif
/*
@@ -204,7 +204,7 @@ static int video_post_probe(struct udevice *dev)
/* Set up the line and display size */
priv->fb = map_sysmem(plat->base, plat->size);
-#if defined(CONFIG_TARGET_ODROIDGO2)
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
/* get lcd rotate */
priv->rot = lcd_getrot();
diff --git a/include/rockchip_display_cmds.h b/include/rockchip_display_cmds.h
index 2fd51541d1..f7a5dc7737 100644
--- a/include/rockchip_display_cmds.h
+++ b/include/rockchip_display_cmds.h
@@ -1,6 +1,6 @@
/*----------------------------------------------------------------------------*/
/*
- ODROIDGO2 LCD control commands
+ ODROID-GOADV LCD control commands
*/
/*----------------------------------------------------------------------------*/
#ifndef _ROCKCHIP_DISPLAY_CMDS_H_
@@ -26,10 +26,12 @@
#define DEFAULT_LCD_ROTATE LCD_ROTATE_270
/*----------------------------------------------------------------------------*/
-/* Max logo bmp file is 1M bytes, only support format is 320x480x24bpp bitmap */
+/* Max logo bmp file is 2M bytes */
+/* ODROID-GO2 320x480x24bpp bitmap, needs bytes = 460,800 */
+/* ODROID-GO3 480x854x24bpp bitmap, needs bytes = 1,229,760 > 1 Mbytes */
/*----------------------------------------------------------------------------*/
#define LCD_LOGO_FILENAME "logo.bmp"
-#define LCD_LOGO_SIZE (1024 * 1024)
+#define LCD_LOGO_SIZE (2 * 1024 * 1024)
/*----------------------------------------------------------------------------*/
/* LCD frame buffer is bgr format (24 bits) */
@@ -63,7 +65,7 @@ struct lcd {
struct lcd_fb_bit fg_color;
struct lcd_fb_bit bg_color;
unsigned char rot;
- bool bgr;
+// bool bgr;
bool transp;
};
diff --git a/include/video_rockchip.h b/include/video_rockchip.h
index a5ef401146..0dcba22b9a 100644
--- a/include/video_rockchip.h
+++ b/include/video_rockchip.h
@@ -7,10 +7,17 @@
#ifndef VIDEO_ROCKCHIP_H
#define VIDEO_ROCKCHIP_H
-#if defined(CONFIG_TARGET_ODROIDGO2)
- #define DRM_ROCKCHIP_FB_WIDTH 320
- #define DRM_ROCKCHIP_FB_HEIGHT 480
- #define DRM_ROCKCHIP_FB_BPP VIDEO_BPP32
+#if defined(CONFIG_PLATFORM_ODROID_GOADV)
+ #if defined(CONFIG_TARGET_ODROIDGO2)
+ #define DRM_ROCKCHIP_FB_WIDTH 320
+ #define DRM_ROCKCHIP_FB_HEIGHT 480
+ #define DRM_ROCKCHIP_FB_BPP VIDEO_BPP32
+ #endif
+ #if defined(CONFIG_TARGET_ODROIDGO3)
+ #define DRM_ROCKCHIP_FB_WIDTH 480
+ #define DRM_ROCKCHIP_FB_HEIGHT 854
+ #define DRM_ROCKCHIP_FB_BPP VIDEO_BPP32
+ #endif
#else
#ifdef CONFIG_DRM_ROCKCHIP_VIDEO_FRAMEBUFFER
#define DRM_ROCKCHIP_FB_WIDTH 1920