All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture
@ 2015-01-30 13:25 Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 02/21] common/lcd: Add command for setting cursor within lcd-framework Hannes Petermaier
                   ` (19 more replies)
  0 siblings, 20 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

Often on boards exists a circuit which switches power on/off to LCD display.
Due to the need of limiting the in-rush current the output voltage from this
circuit rises "slowly", so it is necessary to wait a bit (VCC ramp up time)
before starting output on LCD-pins.
This time is specified in <n> ms within the panel-settings, called "pup_delay"

Further some LCDs need a couple of frames to stabilize the image on it.
We have now the possibility to wait some time after starting output on LCD.
This time is also specified in <n> ms within panel-settings, called "pon_delay"

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 drivers/video/am335x-fb.c |   13 ++++++++-----
 drivers/video/am335x-fb.h |    9 +++++++--
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/video/am335x-fb.c b/drivers/video/am335x-fb.c
index ab98941..6f95649 100644
--- a/drivers/video/am335x-fb.c
+++ b/drivers/video/am335x-fb.c
@@ -127,6 +127,12 @@ int am335xfb_init(struct am335x_lcdpanel *panel)
 	memset((void *)gd->fb_base, 0, 0x20);
 	*(unsigned int *)gd->fb_base = 0x4000;
 
+	/* turn ON display through powercontrol function if accessible */
+	if (0 != panel->panel_power_ctrl)
+		panel->panel_power_ctrl(1);
+
+	debug("am335x-fb: wait for stable power ...\n");
+	mdelay(panel->pup_delay);
 	lcdhw->clkc_enable = LCD_CORECLKEN | LCD_LIDDCLKEN | LCD_DMACLKEN;
 	lcdhw->raster_ctrl = 0;
 	lcdhw->ctrl = LCD_CLK_DIVISOR(panel->pxl_clk_div) | LCD_RASTER_MODE;
@@ -159,11 +165,8 @@ int am335xfb_init(struct am335x_lcdpanel *panel)
 
 	gd->fb_base += 0x20;	/* point fb behind palette */
 
-	/* turn ON display through powercontrol function if accessible */
-	if (0 != panel->panel_power_ctrl) {
-		mdelay(panel->pon_delay);
-		panel->panel_power_ctrl(1);
-	}
+	debug("am335x-fb: waiting picture to be stable.\n.");
+	mdelay(panel->pon_delay);
 
 	return 0;
 }
diff --git a/drivers/video/am335x-fb.h b/drivers/video/am335x-fb.h
index 8a0b131..7f799d1 100644
--- a/drivers/video/am335x-fb.h
+++ b/drivers/video/am335x-fb.h
@@ -55,9 +55,14 @@ struct am335x_lcdpanel {
 	unsigned int	vsw;		/* Vertical Sync Pulse Width */
 	unsigned int	pxl_clk_div;	/* Pixel clock divider*/
 	unsigned int	pol;		/* polarity of sync, clock signals */
+	unsigned int	pup_delay;	/*
+					 * time in ms after power on to
+					 * initialization of lcd-controller
+					 * (VCC ramp up time)
+					 */
 	unsigned int	pon_delay;	/*
-					 * time in ms for turning on lcd after
-					 * initializing lcd-controller
+					 * time in ms after initialization of
+					 * lcd-controller (pic stabilization)
 					 */
 	void (*panel_power_ctrl)(int);	/* fp for power on/off display */
 };
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 02/21] common/lcd: Add command for setting cursor within lcd-framework
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-02-01 14:48   ` Nikita Kiryanov
  2015-01-30 13:25 ` [U-Boot] [PATCH 03/21] common/lcd: Add command for writing to lcd-display Hannes Petermaier
                   ` (18 subsequent siblings)
  19 siblings, 1 reply; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

We need this function if we want to make some outputs i.e position the writing
cursor out of u-boot scripts.

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 common/lcd.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/common/lcd.c b/common/lcd.c
index cc34b8a..f418da9 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -279,12 +279,33 @@ static int do_lcd_clear(cmd_tbl_t *cmdtp, int flag, int argc,
 	return 0;
 }
 
+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(
 	cls,	1,	1,	do_lcd_clear,
 	"clear screen",
 	""
 );
 
