[U-Boot] [PATCH v2] common/lcd_simplefb: Add support for 32bit organized framebuffers

2015-04-24 Thread Hannes Petermaier
Signed-off-by: Hannes Petermaier 
---

Changes in v2:
- correct mistake in color order

 common/lcd_simplefb.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/lcd_simplefb.c b/common/lcd_simplefb.c
index 8db2add..2ba00f6 100644
--- a/common/lcd_simplefb.c
+++ b/common/lcd_simplefb.c
@@ -16,11 +16,14 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static int lcd_dt_simplefb_configure_node(void *blob, int off)
 {
-#if LCD_BPP == LCD_COLOR16
int vl_col = lcd_get_pixel_width();
int vl_row = lcd_get_pixel_height();
+#if LCD_BPP == LCD_COLOR16
return fdt_setup_simplefb_node(blob, off, gd->fb_base, vl_col, vl_row,
   vl_col * 2, "r5g6b5");
+#elif LCD_BPP == LCD_COLOR32
+   return fdt_setup_simplefb_node(blob, off, gd->fb_base, vl_col, vl_row,
+  vl_col * 4, "a8r8g8b8");
 #else
return -1;
 #endif
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 4/5] board/BuR/common: remove BMP_DISPLAY from tseries board

2015-04-24 Thread Hannes Petermaier
Since we display in future the splash screen out of linux-os, we don't need
this support anymore within the common section.

But kwb-target is still using BMP_DISPLAY feature, so we move the related
from the common section into the target-specific.

Also the default environment of tseries will be adapted to this.

Signed-off-by: Hannes Petermaier 
---

 include/configs/bur_am335x_common.h |6 --
 include/configs/kwb.h   |8 
 include/configs/tseries.h   |   10 ++
 3 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/include/configs/bur_am335x_common.h 
b/include/configs/bur_am335x_common.h
index 240fc46..c74140b 100644
--- a/include/configs/bur_am335x_common.h
+++ b/include/configs/bur_am335x_common.h
@@ -30,12 +30,6 @@
 "setenv stdout nc;setenv stdin nc;setenv stderr nc\0"
 
 #define CONFIG_CMD_TIME
-#define CONFIG_VIDEO_BMP_GZIP
-#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (1366*767*4)
-#define CONFIG_CMD_UNZIP
-#define CONFIG_CMD_BMP
-#define CONFIG_BMP_24BMP
-#define CONFIG_BMP_32BPP
 
 #define CONFIG_SYS_GENERIC_BOARD
 
diff --git a/include/configs/kwb.h b/include/configs/kwb.h
index dd30df2..7798b80 100644
--- a/include/configs/kwb.h
+++ b/include/configs/kwb.h
@@ -19,6 +19,14 @@
 #define CONFIG_LCD_NOSTDOUT
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define LCD_BPPLCD_COLOR32
+
+#define CONFIG_VIDEO_BMP_GZIP
+#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (1366*767*4)
+#define CONFIG_CMD_UNZIP
+#define CONFIG_CMD_BMP
+#define CONFIG_BMP_24BMP
+#define CONFIG_BMP_32BPP
+
 /* Clock Defines */
 #define V_OSCK 2600  /* Clock output from T2 */
 #define V_SCLK (V_OSCK)
diff --git a/include/configs/tseries.h b/include/configs/tseries.h
index c58403f..115fd5b 100644
--- a/include/configs/tseries.h
+++ b/include/configs/tseries.h
@@ -126,10 +126,6 @@
 #define MMCARGS \
 "dtbdev=mmc\0" \
 "dtbpart=0:1\0" \
-"logo0=ext4load mmc 0:3 ${loadaddr} /PPTLogo.bmp.gz && " \
-   "bmp display ${loadaddr} 0 0\0" \
-"logo1=ext4load mmc 0:1 ${loadaddr} /PPTLogo.bmp.gz && " \
-   "bmp display ${loadaddr} 0 0\0" \
 "mmcroot0=setenv bootargs ${optargs_rot} ${optargs} console=${console}\0" \
 "mmcroot1=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \
"root=/dev/mmcblk0p2 rootfstype=ext4\0" \
@@ -142,13 +138,11 @@
"setenv simplefb 0; " \
"ext4load mmc 0:2 ${loadaddr} /boot/${kernel}; " \
"run mmcroot1; bootz ${loadaddr} - ${dtbaddr};\0" \
-"defboot=run logo0 || run logo1; " \
-   "ext4load mmc 0:2 ${loadaddr} /boot/PPTImage.md5 && run mmcboot1; " \
+"defboot=ext4load mmc 0:2 ${loadaddr} /boot/PPTImage.md5 && run mmcboot1; " \
"ext4load mmc 0:1 ${dtbaddr} /$dtb && run mmcboot0; " \
"run ramboot; run usbupdate;\0" \
 "bootlimit=1\0" \
-"altbootcmd=run logo0 || run logo1; " \
-   "run mmcboot0;\0" \
+"altbootcmd=run mmcboot0;\0" \
 "upduboot=dhcp; " \
"tftp ${loadaddr} MLO && mmc write ${loadaddr} 100 100; " \
"tftp ${loadaddr} u-boot.img && mmc write ${loadaddr} 300 400;\0"
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 5/5] board/BuR/common: rename "usbupdate" environment to "usbscript"

2015-04-24 Thread Hannes Petermaier
usbupdate in real does allways load some script from usb-storage and execute
it, on all B&R targets.

So we do following 2 things:
- rename it to what it really does
- move it from boards to common environment

Signed-off-by: Hannes Petermaier 
---

 board/BuR/kwb/board.c   |4 ++--
 include/configs/bur_am335x_common.h |1 +
 include/configs/kwb.h   |6 +-
 include/configs/tseries.h   |4 +---
 4 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c
index 6eed7e0..01dd1d9 100644
--- a/board/BuR/kwb/board.c
+++ b/board/BuR/kwb/board.c
@@ -214,8 +214,8 @@ int board_late_init(void)
gpio_get_value(PUSH_KEY) && 1 == cnt) {
lcd_position_cursor(1, 8);
lcd_puts(
-   "updating U-BOOT from USB ...   ");
-   setenv("bootcmd", "run usbupdate");
+   "starting u-boot script from USB ...");
+   setenv("bootcmd", "run usbscript");
cnt = 4;
break;
} else if ((!gpio_get_value(ESC_KEY) &&
diff --git a/include/configs/bur_am335x_common.h 
b/include/configs/bur_am335x_common.h
index c74140b..b441fa0 100644
--- a/include/configs/bur_am335x_common.h
+++ b/include/configs/bur_am335x_common.h
@@ -13,6 +13,7 @@
 #define __BUR_AM335X_COMMON_H__
 /* - */
 #define BUR_COMMON_ENV \
+"usbscript=usb start && fatload usb 0 0x8000 usbscript.img && source\0" \
 "defaultip=192.168.60.253\0" \
 "defaultsip=192.168.60.254\0" \
 "netconsole=echo switching to network console ...; " \
diff --git a/include/configs/kwb.h b/include/configs/kwb.h
index 7798b80..d1c745e 100644
--- a/include/configs/kwb.h
+++ b/include/configs/kwb.h
@@ -80,10 +80,6 @@ BUR_COMMON_ENV \
"run loadromfs; " \
"tftp ${loadaddr} arimg && go ${loadaddr}; " \
"puts 'networkboot failed!';\0" \
-"usbupdate=echo updating u-boot from usb ...; " \
-   "usb start; " \
-   "fatload usb 0 0x8000 updateubootusb.img && source; " \
-   "puts 'usbupdate failed!'\0" \
 "netscript=echo running script from network (tftp) ...; " \
"tftp 0x8000 netscript.img && source; " \
"puts 'netscript load failed!'\0" \
@@ -101,7 +97,7 @@ BUR_COMMON_ENV \
 #endif /* !CONFIG_SPL_BUILD*/
 
 #define CONFIG_BOOTCOMMAND \
-   "run usbupdate;"
+   "run usbscript;"
 #define CONFIG_BOOTDELAY   0
 
 /* undefine command which we not need here */
diff --git a/include/configs/tseries.h b/include/configs/tseries.h
index 115fd5b..9218533 100644
--- a/include/configs/tseries.h
+++ b/include/configs/tseries.h
@@ -140,7 +140,7 @@
"run mmcroot1; bootz ${loadaddr} - ${dtbaddr};\0" \
 "defboot=ext4load mmc 0:2 ${loadaddr} /boot/PPTImage.md5 && run mmcboot1; " \
"ext4load mmc 0:1 ${dtbaddr} /$dtb && run mmcboot0; " \
-   "run ramboot; run usbupdate;\0" \
+   "run ramboot; run usbscript;\0" \
 "bootlimit=1\0" \
 "altbootcmd=run mmcboot0;\0" \
 "upduboot=dhcp; " \
@@ -185,8 +185,6 @@ BUR_COMMON_ENV \
"then; else tftp ${dtbaddr} ${dtb}; fi;" \
"run mmcroot0; " \
"bootz ${loadaddr} ${ramaddr} ${dtbaddr}; fi;\0" \
-"usbupdate=echo Updating UBOOT from USB-Stick ...; " \
-   "usb start && fatload usb 0 0x8000 updateubootusb.img && source\0" \
 "netupdate=echo Updating UBOOT from Network (TFTP) ...; " \
"setenv autoload 0; " \
"dhcp && tftp 0x8000 updateUBOOT.img && source;\0" \
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/5] board/BuR/tseries: take usage of CONFIG_LCD_ROTATION

2015-04-24 Thread Hannes Petermaier
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 
---

 board/BuR/common/common.c |   23 +++
 include/configs/tseries.h |8 +---
 2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
index 23a98e4..3036f86 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) ||
diff --git a/include/configs/tseries.h b/include/configs/tseries.h
index 1e41a12..4406e6f 100644
--- a/include/configs/tseries.h
+++ b/include/configs/tseries.h
@@ -17,6 +17,7 @@
 #define CONFIG_AM335X_LCD
 #define CONFIG_LCD
 #define CONFIG_LCD_NOSTDOUT
+#define CONFIG_LCD_ROTATION
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define LCD_BPPLCD_COLOR32
 
@@ -105,6 +106,7 @@
"mtdparts=" MTDPARTS_DEFAULT "\0" \
"nandargs=setenv bootargs console=${console} " \
"${optargs} " \
+   "${optargs_rot} " \
"root=mtd6 " \
"rootfstype=jffs2\0" \
"kernelsize=0x40\0" \
@@ -127,9 +129,9 @@
"bmp display ${loadaddr} 0 0\0" \
 "logo1=ext4load mmc 0:1 ${loadaddr} /PPTLogo.bmp.gz && " \
"bmp display ${loadaddr} 0 0\0" \
-"mmcroot0=setenv bootargs ${optargs} console=${console}\0" \
-"mmcroot1=setenv bootargs ${optargs} console=${console} root=/dev/mmcblk0p2 " \
-   "rootfstype=ext4\0" \
+"mmcroot0=setenv bootargs ${optargs_rot} ${optargs} console=${console}\0" \
+"mmcroot1=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \
+   "root=/dev/mmcblk0p2 rootfstype=ext4\0" \
 "mmcboot0=echo booting Updatesystem from mmc (ext4-fs) ...; " \
"ext4load mmc 0:1 ${loadaddr} /${kernel}; " \
"ext4load mmc 0:1 ${ramaddr} /${ramdisk}; " \
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] common/lcd_simplefb: Add support for 32bit organized framebuffers

2015-04-24 Thread Hannes Petermaier
Signed-off-by: Hannes Petermaier 
---

 common/lcd_simplefb.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/lcd_simplefb.c b/common/lcd_simplefb.c
index 8db2add..7153c40 100644
--- a/common/lcd_simplefb.c
+++ b/common/lcd_simplefb.c
@@ -16,11 +16,14 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static int lcd_dt_simplefb_configure_node(void *blob, int off)
 {
-#if LCD_BPP == LCD_COLOR16
int vl_col = lcd_get_pixel_width();
int vl_row = lcd_get_pixel_height();
+#if LCD_BPP == LCD_COLOR16
return fdt_setup_simplefb_node(blob, off, gd->fb_base, vl_col, vl_row,
   vl_col * 2, "r5g6b5");
+#elif LCD_BPP == LCD_COLOR32
+   return fdt_setup_simplefb_node(blob, off, gd->fb_base, vl_col, vl_row,
+  vl_col * 4, "a8b8g8r8");
 #else
return -1;
 #endif
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/5] board/BuR/tseries: remove unnary CONFIG_LCD_NOSTDOUT

2015-04-24 Thread Hannes Petermaier
the CONFIG_LCD_NOSTDOUT feature never had become mainline in uboot due to the
fact that the problem of "not writing out whole console to lcd" can be solved
with another way.

So we remove this unnary define.

Signed-off-by: Hannes Petermaier 
---

 include/configs/tseries.h |1 -
 1 file changed, 1 deletion(-)

diff --git a/include/configs/tseries.h b/include/configs/tseries.h
index 4406e6f..f2df358 100644
--- a/include/configs/tseries.h
+++ b/include/configs/tseries.h
@@ -16,7 +16,6 @@
 /* - */
 #define CONFIG_AM335X_LCD
 #define CONFIG_LCD
-#define CONFIG_LCD_NOSTDOUT
 #define CONFIG_LCD_ROTATION
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define LCD_BPPLCD_COLOR32
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/5] board/BuR/tseries: Add simplefb support

2015-04-24 Thread Hannes Petermaier
Since the used AM3352 SoC doesn't have GPU it isn't allways necessary to build
in complete drm-stuff into linux kernel. In very small applications only we use
the simple-framebuffer.

So we have 2 use-cases:
- device operating on drm-driver (let simplefb node disabled)
- device operating on simplefb-driver (activate simplefb node and reserve mem)

The decision is made by means of "simplefb" environment variable.

simplefb = 0
we don't enable the (maybe) existing simplefb node and all the rest around
display is up to the linux-kernel. We just disable the backlight, beceause we
do not want see the flicker during take over of drm-driver.

simplefb = 1
we enable the (maybe) existing simplefb node and reserve framebuffers size
in memory.

Signed-off-by: Hannes Petermaier 
---

 board/BuR/common/common.c |  134 +
 include/configs/tseries.h |4 ++
 2 files changed, 90 insertions(+), 48 deletions(-)

diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
index 3036f86..5b356fb 100644
--- a/board/BuR/common/common.c
+++ b/board/BuR/common/common.c
@@ -34,6 +34,7 @@
 #include "bur_common.h"
 #include "../../../drivers/video/am335x-fb.h"
 #include 
+#include 
 
 static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 
@@ -47,6 +48,64 @@ DECLARE_GLOBAL_DATA_PTR;
 /* --*/
 #if defined(CONFIG_LCD) && defined(CONFIG_AM335X_LCD) && \
!defined(CONFIG_SPL_BUILD)
+void lcdbacklight(int on)
+{
+#ifdef CONFIG_USE_FDT
+   if (gd->fdt_blob == NULL) {
+   printf("%s: don't have a valid gd->fdt_blob!\n", __func__);
+   return;
+   }
+   unsigned int driver = FDTPROP(PATHINF, "brightdrv");
+   unsigned int bright = FDTPROP(PATHINF, "brightdef");
+   unsigned int pwmfrq = FDTPROP(PATHINF, "brightfdim");
+#else
+   unsigned int driver = getenv_ulong("ds1_bright_drv", 16, 0UL);
+   unsigned int bright = getenv_ulong("ds1_bright_def", 10, 50);
+   unsigned int pwmfrq = getenv_ulong("ds1_pwmfreq", 10, ~0UL);
+#endif
+   unsigned int tmp;
+
+   struct gptimer *const timerhw = (struct gptimer *)DM_TIMER6_BASE;
+
+   if (on)
+   bright = bright != ~0UL ? bright : 50;
+   else
+   bright = 0;
+
+   switch (driver) {
+   case 0: /* PMIC LED-Driver */
+   /* brightness level */
+   tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
+  TPS65217_WLEDCTRL2, bright, 0xFF);
+   /* current sink */
+   tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
+  TPS65217_WLEDCTRL1,
+  bright != 0 ? 0x0A : 0x02,
+  0xFF);
+   break;
+   case 1: /* PWM using timer6 */
+   if (pwmfrq != ~0UL) {
+   timerhw->tiocp_cfg = TCFG_RESET;
+   udelay(10);
+   while (timerhw->tiocp_cfg & TCFG_RESET)
+   ;
+   tmp = ~0UL-(V_OSCK/pwmfrq); /* bottom value */
+   timerhw->tldr = tmp;
+   timerhw->tcrr = tmp;
+   tmp = tmp + ((V_OSCK/pwmfrq)/100) * bright;
+   timerhw->tmar = tmp;
+   timerhw->tclr = (TCLR_PT | (2 << TCLR_TRG_SHIFT) |
+   TCLR_CE | TCLR_AR | TCLR_ST);
+   } else {
+   puts("invalid pwmfrq in env/dtb! skip PWM-setup.\n");
+   }
+   break;
+   default:
+   puts("no suitable backlightdriver in env/dtb!\n");
+   break;
+   }
+}
+
 int load_lcdtiming(struct am335x_lcdpanel *panel)
 {
struct am335x_lcdpanel pnltmp;
@@ -304,6 +363,32 @@ int ft_board_setup(void *blob, bd_t *bd)
puts("set bootloader version 'bl-version' prop. not in dtb!\n");
return -1;
}
+   /*
+* if no simplefb is requested through environment, we don't set up
+* one, instead we turn off backlight.
+*/
+   if (getenv_ulong("simplefb", 10, 0) == 0) {
+   lcdbacklight(0);
+   return 0;
+   }
+   /* Setup simplefb devicetree node, also adapt memory-node,
+* upper limit for kernel e.g. linux is memtop-framebuffer alligned
+* to a full megabyte.
+*/
+   u64 start = gd->bd->bi_dram[0].start;
+   u64 size = (gd->fb_base - start) & ~0xF;
+   int rc = fdt_fixup_memory_banks(blob, &start, &size, 1);
+
+   if (rc) {
+   

[U-Boot] Test

2015-04-24 Thread Hannes Petermaier

Hi all,

since midnight i didn't receive anything from the mailinglist ... is 
there something wrong with it ?

or is my mail-provider defective?

best regards,
HAnnes

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/3] board/BuR/tseries: reactivate NAND-board

2015-04-07 Thread Hannes Petermaier
The NAND-version has been become a bit orphan.
Now we need to reactivate it, so bring necessary things:

- loading devicetree
- switch control signal to correct pins
- setup pinmux
- default-environment

up to date.

Signed-off-by: Hannes Petermaier 
---

 board/BuR/common/common.c |   15 +++
 board/BuR/tseries/board.c |3 +++
 board/BuR/tseries/mux.c   |2 +-
 include/configs/tseries.h |   37 -
 4 files changed, 35 insertions(+), 22 deletions(-)

diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
index 81ed8e5..87e4fd6 100644
--- a/board/BuR/common/common.c
+++ b/board/BuR/common/common.c
@@ -33,6 +33,7 @@
 #endif
 #include "bur_common.h"
 #include "../../../drivers/video/am335x-fb.h"
+#include 
 
 static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 
