diff options
author | Hannes Petermaier <oe5hpm@oevsv.at> | 2015-04-24 14:49:35 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-05-08 17:24:17 -0400 |
commit | d804452bf4e4484d2ea305f3d4dc7ba219298fb3 (patch) | |
tree | e77e416c68c4ab9def872b7a70b725872ae1c4b6 /board/BuR/common | |
parent | 87f02d5aeef53bc2028b433a4c02ef2b2eea8c87 (diff) | |
download | u-boot-d804452bf4e4484d2ea305f3d4dc7ba219298fb3.tar.gz u-boot-d804452bf4e4484d2ea305f3d4dc7ba219298fb3.tar.xz u-boot-d804452bf4e4484d2ea305f3d4dc7ba219298fb3.zip |
board/BuR/tseries: take usage of CONFIG_LCD_ROTATION
We take use of the new LCD_ROTATION feature.
The information about how the display is rotated is taken from B&R specific
(/factory-settings/rotation) information in the devicetree.
The information there is stored as string (cw, ud, ccw, none) since starting
support of this devices and cannot be changed, so we have to convert it into
none = 0
cw = 1
ud = 2
ccw = 3
Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
Diffstat (limited to 'board/BuR/common')
-rw-r--r-- | board/BuR/common/common.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 23a98e4fdf..3036f86781 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -52,6 +52,9 @@ int load_lcdtiming(struct am335x_lcdpanel *panel) struct am335x_lcdpanel pnltmp; #ifdef CONFIG_USE_FDT u32 dtbprop; + char buf[32]; + const char *nodep = 0; + int nodeoff; if (gd->fdt_blob == NULL) { printf("%s: don't have a valid gd->fdt_blob!\n", __func__); @@ -97,6 +100,25 @@ int load_lcdtiming(struct am335x_lcdpanel *panel) dtbprop = FDTPROP(PATHTIM, "de-active"); if (dtbprop == 0) pnltmp.pol |= DE_INVERT; + + nodeoff = fdt_path_offset(gd->fdt_blob, "/factory-settings"); + if (nodeoff >= 0) { + nodep = fdt_getprop(gd->fdt_blob, nodeoff, "rotation", NULL); + if (nodep != 0) { + if (strcmp(nodep, "cw") == 0) + panel_info.vl_rot = 1; + else if (strcmp(nodep, "ud") == 0) + panel_info.vl_rot = 2; + else if (strcmp(nodep, "ccw") == 0) + panel_info.vl_rot = 3; + else + panel_info.vl_rot = 0; + } + } else { + puts("no 'factory-settings / rotation' in dtb!\n"); + } + snprintf(buf, sizeof(buf), "fbcon=rotate:%d", panel_info.vl_rot); + setenv("optargs_rot", buf); #else pnltmp.hactive = getenv_ulong("ds1_hactive", 10, ~0UL); pnltmp.vactive = getenv_ulong("ds1_vactive", 10, ~0UL); @@ -111,6 +133,7 @@ int load_lcdtiming(struct am335x_lcdpanel *panel) pnltmp.pol = getenv_ulong("ds1_pol", 16, ~0UL); pnltmp.pup_delay = getenv_ulong("ds1_pupdelay", 10, ~0UL); pnltmp.pon_delay = getenv_ulong("ds1_tondelay", 10, ~0UL); + panel_info.vl_rot = getenv_ulong("ds1_rotation", 10, 0); #endif if ( ~0UL == (pnltmp.hactive) || |