+U_BOOT_CMD(
+	setcurs, 3,	1,	do_lcd_setcursor,
+	"sets cursor for 'puts'",
+	"    <col> <row> in character"
+);
+
 /*----------------------------------------------------------------------*/
 
 static int lcd_init(void *lcdbase)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 03/21] common/lcd: Add command for writing to lcd-display
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 02/21] common/lcd: Add command for setting cursor within lcd-framework Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-02-01 14:53   ` Nikita Kiryanov
  2015-01-30 13:25 ` [U-Boot] [PATCH 04/21] board/BuR/common: Take usage of am335x LCD-Display Hannes Petermaier
                   ` (17 subsequent siblings)
  19 siblings, 1 reply; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

We need this function if we want to make some outputs out of u-boot scripts.

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 common/lcd.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/common/lcd.c b/common/lcd.c
index f418da9..755388f 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -279,6 +279,17 @@ static int do_lcd_clear(cmd_tbl_t *cmdtp, int flag, int argc,
 	return 0;
 }
 
+static int do_lcd_puts(cmd_tbl_t *cmdtp, int flag, int argc,
+		       char *const argv[])
+{
+	if (argc != 2)
+		return CMD_RET_USAGE;
+
+	lcd_puts(argv[1]);
+
+	return 0;
+}
+
 static int do_lcd_setcursor(cmd_tbl_t *cmdtp, int flag, int argc,
 			    char *const argv[])
 {
@@ -306,6 +317,12 @@ U_BOOT_CMD(
 	"    <col> <row> in character"
 );
 
+U_BOOT_CMD(
+	puts,	2,	1,	do_lcd_puts,
+	"print string on lcd-framebuffer",
+	"    <string>"
+);
+
 /*----------------------------------------------------------------------*/
 
 static int lcd_init(void *lcdbase)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 04/21] board/BuR/common: Take usage of am335x LCD-Display
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 02/21] common/lcd: Add command for setting cursor within lcd-framework Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 03/21] common/lcd: Add command for writing to lcd-display Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 05/21] board/BuR/common: try to setup cpsw mac-address from the devicetree Hannes Petermaier
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

From now we use the am335x lcd driver and setup a display with displaying
a summary screen to the lcd.
Values are taken from environment and or devicetree blob.

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 board/BuR/common/bur_common.h |    4 +
 board/BuR/common/common.c     |  417 ++++++++++++++++++++++++++++++++++++++++-
 board/BuR/tseries/board.c     |   52 +++--
 include/configs/tseries.h     |    8 +
 include/power/tps65217.h      |    1 +
 5 files changed, 463 insertions(+), 19 deletions(-)

diff --git a/board/BuR/common/bur_common.h b/board/BuR/common/bur_common.h
index 15225b0..39afbba 100644
--- a/board/BuR/common/bur_common.h
+++ b/board/BuR/common/bur_common.h
@@ -12,6 +12,10 @@
 #ifndef _BUR_COMMON_H_
 #define _BUR_COMMON_H_
 
+#include <../../../drivers/video/am335x-fb.h>
+
+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);
diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
index 25cbe62..7d0e05c 100644
--- a/board/BuR/common/common.c
+++ b/board/BuR/common/common.c
@@ -9,7 +9,7 @@
  * SPDX-License-Identifier:	GPL-2.0+
  *
  */
-
+#include <version.h>
 #include <common.h>
 #include <errno.h>
 #include <spl.h>
@@ -26,10 +26,421 @@
 #include <miiphy.h>
 #include <cpsw.h>
 #include <power/tps65217.h>
+#include <lcd.h>
+#include <fs.h>
+#ifdef CONFIG_USE_FDT
+  #include <fdt_support.h>
+#endif
 #include "bur_common.h"
+#include "../../../drivers/video/am335x-fb.h"
 
 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 PATHTIM "/panel/display-timings/default"
+  #define PATHINF "/panel/panel-info"
+#endif
 /* --------------------------------------------------------------------------*/
+#if defined(CONFIG_LCD) && defined(CONFIG_AM335X_LCD) && \
+	!defined(CONFIG_SPL_BUILD)
+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");
+		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");
+
+	/* calc. proper clk-divisor */
+	dtbprop = FDTPROP(dtbaddr, PATHTIM, "clock-frequency");
+	if (dtbprop != ~0UL)
+		pnltmp.pxl_clk_div = 192000000 / dtbprop;
+	else
+		pnltmp.pxl_clk_div = ~0UL;
+
+	/* check polarity of control-signals */
+	dtbprop = FDTPROP(dtbaddr, PATHTIM, "hsync-active");
+	if (dtbprop == 0)
+		pnltmp.pol |= HSYNC_INVERT;
+	dtbprop = FDTPROP(dtbaddr, PATHTIM, "vsync-active");
+	if (dtbprop == 0)
+		pnltmp.pol |= VSYNC_INVERT;
+	dtbprop = FDTPROP(dtbaddr, PATHINF, "sync-ctrl");
+	if (dtbprop == 1)
+		pnltmp.pol |= HSVS_CONTROL;
+	dtbprop = FDTPROP(dtbaddr, PATHINF, "sync-edge");
+	if (dtbprop == 1)
+		pnltmp.pol |= HSVS_RISEFALL;
+	dtbprop = FDTPROP(dtbaddr, PATHTIM, "pixelclk-active");
+	if (dtbprop == 0)
+		pnltmp.pol |= PXCLK_INVERT;
+	dtbprop = FDTPROP(dtbaddr, PATHTIM, "de-active");
+	if (dtbprop == 0)
+		pnltmp.pol |= DE_INVERT;
+#else
+	pnltmp.hactive = getenv_ulong("ds1_hactive", 10, ~0UL);
+	pnltmp.vactive = getenv_ulong("ds1_vactive", 10, ~0UL);
+	pnltmp.bpp = getenv_ulong("ds1_bpp", 10, ~0UL);
+	pnltmp.hfp = getenv_ulong("ds1_hfp", 10, ~0UL);
+	pnltmp.hbp = getenv_ulong("ds1_hbp", 10, ~0UL);
+	pnltmp.hsw = getenv_ulong("ds1_hsw", 10, ~0UL);
+	pnltmp.vfp = getenv_ulong("ds1_vfp", 10, ~0UL);
+	pnltmp.vbp = getenv_ulong("ds1_vbp", 10, ~0UL);
+	pnltmp.vsw = getenv_ulong("ds1_vsw", 10, ~0UL);
+	pnltmp.pxl_clk_div = getenv_ulong("ds1_pxlclkdiv", 10, ~0UL);
+	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);
+#endif
+	if (
+	   ~0UL == (pnltmp.hactive) ||
+	   ~0UL == (pnltmp.vactive) ||
+	   ~0UL == (pnltmp.bpp) ||
+	   ~0UL == (pnltmp.hfp) ||
+	   ~0UL == (pnltmp.hbp) ||
+	   ~0UL == (pnltmp.hsw) ||
+	   ~0UL == (pnltmp.vfp) ||
+	   ~0UL == (pnltmp.vbp) ||
+	   ~0UL == (pnltmp.vsw) ||
+	   ~0UL == (pnltmp.pxl_clk_div) ||
+	   ~0UL == (pnltmp.pol) ||
+	   ~0UL == (pnltmp.pup_delay) ||
+	   ~0UL == (pnltmp.pon_delay)
+	   ) {
+		puts("lcd-settings in env/dtb incomplete!\n");
+		printf("display-timings:\n"
+			"================\n"
+			"hactive: %d\n"
+			"vactive: %d\n"
+			"bpp    : %d\n"
+			"hfp    : %d\n"
+			"hbp    : %d\n"
+			"hsw    : %d\n"
+			"vfp    : %d\n"
+			"vbp    : %d\n"
+			"vsw    : %d\n"
+			"pxlclk : %d\n"
+			"pol    : 0x%08x\n"
+			"pondly : %d\n",
+			pnltmp.hactive, pnltmp.vactive, pnltmp.bpp,
+			pnltmp.hfp, pnltmp.hbp, pnltmp.hsw,
+			pnltmp.vfp, pnltmp.vbp, pnltmp.vsw,
+			pnltmp.pxl_clk_div, pnltmp.pol, pnltmp.pon_delay);
+
+		return -1;
+	}
+	debug("lcd-settings in env complete, taking over.\n");
+	memcpy((void *)panel,
+	       (void *)&pnltmp,
+	       sizeof(struct am335x_lcdpanel));
+
+	return 0;
+}
+
+#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);
+	loff_t dtbsize;
+
+	if (!dtbdev || !dtbdev) {
+		puts("load_devicetree: <dtbdev>/<dtbpart> missing.\n");
+		return -1;
+	}
+
+	if (fs_set_blk_dev(dtbdev, dtppart, FS_TYPE_EXT)) {
+		puts("load_devicetree: set_blk_dev failed.\n");
+		return -1;
+	}
+	if (dtbname && dtbaddr != ~0UL) {
+		if (fs_read(dtbname, dtbaddr, 0, 0, &dtbsize) == 0) {
+			gd->fdt_blob = (void *)dtbaddr;
+			gd->fdt_size = dtbsize;
+			debug("loaded %d bytes of dtb onto 0x%08x\n",
+			      (u32)dtbsize, dtbaddr);
+			return dtbsize;
+		}
+		puts("load_devicetree: load dtb failed,file does not exist!\n");
+	}
+
+	puts("load_devicetree: <dtb>/<dtbaddr> missing!\n");
+	return -1;
+}
+
+static const char *dtbmacaddr(u32 ifno)
+{
+	int node, len;
+	char enet[16];
+	const char *mac;
+	const char *path;
+	u32 dtbaddr = getenv_ulong("dtbaddr", 16, ~0UL);
+
+	if (dtbaddr == ~0UL) {
+		puts("dtbmacaddr: failed to get 'dtbaddr' from env!\n");
+		return NULL;
+	}
+
+	node = fdt_path_offset((void *)dtbaddr, "/aliases");
+	if (node < 0)
+		return NULL;
+
+	sprintf(enet, "ethernet%d", ifno);
+	path = fdt_getprop((void *)dtbaddr, node, enet, NULL);
+	if (!path) {
+		printf("no alias for %s\n", enet);
+		return NULL;
+	}
+
+	node = fdt_path_offset((void *)dtbaddr, path);
+	mac = fdt_getprop((void *)dtbaddr, node, "mac-address", &len);
+	if (mac && is_valid_ether_addr((u8 *)mac))
+		return mac;
+
+	return NULL;
+}
+
+static void br_summaryscreen_printdtb(char *prefix,
+				       char *name,
+				       char *suffix)
+{
+	u32 dtbaddr = getenv_ulong("dtbaddr", 16, ~0UL);
+	char buf[32] = { 0 };
+	const char *nodep = buf;
+	char *mac = 0;
+	int nodeoffset;
+	int len;
+
+	if (dtbaddr == ~0UL) {
+		puts("br_summaryscreen: failed to get 'dtbaddr' from env!\n");
+		return;
+	}
+
+	if (strcmp(name, "brmac1") == 0) {
+		mac = (char *)dtbmacaddr(0);
+		if (mac)
+			sprintf(buf, "%pM", mac);
+	} else if (strcmp(name, "brmac2") == 0) {
+		mac =  (char *)dtbmacaddr(1);
+		if (mac)
+			sprintf(buf, "%pM", mac);
+	} else {
+		nodeoffset = fdt_path_offset((void *)dtbaddr,
+					     "/factory-settings");
+		if (nodeoffset < 0) {
+			puts("no 'factory-settings' in dtb!\n");
+			return;
+		}
+		nodep = fdt_getprop((void *)dtbaddr, nodeoffset, name, &len);
+	}
+	if (nodep && strlen(nodep) > 1)
+		lcd_printf("%s %s %s", prefix, nodep, suffix);
+	else
+		lcd_printf("\n");
+}
+int ft_board_setup(void *blob, bd_t *bd)
+{
+	int nodeoffset;
+
+	nodeoffset = fdt_path_offset(blob, "/factory-settings");
+	if (nodeoffset < 0) {
+		puts("set bootloader version 'factory-settings' not in dtb!\n");
+		return -1;
+	}
+	if (fdt_setprop(blob, nodeoffset, "bl-version",
+			PLAIN_VERSION, strlen(PLAIN_VERSION)) != 0) {
+		puts("set bootloader version 'bl-version' prop. not in dtb!\n");
+		return -1;
+	}
+	return 0;
+}
+#else
+
+static void br_summaryscreen_printenv(char *prefix,
+				       char *name, char *altname,
+				       char *suffix)
+{
+	char *envval = getenv(name);
+	if (0 != envval) {
+		lcd_printf("%s %s %s", prefix, envval, suffix);
+	} else if (0 != altname) {
+		envval = getenv(altname);
+		if (0 != envval)
+			lcd_printf("%s %s %s", prefix, envval, suffix);
+	} else {
+		lcd_printf("\n");
+	}
+}
+#endif
+void br_summaryscreen(void)
+{
+#ifdef CONFIG_USE_FDT
+	br_summaryscreen_printdtb(" - B&R -", "order-no", "-\n");
+	br_summaryscreen_printdtb(" Serial/Rev :", "serial-no", " /");
+	br_summaryscreen_printdtb(" ", "hw-revision", "\n");
+	br_summaryscreen_printdtb(" MAC (IF1)  :", "brmac1", "\n");
+	br_summaryscreen_printdtb(" MAC (IF2)  :", "brmac2", "\n");
+	lcd_puts(" Bootloader : " PLAIN_VERSION "\n");
+	lcd_puts("\n");
+#else
+	br_summaryscreen_printenv(" - B&R -", "br_orderno", 0, "-\n");
+	br_summaryscreen_printenv(" Serial/Rev :", "br_serial", 0, "\n");
+	br_summaryscreen_printenv(" MAC (IF1)  :", "br_mac1", "ethaddr", "\n");
+	br_summaryscreen_printenv(" MAC (IF2)  :", "br_mac2", 0, "\n");
+	lcd_puts(" Bootloader : " PLAIN_VERSION "\n");
+	lcd_puts("\n");
+#endif
+}
+
+void lcdpower(int on)
+{
+	u32 pin, swval, i;
+#ifdef CONFIG_USE_FDT
+	u32 dtbaddr = getenv_ulong("dtbaddr", 16, ~0UL);
+
+	if (dtbaddr == ~0UL) {
+		puts("lcdpower: failed to get 'dtbaddr' from env!\n");
+		return;
+	}
+	pin = FDTPROP(dtbaddr, PATHINF, "pwrpin");
+#else
+	pin = getenv_ulong("ds1_pwr", 16, ~0UL);
+#endif
+	if (pin == ~0UL) {
+		puts("no pwrpin in dtb/env, cannot powerup display!\n");
+		return;
+	}
+
+	for (i = 0; i < 3; i++) {
+		if (pin != 0) {
+			swval = pin & 0x80 ? 0 : 1;
+			if (on)
+				gpio_direction_output(pin & 0x7F, swval);
+			else
+				gpio_direction_output(pin & 0x7F, !swval);
+
+			debug("switched pin %d to %d\n", pin & 0x7F, swval);
+		}
+		pin >>= 8;
+	}
+}
+
+vidinfo_t	panel_info = {
+		.vl_col = 1366,	/*
+				 * give full resolution for allocating enough
+				 * memory
+				 */
+		.vl_row = 768,
+		.vl_bpix = 5,
+		.priv = 0
+};
+
+void lcd_ctrl_init(void *lcdbase)
+{
+	struct am335x_lcdpanel lcd_panel;
+#ifdef CONFIG_USE_FDT
+	/* TODO: is there a better place to load the dtb ? */
+	load_devicetree();
+#endif
+	memset(&lcd_panel, 0, sizeof(struct am335x_lcdpanel));
+	if (load_lcdtiming(&lcd_panel) != 0)
+		return;
+
+	lcd_panel.panel_power_ctrl = &lcdpower;
+
+	if (0 != am335xfb_init(&lcd_panel))
+		printf("ERROR: failed to initialize video!");
+	/*
+	 * modifiy panel info to 'real' resolution, to operate correct with
+	 * lcd-framework.
+	 */
+	panel_info.vl_col = lcd_panel.hactive;
+	panel_info.vl_row = lcd_panel.vactive;
+
+	lcd_set_flush_dcache(1);
+}
+
+void lcd_enable(void)
+{
+#ifdef CONFIG_USE_FDT
+	u32 dtbaddr = getenv_ulong("dtbaddr", 16, ~0UL);
+
+	if (dtbaddr == ~0UL) {
+		puts("lcdpower: failed to get 'dtbaddr' from env!\n");
+		return;
+	}
+	unsigned int driver = FDTPROP(dtbaddr, PATHINF, "brightdrv");
+	unsigned int bright = FDTPROP(dtbaddr, PATHINF, "brightdef");
+	unsigned int pwmfrq = FDTPROP(dtbaddr, 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;
+
+	bright = bright != ~0UL ? bright : 50;
+
+	switch (driver) {
+	case 0:	/* PMIC LED-Driver */
+		/* brightness level */
+		tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
+				   TPS65217_WLEDCTRL2, bright, 0xFF);
+		/* turn on light */
+		tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
+				   TPS65217_WLEDCTRL1, 0x0A, 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;
+	}
+	br_summaryscreen();
+}
+#elif CONFIG_SPL_BUILD
+#else
+#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);
@@ -43,6 +454,7 @@ void blink(u32 blinks, u32 intervall, u32 pin)
 
 	gpio_set_value(pin, 0);
 }
+
 #ifdef CONFIG_SPL_BUILD
 void pmicsetup(u32 mpupll)
 {
@@ -115,6 +527,9 @@ void pmicsetup(u32 mpupll)
 
 	/* Set MPU Frequency to what we detected now that voltages are set */
 	do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);
+	/* Set PWR_EN bit in Status Register */
+	tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
+			   TPS65217_STATUS, TPS65217_PWR_OFF, TPS65217_PWR_OFF);
 }
 
 void set_uart_mux_conf(void)
diff --git a/board/BuR/tseries/board.c b/board/BuR/tseries/board.c
index c0178e7..66747eb 100644
--- a/board/BuR/tseries/board.c
+++ b/board/BuR/tseries/board.c
@@ -27,6 +27,7 @@
 #include <i2c.h>
 #include <power/tps65217.h>
 #include "../common/bur_common.h"
+#include <lcd.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -82,7 +83,6 @@ static const struct ctrl_ioregs ddr3_ioregs = {
 int spl_start_uboot(void)
 {
 	if (0 == gpio_get_value(REPSWITCH)) {
-		blink(5, 125, ETHLED_ORANGE);
 		mdelay(1000);
 		printf("SPL: entering u-boot instead kernel image.\n");
 		return 1;
@@ -96,7 +96,35 @@ static const struct dpll_params dpll_ddr3 = { 400, OSC-1, 1, -1, -1, -1, -1};
 
 void am33xx_spl_board_init(void)
 {
-	pmicsetup(1000);
+	struct cm_perpll *const cmper = (struct cm_perpll *)CM_PER;
+	/*struct cm_wkuppll *const cmwkup = (struct cm_wkuppll *)CM_WKUP;*/
+	struct cm_dpll *const cmdpll = (struct cm_dpll *)CM_DPLL;
+
+	/*
+	 * in TRM they write a reset value of 1 (=CLK_M_OSC) for the
+	 * CLKSEL_TIMER6_CLK Register, in fact reset value is 0, so we need set
+	 * the source of timer6 clk to CLK_M_OSC
+	 */
+	writel(0x01, &cmdpll->clktimer6clk);
+
+	/* enable additional clocks of modules which are accessed later */
+	u32 *const clk_domains[] = {
+		&cmper->lcdcclkstctrl,
+		0
+	};
+
+	u32 *const clk_modules_tsspecific[] = {
+		&cmper->lcdclkctrl,
+		&cmper->timer5clkctrl,
+		&cmper->timer6clkctrl,
+		0
+	};
+	do_enable_clocks(clk_domains, clk_modules_tsspecific, 1);
+
+	/* setup LCD-Pixel Clock */
+	writel(0x2, &cmdpll->clklcdcpixelclk);	/* clock comes from perPLL M2 */
+
+	pmicsetup(0);
 }
 
 const struct dpll_params *get_dpll_ddr_params(void)
@@ -126,24 +154,12 @@ int board_init(void)
 #ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
 {
-	gpio_direction_output(ETHLED_ORANGE, 0);
-
 	if (0 == gpio_get_value(REPSWITCH)) {
-		printf("\n\n\n"
-		"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
-		"!!!!!!! recovery switch activated !!!!!!!\n"
-		"!!!!!!!     running usbupdate     !!!!!!!\n"
-		"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n");
-		setenv("bootcmd", "sleep 2; run netupdate;");
+		lcd_position_cursor(1, 8);
+		lcd_puts(
+		"switching to network-console ...       ");
+		setenv("bootcmd", "run netconsole");
 	}
-
-	printf("turning on display power+backlight ... ");
-	tps65217_reg_write(TPS65217_PROT_LEVEL_NONE, TPS65217_WLEDCTRL1,
-			   0x09, TPS65217_MASK_ALL_BITS);	/* 200 Hz, ON */
-	tps65217_reg_write(TPS65217_PROT_LEVEL_NONE, TPS65217_WLEDCTRL2,
-			   0x62, TPS65217_MASK_ALL_BITS);	/* 100% */
-	printf("ok.\n");
-
 	return 0;
 }
 #endif /* CONFIG_BOARD_LATE_INIT */
diff --git a/include/configs/tseries.h b/include/configs/tseries.h
index 9a62070..9ad294f 100644
--- a/include/configs/tseries.h
+++ b/include/configs/tseries.h
@@ -14,6 +14,12 @@
 
 #include <configs/bur_am335x_common.h>
 /* ------------------------------------------------------------------------- */
+#define CONFIG_AM335X_LCD
+#define CONFIG_LCD
+#define CONFIG_LCD_NOSTDOUT
+#define CONFIG_SYS_WHITE_ON_BLACK
+#define LCD_BPP				LCD_COLOR32
+
 /* Clock Defines */
 #define V_OSCK				26000000  /* Clock output from T2 */
 #define V_SCLK				(V_OSCK)
@@ -22,6 +28,8 @@
 
 /* Support both device trees and ATAGs. */
 #define CONFIG_OF_LIBFDT
+#define CONFIG_USE_FDT			/* use fdt within board code */
+#define CONFIG_OF_BOARD_SETUP
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
diff --git a/include/power/tps65217.h b/include/power/tps65217.h
index 297c4cb..93cbe36 100644
--- a/include/power/tps65217.h
+++ b/include/power/tps65217.h
@@ -73,6 +73,7 @@ enum {
 #define TPS65217_LDO_VOLTAGE_OUT_1_8		0x06
 #define TPS65217_LDO_VOLTAGE_OUT_3_3		0x1F
 
+#define TPS65217_PWR_OFF			0x80
 #define TPS65217_PWR_SRC_USB_BITMASK		0x4
 #define TPS65217_PWR_SRC_AC_BITMASK		0x8
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 05/21] board/BuR/common: try to setup cpsw mac-address from the devicetree
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (2 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 04/21] board/BuR/common: Take usage of am335x LCD-Display Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 06/21] board/BuR/tseries: Enable HW-Watchdog Hannes Petermaier
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

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 <oe5hpm@oevsv.at>
---
 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("<ethaddr> 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("<ethaddr> not set. trying DTB ... ");
+		mac = dtbmacaddr(0);
+		#endif
+		if (!mac) {
+			printf("<ethaddr> 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.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 06/21] board/BuR/tseries: Enable HW-Watchdog
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (3 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 05/21] board/BuR/common: try to setup cpsw mac-address from the devicetree Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 07/21] board/BuR/tseries: Enable U-Boot BOOTCOUNT feature Hannes Petermaier
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 board/BuR/tseries/board.c |    4 ++++
 include/configs/tseries.h |    3 +++
 2 files changed, 7 insertions(+)

diff --git a/board/BuR/tseries/board.c b/board/BuR/tseries/board.c
index 66747eb..a1c6887 100644
--- a/board/BuR/tseries/board.c
+++ b/board/BuR/tseries/board.c
@@ -28,6 +28,7 @@
 #include <power/tps65217.h>
 #include "../common/bur_common.h"
 #include <lcd.h>
+#include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -144,6 +145,9 @@ void sdram_init(void)
 /* Basic board specific setup.  Pinmux has been handled already. */
 int board_init(void)
 {
+#if defined(CONFIG_HW_WATCHDOG)
+	hw_watchdog_init();
+#endif
 	gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 #ifdef CONFIG_NAND
 	gpmc_init();
diff --git a/include/configs/tseries.h b/include/configs/tseries.h
index 9ad294f..368f588 100644
--- a/include/configs/tseries.h
+++ b/include/configs/tseries.h
@@ -20,6 +20,9 @@
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define LCD_BPP				LCD_COLOR32
 
+#define CONFIG_HW_WATCHDOG
+#define CONFIG_OMAP_WATCHDOG
+#define CONFIG_SPL_WATCHDOG_SUPPORT
 /* Clock Defines */
 #define V_OSCK				26000000  /* Clock output from T2 */
 #define V_SCLK				(V_OSCK)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 07/21] board/BuR/tseries: Enable U-Boot BOOTCOUNT feature
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (4 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 06/21] board/BuR/tseries: Enable HW-Watchdog Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 08/21] board/BuR/tseries: Enable EXT4 support Hannes Petermaier
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 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				26000000  /* Clock output from T2 */
 #define V_SCLK				(V_OSCK)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 08/21] board/BuR/tseries: Enable EXT4 support
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (5 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 07/21] board/BuR/tseries: Enable U-Boot BOOTCOUNT feature Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 09/21] board/BuR/tseries: Change pinmux for GPIO2_28 from GPIO to PWM-Timeroutput Hannes Petermaier
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 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.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 09/21] board/BuR/tseries: Change pinmux for GPIO2_28 from GPIO to PWM-Timeroutput
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (6 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 08/21] board/BuR/tseries: Enable EXT4 support Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 10/21] board/BuR/tseries: Chg pinmux - use free NAND Pins in non NAND-config as GPIO Hannes Petermaier
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

From now we use this pin for the Brightness regulation from LED-Backlight.

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 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.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 10/21] board/BuR/tseries: Chg pinmux - use free NAND Pins in non NAND-config as GPIO
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (7 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 09/21] board/BuR/tseries: Change pinmux for GPIO2_28 from GPIO to PWM-Timeroutput Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 11/21] board/BuR/tseries: Chg Pinmux - enable UART1 pins Hannes Petermaier
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

On boards were we have no NAND-flash soldered, we want to use those free pins
as regular gpio.

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 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.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 11/21] board/BuR/tseries: Chg Pinmux - enable UART1 pins
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (8 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 10/21] board/BuR/tseries: Chg pinmux - use free NAND Pins in non NAND-config as GPIO Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 12/21] board/BuR/common: Introduce Network Console and common environment for it Hannes Petermaier
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 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.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 12/21] board/BuR/common: Introduce Network Console and common environment for it
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (9 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 11/21] board/BuR/tseries: Chg Pinmux - enable UART1 pins Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 13/21] board/BuR/common: Enable CONFIG_CMD_TIME Hannes Petermaier
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

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 <oe5hpm@oevsv.at>
---
 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=0x80200000\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 0x80000000 updateubootusb.img; " \
-		"source;\0" \
-	"netupdate=echo Updating UBOOT from Network (TFTP) ...; " \
-		"setenv autoload 0; " \
-		"dhcp;" \
-		"tftp 0x80000000 updateUBOOT.img;" \
-		"source;\0" \
-	NANDARGS \
-	MMCARGS
+BUR_COMMON_ENV \
+"autoload=0\0" \
+NANDARGS \
+MMCARGS
 #endif /* !CONFIG_SPL_BUILD*/
 
 #define CONFIG_BOOTCOMMAND \
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 13/21] board/BuR/common: Enable CONFIG_CMD_TIME
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (10 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 12/21] board/BuR/common: Introduce Network Console and common environment for it Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 14/21] board/BuR/common: Add support for displaying BMP on LCD Hannes Petermaier
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

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 <oe5hpm@oevsv.at>
---
 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.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 14/21] board/BuR/common: Add support for displaying BMP on LCD
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (11 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 13/21] board/BuR/common: Enable CONFIG_CMD_TIME Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 15/21] board/BuR/tseries: Rework default-environment settings Hannes Petermaier
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

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 <oe5hpm@oevsv.at>
---
 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.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 15/21] board/BuR/tseries: Rework default-environment settings.
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (12 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 14/21] board/BuR/common: Add support for displaying BMP on LCD Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 16/21] board/BuR/tseries: cosmetic changes Hannes Petermaier
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

Due to several changes of the boot-process we've redesigned the default-
environment settings completly.

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 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_OFFS	0x80000
 #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=0x80100000\0" \
+"loadaddr=0x80200000\0" \
+"ramaddr=0x80A00000\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 0x80000000 updateubootusb.img && source\0" \
+"netupdate=echo Updating UBOOT from Network (TFTP) ...; " \
+	"setenv autoload 0; " \
+	"dhcp && tftp 0x80000000 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.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 16/21] board/BuR/tseries: cosmetic changes
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (13 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 15/21] board/BuR/tseries: Rework default-environment settings Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 17/21] board/BuR/kwb: switch to board HW-Rev3 Hannes Petermaier
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

remove unnary '#define	ETHLED_ORANGE	(96+16)	/* GPIO3_16 */'

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 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 -- */
-#define	ETHLED_ORANGE	(96+16)	/* GPIO3_16 */
 #define	REPSWITCH	(0+20)	/* GPIO0_20 */
 
-
 #if defined(CONFIG_SPL_BUILD)
 /* TODO: check ram-timing ! */
 static const struct ddr_data ddr3_data = {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 17/21] board/BuR/kwb: switch to board HW-Rev3
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (14 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 16/21] board/BuR/tseries: cosmetic changes Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 18/21] board/BuR/kwb: Support booting Linux Hannes Petermaier
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

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 <oe5hpm@oevsv.at>
---
 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 <i2c.h>
 #include <power/tps65217.h>
 #include "../common/bur_common.h"
+#include <lcd.h>
 
 /* -------------------------------------------------------------------------*/
 /* -- 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  -- */
 #define	RSTCTRL_FORCE_PWR_NEN			0x0404
+#define	RSTCTRL_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 = 0xAAAA;
@@ -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) &&
+			if (!gpio_get_value(ESC_KEY) &&
+			    gpio_get_value(PUSH_KEY) && 2 == cnt) {
+				lcd_position_cursor(1, 8);
+				lcd_puts(
+				"switching to network-console ...       ");
+				setenv("bootcmd", "run netconsole");
+				cnt = 4;
+				break;
+			} else if (!gpio_get_value(ESC_KEY) &&
 			    gpio_get_value(PUSH_KEY) && 1 == cnt) {
-				puts("updating from USB ...\n");
+				lcd_position_cursor(1, 8);
+				lcd_puts(
+				"updating U-BOOT from USB ...           ");
 				setenv("bootcmd", "run usbupdate");
+				cnt = 4;
 				break;
-			} else if (!gpio_get_value(KEY)) {
+			} else if ((!gpio_get_value(ESC_KEY) &&
+				    gpio_get_value(PUSH_KEY) && cnt == 0) ||
+				    (gpio_get_value(ESC_KEY) &&
+				    gpio_get_value(PUSH_KEY) && cnt == 0)) {
+				lcd_position_cursor(1, 8);
+				lcd_puts(
+				"starting script from network ...      ");
+				setenv("bootcmd", "run netscript");
+				cnt = 4;
+				break;
+			} else if (!gpio_get_value(ESC_KEY)) {
 				break;
 			}
 		} while (cnt);
 	}
 
+	lcd_position_cursor(1, 8);
 	switch (cnt) {
 	case 0:
-		puts("3 blinks ... entering BOOT mode.\n");
+		lcd_puts("entering BOOT-mode.                    ");
+		setenv("bootcmd", "run defaultAR");
 		buf = 0x0000;
 		break;
 	case 1:
-		puts("2 blinks ... entering DIAGNOSE mode.\n");
+		lcd_puts("entering DIAGNOSE-mode.                ");
 		buf = 0x0F0F;
 		break;
 	case 2:
-		puts("1 blinks ... entering SERVICE mode.\n");
+		lcd_puts("entering SERVICE mode.                 ");
 		buf = 0xB4B4;
 		break;
 	case 3:
-		puts("0 blinks ... entering RUN mode.\n");
+		lcd_puts("loading OS...                          ");
 		buf = 0x0404;
 		break;
 	}
-	mdelay(ton);
-	/* turn on light */
-	tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
-			   TPS65217_WLEDCTRL1, 0x09, 0xFF);
 	/* write bootinfo into scratchregister of resetcontroller */
 	oldspeed = i2c_get_bus_speed();
 	if (i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC) >= 0) {
diff --git a/board/BuR/kwb/mux.c b/board/BuR/kwb/mux.c
index ecb2e7a..9f89b5e 100644
--- a/board/BuR/kwb/mux.c
+++ b/board/BuR/kwb/mux.c
@@ -16,23 +16,17 @@
 #include <asm/io.h>
 #include <i2c.h>
 
-static struct module_pin_mux usb0_pin_mux[] = {
-	{OFFSET(usb0_id), (MODE(0) | RXACTIVE)},
-	/* USB0 DrvBus Receiver disable (from romcode 0x20) */
-	{OFFSET(usb0_drvvbus), (MODE(0))},
-	/* USB1 DrvBus as GPIO due to HW-Workaround */
-	{OFFSET(usb1_drvvbus), (MODE(7))},
-	{-1},
-};
-static struct module_pin_mux spi1_pin_mux[] = {
+static struct module_pin_mux spi0_pin_mux[] = {
 	/* SPI1_SCLK */
-	{OFFSET(mcasp0_aclkx), MODE(3) | PULLUDEN |             RXACTIVE},
+	{OFFSET(spi0_sclk),	MODE(0) | PULLUDEN | RXACTIVE},
 	/* SPI1_D0 */
-	{OFFSET(mcasp0_fsx),   MODE(3) | PULLUDEN |		RXACTIVE},
+	{OFFSET(spi0_d0),	MODE(0) | PULLUDEN | RXACTIVE},
 	/* SPI1_D1 */
-	{OFFSET(mcasp0_axr0),  MODE(3) | PULLUDEN |             RXACTIVE},
+	{OFFSET(spi0_d1),	MODE(0) | PULLUDEN | RXACTIVE},
 	/* SPI1_CS0 */
-	{OFFSET(mcasp0_ahclkr), MODE(3) | PULLUDEN | PULLUP_EN | RXACTIVE},
+	{OFFSET(spi0_cs0),	MODE(0) | PULLUDEN | PULLUP_EN | RXACTIVE},
+	/* SPI1_CS1 */
+	{OFFSET(spi0_cs1),	MODE(0) | PULLUDEN | PULLUP_EN | RXACTIVE},
 	{-1},
 };
 
@@ -53,30 +47,34 @@ static struct module_pin_mux dcan1_pin_mux[] = {
 };
 
 static struct module_pin_mux gpios[] = {
-	/* GPIO0_29 (RMII1_REFCLK) - eMMC nRST */
-	{OFFSET(rmii1_refclk), (MODE(7) | PULLUDDIS)},
-	/* GPIO0_4  (SPI D1) - TA602 */
-	{OFFSET(spi0_d1), (MODE(7) | PULLUDDIS | RXACTIVE)},
-	/* GPIO0_5  (SPI CS0) - DISPLAY_ON_OFF */
-	{OFFSET(spi0_cs0), (MODE(7) | PULLUDDIS)},
 	/* GPIO0_7  (PWW0 OUT) - CAN TERM */
 	{OFFSET(ecap0_in_pwm0_out), (MODE(7) | PULLUDDIS | RXACTIVE)},
-	/* GPIO0_19 (DMA_INTR0) - CLKOUT SYS */
-	{OFFSET(xdma_event_intr0), (MODE(7) | RXACTIVE)},
-	/* GPIO0_20 (DMA_INTR1) - SPI1 nCS1 */
-	{OFFSET(xdma_event_intr1), (MODE(7) | PULLUDEN | PULLUP_EN)},
+	/* GPIO0_19 (DMA_INTR0) - TA602 */
+	{OFFSET(xdma_event_intr0), (MODE(7) | PULLUDDIS | RXACTIVE)},
+	/* GPIO0_20 (DMA_INTR1) - SPI0 nCS1 */
+	{OFFSET(xdma_event_intr1), (MODE(7) | PULLUDDIS | RXACTIVE)},
+	/* GPIO0_29 (RMII1_REFCLK) - eMMC nRST */
+	{OFFSET(rmii1_refclk), (MODE(7) | PULLUDDIS)},
 	/* GPIO0_30 (GPMC_WAIT0) - TA601 */
 	{OFFSET(gpmc_wait0), (MODE(7) | PULLUDDIS | RXACTIVE)},
 	/* GPIO0_31 (GPMC_nWP) - SW601 PushButton */
 	{OFFSET(gpmc_wpn), (MODE(7) | PULLUDDIS | RXACTIVE)},
 	/* GPIO1_28 (GPMC_nWE) - FRAM_nWP */
 	{OFFSET(gpmc_be1n), (MODE(7) | PULLUDDIS)},
+	/* GPIO1_29 (gpmc_csn0) - MMC nRST */
+	{OFFSET(gpmc_csn0), (MODE(7) | PULLUDDIS)},
 	/* GPIO2_0  (GPMC_nCS3)	- VBAT_OK */
 	{OFFSET(gpmc_csn3), (MODE(7) | PULLUDDIS | RXACTIVE) },
 	/* GPIO2_2  (GPMC_nADV_ALE) - DCOK */
 	{OFFSET(gpmc_advn_ale), (MODE(7) | PULLUDDIS | RXACTIVE)},
 	/* GPIO2_4  (GPMC_nWE) - TST_BAST */
 	{OFFSET(gpmc_wen), (MODE(7) | PULLUDDIS)},
+	/* GPIO2_5  (gpmc_be0n_cle) - DISPLAY_ON_OFF */
+	{OFFSET(gpmc_be0n_cle), (MODE(7) | PULLUDDIS)},
+	/* GPIO3_16 (mcasp0_axr0) - ETH-LED green */
+	{OFFSET(mcasp0_axr0), (MODE(7) | PULLUDDIS | RXACTIVE)},
+	/* GPIO3_17 (mcasp0_ahclkr) - CAN_STB */
+	{OFFSET(mcasp0_ahclkr), (MODE(7) | PULLUDDIS | RXACTIVE)},
 	/* GPIO3_18 (MCASP0_ACLKR) - SW601 CNTup, mapped to Counter eQEB0A_in */
 	{OFFSET(mcasp0_aclkr), (MODE(1) | PULLUDDIS | RXACTIVE)},
 	/* GPIO3_19 (MCASP0_FSR) - SW601 CNTdown, mapped to Counter eQEB0B_in */
@@ -126,6 +124,10 @@ static struct module_pin_mux mii1_pin_mux[] = {
 };
 
 static struct module_pin_mux mmc1_pin_mux[] = {
+	{OFFSET(gpmc_ad7), (MODE(1) | RXACTIVE | PULLUP_EN)},	/* MMC1_DAT7 */
+	{OFFSET(gpmc_ad6), (MODE(1) | RXACTIVE | PULLUP_EN)},	/* MMC1_DAT6 */
+	{OFFSET(gpmc_ad5), (MODE(1) | RXACTIVE | PULLUP_EN)},	/* MMC1_DAT5 */
+	{OFFSET(gpmc_ad4), (MODE(1) | RXACTIVE | PULLUP_EN)},	/* MMC1_DAT4 */
 	{OFFSET(gpmc_ad3), (MODE(1) | RXACTIVE | PULLUP_EN)},	/* MMC1_DAT3 */
 	{OFFSET(gpmc_ad2), (MODE(1) | RXACTIVE | PULLUP_EN)},	/* MMC1_DAT2 */
 	{OFFSET(gpmc_ad1), (MODE(1) | RXACTIVE | PULLUP_EN)},	/* MMC1_DAT1 */
@@ -187,8 +189,7 @@ void enable_board_pin_mux(void)
 {
 	configure_module_pin_mux(i2c0_pin_mux);
 	configure_module_pin_mux(mii1_pin_mux);
-	configure_module_pin_mux(usb0_pin_mux);
-	configure_module_pin_mux(spi1_pin_mux);
+	configure_module_pin_mux(spi0_pin_mux);
 	configure_module_pin_mux(dcan0_pin_mux);
 	configure_module_pin_mux(dcan1_pin_mux);
 	configure_module_pin_mux(mmc1_pin_mux);
diff --git a/include/configs/kwb.h b/include/configs/kwb.h
index 29b263f..2c59fbd 100644
--- a/include/configs/kwb.h
+++ b/include/configs/kwb.h
@@ -14,6 +14,11 @@
 
 #include <configs/bur_am335x_common.h>
 /* ------------------------------------------------------------------------- */
+#define CONFIG_AM335X_LCD
+#define CONFIG_LCD
+#define CONFIG_LCD_NOSTDOUT
+#define CONFIG_SYS_WHITE_ON_BLACK
+#define LCD_BPP				LCD_COLOR32
 /* Clock Defines */
 #define V_OSCK				26000000  /* Clock output from T2 */
 #define V_SCLK				(V_OSCK)
@@ -87,8 +92,6 @@
 #undef	CONFIG_BOOTM_NETBSD
 #undef	CONFIG_BOOTM_PLAN9
 #undef	CONFIG_BOOTM_RTEMS
-#undef	CONFIG_GZIP
-#undef	CONFIG_ZLIB
 
 /* USB configuration */
 #define CONFIG_USB_MUSB_DSPS
@@ -100,6 +103,8 @@
 #define CONFIG_MUSB_HOST
 #define CONFIG_AM335X_USB0
 #define CONFIG_AM335X_USB0_MODE	MUSB_HOST
+#define CONFIG_AM335X_USB1
+#define CONFIG_AM335X_USB1_MODE	MUSB_HOST
 
 #ifdef CONFIG_MUSB_HOST
 #define CONFIG_CMD_USB
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 18/21] board/BuR/kwb: Support booting Linux
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (15 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 17/21] board/BuR/kwb: switch to board HW-Rev3 Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 19/21] board/BuR/kwb: Redesign default-environment Hannes Petermaier
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

For series testing purpose we need to boot some linux, therefore we enable
the needed features

- bootz
- devicetree

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 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.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 19/21] board/BuR/kwb: Redesign default-environment
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (16 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 18/21] board/BuR/kwb: Support booting Linux Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 20/21] board/BuR/kwb: Form a bootline for vxWorks Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 21/21] board/BuR/kwb: Support modify bootcmd through reset-controller Hannes Petermaier
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

Due to several changes in the boot-process we do a complete redesign of the
default environment.

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 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		0x80F80000
-
-/* RAW SD card / eMMC */
-#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR	0x900	/* address 0x120000 */
-#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR	0x80	/* address 0x10000 */
-#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=0x80100000\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 0x80000000 updateubootusb.img; " \
-		"source;\0" \
-	"netupdate=echo Updating UBOOT from Network (TFTP) ...; " \
-		"setenv autoload 0; " \
-		"dhcp;" \
-		"tftp 0x80000000 updateUBOOT.img;" \
-		"source;\0"
+BUR_COMMON_ENV \
+"vx_romfsbase=0x800E0000\0" \
+"vx_romfssize=0x20000\0" \
+"vx_memtop=0x8FBEF000\0" \
+"loadromfs=mmc read ${vx_romfsbase} 700 100\0" \
+"autoload=0\0" \
+"loadaddr=0x80100000\0" \
+"logoaddr=0x82000000\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 0x80000000 updateubootusb.img && source; " \
+	"puts 'usbupdate failed!'\0" \
+"netscript=echo running script from network (tftp) ...; " \
+	"tftp 0x80000000 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 0x80100000 arimg.bin; " \
+	"then mmc write 0x80100000 800 ${defaultARlen}; " \
+	"else setcurs 1 8; puts 'defAR update failed (tftp)!'; fi;\0" \
+"netupdateROMFS=echo updating romfs from network (tftp) ...; " \
+	"if tftp 0x80100000 romfs.bin; " \
+	"then mmc write 0x80100000 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.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 20/21] board/BuR/kwb: Form a bootline for vxWorks
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (17 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 19/21] board/BuR/kwb: Redesign default-environment Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  2015-01-30 13:25 ` [U-Boot] [PATCH 21/21] board/BuR/kwb: Support modify bootcmd through reset-controller Hannes Petermaier
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

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 <oe5hpm@oevsv.at>
---
 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 @@
 #define	RSTCTRL_FORCE_PWR_NEN			0x0404
 #define	RSTCTRL_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.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 21/21] board/BuR/kwb: Support modify bootcmd through reset-controller
  2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
                   ` (18 preceding siblings ...)
  2015-01-30 13:25 ` [U-Boot] [PATCH 20/21] board/BuR/kwb: Form a bootline for vxWorks Hannes Petermaier