@@ -159,17 +160,22 @@ int load_lcdtiming(struct am335x_lcdpanel *panel)
 #ifdef CONFIG_USE_FDT
 static int load_devicetree(void)
 {
-   char *dtbname = getenv("dtb");
-   char *dtbdev = getenv("dtbdev");
-   char *dtppart = getenv("dtbpart");
-   u32 dtbaddr = getenv_ulong("dtbaddr", 16, 0UL);
int rc;
loff_t dtbsize;
+   u32 dtbaddr = getenv_ulong("dtbaddr", 16, 0UL);
 
if (dtbaddr == 0) {
printf("%s: don't have a valid  in env!\n", __func__);
return -1;
}
+#ifdef CONFIG_NAND
+   dtbsize = 0x2;
+   rc = nand_read_skip_bad(&nand_info[0], 0x4, (size_t *)&dtbsize,
+   NULL, 0x2, (u_char *)dtbaddr);
+#else
+   char *dtbname = getenv("dtb");
+   char *dtbdev = getenv("dtbdev");
+   char *dtppart = getenv("dtbpart");
if (!dtbdev || !dtbdev || !dtbname) {
printf("%s: // missing.\n", __func__);
return -1;
@@ -180,6 +186,7 @@ static int load_devicetree(void)
return -1;
}
rc = fs_read(dtbname, (u32)dtbaddr, 0, 0, &dtbsize);
+#endif
if (rc == 0) {
gd->fdt_blob = (void *)dtbaddr;
gd->fdt_size = dtbsize;
diff --git a/board/BuR/tseries/board.c b/board/BuR/tseries/board.c
index 89e989f..d1d698e 100644
--- a/board/BuR/tseries/board.c
+++ b/board/BuR/tseries/board.c
@@ -128,6 +128,9 @@ void am33xx_spl_board_init(void)
i2c_set_bus_num(0);
i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
pmicsetup(0);
+
+   gpio_direction_output(64+29, 1); /* switch NAND_RnB to GPMC_WAIT1 */
+   gpio_direction_output(64+28, 1); /* switch MII2_CRS to GPMC_WAIT0 */
 }
 
 const struct dpll_params *get_dpll_ddr_params(void)
diff --git a/board/BuR/tseries/mux.c b/board/BuR/tseries/mux.c
index ac7e885..caedf00 100644
--- a/board/BuR/tseries/mux.c
+++ b/board/BuR/tseries/mux.c
@@ -123,7 +123,7 @@ static struct module_pin_mux nand_pin_mux[] = {
{OFFSET(gpmc_ad5), (MODE(0) | PULLUP_EN | RXACTIVE)},   /* NAND AD5 */
{OFFSET(gpmc_ad6), (MODE(0) | PULLUP_EN | RXACTIVE)},   /* NAND AD6 */
{OFFSET(gpmc_ad7), (MODE(0) | PULLUP_EN | RXACTIVE)},   /* NAND AD7 */
-   {OFFSET(gpmc_wait0), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* NAND WAIT */
+   {OFFSET(gpmc_clk), (MODE(2) | RXACTIVE | PULLUP_EN)},   /* NAND WAIT */
{OFFSET(gpmc_wpn), (MODE(7) | PULLUP_EN | RXACTIVE)},   /* NAND_WPN */
{OFFSET(gpmc_csn0), (MODE(0) | PULLUDEN)},  /* NAND_CS0 */
{OFFSET(gpmc_advn_ale), (MODE(0) | PULLUDEN)},  /* NAND_ADV_ALE */
diff --git a/include/configs/tseries.h b/include/configs/tseries.h
index a6c7d5f..1e41a12 100644
--- a/include/configs/tseries.h
+++ b/include/configs/tseries.h
@@ -23,6 +23,8 @@
 #define CONFIG_HW_WATCHDOG
 #define CONFIG_OMAP_WATCHDOG
 #define CONFIG_SPL_WATCHDOG_SUPPORT
+
+#define CONFIG_SPL_GPIO_SUPPORT
 /* Bootcount using the RTC block */
 #define CONFIG_SYS_BOOTCOUNT_ADDR  0x44E3E000
 #define CONFIG_BOOTCOUNT_LIMIT
@@ -103,15 +105,16 @@
"mtdparts=" MTDPARTS_DEFAULT "\0" \
"nandargs=setenv bootargs console=${console} " \
"${optargs} " \
-   "root=${nandroot} " \
-   "rootfstype=${nandrootfstype}\0" \
-   "nandroot=ubi0:rootfs rw ubi.mtd=8,2048\0" \
-   "nandrootfstype=ubifs rootwait=1\0" \
-   "nandimgsize=0x50\0" \
-   "nandboot=echo Booting from nand ...; " \
+   "root=mtd6 " \
+   "rootfstype=jffs2\0" \
+   "kernelsize=0x40\0" \
+   "nandboot=echo booting from nand ...; " \
"run nandargs; " \
-   "nand read ${loadaddr} kernel ${nandimgsize}; " \
-   "bootz ${loadaddr}\0"
+   

[U-Boot] [PATCH 3/3] board/BuR/tseries: change pinmux

2015-04-07 Thread Hannes Petermaier
some pins on the board have been rerouted to other peripherals, so we
change the pinmux to apply with hardware-design.

Signed-off-by: Hannes Petermaier 

---

 board/BuR/tseries/mux.c |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/board/BuR/tseries/mux.c b/board/BuR/tseries/mux.c
index caedf00..c5dc4b7 100644
--- a/board/BuR/tseries/mux.c
+++ b/board/BuR/tseries/mux.c
@@ -17,8 +17,10 @@
 #include 
 
 static struct module_pin_mux uart0_pin_mux[] = {
+   /* UART0_RTS */
+   {OFFSET(uart0_rtsn), (MODE(0) | PULLUDEN)},
/* UART0_CTS */
-   {OFFSET(uart0_ctsn), (MODE(7) | PULLUDEN | PULLUP_EN | RXACTIVE)},
+   {OFFSET(uart0_ctsn), (MODE(0) | PULLUDEN | PULLUP_EN | RXACTIVE)},
/* UART0_RXD */
{OFFSET(uart0_rxd), (MODE(0) | PULLUDEN | PULLUP_EN | RXACTIVE)},
/* UART0_TXD */
@@ -26,9 +28,13 @@ static struct module_pin_mux uart0_pin_mux[] = {
{-1},
 };
 static struct module_pin_mux uart1_pin_mux[] = {
-   /* UART0_RXD */
+   /* UART1_RTS as I2C2-SCL */
+   {OFFSET(uart1_rtsn), (MODE(3) | PULLUDEN | PULLUP_EN | RXACTIVE)},
+   /* UART1_CTS as I2C2-SDA */
+   {OFFSET(uart1_ctsn), (MODE(3) | PULLUDEN | PULLUP_EN | RXACTIVE)},
+   /* UART1_RXD */
{OFFSET(uart1_rxd), (MODE(0) | PULLUDEN | PULLUP_EN | RXACTIVE)},
-   /* UART0_TXD */
+   /* UART1_TXD */
{OFFSET(uart1_txd), (MODE(0) | PULLUDEN)},
{-1},
 };
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] board/BuR/common: simplify access to devicetree

2015-04-07 Thread Hannes Petermaier
instead of polling everytime the environment, we take usage of the global
gd->fdt_blob variable and check it only against NULL.

Variable "dtbaddr" from environment is needed only one time on loading the
devicetree within "load_devicetree()"

Signed-off-by: Hannes Petermaier 
---

 board/BuR/common/common.c |  114 ++---
 1 file changed, 55 insertions(+), 59 deletions(-)

diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
index ccaa9c6..81ed8e5 100644
--- a/board/BuR/common/common.c
+++ b/board/BuR/common/common.c
@@ -39,7 +39,7 @@ static struct ctrl_dev *cdev = (struct ctrl_dev 
*)CTRL_DEVICE_BASE;
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_USE_FDT
-  #define FDTPROP(a, b, c) fdt_getprop_u32_default((void *)a, b, c, ~0UL)
+  #define FDTPROP(b, c) fdt_getprop_u32_default(gd->fdt_blob, b, c, ~0UL)
   #define PATHTIM "/panel/display-timings/default"
   #define PATHINF "/panel/panel-info"
 #endif
@@ -50,51 +50,50 @@ int load_lcdtiming(struct am335x_lcdpanel *panel)
 {
struct am335x_lcdpanel pnltmp;
 #ifdef CONFIG_USE_FDT
-   u32 dtbaddr = getenv_ulong("dtbaddr", 16, ~0UL);
u32 dtbprop;
 
-   if (dtbaddr == ~0UL) {
-   puts("load_lcdtiming: failed to get 'dtbaddr' from env!\n");
+   if (gd->fdt_blob == NULL) {
+   printf("%s: don't have a valid gd->fdt_blob!\n", __func__);
return -1;
}
memcpy(&pnltmp, (void *)panel, sizeof(struct am335x_lcdpanel));
 
-   pnltmp.hactive = FDTPROP(dtbaddr, PATHTIM, "hactive");
-   pnltmp.vactive = FDTPROP(dtbaddr, PATHTIM, "vactive");
-   pnltmp.bpp = FDTPROP(dtbaddr, PATHINF, "bpp");
-   pnltmp.hfp = FDTPROP(dtbaddr, PATHTIM, "hfront-porch");
-   pnltmp.hbp = FDTPROP(dtbaddr, PATHTIM, "hback-porch");
-   pnltmp.hsw = FDTPROP(dtbaddr, PATHTIM, "hsync-len");
-   pnltmp.vfp = FDTPROP(dtbaddr, PATHTIM, "vfront-porch");
-   pnltmp.vbp = FDTPROP(dtbaddr, PATHTIM, "vback-porch");
-   pnltmp.vsw = FDTPROP(dtbaddr, PATHTIM, "vsync-len");
-   pnltmp.pup_delay = FDTPROP(dtbaddr, PATHTIM, "pupdelay");
-   pnltmp.pon_delay = FDTPROP(dtbaddr, PATHTIM, "pondelay");
+   pnltmp.hactive = FDTPROP(PATHTIM, "hactive");
+   pnltmp.vactive = FDTPROP(PATHTIM, "vactive");
+   pnltmp.bpp = FDTPROP(PATHINF, "bpp");
+   pnltmp.hfp = FDTPROP(PATHTIM, "hfront-porch");
+   pnltmp.hbp = FDTPROP(PATHTIM, "hback-porch");
+   pnltmp.hsw = FDTPROP(PATHTIM, "hsync-len");
+   pnltmp.vfp = FDTPROP(PATHTIM, "vfront-porch");
+   pnltmp.vbp = FDTPROP(PATHTIM, "vback-porch");
+   pnltmp.vsw = FDTPROP(PATHTIM, "vsync-len");
+   pnltmp.pup_delay = FDTPROP(PATHTIM, "pupdelay");
+   pnltmp.pon_delay = FDTPROP(PATHTIM, "pondelay");
 
/* calc. proper clk-divisor */
-   dtbprop = FDTPROP(dtbaddr, PATHTIM, "clock-frequency");
+   dtbprop = FDTPROP(PATHTIM, "clock-frequency");
if (dtbprop != ~0UL)
pnltmp.pxl_clk_div = 19200 / dtbprop;
else
pnltmp.pxl_clk_div = ~0UL;
 
/* check polarity of control-signals */
-   dtbprop = FDTPROP(dtbaddr, PATHTIM, "hsync-active");
+   dtbprop = FDTPROP(PATHTIM, "hsync-active");
if (dtbprop == 0)
pnltmp.pol |= HSYNC_INVERT;
-   dtbprop = FDTPROP(dtbaddr, PATHTIM, "vsync-active");
+   dtbprop = FDTPROP(PATHTIM, "vsync-active");
if (dtbprop == 0)
pnltmp.pol |= VSYNC_INVERT;
-   dtbprop = FDTPROP(dtbaddr, PATHINF, "sync-ctrl");
+   dtbprop = FDTPROP(PATHINF, "sync-ctrl");
if (dtbprop == 1)
pnltmp.pol |= HSVS_CONTROL;
-   dtbprop = FDTPROP(dtbaddr, PATHINF, "sync-edge");
+   dtbprop = FDTPROP(PATHINF, "sync-edge");
if (dtbprop == 1)
pnltmp.pol |= HSVS_RISEFALL;
-   dtbprop = FDTPROP(dtbaddr, PATHTIM, "pixelclk-active");
+   dtbprop = FDTPROP(PATHTIM, "pixelclk-active");
if (dtbprop == 0)
pnltmp.pol |= PXCLK_INVERT;
-   dtbprop = FDTPROP(dtbaddr, PATHTIM, "de-active");
+   dtbprop = FDTPROP(PATHTIM, "de-active");
if (dtbprop == 0)
pnltmp.pol |= DE_INVERT;
 #else
@@ -163,11 +162,16 @@ static int load_devicetree(void)
char *dtbname = getenv("dtb");
char *dtbdev = getenv("dtbdev");
char *dtppart = getenv("dtbpart");
-   u32 dtbaddr = getenv_ulong("dtbaddr", 16, ~0UL);
+   u32 dtb

[U-Boot] [PATCH v4 4/4] common/lcd_console: introduce display/framebuffer rotation

2015-03-27 Thread Hannes Petermaier
From: Hannes Petermaier 

Sometimes, for example if the display is mounted in portrait mode or even if it
mounted landscape but rotated by 180 degrees, we need to rotate our content of
the display respectively the framebuffer, so that user can read the messages
who are printed out.

For this we introduce the feature called "CONFIG_LCD_ROTATION", this may be
defined in the board-configuration if needed. After this the lcd_console will
be initialized with a given rotation from "vl_rot" out of "vidinfo_t" which is
provided by the board specific code.

If CONFIG_LCD_ROTATION is not defined, the console will be initialized with
0 degrees rotation.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

Changes in v4:
- cosmetic changes to README
- avoid code-duplication (reuse console_calc_rowcol within rotation code).

Changes in v3:
- rename lcd_address to fbbase for better readability.
- remove empty line lcd_console.c
- use printf instead puts to inform about invalid-fb rotation.
- avoid code-duplication (move define of fbptr_t into lcd.h)

Changes in v2:
- cleanup README text for feature
- don't make code cleanups (lcd_console.c) within this patch
- remove (unnary) comment in lcd_console.h
- update year to 2015 within copyright in lcd_console.c
- move rotation related code into separate file lcd_console_rotation.c
- rework rotation code
- change meaning of vl_rot to match fbcon=rotate: from the linux-kernel

 README|   20 +
 common/Makefile   |1 +
 common/lcd.c  |   15 ++--
 common/lcd_console.c  |  160 ++---
 common/lcd_console_rotation.c |  195 +
 include/lcd.h |9 ++
 include/lcd_console.h |   28 +-
 7 files changed, 344 insertions(+), 84 deletions(-)
 create mode 100644 common/lcd_console_rotation.c

diff --git a/README b/README
index b0124d6..317c380 100644
--- a/README
+++ b/README
@@ -1947,6 +1947,26 @@ CBFS (Coreboot Filesystem) support
the console jump but can help speed up operation when scrolling
is slow.
 
+   CONFIG_LCD_ROTATION
+
+   Sometimes, for example if the display is mounted in portrait
+   mode or even if it's mounted landscape but rotated by 180degree,
+   we need to rotate our content of the display relative to the
+   framebuffer, so that user can read the messages which are
+   printed out.
+   Once CONFIG_LCD_ROTATION is defined, the lcd_console will be
+   initialized with a given rotation from "vl_rot" out of
+   "vidinfo_t" which is provided by the board specific code.
+   The value for vl_rot is coded as following (matching to
+   fbcon=rotate: linux-kernel commandline):
+   0 = no rotation respectively 0 degree
+   1 = 90 degree rotation
+   2 = 180 degree rotation
+   3 = 270 degree rotation
+
+   If CONFIG_LCD_ROTATION is not defined, the console will be
+   initialized with 0degree rotation.
+
CONFIG_LCD_BMP_RLE8
 
Support drawing of RLE8-compressed bitmaps on the LCD.
diff --git a/common/Makefile b/common/Makefile
index 7216a13..a1b3c09 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -200,6 +200,7 @@ obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-y += splash.o
 obj-$(CONFIG_SPLASH_SOURCE) += splash_source.o
 obj-$(CONFIG_LCD) += lcd.o lcd_console.o
+obj-$(CONFIG_LCD_ROTATION) += lcd_console_rotation.o
 obj-$(CONFIG_LCD_DT_SIMPLEFB) += lcd_simplefb.o
 obj-$(CONFIG_LYNXKDI) += lynxkdi.o
 obj-$(CONFIG_MENU) += menu.o
diff --git a/common/lcd.c b/common/lcd.c
index f33942c..d1b4ca7 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -167,7 +167,6 @@ int drv_lcd_init(void)
 
 void lcd_clear(void)
 {
-   short console_rows, console_cols;
int bg_color;
char *s;
ulong addr;
@@ -211,16 +210,14 @@ void lcd_clear(void)
}
 #endif
 #endif
+   /* setup text-console */
+   debug("[LCD] setting up console...\n");
+   lcd_init_console(lcd_base,
+panel_info.vl_col,
+panel_info.vl_row,
+panel_info.vl_rot);
/* Paint the logo and retrieve LCD base address */
debug("[LCD] Drawing the logo...\n");
-#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
-   console_rows = (panel_info.vl_row - BMP_LOGO_HEIGHT);
-   console_rows /= VIDEO_FONT_HEIGHT;
-#else
-   console_rows = panel_info.vl_row / VIDEO_FONT_HEIGHT;
-#endif
-   console_cols = panel_info.vl_col / VIDEO_FONT_WIDTH;
-   lcd_init_console(lcd_base, console_rows, console_cols);
if (do_splash) {
s = getenv("spl

[U-Boot] [PATCH v4 0/4] common/lcd_console: introduce display/framebuffer rotation

2015-03-27 Thread Hannes Petermaier
Sometimes, for example if the display is mounted in portrait mode or even if it
mounted landscape but rotated by 180 degree, we need to rotate our content of
the display respectively the framebuffer, so that user can read the messages who
are printed out.

For this we introduce the feature called "CONFIG_LCD_ROTATION", this may be
defined in the board-configuration if needed. After this the lcd_console will
be initialized with a given rotation from "vl_rot" out of "vidinfo_t" which is
provided by the board specific code.
The value for vl_rot is coded as following (matching to fbcon=rotate: linux-
kernel commandline):
0 = no rotation respectively 0 degree
1 = 90 degree rotation
2 = 180 degree rotation
3 = 270 degree rotation

If CONFIG_LCD_ROTATION is not defined, the console will be initialized with
0 degrees rotation.

Patch 1-3 make preparations to the code.
Patch 4 implements the new feature

Changes in v4:
- cosmetic changes to README
- avoid code-duplication (reuse console_calc_rowcol within rotation code).

Changes in v3:
- rename lcd_address to fbbase for better readability.
- remove empty line lcd_console.c
- use printf instead puts to inform about invalid-fb rotation.
- avoid code-duplication (move define of fbptr_t into lcd.h)

Changes in v2:
- cleanup README text for feature
- don't make code cleanups (lcd_console.c) within this patch
- remove (unnary) comment in lcd_console.h
- update year to 2015 within copyright in lcd_console.c
- move rotation related code into separate file lcd_console_rotation.c
- rework rotation code
- change meaning of vl_rot to match fbcon=rotate: from the linux-kernel

Hannes Petermaier (4):
  common/lcd_console: cleanup lcd_drawchars/lcd_putc_xy
  common/lcd_console: ask only one-time for bg/fg-color per call
  common/lcd_console: move single static variables into common (static)
structure
  common/lcd_console: introduce display/framebuffer rotation

 README|   20 +
 common/Makefile   |1 +
 common/lcd.c  |   15 ++--
 common/lcd_console.c  |  200 +
 common/lcd_console_rotation.c |  195 
 include/lcd.h |9 ++
 include/lcd_console.h |   28 +-
 7 files changed, 358 insertions(+), 110 deletions(-)
 create mode 100644 common/lcd_console_rotation.c

-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v4 2/4] common/lcd_console: ask only one-time for bg/fg-color per call

2015-03-27 Thread Hannes Petermaier
From: Hannes Petermaier 

Don't call the lcd_getfgcolor and lcd_getbgcolor within the "draw-loop", this
only wastes time.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 common/lcd_console.c |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index 243b7c5..b7dda7a 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -59,7 +59,8 @@ static void lcd_putc_xy(ushort x, ushort y, char c)
 {
uchar *dest;
ushort row;
-   int fg_color, bg_color;
+   int fg_color = lcd_getfgcolor();
+   int bg_color = lcd_getbgcolor();
int i;
 
dest = (uchar *)(lcd_console_address +
@@ -73,10 +74,6 @@ static void lcd_putc_xy(ushort x, ushort y, char c)
 #else
uchar *d = dest;
 #endif
-
-   fg_color = lcd_getfgcolor();
-   bg_color = lcd_getbgcolor();
-
uchar bits;
bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
 
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v4 3/4] common/lcd_console: move single static variables into common (static) structure

2015-03-27 Thread Hannes Petermaier
From: Hannes Petermaier 

For coming implementation of lcd_console rotation, we will need some more
variables for holding information about framebuffer size, rotation, ...

For better readability we catch all them into a common structure.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 common/lcd_console.c |   76 +-
 1 file changed, 38 insertions(+), 38 deletions(-)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index b7dda7a..cac77be 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -11,48 +11,49 @@
 #include /* Get font data, width and height */
 
 #define CONSOLE_ROW_SIZE   (VIDEO_FONT_HEIGHT * lcd_line_length)
-#define CONSOLE_ROW_FIRST  lcd_console_address
-#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * console_rows)
+#define CONSOLE_ROW_FIRST  cons.lcd_address
+#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * cons.rows)
 
-static short console_curr_col;
-static short console_curr_row;
-static short console_cols;
-static short console_rows;
-static void *lcd_console_address;
+struct console_t {
+   short curr_col, curr_row;
+   short cols, rows;
+   void *lcd_address;
+};
+static struct console_t cons;
 
 void lcd_init_console(void *address, int rows, int cols)
 {
-   console_curr_col = 0;
-   console_curr_row = 0;
-   console_cols = cols;
-   console_rows = rows;
-   lcd_console_address = address;
+   memset(&cons, 0, sizeof(cons));
+   cons.cols = cols;
+   cons.rows = rows;
+   cons.lcd_address = address;
+
 }
 
 void lcd_set_col(short col)
 {
-   console_curr_col = col;
+   cons.curr_col = col;
 }
 
 void lcd_set_row(short row)
 {
-   console_curr_row = row;
+   cons.curr_row = row;
 }
 
 void lcd_position_cursor(unsigned col, unsigned row)
 {
-   console_curr_col = min_t(short, col, console_cols - 1);
-   console_curr_row = min_t(short, row, console_rows - 1);
+   cons.curr_col = min_t(short, col, cons.cols - 1);
+   cons.curr_row = min_t(short, row, cons.rows - 1);
 }
 
 int lcd_get_screen_rows(void)
 {
-   return console_rows;
+   return cons.rows;
 }
 
 int lcd_get_screen_columns(void)
 {
-   return console_cols;
+   return cons.cols;
 }
 
 static void lcd_putc_xy(ushort x, ushort y, char c)
@@ -63,7 +64,7 @@ static void lcd_putc_xy(ushort x, ushort y, char c)
int bg_color = lcd_getbgcolor();
int i;
 
-   dest = (uchar *)(lcd_console_address +
+   dest = (uchar *)(cons.lcd_address +
 y * lcd_line_length + x * NBITS(LCD_BPP) / 8);
 
for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
@@ -91,7 +92,7 @@ static void console_scrollup(void)
 
/* Copy up rows ignoring those that will be overwritten */
memcpy(CONSOLE_ROW_FIRST,
-  lcd_console_address + CONSOLE_ROW_SIZE * rows,
+  cons.lcd_address + CONSOLE_ROW_SIZE * rows,
   CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows);
 
/* Clear the last rows */
@@ -99,7 +100,7 @@ static void console_scrollup(void)
memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
   bg_color, CONSOLE_ROW_SIZE * rows);
 #else
-   u32 *ppix = lcd_console_address +
+   u32 *ppix = cons.lcd_address +
CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows;
u32 i;
for (i = 0;
@@ -109,27 +110,27 @@ static void console_scrollup(void)
}
 #endif
lcd_sync();
-   console_curr_row -= rows;
+   cons.curr_row -= rows;
 }
 
 static inline void console_back(void)
 {
-   if (--console_curr_col < 0) {
-   console_curr_col = console_cols - 1;
-   if (--console_curr_row < 0)
-   console_curr_row = 0;
+   if (--cons.curr_col < 0) {
+   cons.curr_col = cons.cols - 1;
+   if (--cons.curr_row < 0)
+   cons.curr_row = 0;
}
 
-   lcd_putc_xy(console_curr_col * VIDEO_FONT_WIDTH,
-   console_curr_row * VIDEO_FONT_HEIGHT, ' ');
+   lcd_putc_xy(cons.curr_col * VIDEO_FONT_WIDTH,
+   cons.curr_row * VIDEO_FONT_HEIGHT, ' ');
 }
 
 static inline void console_newline(void)
 {
-   console_curr_col = 0;
+   cons.curr_col = 0;
 
/* Check if we need to scroll the terminal */
-   if (++console_curr_row >= console_rows)
+   if (++cons.curr_row >= cons.rows)
console_scrollup();
else
lcd_sync();
@@ -145,18 +146,17 @@ void lcd_putc(const char c)
 
switch (c) {
case '\r':
-   console_curr_col = 0;
-
+   cons.curr_col = 0;
return;
case '\n':
console_newline();
 

[U-Boot] [PATCH v4 1/4] common/lcd_console: cleanup lcd_drawchars/lcd_putc_xy

2015-03-27 Thread Hannes Petermaier
From: Hannes Petermaier 

the capability of drawing some *str with count from lcd_drawchars is unnary.
It is always called from lcd_putc_xy with one character of and count = 1.

So we simply rename lcd_drawchars into lcd_putc_xy and remove the loops inside.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 common/lcd_console.c |   23 +++
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index 8bf83b9..243b7c5 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -55,18 +55,17 @@ int lcd_get_screen_columns(void)
return console_cols;
 }
 
-static void lcd_drawchars(ushort x, ushort y, uchar *str, int count)
+static void lcd_putc_xy(ushort x, ushort y, char c)
 {
uchar *dest;
ushort row;
int fg_color, bg_color;
+   int i;
 
dest = (uchar *)(lcd_console_address +
 y * lcd_line_length + x * NBITS(LCD_BPP) / 8);
 
for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
-   uchar *s = str;
-   int i;
 #if LCD_BPP == LCD_COLOR16
ushort *d = (ushort *)dest;
 #elif LCD_BPP == LCD_COLOR32
@@ -77,25 +76,17 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, 
int count)
 
fg_color = lcd_getfgcolor();
bg_color = lcd_getbgcolor();
-   for (i = 0; i < count; ++i) {
-   uchar c, bits;
 
-   c = *s++;
-   bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
+   uchar bits;
+   bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
 
-   for (c = 0; c < 8; ++c) {
-   *d++ = (bits & 0x80) ? fg_color : bg_color;
-   bits <<= 1;
-   }
+   for (i = 0; i < 8; ++i) {
+   *d++ = (bits & 0x80) ? fg_color : bg_color;
+   bits <<= 1;
}
}
 }
 
-static inline void lcd_putc_xy(ushort x, ushort y, uchar c)
-{
-   lcd_drawchars(x, y, &c, 1);
-}
-
 static void console_scrollup(void)
 {
const int rows = CONFIG_CONSOLE_SCROLL_LINES;
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 4/4] common/lcd_console: introduce display/framebuffer rotation

2015-03-25 Thread Hannes Petermaier


On 2015-03-25 17:24, Nikita Kiryanov wrote:

Hi Hannes,

Hi Nikita,

This is almost an Acked-By from me, just a few final comments:

Perfect, i think with v4 we can finish the thing :-)


On 03/19/2015 10:37 AM, Hannes Petermaier wrote:


diff --git a/README b/README
index b0124d6..c649de1 100644
--- a/README
+++ b/README
@@ -1947,6 +1947,28 @@ CBFS (Coreboot Filesystem) support
  the console jump but can help speed up operation when 
scrolling

  is slow.

+CONFIG_LCD_ROTATION
+
+Sometimes, for example if the display is mounted in portrait
+mode or even if it mounted landscape but rotated by 180degree,


s/if it/if it's/


+we need to rotate our content of the display respectively the


s/respectively the/relative to the/


+framebuffer, so that user can read the messages who are printed


s/who are printed/which are printed/


+out.
+For this we introduce the feature called "CONFIG_LCD_ROTATION",
+this may be defined in the board-configuration if needed.  
After

+this the lcd_console will be initialized with a given rotation


"this may be defined in the board-configuration if needed"
This is true for all config options in general, no need to mention this.
Also, "For this we introduce" is good for a commit message, but 
doesn't look good

once committed.
How about just "Once CONFIG_LCD_ROTATION is defined, the lcd_console 
will be..."



+from "vl_rot" out of "vidinfo_t" which is provided by the board
+specific code.
+The value for vl_rot is coded as following (matching to
+fbcon=rotate: linux-kernel commandline):
+0 = no rotation respectively 0 degree
+1 = 90 degree rotation
+2 = 180 degree rotation
+3 = 270 degree rotation
+
+If CONFIG_LCD_ROTATION is not defined, the console will be
+initialized with 0degree rotation.
+
  CONFIG_LCD_BMP_RLE8

  Support drawing of RLE8-compressed bitmaps on the LCD.


[...]


+static void console_calc_rowcol(struct console_t *pcons)
+{
+pcons->cols = pcons->lcdsizex / VIDEO_FONT_WIDTH;
+#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
+pcons->rows = (pcons->lcdsizey - BMP_LOGO_HEIGHT);
+pcons->rows /= VIDEO_FONT_HEIGHT;
+#else
+pcons->rows = pcons->lcdsizey / VIDEO_FONT_HEIGHT;
+#endif
+}
Okay, i will fixup the description in v4 ... maybe these troubles are 
coming from, lets say, sub-optimal english-language practise :-)

In original i speak german.


[...]


@@ -235,4 +253,3 @@ U_BOOT_CMD(
  "print string on lcd-framebuffer",
  ""
  );
-


Looks like part of the cleanup from the previous series slipped 
through...

Okay, i will remove it.



+static void console_calc_rowcol_rot(struct console_t *pcons)
+{
+u32 cols, rows;
+
+if (pcons->lcdrot == 1 || pcons->lcdrot == 3) {
+cols = pcons->lcdsizey;
+rows = pcons->lcdsizex;
+} else {
+cols = pcons->lcdsizex;
+rows = pcons->lcdsizey;
+}
+
+pcons->cols = cols / VIDEO_FONT_WIDTH;
+#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
+pcons->rows = (rows - BMP_LOGO_HEIGHT);
+pcons->rows /= VIDEO_FONT_HEIGHT;
+#else
+pcons->rows = rows / VIDEO_FONT_HEIGHT;
+#endif


This duplication with console_calc_rowcol() exists because the 
lcdsizey and

lcdsizex data is expected by the functions to be already in pcons. If you
change console_calc_rowcol() to accept both variables as additional
arguments, then console_calc_rowcol() could be reused in
console_calc_rowcol_rot() and we'll get rid of the code duplication.

I'm not sure about what is more uggly or better.
To avoid this duplication and use one function i have to make this 
function non-static and make a mix of rotation-code into lcd_console.c - 
i wouldn't prefer this.
Maybe the actual way of this (little) duplication is the beautiful one 
and gives most readability of the code.


what do you mean about?

best regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] board/BuR/common: remove unused function 'blink'

2015-03-19 Thread Hannes Petermaier
From: Hannes Petermaier 

since we have possibility to write out on lcd whats going on, we don't need
the gpio blink functionality anymore.

Signed-off-by: Hannes Petermaier 

Signed-off-by: Hannes Petermaier 
---

 board/BuR/common/bur_common.h |1 -
 board/BuR/common/common.c |   14 --
 2 files changed, 15 deletions(-)

diff --git a/board/BuR/common/bur_common.h b/board/BuR/common/bur_common.h
index 3061e4c..e4896fb 100644
--- a/board/BuR/common/bur_common.h
+++ b/board/BuR/common/bur_common.h
@@ -16,7 +16,6 @@
 
 int load_lcdtiming(struct am335x_lcdpanel *panel);
 void br_summaryscreen(void);
-void blink(u32 blinks, u32 intervall, u32 pin);
 void pmicsetup(u32 mpupll);
 void enable_uart0_pin_mux(void);
 void enable_i2c_pin_mux(void);
diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
index 91834eb..ccaa9c6 100644
--- a/board/BuR/common/common.c
+++ b/board/BuR/common/common.c
@@ -441,20 +441,6 @@ void lcd_enable(void)
 #error "LCD-support with a suitable FB-Driver is mandatory !"
 #endif /* CONFIG_LCD */
 
-void blink(u32 blinks, u32 intervall, u32 pin)
-{
-   gpio_direction_output(pin, 0);
-   int val = 0;
-
-   do {
-   val ^= 0x01;
-   gpio_set_value(pin, val);
-   mdelay(intervall);
-   } while (blinks--);
-
-   gpio_set_value(pin, 0);
-}
-
 #ifdef CONFIG_SPL_BUILD
 void pmicsetup(u32 mpupll)
 {
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] board/BuR/common: move I2C initialization from common part to board-specific

2015-03-19 Thread Hannes Petermaier
From: Hannes Petermaier 

At this time I2C and responsible pin-mux is setup during PMIC initialziation
within common.c, this is possible because today PMIC is always connected on
I2C0.

In Future this will be changed, PMIC isn't anymore connected to bus0 in call
cases.

So we do following:
- rename enable_i2c_pin_mux0 to enable_i2c_pin_mux to be generic for enabling
  pin-mux on different or more busses.
- move the call to i2c_pin_mux and i2c_init from common.c to the specific
  board.c

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

 board/BuR/common/bur_common.h |2 +-
 board/BuR/common/common.c |4 
 board/BuR/kwb/board.c |3 ++-
 board/BuR/kwb/mux.c   |2 +-
 board/BuR/tseries/board.c |4 
 board/BuR/tseries/mux.c   |2 +-
 6 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/board/BuR/common/bur_common.h b/board/BuR/common/bur_common.h
index 39afbba..3061e4c 100644
--- a/board/BuR/common/bur_common.h
+++ b/board/BuR/common/bur_common.h
@@ -19,7 +19,7 @@ void br_summaryscreen(void);
 void blink(u32 blinks, u32 intervall, u32 pin);
 void pmicsetup(u32 mpupll);
 void enable_uart0_pin_mux(void);
-void enable_i2c0_pin_mux(void);
+void enable_i2c_pin_mux(void);
 void enable_board_pin_mux(void);
 int board_eth_init(bd_t *bis);
 
diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
index 5ff8a7e..91834eb 100644
--- a/board/BuR/common/common.c
+++ b/board/BuR/common/common.c
@@ -461,10 +461,6 @@ void pmicsetup(u32 mpupll)
int mpu_vdd;
int usb_cur_lim;
 
-   /* setup I2C */
-   enable_i2c0_pin_mux();
-   i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
-
if (i2c_probe(TPS65217_CHIP_PM)) {
puts("PMIC (0x24) not found! skip further initalization.\n");
return;
diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c
index 892311e..6eed7e0 100644
--- a/board/BuR/kwb/board.c
+++ b/board/BuR/kwb/board.c
@@ -124,7 +124,8 @@ void am33xx_spl_board_init(void)
gpio_direction_output(LCD_PWR, 0);
 
/* setup I2C */
-   enable_i2c0_pin_mux();
+   enable_i2c_pin_mux();
+   i2c_set_bus_num(0);
i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 
/* power-ON  3V3 via Resetcontroller */
diff --git a/board/BuR/kwb/mux.c b/board/BuR/kwb/mux.c
index 9f89b5e..2b1d8d3 100644
--- a/board/BuR/kwb/mux.c
+++ b/board/BuR/kwb/mux.c
@@ -180,7 +180,7 @@ void enable_uart0_pin_mux(void)
configure_module_pin_mux(uart0_pin_mux);
 }
 
-void enable_i2c0_pin_mux(void)
+void enable_i2c_pin_mux(void)
 {
configure_module_pin_mux(i2c0_pin_mux);
 }
diff --git a/board/BuR/tseries/board.c b/board/BuR/tseries/board.c
index 9402aa4..89e989f 100644
--- a/board/BuR/tseries/board.c
+++ b/board/BuR/tseries/board.c
@@ -123,6 +123,10 @@ void am33xx_spl_board_init(void)
/* setup LCD-Pixel Clock */
writel(0x2, &cmdpll->clklcdcpixelclk);  /* clock comes from perPLL M2 */
 
+   /* setup I2C */
+   enable_i2c_pin_mux();
+   i2c_set_bus_num(0);
+   i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
pmicsetup(0);
 }
 
diff --git a/board/BuR/tseries/mux.c b/board/BuR/tseries/mux.c
index 2c87a63..ac7e885 100644
--- a/board/BuR/tseries/mux.c
+++ b/board/BuR/tseries/mux.c
@@ -226,7 +226,7 @@ void enable_uart0_pin_mux(void)
configure_module_pin_mux(uart0_pin_mux);
 }
 
-void enable_i2c0_pin_mux(void)
+void enable_i2c_pin_mux(void)
 {
configure_module_pin_mux(i2c0_pin_mux);
 }
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 4/4] common/lcd_console: introduce display/framebuffer rotation

2015-03-19 Thread Hannes Petermaier
From: Hannes Petermaier 

Sometimes, for example if the display is mounted in portrait mode or even if it
mounted landscape but rotated by 180 degrees, we need to rotate our content of
the display respectively the framebuffer, so that user can read the messages
who are printed out.

For this we introduce the feature called "CONFIG_LCD_ROTATION", this may be
defined in the board-configuration if needed. After this the lcd_console will
be initialized with a given rotation from "vl_rot" out of "vidinfo_t" which is
provided by the board specific code.

If CONFIG_LCD_ROTATION is not defined, the console will be initialized with
0 degrees rotation.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

Changes in v3:
- rename lcd_address to fbbase for better readability.
- remove empty line lcd_console.c
- use printf instead puts to inform about invalid-fb rotation.
- avoid code-duplication (move define of fbptr_t into lcd.h)

Changes in v2:
- cleanup README text for feature
- don't make code cleanups (lcd_console.c) within this patch
- remove (unnary) comment in lcd_console.h
- update year to 2015 within copyright in lcd_console.c
- move rotation related code into separate file lcd_console_rotation.c
- rework rotation code
- change meaning of vl_rot to match fbcon=rotate: from the linux-kernel

 README|   22 +
 common/Makefile   |1 +
 common/lcd.c  |   15 ++-
 common/lcd_console.c  |  161 +--
 common/lcd_console_rotation.c |  208 +
 include/lcd.h |9 ++
 include/lcd_console.h |   18 +++-
 7 files changed, 349 insertions(+), 85 deletions(-)
 create mode 100644 common/lcd_console_rotation.c

diff --git a/README b/README
index b0124d6..c649de1 100644
--- a/README
+++ b/README
@@ -1947,6 +1947,28 @@ CBFS (Coreboot Filesystem) support
the console jump but can help speed up operation when scrolling
is slow.
 
+   CONFIG_LCD_ROTATION
+
+   Sometimes, for example if the display is mounted in portrait
+   mode or even if it mounted landscape but rotated by 180degree,
+   we need to rotate our content of the display respectively the
+   framebuffer, so that user can read the messages who are printed
+   out.
+   For this we introduce the feature called "CONFIG_LCD_ROTATION",
+   this may be defined in the board-configuration if needed. After
+   this the lcd_console will be initialized with a given rotation
+   from "vl_rot" out of "vidinfo_t" which is provided by the board
+   specific code.
+   The value for vl_rot is coded as following (matching to
+   fbcon=rotate: linux-kernel commandline):
+   0 = no rotation respectively 0 degree
+   1 = 90 degree rotation
+   2 = 180 degree rotation
+   3 = 270 degree rotation
+
+   If CONFIG_LCD_ROTATION is not defined, the console will be
+   initialized with 0degree rotation.
+
CONFIG_LCD_BMP_RLE8
 
Support drawing of RLE8-compressed bitmaps on the LCD.
diff --git a/common/Makefile b/common/Makefile
index 7216a13..a1b3c09 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -200,6 +200,7 @@ obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-y += splash.o
 obj-$(CONFIG_SPLASH_SOURCE) += splash_source.o
 obj-$(CONFIG_LCD) += lcd.o lcd_console.o
+obj-$(CONFIG_LCD_ROTATION) += lcd_console_rotation.o
 obj-$(CONFIG_LCD_DT_SIMPLEFB) += lcd_simplefb.o
 obj-$(CONFIG_LYNXKDI) += lynxkdi.o
 obj-$(CONFIG_MENU) += menu.o
diff --git a/common/lcd.c b/common/lcd.c
index f33942c..d1b4ca7 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -167,7 +167,6 @@ int drv_lcd_init(void)
 
 void lcd_clear(void)
 {
-   short console_rows, console_cols;
int bg_color;
char *s;
ulong addr;
@@ -211,16 +210,14 @@ void lcd_clear(void)
}
 #endif
 #endif
+   /* setup text-console */
+   debug("[LCD] setting up console...\n");
+   lcd_init_console(lcd_base,
+panel_info.vl_col,
+panel_info.vl_row,
+panel_info.vl_rot);
/* Paint the logo and retrieve LCD base address */
debug("[LCD] Drawing the logo...\n");
-#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
-   console_rows = (panel_info.vl_row - BMP_LOGO_HEIGHT);
-   console_rows /= VIDEO_FONT_HEIGHT;
-#else
-   console_rows = panel_info.vl_row / VIDEO_FONT_HEIGHT;
-#endif
-   console_cols = panel_info.vl_col / VIDEO_FONT_WIDTH;
-   lcd_init_console(lcd_base, console_rows, console_cols);
if (do_splash) {
s = getenv(&quo

[U-Boot] [PATCH v3 0/4] common/lcd_console: introduce display/framebuffer rotation

2015-03-19 Thread Hannes Petermaier
Sometimes, for example if the display is mounted in portrait mode or even if it
mounted landscape but rotated by 180 degree, we need to rotate our content of
the display respectively the framebuffer, so that user can read the messages who
are printed out.

For this we introduce the feature called "CONFIG_LCD_ROTATION", this may be
defined in the board-configuration if needed. After this the lcd_console will
be initialized with a given rotation from "vl_rot" out of "vidinfo_t" which is
provided by the board specific code.
The value for vl_rot is coded as following (matching to fbcon=rotate: linux-
kernel commandline):
0 = no rotation respectively 0 degree
1 = 90 degree rotation
2 = 180 degree rotation
3 = 270 degree rotation

If CONFIG_LCD_ROTATION is not defined, the console will be initialized with
0 degrees rotation.

Patch 1-3 make preparations to the code.
Patch 4 implements the new feature

Changes in v3:
- rename lcd_address to fbbase for better readability.
- remove empty line lcd_console.c
- use printf instead puts to inform about invalid-fb rotation.
- avoid code-duplication (move define of fbptr_t into lcd.h)

Changes in v2:
- cleanup README text for feature
- don't make code cleanups (lcd_console.c) within this patch
- remove (unnary) comment in lcd_console.h
- update year to 2015 within copyright in lcd_console.c
- move rotation related code into separate file lcd_console_rotation.c
- rework rotation code
- change meaning of vl_rot to match fbcon=rotate: from the linux-kernel

Hannes Petermaier (4):
  common/lcd_console: cleanup lcd_drawchars/lcd_putc_xy
  common/lcd_console: ask only one-time for bg/fg-color per call
  common/lcd_console: move single static variables into common (static)
structure
  common/lcd_console: introduce display/framebuffer rotation

 README|   22 +
 common/Makefile   |1 +
 common/lcd.c  |   15 ++-
 common/lcd_console.c  |  201 ---
 common/lcd_console_rotation.c |  208 +
 include/lcd.h |9 ++
 include/lcd_console.h |   18 +++-
 7 files changed, 363 insertions(+), 111 deletions(-)
 create mode 100644 common/lcd_console_rotation.c

-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 2/4] common/lcd_console: ask only one-time for bg/fg-color per call

2015-03-19 Thread Hannes Petermaier
From: Hannes Petermaier 

Don't call the lcd_getfgcolor and lcd_getbgcolor within the "draw-loop", this
only wastes time.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

Changes in v3: None
Changes in v2: None

 common/lcd_console.c |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index 243b7c5..b7dda7a 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -59,7 +59,8 @@ static void lcd_putc_xy(ushort x, ushort y, char c)
 {
uchar *dest;
ushort row;
-   int fg_color, bg_color;
+   int fg_color = lcd_getfgcolor();
+   int bg_color = lcd_getbgcolor();
int i;
 
dest = (uchar *)(lcd_console_address +
@@ -73,10 +74,6 @@ static void lcd_putc_xy(ushort x, ushort y, char c)
 #else
uchar *d = dest;
 #endif
-
-   fg_color = lcd_getfgcolor();
-   bg_color = lcd_getbgcolor();
-
uchar bits;
bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
 
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 3/4] common/lcd_console: move single static variables into common (static) structure

2015-03-19 Thread Hannes Petermaier
From: Hannes Petermaier 

For coming implementation of lcd_console rotation, we will need some more
variables for holding information about framebuffer size, rotation, ...

For better readability we catch all them into a common structure.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

Changes in v3: None
Changes in v2: None

 common/lcd_console.c |   76 +-
 1 file changed, 38 insertions(+), 38 deletions(-)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index b7dda7a..cac77be 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -11,48 +11,49 @@
 #include /* Get font data, width and height */
 
 #define CONSOLE_ROW_SIZE   (VIDEO_FONT_HEIGHT * lcd_line_length)
-#define CONSOLE_ROW_FIRST  lcd_console_address
-#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * console_rows)
+#define CONSOLE_ROW_FIRST  cons.lcd_address
+#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * cons.rows)
 
-static short console_curr_col;
-static short console_curr_row;
-static short console_cols;
-static short console_rows;
-static void *lcd_console_address;
+struct console_t {
+   short curr_col, curr_row;
+   short cols, rows;
+   void *lcd_address;
+};
+static struct console_t cons;
 
 void lcd_init_console(void *address, int rows, int cols)
 {
-   console_curr_col = 0;
-   console_curr_row = 0;
-   console_cols = cols;
-   console_rows = rows;
-   lcd_console_address = address;
+   memset(&cons, 0, sizeof(cons));
+   cons.cols = cols;
+   cons.rows = rows;
+   cons.lcd_address = address;
+
 }
 
 void lcd_set_col(short col)
 {
-   console_curr_col = col;
+   cons.curr_col = col;
 }
 
 void lcd_set_row(short row)
 {
-   console_curr_row = row;
+   cons.curr_row = row;
 }
 
 void lcd_position_cursor(unsigned col, unsigned row)
 {
-   console_curr_col = min_t(short, col, console_cols - 1);
-   console_curr_row = min_t(short, row, console_rows - 1);
+   cons.curr_col = min_t(short, col, cons.cols - 1);
+   cons.curr_row = min_t(short, row, cons.rows - 1);
 }
 
 int lcd_get_screen_rows(void)
 {
-   return console_rows;
+   return cons.rows;
 }
 
 int lcd_get_screen_columns(void)
 {
-   return console_cols;
+   return cons.cols;
 }
 
 static void lcd_putc_xy(ushort x, ushort y, char c)
@@ -63,7 +64,7 @@ static void lcd_putc_xy(ushort x, ushort y, char c)
int bg_color = lcd_getbgcolor();
int i;
 
-   dest = (uchar *)(lcd_console_address +
+   dest = (uchar *)(cons.lcd_address +
 y * lcd_line_length + x * NBITS(LCD_BPP) / 8);
 
for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
@@ -91,7 +92,7 @@ static void console_scrollup(void)
 
/* Copy up rows ignoring those that will be overwritten */
memcpy(CONSOLE_ROW_FIRST,
-  lcd_console_address + CONSOLE_ROW_SIZE * rows,
+  cons.lcd_address + CONSOLE_ROW_SIZE * rows,
   CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows);
 
/* Clear the last rows */
@@ -99,7 +100,7 @@ static void console_scrollup(void)
memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
   bg_color, CONSOLE_ROW_SIZE * rows);
 #else
-   u32 *ppix = lcd_console_address +
+   u32 *ppix = cons.lcd_address +
CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows;
u32 i;
for (i = 0;
@@ -109,27 +110,27 @@ static void console_scrollup(void)
}
 #endif
lcd_sync();
-   console_curr_row -= rows;
+   cons.curr_row -= rows;
 }
 
 static inline void console_back(void)
 {
-   if (--console_curr_col < 0) {
-   console_curr_col = console_cols - 1;
-   if (--console_curr_row < 0)
-   console_curr_row = 0;
+   if (--cons.curr_col < 0) {
+   cons.curr_col = cons.cols - 1;
+   if (--cons.curr_row < 0)
+   cons.curr_row = 0;
}
 
-   lcd_putc_xy(console_curr_col * VIDEO_FONT_WIDTH,
-   console_curr_row * VIDEO_FONT_HEIGHT, ' ');
+   lcd_putc_xy(cons.curr_col * VIDEO_FONT_WIDTH,
+   cons.curr_row * VIDEO_FONT_HEIGHT, ' ');
 }
 
 static inline void console_newline(void)
 {
-   console_curr_col = 0;
+   cons.curr_col = 0;
 
/* Check if we need to scroll the terminal */
-   if (++console_curr_row >= console_rows)
+   if (++cons.curr_row >= cons.rows)
console_scrollup();
else
lcd_sync();
@@ -145,18 +146,17 @@ void lcd_putc(const char c)
 
switch (c) {
case '\r':
-   console_curr_col = 0;
-
+   cons.curr_col = 0;
return;
case '\n':
console_newline();
 

[U-Boot] [PATCH v3 1/4] common/lcd_console: cleanup lcd_drawchars/lcd_putc_xy

2015-03-19 Thread Hannes Petermaier
From: Hannes Petermaier 

the capability of drawing some *str with count from lcd_drawchars is unnary.
It is always called from lcd_putc_xy with one character of and count = 1.

So we simply rename lcd_drawchars into lcd_putc_xy and remove the loops inside.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

Changes in v3: None
Changes in v2: None

 common/lcd_console.c |   23 +++
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index 8bf83b9..243b7c5 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -55,18 +55,17 @@ int lcd_get_screen_columns(void)
return console_cols;
 }
 
-static void lcd_drawchars(ushort x, ushort y, uchar *str, int count)
+static void lcd_putc_xy(ushort x, ushort y, char c)
 {
uchar *dest;
ushort row;
int fg_color, bg_color;
+   int i;
 
dest = (uchar *)(lcd_console_address +
 y * lcd_line_length + x * NBITS(LCD_BPP) / 8);
 
for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
-   uchar *s = str;
-   int i;
 #if LCD_BPP == LCD_COLOR16
ushort *d = (ushort *)dest;
 #elif LCD_BPP == LCD_COLOR32
@@ -77,25 +76,17 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, 
int count)
 
fg_color = lcd_getfgcolor();
bg_color = lcd_getbgcolor();
-   for (i = 0; i < count; ++i) {
-   uchar c, bits;
 
-   c = *s++;
-   bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
+   uchar bits;
+   bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
 
-   for (c = 0; c < 8; ++c) {
-   *d++ = (bits & 0x80) ? fg_color : bg_color;
-   bits <<= 1;
-   }
+   for (i = 0; i < 8; ++i) {
+   *d++ = (bits & 0x80) ? fg_color : bg_color;
+   bits <<= 1;
}
}
 }
 
-static inline void lcd_putc_xy(ushort x, ushort y, uchar c)
-{
-   lcd_drawchars(x, y, &c, 1);
-}
-
 static void console_scrollup(void)
 {
const int rows = CONFIG_CONSOLE_SCROLL_LINES;
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/4] common/lcd_console: move single static variables into common (static) structure

2015-03-18 Thread Hannes Petermaier

On 2015-03-18 13:47, Igor Grinberg wrote:

On 03/18/15 14:14, Hannes Petermaier wrote:

On 2015-03-18 13:11, Igor Grinberg wrote:

[...]

+struct console_t {
+short curr_col, curr_row;
+short cols, rows;
+void *lcd_address;

Shouldn't this be fbbase?


+};
+static struct console_t cons;

[...]


Hi Igor,
my plan was/is to make a cleanup patch after this story is closed.
- remove empty lines in code

Yes indeed, but...


- rename some variables

This depends. For example the lcd_address, you are introducing
a lot of new places where this variable is used.
So, IMO, it is better to rename it before you are using it, otherwise
the renaming patch will be much bigger and that is called needless churn...


would it be better to do that immediately ?

Well, I think that there are certain levels of cleanup...
In case of the lcd_address, I think it is better to rename it before use.

I think the rule of thumb (meaning this is not cast in stone) is first
do a clean up and then add a functionality to already clean code.

Hi Igor,

Okay,
thanks - i will do the renanaming within my implementation of the 
rotation feature.


best regards,
Hannes
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 4/4] common/lcd_console: introduce display/framebuffer rotation

2015-03-18 Thread Hannes Petermaier
"U-Boot"  schrieb am 18.03.2015 13:56:49:

> 
> Hi Hannes,
Hi Igor,
thanks for response - we come closer to the final solution :-)

> 
> > +}
> > +
> > +void __weak lcd_init_console_rot(struct console_t *pcons)
> > +{
> > +   return;
> > +}
> > +
> > +void lcd_init_console(void *address, int vl_cols, int vl_rows, int 
vl_rot)
> > +{
> > +   memset(&cons, 0, sizeof(cons));
> > +   cons.lcd_address = address;
> > +
> > +   cons.lcdsizex = vl_cols;
> > +   cons.lcdsizey = vl_rows;
> > +   cons.lcdrot = vl_rot;
> > +
> > +   cons.fp_putc_xy = &lcd_putc_xy0;
> > +   cons.fp_console_moverow = &console_moverow0;
> > +   cons.fp_console_setrow = &console_setrow0;
> > +   console_calc_rowcol(&cons);
> 
> I think the above four lines is exactly what should be placed in the
> __weak variant of lcd_init_console_rot() function (the one just above
> this one).
I think not so.
If the lcd_console_rotation.c is compiled in, the __weak function isn't 
called anymore.
And if user wants to have 0 degree rotation, the init-function from 
lcd_console_rotation.c doesn't anything.
Therefore it is necessary to initialize these pointers here.

> > +
> > +   lcd_init_console_rot(&cons);
> > +
> > +   debug("lcd_console: have %d/%d col/rws on scr %dx%d (%d deg 
rotated)\n",
> > + cons.cols, cons.rows, cons.lcdsizex, cons.lcdsizey, vl_rot);
> > +
> 
> no need for the empty line here.
Will be changed in v3.

> > +
> > +#include 
> > +#include 
> > +#include   /* Get font data, width and height */
> > +
> > +#if LCD_BPP == LCD_COLOR16
> > +   #define fbptr_t ushort
> > +#elif LCD_BPP == LCD_COLOR32
> > +   #define fbptr_t u32
> > +#else
> > +   #define fbptr_t uchar
> > +#endif
> 
> That is a duplication of the code in lcd_console.c.
> If we can get rid of these size games, probably we should have in the 
lcd.h,
> or lcd_console.h, or ...
It might be possible to move this into lcd.h, in every case it is 
necesarry that common.h
is included before - from here the information about LCD_BPP is coming.
I will have a 2nd look to that to avoid this duplication.

> > +
> > +void lcd_init_console_rot(struct console_t *pcons)
> > +{
> > +   if (pcons->lcdrot == 0) {
> > +  return;
> > +   } else if (pcons->lcdrot == 1) {
> > +  pcons->fp_putc_xy = &lcd_putc_xy90;
> > +  pcons->fp_console_moverow = &console_moverow90;
> > +  pcons->fp_console_setrow = &console_setrow90;
> > +   } else if (pcons->lcdrot == 2) {
> > +  pcons->fp_putc_xy = &lcd_putc_xy180;
> > +  pcons->fp_console_moverow = &console_moverow180;
> > +  pcons->fp_console_setrow = &console_setrow180;
> > +   } else if (pcons->lcdrot == 3) {
> > +  pcons->fp_putc_xy = &lcd_putc_xy270;
> > +  pcons->fp_console_moverow = &console_moverow270;
> > +  pcons->fp_console_setrow = &console_setrow270;
> > +   } else {
> > +  puts("lcd_init_console_rot: invalid framebuffer rotation!\n");
> 
> How about
> printf("%s: invalid framebuffer rotation!\n", __func__);
> ?
Okay, i will change that.
Sometime ago, somebody told me on the mailing list that i should prefer 
the puts function if i don't have to print out some values.
If we want to use the printf we can also printout the given rotation 
pcons->lcdrot.

> -- 
> Regards,
> Igor.
best regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/4] common/lcd_console: move single static variables into common (static) structure

2015-03-18 Thread Hannes Petermaier

On 2015-03-18 13:11, Igor Grinberg wrote:

[...]

+struct console_t {
+   short curr_col, curr_row;
+   short cols, rows;
+   void *lcd_address;

Shouldn't this be fbbase?


+};
+static struct console_t cons;

[...]


Hi Igor,
my plan was/is to make a cleanup patch after this story is closed.
- remove empty lines in code
- rename some variables

would it be better to do that immediately ?

best regards,
Hannes

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 0/4] common/lcd_console: introduce display/framebuffer rotation

2015-03-18 Thread Hannes Petermaier
Sometimes, for example if the display is mounted in portrait mode or even if it
mounted landscape but rotated by 180 degree, we need to rotate our content of
the display respectively the framebuffer, so that user can read the messages who
are printed out.

For this we introduce the feature called "CONFIG_LCD_ROTATION", this may be
defined in the board-configuration if needed. After this the lcd_console will
be initialized with a given rotation from "vl_rot" out of "vidinfo_t" which is
provided by the board specific code.
The value for vl_rot is coded as following (matching to fbcon=rotate: linux-
kernel commandline):
0 = no rotation respectively 0 degree
1 = 90 degree rotation
2 = 180 degree rotation
3 = 270 degree rotation

If CONFIG_LCD_ROTATION is not defined, the console will be initialized with
0 degrees rotation.

Patch 1-3 make preparations to the code.
Patch 4 implements the new feature

Changes in v2:
- cleanup README text for feature
- don't make code cleanups (lcd_console.c) within this patch
- remove (unnary) comment in lcd_console.h
- update year to 2015 within copyright in lcd_console.c
- move rotation related code into separate file lcd_console_rotation.c
- rework rotation code
- change meaning of vl_rot to match fbcon=rotate: from the linux-kernel

Hannes Petermaier (4):
  common/lcd_console: cleanup lcd_drawchars/lcd_putc_xy
  common/lcd_console: ask only one-time for bg/fg-color per call
  common/lcd_console: move single static variables into common (static)
structure
  common/lcd_console: introduce display/framebuffer rotation

 README|   22 +
 common/Makefile   |1 +
 common/lcd.c  |   15 ++-
 common/lcd_console.c  |  208 +--
 common/lcd_console_rotation.c |  216 +
 include/lcd.h |1 +
 include/lcd_console.h |   18 +++-
 7 files changed, 371 insertions(+), 110 deletions(-)
 create mode 100644 common/lcd_console_rotation.c

-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 4/4] common/lcd_console: introduce display/framebuffer rotation

