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 @@
 
 	gpio_set_value(pin, 0);
 }
+
 #ifdef CONFIG_SPL_BUILD
 void pmicsetup(u32 mpupll)
 {
@@ -115,6 +527,9 @@
 
 	/* 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 @@
 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 @@
 
 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 @@
 #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 */