@ 2015-01-30 13:25 ` Hannes Petermaier
  19 siblings, 0 replies; 27+ messages in thread
From: Hannes Petermaier @ 2015-01-30 13:25 UTC (permalink / raw)
  To: u-boot

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 <oe5hpm@oevsv.at>
---
 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 = 0xAAAA;
+	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.9.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 02/21] common/lcd: Add command for setting cursor within lcd-framework
  2015-01-30 13:25 ` [U-Boot] [PATCH 02/21] common/lcd: Add command for setting cursor within lcd-framework Hannes Petermaier
@ 2015-02-01 14:48   ` Nikita Kiryanov
  2015-02-02  7:32     ` Hannes Petermaier
  0 siblings, 1 reply; 27+ messages in thread
From: Nikita Kiryanov @ 2015-02-01 14:48 UTC (permalink / raw)
  To: u-boot

Hi Hannes,

On 01/30/2015 03:25 PM, Hannes Petermaier wrote:
> We need this function if we want to make some outputs i.e position the writing
> cursor out of u-boot scripts.

This commit message is inaccurate. Positioning the writing cursor is not in itself output.
Also, what is the use case for such a command?

>
> Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
> ---
>   common/lcd.c |   21 +++++++++++++++++++++
>   1 file changed, 21 insertions(+)
>
> diff --git a/common/lcd.c b/common/lcd.c
> index cc34b8a..f418da9 100644
> --- a/common/lcd.c
> +++ b/common/lcd.c
> @@ -279,12 +279,33 @@ static int do_lcd_clear(cmd_tbl_t *cmdtp, int flag, int argc,
>   	return 0;
>   }
>
> +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(
>   	cls,	1,	1,	do_lcd_clear,
>   	"clear screen",
>   	""
>   );
>
> +U_BOOT_CMD(
> +	setcurs, 3,	1,	do_lcd_setcursor,
> +	"sets cursor for 'puts'",
> +	"    <col> <row> in character"
> +);
> +

