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

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

bur/scripts
===
target specific helper scripts

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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

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

So we cannot use the normal echo , instead we write explicitly using
lcdputs ... for writing to the actual cursor position on LCD.

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

---
Changes for v2:
  - better understandable commit-message
  - rename puts into lcdputs
  - move code from lcd.c to lcd_console.c
---
 common/lcd_console.c |   18 ++
 1 file changed, 18 insertions(+)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index 5363232..8bf83b9 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -225,8 +225,26 @@ static int do_lcd_setcursor(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;
+}
+
 U_BOOT_CMD(
setcurs, 3, 1,  do_lcd_setcursor,
set cursor position within screen,
col row in character
 );
+
+U_BOOT_CMD(
+   lcdputs, 2, 1,  do_lcd_puts,
+   print string on lcd-framebuffer,
+   string
+);
+
-- 
1.7.10.4

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


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

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

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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


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

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

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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


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

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

Older boards aren't supported from now anymore.

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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

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

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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


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

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

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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


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

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

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

best regards,
Hannes

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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

best regards,
Hannes

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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


Re: [U-Boot] U-Boot gitweb

2015-02-03 Thread Stefano Babic
Hi Bin,

On 03/02/2015 04:24, Bin Meng wrote:
 Hello,
 
 On Mon, Feb 2, 2015 at 3:47 PM, Nable nable.mainin...@googlemail.com wrote:
 Hi!

 I can also see the same issue.
 It looks like some problem with permissions:
 
 Forbidden
 You don't have permission to access /gitweb.css on this server.
 Apache/2.2.22 (Debian) Server at git.denx.de Port 80
 

 Error 403 is also returned for gitweb.js and git-logo.png
 
 Is there anyone who is looking into this issue?
 
 I noticed that last night it seemed to be OK, however this morning the
 issues popped up again.

It means only that pages were taken from your cache, and this morning
your browser tried to get them again from the server.

It is fixed now - thanks to have reported the issue.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] sunxi: video: Dynamically reserve framebuffer memory

2015-02-03 Thread Ian Campbell
On Mon, 2015-02-02 at 19:57 +0100, Hans de Goede wrote:
 Only use CONFIG_SUNXI_MAX_FB_SIZE to reserve memory at the top when relocating
 u-boot, and calculate the actual amount of memory necessary when setting up
 the video-mode and use only that, freeing up some additional memory for use
 by the kernel.
 
 Signed-off-by: Hans de Goede hdego...@redhat.com

Acked-by: Ian Campbell i...@hellion.org.uk


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


Re: [U-Boot] [PATCH 1/2] sunxi: video: Do not use CONFIG_SYS_MEM_TOP_HIDE for the framebuffer

2015-02-03 Thread Ian Campbell
On Mon, 2015-02-02 at 19:57 +0100, Hans de Goede wrote:
 @@ -1237,6 +1243,20 @@ int sunxi_simplefb_setup(void *blob)
   return 0; /* Keep older kernels working */
   }
  
 + /*
 +  * Do not report the framebuffer as free RAM to Linux, note we cannot
 +  * use fdt_add_mem_rsv() here, because then it is still seen as RAM,
 +  * and Linux refuses to iomap RAM on ARM, see:
 +  * linux/arch/arm/mm/ioremap.c around line 301.

A little bit Linux centric ;-)

I'd suggest s/Linux/OS for the first one and s/and Linux refuses/for
example Linux refuses/.

 +  */
 + start = gd-bd-bi_dram[0].start;
 + size = gd-bd-bi_dram[0].size - CONFIG_SUNXI_MAX_FB_SIZE;
 + ret = fdt_fixup_memory_banks(blob, start, size, 1);

I suppose this is currently safe when put up against arch_fixup_fdt(),
but it might be a bit fragile against future changes?

I'm not sure what else we can do though, directly adjusting
gd-bd-bi_dram[0].size seems iffy.

Perhaps a hook called from arch_fixup_fdt which is passed the arrays
which are about to be passed to fdt_fixup_memory_banks so it can adjust
them?


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


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

2015-02-03 Thread Hannes Petermaier
Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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


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

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

So we cannot use the normal echo , instead we write explicitly using
lcdputs ... for writing to the actual cursor position on LCD.

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

---
Changes for v2:
  - better understandable commit-message
  - rename puts into lcdputs
  - move code from lcd.c to lcd_console.c
---
 common/lcd_console.c |   18 ++
 1 file changed, 18 insertions(+)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index 5363232..8bf83b9 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -225,8 +225,26 @@ static int do_lcd_setcursor(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;
+}
+
 U_BOOT_CMD(
setcurs, 3, 1,  do_lcd_setcursor,
set cursor position within screen,
col row in character
 );
+
+U_BOOT_CMD(
+   lcdputs, 2, 1,  do_lcd_puts,
+   print string on lcd-framebuffer,
+   string
+);
+
-- 
1.7.10.4

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


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

2015-02-03 Thread Hannes Petermaier
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 oe5...@oevsv.at

---
Changes for V2: None
---
 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 intvsw;/* Vertical Sync Pulse Width */