2015-03-18 Thread Hannes Petermaier
From: Hannes Petermaier 

Sometimes, for example if the display is mounted in portrait mode or even if it
mounted landscape but rotated by 180 degrees, we need to rotate our content of
the display respectively the framebuffer, so that user can read the messages
who are printed out.

For this we introduce the feature called "CONFIG_LCD_ROTATION", this may be
defined in the board-configuration if needed. After this the lcd_console will
be initialized with a given rotation from "vl_rot" out of "vidinfo_t" which is
provided by the board specific code.

If CONFIG_LCD_ROTATION is not defined, the console will be initialized with
0 degrees rotation.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

Changes in v2:
- cleanup README text for feature
- don't make code cleanups (lcd_console.c) within this patch
- remove (unnary) comment in lcd_console.h
- update year to 2015 within copyright in lcd_console.c
- move rotation related code into separate file lcd_console_rotation.c
- rework rotation code
- change meaning of vl_rot to match fbcon=rotate: from the linux-kernel

 README|   22 +
 common/Makefile   |1 +
 common/lcd.c  |   15 ++-
 common/lcd_console.c  |  168 ++--
 common/lcd_console_rotation.c |  216 +
 include/lcd.h |1 +
 include/lcd_console.h |   18 +++-
 7 files changed, 357 insertions(+), 84 deletions(-)
 create mode 100644 common/lcd_console_rotation.c