I think it would be better if the U_BOOT_CMD macros were adjacent to the functions they
use. Also, I think this command is better suited for the lcd_console.c file.

>   /*----------------------------------------------------------------------*/
>
>   static int lcd_init(void *lcdbase)
>

-- 
Regards,
Nikita Kiryanov

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 03/21] common/lcd: Add command for writing to lcd-display
  2015-01-30 13:25 ` [U-Boot] [PATCH 03/21] common/lcd: Add command for writing to lcd-display Hannes Petermaier
@ 2015-02-01 14:53   ` Nikita Kiryanov
  2015-02-02  7:37     ` Hannes Petermaier
  0 siblings, 1 reply; 27+ messages in thread
From: Nikita Kiryanov @ 2015-02-01 14:53 UTC (permalink / raw)
  To: u-boot

Hi Hannes,

On 01/30/2015 03:25 PM, Hannes Petermaier wrote:
> We need this function if we want to make some outputs out of u-boot scripts.
>

I think this commit message is missing information. What makes this necessary?
Why can't your script use regular echo commands with the lcd console enabled?

> Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
> ---
>   common/lcd.c |   17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
>
> diff --git a/common/lcd.c b/common/lcd.c
> index f418da9..755388f 100644
> --- a/common/lcd.c
> +++ b/common/lcd.c
> @@ -279,6 +279,17 @@ static int do_lcd_clear(cmd_tbl_t *cmdtp, int flag, int argc,
>   	return 0;
>   }
>
> +static int do_lcd_puts(cmd_tbl_t *cmdtp, int flag, int argc,
> +		       char *const argv[])
> +{
> +	if (argc != 2)
> +		return CMD_RET_USAGE;
> +
> +	lcd_puts(argv[1]);
> +
> +	return 0;
> +}
> +
>   static int do_lcd_setcursor(cmd_tbl_t *cmdtp, int flag, int argc,
>   			    char *const argv[])
>   {
> @@ -306,6 +317,12 @@ U_BOOT_CMD(
>   	"    <col> <row> in character"
>   );
>
> +U_BOOT_CMD(
> +	puts,	2,	1,	do_lcd_puts,

"puts" is too generic for an lcd specific function. I would expect to see something
with an "lcd" prefix. Also, this code seems better suited for lcd_console.c

> +	"print string on lcd-framebuffer",
> +	"    <string>"
> +);
> +
>   /*----------------------------------------------------------------------*/
>
>   static int lcd_init(void *lcdbase)
>

-- 
Regards,
Nikita Kiryanov

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 02/21] common/lcd: Add command for setting cursor within lcd-framework
  2015-02-01 14:48   ` Nikita Kiryanov