unsigned intpxl_clk_div;/* Pixel clock divider*/
unsigned intpol;/* polarity of sync, clock signals */
+   unsigned intpup_delay;  /*
+* time in ms after power on to
+* initialization of lcd-controller
+* (VCC ramp up time)
+*/
unsigned intpon_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.10.4

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


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

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

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
index 7d0e05c..18e1520 100644
--- a/board/BuR/common/common.c
+++ b/board/BuR/common/common.c
@@ -591,9 +591,9 @@ static struct cpsw_platform_data cpsw_data = {
 int board_eth_init(bd_t *bis)
 {
int rv = 0;
-   uint8_t mac_addr[6];
+   char mac_addr[6];
+   const char *mac = 0;
uint32_t mac_hi, mac_lo;
-
/* try reading mac address from efuse */
mac_lo = readl(cdev-macid0l);
mac_hi = readl(cdev-macid0h);
@@ -607,14 +607,19 @@ int board_eth_init(bd_t *bis)
 #if (defined(CONFIG_DRIVER_TI_CPSW)  !defined(CONFIG_SPL_BUILD)) || \
(defined(CONFIG_SPL_ETH_SUPPORT)  defined(CONFIG_SPL_BUILD))
if (!getenv(ethaddr)) {
-   printf(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.10.4

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


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

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

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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


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

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

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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


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

2015-02-03 Thread Hannes Petermaier
Signed-off-by: Hannes Petermaier oe5...@oevsv.at

---
Changes for V2: None
---
 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_BPPLCD_COLOR32
 
+#define CONFIG_HW_WATCHDOG
+#define CONFIG_OMAP_WATCHDOG
+#define CONFIG_SPL_WATCHDOG_SUPPORT
 /* Clock Defines */
 #define V_OSCK 2600  /* Clock output from T2 */
 #define V_SCLK (V_OSCK)
-- 
1.7.10.4

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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

best regards,
Hannes

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


Re: [U-Boot] Patch to add support for BAV335x boards

2015-02-03 Thread Wolfgang Denk
Dear Gilles,

In message 3efcb679-8df9-43f2-b3f4-fbc00e578...@gigadevices.com you wrote:
 
 I just added support for the BAV335x OEM boards =
 http://birdland.com/oem/bav335x-network-processor/
 
 This patch was generated with the patman tool which reported no checks, =
 warnings nor errors.
 
 The patch is relative to the v2015.01 tag.

THis being a version 2 of the patch, you should have marked it as such
in the Subject, and provides a Changelog.

 Content-Disposition: attachment;
   filename=0001-Adding-Support-for-BAV335x-boards.patch
 Content-Type: application/octet-stream;
   name=0001-Adding-Support-for-BAV335x-boards.patch
 Content-Transfer-Encoding: quoted-printable

Also, I asked you before NOT to send patches as MIME attachments.
Please make sure to send them inline, ideally using git-send-email.

This being a TI based board, you should have sent it to the TI
custodian.

 From a4d163542a7acbcc1ac5f520f41966f373b9f307 Mon Sep 17 00:00:00 2001
 From: Gilles Gameiro gil...@gigadevices.com
 Date: Sun, 1 Feb 2015 19:30:01 -0800
 Subject: [PATCH] Adding Support for BAV335x boards
 
 Signed-off-by: Gilles Gameiro gil...@gigadevices.com

Please add a description of the board to the commit message.


 @@ -969,6 +982,7 @@ source board/taskit/stamp9g20/Kconfig
  source board/tbs/tbs2910/Kconfig
  source board/ti/am335x/Kconfig
  source board/ti/am43xx/Kconfig
 +source board/birdland/bav335x/Kconfig
  source board/ti/ti814x/Kconfig
  source board/ti/ti816x/Kconfig
  source board/ti/tnetv107xevm/Kconfig

Please keep lists sorted.

 +config CONS_INDEX
 + int UART used for console
 + range 1 6
 + default 1
 + help
 +   The AM335x SoC has a total of 6 UARTs (UART0 to UART5 as referenced
 +   in documentation, etc) available to it.  Depending on your specific
 +   board you may want something other than UART0 as for example the IDK
 +   uses UART3 so enter 4 here.

Is this useful and correct information for your board?

 --- /dev/null
 +++ b/board/birdland/bav335x/Makefile
 @@ -0,0 +1,11 @@
 +#
 +# Makefile
 +#
 +# Copyright (C) 2012-2014, Birdland Audio - http://birdland.com/oem
 +#

SPDX ID missing.

 +++ b/board/birdland/bav335x/README
 @@ -0,0 +1,31 @@
 +Summary
 +===

SPDX ID missing.  Please fix globally for all new files.



 +static __maybe_unused struct ctrl_dev *cdev =
 + (struct ctrl_dev *)CTRL_DEVICE_BASE;
 +
 +
 +
 +/*

Excessive white space - please use a single blank line.  Please fix globally.

 + if (header.version[1] == 'A') {
 + if (debug)
 + puts(=== Detected Board model BAV335x Rev.A);

Use debug() instead.  Please fix globally.

...
 +void sdram_init(void)
 +{
 + config_ddr(400, ioregs_bonelt,
 +ddr3_bav335x_data,
 +ddr3_bav335x_cmd_ctrl_data,
 +ddr3_bav335x_emif_reg_data, 0);
 +}
 +#endif

It might be useful to add a comment so it is easier to see which #if
this belongs to.


 + /* Default manufacturing address; used when no EE or invalid */
 + n = 0;
 + mac_addr[0] = 0;
 + mac_addr[1] = 0x20;
 + mac_addr[2] = 0x18;
 + mac_addr[3] = 0x1C;
 + mac_addr[4] = 0x00;
 + mac_addr[5] = 0x01;

Please never, never ever hard-wire MAC addresses into U-Boot.

Also, the 002018 prefix appears to be owned by Cis Technology Inc.;
do you have the rights to use it?

 --- /dev/null
 +++ b/board/birdland/bav335x/mux.c
 @@ -0,0 +1,206 @@
 +/*
 + * mux.c
 + *
 + * Copyright (c) 2012-2014 Birdland Audio - http://birdland.com/oem
 + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation version 2.
 + *
 + * This program is distributed as is WITHOUT ANY WARRANTY of any
 + * kind, whether express or implied; without even the implied warranty
 + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 + * GNU General Public License for more details.

Please use SPDX ID instead.  

What exactly is the difference in this file compared to
board/ti/am335x/mux.c ?

 +/*
 + * The AM335x GP EVM, if daughter card(s) are connected, can have 8
 + * different profiles.  These profiles determine what peripherals are
 + * valid and need pinmux to be configured.
 + */

Is this relevant to your board?


 diff --git a/board/birdland/bav335x/u-boot.lds 
 b/board/birdland/bav335x/u-boot.lds
 new file mode 100644
 index 000..fc80f21
 --- /dev/null
 +++ b/board/birdland/bav335x/u-boot.lds

Do you really need a private linker script?  Why?

 + /*
 +  * Deprecated: this MMU section is used by pxa at present but
 +  * should not be used by new boards/CPUs.
 +  */

Did you read that?

 --- /dev/null
 +++ b/include/configs/bav335x.h
 @@ -0,0 +1,633 @@
 +/*
 + * bav335x.h
 + *
 + * Copyright (c) 2012-2014 Birdland 

Re: [U-Boot] SPL DM

2015-02-03 Thread Simon Glass
Hi Michal,

On 3 February 2015 at 06:16, Michal Simek mon...@monstr.eu wrote:
 Hi Simon,

 I am playing with driver model and I have moved uartlite to it and
 it is working fine for normal u-boot +10k but SPL size is dramatically
 bigger. Without DM I can fit to 3k but now it has ~16k.

 microblaze-generic:  all +10759  bss +4  data +560  rodata +1379
 spl/u-boot-spl:all +9100  spl/u-boot-spl:bss -4  spl/u-boot-spl:data -48
  spl/u-boot-spl:rodata +5660  spl/u-boot-spl:text +3492  text +8816

 This 9k is after removing all printf calling which is adding 6kB.


 diff --git a/common/malloc_simple.c b/common/malloc_simple.c
 index afdacff80d8e..a9e4d96738a0 100644
 --- a/common/malloc_simple.c
 +++ b/common/malloc_simple.c
 @@ -19,7 +19,7 @@ void *malloc_simple(size_t bytes)

 new_ptr = gd-malloc_ptr + bytes;
 if (new_ptr  gd-malloc_limit)
 -   panic(Out of pre-reloc memory);
 +   puts(Out of pre-reloc memory);
 ptr = map_sysmem(gd-malloc_base + gd-malloc_ptr, bytes);
 gd-malloc_ptr = ALIGN(new_ptr, sizeof(new_ptr));
 return ptr;
 diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
 index 3fc7104359d3..d56fafcb8ee2 100644
 --- a/drivers/serial/serial-uclass.c
 +++ b/drivers/serial/serial-uclass.c
 @@ -72,7 +72,7 @@ static void serial_find_console_or_panic(void)
 if (uclass_get_device_by_seq(UCLASS_SERIAL, INDEX, dev) 
 uclass_get_device(UCLASS_SERIAL, INDEX, dev) 
 (uclass_first_device(UCLASS_SERIAL, dev) || !dev))
 -   panic(No serial driver found);
 +   puts(No serial driver found);
  #undef INDEX
 gd-cur_serial_dev = dev;
  }


 Here is diff between versions. I have setup CONFIG_SYS_MALLOC_SIMPLE
 Simon: Have you tried to to reduce size in this too?
 Interesting part is that new uartlite functions are not called that's why I 
 am expecting
 any other problem.

  spl-u-boot-spl: add: 27/-13, grow: 2/-1 bytes: 4024/-576 
 (3448)
  function   old new   
 delta
  device_bind  - 596
 +596
  device_probe_child   - 508
 +508
  uclass_get   - 296
 +296
  lists_bind_drivers   - 212
 +212
  uclass_resolve_seq   - 188
 +188
  uclass_bind_device   - 180
 +180
  uclass_find_device_by_seq- 172
 +172
  device_bind_by_name  - 152
 +152
  uclass_get_device_by_seq - 140
 +140
  serial_find_console_or_panic - 136
 +136
  uclass_find_device   - 132
 +132
  lists_driver_lookup_name - 128
 +128
  uclass_first_device  - 108
 +108
  dm_init  -  96 
 +96
  _serial_putc -  96 
 +96
  uclass_unbind_device -  92 
 +92
  malloc_simple-  92 
 +92
  uclass_get_device-  88 
 +88
  lists_uclass_lookup  -  80 
 +80
  dm_init_and_scan -  80 
 +80
  calloc   -  80 
 +80
  uclass_find  -  72 
 +72
  uclass_pre_probe_child   -  60 
 +60
  uclass_post_probe_device -  52 
 +52
  strcmp   -  52 
 +52
  dm_scan_platdata -  52 
 +52
  serial_puts 44  80 
 +36
  device_probe -  32 
 +32
  board_init_r   232 248 
 +16
  serial_current   4   -  
 -4
  userial0_setbrg  8   -  
 -8
  serial_init 56  48  
 -8
  userial0_tstc   20   - 
 -20
  userial0_puts   32   - 
 -32
  userial0_putc   32  

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

2015-02-03 Thread Hannes Petermaier
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 oe5...@oevsv.at

---
Changes for V2: None
---
 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 = 19200 / 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) ||
+

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

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

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

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


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

2015-02-03 Thread Hannes Petermaier
Hi all,

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

regards,
Hannes


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


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

2015-02-03 Thread Nikita Kiryanov

Hi Hannes,

On 02/02/2015 09:37 AM, Hannes Petermaier wrote:

From: Nikita Kiryanov nik...@compulab.co.il
To: Hannes Petermaier oe5...@oevsv.at, u-boot@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-boun...@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 oe5...@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
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

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

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

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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


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

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

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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


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

2015-02-03 Thread Hannes Petermaier
Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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


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

2015-02-03 Thread Hannes Petermaier
Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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


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

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

bur/scripts
===
target specific helper scripts

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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

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

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

the environment in flash is NOT overwritten.

Signed-off-by: Hannes Petermaier oe5...@oevsv.at

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

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

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


[U-Boot] SPL DM

2015-02-03 Thread Michal Simek
Hi Simon,

I am playing with driver model and I have moved uartlite to it and
it is working fine for normal u-boot +10k but SPL size is dramatically
bigger. Without DM I can fit to 3k but now it has ~16k.

microblaze-generic:  all +10759  bss +4  data +560  rodata +1379
spl/u-boot-spl:all +9100  spl/u-boot-spl:bss -4  spl/u-boot-spl:data -48
 spl/u-boot-spl:rodata +5660  spl/u-boot-spl:text +3492  text +8816

This 9k is after removing all printf calling which is adding 6kB.


diff --git a/common/malloc_simple.c b/common/malloc_simple.c
index afdacff80d8e..a9e4d96738a0 100644
--- a/common/malloc_simple.c
+++ b/common/malloc_simple.c
@@ -19,7 +19,7 @@ void *malloc_simple(size_t bytes)

new_ptr = gd-malloc_ptr + bytes;
if (new_ptr  gd-malloc_limit)
-   panic(Out of pre-reloc memory);
+   puts(Out of pre-reloc memory);
ptr = map_sysmem(gd-malloc_base + gd-malloc_ptr, bytes);
gd-malloc_ptr = ALIGN(new_ptr, sizeof(new_ptr));
return ptr;
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 3fc7104359d3..d56fafcb8ee2 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -72,7 +72,7 @@ static void serial_find_console_or_panic(void)
if (uclass_get_device_by_seq(UCLASS_SERIAL, INDEX, dev) 
uclass_get_device(UCLASS_SERIAL, INDEX, dev) 
(uclass_first_device(UCLASS_SERIAL, dev) || !dev))
-   panic(No serial driver found);
+   puts(No serial driver found);
 #undef INDEX
gd-cur_serial_dev = dev;
 }


Here is diff between versions. I have setup CONFIG_SYS_MALLOC_SIMPLE
Simon: Have you tried to to reduce size in this too?
Interesting part is that new uartlite functions are not called that's why I am 
expecting
any other problem.

 spl-u-boot-spl: add: 27/-13, grow: 2/-1 bytes: 4024/-576 (3448)
 function   old new   delta
 device_bind  - 596+596
 device_probe_child   - 508+508
 uclass_get   - 296+296
 lists_bind_drivers   - 212+212
 uclass_resolve_seq   - 188+188
 uclass_bind_device   - 180+180
 uclass_find_device_by_seq- 172+172
 device_bind_by_name  - 152+152
 uclass_get_device_by_seq - 140+140
 serial_find_console_or_panic - 136+136
 uclass_find_device   - 132+132
 lists_driver_lookup_name - 128+128
 uclass_first_device  - 108+108
 dm_init  -  96 +96
 _serial_putc -  96 +96
 uclass_unbind_device -  92 +92
 malloc_simple-  92 +92
 uclass_get_device-  88 +88
 lists_uclass_lookup  -  80 +80
 dm_init_and_scan -  80 +80
 calloc   -  80 +80
 uclass_find  -  72 +72
 uclass_pre_probe_child   -  60 +60
 uclass_post_probe_device -  52 +52
 strcmp   -  52 +52
 dm_scan_platdata -  52 +52
 serial_puts 44  80 +36
 device_probe -  32 +32
 board_init_r   232 248 +16
 serial_current   4   -  -4
 userial0_setbrg  8   -  -8
 serial_init 56  48  -8
 userial0_tstc   20   - -20
 userial0_puts   32   - -32
 userial0_putc   32   - -32
 userial0_init   32   - -32
 userial0_getc   32   - -32
 uartlite_serial_getc 

Re: [U-Boot] [PATCH 1/2] sunxi: video: Do not use CONFIG_SYS_MEM_TOP_HIDE for the framebuffer

2015-02-03 Thread Hans de Goede

Hi,

On 02/03/2015 02:20 PM, Ian Campbell wrote:

On Mon, 2015-02-02 at 19:57 +0100, Hans de Goede wrote:

@@ -1237,6 +1243,20 @@ int sunxi_simplefb_setup(void *blob)
return 0; /* Keep older kernels working */
}

+   /*
+* Do not report the framebuffer as free RAM to Linux, note we cannot
+* use fdt_add_mem_rsv() here, because then it is still seen as RAM,
+* and Linux refuses to iomap RAM on ARM, see:
+* linux/arch/arm/mm/ioremap.c around line 301.


A little bit Linux centric ;-)

I'd suggest s/Linux/OS for the first one and s/and Linux refuses/for
example Linux refuses/.


OK, will fix.


+*/
+   start = gd-bd-bi_dram[0].start;
+   size = gd-bd-bi_dram[0].size - CONFIG_SUNXI_MAX_FB_SIZE;
+   ret = fdt_fixup_memory_banks(blob, start, size, 1);


I suppose this is currently safe when put up against arch_fixup_fdt(),
but it might be a bit fragile against future changes?


We get called after arch_fixup_fdt(), so we should be able to simply
override what it has setup in the fdt.


I'm not sure what else we can do though, directly adjusting
gd-bd-bi_dram[0].size seems iffy.

Perhaps a hook called from arch_fixup_fdt which is passed the arrays
which are about to be passed to fdt_fixup_memory_banks so it can adjust
them?


Then we need to keep track of if that callback succeeded, because without
the reservation we should not enable simplefb. I would prefer to just
keep this bit as is.

Regards,

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


[U-Boot] [PATCH 1/5] nand: Add verification functions

2015-02-03 Thread Peter Tyser
Add nand_verify() and nand_verify_page_oob().  nand_verify() verifies
NAND contents against an arbitrarily sized buffer using ECC while
nand_verify_page_oob() verifies a NAND page's contents and OOB.

Signed-off-by: Peter Tyser pty...@xes-inc.com
---

 drivers/mtd/nand/nand_util.c | 97 +++-
 include/nand.h   |  4 ++
 2 files changed, 100 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index afdd160..f487756 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -464,6 +464,87 @@ static size_t drop_ffs(const nand_info_t *nand, const 
u_char *buf,
 #endif
 
 /**
+ * nand_verify_page_oob:
+ *
+ * Verify a page of NAND flash, including the OOB.
+ * Reads page of NAND and verifies the contents and OOB against the
+ * values in ops.
+ *
+ * @param nand NAND device
+ * @param ops  MTD operations, including data to verify
+ * @param ofs  offset in flash
+ * @return 0 in case of success
+ */
+int nand_verify_page_oob(nand_info_t *nand, struct mtd_oob_ops *ops, loff_t 
ofs)
+{
+   int rval;
+   struct mtd_oob_ops vops;
+   size_t verlen = nand-writesize + nand-oobsize;
+
+   memcpy(vops, ops, sizeof(vops));
+
+   vops.datbuf = malloc(verlen);
+
+   if (!vops.datbuf)
+   return -ENOMEM;
+
+   vops.oobbuf = vops.datbuf + nand-writesize;
+
+   rval = mtd_read_oob(nand, ofs, vops);
+   if (!rval)
+   rval = memcmp(ops-datbuf, vops.datbuf, vops.len);
+   if (!rval)
+   rval = memcmp(ops-oobbuf, vops.oobbuf, vops.ooblen);
+
+   free(vops.datbuf);
+
+   return rval ? -EIO : 0;
+}
+
+/**
+ * nand_verify:
+ *
+ * Verify a region of NAND flash.
+ * Reads NAND in page-sized chunks and verifies the contents against
+ * the contents of a buffer.  The offset into the NAND must be
+ * page-aligned, and the function doesn't handle skipping bad blocks.
+ *
+ * @param nand NAND device
+ * @param ofs  offset in flash
+ * @param len  buffer length
+ * @param buf  buffer to read from
+ * @return 0 in case of success
+ */
+int nand_verify(nand_info_t *nand, loff_t ofs, size_t len, u_char *buf)
+{
+   int rval = 0;
+   size_t verofs;
+   size_t verlen = nand-writesize;
+   uint8_t *verbuf = malloc(verlen);
+
+   if (!verbuf)
+   return -ENOMEM;
+
+   /* Read the NAND back in page-size groups to limit malloc size */
+   for (verofs = ofs; verofs  ofs + len;
+verofs += verlen, buf += verlen) {
+   verlen = min(nand-writesize, (uint32_t)(ofs + len - verofs));
+   rval = nand_read(nand, verofs, verlen, verbuf);
+   if (!rval || (rval == -EUCLEAN))
+   rval = memcmp(buf, verbuf, verlen);
+
+   if (rval)
+   break;
+   }
+
+   free(verbuf);
+
+   return rval ? -EIO : 0;
+}
+
+
+
+/**
  * nand_write_skip_bad:
  *
  * Write image to NAND flash.
@@ -501,7 +582,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, 
size_t *length,
 
 #ifdef CONFIG_CMD_NAND_YAFFS
if (flags  WITH_YAFFS_OOB) {
-   if (flags  ~WITH_YAFFS_OOB)
+   if (flags  (~WITH_YAFFS_OOB  ~WITH_WR_VERIFY))
return -EINVAL;
 
int pages;
@@ -554,6 +635,10 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, 
size_t *length,
 
if (!need_skip  !(flags  WITH_DROP_FFS)) {
rval = nand_write(nand, offset, length, buffer);
+
+   if ((flags  WITH_WR_VERIFY)  !rval)
+   rval = nand_verify(nand, offset, *length, buffer);
+
if (rval == 0)
return 0;
 
@@ -601,6 +686,11 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, 
size_t *length,
ops.oobbuf = ops.datbuf + pagesize;
 
rval = mtd_write_oob(nand, offset, ops);
+
+   if ((flags  WITH_WR_VERIFY)  !rval)
+   rval = nand_verify_page_oob(nand,
+   ops, offset);
+
if (rval != 0)
break;
 
@@ -620,6 +710,11 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, 
size_t *length,
 
rval = nand_write(nand, offset, truncated_write_size,
p_buffer);
+
+   if ((flags  WITH_WR_VERIFY)  !rval)
+   rval = nand_verify(nand, offset,
+   truncated_write_size, p_buffer);
+
offset += write_size;
p_buffer += write_size;
}
diff --git a/include/nand.h b/include/nand.h
index 

[U-Boot] [PATCH 3/5] dfu: nand: Verify writes

2015-02-03 Thread Peter Tyser
Previously NAND writes were not verified and could fail silently.  Add
a verification step after all writes to NAND.

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
I don't have a board with DFU support, so this change is untested.

 drivers/dfu/dfu_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
index f9ee189..a975492 100644
--- a/drivers/dfu/dfu_nand.c
+++ b/drivers/dfu/dfu_nand.c
@@ -64,7 +64,7 @@ static int nand_block_op(enum dfu_op op, struct dfu_entity 
*dfu,
return ret;
/* then write */
ret = nand_write_skip_bad(nand, start, count, actual,
-   lim, buf, 0);
+   lim, buf, WITH_WR_VERIFY);
}
 
if (ret != 0) {
-- 
1.9.1

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


[U-Boot] Hang when enabling DCache on a iMX6 board

2015-02-03 Thread Boris Brezillon
Hello,

I'm currently porting the SECO iMX6 uQ7 board to mainline, but I'm
facing a hang when enabling DCache (CONFIG_SYS_DCACHE_OFF undefined).
Last week I asked on the #u-boot chan if anybody already encountered
such a bug, and someone (named malik) suggested to check my DDR timings.

After a few more tests and checks I decided to port my changes to an
older version (2014.04), and it apparently works.
I haven't bisected to find the exact commit that makes it fails yet,
but before doing that I'd like to know if anyone else already
experienced this kind of problem, or has any idea of what could cause
this.

Here is my public repository containing two branches [1], the
seco-mainline branch contains my port based on the master branch and
the seco-2014.04 contains the same work based on the 2014.04 tag. 

Best Regards,

Boris

[1]https://github.com/bbrezillon/u-boot-seco

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/5] cmd_nand: Verify writes to NAND

2015-02-03 Thread Peter Tyser
Previously NAND writes were only verified when CONFIG_MTD_NAND_VERIFY_WRITE
was defined.  On boards without this define writes could fail silently.
Boards with CONFIG_MTD_NAND_VERIFY_WRITE could prematurely report
failures which ECC could correct.

Add a verification step after all nand write[.x] commands to ensure the
writes were successful.  The verification uses ECC for for normal
writes, but does not for raw and yaffs writes.  Some test cases which
inject fake bad bits on a 2K page flash are below.

Test cases with CONFIG_MTD_NAND_VERIFY_WRITE defined:
  Example of an ECC write which previously failed when
  CONFIG_MTD_NAND_VERIFY_WRITE was defined, but now succeeds because ECC
  is used during verification:
  nand erase 0 0x1
  dhcp /somefile
  mw.b 0x1 0xff 0x2000
  mw.b 0x10020 0xfe 1
  nand write.raw 0x1 0x800 1
  mw.b 0x120 0x01 1
  nand write 0x100 0x800 0x1800

Test cases without CONFIG_MTD_NAND_VERIFY_WRITE defined:
  Example of an ECC write which previously silently failed:
  nand erase 0 0x1
  dhcp /somefile
  mw.b 0x1 0xff 0x2000
  mw.b 0x10020 0x00 1
  nand write.raw 0x1 0x800 1
  mw.b 0x120 0xff 1
  nand write 0x100 0x800 0x1800

  Example of a raw write which previously failed silently due to stuck
  data bit, but now errors out:
  nand erase 0 0x1
  dhcp /somefile
  mw.b 0x1 0xff 0x2000
  mw.b 0x10020 0xfe 1
  nand write.raw 0x1 0x800 1
  mw.b 0x120 0x01 1
  nand write.raw 0x100 0x800 3

  Example of a raw write which previously failed silently due to stuck OOB
  bit, but now errors out:
  nand erase 0 0x1
  dhcp /somefile
  mw.b 0x1 0xff 0x2000
  mw.b 0x10810 0xfe 1
  nand write.raw 0x1 0x800 1
  mw.b 0x1000810 0x01 1
  nand write.raw 0x100 0x800 3

Signed-off-by: Peter Tyser pty...@xes-inc.com
---

 common/cmd_nand.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 7f962dc..bada28c 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -419,10 +419,13 @@ static int raw_access(nand_info_t *nand, ulong addr, 
loff_t off, ulong count,
.mode = MTD_OPS_RAW
};
 
-   if (read)
+   if (read) {
ret = mtd_read_oob(nand, off, ops);
-   else
+   } else {
ret = mtd_write_oob(nand, off, ops);
+   if (!ret)
+   ret = nand_verify_page_oob(nand, ops, off);
+   }
 
if (ret) {
printf(%s: error at offset %llx, ret %d\n,
@@ -690,7 +693,8 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
else
ret = nand_write_skip_bad(nand, off, rwsize,
  NULL, maxsize,
- (u_char *)addr, 0);
+ (u_char *)addr,
+ WITH_WR_VERIFY);
 #ifdef CONFIG_CMD_NAND_TRIMFFS
} else if (!strcmp(s, .trimffs)) {
if (read) {
@@ -699,7 +703,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
}
ret = nand_write_skip_bad(nand, off, rwsize, NULL,
maxsize, (u_char *)addr,
-   WITH_DROP_FFS);
+   WITH_DROP_FFS | WITH_WR_VERIFY);
 #endif
 #ifdef CONFIG_CMD_NAND_YAFFS
} else if (!strcmp(s, .yaffs)) {
@@ -709,7 +713,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
}
ret = nand_write_skip_bad(nand, off, rwsize, NULL,
maxsize, (u_char *)addr,
-   WITH_YAFFS_OOB);
+   WITH_YAFFS_OOB | 
WITH_WR_VERIFY);
 #endif
} else if (!strcmp(s, .oob)) {
/* out-of-band data */
-- 
1.9.1

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


[U-Boot] [PATCH 5/5] nand: yaffs: Remove the nand write.yaffs command

2015-02-03 Thread Peter Tyser
This command is only enabled by one board, complicates the NAND code,
and doesn't appear to have been functioning properly for several
years.  If there are no bad blocks in the NAND region being written
nand_write_skip_bad() will take the shortcut of calling nand_write()
which bypasses the special yaffs handling.  This causes invalid YAFFS
data to be written. See
http://lists.denx.de/pipermail/u-boot/2011-September/102830.html for
an example and a potential workaround.

U-Boot still retains the ability to mount and access YAFFS partitions
via CONFIG_YAFFS2.

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
If people are actively using nand write.yaffs, feel free to chime in
if you'd like it to be kept in.  I spent a little time trying to use
it and ran into a handful of issues which made me think it wasn't
actively used.

It's also not clear to me why nand write.raw wouldn't be usable since
it should allow writing any arbitrary data?

 common/cmd_nand.c| 15 -
 drivers/mtd/nand/nand_util.c | 77 +++-
 include/configs/M54418TWR.h  |  1 -
 include/configs/VCMA9.h  |  1 -
 include/nand.h   |  7 ++--
 5 files changed, 14 insertions(+), 87 deletions(-)

diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index bada28c..17fa7ea 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -705,16 +705,6 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
maxsize, (u_char *)addr,
WITH_DROP_FFS | WITH_WR_VERIFY);
 #endif