diff --git a/README b/README
index b0124d6..c649de1 100644
--- a/README
+++ b/README
@@ -1947,6 +1947,28 @@ CBFS (Coreboot Filesystem) support
the console jump but can help speed up operation when scrolling
is slow.
 
+   CONFIG_LCD_ROTATION
+
+   Sometimes, for example if the display is mounted in portrait
+   mode or even if it mounted landscape but rotated by 180degree,
+   we need to rotate our content of the display respectively the
+   framebuffer, so that user can read the messages who are printed
+   out.
+   For this we introduce the feature called "CONFIG_LCD_ROTATION",
+   this may be defined in the board-configuration if needed. After
+   this the lcd_console will be initialized with a given rotation
+   from "vl_rot" out of "vidinfo_t" which is provided by the board
+   specific code.
+   The value for vl_rot is coded as following (matching to
+   fbcon=rotate: linux-kernel commandline):
+   0 = no rotation respectively 0 degree
+   1 = 90 degree rotation
+   2 = 180 degree rotation
+   3 = 270 degree rotation
+
+   If CONFIG_LCD_ROTATION is not defined, the console will be
+   initialized with 0degree rotation.
+
CONFIG_LCD_BMP_RLE8
 
Support drawing of RLE8-compressed bitmaps on the LCD.
diff --git a/common/Makefile b/common/Makefile
index 7216a13..a1b3c09 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -200,6 +200,7 @@ obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-y += splash.o
 obj-$(CONFIG_SPLASH_SOURCE) += splash_source.o
 obj-$(CONFIG_LCD) += lcd.o lcd_console.o
+obj-$(CONFIG_LCD_ROTATION) += lcd_console_rotation.o
 obj-$(CONFIG_LCD_DT_SIMPLEFB) += lcd_simplefb.o
 obj-$(CONFIG_LYNXKDI) += lynxkdi.o
 obj-$(CONFIG_MENU) += menu.o
diff --git a/common/lcd.c b/common/lcd.c
index f33942c..d1b4ca7 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -167,7 +167,6 @@ int drv_lcd_init(void)
 
 void lcd_clear(void)
 {
-   short console_rows, console_cols;
int bg_color;
char *s;
ulong addr;
@@ -211,16 +210,14 @@ void lcd_clear(void)
}
 #endif
 #endif
+   /* setup text-console */
+   debug("[LCD] setting up console...\n");
+   lcd_init_console(lcd_base,
+panel_info.vl_col,
+panel_info.vl_row,
+panel_info.vl_rot);
/* Paint the logo and retrieve LCD base address */
debug("[LCD] Drawing the logo...\n");
-#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
-   console_rows = (panel_info.vl_row - BMP_LOGO_HEIGHT);
-   console_rows /= VIDEO_FONT_HEIGHT;
-#else
-   console_rows = panel_info.vl_row / VIDEO_FONT_HEIGHT;
-#endif
-   console_cols = panel_info.vl_col / VIDEO_FONT_WIDTH;
-   lcd_init_console(lcd_base, console_rows, console_cols);
if (do_splash) {
s = getenv("splashimage");
if (s) {
diff --git a/common/lcd_console.c b/common/lcd_console.c
index cac77be..14fd890 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -1,7 +1,8 @@
 /*
- * (C) Copyright 2001

[U-Boot] [PATCH v2 1/4] common/lcd_console: cleanup lcd_drawchars/lcd_putc_xy

2015-03-18 Thread Hannes Petermaier
From: Hannes Petermaier 

the capability of drawing some *str with count from lcd_drawchars is unnary.
It is always called from lcd_putc_xy with one character of and count = 1.

So we simply rename lcd_drawchars into lcd_putc_xy and remove the loops inside.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

Changes in v2: None

 common/lcd_console.c |   23 +++
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index 8bf83b9..243b7c5 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -55,18 +55,17 @@ int lcd_get_screen_columns(void)
return console_cols;
 }
 
-static void lcd_drawchars(ushort x, ushort y, uchar *str, int count)
+static void lcd_putc_xy(ushort x, ushort y, char c)
 {
uchar *dest;
ushort row;
int fg_color, bg_color;
+   int i;
 
dest = (uchar *)(lcd_console_address +
 y * lcd_line_length + x * NBITS(LCD_BPP) / 8);
 
for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
-   uchar *s = str;
-   int i;
 #if LCD_BPP == LCD_COLOR16
ushort *d = (ushort *)dest;
 #elif LCD_BPP == LCD_COLOR32
@@ -77,25 +76,17 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, 
int count)
 
fg_color = lcd_getfgcolor();
bg_color = lcd_getbgcolor();
-   for (i = 0; i < count; ++i) {
-   uchar c, bits;
 
-   c = *s++;
-   bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
+   uchar bits;
+   bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
 
-   for (c = 0; c < 8; ++c) {
-   *d++ = (bits & 0x80) ? fg_color : bg_color;
-   bits <<= 1;
-   }
+   for (i = 0; i < 8; ++i) {
+   *d++ = (bits & 0x80) ? fg_color : bg_color;
+   bits <<= 1;
}
}
 }
 
-static inline void lcd_putc_xy(ushort x, ushort y, uchar c)
-{
-   lcd_drawchars(x, y, &c, 1);
-}
-
 static void console_scrollup(void)
 {
const int rows = CONFIG_CONSOLE_SCROLL_LINES;
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 2/4] common/lcd_console: ask only one-time for bg/fg-color per call

2015-03-18 Thread Hannes Petermaier
From: Hannes Petermaier 

Don't call the lcd_getfgcolor and lcd_getbgcolor within the "draw-loop", this
only wastes time.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

Changes in v2: None

 common/lcd_console.c |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index 243b7c5..b7dda7a 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -59,7 +59,8 @@ static void lcd_putc_xy(ushort x, ushort y, char c)
 {
uchar *dest;
ushort row;
-   int fg_color, bg_color;
+   int fg_color = lcd_getfgcolor();
+   int bg_color = lcd_getbgcolor();
int i;
 
dest = (uchar *)(lcd_console_address +
@@ -73,10 +74,6 @@ static void lcd_putc_xy(ushort x, ushort y, char c)
 #else
uchar *d = dest;
 #endif
-
-   fg_color = lcd_getfgcolor();
-   bg_color = lcd_getbgcolor();
-
uchar bits;
bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
 
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 3/4] common/lcd_console: move single static variables into common (static) structure

2015-03-18 Thread Hannes Petermaier
From: Hannes Petermaier 

For coming implementation of lcd_console rotation, we will need some more
variables for holding information about framebuffer size, rotation, ...

For better readability we catch all them into a common structure.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

Changes in v2: None

 common/lcd_console.c |   76 +-
 1 file changed, 38 insertions(+), 38 deletions(-)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index b7dda7a..cac77be 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -11,48 +11,49 @@
 #include /* Get font data, width and height */
 
 #define CONSOLE_ROW_SIZE   (VIDEO_FONT_HEIGHT * lcd_line_length)
-#define CONSOLE_ROW_FIRST  lcd_console_address
-#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * console_rows)
+#define CONSOLE_ROW_FIRST  cons.lcd_address
+#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * cons.rows)
 
-static short console_curr_col;
-static short console_curr_row;
-static short console_cols;
-static short console_rows;
-static void *lcd_console_address;
+struct console_t {
+   short curr_col, curr_row;
+   short cols, rows;
+   void *lcd_address;
+};
+static struct console_t cons;
 
 void lcd_init_console(void *address, int rows, int cols)
 {
-   console_curr_col = 0;
-   console_curr_row = 0;
-   console_cols = cols;
-   console_rows = rows;
-   lcd_console_address = address;
+   memset(&cons, 0, sizeof(cons));
+   cons.cols = cols;
+   cons.rows = rows;
+   cons.lcd_address = address;
+
 }
 
 void lcd_set_col(short col)
 {
-   console_curr_col = col;
+   cons.curr_col = col;
 }
 
 void lcd_set_row(short row)
 {
-   console_curr_row = row;
+   cons.curr_row = row;
 }
 
 void lcd_position_cursor(unsigned col, unsigned row)
 {
-   console_curr_col = min_t(short, col, console_cols - 1);
-   console_curr_row = min_t(short, row, console_rows - 1);
+   cons.curr_col = min_t(short, col, cons.cols - 1);
+   cons.curr_row = min_t(short, row, cons.rows - 1);
 }
 
 int lcd_get_screen_rows(void)
 {
-   return console_rows;
+   return cons.rows;
 }
 
 int lcd_get_screen_columns(void)
 {
-   return console_cols;
+   return cons.cols;
 }
 
 static void lcd_putc_xy(ushort x, ushort y, char c)
@@ -63,7 +64,7 @@ static void lcd_putc_xy(ushort x, ushort y, char c)
int bg_color = lcd_getbgcolor();
int i;
 
-   dest = (uchar *)(lcd_console_address +
+   dest = (uchar *)(cons.lcd_address +
 y * lcd_line_length + x * NBITS(LCD_BPP) / 8);
 
for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
@@ -91,7 +92,7 @@ static void console_scrollup(void)
 
/* Copy up rows ignoring those that will be overwritten */
memcpy(CONSOLE_ROW_FIRST,
-  lcd_console_address + CONSOLE_ROW_SIZE * rows,
+  cons.lcd_address + CONSOLE_ROW_SIZE * rows,
   CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows);
 
/* Clear the last rows */
@@ -99,7 +100,7 @@ static void console_scrollup(void)
memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
   bg_color, CONSOLE_ROW_SIZE * rows);
 #else
-   u32 *ppix = lcd_console_address +
+   u32 *ppix = cons.lcd_address +
CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows;
u32 i;
for (i = 0;
@@ -109,27 +110,27 @@ static void console_scrollup(void)
}
 #endif
lcd_sync();
-   console_curr_row -= rows;
+   cons.curr_row -= rows;
 }
 
 static inline void console_back(void)
 {
-   if (--console_curr_col < 0) {
-   console_curr_col = console_cols - 1;
-   if (--console_curr_row < 0)
-   console_curr_row = 0;
+   if (--cons.curr_col < 0) {
+   cons.curr_col = cons.cols - 1;
+   if (--cons.curr_row < 0)
+   cons.curr_row = 0;
}
 
-   lcd_putc_xy(console_curr_col * VIDEO_FONT_WIDTH,
-   console_curr_row * VIDEO_FONT_HEIGHT, ' ');
+   lcd_putc_xy(cons.curr_col * VIDEO_FONT_WIDTH,
+   cons.curr_row * VIDEO_FONT_HEIGHT, ' ');
 }
 
 static inline void console_newline(void)
 {
-   console_curr_col = 0;
+   cons.curr_col = 0;
 
/* Check if we need to scroll the terminal */
-   if (++console_curr_row >= console_rows)
+   if (++cons.curr_row >= cons.rows)
console_scrollup();
else
lcd_sync();
@@ -145,18 +146,17 @@ void lcd_putc(const char c)
 
switch (c) {
case '\r':
-   console_curr_col = 0;
-
+   cons.curr_col = 0;
return;
case '\n':
console_newline();
 
return;
case '\t'

Re: [U-Boot] Kernel to U-boot messaging and vice versa.

2015-03-17 Thread Hannes Petermaier

Hi Dev,

Altough your problem is off-topic from u-boot, we want to help you :-)

the only solution what i see, is some watchdog.
Maybe your CPU has such feature or your hardware around does offer some 
watchdog.


best regards,
Hannes

On 2015-03-17 21:53, Dev wrote

Thank You Hannes and Andy for replying back.

I agree that the kernel and U-boot are very old. There are many units deployed 
out in the field which are running these versions. Hence, we are stuck on these 
old versions.

There are some kernel modules which are running above linux kernel. When we try 
to field upgrade these deployed units, due to external failures for example 
power surge, these kernel modules hang in a bad state, which causes the unit 
unusable. In those conditions we want the unit to go through reset sequence.

Regards,
-Dev


From: andy.p...@sdcsystems.com
To: dsupe...@hotmail.com
CC: u-boot@lists.denx.de
Subject: RE: [U-Boot] Kernel to U-boot messaging and vice versa.
Date: Tue, 17 Mar 2015 19:15:24 +

Dev wrote...


I am new to U-boot development. We are using U-Boot 1.1.4 on a MIPS
74Kc QCA 9557 processor, which is running Linux Kernel 2.6.32.27.

Is there a reason why you have to be running a kernel from 2010 and a
version of bootloader that is even older?  It makes life much easier to
provide support if you can update to more recent versions and you never know
they may already have fixed your problems!


We have a situation were our firmware keeps hanging due to some issues.

What is your "firmware" in this context?  As you rightly said, once the
Linux kernel is running U-Boot is no more and if U-Boot is hanging then you
aren't going to get to the kernel anyway!


We are looking into a solution where U-boot and Kernel keep communicating
with each other every some minutes. If U-boot finds that there is no
communication, it will reset the board.

This sounds like it is the territory of watchdog timers.  I don't know that
CPU to know whether it has one built in though, nor if the kernel supports
it.

Andy.



___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot




___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Kernel to U-boot messaging and vice versa.

2015-03-17 Thread Hannes Petermaier

Hi Dev,

for opinion, no way.

best regards,
Hannes

On 2015-03-17 16:28, Dev wrote:

Hello,
   I am new to U-boot development. We are using U-Boot 1.1.4 on a MIPS 74Kc QCA 
9557 processor, which is running Linux Kernel 2.6.32.27. We have a situation 
were our firmware keeps hanging due to some issues. We are looking into a 
solution where U-boot and Kernel keep communicating with each other every some 
minutes. If U-boot finds that there is no communication, it will reset the 
board.

I understand that once the Linux Kernel is booted, the bootloader is not there 
anymore. BUT, is there any way by modifying the Linux Kernel, we can achieve 
periodic U-boot to Kernel communication.

Thanks,
-Dev

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot




___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] board/BuR/common: use SYS_CONSOLE_OVERWRITE

2015-03-17 Thread Hannes Petermaier
From: Hannes Petermaier 

We don't want that CONSOLE is redirected to LCD upon init, we rather prefer
that console is still on the serial line.

Signed-off-by: Hannes Petermaier 
---

 board/BuR/common/common.c   |4 
 include/configs/bur_am335x_common.h |2 ++
 2 files changed, 6 insertions(+)

diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
index 18e1520..5ff8a7e 100644
--- a/board/BuR/common/common.c
+++ b/board/BuR/common/common.c
@@ -641,3 +641,7 @@ int board_mmc_init(bd_t *bis)
return omap_mmc_init(1, 0, 0, -1, -1);
 }
 #endif
+int overwrite_console(void)
+{
+   return 1;
+}
diff --git a/include/configs/bur_am335x_common.h 
b/include/configs/bur_am335x_common.h
index 377e6cf..240fc46 100644
--- a/include/configs/bur_am335x_common.h
+++ b/include/configs/bur_am335x_common.h
@@ -142,6 +142,8 @@
 #define CONFIG_SYS_PROMPT  "U-Boot (BuR V2.0)# "
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 #define CONFIG_ENV_OVERWRITE   /* Overwrite ethaddr / serial# */
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
 
 /* As stated above, the following choices are optional. */
 #define CONFIG_SYS_LONGHELP
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] board/BuR/common: fix compiler warning

2015-03-16 Thread Hannes Petermaier
From: Hannes Petermaier 

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

 include/configs/bur_am335x_common.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/bur_am335x_common.h 
b/include/configs/bur_am335x_common.h
index a558e42..377e6cf 100644
--- a/include/configs/bur_am335x_common.h
+++ b/include/configs/bur_am335x_common.h
@@ -25,7 +25,7 @@
 "fi;" \
 "setenv netdisplay0 '" \
 "setcurs 1 9; puts myip; setcurs 10 9; puts ${ipaddr};" \
-"setcurs 1 10;puts serverip; setcurs 10 10; puts ${serverip}\;'" \
+"setcurs 1 10;puts serverip; setcurs 10 10; puts ${serverip};" \
 "run netdisplay0; " \
 "setenv stdout nc;setenv stdin nc;setenv stderr nc\0"
 
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] common/lcd_console: introduce display/framebuffer rotation

2015-03-16 Thread Hannes Petermaier
Nikita Kiryanov  schrieb am 15.03.2015 19:56:31:

> 
> Hi Hannes,
Hi Nikita,
many thanks for response.
> 
> I second Grinberg's suggestion of a separate file and 0 degree default 
(also as a
> fallback for invalid rotation value, see below).
Okay - i will provide a V2 from this patch where i try to implement as 
sugessted, maybe we will need some V3 :-)
Probably on wednesday.

> Some additional comments:
> 
> > +
> > +  If CONFIG_LCD_ROTATION is not defined, the console will be
> > +  initialized with 0degree rotation
> 
> This is enough. "the screen behaves like the days before" is vague and 
unnecessary
> (days before what?)
Okay - i will do so.

> 
> > +static inline void console_setrow0(u32 row, int clr)
> > +{
> >  int i;
> > +   uchar *dst = (uchar *)(cons.lcd_address +
> > +row * VIDEO_FONT_HEIGHT *
> > +cons.lcdsizex * PIXLBYTES);
> >
> > -   dest = (uchar *)(cons.lcd_address +
> > -  y * lcd_line_length + x * NBITS(LCD_BPP) / 8);
> > +   fbptr_t *d = (fbptr_t *)dst;
> 
> Here you can just create the fbptr variable directly. You have a bunch 
of
> function where this recasting is avoidable.
> 
> > +   for (i = 0; i < (VIDEO_FONT_HEIGHT * cons.lcdsizex); i++)
> > +  *d++ = clr;
> > +}

> 
> > +void lcd_init_console(void *address, int vl_cols, int vl_rows, int 
vl_rot)
> > +{
> > +   memset(&cons, 0, sizeof(cons));
> > +   cons.lcd_address = address;
> > +
> > +   cons.lcdsizex = vl_cols;
> > +   cons.lcdsizey = vl_rows;
> > +
> > +   if (vl_rot == 0) {
> > +  cons.fp_putc_xy = &lcd_putc_xy0;
> > +  cons.fp_console_moverow = &console_moverow0;
> > +  cons.fp_console_setrow = &console_setrow0;
> > +  console_calc_rowcol(vl_cols, vl_rows, &cons.cols, &cons.rows);
> > +#ifdef CONFIG_LCD_ROTATION
> > +   } else if (vl_rot == 90) {
> > +  cons.fp_putc_xy = &lcd_putc_xy90;
> > +  cons.fp_console_moverow = &console_moverow90;
> > +  cons.fp_console_setrow = &console_setrow90;
> > +  console_calc_rowcol(vl_rows, vl_cols, &cons.cols, &cons.rows);
> > +   } else if (vl_rot == 180) {
> > +  cons.fp_putc_xy = &lcd_putc_xy180;
> > +  cons.fp_console_moverow = &console_moverow180;
> > +  cons.fp_console_setrow = &console_setrow180;
> > +  console_calc_rowcol(vl_cols, vl_rows, &cons.cols, &cons.rows);
> > +   } else if (vl_rot == 270) {
> > +  cons.fp_putc_xy = &lcd_putc_xy270;
> > +  cons.fp_console_moverow = &console_moverow270;
> > +  cons.fp_console_setrow = &console_setrow270;
> > +  console_calc_rowcol(vl_rows, vl_cols, &cons.cols, &cons.rows);
> > +#endif
> > +   } else {
> > +  puts("lcd_init_console: invalid framebuffer rotation!\n");
> 
> This case leaves the function pointers uninitialized, which would crash 
the 
> system later on.
> I suggest you default to 0 degree rotation both for the generic case and 
for 
> the fallback behavior
> (with the warning message where necessary).
Oh my god, i haven't seen this mess ... i will remove it during moving 
lcd_rotation stuff
into separate file.

> >   void lcd_putc(const char c)
> >   {
> >  if (!lcd_is_enabled) {
> > serial_putc(c);
> > -
> 
> This is a cleanup. It should not be in this patch.
I will make this cleanup in a following patch, after this series has been 
merged.


> > --- a/include/lcd_console.h
> > +++ b/include/lcd_console.h
> > @@ -16,11 +16,12 @@
> >* console has.
> >*
> >* @address: Console base address
> > - * @rows: Number of rows in the console
> > - * @cols: Number of columns in the console
> > + * @vl_rows: Number of rows in the console
> > + * @vl_cols: Number of columns in the console
> > + * @vl_rot: Rotation of display in degree (0 - 90 - 180 - 270) 
counterlockwise
> >*/
> > -void lcd_init_console(void *address, int rows, int cols);
> > -
> > +/*void lcd_init_console(void *address, int rows, int cols); */
> 
> Please delete this comment
Okay.

> -- 
> Regards,
> Nikita Kiryanov
best regards,
Hannes




___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] common/lcd_console: introduce display/framebuffer rotation

2015-03-16 Thread Hannes Petermaier
> Hi Hannes,
Hi Igor,

> >> +/* setup text-console */
> >> +debug("[LCD] setting up console...\n");
> >> +#ifdef CONFIG_LCD_ROTATION
> >> +lcd_init_console(lcd_base,
> >> + panel_info.vl_col,
> >> + panel_info.vl_row,
> >> + panel_info.vl_rot);
> >>   #else
> >> -console_rows = panel_info.vl_row / VIDEO_FONT_HEIGHT;
> >> +lcd_init_console(lcd_base,
> >> + panel_info.vl_col,
> >> + panel_info.vl_row,
> >> + 0);
> >>   #endif
> >> Please, don't start the #ifdef mess here...
> >> just always pass the panel_info.vl_rot.
> > This is not possible, because 'vl_rot' does'nt exist if
> > CONFIG_LCD_ROTATION is not defined. (have a look into lcd.h).
> 
> Of course I did before sending the reply...
> What I'm trying to say is - let it exist and default to 0 angle 
rotation.
> 
> > I made this to be compatible to all who have allready initialized a
> > panel_info without vl_rot.
> 
> This increases the mess and I think is not sensible enough.
> Just change the users to initialize the panel_info with vl_rot.
> I think also that default initialization of globals is 0, right?
> If so, those users that do not initialize the vl_rot explicitly,
> should have it initialized to 0 implicitly by compiler.
Yes, thats a good idea. I will check if the compiler really initializes 
the global
struct panel_info with zero and change this.
 
[...]
> >>>   }
> >>>   +static inline void console_setrow180(u32 row, int clr)
> >>> +{
> >>> +int i;
> >>> +uchar *dst = (uchar *)(cons.lcd_address +
> >>> +   (cons.rows-row-1) * VIDEO_FONT_HEIGHT *
> >>> +   cons.lcdsizex * PIXLBYTES);
> >>> +
> >>> +fbptr_t *d = (fbptr_t *)dst;
> >>> +for (i = 0; i < (VIDEO_FONT_HEIGHT * cons.lcdsizex); i++)
> >>> +*d++ = clr;
> >>> +}
> >>> +
> >>> +static inline void console_moverow180(u32 rowdst, u32 rowsrc)
> >>> +{
> >>> +int i;
> >>> +uchar *dst = (uchar *)(cons.lcd_address +
> >>> +   (cons.rows-rowdst-1) * VIDEO_FONT_HEIGHT *
> >>> +   cons.lcdsizex * PIXLBYTES);
> >>> +
> >>> +uchar *src = (uchar *)(cons.lcd_address +
> >>> +   (cons.rows-rowsrc-1) * VIDEO_FONT_HEIGHT *
> >>> +   cons.lcdsizex * PIXLBYTES);
> >>> +
> >>> +fbptr_t *pdst = (fbptr_t *)dst;
> >>> +fbptr_t *psrc = (fbptr_t *)src;
> >>> +for (i = 0; i < (VIDEO_FONT_HEIGHT * cons.lcdsizex); i++)
> >>> +*pdst++ = *psrc++;
> >>> +}
> >>> +
> >>> +#endif /* CONFIG_LCD_ROTATION */
> >> Can't this whole thing go into a separate file?
> >> So, the console stuff will only define weak functions which can be 
overridden
> >> by the rotation functionality.
> >> This will keep the console code clean (also from ifdefs) and have the 
rotation
> >> functionality cleanly added by a CONFIG_ symbol, which will control 
the
> >> compilation for the separate file.
> > Might be possible, which name should we give to it ? 
lcd_console_rotation.c ?
> 
> Sounds good.
> 
> > But how we deal with the function-pointer initialization ?
> 
> I think the usual method would do...
> You call some kind of lcd_console_init_rot() with most of the code
> that you currently have in lcd_init_console() that is related to 
rotation.
> If the CONFIG_LCD_ROTATION is not set, then the lcd_init_console() stub
> just returns the 0 rotation config.

I just started to move rotation specific functions into own file, called 
lcd_console_rotation.c and
ran into some trouble.

1) 
I need during initialization the console_calc_rowcol(...) function, which 
is provided by lcd.c.
A possible solution might be to "un-static" it - but i am not happy with 
this. 
Another way could be to take up vl_rot into console_t structure and pass 
only a pointer to structure to this function and decide inside the 
function.
But this would create a little mix between 0 degree and rotation code.
Yet another idea is to have (also having pointer to console_t in call) in 
lcd_console_rotation also such a calc function which overrides the values 
calculated before.

or maybe you've another solution ?

2)
I need in almost every "paint-function" the framebuffer base 
(cons.lcd_address) and the screen dimension.
This information is stored in the static structure within lcd.c - i don't 
like to make this public.
A possible solution could be to change all painting function to work 
without some global variable and pass
a third argument, pointer to console_t, and take informations from there. 
This will consume one more register
on function call, runtime is equal i think.