@ 2015-02-02  7:32     ` Hannes Petermaier
  2015-02-03 11:52       ` Nikita Kiryanov
  0 siblings, 1 reply; 27+ messages in thread
From: Hannes Petermaier @ 2015-02-02  7:32 UTC (permalink / raw)
  To: u-boot

"U-Boot" <u-boot-bounces@lists.denx.de> schrieb am 01.02.2015 15:48:51:

> From: Nikita Kiryanov <nikita@compulab.co.il>
> To: Hannes Petermaier <oe5hpm@oevsv.at>, u-boot at lists.denx.de
> Date: 01.02.2015 15:49
> Subject: Re: [U-Boot] [PATCH 02/21] common/lcd: Add command for setting 
cursor
> within lcd-framework
> Sent by: "U-Boot" <u-boot-bounces@lists.denx.de>
> 
> Hi Hannes,
Hi Nikita,

> 
> On 01/30/2015 03:25 PM, Hannes Petermaier wrote:
> > We need this function if we want to make some outputs i.e position the 
writing
> > cursor out of u-boot scripts.
> 
> This commit message is inaccurate. Positioning the writing cursor is not 
in 
> itself output.
> Also, what is the use case for such a command?
> 
I want to set the "cursor" on the screen to a specific position and write 
there something
with "puts".