-#ifdef CONFIG_CMD_NAND_YAFFS
-   } else if (!strcmp(s, .yaffs)) {
-   if (read) {
-   printf(Unknown nand command suffix '%s'.\n, 
s);
-   return 1;
-   }
-   ret = nand_write_skip_bad(nand, off, rwsize, NULL,
-   maxsize, (u_char *)addr,
-   WITH_YAFFS_OOB | 
WITH_WR_VERIFY);
-#endif
} else if (!strcmp(s, .oob)) {
/* out-of-band data */
mtd_oob_ops_t ops = {
@@ -857,11 +847,6 @@ static char nand_help_text[] =
'addr', skipping bad blocks and dropping any pages at the end\n
of eraseblocks that contain only 0xFF\n
 #endif
-#ifdef CONFIG_CMD_NAND_YAFFS
-   nand write.yaffs - addr off|partition size\n
-   write 'size' bytes starting at offset 'off' with yaffs format\n
-   from memory address 'addr', skipping bad blocks.\n
-#endif
nand erase[.spread] [clean] off size - erase 'size' bytes 
from offset 'off'\n
With '.spread', erase enough for given file size, otherwise,\n
diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index f487756..12dd26a 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -580,24 +580,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, 
size_t *length,
if (actual)
*actual = 0;
 
-#ifdef CONFIG_CMD_NAND_YAFFS
-   if (flags  WITH_YAFFS_OOB) {
-   if (flags  (~WITH_YAFFS_OOB  ~WITH_WR_VERIFY))
-   return -EINVAL;
-
-   int pages;
-   pages = nand-erasesize / nand-writesize;
-   blocksize = (pages * nand-oobsize) + nand-erasesize;
-   if (*length % (nand-writesize + nand-oobsize)) {
-   printf(Attempt to write incomplete page
-in yaffs mode\n);
-   return -EINVAL;
-   }
-   } else
-#endif
-   {
-   blocksize = nand-erasesize;
-   }
+   blocksize = nand-erasesize;
 
/*
 * nand_write() handles unaligned, partial page writes.
@@ -666,58 +649,22 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, 
size_t *length,
else
write_size = blocksize - block_offset;
 
-#ifdef CONFIG_CMD_NAND_YAFFS
-   if (flags  WITH_YAFFS_OOB) {
-   int page, pages;
-   size_t pagesize = nand-writesize;
-   size_t pagesize_oob = pagesize + nand-oobsize;
-   struct mtd_oob_ops ops;
-
-   ops.len = pagesize;
-   ops.ooblen = nand-oobsize;
-   ops.mode = MTD_OPS_AUTO_OOB;
-   ops.ooboffs = 0;
-
-   pages = write_size / pagesize_oob;
-   for (page = 0; page  pages; page++) {
-   WATCHDOG_RESET();
-
-   ops.datbuf = p_buffer;
-   ops.oobbuf = ops.datbuf + pagesize;
-
-   rval = mtd_write_oob(nand, offset, ops);
-
- 

[U-Boot] [PATCH 4/5] nand: Remove CONFIG_MTD_NAND_VERIFY_WRITE

2015-02-03 Thread Peter Tyser
The CONFIG_MTD_NAND_VERIFY_WRITE has been removed from Linux for some
time and a more generic method of NAND verification now exists in U-Boot.

Signed-off-by: Peter Tyser pty...@xes-inc.com
---

 README  |  3 --
 board/prodrive/alpr/nand.c  | 16 -
 board/socrates/nand.c   | 25 --
 drivers/mtd/nand/davinci_nand.c | 12 ---
 drivers/mtd/nand/fsl_elbc_nand.c| 38 --
 drivers/mtd/nand/fsl_ifc_nand.c | 38 --
 drivers/mtd/nand/fsl_upm.c  | 18 --
 drivers/mtd/nand/mpc5121_nfc.c  | 26 ---
 drivers/mtd/nand/mxc_nand.c | 33 ---
 drivers/mtd/nand/nand_base.c| 65 -
 drivers/mtd/nand/ndfc.c | 18 --
 include/configs/B4860QDS.h  |  1 -
 include/configs/BSC9131RDB.h|  1 -
 include/configs/BSC9132QDS.h|  1 -
 include/configs/C29XPCIE.h  |  1 -
 include/configs/MPC8313ERDB.h   |  1 -
 include/configs/MPC8315ERDB.h   |  1 -
 include/configs/MPC837XEMDS.h   |  1 -
 include/configs/MPC8536DS.h |  1 -
 include/configs/MPC8569MDS.h|  1 -
 include/configs/MPC8572DS.h |  1 -
 include/configs/P1010RDB.h  |  1 -
 include/configs/P1022DS.h   |  1 -
 include/configs/P1023RDB.h  |  1 -
 include/configs/P2041RDB.h  |  1 -
 include/configs/T102xQDS.h  |  1 -
 include/configs/T102xRDB.h  |  1 -
 include/configs/T1040QDS.h  |  1 -
 include/configs/T104xRDB.h  |  1 -
 include/configs/T208xQDS.h  |  1 -
 include/configs/T208xRDB.h  |  1 -
 include/configs/T4240QDS.h  |  1 -
 include/configs/T4240RDB.h  |  1 -
 include/configs/corenet_ds.h|  1 -
 include/configs/ids8313.h   |  1 -
 include/configs/km/kmp204x-common.h |  1 -
 include/configs/ls1021aqds.h|  1 -
 include/configs/ls2085a_common.h|  1 -
 include/configs/p1_p2_rdb_pc.h  |  1 -
 include/configs/ve8313.h|  1 -
 include/configs/xpedite537x.h   |  1 -
 include/configs/xpedite550x.h   |  1 -
 include/linux/mtd/nand.h|  5 ---
 43 files changed, 328 deletions(-)

diff --git a/README b/README
index fefa71c..88a21ff 100644
--- a/README
+++ b/README
@@ -3493,9 +3493,6 @@ FIT uImage format:
Adds the MTD partitioning infrastructure from the Linux
kernel. Needed for UBI support.
 
-   CONFIG_MTD_NAND_VERIFY_WRITE
-   verify if the written data is correct reread.
-
 - UBI support
CONFIG_CMD_UBI
 
diff --git a/board/prodrive/alpr/nand.c b/board/prodrive/alpr/nand.c
index 5427de5..ca40cea 100644
--- a/board/prodrive/alpr/nand.c
+++ b/board/prodrive/alpr/nand.c
@@ -93,19 +93,6 @@ static void alpr_nand_read_buf(struct mtd_info *mtd, u_char 
*buf, int len)
}
 }
 
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
-static int alpr_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int 
len)
-{
-   int i;
-
-   for (i = 0; i  len; i++)
-   if (buf[i] != readb((alpr_ndfc-data)))
-   return i;
-
-   return 0;
-}
-#endif
-
 static int alpr_nand_dev_ready(struct mtd_info *mtd)
 {
/*
@@ -130,9 +117,6 @@ int board_nand_init(struct nand_chip *nand)
nand-read_byte  = alpr_nand_read_byte;
nand-write_buf  = alpr_nand_write_buf;
nand-read_buf   = alpr_nand_read_buf;
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
-   nand-verify_buf = alpr_nand_verify_buf;
-#endif
nand-dev_ready  = alpr_nand_dev_ready;
 
return 0;
diff --git a/board/socrates/nand.c b/board/socrates/nand.c
index 7394478..15e6ea6 100644
--- a/board/socrates/nand.c
+++ b/board/socrates/nand.c
@@ -18,9 +18,6 @@ static void sc_nand_write_buf(struct mtd_info *mtd, const 
u_char *buf, int len);
 static u_char sc_nand_read_byte(struct mtd_info *mtd);
 static u16 sc_nand_read_word(struct mtd_info *mtd);
 static void sc_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len);
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
-static int sc_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int 
len);
-#endif
 static int sc_nand_device_ready(struct mtd_info *mtdinfo);
 
 #define FPGA_NAND_CMD_MASK (0x7  28)
@@ -102,25 +99,6 @@ static void sc_nand_read_buf(struct mtd_info *mtd, u_char 
*buf, int len)
}
 }
 
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
-/**
- * sc_nand_verify_buf -  Verify chip data against buffer
- * @mtd:   MTD device structure
- * @buf:   buffer containing the data to compare
- * @len:   number of bytes to compare
- */
-static int sc_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
-{
-   int i;
-
-   for (i = 0; i  len; i++) {
-   if (buf[i] != sc_nand_read_byte(mtd));
-   return -EFAULT;
-   }
-   return 0;
-}

Re: [U-Boot] [RFC PATCH 6/7] arm: Show relocated PC/LR in the register dump

2015-02-03 Thread Albert ARIBAUD
Hello Simon,

On Fri, 30 Jan 2015 12:04:56 -0700, Simon Glass s...@chromium.org wrote:
 If we don't know the relocation address, the raw values are not very useful.
 Show the pre-relocation values as well as these can be looked up in
 System.map, etc.
 
 Signed-off-by: Simon Glass s...@chromium.org
 ---
 
  arch/arm/lib/interrupts.c | 13 +
  1 file changed, 9 insertions(+), 4 deletions(-)
 
 diff --git a/arch/arm/lib/interrupts.c b/arch/arm/lib/interrupts.c
 index 4dacfd9..06f4679 100644
 --- a/arch/arm/lib/interrupts.c
 +++ b/arch/arm/lib/interrupts.c
 @@ -137,10 +137,15 @@ void show_regs (struct pt_regs *regs)
  
   flags = condition_codes (regs);
  
 - printf (pc : [%08lx]lr : [%08lx]\n
 - sp : %08lx  ip : %08lx  fp : %08lx\n,
 - instruction_pointer (regs),
 - regs-ARM_lr, regs-ARM_sp, regs-ARM_ip, regs-ARM_fp);
 + printf(pc : [%08lx] lr : [%08lx]\n,
 +instruction_pointer(regs), regs-ARM_lr);
 + if (gd-flags  GD_FLG_RELOC) {
 + printf(reloc pc : [%08lx]   lr : [%08lx]\n,
 +instruction_pointer(regs) - gd-reloc_off,
 +regs-ARM_lr - gd-reloc_off);
 + }
 + printf(sp : %08lx  ip : %08lx   fp : %08lx\n,
 +regs-ARM_sp, regs-ARM_ip, regs-ARM_fp);
   printf (r10: %08lx  r9 : %08lx  r8 : %08lx\n,
   regs-ARM_r10, regs-ARM_r9, regs-ARM_r8);
   printf (r7 : %08lx  r6 : %08lx  r5 : %08lx  r4 : %08lx\n,
 -- 
 2.2.0.rc0.207.ga3a616c
 

Applied as a bugfix to u-boot-arm/master, thanks!

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


Re: [U-Boot] Hang when enabling DCache on a iMX6 board

2015-02-03 Thread Anatolij Gustschin
Hello Boris,

On Tue, 3 Feb 2015 19:39:16 +0100
Boris Brezillon boris.brezil...@free-electrons.com wrote:

 Hello,
 
 I'm currently porting the SECO iMX6 uQ7 board to mainline, but I'm
 facing a hang when enabling DCache (CONFIG_SYS_DCACHE_OFF undefined).
 Last week I asked on the #u-boot chan if anybody already encountered
 such a bug, and someone (named malik) suggested to check my DDR timings.
 
 After a few more tests and checks I decided to port my changes to an
 older version (2014.04), and it apparently works.
 I haven't bisected to find the exact commit that makes it fails yet,
 but before doing that I'd like to know if anyone else already
 experienced this kind of problem, or has any idea of what could cause
 this.

I've seen similar problem when porting to v2014.04. The problem
disappeared after including the mx6_common.h in the board config
file. This header file contains some errata configs, so please try
with

#include mx6_common.h

in your board config file.

HTH,

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


Re: [U-Boot] [PATCH 1/3] dm: Prevent demo hello and demo status segfaults

2015-02-03 Thread Simon Glass
On 3 February 2015 at 12:18, Peter Tyser pty...@xes-inc.com wrote:
 Segfaults can occur when a mandatory argument is not provided to
 demo hello and demo status.  Eg:

= demo hello
Segmentation fault (core dumped)

 Add a check to ensure all required arguments are provided.

 Signed-off-by: Peter Tyser pty...@xes-inc.com
 ---
  common/cmd_demo.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

Thanks!

Acked-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] dm: Prevent demo hello and demo status segfaults

2015-02-03 Thread Peter Tyser
Segfaults can occur when a mandatory argument is not provided to
demo hello and demo status.  Eg:

   = demo hello
   Segmentation fault (core dumped)

Add a check to ensure all required arguments are provided.

Signed-off-by: Peter Tyser pty...@xes-inc.com
---
 common/cmd_demo.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/cmd_demo.c b/common/cmd_demo.c
index 652c61c..b8b8578 100644
--- a/common/cmd_demo.c
+++ b/common/cmd_demo.c
@@ -76,7 +76,9 @@ static int do_demo(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
ARRAY_SIZE(demo_commands));
argc -= 2;
argv += 2;
-   if (!demo_cmd || argc  demo_cmd-maxargs)
+
+   if ((!demo_cmd || argc  demo_cmd-maxargs) ||
+   ((demo_cmd-name[0] != 'l')  (argc  1)))
return CMD_RET_USAGE;
 
if (argc) {
-- 
1.9.1

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


Re: [U-Boot] [PATCH 1/3] dm: Prevent demo hello and demo status segfaults

2015-02-03 Thread Peter Tyser
Hi Simon,

On Tue, 2015-02-03 at 13:18 -0600, Peter Tyser wrote:
 Segfaults can occur when a mandatory argument is not provided to
 demo hello and demo status.  Eg:
 
= demo hello
Segmentation fault (core dumped)
 
 Add a check to ensure all required arguments are provided.
 
 Signed-off-by: Peter Tyser pty...@xes-inc.com

The 1/3 in the subject line is an error - there are no other
patches in the series.

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


Re: [U-Boot] Patch to add support for BAV335x boards

2015-02-03 Thread Albert ARIBAUD
Hello Gilles,

On Mon, 2 Feb 2015 23:40:02 -0800, Gilles gil...@gigadevices.com
wrote:
 Hi Folks,
 
 I just added support for the BAV335x OEM boards 
 http://birdland.com/oem/bav335x-network-processor/
 
 This patch was generated with the patman tool which reported no checks, 
 warnings nor errors.
 
 The patch is relative to the v2015.01 tag.

Your mail's subject should be the one produced by patman, and the patch
should be in the mail body, not in an attachment.

Actually, patman would have handled all this for you and more (CC:s,
etc) if it had not been prevented from sending the mail itself.

Did patman abort before it could send the mail? If so, then you should
fix your patman configuration; or at least, you could send the mail
through git send-email (which you might have to install in addition to
git itself).

Please read tools/patman/README and set up your patman -- that'll save
time to both you and the list.

 Cheers,
 Gilles

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


[U-Boot] [PATCH] sunxi: configs/sunxi-common.h: Enable CONFIG_CMD_PART

2015-02-03 Thread Hans de Goede
The recent changes to config_distro_bootcmd.h require CONFIG_CMD_PART to be
defined, as the default bootcmd not uses the part command.

This fixes sunxi boards not booting with v2015.04-rc1.

Signed-off-by: Hans de Goede hdego...@redhat.com
---
 include/configs/sunxi-common.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index bf60dcb..9e145f0 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -144,6 +144,9 @@
 #define CONFIG_CMD_MEMORY
 #define CONFIG_CMD_SETEXPR
 
+#define CONFIG_PARTITION_UUIDS
+#define CONFIG_CMD_PART
+
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_INITRD_TAG
-- 
2.2.2

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


Re: [U-Boot] [PATCH] mpc837xerdb: fix Calling __hwconfig without a buffer warning

2015-02-03 Thread Sinan Akman

Tom Rini wrote:

On 02/03/2015 02:31 PM, Sinan Akman wrote:

  Hi Tom

  As per our discussion with Kim at IRC, could you please
pick this for rc2 :

http://u-boot.10912.n7.nabble.com/PATCH-mpc837xerdb-fix-Calling-hwconfig-without-a-buffer-warning-tp202599.html


OK, I've assigned to myself in patchwork and I'll pick it up soon.  Thanks!


  Perfect. Thanks much.

  I'll now cc you all mpx83xx patches and if we don't
hear from Kim for some time or any other comment I'll
remind you to apply. Kim seems to be fine with this
process.

  BTW, sorry I forgot to cc to the list initially
so adding it now as well.

  Thanks much again

  Sinan Akman

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


[U-Boot] [RFC PATCH] arm: Enable CONFIG_USE_ARCH_MEMSET/MEMCPY globally

2015-02-03 Thread Tom Rini
- Move the obj- lines for memset.S/memcpy.S to outside of an SPL check
  so that SPL can use them as well.
- Make sure memset() / memcpy() end up in a text.fn section for garbage
  collection in SPL.
- Update examples/api/Makefile to get memset() again on ARM.
- Drop Y-MODEM SPL from am335x_evm and USB SPL so that it fits within
  size constraints again.
- Always set CONFIG_USE_ARCH_MEMSET/MEMCPY on ARM  !ARM64

Cc: Albert Aribaud albert.u.b...@aribaud.net
Signed-off-by: Tom Rini tr...@ti.com

---
Aside from needing to split at least the am335x_evm change out (it's
fine to do today, and unused in the usecase am335x_evm_usbspl is for),
the setting of MEMSET/MEMCPY should be done in Kconfig.  This will make
opting out easier if we need that long-term.  The problems today are:
- Lack of arm64 memset/memcpy (Exist in kernel, could be synced over)
- A thumb1? problem on platforms such as taurus that I hope would be
  resolved with a re-sync to the kernel again as there's some minor
  differences between our implementations.

If we're good with the notion of always switching over to the asm
versions of these functions (and keeping it selectable or not?) I can
address some of these problems and of course other feedback.
---
 arch/arm/lib/Makefile|4 ++--
 arch/arm/lib/memcpy.S|2 +-
 arch/arm/lib/memset.S|2 +-
 examples/api/Makefile|3 ++-
 include/config_fallbacks.h   |5 +
 include/configs/am335x_evm.h |2 ++
 6 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index d74e4b8..d4b0742 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -27,11 +27,11 @@ endif
 obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
-obj-$(CONFIG_USE_ARCH_MEMSET) += memset.o
-obj-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
 else
 obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
 endif
+obj-$(CONFIG_USE_ARCH_MEMSET) += memset.o
+obj-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
 obj-$(CONFIG_SEMIHOSTING) += semihosting.o
 
 obj-y  += sections.o
diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S
index eeaf003..ffaee74 100644
--- a/arch/arm/lib/memcpy.S
+++ b/arch/arm/lib/memcpy.S
@@ -58,7 +58,7 @@
ldmfd sp!, {r0, \reg1, \reg2}
.endm
 
-   .text
+   .section .text.memcpy,ax,%progbits
 
 /* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
.syntax unified
diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S
index 7208f20..49bdff7 100644
--- a/arch/arm/lib/memset.S
+++ b/arch/arm/lib/memset.S
@@ -12,7 +12,7 @@
 #include linux/linkage.h
 #include asm/assembler.h
 
-   .text
+   .section .text.memset,ax,%progbits
.align  5
 
.syntax unified
diff --git a/examples/api/Makefile b/examples/api/Makefile
index 6cf23d1..e3c0b6e 100644
--- a/examples/api/Makefile
+++ b/examples/api/Makefile
@@ -28,6 +28,7 @@ EXT_COBJ-y += lib/string.o
 EXT_COBJ-y += lib/time.o
 EXT_COBJ-y += lib/vsprintf.o
 EXT_SOBJ-$(CONFIG_PPC) += arch/powerpc/lib/ppcstring.o
+EXT_SOBJ-$(CONFIG_USE_ARCH_MEMSET) += arch/arm/lib/memset.o
 
 # Create a list of object files to be compiled
 OBJS := $(OBJ-y) $(notdir $(EXT_COBJ-y) $(EXT_SOBJ-y))
@@ -53,5 +54,5 @@ $(addprefix $(obj)/,$(notdir $(EXT_COBJ-y))): $(obj)/%.o: 
lib/%.c FORCE
$(call if_changed_rule,cc_o_c)
 
 # Rule to build architecture-specific library assembly files
-$(addprefix $(obj)/,$(notdir $(EXT_SOBJ-y))): $(obj)/%.o: arch/powerpc/lib/%.S 
FORCE
+$(addprefix $(obj)/,$(notdir $(EXT_SOBJ-y))): $(obj)/%.o: arch/$(ARCH)/lib/%.S 
FORCE
$(call if_changed_dep,as_o_S)
diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h
index ddfe045..dd17573 100644
--- a/include/config_fallbacks.h
+++ b/include/config_fallbacks.h
@@ -97,4 +97,9 @@
 # endif
 #endif
 
+#if defined(CONFIG_ARM)  !defined(CONFIG_ARM64)
+#define CONFIG_USE_ARCH_MEMSET
+#define CONFIG_USE_ARCH_MEMCPY
+#endif
+
 #endif /* __CONFIG_FALLBACKS_H */
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index f1c270c..7a87b46 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -345,6 +345,8 @@
 /* disable EFI partitions and partition UUID support */
 #undef CONFIG_PARTITION_UUIDS
 #undef CONFIG_EFI_PARTITION
+/* Reclaim more space */
+#undef CONFIG_SPL_YMODEM_SUPPORT
 /* General network SPL  */
 #define CONFIG_SPL_NET_SUPPORT
 #define CONFIG_SPL_ENV_SUPPORT
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH] powerpc, mpc5xx: fix compiler warning

2015-02-03 Thread Masahiro Yamada
Hi Heiko,


On Tue,  3 Feb 2015 11:10:19 +0100
Heiko Schocher h...@denx.de wrote:

 executing tools/buildman/buildman mpc5xx drops this warning:
 
 common/spl/spl_nor.c: In function 'spl_nor_load_image':
 common/spl/spl_nor.c:26:10: warning: assignment discards 'const' qualifier 
 from pointer target type [enabled by default]
 
 fix this.
 
 Signed-off-by: Heiko Schocher h...@denx.de
 ---
 
  common/spl/spl_nor.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c
 index 2c0e8e0..dcba2e0 100644
 --- a/common/spl/spl_nor.c
 +++ b/common/spl/spl_nor.c
 @@ -23,7 +23,7 @@ void spl_nor_load_image(void)
* Load Linux from its location in NOR flash to its defined
* location in SDRAM
*/
 - header = (const struct image_header *)CONFIG_SYS_OS_BASE;
 + header = (struct image_header *)CONFIG_SYS_OS_BASE;
  
   if (image_get_os(header) == IH_OS_LINUX) {
   /* happy - was a Linux */
 -- 
 2.1.0



I think you are doing wrong to just suppress the warning.


Both image_get_os() and spl_parse_image_header() expect
const struct image_header * argument.

Add const to struct image_header *header;




Best Regards
Masahiro Yamada

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


Re: [U-Boot] [PATCH] powerpc, mpc5xx: fix compiler warning

2015-02-03 Thread Masahiro Yamada
Hi Heiko,



On Tue,  3 Feb 2015 11:10:19 +0100
Heiko Schocher h...@denx.de wrote:

 executing tools/buildman/buildman mpc5xx drops this warning:
 
 common/spl/spl_nor.c: In function 'spl_nor_load_image':
 common/spl/spl_nor.c:26:10: warning: assignment discards 'const' qualifier 
 from pointer target type [enabled by default]
 
 fix this.
 
 Signed-off-by: Heiko Schocher h...@denx.de
 ---
 
  common/spl/spl_nor.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c
 index 2c0e8e0..dcba2e0 100644
 --- a/common/spl/spl_nor.c
 +++ b/common/spl/spl_nor.c
 @@ -23,7 +23,7 @@ void spl_nor_load_image(void)
* Load Linux from its location in NOR flash to its defined
* location in SDRAM
*/
 - header = (const struct image_header *)CONFIG_SYS_OS_BASE;
 + header = (struct image_header *)CONFIG_SYS_OS_BASE;
  
   if (image_get_os(header) == IH_OS_LINUX) {
   /* happy - was a Linux */
 -- 
 2.1.0



I forgot to mention this:

This patch is not related to powerpc, mpc5xx:
even though you found this when you were building mpc5xx boards.


Please change the prefix of the subject.



Best Regards
Masahiro Yamada

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


[U-Boot] [PATCH 03/12] arc: add more flavours of ARC700 series CPU

2015-02-03 Thread Alexey Brodkin
Now we may select a particular version of ARC700:
 * ARC750D or
 * ARC770D

It allows more flexible (or more fine tuned) configuration of U-Boot.
Before that change we relied on minimal configuration but now we may
use specific features of each CPU.

Moreover allows us to escape manual selection of options that
exist in both CPUs but may have say different version like MMUv2 in
ARC750D vs MMUv3 in ARC770D.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 arch/arc/Kconfig   | 40 
 arch/arc/config.mk |  4 
 arch/arc/include/asm/arcregs.h |  2 ++
 arch/arc/include/asm/cache.h   |  6 ++
 include/configs/arcangel4-be.h |  1 -
 include/configs/arcangel4.h|  1 -
 include/configs/axs101.h   |  1 -
 include/configs/tb100.h|  1 -
 8 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index c6b1efe..f7d2964 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -8,6 +8,46 @@ config SYS_CPU
default arcv1
 
 choice
+   prompt CPU selection
+   default CPU_ARC770D
+
+config CPU_ARC750D
+   bool ARC 750D
+   select ARC_MMU_V2
+   help
+ Choose this option to build an U-Boot for ARC750D CPU.
+
+config CPU_ARC770D
+   bool ARC 770D
+   select ARC_MMU_V3
+   help
+ Choose this option to build an U-Boot for ARC770D CPU.
+
+endchoice
+
+choice
+   prompt MMU Version
+   default ARC_MMU_V3 if CPU_ARC770D
+   default ARC_MMU_V2 if CPU_ARC750D
+
+config ARC_MMU_V2
+   bool MMU v2
+   depends on CPU_ARC750D
+   help
+ Fixed the deficiency of v1 - possible thrashing in memcpy sceanrio
+ when 2 D-TLB and 1 I-TLB entries index into same 2way set.
+
+config ARC_MMU_V3
+   bool MMU v3
+   depends on CPU_ARC770D
+   help
+ Introduced with ARC700 4.10: New Features
+ Variable Page size (1k-16k), var JTLB size 128 x (2 or 4)
+ Shared Address Spaces (SASID)
+
+endchoice
+
+choice
prompt Target select
 
 config TARGET_TB100
diff --git a/arch/arc/config.mk b/arch/arc/config.mk
index 5321987..dd180ef 100644
--- a/arch/arc/config.mk
+++ b/arch/arc/config.mk
@@ -25,6 +25,10 @@ ifdef CONFIG_ARC_MMU_VER
 CONFIG_MMU = 1
 endif
 
+ifdef CONFIG_CPU_ARC770D
+PLATFORM_CPPFLAGS += -mlock -mswape
+endif
+
 PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2
 
 # Needed for relocation
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index 8ace87f..31627e6 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -7,6 +7,8 @@
 #ifndef _ASM_ARC_ARCREGS_H
 #define _ASM_ARC_ARCREGS_H
 
+#include asm/cache.h
+
 /*
  * ARC architecture has additional address space - auxiliary registers.
  * These registers are mostly used for configuration purposes.
diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h
index 16e7568..368d1f0 100644
--- a/arch/arc/include/asm/cache.h
+++ b/arch/arc/include/asm/cache.h
@@ -20,4 +20,10 @@
 #define ARCH_DMA_MINALIGN  128
 #endif
 
+#if defined(CONFIG_ARC_MMU_V2)
+#define CONFIG_ARC_MMU_VER 2
+#elif defined(CONFIG_ARC_MMU_V3)
+#define CONFIG_ARC_MMU_VER 3
+#endif
+
 #endif /* __ASM_ARC_CACHE_H */
diff --git a/include/configs/arcangel4-be.h b/include/configs/arcangel4-be.h
index 2ca209e..a43590b 100644
--- a/include/configs/arcangel4-be.h
+++ b/include/configs/arcangel4-be.h
@@ -11,7 +11,6 @@
  *  CPU configuration
  */
 #define CONFIG_SYS_BIG_ENDIAN
-#define CONFIG_ARC_MMU_VER 3
 #define CONFIG_SYS_CACHELINE_SIZE  64
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
 
diff --git a/include/configs/arcangel4.h b/include/configs/arcangel4.h
index 2afb63d..565f70e 100644
--- a/include/configs/arcangel4.h
+++ b/include/configs/arcangel4.h
@@ -10,7 +10,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_ARC_MMU_VER 3
 #define CONFIG_SYS_CACHELINE_SIZE  64
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
 
diff --git a/include/configs/axs101.h b/include/configs/axs101.h
index a8a9cb3..b94687c 100644
--- a/include/configs/axs101.h
+++ b/include/configs/axs101.h
@@ -10,7 +10,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_ARC_MMU_VER 3
 #define CONFIG_SYS_CACHELINE_SIZE  32
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
 
diff --git a/include/configs/tb100.h b/include/configs/tb100.h
index a598343..f353950 100644
--- a/include/configs/tb100.h
+++ b/include/configs/tb100.h
@@ -12,7 +12,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_ARC_MMU_VER 3
 #define CONFIG_SYS_CACHELINE_SIZE  32
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
 
-- 
2.1.0

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


[U-Boot] [PATCH 04/12] arc: define and use PTAG AUX regs for MMUv3 only

2015-02-03 Thread Alexey Brodkin
DC_PTAG and IC_PTAG registers only exist in MMUv3.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 arch/arc/include/asm/arcregs.h | 4 ++--
 arch/arc/lib/cache.c   | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index 31627e6..6a36a81 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -23,7 +23,7 @@
 #define ARC_AUX_IC_IVIC0x10
 #define ARC_AUX_IC_CTRL0x11
 #define ARC_AUX_IC_IVIL0x19
-#if (CONFIG_ARC_MMU_VER  2)
+#if (CONFIG_ARC_MMU_VER == 3)
 #define ARC_AUX_IC_PTAG0x1E
 #endif
 #define ARC_BCR_IC_BUILD   0x77
@@ -42,7 +42,7 @@
 #define ARC_AUX_DC_IVDL0x4A
 #define ARC_AUX_DC_FLSH0x4B
 #define ARC_AUX_DC_FLDL0x4C
-#if (CONFIG_ARC_MMU_VER  2)
+#if (CONFIG_ARC_MMU_VER == 3)
 #define ARC_AUX_DC_PTAG0x5C
 #endif
 #define ARC_BCR_DC_BUILD   0x72
diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c
index fa19a13..fa2a1e7 100644
--- a/arch/arc/lib/cache.c
+++ b/arch/arc/lib/cache.c
@@ -101,7 +101,7 @@ void flush_dcache_all(void)
 #ifndef CONFIG_SYS_DCACHE_OFF
 static void dcache_flush_line(unsigned addr)
 {
-#if (CONFIG_ARC_MMU_VER  2)
+#if (CONFIG_ARC_MMU_VER == 3)
write_aux_reg(ARC_AUX_DC_PTAG, addr);
 #endif
write_aux_reg(ARC_AUX_DC_FLDL, addr);
@@ -115,7 +115,7 @@ static void dcache_flush_line(unsigned addr)
 * Invalidate I$ for addresses range just flushed from D$.
 * If we try to execute data flushed above it will be valid/correct
 */
-#if (CONFIG_ARC_MMU_VER  2)
+#if (CONFIG_ARC_MMU_VER == 3)
write_aux_reg(ARC_AUX_IC_PTAG, addr);
 #endif
write_aux_reg(ARC_AUX_IC_IVIL, addr);
@@ -145,7 +145,7 @@ void invalidate_dcache_range(unsigned long start, unsigned 
long end)
end = end  (~(CONFIG_SYS_CACHELINE_SIZE - 1));
 
for (addr = start; addr = end; addr += CONFIG_SYS_CACHELINE_SIZE) {
-#if (CONFIG_ARC_MMU_VER  2)
+#if (CONFIG_ARC_MMU_VER == 3)
write_aux_reg(ARC_AUX_DC_PTAG, addr);
 #endif
write_aux_reg(ARC_AUX_DC_IVDL, addr);
-- 
2.1.0

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


[U-Boot] [PATCH 02/12] arc: remove CPU hard-coded selection from board description in include/configs

2015-02-03 Thread Alexey Brodkin
With switch to Kconfig we only need very board-specific descriptions in
include/configs.

CPU selection is performed with either defconfig or manually via
menuconfig.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 include/configs/arcangel4-be.h | 1 -
 include/configs/arcangel4.h| 1 -
 include/configs/axs101.h   | 1 -
 include/configs/tb100.h| 1 -
 4 files changed, 4 deletions(-)

diff --git a/include/configs/arcangel4-be.h b/include/configs/arcangel4-be.h
index 76163ab..2ca209e 100644
--- a/include/configs/arcangel4-be.h
+++ b/include/configs/arcangel4-be.h
@@ -11,7 +11,6 @@
  *  CPU configuration
  */
 #define CONFIG_SYS_BIG_ENDIAN
-#define CONFIG_ARC700
 #define CONFIG_ARC_MMU_VER 3
 #define CONFIG_SYS_CACHELINE_SIZE  64
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
diff --git a/include/configs/arcangel4.h b/include/configs/arcangel4.h
index 81934a4..2afb63d 100644
--- a/include/configs/arcangel4.h
+++ b/include/configs/arcangel4.h
@@ -10,7 +10,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_ARC700
 #define CONFIG_ARC_MMU_VER 3
 #define CONFIG_SYS_CACHELINE_SIZE  64
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
diff --git a/include/configs/axs101.h b/include/configs/axs101.h
index c61ddd6..a8a9cb3 100644
--- a/include/configs/axs101.h
+++ b/include/configs/axs101.h
@@ -10,7 +10,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_ARC700
 #define CONFIG_ARC_MMU_VER 3
 #define CONFIG_SYS_CACHELINE_SIZE  32
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
diff --git a/include/configs/tb100.h b/include/configs/tb100.h
index e9218f7..a598343 100644
--- a/include/configs/tb100.h
+++ b/include/configs/tb100.h
@@ -12,7 +12,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_ARC700
 #define CONFIG_ARC_MMU_VER 3
 #define CONFIG_SYS_CACHELINE_SIZE  32
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
-- 
2.1.0

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


[U-Boot] [PATCH 01/12] arc: memcmp - fix zero-delay loop utilization

2015-02-03 Thread Alexey Brodkin
From: Igor Guryanov gurya...@synopsys.com

It's prohibited to put branch instruction in the very end of zero-delay
loop. On execution this causes Illegal instruction exception.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
Signed-off-by: Igor Guryanov gurya...@synopsys.com
---
 arch/arc/lib/memcmp.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arc/lib/memcmp.S b/arch/arc/lib/memcmp.S
index fa5aac5..87bccab 100644
--- a/arch/arc/lib/memcmp.S
+++ b/arch/arc/lib/memcmp.S
@@ -29,6 +29,7 @@ memcmp:
ld.a%r4, [%r0, 8]
ld.a%r5, [%r1, 8]
brneWORD2, %r12, .Lodd
+   nop
 .Loop_end:
asl_s   SHIFT, SHIFT, 3
bhs_s   .Last_cmp
@@ -105,6 +106,7 @@ memcmp:
ldb.a   %r4, [%r0, 2]
ldb.a   %r5, [%r1, 2]
brne%r3, %r12, .Lbyte_odd
+   nop
 .Lbyte_end:
bcc .Lbyte_even
brne%r4, %r5, .Lbyte_even
-- 
2.1.0

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


[U-Boot] [PATCH 00/12] ARC: more improvements

2015-02-03 Thread Alexey Brodkin
This series is focused on following items:
 * Move more config options to Kconfig
   - Cache settings
   - Endianess
   - Monitor base

 * Clean-up of board configuration headers

 * Build libgcc in U-Boot for portability

Alexey Brodkin (11):
  arc: remove CPU hard-coded selection from board description in
include/configs
  arc: add more flavours of ARC700 series CPU
  arc: define and use PTAG AUX regs for MMUv3 only
  arc: select cache settings via menuconfig
  arc: add selection of endianess in Kconfig
  arc: hard-code CONFIG_SYS_GENERIC_BOARD into asm/config.h
  arc: get rid of useless CONFIG_SKIP_LOWLEVEL_INIT
  arc: hard-code CONFIG_ARCH_EARLY_INIT_R in asm/config.h
  arc: move SYS_MONITOR_BASE setup in Konfig
  arc: move CPU flags selection to the main config.mk
  arc: build libgcc in U-Boot

Igor Guryanov (1):
  arc: memcmp - fix zero-delay loop utilization

 Kconfig|   2 +-
 arch/Kconfig   |   1 +
 arch/arc/Kconfig   |  71 -
 arch/arc/config.mk |  15 ++-
 arch/arc/cpu/arcv1/config.mk   |   7 --
 arch/arc/include/asm/arcregs.h |   6 +-
 arch/arc/include/asm/cache.h   |  19 ++--
 arch/arc/include/asm/config.h  |   2 +
 arch/arc/lib/Makefile  |   2 +
 arch/arc/lib/_millicodethunk.S | 226 +
 arch/arc/lib/cache.c   |   7 +-
 arch/arc/lib/libgcc2.c | 161 +
 arch/arc/lib/libgcc2.h | 132 
 arch/arc/lib/memcmp.S  |   2 +
 board/synopsys/Kconfig |  10 --
 board/synopsys/MAINTAINERS |   1 -
 configs/arcangel4-be_defconfig |   4 +-
 configs/arcangel4_defconfig|   1 +
 configs/axs101_defconfig   |   5 +-
 configs/tb100_defconfig|   4 +-
 include/configs/arcangel4-be.h |  91 -
 include/configs/arcangel4.h|  12 ---
 include/configs/axs101.h   |  15 ---
 include/configs/tb100.h|  10 --
 24 files changed, 639 insertions(+), 167 deletions(-)
 delete mode 100644 arch/arc/cpu/arcv1/config.mk
 create mode 100644 arch/arc/lib/_millicodethunk.S
 create mode 100644 arch/arc/lib/libgcc2.c
 create mode 100644 arch/arc/lib/libgcc2.h
 delete mode 100644 include/configs/arcangel4-be.h

-- 
2.1.0

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


[U-Boot] [PATCH 07/12] arc: hard-code CONFIG_SYS_GENERIC_BOARD into asm/config.h

2015-02-03 Thread Alexey Brodkin
There're no other options for ARC except generic board so ther's no
point to define CONFIG_SYS_GENERIC_BOARD per board.

We now have it set fo all ARC boards.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 arch/arc/include/asm/config.h | 1 +
 include/configs/arcangel4.h   | 1 -
 include/configs/axs101.h  | 1 -
 include/configs/tb100.h   | 1 -
 4 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arc/include/asm/config.h b/arch/arc/include/asm/config.h
index e5be078..c1e9b44 100644
--- a/arch/arc/include/asm/config.h
+++ b/arch/arc/include/asm/config.h
@@ -7,6 +7,7 @@
 #ifndef __ASM_ARC_CONFIG_H_
 #define __ASM_ARC_CONFIG_H_
 
+#define CONFIG_SYS_GENERIC_BOARD
 #define CONFIG_SYS_GENERIC_GLOBAL_DATA
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
 
diff --git a/include/configs/arcangel4.h b/include/configs/arcangel4.h
index 3268c56..60f3077 100644
--- a/include/configs/arcangel4.h
+++ b/include/configs/arcangel4.h
@@ -15,7 +15,6 @@
 /*
  * Board configuration
  */
-#define CONFIG_SYS_GENERIC_BOARD
 #define CONFIG_SKIP_LOWLEVEL_INIT  /* U-Boot is in RAM already */
 
 #define CONFIG_ARCH_EARLY_INIT_R
diff --git a/include/configs/axs101.h b/include/configs/axs101.h
index ff3fad3..2340d99 100644
--- a/include/configs/axs101.h
+++ b/include/configs/axs101.h
@@ -15,7 +15,6 @@
 /*
  * Board configuration
  */
-#define CONFIG_SYS_GENERIC_BOARD
 #define CONFIG_SKIP_LOWLEVEL_INIT  /* U-Boot is in RAM already */
 
 #define CONFIG_ARCH_EARLY_INIT_R
diff --git a/include/configs/tb100.h b/include/configs/tb100.h
index 32675c4..c6878fc 100644
--- a/include/configs/tb100.h
+++ b/include/configs/tb100.h
@@ -17,7 +17,6 @@
 /*
  * Board configuration
  */
-#define CONFIG_SYS_GENERIC_BOARD
 #define CONFIG_ARCH_EARLY_INIT_R
 
 /*
-- 
2.1.0

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


[U-Boot] [PATCH 05/12] arc: select cache settings via menuconfig

2015-02-03 Thread Alexey Brodkin
This change allows to keep board description clean and minimalistic.
This is especially helpful if one board may house different CPUs with
different features.

It is applicable to both FPGA-based boards or those that have CPUs
mounted on interchnagable daughter-boards.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 arch/arc/Kconfig   | 19 +++
 arch/arc/include/asm/cache.h   | 13 +
 arch/arc/lib/cache.c   |  1 +
 configs/axs101_defconfig   |  4 +++-
 configs/tb100_defconfig|  3 ++-
 include/configs/arcangel4-be.h |  1 -
 include/configs/arcangel4.h|  1 -
 include/configs/axs101.h   |  4 
 include/configs/tb100.h|  1 -
 9 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index f7d2964..397b179 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -47,6 +47,25 @@ config ARC_MMU_V3
 
 endchoice
 
+config SYS_ICACHE_OFF
+   bool Do not use Instruction Cache
+   default n
+
+config SYS_DCACHE_OFF
+   bool Do not use Data Cache
+   default n
+
+config ARC_CACHE_LINE_SHIFT
+   int Cache Line Length (as power of 2)
+   range 5 7
+   default 6
+   depends on !SYS_DCACHE_OFF || !SYS_DCACHE_OFF
+   help
+ Starting with ARC700 4.9, Cache line length is configurable,
+ This option specifies N, with Line-len = 2 power N
+ So line lengths of 32, 64, 128 are specified by 5,6,7, respectively
+ Linux only supports same line lengths for I and D caches.
+
 choice
prompt Target select
 
diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h
index 368d1f0..2725961 100644
--- a/arch/arc/include/asm/cache.h
+++ b/arch/arc/include/asm/cache.h
@@ -9,15 +9,12 @@
 
 #include config.h
 
-/*
- * The current upper bound for ARC L1 data cache line sizes is 128 bytes.
- * We use that value for aligning DMA buffers unless the board config has
- * specified an alternate cache line size.
- */
-#ifdef CONFIG_SYS_CACHELINE_SIZE
-#define ARCH_DMA_MINALIGN  CONFIG_SYS_CACHELINE_SIZE
+#ifdef CONFIG_ARC_CACHE_LINE_SHIFT
+#define CONFIG_SYS_CACHELINE_SIZE  (1  CONFIG_ARC_CACHE_LINE_SHIFT)
+#define ARCH_DMA_MINALIGN  CONFIG_SYS_CACHELINE_SIZE
 #else
-#define ARCH_DMA_MINALIGN  128
+/* Satisfy users of ARCH_DMA_MINALIGN */
+#define ARCH_DMA_MINALIGN  128
 #endif
 
 #if defined(CONFIG_ARC_MMU_V2)
diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c
index fa2a1e7..a227723 100644
--- a/arch/arc/lib/cache.c
+++ b/arch/arc/lib/cache.c
@@ -6,6 +6,7 @@
 
 #include config.h
 #include asm/arcregs.h
+#include asm/cache.h
 
 /* Bit values in IC_CTRL */
 #define IC_CTRL_CACHE_DISABLE  (1  0)
diff --git a/configs/axs101_defconfig b/configs/axs101_defconfig
index 5c0ca11..d165e41 100644
--- a/configs/axs101_defconfig
+++ b/configs/axs101_defconfig
@@ -1,3 +1,5 @@
 CONFIG_ARC=y
 CONFIG_TARGET_AXS101=y
-CONFIG_SYS_CLK_FREQ=75000
\ No newline at end of file
+CONFIG_SYS_CLK_FREQ=75000
+CONFIG_ARC_CACHE_LINE_SHIFT=5
+CONFIG_SYS_DCACHE_OFF=y
\ No newline at end of file
diff --git a/configs/tb100_defconfig b/configs/tb100_defconfig
index d2de03b..e17a495 100644
--- a/configs/tb100_defconfig
+++ b/configs/tb100_defconfig
@@ -1,3 +1,4 @@
 CONFIG_ARC=y
 CONFIG_TARGET_TB100=y
-CONFIG_SYS_CLK_FREQ=5
\ No newline at end of file
+CONFIG_SYS_CLK_FREQ=5
+CONFIG_ARC_CACHE_LINE_SHIFT=5
diff --git a/include/configs/arcangel4-be.h b/include/configs/arcangel4-be.h
index a43590b..b0bc8bc 100644
--- a/include/configs/arcangel4-be.h
+++ b/include/configs/arcangel4-be.h
@@ -11,7 +11,6 @@
  *  CPU configuration
  */
 #define CONFIG_SYS_BIG_ENDIAN
-#define CONFIG_SYS_CACHELINE_SIZE  64
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
 
 /*
diff --git a/include/configs/arcangel4.h b/include/configs/arcangel4.h
index 565f70e..3268c56 100644
--- a/include/configs/arcangel4.h
+++ b/include/configs/arcangel4.h
@@ -10,7 +10,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_SYS_CACHELINE_SIZE  64
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
 
 /*
diff --git a/include/configs/axs101.h b/include/configs/axs101.h
index b94687c..ff3fad3 100644
--- a/include/configs/axs101.h
+++ b/include/configs/axs101.h
@@ -10,12 +10,8 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_SYS_CACHELINE_SIZE  32
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
 
-/* NAND controller DMA doesn't work correctly with D$ enabled */
-#define CONFIG_SYS_DCACHE_OFF
-
 /*
  * Board configuration
  */
diff --git a/include/configs/tb100.h b/include/configs/tb100.h
index f353950..32675c4 100644
--- a/include/configs/tb100.h
+++ b/include/configs/tb100.h
@@ -12,7 +12,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_SYS_CACHELINE_SIZE  32
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
 
 /*
-- 
2.1.0

___
U-Boot mailing list

[U-Boot] [PATCH 06/12] arc: add selection of endianess in Kconfig

2015-02-03 Thread Alexey Brodkin
This change allows to keep board description clean and minimalistic.
This is especially helpful if one board may house different CPUs with
different features.

It is applicable to both FPGA-based boards or those that have CPUs
mounted on interchnagable daughter-boards.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 arch/arc/Kconfig   |  9 +++--
 arch/arc/config.mk |  4 +-
 board/synopsys/Kconfig | 10 -
 board/synopsys/MAINTAINERS |  1 -
 configs/arcangel4-be_defconfig |  3 +-
 include/configs/arcangel4-be.h | 88 --
 6 files changed, 11 insertions(+), 104 deletions(-)
 delete mode 100644 include/configs/arcangel4-be.h

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 397b179..04fc7b6 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -47,6 +47,12 @@ config ARC_MMU_V3
 
 endchoice
 
+config CPU_BIG_ENDIAN
+   bool Enable Big Endian Mode
+   default n
+   help
+ Build kernel for Big Endian Mode of ARC CPU
+
 config SYS_ICACHE_OFF
bool Do not use Instruction Cache
default n
@@ -75,9 +81,6 @@ config TARGET_TB100
 config TARGET_ARCANGEL4
bool Support arcangel4
 
-config TARGET_ARCANGEL4_BE
-   bool Support arcangel4-be
-
 config TARGET_AXS101
bool Support axs101
 
diff --git a/arch/arc/config.mk b/arch/arc/config.mk
index dd180ef..4f2d31f 100644
--- a/arch/arc/config.mk
+++ b/arch/arc/config.mk
@@ -4,8 +4,10 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifndef CONFIG_SYS_BIG_ENDIAN
+ifndef CONFIG_CPU_BIG_ENDIAN
 CONFIG_SYS_LITTLE_ENDIAN = 1
+else
+CONFIG_SYS_BIG_ENDIAN = 1
 endif
 
 ifdef CONFIG_SYS_LITTLE_ENDIAN
diff --git a/board/synopsys/Kconfig b/board/synopsys/Kconfig
index f614f88..8ab48cd 100644
--- a/board/synopsys/Kconfig
+++ b/board/synopsys/Kconfig
@@ -7,13 +7,3 @@ config SYS_CONFIG_NAME
default arcangel4
 
 endif
-
-if TARGET_ARCANGEL4_BE
-
-config SYS_VENDOR
-   default synopsys
-
-config SYS_CONFIG_NAME
-   default arcangel4-be
-
-endif
diff --git a/board/synopsys/MAINTAINERS b/board/synopsys/MAINTAINERS
index 720edd8..43114ce 100644
--- a/board/synopsys/MAINTAINERS
+++ b/board/synopsys/MAINTAINERS
@@ -3,5 +3,4 @@ M:  Alexey Brodkin abrod...@synopsys.com
 S: Maintained
 F: include/configs/arcangel4.h
 F: configs/arcangel4_defconfig
-F: include/configs/arcangel4-be.h
 F: configs/arcangel4-be_defconfig
diff --git a/configs/arcangel4-be_defconfig b/configs/arcangel4-be_defconfig
index 0c3ab4e..5d2e126 100644
--- a/configs/arcangel4-be_defconfig
+++ b/configs/arcangel4-be_defconfig
@@ -1,3 +1,4 @@
 CONFIG_ARC=y
-CONFIG_TARGET_ARCANGEL4_BE=y
+CONFIG_TARGET_ARCANGEL4=y
 CONFIG_SYS_CLK_FREQ=7000
+CONFIG_CPU_BIG_ENDIAN=y
diff --git a/include/configs/arcangel4-be.h b/include/configs/arcangel4-be.h
deleted file mode 100644
index b0bc8bc..000
--- a/include/configs/arcangel4-be.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#ifndef _CONFIG_ARCANGEL4_H_
-#define _CONFIG_ARCANGEL4_H_
-
-/*
- *  CPU configuration
- */
-#define CONFIG_SYS_BIG_ENDIAN
-#define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
-
-/*
- * Board configuration
- */
-#define CONFIG_SYS_GENERIC_BOARD
-#define CONFIG_SKIP_LOWLEVEL_INIT  /* U-Boot is in RAM already */
-
-#define CONFIG_ARCH_EARLY_INIT_R
-
-/*
- * Memory configuration
- */
-#define CONFIG_SYS_TEXT_BASE   0x8100
-#define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE
-
-#define CONFIG_SYS_DDR_SDRAM_BASE  0x8000
-#define CONFIG_SYS_SDRAM_BASE  CONFIG_SYS_DDR_SDRAM_BASE
-#define CONFIG_SYS_SDRAM_SIZE  0x1000  /* 256 Mb */
-
-#define CONFIG_SYS_INIT_SP_ADDR\
-   (CONFIG_SYS_SDRAM_BASE + 0x1000 - GENERATED_GBL_DATA_SIZE)
-
-#define CONFIG_SYS_MALLOC_LEN  0x20/* 2 MB */
-#define CONFIG_SYS_BOOTM_LEN   0x200   /* 32 MB */
-#define CONFIG_SYS_LOAD_ADDR   0x8200
-
-#define CONFIG_SYS_NO_FLASH
-
-/*
- * UART configuration
- *
- */
-#define CONFIG_ARC_SERIAL
-#define CONFIG_ARC_UART_BASE   0xC0FC1000
-#define CONFIG_BAUDRATE115200
-
-/*
- * Command line configuration
- */
-#include config_cmd_default.h
-
-#define CONFIG_CMD_ELF
-
-#define CONFIG_OF_LIBFDT
-
-#define CONFIG_AUTO_COMPLETE
-#define CONFIG_SYS_MAXARGS 16
-
-/*
- * Environment settings
- */
-#define CONFIG_ENV_IS_NOWHERE
-#define CONFIG_ENV_SIZE0x00200 /* 512 bytes */
-#define CONFIG_ENV_OFFSET  0
-
-/*
- * Environment configuration
- */
-#define CONFIG_BOOTDELAY   3
-#define CONFIG_BOOTFILEuImage
-#define CONFIG_BOOTARGSconsole=ttyARC0,115200n8
-#define CONFIG_LOADADDRCONFIG_SYS_LOAD_ADDR
-
-/*
- * Console 

[U-Boot] [PATCH 09/12] arc: hard-code CONFIG_ARCH_EARLY_INIT_R in asm/config.h

2015-02-03 Thread Alexey Brodkin
Common arch_early_init_r() is used in arc/lib/cpu.c for all ARC boards
so there's no sense in separate per-board definitions.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 arch/arc/include/asm/config.h | 1 +
 include/configs/arcangel4.h   | 5 -
 include/configs/axs101.h  | 5 -
 include/configs/tb100.h   | 5 -
 4 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/arch/arc/include/asm/config.h b/arch/arc/include/asm/config.h
index c1e9b44..b4e9099 100644
--- a/arch/arc/include/asm/config.h
+++ b/arch/arc/include/asm/config.h
@@ -10,6 +10,7 @@
 #define CONFIG_SYS_GENERIC_BOARD
 #define CONFIG_SYS_GENERIC_GLOBAL_DATA
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
+#define CONFIG_ARCH_EARLY_INIT_R
 
 #define CONFIG_LMB
 
diff --git a/include/configs/arcangel4.h b/include/configs/arcangel4.h
index 003a45d..80d6438 100644
--- a/include/configs/arcangel4.h
+++ b/include/configs/arcangel4.h
@@ -13,11 +13,6 @@
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
 
 /*
- * Board configuration
- */
-#define CONFIG_ARCH_EARLY_INIT_R
-
-/*
  * Memory configuration
  */
 #define CONFIG_SYS_TEXT_BASE   0x8100
diff --git a/include/configs/axs101.h b/include/configs/axs101.h
index 4064ed2..e9a3231 100644
--- a/include/configs/axs101.h
+++ b/include/configs/axs101.h
@@ -12,11 +12,6 @@
  */
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
 
-/*
- * Board configuration
- */
-#define CONFIG_ARCH_EARLY_INIT_R
-
 #define ARC_FPGA_PERIPHERAL_BASE   0xE000
 #define ARC_APB_PERIPHERAL_BASE0xF000
 #define ARC_DWMMC_BASE (ARC_FPGA_PERIPHERAL_BASE + 0x15000)
diff --git a/include/configs/tb100.h b/include/configs/tb100.h
index c6878fc..54eca6f 100644
--- a/include/configs/tb100.h
+++ b/include/configs/tb100.h
@@ -15,11 +15,6 @@
 #define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
 
 /*
- * Board configuration
- */
-#define CONFIG_ARCH_EARLY_INIT_R
-
-/*
  * Memory configuration
  */
 #define CONFIG_SYS_TEXT_BASE   0x8400
-- 
2.1.0

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


[U-Boot] [PATCH 12/12] arc: build libgcc in U-Boot

2015-02-03 Thread Alexey Brodkin
This way we may have very limited set of functions implemented so we
save some space.

Also it allows us to build U-Boot for any ARC core with the same one
toolchain because we don't rely on pre-built libgcc.

For example:
 * we may use little-endian toolchain but build U-Boot for ether
endianess
 * we may use non-multilibbed uClibc toolchain but build U-Boot for
whatever ARC CPU flavour that current GCC supports

Private libgcc built from generic C implementation contributes only 144
bytes to .text section so we don't see significant degradation of size:
---8---
$ arc-linux-size u-boot.libgcc-prebuilt
   textdata bss dec hex filename
 17   24912  214820  461949   70c7d u-boot.libgcc-prebuilt

$ arc-linux-size u-boot.libgcc-private
   textdata bss dec hex filename
 222361   24912  214820  462093   70d0d u-boot.libgcc-private
---8---

Also I don't notice visible performance degradation compared to
pre-built libgcc (where at least *div* functions are had-written in
assembly) on typical operations of downloading 10Mb uImage over TFTP and
bootm.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 arch/Kconfig   |   1 +
 arch/arc/Kconfig   |   3 +
 arch/arc/config.mk |   3 +
 arch/arc/lib/Makefile  |   2 +
 arch/arc/lib/_millicodethunk.S | 226 +
 arch/arc/lib/libgcc2.c | 161 +
 arch/arc/lib/libgcc2.h | 132 
 7 files changed, 528 insertions(+)
 create mode 100644 arch/arc/lib/_millicodethunk.S
 create mode 100644 arch/arc/lib/libgcc2.c
 create mode 100644 arch/arc/lib/libgcc2.h

diff --git a/arch/Kconfig b/arch/Kconfig
index f63cc5a..132123b 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -4,6 +4,7 @@ choice
 
 config ARC
bool ARC architecture
+   select HAVE_PRIVATE_LIBGCC
 
 config ARM
bool ARM architecture
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 04fc7b6..a8dc4e2 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -4,6 +4,9 @@ menu ARC architecture
 config SYS_ARCH
default arc
 
+config USE_PRIVATE_LIBGCC
+   default y
+
 config SYS_CPU
default arcv1
 
diff --git a/arch/arc/config.mk b/arch/arc/config.mk
index 3e75e60..f1e81b6 100644
--- a/arch/arc/config.mk
+++ b/arch/arc/config.mk
@@ -12,11 +12,14 @@ endif
 
 ifdef CONFIG_SYS_LITTLE_ENDIAN
 ARC_CROSS_COMPILE := arc-buildroot-linux-uclibc-
+PLATFORM_LDFLAGS += -EL
+PLATFORM_CPPFLAGS += -mlittle-endian
 endif
 
 ifdef CONFIG_SYS_BIG_ENDIAN
 ARC_CROSS_COMPILE := arceb-buildroot-linux-uclibc-
 PLATFORM_LDFLAGS += -EB
+PLATFORM_CPPFLAGS += -mbig-endian
 endif
 
 ifeq ($(CROSS_COMPILE),)
diff --git a/arch/arc/lib/Makefile b/arch/arc/lib/Makefile
index bae4419..b8028c9 100644
--- a/arch/arc/lib/Makefile
+++ b/arch/arc/lib/Makefile
@@ -20,3 +20,5 @@ obj-y += reset.o
 obj-y += timer.o
 
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
+
+lib-$(CONFIG_USE_PRIVATE_LIBGCC) += _millicodethunk.o libgcc2.o
diff --git a/arch/arc/lib/_millicodethunk.S b/arch/arc/lib/_millicodethunk.S
new file mode 100644
index 000..b332416
--- /dev/null
+++ b/arch/arc/lib/_millicodethunk.S
@@ -0,0 +1,226 @@
+/*
+ * Copyright (C) 1995, 1997, 2007-2013 Free Software Foundation, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+ /* ANSI concatenation macros.  */
+
+ #define CONCAT1(a, b) CONCAT2(a, b)
+ #define CONCAT2(a, b) a ## b
+
+ /* Use the right prefix for global labels.  */
+
+ #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
+
+#ifndef WORKING_ASSEMBLER
+#define abs_l abs
+#define asl_l asl
+#define mov_l mov
+#endif
+
+#define FUNC(X) .type SYM(X),@function
+#define HIDDEN_FUNC(X) FUNC(X)` .hidden X
+#define ENDFUNC0(X) .Lfe_##X: .size X,.Lfe_##X-X
+#define ENDFUNC(X)  ENDFUNC0(X)
+
+   .section .text
+   .align 4
+   .global SYM(__st_r13_to_r15)
+   .global SYM(__st_r13_to_r16)
+   .global SYM(__st_r13_to_r17)
+   .global SYM(__st_r13_to_r18)
+   .global SYM(__st_r13_to_r19)
+   .global SYM(__st_r13_to_r20)
+   .global SYM(__st_r13_to_r21)
+   .global SYM(__st_r13_to_r22)
+   .global SYM(__st_r13_to_r23)
+   .global SYM(__st_r13_to_r24)
+   .global SYM(__st_r13_to_r25)
+   HIDDEN_FUNC(__st_r13_to_r15)
+   HIDDEN_FUNC(__st_r13_to_r16)
+   HIDDEN_FUNC(__st_r13_to_r17)
+   HIDDEN_FUNC(__st_r13_to_r18)
+   HIDDEN_FUNC(__st_r13_to_r19)
+   HIDDEN_FUNC(__st_r13_to_r20)
+   HIDDEN_FUNC(__st_r13_to_r21)
+   HIDDEN_FUNC(__st_r13_to_r22)
+   HIDDEN_FUNC(__st_r13_to_r23)
+   HIDDEN_FUNC(__st_r13_to_r24)
+   HIDDEN_FUNC(__st_r13_to_r25)
+   .align 4
+SYM(__st_r13_to_r25):
+   st r25, [sp,48]
+SYM(__st_r13_to_r24):
+   st r24, [sp,44]
+SYM(__st_r13_to_r23):
+   st r23, [sp,40]
+SYM(__st_r13_to_r22):
+   st r22, [sp,36]
+SYM(__st_r13_to_r21):
+   st r21, [sp,32]
+SYM(__st_r13_to_r20):
+   st r20, [sp,28]

[U-Boot] [PATCH 08/12] arc: get rid of useless CONFIG_SKIP_LOWLEVEL_INIT

2015-02-03 Thread Alexey Brodkin
Currently there's nothing related to really low-level init on ARC so
CONFIG_SKIP_LOWLEVEL_INIT definition makes no sense.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 include/configs/arcangel4.h | 2 --
 include/configs/axs101.h| 2 --
 2 files changed, 4 deletions(-)

diff --git a/include/configs/arcangel4.h b/include/configs/arcangel4.h
index 60f3077..003a45d 100644
--- a/include/configs/arcangel4.h
+++ b/include/configs/arcangel4.h
@@ -15,8 +15,6 @@
 /*
  * Board configuration
  */
-#define CONFIG_SKIP_LOWLEVEL_INIT  /* U-Boot is in RAM already */
-
 #define CONFIG_ARCH_EARLY_INIT_R
 
 /*
diff --git a/include/configs/axs101.h b/include/configs/axs101.h
index 2340d99..4064ed2 100644
--- a/include/configs/axs101.h
+++ b/include/configs/axs101.h
@@ -15,8 +15,6 @@
 /*
  * Board configuration
  */
-#define CONFIG_SKIP_LOWLEVEL_INIT  /* U-Boot is in RAM already */
-
 #define CONFIG_ARCH_EARLY_INIT_R
 
 #define ARC_FPGA_PERIPHERAL_BASE   0xE000
-- 
2.1.0

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


[U-Boot] [PATCH 10/12] arc: move SYS_MONITOR_BASE setup in Konfig

2015-02-03 Thread Alexey Brodkin
Following SPARK ARC now has SYS_MONITOR_BASE setup via Kconfig.
This makes include/configs/*.h cleaner and more flexible.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 Kconfig| 2 +-
 configs/arcangel4-be_defconfig | 1 +
 configs/arcangel4_defconfig| 1 +
 configs/axs101_defconfig   | 3 ++-
 configs/tb100_defconfig| 1 +
 include/configs/arcangel4.h| 1 -
 include/configs/axs101.h   | 1 -
 include/configs/tb100.h| 1 -
 8 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Kconfig b/Kconfig
index 4157da3..145421a 100644
--- a/Kconfig
+++ b/Kconfig
@@ -138,7 +138,7 @@ config SYS_EXTRA_OPTIONS
  new boards should not use this option.
 
 config SYS_TEXT_BASE
-   depends on SPARC
+   depends on SPARC || ARC
hex Text Base
help
  TODO: Move CONFIG_SYS_TEXT_BASE for all the architecture
diff --git a/configs/arcangel4-be_defconfig b/configs/arcangel4-be_defconfig
index 5d2e126..979f26e 100644
--- a/configs/arcangel4-be_defconfig
+++ b/configs/arcangel4-be_defconfig
@@ -2,3 +2,4 @@ CONFIG_ARC=y
 CONFIG_TARGET_ARCANGEL4=y
 CONFIG_SYS_CLK_FREQ=7000
 CONFIG_CPU_BIG_ENDIAN=y
+CONFIG_SYS_TEXT_BASE=0x8100
diff --git a/configs/arcangel4_defconfig b/configs/arcangel4_defconfig
index a63ef21..797595f 100644
--- a/configs/arcangel4_defconfig
+++ b/configs/arcangel4_defconfig
@@ -1,3 +1,4 @@
 CONFIG_ARC=y
 CONFIG_TARGET_ARCANGEL4=y
 CONFIG_SYS_CLK_FREQ=7000
+CONFIG_SYS_TEXT_BASE=0x8100
diff --git a/configs/axs101_defconfig b/configs/axs101_defconfig
index d165e41..34ed963 100644
--- a/configs/axs101_defconfig
+++ b/configs/axs101_defconfig
@@ -2,4 +2,5 @@ CONFIG_ARC=y
 CONFIG_TARGET_AXS101=y
 CONFIG_SYS_CLK_FREQ=75000
 CONFIG_ARC_CACHE_LINE_SHIFT=5
-CONFIG_SYS_DCACHE_OFF=y
\ No newline at end of file
+CONFIG_SYS_DCACHE_OFF=y
+CONFIG_SYS_TEXT_BASE=0x8100
\ No newline at end of file
diff --git a/configs/tb100_defconfig b/configs/tb100_defconfig
index e17a495..b0e8c9f 100644
--- a/configs/tb100_defconfig
+++ b/configs/tb100_defconfig
@@ -2,3 +2,4 @@ CONFIG_ARC=y
 CONFIG_TARGET_TB100=y
 CONFIG_SYS_CLK_FREQ=5
 CONFIG_ARC_CACHE_LINE_SHIFT=5
+CONFIG_SYS_TEXT_BASE=0x8400
diff --git a/include/configs/arcangel4.h b/include/configs/arcangel4.h
index 80d6438..5e4097f 100644
--- a/include/configs/arcangel4.h
+++ b/include/configs/arcangel4.h
@@ -15,7 +15,6 @@
 /*
  * Memory configuration
  */
-#define CONFIG_SYS_TEXT_BASE   0x8100
 #define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE
 
 #define CONFIG_SYS_DDR_SDRAM_BASE  0x8000
diff --git a/include/configs/axs101.h b/include/configs/axs101.h
index e9a3231..5fb8aca 100644
--- a/include/configs/axs101.h
+++ b/include/configs/axs101.h
@@ -20,7 +20,6 @@
 /*
  * Memory configuration
  */
-#define CONFIG_SYS_TEXT_BASE   0x8100
 #define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE
 
 #define CONFIG_SYS_DDR_SDRAM_BASE  0x8000
diff --git a/include/configs/tb100.h b/include/configs/tb100.h
index 54eca6f..46df406 100644
--- a/include/configs/tb100.h
+++ b/include/configs/tb100.h
@@ -17,7 +17,6 @@
 /*
  * Memory configuration
  */
-#define CONFIG_SYS_TEXT_BASE   0x8400
 #define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE
 
 #define CONFIG_SYS_DDR_SDRAM_BASE  0x8000
-- 
2.1.0

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


[U-Boot] [PATCH 11/12] arc: move CPU flags selection to the main config.mk

2015-02-03 Thread Alexey Brodkin
As a preparation to ARCv2 port submission we're moving CPU slection
flags to a common location.
Also it will allow us to have more flexible CPU specification, not only
ISA version but CPU family as well checking CONFIG_ARC_CPU_xxx.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 arch/arc/config.mk   | 6 +-
 arch/arc/cpu/arcv1/config.mk | 7 ---
 2 files changed, 5 insertions(+), 8 deletions(-)
 delete mode 100644 arch/arc/cpu/arcv1/config.mk

diff --git a/arch/arc/config.mk b/arch/arc/config.mk
index 4f2d31f..3e75e60 100644
--- a/arch/arc/config.mk
+++ b/arch/arc/config.mk
@@ -27,8 +27,12 @@ ifdef CONFIG_ARC_MMU_VER
 CONFIG_MMU = 1
 endif
 
+ifdef CONFIG_CPU_ARC750D
+PLATFORM_CPPFLAGS += -marc700
+endif
+
 ifdef CONFIG_CPU_ARC770D
-PLATFORM_CPPFLAGS += -mlock -mswape
+PLATFORM_CPPFLAGS += -marc700 -mlock -mswape
 endif
 
 PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2
diff --git a/arch/arc/cpu/arcv1/config.mk b/arch/arc/cpu/arcv1/config.mk
deleted file mode 100644
index 3206ff4..000
--- a/arch/arc/cpu/arcv1/config.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -mA7
-- 
2.1.0

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


[U-Boot] [PATCH] ARM: at91: at91sam9rlek: add hush parser to defconfig

2015-02-03 Thread Josh Wu
HUSH parser will handle the variable easier. That will be helpful for
write a complicated U-Boot commands or varaibles.

Signed-off-by: Josh Wu josh...@atmel.com
---

 configs/at91sam9rlek_dataflash_defconfig | 1 +
 configs/at91sam9rlek_mmc_defconfig   | 1 +
 configs/at91sam9rlek_nandflash_defconfig | 1 +
 3 files changed, 3 insertions(+)

diff --git a/configs/at91sam9rlek_dataflash_defconfig 
b/configs/at91sam9rlek_dataflash_defconfig
index 90516e0..c811ad5 100644
--- a/configs/at91sam9rlek_dataflash_defconfig
+++ b/configs/at91sam9rlek_dataflash_defconfig
@@ -1,3 +1,4 @@
 CONFIG_SYS_EXTRA_OPTIONS=AT91SAM9RL,SYS_USE_DATAFLASH
 CONFIG_ARM=y
 CONFIG_TARGET_AT91SAM9RLEK=y
+CONFIG_HUSH_PARSER=y
diff --git a/configs/at91sam9rlek_mmc_defconfig 
b/configs/at91sam9rlek_mmc_defconfig
index b93c881..8704140 100644
--- a/configs/at91sam9rlek_mmc_defconfig
+++ b/configs/at91sam9rlek_mmc_defconfig
@@ -1,3 +1,4 @@
 CONFIG_SYS_EXTRA_OPTIONS=AT91SAM9RL,SYS_USE_MMC
 CONFIG_ARM=y
 CONFIG_TARGET_AT91SAM9RLEK=y
+CONFIG_HUSH_PARSER=y
diff --git a/configs/at91sam9rlek_nandflash_defconfig 
b/configs/at91sam9rlek_nandflash_defconfig
index 0e2edfd..e3de043 100644
--- a/configs/at91sam9rlek_nandflash_defconfig
+++ b/configs/at91sam9rlek_nandflash_defconfig
@@ -1,3 +1,4 @@
 CONFIG_SYS_EXTRA_OPTIONS=AT91SAM9RL,SYS_USE_NANDFLASH
 CONFIG_ARM=y
 CONFIG_TARGET_AT91SAM9RLEK=y
+CONFIG_HUSH_PARSER=y
-- 
1.9.1

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


Re: [U-Boot] [RFC PATCH 0/21] ARM: start to move SoC code into arch/arm/mach-*

2015-02-03 Thread Albert ARIBAUD
Hello Simon,

On Sun, 1 Feb 2015 09:23:05 -0700, Simon Glass s...@chromium.org wrote:
 Hi Albert,

 [...]

 I think the ARM core name is a convenient way of splitting things up
 and has served us well. But now the common elements are more at the
 SOC level. Yes the idea of arch/arm/soc/mach-... is more pure from a
 hierarchical point of view, but arch/arm/mach-... would be my
 preference. I feel that arch/arm is underused now, and U-Boot is
 growing so we should try to 'balance' the source tree, making sure
 each level of the hierarchy justifies itself with enough
 files/subdirs, etc.
 
 [...]

Can't say I like directory entry count as a criterion for structuring a
source code tree, but apart from that nitpick, the rest of your and
others' explanations (skipped here for clarity) makes sense. Oh well,
I'll have to learn to live without a soc subdir. :)

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


[U-Boot] Patch to add support for BAV335x boards

2015-02-03 Thread Gilles
Hi Folks,

I just added support for the BAV335x OEM boards 
http://birdland.com/oem/bav335x-network-processor/

This patch was generated with the patman tool which reported no checks, 
warnings nor errors.

The patch is relative to the v2015.01 tag.

Cheers,
Gilles
.


0001-Adding-Support-for-BAV335x-boards.patch
Description: Binary data
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/5] microblaze: Move architecture to use generic board init

2015-02-03 Thread Michal Simek
Hi Simon,

On 02/03/2015 12:58 AM, Simon Glass wrote:
 Hi Michal,
 
 On 2 February 2015 at 08:46, Michal Simek michal.si...@xilinx.com wrote:
 Compile code with -fPIC to get GOT. Do not build SPL
 with fPIC because it increasing SPL size for nothing.

 Signed-off-by: Michal Simek michal.si...@xilinx.com
 ---

 Changes in v2:
 - Use dram_init instead of init_func_ram()
   Suggested by Simon

 This code requires
 common/board_r: manual relocation for cmd table
 http://lists.denx.de/pipermail/u-boot/2015-January/201965.html

 Not fully happy about it because compare to previous solution adds
 almost +60k on size for doing the same thing as before.

 15: microblaze: Move architecture to use generic board init
 microblaze: (for 1/1 boards)  all +52268.0  bss -4.0  data +11724.0
 rodata -2676.0  spl/u-boot-spl:all +36.0  spl/u-boot-spl:data +36.0
 text +43224.0
 microblaze-generic:  all +52268  bss -4  data +11724  rodata
 -2676  spl/u-boot-spl:all +36  spl/u-boot-spl:data +36  text +43224

 Depends on:
 http://lists.denx.de/pipermail/u-boot/2015-January/203277.html
 
 Yes that seems crazy.
 
 You can use -B to see what code is added. Can you figure it out?

I was checking this with our toolchain guy and expectation with fPIC/fPIE
is 20% bigger code and I am below that.

I was checking -B output too and it is adding bytes to every function
that's why the sum is that big.

Thanks,
Michal


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


Re: [U-Boot] [RFC PATCH] dm: Add support for all targets which requires MANUAL_RELOC

2015-02-03 Thread Simon Glass
Hi Michal,

On 3 February 2015 at 02:11, Michal Simek michal.si...@xilinx.com wrote:
 Hi Simon,

 On 02/03/2015 03:02 AM, Masahiro Yamada wrote:
 Hi.


 On Mon, 2 Feb 2015 16:57:15 -0700
 Simon Glass s...@chromium.org wrote:

 Hi Michal,

 On 2 February 2015 at 08:31, Michal Simek michal.si...@xilinx.com wrote:
 Targets with CONFIG_NEEDS_MANUAL_RELOC do not use REL/RELA
 relocation (mostly only GOT) where functions aray are not
 updated. This patch is fixing function pointers for DM core
 and serial-uclass to ensure that relocated functions are called.

 Signed-off-by: Michal Simek michal.si...@xilinx.com
 ---

  drivers/core/root.c| 64 
 ++
  drivers/serial/serial-uclass.c | 16 +++
  2 files changed, 80 insertions(+)

 How long will we have to carry this patch? It seems that if we add any
 new driver we will have to add more code like this?



 This patch is unfortunate.
 Can we discontinue CONFIG_NEEDS_MANUAL_RELOC some day?

 This patch (or similar one) has to be alive when we have platform
 which requires CONFIG_NEEDS_MANUAL_RELOC for full u-boot.
 There is an option to move to REL/RELA but the question is if
 all platforms have it/support it. Unfortunately I think that
 it will be in the tree for a long time.


 If we use SPL, we do not have to relocate code, I think.

 SPL doesn't have relocation that's why this code is not used there.

Maybe I asked this before, but when can we remove
CONFIG_NEEDS_MANUAL_RELOC? What platforms need it?

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


Re: [U-Boot] [PATCH 2/9] sunxi: Move SPL s_init() code to board_init_f()

2015-02-03 Thread Simon Glass
Hi,

On 2 February 2015 at 22:29, Simon Glass s...@chromium.org wrote:
 Hi,

 On 2 February 2015 at 01:07, Hans de Goede hdego...@redhat.com wrote:
 Hi Simon, Siarhei,

 On 01-02-15 21:59, Simon Glass wrote:

 Hi Siarhei,

 On 1 February 2015 at 11:37, Siarhei Siamashka
 siarhei.siamas...@gmail.com


 snip

 A comprehensive FEL usage guide is supposed to be in the linux-sunxi
 wiki. But it might be not very up to date with the mainline u-boot
 usage.

 Anyway, first just clone the https://github.com/linux-sunxi/sunxi-tools
 repository and build it. This will provide you with the x86 binary of
 the 'fel' tool, which is used on your desktop PC to talk with the
 device.

 Then connect the device to your PC using a USB A to USB mini/micro B
 cable. And reset the board while keeping the FEL button pressed. The
 button might be labelled as UPGRADE on your pcduino3 board:
 http://linux-sunxi.org/LinkSprite_pcDuino_V3#FEL_mode

 Then just run fel ver command:
 http://linux-sunxi.org/FEL#Running_the_fel_tool

 If everything is fine, it should respond with something like this:
 AWUSBFEX soc=00162500(A13) 0001 ver=0001 44 08 scratchpad=7e00
  

 Now you can use write commands to upload data to SRAM. And exe
 command to execute functions on the device (works as some kind of RPC):
 http://linux-sunxi.org/FEL/USBBoot#Manual_loading

 As a simple test, you can upload just a single bx lr instruction
 (compiled in ARM mode) to the address 0x2000 and try to execute it.
 In the case if your code screws up something and does not return
 control to the BROM correctly, then the fel tool can't communicate
 over USB anymore and just timeouts. Regarding the address space, you
 can use SRAM addresses starting from 0x2000 up to something like 0x5E00
 (that's where the stack pointer is set). This was a description of a
 bare metal FEL usage.

 Now as for the u-boot support. You can compile and run u-boot in the FEL
 mode configuration on pcduino3 in the following way:

 make CROSS_COMPILE=arm-none-gnueabi- Linksprite_pcDuino3_felconfig
 make CROSS_COMPILE=arm-none-gnueabi- -j2

 fel write 0x2000 spl/u-boot-spl.bin
 fel exe 0x2000

 sleep 1 # Wait for DRAM initialization to complete


 i.e. wait for U-Boot SPL to return to the BROM?


 fel write 0x4a00 u-boot.bin
 fel exe 0x4a00

 Please note the use of '*_felconfig' instead of '*_defconfig'.
 And also right now the FEL mode support is broken. That's why the
 http://lists.denx.de/pipermail/u-boot/2015-January/203282.html
 patchset tried to address this problem.


 OK that looks like an excellent guide, thank you. I will make some time to
 take a more detailed look at this as soon as I can, but definitely in the
 next few days.


 I've been reading all threads on this, thank you both for looking into this,
 since you're on it I'm going to leave this be (and not review / apply
 Siarhei's patches for this), and we can revisit this later, with hopefully a
 better fix.

 Thanks to Siarhei's instructions I have a working setup with pcduino3.
 One less board where I have to swap SD cards. Can I suggest that it
 would be really nice to have a README.sunxi that covers all of this?

 Anyway I will fiddle around and see what I can come up with.

The problem seems to be the start.S code 'Setup vector' and
cpu_init_cp15. If I remove these then FEL boots OK without all the
gdata/r9 stuff and with the rest of the boot flow normal.

I would quite like FEL to be an option you enable, but we can detect
whether it is actually being used (as with Tegra and Exynos). Perhaps
checking the value of lr will allow this to work.

I'm not sure of the best way to skip the vector/cp15 setup. For now I
can do an #ifdef but I'm wondering if we should allow
save_boot_params() to return some flags indicating what should be
skipped?

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


Re: [U-Boot] SPL DM

2015-02-03 Thread Simon Glass
Hi Michal,

On 3 February 2015 at 08:46, Michal Simek mon...@monstr.eu wrote:
 Hi Simon,

 On 02/03/2015 03:11 PM, Simon Glass wrote:
 Hi Michal,

 On 3 February 2015 at 06:16, Michal Simek mon...@monstr.eu wrote:
 Hi Simon,

 I am playing with driver model and I have moved uartlite to it and
 it is working fine for normal u-boot +10k but SPL size is dramatically
 bigger. Without DM I can fit to 3k but now it has ~16k.

 microblaze-generic:  all +10759  bss +4  data +560  rodata +1379
 spl/u-boot-spl:all +9100  spl/u-boot-spl:bss -4  spl/u-boot-spl:data -48
  spl/u-boot-spl:rodata +5660  spl/u-boot-spl:text +3492  text +8816

 This 9k is after removing all printf calling which is adding 6kB.


 diff --git a/common/malloc_simple.c b/common/malloc_simple.c
 index afdacff80d8e..a9e4d96738a0 100644
 --- a/common/malloc_simple.c
 +++ b/common/malloc_simple.c
 @@ -19,7 +19,7 @@ void *malloc_simple(size_t bytes)

 new_ptr = gd-malloc_ptr + bytes;
 if (new_ptr  gd-malloc_limit)
 -   panic(Out of pre-reloc memory);
 +   puts(Out of pre-reloc memory);
 ptr = map_sysmem(gd-malloc_base + gd-malloc_ptr, bytes);
 gd-malloc_ptr = ALIGN(new_ptr, sizeof(new_ptr));
 return ptr;
 diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
 index 3fc7104359d3..d56fafcb8ee2 100644
 --- a/drivers/serial/serial-uclass.c
 +++ b/drivers/serial/serial-uclass.c
 @@ -72,7 +72,7 @@ static void serial_find_console_or_panic(void)
 if (uclass_get_device_by_seq(UCLASS_SERIAL, INDEX, dev) 
 uclass_get_device(UCLASS_SERIAL, INDEX, dev) 
 (uclass_first_device(UCLASS_SERIAL, dev) || !dev))
 -   panic(No serial driver found);
 +   puts(No serial driver found);
  #undef INDEX
 gd-cur_serial_dev = dev;
  }


 Here is diff between versions. I have setup CONFIG_SYS_MALLOC_SIMPLE
 Simon: Have you tried to to reduce size in this too?
 Interesting part is that new uartlite functions are not called that's why I 
 am expecting
 any other problem.

  spl-u-boot-spl: add: 27/-13, grow: 2/-1 bytes: 4024/-576 
 (3448)
  function   old new   
 delta
  device_bind  - 596
 +596
  device_probe_child   - 508
 +508
  uclass_get   - 296
 +296
  lists_bind_drivers   - 212
 +212
  uclass_resolve_seq   - 188
 +188
  uclass_bind_device   - 180
 +180
  uclass_find_device_by_seq- 172
 +172
  device_bind_by_name  - 152
 +152
  uclass_get_device_by_seq - 140
 +140
  serial_find_console_or_panic - 136
 +136
  uclass_find_device   - 132
 +132
  lists_driver_lookup_name - 128
 +128
  uclass_first_device  - 108
 +108
  dm_init  -  96 
 +96
  _serial_putc -  96 
 +96
  uclass_unbind_device -  92 
 +92
  malloc_simple-  92 
 +92
  uclass_get_device-  88 
 +88
  lists_uclass_lookup  -  80 
 +80
  dm_init_and_scan -  80 
 +80
  calloc   -  80 
 +80
  uclass_find  -  72 
 +72
  uclass_pre_probe_child   -  60 
 +60
  uclass_post_probe_device -  52 
 +52
  strcmp   -  52 
 +52
  dm_scan_platdata -  52 
 +52
  serial_puts 44  80 
 +36
  device_probe -  32 
 +32
  board_init_r   232 248 
 +16
  serial_current   4   - 
  -4
  userial0_setbrg  8   - 
  -8
  serial_init 56  48 
  -8
  userial0_tstc   20   - 
 -20
 

Re: [U-Boot] [PATCH 1/2] cmd_fdt: Actually fix fdt command in sandbox

2015-02-03 Thread Simon Glass
Hi Joe,

On 3 February 2015 at 15:06, Joe Hershberger joe.hershber...@ni.com wrote:
 Commit 90bac29a76bc8d649b41a55f2786c0abef9bb2c1 claims to fix this bug
 that was introduced in commit a92fd6577ea17751ead9b50243e3c562125cf581
 but doesn't actually make the change that the commit message describes.

 Actually fix the bug this time.

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com
 ---

  common/cmd_fdt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Simon Glass s...@chromium.org

set_working_fdt_addr() is very confusing. It should take a ulong as a
parameter, not a void *.


 diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
 index dc59fab..51c585b 100644
 --- a/common/cmd_fdt.c
 +++ b/common/cmd_fdt.c
 @@ -123,7 +123,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, 
 char * const argv[])
 if (control)
 gd-fdt_blob = blob;
 else
 -   set_working_fdt_addr((void *)blob);
 +   set_working_fdt_addr((void *)addr);

 if (argc = 2) {
 int  len;
 --
 1.7.11.5


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


Re: [U-Boot] [PATCH] RSA depends on DM

2015-02-03 Thread Simon Glass
+Masahiro

Hi Chris,

On 3 February 2015 at 00:42, Chris Kuethe chris.kue...@gmail.com wrote:
 Discovered while experimenting with signature checking on vexpress
 which doesn't typically use DM. Rather than complaining about unmet
 dependencies it might be better to enable those them.

 ---
  lib/rsa/Kconfig | 1 +
  1 file changed, 1 insertion(+)

 diff --git a/lib/rsa/Kconfig b/lib/rsa/Kconfig
 index 1268a1b..4db5da4 100644
 --- a/lib/rsa/Kconfig
 +++ b/lib/rsa/Kconfig
 @@ -2,6 +2,7 @@ config RSA
   bool Use RSA Library
   select RSA_FREESCALE_EXP if FSL_CAAM
   select RSA_SOFTWARE_EXP if !RSA_FREESCALE_EXP
 + select DM
   help
RSA support. This enables the RSA algorithm used for FIT image
verification in U-Boot.

I wonder whether 'depends on DM' might be better? It seems odd to have
the tail wagging the dog.

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


Re: [U-Boot] [PATCH V3] cmd_i2c: Provide option for bulk 'i2c write' in one transaction

2015-02-03 Thread Simon Glass
Hi Masahiro,

On 3 February 2015 at 01:35, Masahiro Yamada yamad...@jp.panasonic.com wrote:
 Hi Simon,


 On Tue, 3 Feb 2015 10:10:02 +0200
 Lubomir Popov lpo...@mm-sol.com wrote:

 Hi Simon,

  Hi,
 
  On 30 January 2015 at 10:56, Lubomir Popov lpo...@mm-sol.com wrote:
  I2C chips do exist that require a write of some multi-byte data to occur 
  in
  a single bus transaction (aka atomic transfer), otherwise either the write
  does not come into effect at all, or normal operation of internal 
  circuitry
  cannot be guaranteed. The current implementation of the 'i2c write' 
  command
  (transfer of multiple bytes from a memory buffer) in fact performs a 
  separate
  transaction for each byte to be written and thus cannot support such 
  types of
  I2C slave devices.
 
  This patch provides an alternative by allowing 'i2c write' to execute the
  write transfer of the given number of bytes in a single bus transaction if
  the '-s' option is specified as a final command argument. Else the current
  re-addressing method is used.
 
  Signed-off-by: Lubomir Popov l-po...@ti.com




 Can we support pagesize property in Driver Model I2C?

 The binding information is written in
 Documentation/devicetree/bindings/eeprom.txt  of Linux Kernel.

 If it is possible, it would help make the write access faster.
 (Sorry, I have not taken a close look.)

 Perhaps, it may also satisfy Lubomir's demand ??


I think this is slightly different - some devices cannot support
writes with more than one data value at a time - they require a
separate address cycle before each data value.

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


Re: [U-Boot] [PATCH] RSA depends on DM

2015-02-03 Thread Chris Kuethe
On Tue, Feb 3, 2015 at 4:38 PM, Simon Glass s...@chromium.org wrote:
 +Masahiro

 Hi Chris,

 On 3 February 2015 at 00:42, Chris Kuethe chris.kue...@gmail.com wrote:
 Discovered while experimenting with signature checking on vexpress
 which doesn't typically use DM. Rather than complaining about unmet
 dependencies it might be better to enable those them.

 ---
  lib/rsa/Kconfig | 1 +
  1 file changed, 1 insertion(+)

 diff --git a/lib/rsa/Kconfig b/lib/rsa/Kconfig
 index 1268a1b..4db5da4 100644
 --- a/lib/rsa/Kconfig
 +++ b/lib/rsa/Kconfig
 @@ -2,6 +2,7 @@ config RSA
   bool Use RSA Library
   select RSA_FREESCALE_EXP if FSL_CAAM
   select RSA_SOFTWARE_EXP if !RSA_FREESCALE_EXP
 + select DM
   help
RSA support. This enables the RSA algorithm used for FIT image
verification in U-Boot.

 I wonder whether 'depends on DM' might be better? It seems odd to have
 the tail wagging the dog.

 Regards,
 Simon

No, that would not be better because a few lines down,
RSA_SOFTWARE_EXP and RSA_FREESCALE_EXP both say depends on DM but
they don't actually enable it if they need it.

As a user, my expectation is that when I turn on some high level
feature, that will enable all of its lower level dependencies. Would
it be less strange to make FIT_SIGNATURE turn on DM instead of RSA?

-- 
GDB has a 'break' feature; why doesn't it have 'fix' too?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH] ARMv8: add Kconfig and CPU_V8 option

2015-02-03 Thread fenghua
From: David Feng feng...@phytium.com.cn

This patch add Kconfig to armv8.

Signed-off-by: David Feng feng...@phytium.com.cn
---
 arch/arm/Kconfig   |   16 +++-
 arch/arm/cpu/armv8/Kconfig |   10 ++
 2 files changed, 21 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/cpu/armv8/Kconfig

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 986b4c5..a01cb3c 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -33,6 +33,10 @@ config CPU_V7
 bool
 select HAS_VBAR
 
+config CPU_V8
+bool
+select ARM64
+
 config CPU_PXA
 bool
 
@@ -729,24 +733,24 @@ config TEGRA
 
 config TARGET_VEXPRESS64_AEMV8A
bool Support vexpress_aemv8a
-   select ARM64
+   select CPU_V8
 
 config TARGET_VEXPRESS64_BASE_FVP
bool Support Versatile Express ARMv8a FVP BASE model
-   select ARM64
+   select CPU_V8
select SEMIHOSTING
 
 config TARGET_VEXPRESS64_JUNO
bool Support Versatile Express Juno Development Platform
-   select ARM64
+   select CPU_V8
 
 config TARGET_LS2085A_EMU
bool Support ls2085a_emu
-   select ARM64
+   select CPU_V8
 
 config TARGET_LS2085A_SIMU
bool Support ls2085a_simu
-   select ARM64
+   select CPU_V8
 
 config TARGET_LS1021AQDS
bool Support ls1021aqds
@@ -855,6 +859,8 @@ source arch/arm/cpu/armv7/zynq/Kconfig
 
 source arch/arm/cpu/armv7/Kconfig
 
+source arch/arm/cpu/armv8/Kconfig
+
 source board/aristainetos/Kconfig
 source board/BuR/kwb/Kconfig
 source board/BuR/tseries/Kconfig
diff --git a/arch/arm/cpu/armv8/Kconfig b/arch/arm/cpu/armv8/Kconfig
new file mode 100644
index 000..5953848
--- /dev/null
+++ b/arch/arm/cpu/armv8/Kconfig
@@ -0,0 +1,10 @@
+if CPU_V8
+
+menu ARMv8
+
+config ARMV8_SWITCH_TO_EL1
+   boolean Switch to exception level 1 when loading OS
+
+endmenu
+
+endif
-- 
1.7.9.5


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


Re: [U-Boot] [RFC PATCH] dm: Add support for all targets which requires MANUAL_RELOC

2015-02-03 Thread Michal Simek
Hi Simon,

On 02/03/2015 03:02 AM, Masahiro Yamada wrote:
 Hi.
 
 
 On Mon, 2 Feb 2015 16:57:15 -0700
 Simon Glass s...@chromium.org wrote:
 
 Hi Michal,

 On 2 February 2015 at 08:31, Michal Simek michal.si...@xilinx.com wrote:
 Targets with CONFIG_NEEDS_MANUAL_RELOC do not use REL/RELA
 relocation (mostly only GOT) where functions aray are not
 updated. This patch is fixing function pointers for DM core
 and serial-uclass to ensure that relocated functions are called.

 Signed-off-by: Michal Simek michal.si...@xilinx.com
 ---

  drivers/core/root.c| 64 
 ++
  drivers/serial/serial-uclass.c | 16 +++
  2 files changed, 80 insertions(+)

 How long will we have to carry this patch? It seems that if we add any
 new driver we will have to add more code like this?
 
 
 
 This patch is unfortunate.
 Can we discontinue CONFIG_NEEDS_MANUAL_RELOC some day?

This patch (or similar one) has to be alive when we have platform
which requires CONFIG_NEEDS_MANUAL_RELOC for full u-boot.
There is an option to move to REL/RELA but the question is if
all platforms have it/support it. Unfortunately I think that
it will be in the tree for a long time.

 
 If we use SPL, we do not have to relocate code, I think.

SPL doesn't have relocation that's why this code is not used there.

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


[U-Boot] [PATCH] .travis.yml: remove 824x builds

2015-02-03 Thread Heiko Schocher
remove powerpc 824x build, as this architecture not longer
exists.

Signed-off-by: Heiko Schocher h...@denx.de
---

 .travis.yml | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 90f0fd7..923c9dd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -107,9 +107,6 @@ matrix:
 - TEST_CMD=tools/buildman/buildman mpc512x
   INSTALL_TOOLCHAIN=ppc
 - env:
-- TEST_CMD=tools/buildman/buildman mpc824x
-  INSTALL_TOOLCHAIN=ppc
-- env:
 - TEST_CMD=tools/buildman/buildman mpc8260
   INSTALL_TOOLCHAIN=ppc
 - env:
-- 
2.1.0

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


[U-Boot] [PATCH] powerpc, mpc5xx: fix compiler warning

2015-02-03 Thread Heiko Schocher
executing tools/buildman/buildman mpc5xx drops this warning:

common/spl/spl_nor.c: In function 'spl_nor_load_image':
common/spl/spl_nor.c:26:10: warning: assignment discards 'const' qualifier from 
pointer target type [enabled by default]

fix this.

Signed-off-by: Heiko Schocher h...@denx.de
---

 common/spl/spl_nor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c
index 2c0e8e0..dcba2e0 100644
--- a/common/spl/spl_nor.c
+++ b/common/spl/spl_nor.c
@@ -23,7 +23,7 @@ void spl_nor_load_image(void)
 * Load Linux from its location in NOR flash to its defined
 * location in SDRAM
 */
-   header = (const struct image_header *)CONFIG_SYS_OS_BASE;
+   header = (struct image_header *)CONFIG_SYS_OS_BASE;
 
if (image_get_os(header) == IH_OS_LINUX) {
/* happy - was a Linux */
-- 
2.1.0

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


Re: [U-Boot] Zynq Zybo booting with mainline U-Boot

2015-02-03 Thread Michal Simek
Hi Simon and Masahiro,

On 02/03/2015 08:32 AM, Masahiro Yamada wrote:
 Hi Simon,
 
 
 On Mon, 2 Feb 2015 22:00:25 -0700
 Simon Glass s...@chromium.org wrote:
 
 Hi,

 I have one of boards and would like to get mainline U-Boot booting on it.

 I have followed the instructions for creating a BOOT.BIN file comprised of:

 - boot.elf
 - .bit file
 - u-boot.elf

 and putting it on a a micro-SD card.

 This works OK with the diligent master branch from github. I can boot 
 normally.

 However this is 2013.10. Mainline U-Boot uses device tree so
 presumably the elf file does not work. I expect we need to use
 u-boot-dtb.bin.

I think the best what you can do is simple disable CONFIG_OF_CONTROL
from mainline u-boot and do not use now.
This is what I do in xilinx tree but OF_CONTROL is also working fine
but needs some setup.


 However since this is not an elf file I'm not sure how to build the
 image using the 'Create Zynq Boot Image' tool.

 I don't see any instructions in REAME.zynq about how to create an SD card.

 Any pointers please?

 
 
 I have a Zynq ZC706 board.
 
 The follwing is what I tried to run u-boot mainline.
 
 
 I hope it will work for Zybo board, too.

Zybo will be just the same.

 
 
 [1] If you are using Xilinx hardware tool (Vivado or ISE)
 you can generate  ps7_init.[ch] or ps7_init_gpl.[ch].
 
 Copy the C file and the header into borad/xilinx/zynq directory
 
 
 [2] Build
 
 make zynq_zybo_defconfig   make
 
 
 [3] Download the python script to generate boot.bin
 
git clone git://github.com/Xilinx/u-boot-xlnx.git
 
 Copy  tools/zynq-boot-bin.py   to  ~/bin  or somewhere you like


In future I want to move this script to be the part of mkimage
but it has low priority now.



 [4] Generate boot.bin
 
 zynq-boot-bin.py -o boot.bin -u u-boot/spl/u-boot-spl.bin
 
 
 [5] Copy  boot.bin and u-boot-dtb.img  to your SD card
 
 
 
 
 Please give it a try.
 
 The problem about the instruction above is FPAG bit file is not loaded.

yes - but if you use xilinx tree I have also added support for loading
bitstream by SPL. I just haven't sent it to mainline yet.
But you can simple load bitstream in full u-boot which is fully supported
in mainline.


 Another way instead of [4] might be:
 
 
 Describe foo.bif as follows
 
 image:
 {
 [bootloader]fsbl.elf
 fpga.bit
 [load=0x0400,startup=0x0400]u-boot/u-boot-dtb.bin
 }
 
 and 
 $ bootgen -image foo.bif -w on -o boot.bin
 

yes - this should also work.

 I have not working on Zynq these days.

why not? :-)

 I hope Michal can support us.

Simon: Let me know if you need any my help on this.
I have zybo here that I can try it.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP - KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform




signature.asc
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] netconsole: USB Ethernet connection dropping with ping or tftpboot

2015-02-03 Thread Jörg Krause
I followed the instructions from Marek in 'M28 U-Boot Single-Wire Debug
preview' to enable NetConsole:
http://www.denx-cs.de/?q=blogm28singlewiredebug

I'm using mxsldr to flash the u-boot.sb image to RAM. This is the dmesg
output from my host:

[31048.492181] usb 3-13: new high-speed USB device number 24
using xhci_hcd
[31048.667617] cdc_ether 3-13:1.0 eth0: register 'cdc_ether' at
usb-:00:14.0-13, CDC Ethernet Device, 00:19:b8:00:00:01
[31048.669101] cdc_ether 3-13:1.0 enp0s20u13: renamed from eth0
[31048.696758] cdc_ether 3-13:1.0 enp0s20u13: kevent 12 may have
been dropped

I noticed the 'kevent 12 may have been dropped' message here.

Nevertheless, NetworkManager shows me a USB Ethernet connection and
using './netconsole 10.0.0.2' I am able to communicate with the device,
e.g. 'nand info' outputs correctly.

But if I use 'ping 10.0.0.1' or 'tftpboot u-boot.sb' the network
connection drops. Both commands work fine if I switch back from
netconsole to serial in-/output.

This is the output from dmesg:
[31620.215354] usb 3-13: USB disconnect, device number 24
[31620.215422] cdc_ether 3-13:1.0 enp0s20u13: unregister
'cdc_ether' usb-:00:14.0-13, CDC Ethernet Device

Do I missed something?

Best regards
Jörg Krause

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


[U-Boot] Loop Variable through to user space

2015-02-03 Thread André Schaller
Hi all,

during the execution of th MLO I create a variable, whose value I want
to make accessible to user space applications in Android. How can this
be achieved?

One way would be to write the contents of the variable to external
memory and let it read by the user space process. However, I would need
to make sure that during boot no other process is overwriting the address.

Do you know of any other ways?

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


Re: [U-Boot] [RFC PATCH 04/21] ARM: tegra: collect SoC sources into mach-tegra

2015-02-03 Thread Tom Rini
On Wed, Jan 28, 2015 at 11:11:46AM +0900, Masahiro Yamada wrote:
 Hi Stephen,
 
 
 On Mon, 26 Jan 2015 10:40:57 -0700
 Stephen Warren swar...@wwwdotorg.org wrote:
 
  On 01/24/2015 11:11 PM, Masahiro Yamada wrote:
   This commit moves files as follows:
  
 arch/arm/cpu/arm720t/tegra20/*  - arch/arm/mach-tegra/tegra20/*
 arch/arm/cpu/arm720t/tegra30/*  - arch/arm/mach-tegra/tegra30/*
  ...
  
  Bikeshed: I know that this matches what the Linux kernel has for
  32-bit ARM, but I've always disliked using the word machine to
  describe an SoC. Would just tegra or soc-tegra be better than
  mach-tegra? Feel free to entirely ignore this though; I don't feel
  too strongly.
 
 In hindsight, arch/arm/soc-* would have been clearer than arch/arm/mach-*.
 However, we are already familiar with this directory name convention,
 so machine looks OK to me.
 
  Oh and one more thing: We're starting to work on 64-bit Tegra
  support in the Linux kernel. A fair amount of the code moved by this
  patch is likely to apply on both 32-bit and 64-bit Tegra. Will
  arch/arm support 64-bit within U-Boot, or will there be a separate
  directory for 32- and 64-bit ARM? If so, should this code all be
  moved to something more like soc/tegra/... or drivers/tegra/... or
  drivers/soc/tegra/... or ... so it can be shared between the
  architectures?
 
 We had a hot discussion when aarch64 support was introduced to U-Boot.
 
 Finally, the community chose arch/arm/cpu/armv8/ rather than arch/arm64/,
 i.e. single-arch-directory.

And I suspect that at some point we'll also end up moving things from
arch/ into drivers/soc/ to mirror the kernel as well.  But I still think
arch/arm for both is the right direction :)

-- 
Tom


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


<    1   2