Whats your opinion around this ?

> >> I would recommend extracting the whole if else ... structure into
> >> a separate function say lcd_setup_console_rot() or something and
> >> make the default one doing only the vl_rot == 0 stuff.
> > Whats the use of this ?
> > Should this also be in a separate file?
> 
> Yes, that is how I think it will do better.
> 
> Just 

Re: [U-Boot] Commit 7ae47f6b causes a warning

2015-03-16 Thread Hannes Petermaier
> Hello Hannes,
Hi Albert,
many thanks - i will fix this, probably on wednesday and send a patch.

best regards,
Hannes

> 
> On Tue,  3 Feb 2015 13:22:34 +0100, Hannes Petermaier 
> wrote:
> 
> > diff --git a/include/configs/bur_am335x_common.h 
b/include/configs/bur_am335x_common.h
> > index e9d5d01..d7ea1c9 100644
> > --- a/include/configs/bur_am335x_common.h
> > +++ b/include/configs/bur_am335x_common.h
> > @@ -12,6 +12,23 @@
> >  #ifndef __BUR_AM335X_COMMON_H__
> >  #define __BUR_AM335X_COMMON_H__
> >  /* 
- 
*/
> > +#define BUR_COMMON_ENV \
> > +"defaultip=192.168.60.253\0" \
> > +"defaultsip=192.168.60.254\0" \
> > +"netconsole=echo switching to network console ...; " \
> > +"if dhcp; then " \
> > +"setenv ncip ${serverip}; else " \
> > +"setenv ncip 192.168.60.254; " \
> > +"setenv serverip 192.168.60.254; " \
> > +"setenv gatewayip 192.168.60.254; " \
> > +"setenv ipaddr 192.168.60.1; " \
> > +"fi;" \
> > +"setenv netdisplay0 '" \
> > +"setcurs 1 9; puts myip; setcurs 10 9; puts ${ipaddr};" \
> > +"setcurs 1 10;puts serverip; setcurs 10 10; puts ${serverip}\;'" \
> 
> This line contains a '\;' sequence which gcc warns against:
> 
>cc1: warning: unknown escape sequence: '\;' [enabled by default]
> 
> Could you post a fix?
> 

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/4] common/lcd_console: move single static variables into common (static) structure

2015-03-15 Thread Hannes Petermaier
Nikita Kiryanov  schrieb am 15.03.2015 19:57:08:

> Hi Hannes,
Hi Nikita,
> 
> > -static void *lcd_console_address;
> > +struct console_t {
> > +   short curr_col, curr_row;
> > +   short cols, rows;
> > +   void *lcd_address;
> 
> Can this be void *base_address? I think that's a bit more descriptive.

Yes, i will do some cleanup after Patch 4/4 is finished and within this 
action i will rename this variable to
fbbase - this should be most descriptive.

> 
> Other than that,
> Acked-by: Nikita Kiryanov 
> 
> > +};
> 
> -- 
> Regards,
> Nikita Kiryanov
many thanks and best regards,
Hannes

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] common/lcd_console: introduce display/framebuffer rotation

2015-03-12 Thread Hannes Petermaier


On 2015-03-12 13:26, Igor Grinberg wrote:

Hi Hannes,

Hi Igor,
thanks for response.

  #endif
-   /* Paint the logo and retrieve LCD base address */
-   debug("[LCD] Drawing the logo...\n");
-#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
-   console_rows = (panel_info.vl_row - BMP_LOGO_HEIGHT);
-   console_rows /= VIDEO_FONT_HEIGHT;
+   /* setup text-console */
+   debug("[LCD] setting up console...\n");
+#ifdef CONFIG_LCD_ROTATION
+   lcd_init_console(lcd_base,
+panel_info.vl_col,
+panel_info.vl_row,
+panel_info.vl_rot);
  #else
-   console_rows = panel_info.vl_row / VIDEO_FONT_HEIGHT;
+   lcd_init_console(lcd_base,
+panel_info.vl_col,
+panel_info.vl_row,
+0);
  #endif
Please, don't start the #ifdef mess here...
just always pass the panel_info.vl_rot.
This is not possible, because 'vl_rot' does'nt exist if 
CONFIG_LCD_ROTATION is not defined. (have a look into lcd.h). I made 
this to be compatible to all who have allready initialized a panel_info 
without vl_rot.