For example:

setcurs 1 9;            sets the cursor to first column and 9th row
puts "Hello World!"     writes the text to the cursor.

> >
> > Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
> > ---
> >   common/lcd.c |   21 +++++++++++++++++++++
> >   1 file changed, 21 insertions(+)
> >
> > diff --git a/common/lcd.c b/common/lcd.c
> > index cc34b8a..f418da9 100644
> > --- a/common/lcd.c
> > +++ b/common/lcd.c
> > @@ -279,12 +279,33 @@ static int do_lcd_clear(cmd_tbl_t *cmdtp, int 
flag, int argc,
> >      return 0;
> >   }
> >
> > +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(
> >      cls,   1,   1,   do_lcd_clear,
> >      "clear screen",
> >      ""
> >   );
> >
> > +U_BOOT_CMD(
> > +   setcurs, 3,   1,   do_lcd_setcursor,
> > +   "sets cursor for 'puts'",
> > +   "    <col> <row> in character"
> > +);
> > +
> 
> I think it would be better if the U_BOOT_CMD macros were adjacent to the 
functions they
> use. Also, I think this command is better suited for the lcd_console.c 
file.

You're maybe right. Only thing for decission was, that existing commands 
are allready defined within
lcd.c. But i've no problem to move it. What do you say? let's move?