-   console_cols = panel_info.vl_col / VIDEO_FONT_WIDTH;
-   lcd_init_console(lcd_base, console_rows, console_cols);
+   /* Paint the logo and retrieve LCD base address */
+   debug("[LCD] Drawing the logo...\n");
if (do_splash) {
s = getenv("splashimage");
if (s) {
diff --git a/common/lcd_console.c b/common/lcd_console.c
index cac77be..6199c9a 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -2,6 +2,7 @@
   * (C) Copyright 2001-2014
   * DENX Software Engineering -- w...@denx.de
   * Compulab Ltd - http://compulab.co.il/
+ * Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com
   *
   * SPDX-License-Identifier:   GPL-2.0+
   */
@@ -10,26 +11,27 @@
  #include 
  #include  /* Get font data, width and height */
  
-#define CONSOLE_ROW_SIZE	(VIDEO_FONT_HEIGHT * lcd_line_length)

-#define CONSOLE_ROW_FIRST  cons.lcd_address
-#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * cons.rows)
+#define PIXLBYTES  (NBYTES(LCD_BPP))
+
+#if LCD_BPP == LCD_COLOR16
+   #define fbptr_t ushort
+#elif LCD_BPP == LCD_COLOR32
+   #define fbptr_t u32
+#else
+   #define fbptr_t uchar
+#endif
  
  struct console_t {

short curr_col, curr_row;
short cols, rows;
void *lcd_address;
+   u32 lcdsizex, lcdsizey;
+   void (*fp_putc_xy)(ushort x, ushort y, char c);
+   void (*fp_console_moverow)(u32 rowdst, u32 rowsrc);
+   void (*fp_console_setrow)(u32 row, int clr);
  };
  static struct console_t cons;
  
-void lcd_init_console(void *address, int rows, int cols)

-{
-   memset(&cons, 0, sizeof(cons));
-   cons.cols = cols;
-   cons.rows = rows;
-   cons.lcd_address = address;
-
-}
-
  void lcd_set_col(short col)
  {
cons.curr_col = col;
@@ -56,63 +58,221 @@ int lcd_get_screen_columns(void)
return cons.cols;
  }
  
-static void lcd_putc_xy(ushort x, ushort y, char c)

+static void lcd_putc_xy0(ushort x, ushort y, char c)
  {
-   uchar *dest;
-   ushort row;
int fg_color = lcd_getfgcolor();
int bg_color = lcd_getbgcolor();
+   int i, row;
+   uchar *dest = (uchar *)(cons.lcd_address +
+   y * cons.lcdsizex * PIXLBYTES +
+   x * PIXLBYTES);
+
+   for (row = 0; row < VIDEO_FONT_HEIGHT; row++) {
+   fbptr_t *d = (fbptr_t *)dest;
+   uchar bits;
+   bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
+   for (i = 0; i < 8; ++i) {
+   *d++ = (bits & 0x80) ? fg_color : bg_color;
+   bits <<= 1;
+   }
+   dest += cons.lcdsizex * PIXLBYTES;
+   }
+}
+
+static inline void console_setrow0(u32 row, int clr)
+{
int i;
+   uchar *dst = (uchar *)(cons.lcd_address +
+  row * VIDEO_FONT_HEIGHT *
+  cons.lcdsizex * PIXLBYTES);
  
-	dest = (uchar *)(cons.lcd_address +

-y * lcd_line_length + x * NBITS(LCD_BPP) / 8);
+   fbptr_t *d = (fbptr_t *)dst;
+   for (i = 0; i < (VIDEO_FONT_HEIGHT * cons.lcdsizex); i++)
+   *d++ = clr;
+}
  
-	for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {

-#if LCD_BPP == LCD_COLOR16
-   ushort *d = (ushort *)dest;
-#elif LCD_BPP == LCD_COLOR32
-   u32 *d = (u32 *)dest;
-#else
-   uchar *d = dest;
-#endif
+static inline void console_moverow0(u32 rowdst, u32 rowsrc)
+{
+   int i;
+   uchar *dst = (uchar *)(cons.lcd_address +
+  rowdst * VIDEO_FONT_HEIGHT *
+  cons.lcdsizex * PIXLBYTES);
+
+   uchar *src = (uchar *)(cons.lcd_addres

[U-Boot] [PATCH 0/4] Introduce lcd_console rotation.

2015-03-12 Thread Hannes Petermaier
Sometimes, for example if the display is mounted in portrait mode or even if it

mounted landscape but rotated by 180 degree, we need to rotate our content of
the display respectively the framebuffer, so that user can read the messages who
are printed out.

For this we introduce the feature called "CONFIG_LCD_ROTATION", this may be
defined in the board-configuration if needed. After this the lcd_console will
be initialized with a given rotation from "vl_rot" out of "vidinfo_t" which is
provided by the board specific code.

If CONFIG_LCD_ROTATION is not defined, the console will be initialized with
0 degrees rotation - the screen behaves like the days before.

Patch 1-3 make preparations to the code.
Patch 4 implements the new feature


Hannes Petermaier (4):
  common/lcd_console: cleanup lcd_drawchars/lcd_putc_xy
  common/lcd_console: ask only one-time for bg/fg-color per call
  common/lcd_console: move single static variables into common (static)
structure
  common/lcd_console: introduce display/framebuffer rotation

 README|   17 +++
 common/lcd.c  |   22 +--
 common/lcd_console.c  |  395 +
 include/lcd.h |1 +
 include/lcd_console.h |9 +-
 5 files changed, 334 insertions(+), 110 deletions(-)

-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 4/4] common/lcd_console: introduce display/framebuffer rotation

2015-03-11 Thread Hannes Petermaier
From: Hannes Petermaier 

Sometimes, for example if the display is mounted in portrait mode or even if it
mounted landscape but rotated by 180 degrees, we need to rotate our content of
the display respectively the framebuffer, so that user can read the messages
who are printed out.

For this we introduce the feature called "CONFIG_LCD_ROTATION", this may be
defined in the board-configuration if needed. After this the lcd_console will
be initialized with a given rotation from "vl_rot" out of "vidinfo_t" which is
provided by the board specific code.

If CONFIG_LCD_ROTATION is not defined, the console will be initialized with
0 degrees rotation - the screen behaves like the days before.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

 README|   17 +++
 common/lcd.c  |   22 ++--
 common/lcd_console.c  |  333 -
 include/lcd.h |1 +
 include/lcd_console.h |9 +-
 5 files changed, 309 insertions(+), 73 deletions(-)

diff --git a/README b/README
index 3c4a2e6..a95b1e8 100644
--- a/README
+++ b/README
@@ -1933,6 +1933,23 @@ CBFS (Coreboot Filesystem) support
the console jump but can help speed up operation when scrolling
is slow.
 
+   CONFIG_LCD_ROTATION
+
+   Sometimes, for example if the display is mounted in portrait
+   mode or even if it mounted landscape but rotated by 180degree,
+   we need to rotate our content of the display respectively the
+   framebuffer, so that user can read the messages who are printed
+   out.
+   For this we introduce the feature called "CONFIG_LCD_ROTATION",
+   this may be defined in the board-configuration if needed. After
+   this the lcd_console will be initialized with a given rotation
+   from "vl_rot" out of "vidinfo_t" which is provided by the board
+   specific code.
+
+   If CONFIG_LCD_ROTATION is not defined, the console will be
+   initialized with 0degree rotation - the screen behaves like the
+   days before.
+
CONFIG_LCD_BMP_RLE8
 
Support drawing of RLE8-compressed bitmaps on the LCD.
diff --git a/common/lcd.c b/common/lcd.c
index f33942c..dfa4c69 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -167,7 +167,6 @@ int drv_lcd_init(void)
 
 void lcd_clear(void)
 {
-   short console_rows, console_cols;
int bg_color;
char *s;
ulong addr;
@@ -211,16 +210,21 @@ void lcd_clear(void)
}
 #endif
 #endif
-   /* Paint the logo and retrieve LCD base address */
-   debug("[LCD] Drawing the logo...\n");
-#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
-   console_rows = (panel_info.vl_row - BMP_LOGO_HEIGHT);
-   console_rows /= VIDEO_FONT_HEIGHT;
+   /* setup text-console */
+   debug("[LCD] setting up console...\n");
+#ifdef CONFIG_LCD_ROTATION
+   lcd_init_console(lcd_base,
+panel_info.vl_col,
+panel_info.vl_row,
+panel_info.vl_rot);
 #else
-   console_rows = panel_info.vl_row / VIDEO_FONT_HEIGHT;
+   lcd_init_console(lcd_base,
+panel_info.vl_col,
+panel_info.vl_row,
+0);
 #endif
-   console_cols = panel_info.vl_col / VIDEO_FONT_WIDTH;
-   lcd_init_console(lcd_base, console_rows, console_cols);
+   /* Paint the logo and retrieve LCD base address */
+   debug("[LCD] Drawing the logo...\n");
if (do_splash) {
s = getenv("splashimage");
if (s) {
diff --git a/common/lcd_console.c b/common/lcd_console.c
index cac77be..6199c9a 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -2,6 +2,7 @@
  * (C) Copyright 2001-2014
  * DENX Software Engineering -- w...@denx.de
  * Compulab Ltd - http://compulab.co.il/
+ * Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com
  *
  * SPDX-License-Identifier:GPL-2.0+
  */
@@ -10,26 +11,27 @@
 #include 
 #include /* Get font data, width and height */
 
-#define CONSOLE_ROW_SIZE   (VIDEO_FONT_HEIGHT * lcd_line_length)
-#define CONSOLE_ROW_FIRST  cons.lcd_address
-#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * cons.rows)
+#define PIXLBYTES  (NBYTES(LCD_BPP))
+
+#if LCD_BPP == LCD_COLOR16
+   #define fbptr_t ushort
+#elif LCD_BPP == LCD_COLOR32
+   #define fbptr_t u32
+#else
+   #define fbptr_t uchar
+#endif
 
 struct console_t {
short curr_col, curr_row;
short cols, rows;
void *lcd_address;
+   u32 lcdsizex, lcdsizey;
+   void (*fp_putc_xy)(ushort x, ushort y, char c);
+   void (*fp_console_mov

[U-Boot] [PATCH 3/4] common/lcd_console: move single static variables into common (static) structure

2015-03-11 Thread Hannes Petermaier
From: Hannes Petermaier 

For coming implementation of lcd_console rotation, we will need some more
variables for holding information about framebuffer size, rotation, ...

For better readability we catch all them into a common structure.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

 common/lcd_console.c |   76 +-
 1 file changed, 38 insertions(+), 38 deletions(-)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index b7dda7a..cac77be 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -11,48 +11,49 @@
 #include /* Get font data, width and height */
 
 #define CONSOLE_ROW_SIZE   (VIDEO_FONT_HEIGHT * lcd_line_length)
-#define CONSOLE_ROW_FIRST  lcd_console_address
-#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * console_rows)
+#define CONSOLE_ROW_FIRST  cons.lcd_address
+#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * cons.rows)
 
-static short console_curr_col;
-static short console_curr_row;
-static short console_cols;
-static short console_rows;
-static void *lcd_console_address;
+struct console_t {
+   short curr_col, curr_row;
+   short cols, rows;
+   void *lcd_address;
+};
+static struct console_t cons;
 
 void lcd_init_console(void *address, int rows, int cols)
 {
-   console_curr_col = 0;
-   console_curr_row = 0;
-   console_cols = cols;
-   console_rows = rows;
-   lcd_console_address = address;
+   memset(&cons, 0, sizeof(cons));
+   cons.cols = cols;
+   cons.rows = rows;
+   cons.lcd_address = address;
+
 }
 
 void lcd_set_col(short col)
 {
-   console_curr_col = col;
+   cons.curr_col = col;
 }
 
 void lcd_set_row(short row)
 {
-   console_curr_row = row;
+   cons.curr_row = row;
 }
 
 void lcd_position_cursor(unsigned col, unsigned row)
 {
-   console_curr_col = min_t(short, col, console_cols - 1);
-   console_curr_row = min_t(short, row, console_rows - 1);
+   cons.curr_col = min_t(short, col, cons.cols - 1);
+   cons.curr_row = min_t(short, row, cons.rows - 1);
 }
 
 int lcd_get_screen_rows(void)
 {
-   return console_rows;
+   return cons.rows;
 }
 
 int lcd_get_screen_columns(void)
 {
-   return console_cols;
+   return cons.cols;
 }
 
 static void lcd_putc_xy(ushort x, ushort y, char c)
@@ -63,7 +64,7 @@ static void lcd_putc_xy(ushort x, ushort y, char c)
int bg_color = lcd_getbgcolor();
int i;
 
-   dest = (uchar *)(lcd_console_address +
+   dest = (uchar *)(cons.lcd_address +
 y * lcd_line_length + x * NBITS(LCD_BPP) / 8);
 
for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
@@ -91,7 +92,7 @@ static void console_scrollup(void)
 
/* Copy up rows ignoring those that will be overwritten */
memcpy(CONSOLE_ROW_FIRST,
-  lcd_console_address + CONSOLE_ROW_SIZE * rows,
+  cons.lcd_address + CONSOLE_ROW_SIZE * rows,
   CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows);
 
/* Clear the last rows */
@@ -99,7 +100,7 @@ static void console_scrollup(void)
memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
   bg_color, CONSOLE_ROW_SIZE * rows);
 #else
-   u32 *ppix = lcd_console_address +
+   u32 *ppix = cons.lcd_address +
CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows;
u32 i;
for (i = 0;
@@ -109,27 +110,27 @@ static void console_scrollup(void)
}
 #endif
lcd_sync();
-   console_curr_row -= rows;
+   cons.curr_row -= rows;
 }
 
 static inline void console_back(void)
 {
-   if (--console_curr_col < 0) {
-   console_curr_col = console_cols - 1;
-   if (--console_curr_row < 0)
-   console_curr_row = 0;
+   if (--cons.curr_col < 0) {
+   cons.curr_col = cons.cols - 1;
+   if (--cons.curr_row < 0)
+   cons.curr_row = 0;
}
 
-   lcd_putc_xy(console_curr_col * VIDEO_FONT_WIDTH,
-   console_curr_row * VIDEO_FONT_HEIGHT, ' ');
+   lcd_putc_xy(cons.curr_col * VIDEO_FONT_WIDTH,
+   cons.curr_row * VIDEO_FONT_HEIGHT, ' ');
 }
 
 static inline void console_newline(void)
 {
-   console_curr_col = 0;
+   cons.curr_col = 0;
 
/* Check if we need to scroll the terminal */
-   if (++console_curr_row >= console_rows)
+   if (++cons.curr_row >= cons.rows)
console_scrollup();
else
lcd_sync();
@@ -145,18 +146,17 @@ void lcd_putc(const char c)
 
switch (c) {
case '\r':
-   console_curr_col = 0;
-
+   cons.curr_col = 0;
return;
case '\n':
console_newline();
 
return;
case '\t'

[U-Boot] [PATCH 2/4] common/lcd_console: ask only one-time for bg/fg-color per call

2015-03-11 Thread Hannes Petermaier
From: Hannes Petermaier 

Don't call the lcd_getfgcolor and lcd_getbgcolor within the "draw-loop", this
only wastes time.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

 common/lcd_console.c |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index 243b7c5..b7dda7a 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -59,7 +59,8 @@ static void lcd_putc_xy(ushort x, ushort y, char c)
 {
uchar *dest;
ushort row;
-   int fg_color, bg_color;
+   int fg_color = lcd_getfgcolor();
+   int bg_color = lcd_getbgcolor();
int i;
 
dest = (uchar *)(lcd_console_address +
@@ -73,10 +74,6 @@ static void lcd_putc_xy(ushort x, ushort y, char c)
 #else
uchar *d = dest;
 #endif
-
-   fg_color = lcd_getfgcolor();
-   bg_color = lcd_getbgcolor();
-
uchar bits;
bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
 
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/4] common/lcd_console: cleanup lcd_drawchars/lcd_putc_xy

2015-03-11 Thread Hannes Petermaier
From: Hannes Petermaier 

the capability of drawing some *str with count from lcd_drawchars is unnary.
It is always called from lcd_putc_xy with one character of and count = 1.

So we simply rename lcd_drawchars into lcd_putc_xy and remove the loops inside.

Signed-off-by: Hannes Petermaier 
Signed-off-by: Hannes Petermaier 
---

 common/lcd_console.c |   23 +++
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index 8bf83b9..243b7c5 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -55,18 +55,17 @@ int lcd_get_screen_columns(void)
return console_cols;
 }
 
-static void lcd_drawchars(ushort x, ushort y, uchar *str, int count)
+static void lcd_putc_xy(ushort x, ushort y, char c)
 {
uchar *dest;
ushort row;
int fg_color, bg_color;
+   int i;
 
dest = (uchar *)(lcd_console_address +
 y * lcd_line_length + x * NBITS(LCD_BPP) / 8);
 
for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
-   uchar *s = str;
-   int i;
 #if LCD_BPP == LCD_COLOR16
ushort *d = (ushort *)dest;
 #elif LCD_BPP == LCD_COLOR32
@@ -77,25 +76,17 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, 
int count)
 
fg_color = lcd_getfgcolor();
bg_color = lcd_getbgcolor();
-   for (i = 0; i < count; ++i) {
-   uchar c, bits;
 
-   c = *s++;
-   bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
+   uchar bits;
+   bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
 
-   for (c = 0; c < 8; ++c) {
-   *d++ = (bits & 0x80) ? fg_color : bg_color;
-   bits <<= 1;
-   }
+   for (i = 0; i < 8; ++i) {
+   *d++ = (bits & 0x80) ? fg_color : bg_color;
+   bits <<= 1;
}
}
 }
 
-static inline void lcd_putc_xy(ushort x, ushort y, uchar c)
-{
-   lcd_drawchars(x, y, &c, 1);
-}
-
 static void console_scrollup(void)
 {
const int rows = CONFIG_CONSOLE_SCROLL_LINES;
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Bad colors on BMP display on LCD

2015-03-03 Thread Hannes Petermaier

On 2015-03-03 15:55, Guillaume Gardet wrote:

Hi,

Hi Guillaume,



Le 26/02/2015 18:10, Hannes Petermaier a écrit :

Hi Guillaume,

which imageformat (bpp) do you have?


It depends on images tested. Most of them are: "PC bitmap, Windows 3.x 
format, XXX x YY x 8". Just see tools/logos/*.bmp in U-Boot sources.


I also created my own BMP image using convert tool with the following 
option : "-depth 8 -colors 256 -compress none -alpha off".


On my boards i use 24bpp BMPs maybe you try that. I will try display 
some logos out of tools/logos/*.bmp on my boards this evening.




which u-boot framebuffer driver is used ?


On snow config, this should be the exynos framebuffer driver.


Guillaume


best regards,
Hannes
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] lcd-console / display rotation

2015-03-03 Thread Hannes Petermaier
> 
> +Anatolij, Nikita
> 
> Hi,
Hi,
many thanks for response.

> 
> On 2 March 2015 at 03:12, Hannes Petermaier
>  wrote:
> > Hello everybody,
> >
> > A short question about lcd-console:
> >
> > Today u-boot only supports a 'linear framebuffer', meaning the next 
pixel
> > of a character is allways right after left and the framebuffer address 
is
> > incrementing.
> > We call this the display is mounted with 0° rotation.
> >
> > In some cases we have a rotated display.
> > Maybe rotated by 90° to have portrait mode or even 180° due to 
mechanical
> > issues.
> >
> > My question is:
> > Is anybody currently working around this, having rotated display ?
> > If not so, i would like start a implementation.
> >
> > 180° is quite easy, we only need to add some offset (total len of
> > framebuffer) to our framebuffer base address and do -- instead ++ for
> > drawing characters. Font can be reused.
> >
> > In the other cases, 90° and 270° it will maybe a bit tricky. I think a
> > ?rotated font? is also necessary.
> >
> > Of course we have to think about the other functions like scroll 
up/down.
> 
> I don't know of anything, but it sounds useful.
Okay, Anatolij doesn't also know anything that there is something going 
on.
I will start to form some ideas how to implement such feature.

> 
> Also I wonder if some hardware has support for this?
"Support" is the wrong word, sometimes the the lcd is mechanical built in 
rotated and the logical start of the framebuffer isn't as usual at 
top-left, rather it it bottom-right - means rotated by 180°.
> 
> Nikita (on CC) is tidying up this part of U-Boot so get in touch with 
him.
Nikita, whats your opinion around that ?

> Regards,
> Simon
best regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] lcd-console / display rotation

2015-03-02 Thread Hannes Petermaier
Hello everybody,

A short question about lcd-console:

Today u-boot only supports a 'linear framebuffer', meaning the next pixel 
of a character is allways right after left and the framebuffer address is 
incrementing.
We call this the display is mounted with 0° rotation.

In some cases we have a rotated display.
Maybe rotated by 90° to have portrait mode or even 180° due to mechanical 
issues.

My question is:
Is anybody currently working around this, having rotated display ?
If not so, i would like start a implementation.

180° is quite easy, we only need to add some offset (total len of 
framebuffer) to our framebuffer base address and do -- instead ++ for 
drawing characters. Font can be reused.

In the other cases, 90° and 270° it will maybe a bit tricky. I think a 
?rotated font? is also necessary.

Of course we have to think about the other functions like scroll up/down.

best regards,
hannes

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Bad colors on BMP display on LCD

2015-02-26 Thread Hannes Petermaier

Hi Guillaume,

which imageformat (bpp) do you have?
which u-boot framebuffer driver is used ?

best regards,
HAnnes

On 2015-02-26 17:52, Guillaume Gardet wrote:

Hi,

I am trying to display a BMP image on a Samsung Chromebook (snow), but 
I get wrong colors. The image is displayed but colors are bad.


I used my own image and images provided in tools/logos/ folder, thay 
are all ok on the Sabrelite board (HDMI output) but displayed in bad 
colors on the samsung chromebook (LCD screen).


What could be wrong? What am I missing?


Guillaume

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot




___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] lcd: Add support for CONFIG_LCD_NOSTDOUT

2015-02-04 Thread Hannes Petermaier

On 2014-08-11 15:52, Anatolij Gustschin wrote:

Hi,

Hi,
sorry for my late response because i've been working on some other 
project for a couple of months.


On Thu,  6 Mar 2014 15:26:11 +0100
Hannes Petermaier  wrote:
...

+   CONFIG_LCD_NOSTDOUT
+   Normally 'stdout' is redirected to LCD-screen after
+   initialization. Define CONFIG_LCD_NOSTDOUT to avoid this.
+   Useful in case where only lcd_puts(...), lcd_printf(...)
+   functions of the framework are used and 'normal' u-boot
+   console remains e.g. on serial-line.
+

this console redirection to lcd can be disabled by defining

#define CONFIG_SYS_CONSOLE_IS_IN_ENV
#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE

in the board config file and adding below function to
the board code:

int overwrite_console(void)
{
 return 1;
}

Can you please try it instead of this patch?

Yes - that works for me - so we can close the case.
Many thanks.
I will create some patch for the B&R boards.


Best regards,

Anatolij

best regards,
Hannes
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] intern: Add copy scripts and target specific helpers

2015-02-04 Thread Hannes Petermaier

On 2015-02-04 08:33, Heiko Schocher wrote:

Hello Hannes,


1st)
patman prints out some errors, looks like for me that something is wrong
with the first line of my commit message - but no idea what.

"
Traceback (most recent call last):
   File "tools/patman/patman", line 149, in 
 options.add_maintainers)
   File "/home/petermaierh/work/u-boot/tools/patman/series.py", line 
227,

in MakeCcFile
 raise_on_error=raise_on_error)
   File "/home/petermaierh/work/u-boot/tools/patman/gitutil.py", line 
321,

in BuildEmailList
 raw += LookupEmail(item, alias, raise_on_error=raise_on_error)
   File "/home/petermaierh/work/u-boot/tools/patman/gitutil.py", line 
490,

in LookupEmail
 raise ValueError, msg
ValueError: Alias 'drivers/video/am335x-fb' not found
"
maybe you've or somebody else has an idea how to fix this ?


I am not really a python coder ... and I do not see such an error,
if I create a commit with changes in "drivers/video/am335x-fb.c"
I got not this error ... my first thought it was the
"drivers/video/am335x-fb:" in your subject line... but I used the same
subject for a test commit ... please try another subject line:
"drivers, video, am335x: ..." ?

How does your patman config file looks like?

I've tried to add
--no-tags Don't process subject tags as aliaes
to cmdline, this works ... so it is definitely a problem with the 
subject line of the commit.





2nd)
How to achieve "not breaking threading" ? How the right "in-reply-to" is
added to git-send-email ? from where comes this information.
I've seen at my last V2 that i don't have reached the goal.


Hmm... I am not sure, maybe this is a ToDo? Simon? Could you
help here?

An idea is to use the
-r IN_REPLY_TO
in the commandline, the value may be taken from patchwork, here is a 
messageid like

<1422966166-3973-21-git-send-email-oe5...@oevsv.at> displayed.



Thanks!

bye,
Heiko

best regards,
Hannes



many thanks and best regards,
Hannes

Heiko Schocher  schrieb am 03.02.2015 13:47:02:


From: Heiko Schocher 
To: Hannes Petermaier 
Cc: Hannes Petermaier , u-boot@lists.denx.de, U-Boot


boun...@lists.denx.de>
Date: 03.02.2015 13:47
Subject: Re: [U-Boot] [PATCH v2] intern: Add copy scripts and target

specific helpers


Hello Hannes,

Am 03.02.2015 13:37, schrieb Hannes Petermaier:

Hi all,

please ignore this "internal" patch.
This is was an accident.


Maybe it is worth to look into patman, see:
u-boot:/tools/patman/README ?

bye,
Heiko


best regards,
Hannes

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot



--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany








___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] intern: Add copy scripts and target specific helpers

2015-02-04 Thread Hannes Petermaier
Heiko,

what a great tool :-)
This makes the whole thing much easier and will produce (hopefully) less 
noise from me :-)

But i 've a further questions:

1st)
patman prints out some errors, looks like for me that something is wrong 
with the first line of my commit message - but no idea what.

"
Traceback (most recent call last):
  File "tools/patman/patman", line 149, in 
options.add_maintainers)
  File "/home/petermaierh/work/u-boot/tools/patman/series.py", line 227, 
in MakeCcFile
raise_on_error=raise_on_error)
  File "/home/petermaierh/work/u-boot/tools/patman/gitutil.py", line 321, 
in BuildEmailList
raw += LookupEmail(item, alias, raise_on_error=raise_on_error)
  File "/home/petermaierh/work/u-boot/tools/patman/gitutil.py", line 490, 
in LookupEmail
raise ValueError, msg
ValueError: Alias 'drivers/video/am335x-fb' not found
"
maybe you've or somebody else has an idea how to fix this ?

2nd)
How to achieve "not breaking threading" ? How the right "in-reply-to" is 
added to git-send-email ? from where comes this information.
I've seen at my last V2 that i don't have reached the goal.

many thanks and best regards,
Hannes

Heiko Schocher  schrieb am 03.02.2015 13:47:02:

> From: Heiko Schocher 
> To: Hannes Petermaier 
> Cc: Hannes Petermaier , u-boot@lists.denx.de, U-Boot 
 boun...@lists.denx.de>
> Date: 03.02.2015 13:47
> Subject: Re: [U-Boot] [PATCH v2] intern: Add copy scripts and target 
specific helpers
> 
> Hello Hannes,
> 
> Am 03.02.2015 13:37, schrieb Hannes Petermaier:
> > Hi all,
> >
> > please ignore this "internal" patch.
> > This is was an accident.
> 
> Maybe it is worth to look into patman, see:
> u-boot:/tools/patman/README ?
> 
> bye,
> Heiko
> >
> > best regards,
> > Hannes
> >
> > ___
> > U-Boot mailing list
> > U-Boot@lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
> >
> 
> -- 
> DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] intern: Add copy scripts and target specific helpers

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore this "internal" patch.
This is was an accident.

best regards,
Hannes

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] intern: Add specific offset do FAT-Filesystem

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore this "internal" patch.
This is was an accident.

best regards,
Hannes

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/kwb: Redesign default-environment

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] intern: disable lcd-stdout

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore this "internal" patch.
This is was an accident.

best regards,
Hannes

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/kwb: Support modify bootcmd through reset-controller

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/common: Add support for displaying BMP on LCD

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/kwb: Form a bootline for vxWorks

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/kwb: Support booting Linux

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/kwb: switch to board HW-Rev3

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/tseries: Rework default-environment settings.

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/tseries: Chg pinmux - use free NAND Pins in non NAND-config as GPIO

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/tseries: cosmetic changes

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/common: Enable CONFIG_CMD_TIME

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/tseries: Chg Pinmux - enable UART1 pins

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/common: Introduce Network Console and common environment for it

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/tseries: Change pinmux for GPIO2_28 from GPIO to PWM-Timeroutput

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/tseries: Enable EXT4 support

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/common: try to setup cpsw mac-address from the devicetree

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/tseries: Enable U-Boot BOOTCOUNT feature

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/tseries: Enable HW-Watchdog

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] common/lcd: Add command for writing to lcd-display

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] board/BuR/common: Take usage of am335x LCD-Display

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] common/lcd: Add command for setting cursor within lcd-console

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] drivers/video/am335x-fb: Add possibility to wait for stable power/picture

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore, the numbering has been lost - so i will resend V2

regards,
Hannes


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 23/24] intern: Add specific offset do FAT-Filesystem

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore this "internal" patch.
This is was an accident.

best regards,
Hannes


"U-Boot"  schrieb am 03.02.2015 13:22:45:

> From: Hannes Petermaier 
> To: u-boot@lists.denx.de
> Date: 03.02.2015 13:27
> Subject: [U-Boot] [PATCH v2 23/24] intern: Add specific offset do 
FAT-Filesystem
> Sent by: "U-Boot" 
> 
> on vxWorks targets the filesystem with its MBR starts from a higher 
offset in
> the emmc flash for limiting space which is accesible by the user.
> 
> Signed-off-by: Hannes Petermaier 
> 
> ---
> Changes for V2: None
> ---
>  board/BuR/kwb/board.c |6 ++
>  disk/part_dos.c   |   11 ---
>  drivers/mmc/mmc.c |8 
>  fs/fat/fat.c  |5 +++--
>  fs/fat/fat_write.c|7 ---
>  include/part.h|   10 +-
>  6 files changed, 38 insertions(+), 9 deletions(-)
> 
> diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c
> index 892311e..8578c06 100644
> --- a/board/BuR/kwb/board.c
> +++ b/board/BuR/kwb/board.c
> @@ -27,6 +27,7 @@
>  #include 
>  #include "../common/bur_common.h"
>  #include 
> +#include 
> 
>  /* 
-*/
>  /* -- defines for used GPIO Hardware -- */
> @@ -162,6 +163,11 @@ int board_init(void)
> gpmc_init();
> return 0;
>  }
> +void board_mmc_geometry(struct mmc *mmc)
> +{
> +   mmc->block_dev.lba_fs = mmc->block_dev.lba - 0x2A8000;
> +   mmc->block_dev.lba_offset = 0x2A8000;
> +}
> 
>  #ifdef CONFIG_BOARD_LATE_INIT
>  int board_late_init(void)
> diff --git a/disk/part_dos.c b/disk/part_dos.c
> index cf1a36e..9c34107 100644
> --- a/disk/part_dos.c
> +++ b/disk/part_dos.c
> @@ -89,7 +89,8 @@ int test_part_dos (block_dev_desc_t *dev_desc)
>  {
> ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
> 
> -   if (dev_desc->block_read(dev_desc->dev, 0, 1, (ulong *) buffer) != 
1)
> +   if (dev_desc->block_read(dev_desc->dev, dev_desc->lba_offset, 1,
> + (ulong *)buffer) != 1)
>return -1;
> 
> if (test_block_type(buffer) != DOS_MBR)
> @@ -108,7 +109,9 @@ static void 
print_partition_extended(block_dev_desc_t *dev_desc,
> dos_partition_t *pt;
> int i;
> 
> -   if (dev_desc->block_read(dev_desc->dev, ext_part_sector, 1, (ulong 
*) 
> buffer) != 1) {
> +   if (dev_desc->block_read(dev_desc->dev,
> + ext_part_sector + dev_desc->lba_offset, 1,
> + (ulong *)buffer) != 1) {
>printf ("** Can't read partition table on %d:%d **\n",
>   dev_desc->dev, ext_part_sector);
>return;
> @@ -172,7 +175,9 @@ static int get_partition_info_extended 
(block_dev_desc_t 
> *dev_desc, int ext_part
> int i;
> int dos_type;
> 
> -   if (dev_desc->block_read (dev_desc->dev, ext_part_sector, 1, (ulong 
*) 
> buffer) != 1) {
> +   if (dev_desc->block_read(dev_desc->dev,
> + ext_part_sector + dev_desc->lba_offset, 1,
> + (ulong *)buffer) != 1) {
>printf ("** Can't read partition table on %d:%d **\n",
>   dev_desc->dev, ext_part_sector);
>return -1;
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index b8039cd..52e8cf5 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -531,6 +531,12 @@ static int mmc_change_freq(struct mmc *mmc)
> return 0;
>  }
> 
> +void __weak board_mmc_geometry(struct mmc *mmc)
> +{
> +   mmc->block_dev.lba_fs = mmc->block_dev.lba;
> +   mmc->block_dev.lba_offset = 0;
> +}
> +
>  static int mmc_set_capacity(struct mmc *mmc, int part_num)
>  {
> switch (part_num) {
> @@ -556,6 +562,8 @@ static int mmc_set_capacity(struct mmc *mmc, int 
part_num)
> 
> mmc->block_dev.lba = lldiv(mmc->capacity, mmc->read_bl_len);
> 
> +   board_mmc_geometry(mmc);
> +
> return 0;
>  }
> 
> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> index bccc3e3..46f7da6 100644
> --- a/fs/fat/fat.c
> +++ b/fs/fat/fat.c
> @@ -49,7 +49,8 @@ static int disk_read(__u32 block, __u32 nr_blocks, 
void *buf)
>return -1;
> 
> return cur_dev->block_read(cur_dev->dev,
> - cur_part_info.start + block, nr_blocks, buf);
> + cur_part_info.start + block + cur_dev->lba_offset,
> + nr_blocks, buf);
>  }
> 
>  int fat_set_blk_dev(block_dev_desc_t *dev_desc, disk_partition_t *info)
> @@ -97,7 +98,7 @@ int fat_register_device(block_dev_desc_t *dev_desc, 
int part_no)
>}
> 
>info.start = 0;
> -  info.size = dev_desc->lba;
&g

Re: [U-Boot] [PATCH v2 24/24] intern: Add copy scripts and target specific helpers

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore this "internal" patch.
This is was an accident.

best regards,
Hannes


"U-Boot"  schrieb am 03.02.2015 13:22:46:

> From: Hannes Petermaier 
> To: u-boot@lists.denx.de
> Date: 03.02.2015 13:27
> Subject: [U-Boot] [PATCH v2 24/24] intern: Add copy scripts and target 
specific helpers
> Sent by: "U-Boot" 
> 
> cpy
> ===
> copies relevant files to TFTP server and packs them into a ZIP which can 
be
> checked in for series production in SAP.
> 
> bur/scripts
> ===
> target specific helper scripts
> 
> Signed-off-by: Hannes Petermaier 
> 
> ---
> Changes for V2: None
> ---
>  bur-scripts/.gitignore|3 ++
>  bur-scripts/kwb/addUSBfiles.sh|5 +++
>  bur-scripts/kwb/dispScripts.sh|4 ++
>  bur-scripts/kwb/setdisp_43kwb |   32 +
>  bur-scripts/kwb/updateUBOOTusb|7 +++
>  bur-scripts/kwb/updateUBOOTusb.sh |2 +
>  bur-scripts/netscript |4 ++
>  bur-scripts/netscript.sh  |5 +++
>  bur-scripts/netscript.txt |6 +++
>  bur-scripts/tseries/addUSBfiles.sh|5 +++
>  bur-scripts/tseries/updateUBOOTusb|4 ++
>  bur-scripts/tseries/updateUBOOTusb.sh |2 +
>  cpy   |   79 
+
>  13 files changed, 158 insertions(+)
>  create mode 100644 bur-scripts/.gitignore
>  create mode 100755 bur-scripts/kwb/addUSBfiles.sh
>  create mode 100755 bur-scripts/kwb/dispScripts.sh
>  create mode 100644 bur-scripts/kwb/setdisp_43kwb
>  create mode 100644 bur-scripts/kwb/updateUBOOTusb
>  create mode 100755 bur-scripts/kwb/updateUBOOTusb.sh
>  create mode 100644 bur-scripts/netscript
>  create mode 100755 bur-scripts/netscript.sh
>  create mode 100644 bur-scripts/netscript.txt
>  create mode 100755 bur-scripts/tseries/addUSBfiles.sh
>  create mode 100644 bur-scripts/tseries/updateUBOOTusb
>  create mode 100755 bur-scripts/tseries/updateUBOOTusb.sh
>  create mode 100755 cpy
> 
> diff --git a/bur-scripts/.gitignore b/bur-scripts/.gitignore
> new file mode 100644
> index 000..ca70038
> --- /dev/null
> +++ b/bur-scripts/.gitignore
> @@ -0,0 +1,3 @@
> +addon/*
> +*.img
> +
> diff --git a/bur-scripts/kwb/addUSBfiles.sh 
b/bur-scripts/kwb/addUSBfiles.sh
> new file mode 100755
> index 000..7555420
> --- /dev/null
> +++ b/bur-scripts/kwb/addUSBfiles.sh
> @@ -0,0 +1,5 @@
> +#!/bin/sh
> +echo "copy MLO -> bur/scripts/addon/kwb/MLO.update"
> +cp ../../MLO ../addon/kwb/MLO.update
> +echo "copy u-boot.img -> bur/scripts/addon/kwb/u-boot.img"
> +cp ../../u-boot.img ../addon/kwb/u-boot.img.update
> diff --git a/bur-scripts/kwb/dispScripts.sh 
b/bur-scripts/kwb/dispScripts.sh
> new file mode 100755
> index 000..55cc1d4
> --- /dev/null
> +++ b/bur-scripts/kwb/dispScripts.sh
> @@ -0,0 +1,4 @@
> +#!/bin/sh
> +mkimage -A ARM -T script -C none -d setdisp_43kwb setdisp_43kwb.img
> +cp setdisp*.img /tftpboot/tseries
> +
> diff --git a/bur-scripts/kwb/setdisp_43kwb 
b/bur-scripts/kwb/setdisp_43kwb
> new file mode 100644
> index 000..210f0a8
> --- /dev/null
> +++ b/bur-scripts/kwb/setdisp_43kwb
> @@ -0,0 +1,32 @@
> +setenv ds1_hactive 480
> +setenv ds1_vactive 272
> +setenv ds1_bpp 32
> +setenv ds1_hfp 8
> +setenv ds1_hbp 43
> +setenv ds1_hsw 2
> +setenv ds1_vfp 4
> +setenv ds1_vbp 2
> +setenv ds1_vsw 10
> +setenv ds1_pxlclkdiv 21
> +setenv ds1_pol 0x230
> +setenv ds1_pupdelay 10
> +setenv ds1_tondelay 10
> +setenv ds1_pwr 0x0045
> +setenv ds1_bright_drv 0
> +setenv ds1_bright 50
> +
> +setenv br_blversion V2.0
> +setenv br_orderno "not programmed"
> +setenv br_serial "not programmed"
> +setenv br_mac1
> +setenv br_mac2
> +
> +setenv dnsip
> +setenv gatewayip
> +setenv ipaddr
> +setenv serverip
> +setenv fileaddr
> +setenv filesize
> +setenv bootfile
> +
> +saveenv
> diff --git a/bur-scripts/kwb/updateUBOOTusb 
b/bur-scripts/kwb/updateUBOOTusb
> new file mode 100644
> index 000..9edaa26
> --- /dev/null
> +++ b/bur-scripts/kwb/updateUBOOTusb
> @@ -0,0 +1,7 @@
> +fatload usb 0 0x8010 bur-ppt-ts30.dtb
> +fatload usb 0 0x8020 zImage
> +fatload usb 0 0x80A0 rootfs.cpio.uboot
> +setenv bootargs "consoleblank=0 quiet lpj=1191936 panic=2 
console=ttyO0,
> 115200n8 burbootmode=pme"
> +setenv bootcmd "env default -a; setenv bootcmd run netboot; saveenv; 
reset"
> +saveenv
> +bootz 0x8020 0x80A0 0x8010;
> diff --git a/bur-scripts/kwb/updateUBOOTusb.sh 
b/bur-scripts/kwb/updateUBOOTusb.sh
> new file mode

Re: [U-Boot] [PATCH v2 22/24] intern: disable lcd-stdout

2015-02-03 Thread Hannes Petermaier
Hi all,

please ignore this "internal" patch.
This is was an accident.

best regards,
Hannes



From:   Hannes Petermaier 
To: u-boot@lists.denx.de
Date:   03.02.2015 13:26
Subject:[U-Boot] [PATCH v2 22/24] intern: disable lcd-stdout
Sent by:"U-Boot" 



on B&R boards we want not redirect console to screen.

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 README   |7 +++
 common/lcd.c |   10 ++
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/README b/README
index fefa71c..8f9865c 100644
--- a/README
+++ b/README
@@ -1959,6 +1959,13 @@ CBFS (Coreboot Filesystem) support
 Normally display is black on white 
background; define
 CONFIG_SYS_WHITE_ON_BLACK to get it 
inverted.
 
+CONFIG_LCD_NOSTDOUT
+Normally 'stdout' is redirected to 
LCD-screen after
+initialization. Define 
CONFIG_LCD_NOSTDOUT to avoid this.
+Useful in case where only lcd_puts(...), 
lcd_printf(...)
+functions of the framework are used and 
'normal' u-boot
+console remains e.g. on serial-line.
+
 CONFIG_LCD_ALIGNMENT
 
 Normally the LCD is page-aligned 
(typically 4KB). If this is
diff --git a/common/lcd.c b/common/lcd.c
index cc34b8a..3ed6d20 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -194,12 +194,11 @@ __weak int lcd_get_size(int *line_length)
 
 int drv_lcd_init(void)
 {
-struct stdio_dev lcddev;
-int rc;
-
 lcd_base = map_sysmem(gd->fb_base, 0);
-
 lcd_init(lcd_base); /* LCD 
initialization */
+#ifndef CONFIG_LCD_NOSTDOUT
+struct stdio_dev lcddev;
+int rc;
 
 /* Device initialization */
 memset(&lcddev, 0, sizeof(lcddev));
@@ -213,6 +212,9 @@ int drv_lcd_init(void)
 rc = stdio_register(&lcddev);
 
 return (rc == 0) ? 1 : rc;
+#else
+return 0;
+#endif
 }
 
 
/*--*/
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot



___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 24/24] intern: Add copy scripts and target specific helpers

2015-02-03 Thread Hannes Petermaier
cpy
===
copies relevant files to TFTP server and packs them into a ZIP which can be
checked in for series production in SAP.

bur/scripts
===
target specific helper scripts

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 bur-scripts/.gitignore|3 ++
 bur-scripts/kwb/addUSBfiles.sh|5 +++
 bur-scripts/kwb/dispScripts.sh|4 ++
 bur-scripts/kwb/setdisp_43kwb |   32 +
 bur-scripts/kwb/updateUBOOTusb|7 +++
 bur-scripts/kwb/updateUBOOTusb.sh |2 +
 bur-scripts/netscript |4 ++
 bur-scripts/netscript.sh  |5 +++
 bur-scripts/netscript.txt |6 +++
 bur-scripts/tseries/addUSBfiles.sh|5 +++
 bur-scripts/tseries/updateUBOOTusb|4 ++
 bur-scripts/tseries/updateUBOOTusb.sh |2 +
 cpy   |   79 +
 13 files changed, 158 insertions(+)
 create mode 100644 bur-scripts/.gitignore
 create mode 100755 bur-scripts/kwb/addUSBfiles.sh
 create mode 100755 bur-scripts/kwb/dispScripts.sh
 create mode 100644 bur-scripts/kwb/setdisp_43kwb
 create mode 100644 bur-scripts/kwb/updateUBOOTusb
 create mode 100755 bur-scripts/kwb/updateUBOOTusb.sh
 create mode 100644 bur-scripts/netscript
 create mode 100755 bur-scripts/netscript.sh
 create mode 100644 bur-scripts/netscript.txt
 create mode 100755 bur-scripts/tseries/addUSBfiles.sh
 create mode 100644 bur-scripts/tseries/updateUBOOTusb
 create mode 100755 bur-scripts/tseries/updateUBOOTusb.sh
 create mode 100755 cpy

diff --git a/bur-scripts/.gitignore b/bur-scripts/.gitignore
new file mode 100644
index 000..ca70038
--- /dev/null
+++ b/bur-scripts/.gitignore
@@ -0,0 +1,3 @@
+addon/*
+*.img
+
diff --git a/bur-scripts/kwb/addUSBfiles.sh b/bur-scripts/kwb/addUSBfiles.sh
new file mode 100755
index 000..7555420
--- /dev/null
+++ b/bur-scripts/kwb/addUSBfiles.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+echo "copy MLO -> bur/scripts/addon/kwb/MLO.update"
+cp ../../MLO ../addon/kwb/MLO.update
+echo "copy u-boot.img -> bur/scripts/addon/kwb/u-boot.img"
+cp ../../u-boot.img ../addon/kwb/u-boot.img.update
diff --git a/bur-scripts/kwb/dispScripts.sh b/bur-scripts/kwb/dispScripts.sh
new file mode 100755
index 000..55cc1d4
--- /dev/null
+++ b/bur-scripts/kwb/dispScripts.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+mkimage -A ARM -T script -C none -d setdisp_43kwb setdisp_43kwb.img
+cp setdisp*.img /tftpboot/tseries
+
diff --git a/bur-scripts/kwb/setdisp_43kwb b/bur-scripts/kwb/setdisp_43kwb
new file mode 100644
index 000..210f0a8
--- /dev/null
+++ b/bur-scripts/kwb/setdisp_43kwb
@@ -0,0 +1,32 @@
+setenv ds1_hactive 480
+setenv ds1_vactive 272
+setenv ds1_bpp 32
+setenv ds1_hfp 8
+setenv ds1_hbp 43
+setenv ds1_hsw 2
+setenv ds1_vfp 4
+setenv ds1_vbp 2
+setenv ds1_vsw 10
+setenv ds1_pxlclkdiv 21
+setenv ds1_pol 0x230
+setenv ds1_pupdelay 10
+setenv ds1_tondelay 10
+setenv ds1_pwr 0x0045
+setenv ds1_bright_drv 0
+setenv ds1_bright 50
+
+setenv br_blversion V2.0
+setenv br_orderno "not programmed"
+setenv br_serial "not programmed"
+setenv br_mac1
+setenv br_mac2
+
+setenv dnsip
+setenv gatewayip
+setenv ipaddr
+setenv serverip
+setenv fileaddr
+setenv filesize
+setenv bootfile
+
+saveenv
diff --git a/bur-scripts/kwb/updateUBOOTusb b/bur-scripts/kwb/updateUBOOTusb
new file mode 100644
index 000..9edaa26
--- /dev/null
+++ b/bur-scripts/kwb/updateUBOOTusb
@@ -0,0 +1,7 @@
+fatload usb 0 0x8010 bur-ppt-ts30.dtb
+fatload usb 0 0x8020 zImage
+fatload usb 0 0x80A0 rootfs.cpio.uboot
+setenv bootargs "consoleblank=0 quiet lpj=1191936 panic=2 
console=ttyO0,115200n8 burbootmode=pme"
+setenv bootcmd "env default -a; setenv bootcmd run netboot; saveenv; reset"
+saveenv
+bootz 0x8020 0x80A0 0x8010;
diff --git a/bur-scripts/kwb/updateUBOOTusb.sh 
b/bur-scripts/kwb/updateUBOOTusb.sh
new file mode 100755
index 000..1fe3b64
--- /dev/null
+++ b/bur-scripts/kwb/updateUBOOTusb.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+mkimage -A ARM -T script -C none -n "ubootUpdateUSB" -d updateUBOOTusb 
updateUBOOTusb.img
diff --git a/bur-scripts/netscript b/bur-scripts/netscript
new file mode 100644
index 000..7bfa8dd
--- /dev/null
+++ b/bur-scripts/netscript
@@ -0,0 +1,4 @@
+tftp 0x8000 setdisp_43kwb.img && source 0x8000
+reset
+
+
diff --git a/bur-scripts/netscript.sh b/bur-scripts/netscript.sh
new file mode 100755
index 000..33cbc18
--- /dev/null
+++ b/bur-scripts/netscript.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+mkimage -A ARM -T script -C none -d setdisp_common -d netscript.txt 
netscript.img
+cp netscript.img /tftpboot/tseries/
+
+
diff --git a/bur-scripts/netscript.txt b/bur-scripts/netscript.txt
new file mode 100644
index 000..537f4e2
--- /dev/null
+++ b/bur-scripts/netscript.txt
@@ -0,0 +1,6 @@
+tftp 0x8010 MLO && mmc write 0x8010 100 100
+tftp 0x8010 u-boot.img &

[U-Boot] [PATCH v2 21/24] board/BuR/kwb: Support modify bootcmd through reset-controller

2015-02-03 Thread Hannes Petermaier
For some cases it is necessary to modify temporaly the bootcommand.
This can be done by writing into the Scratchregister a specific value:

* 0xCC - modify bootcmd "run netboot"
* 0xCD - modify bootcmd "run netscript"
* 0xCE - modify bootcmd "run mmcboot"

the environment in flash is NOT overwritten.

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 board/BuR/kwb/board.c |   30 --
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c
index 455f472..892311e 100644
--- a/board/BuR/kwb/board.c
+++ b/board/BuR/kwb/board.c
@@ -169,10 +169,18 @@ int board_late_init(void)
const unsigned int toff = 1000;
unsigned int cnt  = 3;
unsigned short buf = 0x;
+   unsigned char scratchreg = 0;
unsigned int oldspeed;
 
-   tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
-  TPS65217_WLEDCTRL2, 0x32, 0xFF); /* 50% dimlevel */
+   /* try to read out some boot-instruction from resetcontroller */
+   oldspeed = i2c_get_bus_speed();
+   if (i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC) >= 0) {
+   i2c_read(RSTCTRL_ADDR, RSTCTRL_SCRATCHREG, 1,
+&scratchreg, sizeof(scratchreg));
+   i2c_set_bus_speed(oldspeed);
+   } else {
+   puts("ERROR: i2c_set_bus_speed failed! (scratchregister)\n");
+   }
 
if (gpio_get_value(ESC_KEY)) {
do {
@@ -223,6 +231,24 @@ int board_late_init(void)
break;
}
} while (cnt);
+   } else if (scratchreg == 0xCC) {
+   lcd_position_cursor(1, 8);
+   lcd_puts(
+   "starting vxworks from network ...  ");
+   setenv("bootcmd", "run netboot");
+   cnt = 4;
+   } else if (scratchreg == 0xCD) {
+   lcd_position_cursor(1, 8);
+   lcd_puts(
+   "starting script from network ...  ");
+   setenv("bootcmd", "run netscript");
+   cnt = 4;
+   } else if (scratchreg == 0xCE) {
+   lcd_position_cursor(1, 8);
+   lcd_puts(
+   "starting AR from eMMC ... ");
+   setenv("bootcmd", "run mmcboot");
+   cnt = 4;
}
 
lcd_position_cursor(1, 8);
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 22/24] intern: disable lcd-stdout

2015-02-03 Thread Hannes Petermaier
on B&R boards we want not redirect console to screen.

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 README   |7 +++
 common/lcd.c |   10 ++
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/README b/README
index fefa71c..8f9865c 100644
--- a/README
+++ b/README
@@ -1959,6 +1959,13 @@ CBFS (Coreboot Filesystem) support
Normally display is black on white background; define
CONFIG_SYS_WHITE_ON_BLACK to get it inverted.
 
+   CONFIG_LCD_NOSTDOUT
+   Normally 'stdout' is redirected to LCD-screen after
+   initialization. Define CONFIG_LCD_NOSTDOUT to avoid this.
+   Useful in case where only lcd_puts(...), lcd_printf(...)
+   functions of the framework are used and 'normal' u-boot
+   console remains e.g. on serial-line.
+
CONFIG_LCD_ALIGNMENT
 
Normally the LCD is page-aligned (typically 4KB). If this is
diff --git a/common/lcd.c b/common/lcd.c
index cc34b8a..3ed6d20 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -194,12 +194,11 @@ __weak int lcd_get_size(int *line_length)
 
 int drv_lcd_init(void)
 {
-   struct stdio_dev lcddev;
-   int rc;
-
lcd_base = map_sysmem(gd->fb_base, 0);
-
lcd_init(lcd_base); /* LCD initialization */
+#ifndef CONFIG_LCD_NOSTDOUT
+   struct stdio_dev lcddev;
+   int rc;
 
/* Device initialization */
memset(&lcddev, 0, sizeof(lcddev));
@@ -213,6 +212,9 @@ int drv_lcd_init(void)
rc = stdio_register(&lcddev);
 
return (rc == 0) ? 1 : rc;
+#else
+   return 0;
+#endif
 }
 
 /*--*/
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 23/24] intern: Add specific offset do FAT-Filesystem

2015-02-03 Thread Hannes Petermaier
on vxWorks targets the filesystem with its MBR starts from a higher offset in
the emmc flash for limiting space which is accesible by the user.

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 board/BuR/kwb/board.c |6 ++
 disk/part_dos.c   |   11 ---
 drivers/mmc/mmc.c |8 
 fs/fat/fat.c  |5 +++--
 fs/fat/fat_write.c|7 ---
 include/part.h|   10 +-
 6 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c
index 892311e..8578c06 100644
--- a/board/BuR/kwb/board.c
+++ b/board/BuR/kwb/board.c
@@ -27,6 +27,7 @@
 #include 
 #include "../common/bur_common.h"
 #include 
+#include 
 
 /* -*/
 /* -- defines for used GPIO Hardware -- */
@@ -162,6 +163,11 @@ int board_init(void)
gpmc_init();
return 0;
 }
+void board_mmc_geometry(struct mmc *mmc)
+{
+   mmc->block_dev.lba_fs = mmc->block_dev.lba - 0x2A8000;
+   mmc->block_dev.lba_offset = 0x2A8000;
+}
 
 #ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
diff --git a/disk/part_dos.c b/disk/part_dos.c
index cf1a36e..9c34107 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -89,7 +89,8 @@ int test_part_dos (block_dev_desc_t *dev_desc)
 {
ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
 
-   if (dev_desc->block_read(dev_desc->dev, 0, 1, (ulong *) buffer) != 1)
+   if (dev_desc->block_read(dev_desc->dev, dev_desc->lba_offset, 1,
+(ulong *)buffer) != 1)
return -1;
 
if (test_block_type(buffer) != DOS_MBR)
@@ -108,7 +109,9 @@ static void print_partition_extended(block_dev_desc_t 
*dev_desc,
dos_partition_t *pt;
int i;
 
-   if (dev_desc->block_read(dev_desc->dev, ext_part_sector, 1, (ulong *) 
buffer) != 1) {
+   if (dev_desc->block_read(dev_desc->dev,
+ext_part_sector + dev_desc->lba_offset, 1,
+(ulong *)buffer) != 1) {
printf ("** Can't read partition table on %d:%d **\n",
dev_desc->dev, ext_part_sector);
return;
@@ -172,7 +175,9 @@ static int get_partition_info_extended (block_dev_desc_t 
*dev_desc, int ext_part
int i;
int dos_type;
 
-   if (dev_desc->block_read (dev_desc->dev, ext_part_sector, 1, (ulong *) 
buffer) != 1) {
+   if (dev_desc->block_read(dev_desc->dev,
+ext_part_sector + dev_desc->lba_offset, 1,
+(ulong *)buffer) != 1) {
printf ("** Can't read partition table on %d:%d **\n",
dev_desc->dev, ext_part_sector);
return -1;
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index b8039cd..52e8cf5 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -531,6 +531,12 @@ static int mmc_change_freq(struct mmc *mmc)
return 0;
 }
 
+void __weak board_mmc_geometry(struct mmc *mmc)
+{
+   mmc->block_dev.lba_fs = mmc->block_dev.lba;
+   mmc->block_dev.lba_offset = 0;
+}
+
 static int mmc_set_capacity(struct mmc *mmc, int part_num)
 {
switch (part_num) {
@@ -556,6 +562,8 @@ static int mmc_set_capacity(struct mmc *mmc, int part_num)
 
mmc->block_dev.lba = lldiv(mmc->capacity, mmc->read_bl_len);
 
+   board_mmc_geometry(mmc);
+
return 0;
 }
 
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index bccc3e3..46f7da6 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -49,7 +49,8 @@ static int disk_read(__u32 block, __u32 nr_blocks, void *buf)
return -1;
 
return cur_dev->block_read(cur_dev->dev,
-   cur_part_info.start + block, nr_blocks, buf);
+   cur_part_info.start + block + cur_dev->lba_offset,
+   nr_blocks, buf);
 }
 
 int fat_set_blk_dev(block_dev_desc_t *dev_desc, disk_partition_t *info)
@@ -97,7 +98,7 @@ int fat_register_device(block_dev_desc_t *dev_desc, int 
part_no)
}
 
info.start = 0;
-   info.size = dev_desc->lba;
+   info.size = dev_desc->lba_fs;
info.blksz = dev_desc->blksz;
info.name[0] = 0;
info.type[0] = 0;
diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index 98b88ad..7ed656e 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -33,14 +33,15 @@ static int disk_write(__u32 block, __u32 nr_blocks, void 
*buf)
if (!cur_dev || !cur_dev->block_write)
return -1;
 
-   if (cur_part_info.start + block + nr_blocks >
-   cur_part_info.start + total_sector) {
+   if (cur_part_info.start + block + nr_blocks + c

[U-Boot] [PATCH v2 17/24] board/BuR/kwb: switch to board HW-Rev3

2015-02-03 Thread Hannes Petermaier
The board has been redesigned, therefore we need from now other I/O Pins to
mux and handle.

Older boards aren't supported from now anymore.

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 board/BuR/kwb/board.c |   92 ++---
 board/BuR/kwb/mux.c   |   51 +--
 include/configs/kwb.h |9 +++--
 3 files changed, 89 insertions(+), 63 deletions(-)

diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c
index 804765a..30900bc 100644
--- a/board/BuR/kwb/board.c
+++ b/board/BuR/kwb/board.c
@@ -26,14 +26,13 @@
 #include 
 #include 
 #include "../common/bur_common.h"
+#include 
 
 /* -*/
 /* -- defines for used GPIO Hardware -- */
-#define KEY(0+4)
-#define LCD_PWR(0+5)
-#define PUSH_KEY   (0+31)
-#define USB2SD_NRST(32+29)
-#define USB2SD_PWR (96+13)
+#define ESC_KEY(0+19)
+#define LCD_PWR(0+5)
+#define PUSH_KEY   (0+31)
 /* -*/
 /* -- PSOC Resetcontroller Register defines -- */
 
@@ -46,6 +45,7 @@
 
 /* -- defines for RSTCTRL_CTRLREG  -- */
 #defineRSTCTRL_FORCE_PWR_NEN   0x0404
+#defineRSTCTRL_CAN_STB 0x4040
 
 #if defined(CONFIG_SPL_BUILD)
 /* TODO: check ram-timing ! */
@@ -107,10 +107,13 @@ void am33xx_spl_board_init(void)
&cmper->epwmss0clkctrl,
&cmper->epwmss1clkctrl,
&cmper->epwmss2clkctrl,
+   &cmper->lcdclkctrl,
+   &cmper->lcdcclkstctrl,
0
};
do_enable_clocks(clk_domains, clk_modules_kwbspecific, 1);
-
+   /* setup LCD-Pixel Clock */
+   writel(0x2, CM_DPLL + 0x34);
/* power-OFF LCD-Display */
gpio_direction_output(LCD_PWR, 0);
 
@@ -121,7 +124,7 @@ void am33xx_spl_board_init(void)
/* power-ON  3V3 via Resetcontroller */
oldspeed = i2c_get_bus_speed();
if (i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC) >= 0) {
-   buf = RSTCTRL_FORCE_PWR_NEN;
+   buf = RSTCTRL_FORCE_PWR_NEN | RSTCTRL_CAN_STB;
i2c_write(RSTCTRL_ADDR, RSTCTRL_CTRLREG, 1,
  (uint8_t *)&buf, sizeof(buf));
i2c_set_bus_speed(oldspeed);
@@ -129,15 +132,6 @@ void am33xx_spl_board_init(void)
puts("ERROR: i2c_set_bus_speed failed! (turn on PWR_nEN)\n");
}
 
-#if defined(CONFIG_AM335X_USB0)
-   /* power on USB2SD Controller */
-   gpio_direction_output(USB2SD_PWR, 1);
-   mdelay(1);
-   /* give a reset Pulse to USB2SD Controller */
-   gpio_direction_output(USB2SD_NRST, 0);
-   mdelay(1);
-   gpio_set_value(USB2SD_NRST, 1);
-#endif
pmicsetup(0);
 }
 
@@ -166,7 +160,6 @@ int board_init(void)
 #ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
 {
-   const unsigned int ton  = 250;
const unsigned int toff = 1000;
unsigned int cnt  = 3;
unsigned short buf = 0x;
@@ -175,50 +168,77 @@ int board_late_init(void)
tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
   TPS65217_WLEDCTRL2, 0x32, 0xFF); /* 50% dimlevel */
 
-   if (gpio_get_value(KEY)) {
+   if (gpio_get_value(ESC_KEY)) {
do {
-   /* turn on light */
-   tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
-  TPS65217_WLEDCTRL1, 0x09, 0xFF);
-   mdelay(ton);
-   /* turn off light */
-   tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
-  TPS65217_WLEDCTRL1, 0x01, 0xFF);
+   lcd_position_cursor(1, 8);
+   switch (cnt) {
+   case 3:
+   lcd_puts(
+   "release ESC-KEY to enter SERVICE-mode.");
+   break;
+   case 2:
+   lcd_puts(
+   "release ESC-KEY to enter DIAGNOSE-mode.");
+   break;
+   case 1:
+   lcd_puts(
+   "release ESC-KEY to enter BOOT-mode.");
+   break;
+   }
mdelay(toff);
cnt--;
-   if (!gpio_get_value(KEY) &&
+ 

[U-Boot] [PATCH v2 15/24] board/BuR/tseries: Rework default-environment settings.

2015-02-03 Thread Hannes Petermaier
Due to several changes of the boot-process we've redesigned the default-
environment settings completly.

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 include/configs/tseries.h |   71 +
 1 file changed, 66 insertions(+), 5 deletions(-)

diff --git a/include/configs/tseries.h b/include/configs/tseries.h
index 8e073e0..a6c7d5f 100644
--- a/include/configs/tseries.h
+++ b/include/configs/tseries.h
@@ -94,8 +94,8 @@
 #define CONFIG_SYS_NAND_U_BOOT_OFFS0x8
 #endif /* CONFIG_NAND */
 
-/* Always 128 KiB env size */
-#define CONFIG_ENV_SIZE(128 << 10)
+/* Always 64 KiB env size */
+#define CONFIG_ENV_SIZE(64 << 10)
 
 #ifdef CONFIG_NAND
 #define NANDARGS \
@@ -118,7 +118,32 @@
 
 #ifdef CONFIG_MMC
 #define MMCARGS \
-   "silent=1\0"
+"dtbdev=mmc\0" \
+"dtbpart=0:1\0" \
+"logo0=ext4load mmc 0:3 ${loadaddr} /PPTLogo.bmp.gz && " \
+   "bmp display ${loadaddr} 0 0\0" \
+"logo1=ext4load mmc 0:1 ${loadaddr} /PPTLogo.bmp.gz && " \
+   "bmp display ${loadaddr} 0 0\0" \
+"mmcroot0=setenv bootargs ${optargs} console=${console}\0" \
+"mmcroot1=setenv bootargs ${optargs} console=${console} root=/dev/mmcblk0p2 " \
+   "rootfstype=ext4\0" \
+"mmcboot0=echo booting Updatesystem from mmc (ext4-fs) ...; " \
+   "ext4load mmc 0:1 ${loadaddr} /${kernel}; " \
+   "ext4load mmc 0:1 ${ramaddr} /${ramdisk}; " \
+   "run mmcroot0; bootz ${loadaddr} ${ramaddr} ${dtbaddr};\0" \
+"mmcboot1=echo booting PPT-OS from mmc (ext4-fs) ...; " \
+   "ext4load mmc 0:2 ${loadaddr} /boot/${kernel}; " \
+   "run mmcroot1; bootz ${loadaddr} - ${dtbaddr};\0" \
+"defboot=run logo0 || run logo1; " \
+   "ext4load mmc 0:2 ${loadaddr} /boot/PPTImage.md5 && run mmcboot1; " \
+   "ext4load mmc 0:1 ${dtbaddr} /$dtb && run mmcboot0; " \
+   "run ramboot; run usbupdate;\0" \
+"bootlimit=1\0" \
+"altbootcmd=run logo0 || run logo1; " \
+   "run mmcboot0;\0" \
+"upduboot=dhcp; " \
+   "tftp ${loadaddr} MLO && mmc write ${loadaddr} 100 100; " \
+   "tftp ${loadaddr} u-boot.img && mmc write ${loadaddr} 300 400;\0"
 #else
 #define MMCARGS ""
 #endif /* CONFIG_MMC */
@@ -126,14 +151,50 @@
 #ifndef CONFIG_SPL_BUILD
 #define CONFIG_EXTRA_ENV_SETTINGS \
 BUR_COMMON_ENV \
+"verify=no\0" \
 "autoload=0\0" \
+"dtb=bur-ppt-ts30.dtb\0" \
+"dtbaddr=0x8010\0" \
+"loadaddr=0x8020\0" \
+"ramaddr=0x80A0\0" \
+"kernel=zImage\0" \
+"ramdisk=rootfs.cpio.uboot\0" \
+"console=ttyO0,115200n8\0" \
+"optargs=consoleblank=0 quiet lpj=1191936 panic=2\0" \
+"nfsroot=/tftpboot/tseries/rootfs-small\0" \
+"nfsopts=nolock\0" \
+"ramargs=setenv bootargs ${optargs} console=${console} root=/dev/ram0\0" \
+"netargs=setenv bootargs console=${console} " \
+   "${optargs} " \
+   "root=/dev/nfs " \
+   "nfsroot=${serverip}:${nfsroot},${nfsopts} rw " \
+   "ip=dhcp\0" \
+"netboot=echo Booting from network ...; " \
+   "dhcp; " \
+   "tftp ${loadaddr} ${kernel}; " \
+   "tftp ${dtbaddr} ${dtb}; " \
+   "run netargs; " \
+   "bootz ${loadaddr} - ${dtbaddr}\0" \
+"ramboot=echo Booting from network into RAM ...; "\
+   "if dhcp; then; " \
+   "tftp ${loadaddr} ${kernel}; " \
+   "tftp ${ramaddr} ${ramdisk}; " \
+   "if ext4load ${dtbdev} ${dtbpart} ${dtbaddr} /${dtb}; " \
+   "then; else tftp ${dtbaddr} ${dtb}; fi;" \
+   "run mmcroot0; " \
+   "bootz ${loadaddr} ${ramaddr} ${dtbaddr}; fi;\0" \
+"usbupdate=echo Updating UBOOT from USB-Stick ...; " \
+   "usb start && fatload usb 0 0x8000 updateubootusb.img && source\0" \
+"netupdate=echo Updating UBOOT from Network (TFTP) ...; " \
+   "setenv autoload 0; " \
+   "dhcp && tftp 0x8000 updateUBOOT.img && source;\0" \
 NANDARGS \
 MMCARGS
 #endif /* !CONFIG_SPL_BUILD*/
 
 #define CONFIG_BOOTCOMMAND \
-   "run mmcboot1;"
-#define CONFIG_BOOTDELAY   1 /* TODO: für release auf 0 setzen */
+   "run defboot;"
+#define CONFIG_BOOTDELAY   0
 
 #ifdef CONFIG_NAND
 /*
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 18/24] board/BuR/kwb: Support booting Linux

2015-02-03 Thread Hannes Petermaier
For series testing purpose we need to boot some linux, therefore we enable
the needed features

- bootz
- devicetree

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 include/configs/kwb.h |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/configs/kwb.h b/include/configs/kwb.h
index 2c59fbd..7989f4b 100644
--- a/include/configs/kwb.h
+++ b/include/configs/kwb.h
@@ -88,10 +88,17 @@
 #define CONFIG_BOOTDELAY   1 /* TODO: für release auf 0 setzen */
 
 /* undefine command which we not need here */
-#undef CONFIG_BOOTM_LINUX
 #undef CONFIG_BOOTM_NETBSD
 #undef CONFIG_BOOTM_PLAN9
 #undef CONFIG_BOOTM_RTEMS
+#undef CONFIG_CMD_CRC32
+
+/* Support both device trees and ATAGs. */
+#define CONFIG_OF_LIBFDT
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
+#define CONFIG_CMD_BOOTZ
 
 /* USB configuration */
 #define CONFIG_USB_MUSB_DSPS
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 19/24] board/BuR/kwb: Redesign default-environment

2015-02-03 Thread Hannes Petermaier
Due to several changes in the boot-process we do a complete redesign of the
default environment.

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 include/configs/kwb.h |   81 +++--
 1 file changed, 45 insertions(+), 36 deletions(-)

diff --git a/include/configs/kwb.h b/include/configs/kwb.h
index 7989f4b..dd30df2 100644
--- a/include/configs/kwb.h
+++ b/include/configs/kwb.h
@@ -43,49 +43,58 @@
 #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
 #define CONFIG_SPL_MMC_SUPPORT
 
-#undef CONFIG_SPL_OS_BOOT
-#ifdef CONFIG_SPL_OS_BOOT
-#define CONFIG_SYS_SPL_ARGS_ADDR   0x80F8
-
-/* RAW SD card / eMMC */
-#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR0x900   /* address 
0x12 */
-#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0x80/* address 0x1 */
-#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0x80/* 64KiB */
-
-#endif /* CONFIG_SPL_OS_BOOT */
-
-/* Always 128 KiB env size */
-#define CONFIG_ENV_SIZE(128 << 10)
+/* Always 64 KiB env size */
+#define CONFIG_ENV_SIZE(64 << 10)
 
 #ifndef CONFIG_SPL_BUILD
 #define CONFIG_EXTRA_ENV_SETTINGS \
-   "autoload=0\0" \
-   "loadaddr=0x8010\0" \
-   "bootfile=arimg\0" \
-   "usbboot=echo Booting from USB-Stick ...; " \
-   "usb start; " \
-   "fatload usb 0 ${loadaddr} ${bootfile}; " \
-   "usb stop; " \
-   "go ${loadaddr};\0" \
-   "netboot=echo Booting from network ...; " \
-   "setenv autoload 0; " \
-   "dhcp; " \
-   "tftp ${loadaddr} arimg; " \
-   "go ${loadaddr}\0" \
-   "usbupdate=echo Updating UBOOT from USB-Stick ...; " \
-   "usb start; " \
-   "fatload usb 0 0x8000 updateubootusb.img; " \
-   "source;\0" \
-   "netupdate=echo Updating UBOOT from Network (TFTP) ...; " \
-   "setenv autoload 0; " \
-   "dhcp;" \
-   "tftp 0x8000 updateUBOOT.img;" \
-   "source;\0"
+BUR_COMMON_ENV \
+"vx_romfsbase=0x800E\0" \
+"vx_romfssize=0x2\0" \
+"vx_memtop=0x8FBEF000\0" \
+"loadromfs=mmc read ${vx_romfsbase} 700 100\0" \
+"autoload=0\0" \
+"loadaddr=0x8010\0" \
+"logoaddr=0x8200\0" \
+"defaultARlen=0x8000\0" \
+"loaddefaultAR=mmc read ${loadaddr} 800 ${defaultARlen}\0" \
+"defaultAR=run loadromfs; run loaddefaultAR; go ${loadaddr}\0" \
+"logo0=fatload mmc 0:1 ${logoaddr} SYSTEM/ADDON/Bootlogo/Bootlogo.bmp.gz && " \
+   "bmp display ${logoaddr} 0 0\0" \
+"logo1=fatload mmc 0:1 ${logoaddr} SYSTEM/BASE/Bootlogo/Bootlogo.bmp.gz && " \
+   "bmp display ${logoaddr} 0 0\0" \
+"mmcboot=echo booting AR from eMMC-flash ...; "\
+   "run logo0 || run logo1; " \
+   "run loadromfs; " \
+   "fatload mmc 0:1 ${loadaddr} arimg && go ${loadaddr}; " \
+   "run defaultAR;\0" \
+"netboot=echo booting AR from network ...; " \
+   "run loadromfs; " \
+   "tftp ${loadaddr} arimg && go ${loadaddr}; " \
+   "puts 'networkboot failed!';\0" \
+"usbupdate=echo updating u-boot from usb ...; " \
+   "usb start; " \
+   "fatload usb 0 0x8000 updateubootusb.img && source; " \
+   "puts 'usbupdate failed!'\0" \
+"netscript=echo running script from network (tftp) ...; " \
+   "tftp 0x8000 netscript.img && source; " \
+   "puts 'netscript load failed!'\0" \
+"netupdate=tftp ${loadddr} MLO && mmc write ${loadaddr} 100 100; " \
+   "tftp ${loadaddr} u-boot.img && mmc write ${loadaddr} 300 300\0" \
+"netupdatedefaultAR=echo updating defaultAR from network (tftp) ...; " \
+   "if tftp 0x8010 arimg.bin; " \
+   "then mmc write 0x8010 800 ${defaultARlen}; " \
+   "else setcurs 1 8; puts 'defAR update failed (tftp)!'; fi;\0" \
+"netupdateROMFS=echo updating romfs from network (tftp) ...; " \
+   "if tftp 0x8010 romfs.bin; " \
+   "then mmc write 0x8010 700 100; " \
+   "else setcurs 1 8; puts 'romfs update failed (tftp)!'; fi;\0"
+
 #endif /* !CONFIG_SPL_BUILD*/
 
 #define CONFIG_BOOTCOMMAND \
"run usbupdate;"
-#define CONFIG_BOOTDELAY   1 /* TODO: für release auf 0 setzen */
+#define CONFIG_BOOTDELAY   0
 
 /* undefine command which we not need here */
 #undef CONFIG_BOOTM_NETBSD
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 20/24] board/BuR/kwb: Form a bootline for vxWorks

2015-02-03 Thread Hannes Petermaier
vxWorks needs several parameters which are set by the bootloader und his
environment. So we form a vxWorks bootline and pass the result to vxWorks on
a predefined address.

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 board/BuR/kwb/board.c |   30 ++
 1 file changed, 30 insertions(+)

diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c
index 30900bc..455f472 100644
--- a/board/BuR/kwb/board.c
+++ b/board/BuR/kwb/board.c
@@ -47,6 +47,12 @@
 #defineRSTCTRL_FORCE_PWR_NEN   0x0404
 #defineRSTCTRL_CAN_STB 0x4040
 
+#define VXWORKS_BOOTLINE   0x80001100
+#define DEFAULT_BOOTLINE   "cpsw(0,0):pme/vxWorks"
+#define VXWORKS_USER   "u=vxWorksFTP pw=vxWorks tn=vxtarget"
+
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_SPL_BUILD)
 /* TODO: check ram-timing ! */
 static const struct ddr_data ddr3_data = {
@@ -248,6 +254,30 @@ int board_late_init(void)
} else {
puts("ERROR: i2c_set_bus_speed failed! (scratchregister)\n");
}
+   /* setup vxworks bootline */
+   char *vxworksbootline = (char *)VXWORKS_BOOTLINE;
+
+   /* setup default IP, in case if there is nothing in environment */
+   if (!getenv("ipaddr")) {
+   setenv("ipaddr", "192.168.60.1");
+   setenv("netmask", "255.255.255.0");
+   setenv("serverip", "192.168.60.254");
+   setenv("gatewayip", "192.168.60.254");
+   puts("net: had no IP! made default setup.\n");
+   }
+
+   sprintf(vxworksbootline,
+   "%s h=%s e=%s:%s g=%s %s o=0x%08x;0x%08x;0x%08x;0x%08x",
+   DEFAULT_BOOTLINE,
+   getenv("serverip"),
+   getenv("ipaddr"), getenv("netmask"),
+   getenv("gatewayip"),
+   VXWORKS_USER,
+   (unsigned int) gd->fb_base-0x20,
+   (u32)getenv_ulong("vx_memtop", 16, gd->fb_base-0x20),
+   (u32)getenv_ulong("vx_romfsbase", 16, 0),
+   (u32)getenv_ulong("vx_romfssize", 16, 0));
+
/*
 * reset VBAR registers to its reset location, VxWorks 6.9.3.2 does
 * expect that vectors are there, original u-boot moves them to _start
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 14/24] board/BuR/common: Add support for displaying BMP on LCD

2015-02-03 Thread Hannes Petermaier
Customer wants to display some logo very quickly after power on, so we support
from now loading a compressed bmp.gz to the screen.

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 include/configs/bur_am335x_common.h |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/configs/bur_am335x_common.h 
b/include/configs/bur_am335x_common.h
index cd15c6c..29c1567 100644
--- a/include/configs/bur_am335x_common.h
+++ b/include/configs/bur_am335x_common.h
@@ -30,6 +30,13 @@
 "setenv stdout nc;setenv stdin nc;setenv stderr nc\0"
 
 #define CONFIG_CMD_TIME
+#define CONFIG_VIDEO_BMP_GZIP
+#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (1366*767*4)
+#define CONFIG_CMD_UNZIP
+#define CONFIG_CMD_BMP
+#define CONFIG_BMP_24BMP
+#define CONFIG_BMP_32BPP
+
 #define CONFIG_SYS_GENERIC_BOARD
 
 #define CONFIG_AM33XX
@@ -130,7 +137,7 @@
  * we are on so we do not need to rely on the command prompt.  We set a
  * console baudrate of 115200 and use the default baud rate table.
  */
-#define CONFIG_SYS_MALLOC_LEN  (1024 << 10)
+#define CONFIG_SYS_MALLOC_LEN  (5120 << 10)
 #define CONFIG_SYS_HUSH_PARSER
 #define CONFIG_SYS_PROMPT  "U-Boot (BuR V2.0)# "
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 16/24] board/BuR/tseries: cosmetic changes

2015-02-03 Thread Hannes Petermaier
remove unnary '#define  ETHLED_ORANGE   (96+16) /* GPIO3_16 */'

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 board/BuR/tseries/board.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/board/BuR/tseries/board.c b/board/BuR/tseries/board.c
index a1c6887..9402aa4 100644
--- a/board/BuR/tseries/board.c
+++ b/board/BuR/tseries/board.c
@@ -34,10 +34,8 @@ DECLARE_GLOBAL_DATA_PTR;
 
 /* --*/
 /* -- defines for GPIO -- */
-#defineETHLED_ORANGE   (96+16) /* GPIO3_16 */
 #defineREPSWITCH   (0+20)  /* GPIO0_20 */
 
-
 #if defined(CONFIG_SPL_BUILD)
 /* TODO: check ram-timing ! */
 static const struct ddr_data ddr3_data = {
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 10/24] board/BuR/tseries: Chg pinmux - use free NAND Pins in non NAND-config as GPIO

2015-02-03 Thread Hannes Petermaier
On boards were we have no NAND-flash soldered, we want to use those free pins
as regular gpio.

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 board/BuR/tseries/mux.c |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/board/BuR/tseries/mux.c b/board/BuR/tseries/mux.c
index 36ee04c..330429a 100644
--- a/board/BuR/tseries/mux.c
+++ b/board/BuR/tseries/mux.c
@@ -168,7 +168,14 @@ static struct module_pin_mux gpIOs[] = {
{OFFSET(mcasp0_axr0),  (MODE(7) | PULLUDDIS) },
/* GPIO3_17 (MCASP0_AHCLKR) - ETH2_LEDY */
{OFFSET(mcasp0_ahclkr), (MODE(7) | PULLUDDIS) },
-
+#ifndef CONFIG_NAND
+   /* GPIO2_3 - NAND_OE */
+   {OFFSET(gpmc_oen_ren), (MODE(7) | PULLDOWN_EN | RXACTIVE)},
+   /* GPIO2_4 - NAND_WEN */
+   {OFFSET(gpmc_wen), (MODE(7) | PULLDOWN_EN | RXACTIVE)},
+   /* GPIO2_5 - NAND_BE_CLE */
+   {OFFSET(gpmc_be0n_cle), (MODE(7) | PULLDOWN_EN | RXACTIVE)},
+#endif
{-1},
 };
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 12/24] board/BuR/common: Introduce Network Console and common environment for it

2015-02-03 Thread Hannes Petermaier
It is often necessary to "break in" into boards bootloader commandline if
something fails or even for development purposes some parameters have to be
changed.

So we enable u-boot's CONFIG_NETCONSOLE feature.
We also modify Networksettings to apply with this new use-case.

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 include/configs/bur_am335x_common.h |   23 +--
 include/configs/tseries.h   |   33 -
 2 files changed, 25 insertions(+), 31 deletions(-)

diff --git a/include/configs/bur_am335x_common.h 
b/include/configs/bur_am335x_common.h
index e9d5d01..d7ea1c9 100644
--- a/include/configs/bur_am335x_common.h
+++ b/include/configs/bur_am335x_common.h
@@ -12,6 +12,23 @@
 #ifndef __BUR_AM335X_COMMON_H__
 #define __BUR_AM335X_COMMON_H__
 /* - */
+#define BUR_COMMON_ENV \
+"defaultip=192.168.60.253\0" \
+"defaultsip=192.168.60.254\0" \
+"netconsole=echo switching to network console ...; " \
+"if dhcp; then " \
+"setenv ncip ${serverip}; else " \
+"setenv ncip 192.168.60.254; " \
+"setenv serverip 192.168.60.254; " \
+"setenv gatewayip 192.168.60.254; " \
+"setenv ipaddr 192.168.60.1; " \
+"fi;" \
+"setenv netdisplay0 '" \
+"setcurs 1 9; puts myip; setcurs 10 9; puts ${ipaddr};" \
+"setcurs 1 10;puts serverip; setcurs 10 10; puts ${serverip}\;'" \
+"run netdisplay0; " \
+"setenv stdout nc;setenv stdin nc;setenv stderr nc\0"
+
 #define CONFIG_SYS_GENERIC_BOARD
 
 #define CONFIG_AM33XX
@@ -47,7 +64,7 @@
 #define CONFIG_BOOTP_SEND_HOSTNAME
 #define CONFIG_BOOTP_GATEWAY
 #define CONFIG_BOOTP_SUBNETMASK
-#define CONFIG_NET_RETRY_COUNT 4
+#define CONFIG_NET_RETRY_COUNT 2
 #define CONFIG_CMD_PING
 #define CONFIG_DRIVER_TI_CPSW  /* Driver for IP block */
 #define CONFIG_MII /* Required in net/eth.c */
@@ -57,7 +74,9 @@
 #define CONFIG_SPL_NET_SUPPORT
 #define CONFIG_SPL_ENV_SUPPORT /* used for a fetching MAC-Address */
 #define CONFIG_SPL_NET_VCI_STRING  "AM335x U-Boot SPL"
-
+/* Network console */
+#define CONFIG_NETCONSOLE  1
+#define CONFIG_BOOTP_MAY_FAIL  /* if we don't have DHCP environment */
 /*
  * SPL related defines.  The Public RAM memory map the ROM defines the
  * area between 0x402F0400 and 0x4030B800 as a download area and
diff --git a/include/configs/tseries.h b/include/configs/tseries.h
index 986db3f..8e073e0 100644
--- a/include/configs/tseries.h
+++ b/include/configs/tseries.h
@@ -125,35 +125,10 @@
 
 #ifndef CONFIG_SPL_BUILD
 #define CONFIG_EXTRA_ENV_SETTINGS \
-   "autoload=0\0" \
-   "loadaddr=0x8020\0" \
-   "bootfile=zImage\0" \
-   "console=ttyO0,115200n8\0" \
-   "optargs=\0" \
-   "rootpath=/tftpboot/tseries/rootfs-small\0" \
-   "nfsopts=nolock\0" \
-   "netargs=setenv bootargs console=${console} " \
-   "${optargs} " \
-   "root=/dev/nfs " \
-   "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
-   "ip=dhcp\0" \
-   "netboot=echo Booting from network ...; " \
-   "setenv autoload no; " \
-   "dhcp; " \
-   "tftp ${loadaddr} ${bootfile}; " \
-   "run netargs; " \
-   "bootm ${loadaddr}\0" \
-   "usbupdate=echo Updating UBOOT from USB-Stick ...; " \
-   "usb start; " \
-   "fatload usb 0 0x8000 updateubootusb.img; " \
-   "source;\0" \
-   "netupdate=echo Updating UBOOT from Network (TFTP) ...; " \
-   "setenv autoload 0; " \
-   "dhcp;" \
-   "tftp 0x8000 updateUBOOT.img;" \
-   "source;\0" \
-   NANDARGS \
-   MMCARGS
+BUR_COMMON_ENV \
+"autoload=0\0" \
+NANDARGS \
+MMCARGS
 #endif /* !CONFIG_SPL_BUILD*/
 
 #define CONFIG_BOOTCOMMAND \
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 09/24] board/BuR/tseries: Change pinmux for GPIO2_28 from GPIO to PWM-Timeroutput

2015-02-03 Thread Hannes Petermaier
>From now we use this pin for the Brightness regulation from LED-Backlight.

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 board/BuR/tseries/mux.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/board/BuR/tseries/mux.c b/board/BuR/tseries/mux.c
index 0ba25ee..36ee04c 100644
--- a/board/BuR/tseries/mux.c
+++ b/board/BuR/tseries/mux.c
@@ -131,9 +131,9 @@ static struct module_pin_mux gpIOs[] = {
{OFFSET(spi0_cs1),  (MODE(7) | PULLUDEN | PULLUP_EN | RXACTIVE)},
/* TIMER5   (MMC0_DAT3) - TIMER5 (Buzzer) */
{OFFSET(mmc0_dat3), (MODE(3) | PULLUDEN | RXACTIVE)},
-   /* TIMER6   (MMC0_DAT2) - PWM_BACK_3V3, later used as MODE3 for PWM */
-   {OFFSET(mmc0_dat2), (MODE(7) | PULLUDEN | RXACTIVE)},
-   /* GPIO2_27 (MMC0_DAT1)  - MII_nNAND */
+   /* TIMER6   (MMC0_DAT2) - PWM_BACK_3V3 */
+   {OFFSET(mmc0_dat2), (MODE(3) | PULLUDEN | RXACTIVE)},
+   /* GPIO2_28 (MMC0_DAT1)  - MII_nNAND */
{OFFSET(mmc0_dat1), (MODE(7) | PULLUDEN | RXACTIVE)},
/* GPIO2_29 (MMC0_DAT0)  - NAND_1n0 */
{OFFSET(mmc0_dat0), (MODE(7) | PULLUDEN | RXACTIVE)},
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 11/24] board/BuR/tseries: Chg Pinmux - enable UART1 pins

2015-02-03 Thread Hannes Petermaier
Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 board/BuR/tseries/mux.c |8 
 1 file changed, 8 insertions(+)

diff --git a/board/BuR/tseries/mux.c b/board/BuR/tseries/mux.c
index 330429a..2c87a63 100644
--- a/board/BuR/tseries/mux.c
+++ b/board/BuR/tseries/mux.c
@@ -25,6 +25,13 @@ static struct module_pin_mux uart0_pin_mux[] = {
{OFFSET(uart0_txd), (MODE(0) | PULLUDEN)},
{-1},
 };
+static struct module_pin_mux uart1_pin_mux[] = {
+   /* UART0_RXD */
+   {OFFSET(uart1_rxd), (MODE(0) | PULLUDEN | PULLUP_EN | RXACTIVE)},
+   /* UART0_TXD */
+   {OFFSET(uart1_txd), (MODE(0) | PULLUDEN)},
+   {-1},
+};
 #ifdef CONFIG_MMC
 static struct module_pin_mux mmc1_pin_mux[] = {
{OFFSET(gpmc_ad7), (MODE(1) | RXACTIVE | PULLUP_EN)},   /* MMC1_DAT7 */
@@ -236,5 +243,6 @@ void enable_board_pin_mux(void)
 #endif
configure_module_pin_mux(spi0_pin_mux);
configure_module_pin_mux(lcd_pin_mux);
+   configure_module_pin_mux(uart1_pin_mux);
configure_module_pin_mux(gpIOs);
 }
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 13/24] board/BuR/common: Enable CONFIG_CMD_TIME

2015-02-03 Thread Hannes Petermaier
time measurement of u-boot commands is needed very often during development.
We add this feature until development is completed. Maybe forever :)

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 include/configs/bur_am335x_common.h |1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/bur_am335x_common.h 
b/include/configs/bur_am335x_common.h
index d7ea1c9..cd15c6c 100644
--- a/include/configs/bur_am335x_common.h
+++ b/include/configs/bur_am335x_common.h
@@ -29,6 +29,7 @@
 "run netdisplay0; " \
 "setenv stdout nc;setenv stdin nc;setenv stderr nc\0"
 
+#define CONFIG_CMD_TIME
 #define CONFIG_SYS_GENERIC_BOARD
 
 #define CONFIG_AM33XX
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 08/24] board/BuR/tseries: Enable EXT4 support

2015-02-03 Thread Hannes Petermaier
Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 include/configs/tseries.h |4 
 1 file changed, 4 insertions(+)

diff --git a/include/configs/tseries.h b/include/configs/tseries.h
index 7fd0a00..986db3f 100644
--- a/include/configs/tseries.h
+++ b/include/configs/tseries.h
@@ -275,6 +275,10 @@
 #define CONFIG_DOS_PARTITION
 #define CONFIG_CMD_FAT
 #define CONFIG_FAT_WRITE
+#define CONFIG_FS_EXT4
+#define CONFIG_EXT4_WRITE
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_EXT4_WRITE
 #define CONFIG_CMD_FS_GENERIC
 #endif /* CONFIG_MMC, ... */
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 07/24] board/BuR/tseries: Enable U-Boot BOOTCOUNT feature

2015-02-03 Thread Hannes Petermaier
Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 include/configs/tseries.h |4 
 1 file changed, 4 insertions(+)

diff --git a/include/configs/tseries.h b/include/configs/tseries.h
index 368f588..7fd0a00 100644
--- a/include/configs/tseries.h
+++ b/include/configs/tseries.h
@@ -23,6 +23,10 @@
 #define CONFIG_HW_WATCHDOG
 #define CONFIG_OMAP_WATCHDOG
 #define CONFIG_SPL_WATCHDOG_SUPPORT
+/* Bootcount using the RTC block */
+#define CONFIG_SYS_BOOTCOUNT_ADDR  0x44E3E000
+#define CONFIG_BOOTCOUNT_LIMIT
+#define CONFIG_BOOTCOUNT_AM33XX
 /* Clock Defines */
 #define V_OSCK 2600  /* Clock output from T2 */
 #define V_SCLK (V_OSCK)
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 05/24] board/BuR/common: try to setup cpsw mac-address from the devicetree

2015-02-03 Thread Hannes Petermaier
since we have a dtb blob programmed on the board we try to setup the cpsw
interface with the programmed mac.
If this method fails, we fall back to the device-fuses.

Signed-off-by: Hannes Petermaier 

---
Changes for V2: None
---
 board/BuR/common/common.c |   25 +++--
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
index 7d0e05c..18e1520 100644
--- a/board/BuR/common/common.c
+++ b/board/BuR/common/common.c
@@ -591,9 +591,9 @@ static struct cpsw_platform_data cpsw_data = {
 int board_eth_init(bd_t *bis)
 {
int rv = 0;
-   uint8_t mac_addr[6];
+   char mac_addr[6];
+   const char *mac = 0;
uint32_t mac_hi, mac_lo;
-
/* try reading mac address from efuse */
mac_lo = readl(&cdev->macid0l);
mac_hi = readl(&cdev->macid0h);
@@ -607,14 +607,19 @@ int board_eth_init(bd_t *bis)
 #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \
(defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD))
if (!getenv("ethaddr")) {
-   printf(" not set. Validating first E-fuse MAC ... ");
-
-   if (is_valid_ether_addr(mac_addr)) {
-   printf("using: %02X:%02X:%02X:%02X:%02X:%02X.\n",
-  mac_addr[0], mac_addr[1], mac_addr[2],
-  mac_addr[3], mac_addr[4], mac_addr[5]
-   );
-   eth_setenv_enetaddr("ethaddr", mac_addr);
+   #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_USE_FDT)
+   printf(" not set. trying DTB ... ");
+   mac = dtbmacaddr(0);
+   #endif
+   if (!mac) {
+   printf(" not set. validating E-fuse MAC ... ");
+   if (is_valid_ether_addr((const u8 *)mac_addr))
+   mac = (const char *)mac_addr;
+   }
+
+   if (mac) {
+   printf("using: %pM on ", mac);
+   eth_setenv_enetaddr("ethaddr", (const u8 *)mac);
}
}
writel(MII_MODE_ENABLE, &cdev->miisel);
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 02/24] common/lcd: Add command for setting cursor within lcd-console

2015-02-03 Thread Hannes Petermaier
Sometimes we do not want redirect u-boot's console to screen but anyway we want
write out some status information out of a u-boot script to the display.

To define the specific position of the string to be written, we have to set
the cursor with "setcurs" before writing.

Signed-off-by: Hannes Petermaier 

---
Changes for V2:
  - more understandable commit-message
  - moved code from lcd.c into lcd_console.c
---
 common/lcd_console.c |   21 +
 1 file changed, 21 insertions(+)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index 74c388a..5363232 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -209,3 +209,24 @@ void lcd_printf(const char *fmt, ...)
 
lcd_puts(buf);
 }
+
+static int do_lcd_setcursor(cmd_tbl_t *cmdtp, int flag, int argc,
+   char *const argv[])
+{
+   unsigned int col, row;
+
+   if (argc != 3)
+   return CMD_RET_USAGE;
+
+   col = simple_strtoul(argv[1], NULL, 10);
+   row = simple_strtoul(argv[2], NULL, 10);
+   lcd_position_cursor(col, row);
+
+   return 0;
+}
+
+U_BOOT_CMD(
+   setcurs, 3, 1,  do_lcd_setcursor,
+   "set cursor position within screen",
+   "  in character"
+);
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   3   >