> 
> > 
/*----------------------------------------------------------------------*/
> >
> >   static int lcd_init(void *lcdbase)
> >
> 
> -- 
> Regards,
> Nikita Kiryanov

best regards,
Hannes

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 03/21] common/lcd: Add command for writing to lcd-display
  2015-02-01 14:53   ` Nikita Kiryanov
@ 2015-02-02  7:37     ` Hannes Petermaier
  2015-02-03 11:53       ` Nikita Kiryanov
  0 siblings, 1 reply; 27+ messages in thread
From: Hannes Petermaier @ 2015-02-02  7:37 UTC (permalink / raw)
  To: u-boot

> From: Nikita Kiryanov <nikita@compulab.co.il>
> To: Hannes Petermaier <oe5hpm@oevsv.at>, u-boot at lists.denx.de
> Date: 01.02.2015 15:53
> Subject: Re: [U-Boot] [PATCH 03/21] common/lcd: Add command for writing 
to lcd-display
> Sent by: "U-Boot" <u-boot-bounces@lists.denx.de>
> 
> Hi Hannes,
Hi Nikita,

> 
> On 01/30/2015 03:25 PM, Hannes Petermaier wrote:
> > We need this function if we want to make some outputs out of u-boot 
scripts.
> >
> 
> I think this commit message is missing information. What makes this 
necessary?
> Why can't your script use regular echo commands with the lcd console 
enabled?

Since i don't want that stdout is redirected to LCD (customer isn't 
interested in watching
all output of u-boot) i need something to write out of scripts to the 
screen.

For example we write of script in which mode we are booting, maybe also 
some default ip settings
in recovery mode.

> 
> > Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
> > ---
> >   common/lcd.c |   17 +++++++++++++++++
> >   1 file changed, 17 insertions(+)
> >
> > diff --git a/common/lcd.c b/common/lcd.c
> > index f418da9..755388f 100644
> > --- a/common/lcd.c
> > +++ b/common/lcd.c
> > @@ -279,6 +279,17 @@ static int do_lcd_clear(cmd_tbl_t *cmdtp, int 
flag, int argc,
> >      return 0;
> >   }
> >
> > +static int do_lcd_puts(cmd_tbl_t *cmdtp, int flag, int argc,
> > +             char *const argv[])
> > +{
> > +   if (argc != 2)
> > +      return CMD_RET_USAGE;
> > +
> > +   lcd_puts(argv[1]);
> > +
> > +   return 0;
> > +}
> > +
> >   static int do_lcd_setcursor(cmd_tbl_t *cmdtp, int flag, int argc,
> >                char *const argv[])
> >   {
> > @@ -306,6 +317,12 @@ U_BOOT_CMD(
> >      "    <col> <row> in character"
> >   );
> >
> > +U_BOOT_CMD(
> > +   puts,   2,   1,   do_lcd_puts,
> 
> "puts" is too generic for an lcd specific function. I would expect to 
see something
> with an "lcd" prefix. Also, this code seems better suited for 
lcd_console.c

Okay, thats right - should we rename it to "lcdputs" ?

Only thing for decission was, that existing commands are allready defined 
within
lcd.c. But i've no problem to move it. What do you say? let's move?

> 
> > +   "print string on lcd-framebuffer",
> > +   "    <string>"
> > +);
> > +
> > 
/*----------------------------------------------------------------------*/
> >
> >   static int lcd_init(void *lcdbase)
> >
> 
> -- 
> Regards,
> Nikita Kiryanov
best regards,
Hannes

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 02/21] common/lcd: Add command for setting cursor within lcd-framework
  2015-02-02  7:32     ` Hannes Petermaier
@ 2015-02-03 11:52       ` Nikita Kiryanov
  0 siblings, 0 replies; 27+ messages in thread
From: Nikita Kiryanov @ 2015-02-03 11:52 UTC (permalink / raw)
  To: u-boot

Hi Hannes,

On 02/02/2015 09:32 AM, Hannes Petermaier wrote:
> "U-Boot" <u-boot-bounces@lists.denx.de> schrieb am 01.02.2015 15:48:51:
>
>> From: Nikita Kiryanov <nikita@compulab.co.il>
>> To: Hannes Petermaier <oe5hpm@oevsv.at>, u-boot at lists.denx.de
>> Date: 01.02.2015 15:49
>> Subject: Re: [U-Boot] [PATCH 02/21] common/lcd: Add command for setting
> cursor
>> within lcd-framework
>> Sent by: "U-Boot" <u-boot-bounces@lists.denx.de>
>>
>> Hi Hannes,
> Hi Nikita,
>
>>
>> On 01/30/2015 03:25 PM, Hannes Petermaier wrote:
>>> We need this function if we want to make some outputs i.e position the
> writing
>>> cursor out of u-boot scripts.
>>
>> This commit message is inaccurate. Positioning the writing cursor is not
> in
>> itself output.
>> Also, what is the use case for such a command?
>>
> I want to set the "cursor" on the screen to a specific position and write
> there something
> with "puts".
>
> For example:
>
> setcurs 1 9;            sets the cursor to first column and 9th row
> puts "Hello World!"     writes the text to the cursor.

Alright... So setcurs does not output anything, just prepares us to do output.
I think that's how the commit message should be phrased.

>
>>>
>>> Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
>>> ---
>>>    common/lcd.c |   21 +++++++++++++++++++++
>>>    1 file changed, 21 insertions(+)
>>>
>>> diff --git a/common/lcd.c b/common/lcd.c
>>> index cc34b8a..f418da9 100644
>>> --- a/common/lcd.c
>>> +++ b/common/lcd.c
>>> @@ -279,12 +279,33 @@ static int do_lcd_clear(cmd_tbl_t *cmdtp, int
> flag, int argc,
>>>       return 0;
>>>    }
>>>
>>> +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(
>>>       cls,   1,   1,   do_lcd_clear,
>>>       "clear screen",
>>>       ""
>>>    );
>>>
>>> +U_BOOT_CMD(
>>> +   setcurs, 3,   1,   do_lcd_setcursor,
>>> +   "sets cursor for 'puts'",

Another thing: this function is not really limited to working with puts. It
can do preparation for any other command that outputs to console. I recommend
rewriting the description string to not mention it, maybe something along the
lines of "set cursor on the screen".

>>> +   "    <col> <row> in character"
>>> +);
>>> +
>>
>> I think it would be better if the U_BOOT_CMD macros were adjacent to the
> functions they
>> use. Also, I think this command is better suited for the lcd_console.c
> file.
>
> You're maybe right. Only thing for decission was, that existing commands
> are allready defined within
> lcd.c.

That's ok; we should place code where it's most relevant, and your command
is related to lcd console functionality.

> But i've no problem to move it. What do you say? let's move?

Yes, please move it to lcd_console.c

-- 
Regards,
Nikita Kiryanov

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [U-Boot] [PATCH 03/21] common/lcd: Add command for writing to lcd-display
  2015-02-02  7:37     ` Hannes Petermaier
@ 2015-02-03 11:53       ` Nikita Kiryanov
  0 siblings, 0 replies; 27+ messages in thread
From: Nikita Kiryanov @ 2015-02-03 11:53 UTC (permalink / raw)
  To: u-boot

Hi Hannes,

On 02/02/2015 09:37 AM, Hannes Petermaier wrote:
>> From: Nikita Kiryanov <nikita@compulab.co.il>
>> To: Hannes Petermaier <oe5hpm@oevsv.at>, u-boot at lists.denx.de
>> Date: 01.02.2015 15:53
>> Subject: Re: [U-Boot] [PATCH 03/21] common/lcd: Add command for writing
> to lcd-display
>> Sent by: "U-Boot" <u-boot-bounces@lists.denx.de>
>>
>> Hi Hannes,
> Hi Nikita,
>
>>
>> On 01/30/2015 03:25 PM, Hannes Petermaier wrote:
>>> We need this function if we want to make some outputs out of u-boot
> scripts.
>>>
>>
>> I think this commit message is missing information. What makes this
> necessary?
>> Why can't your script use regular echo commands with the lcd console
> enabled?
>
> Since i don't want that stdout is redirected to LCD (customer isn't
> interested in watching
> all output of u-boot) i need something to write out of scripts to the
> screen.
>
> For example we write of script in which mode we are booting, maybe also
> some default ip settings
> in recovery mode.

Alright, then please explain in the commit message that this function is meant
to give user the option to output to lcd without enabling lcd console.

>
>>
>>> Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
>>> ---
>>>    common/lcd.c |   17 +++++++++++++++++
>>>    1 file changed, 17 insertions(+)
>>>
>>> diff --git a/common/lcd.c b/common/lcd.c
>>> index f418da9..755388f 100644
>>> --- a/common/lcd.c
>>> +++ b/common/lcd.c
>>> @@ -279,6 +279,17 @@ static int do_lcd_clear(cmd_tbl_t *cmdtp, int
> flag, int argc,
>>>       return 0;
>>>    }
>>>
>>> +static int do_lcd_puts(cmd_tbl_t *cmdtp, int flag, int argc,
>>> +             char *const argv[])
>>> +{
>>> +   if (argc != 2)
>>> +      return CMD_RET_USAGE;
>>> +
>>> +   lcd_puts(argv[1]);
>>> +
>>> +   return 0;
>>> +}
>>> +
>>>    static int do_lcd_setcursor(cmd_tbl_t *cmdtp, int flag, int argc,
>>>                 char *const argv[])
>>>    {
>>> @@ -306,6 +317,12 @@ U_BOOT_CMD(
>>>       "    <col> <row> in character"
>>>    );
>>>
>>> +U_BOOT_CMD(
>>> +   puts,   2,   1,   do_lcd_puts,
>>
>> "puts" is too generic for an lcd specific function. I would expect to
> see something
>> with an "lcd" prefix. Also, this code seems better suited for
> lcd_console.c
>
> Okay, thats right - should we rename it to "lcdputs" ?

That sounds better, yes.

>
> Only thing for decission was, that existing commands are allready defined
> within
> lcd.c.

That's ok; we should place code where it's most relevant, and your command
is related to lcd console functionality.

> But i've no problem to move it. What do you say? let's move?

Yes, please move it to lcd_console.c

-- 
Regards,
Nikita Kiryanov

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2015-02-03 11:53 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-30 13:25 [U-Boot] [PATCH 01/21] drivers/video/am335x-fb: Add possibility to wait for stable power/picture Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 02/21] common/lcd: Add command for setting cursor within lcd-framework Hannes Petermaier
2015-02-01 14:48   ` Nikita Kiryanov
2015-02-02  7:32     ` Hannes Petermaier
2015-02-03 11:52       ` Nikita Kiryanov
2015-01-30 13:25 ` [U-Boot] [PATCH 03/21] common/lcd: Add command for writing to lcd-display Hannes Petermaier
2015-02-01 14:53   ` Nikita Kiryanov
2015-02-02  7:37     ` Hannes Petermaier
2015-02-03 11:53       ` Nikita Kiryanov
2015-01-30 13:25 ` [U-Boot] [PATCH 04/21] board/BuR/common: Take usage of am335x LCD-Display Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 05/21] board/BuR/common: try to setup cpsw mac-address from the devicetree Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 06/21] board/BuR/tseries: Enable HW-Watchdog Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 07/21] board/BuR/tseries: Enable U-Boot BOOTCOUNT feature Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 08/21] board/BuR/tseries: Enable EXT4 support Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 09/21] board/BuR/tseries: Change pinmux for GPIO2_28 from GPIO to PWM-Timeroutput Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 10/21] board/BuR/tseries: Chg pinmux - use free NAND Pins in non NAND-config as GPIO Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 11/21] board/BuR/tseries: Chg Pinmux - enable UART1 pins Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 12/21] board/BuR/common: Introduce Network Console and common environment for it Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 13/21] board/BuR/common: Enable CONFIG_CMD_TIME Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 14/21] board/BuR/common: Add support for displaying BMP on LCD Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 15/21] board/BuR/tseries: Rework default-environment settings Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 16/21] board/BuR/tseries: cosmetic changes Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 17/21] board/BuR/kwb: switch to board HW-Rev3 Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 18/21] board/BuR/kwb: Support booting Linux Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 19/21] board/BuR/kwb: Redesign default-environment Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 20/21] board/BuR/kwb: Form a bootline for vxWorks Hannes Petermaier
2015-01-30 13:25 ` [U-Boot] [PATCH 21/21] board/BuR/kwb: Support modify bootcmd through reset-controller Hannes Petermaier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.