[U-Boot] [PATCH V3 10/10] fat: remove old implementation

2015-10-02 Thread Stephen Warren
Now that we've switched to the new FAT filesystem implementation, delete
the old implementation.

Signed-off-by: Stephen Warren 
---
 fs/fat_orig/Kconfig |0
 fs/fat_orig/Makefile|   11 -
 fs/fat_orig/fat.c   | 1360 ---
 fs/fat_orig/fat_write.c | 1122 --
 fs/fat_orig/file.c  |  183 ---
 5 files changed, 2676 deletions(-)
 delete mode 100644 fs/fat_orig/Kconfig
 delete mode 100644 fs/fat_orig/Makefile
 delete mode 100644 fs/fat_orig/fat.c
 delete mode 100644 fs/fat_orig/fat_write.c
 delete mode 100644 fs/fat_orig/file.c

diff --git a/fs/fat_orig/Kconfig b/fs/fat_orig/Kconfig
deleted file mode 100644
index e69de29bb2d1..
diff --git a/fs/fat_orig/Makefile b/fs/fat_orig/Makefile
deleted file mode 100644
index b60e8486c48d..
--- a/fs/fat_orig/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-obj-$(CONFIG_FS_FAT)   := fat.o
-obj-$(CONFIG_FAT_WRITE):= fat_write.o
-
-ifndef CONFIG_SPL_BUILD
-obj-$(CONFIG_FS_FAT)   += file.o
-endif
diff --git a/fs/fat_orig/fat.c b/fs/fat_orig/fat.c
deleted file mode 100644
index f939bc5deed2..
--- a/fs/fat_orig/fat.c
+++ /dev/null
@@ -1,1360 +0,0 @@
-/*
- * fat.c
- *
- * R/O (V)FAT 12/16/32 filesystem implementation by Marcus Sundberg
- *
- * 2002-07-28 - rjo...@nexus-tech.net - ported to ppcboot v1.1.6
- * 2003-03-10 - khar...@nexus-tech.net - ported to uboot
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#ifdef CONFIG_SUPPORT_VFAT
-static const int vfat_enabled = 1;
-#else
-static const int vfat_enabled = 0;
-#endif
-
-/*
- * Convert a string to lowercase.
- */
-static void downcase(char *str)
-{
-   while (*str != '\0') {
-   *str = tolower(*str);
-   str++;
-   }
-}
-
-static block_dev_desc_t *cur_dev;
-static disk_partition_t cur_part_info;
-
-#define DOS_BOOT_MAGIC_OFFSET  0x1fe
-#define DOS_FS_TYPE_OFFSET 0x36
-#define DOS_FS32_TYPE_OFFSET   0x52
-
-static int disk_read(__u32 block, __u32 nr_blocks, void *buf)
-{
-   ulong ret;
-
-   if (!cur_dev || !cur_dev->block_read)
-   return -1;
-
-   ret = cur_dev->block_read(cur_dev->dev,
- cur_part_info.start + block, nr_blocks, buf);
-
-   if (nr_blocks && ret == 0)
-   return -1;
-
-   return ret;
-}
-
-int fat_set_blk_dev(block_dev_desc_t *dev_desc, disk_partition_t *info)
-{
-   ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
-
-   cur_dev = dev_desc;
-   cur_part_info = *info;
-
-   /* Make sure it has a valid FAT header */
-   if (disk_read(0, 1, buffer) != 1) {
-   cur_dev = NULL;
-   return -1;
-   }
-
-   /* Check if it's actually a DOS volume */
-   if (memcmp(buffer + DOS_BOOT_MAGIC_OFFSET, "\x55\xAA", 2)) {
-   cur_dev = NULL;
-   return -1;
-   }
-
-   /* Check for FAT12/FAT16/FAT32 filesystem */
-   if (!memcmp(buffer + DOS_FS_TYPE_OFFSET, "FAT", 3))
-   return 0;
-   if (!memcmp(buffer + DOS_FS32_TYPE_OFFSET, "FAT32", 5))
-   return 0;
-
-   cur_dev = NULL;
-   return -1;
-}
-
-int fat_register_device(block_dev_desc_t *dev_desc, int part_no)
-{
-   disk_partition_t info;
-
-   /* First close any currently found FAT filesystem */
-   cur_dev = NULL;
-
-   /* Read the partition table, if present */
-   if (get_partition_info(dev_desc, part_no, )) {
-   if (part_no != 0) {
-   printf("** Partition %d not valid on device %d **\n",
-   part_no, dev_desc->dev);
-   return -1;
-   }
-
-   info.start = 0;
-   info.size = dev_desc->lba;
-   info.blksz = dev_desc->blksz;
-   info.name[0] = 0;
-   info.type[0] = 0;
-   info.bootable = 0;
-#ifdef CONFIG_PARTITION_UUIDS
-   info.uuid[0] = 0;
-#endif
-   }
-
-   return fat_set_blk_dev(dev_desc, );
-}
-
-/*
- * Get the first occurence of a directory delimiter ('/' or '\') in a string.
- * Return index into string if found, -1 otherwise.
- */
-static int dirdelim(char *str)
-{
-   char *start = str;
-
-   while (*str != '\0') {
-   if (ISDIRDELIM(*str))
-   return str - start;
-   str++;
-   }
-   return -1;
-}
-
-/*
- * Extract zero terminated short name from a directory entry.
- */
-static void get_name(dir_entry *dirent, char *s_name)
-{
-   char *ptr;
-
-   memcpy(s_name, dirent->name, 8);
-   s_name[8] = '\0';
-   ptr = s_name;
-   while (*ptr && *ptr != ' ')
-   ptr++;
-   if (dirent->ext[0] && 

[U-Boot] [PATCH V3 08/10] fat: add U-Boot to ff.c API conversion wrapper

2015-10-02 Thread Stephen Warren
Add a file that converts all the FAT-related APIs used by U-Boot into
ff.c calls. This allows ff.c to provide the FAT implementation for
U-Boot.

Signed-off-by: Stephen Warren 
---
v3:
* Fix writes to truncate the file to the written length.
* Add error cleanup (e.g. fclose()) to a number of functions.
v2:
* Implement fat_register_device(), file_fat_read() for SPL FAT usage.
* Use _MAX_LFN to define size of lfname[] in file_fat_ls().
---
 fs/fat/Kconfig|   0
 fs/fat/Makefile   |   7 +
 fs/fat/ff-uboot.c | 421 ++
 3 files changed, 428 insertions(+)
 create mode 100644 fs/fat/Kconfig
 create mode 100644 fs/fat/Makefile
 create mode 100644 fs/fat/ff-uboot.c

diff --git a/fs/fat/Kconfig b/fs/fat/Kconfig
new file mode 100644
index ..e69de29bb2d1
diff --git a/fs/fat/Makefile b/fs/fat/Makefile
new file mode 100644
index ..c527fc2bb401
--- /dev/null
+++ b/fs/fat/Makefile
@@ -0,0 +1,7 @@
+#
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-$(CONFIG_FS_FAT)   += ff.o
+obj-$(CONFIG_FS_FAT)   += ff-uboot.o
diff --git a/fs/fat/ff-uboot.c b/fs/fat/ff-uboot.c
new file mode 100644
index ..a97254b8aa19
--- /dev/null
+++ b/fs/fat/ff-uboot.c
@@ -0,0 +1,421 @@
+/*
+ * Copyright (C) 2015 Stephen Warren 
+ * (GPL-2.0+)
+ *
+ * Portions taken from U-Boot's previous FAT implementation
+ * R/O (V)FAT 12/16/32 filesystem implementation by Marcus Sundberg
+ * 2002-07-28 - rjo...@nexus-tech.net - ported to ppcboot v1.1.6
+ * 2003-03-10 - khar...@nexus-tech.net - ported to uboot
+ *
+ * Small portions taken from Barebox v2015.07.0
+ * Copyright (c) 2007 Sascha Hauer , Pengutronix
+ * (GPL-2.0)
+ *
+ * SPDX-License-Identifier: GPL-2.0+ GPL-2.0
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include "diskio.h"
+#include "ff.h"
+
+static block_dev_desc_t *fat_dev;
+static disk_partition_t *fat_part;
+static FATFS fat_ff_fs;
+
+/* Functions called by ff.c */
+
+DSTATUS disk_initialize(BYTE pdrv)
+{
+   return 0;
+}
+
+DSTATUS disk_status(BYTE pdrv)
+{
+   return 0;
+}
+
+DRESULT disk_read(BYTE pdrv, BYTE *buff, DWORD sector, UINT count)
+{
+   int ret;
+
+   debug("%s(sector=%d, count=%u)\n", __func__, sector, count);
+
+   ret = fat_dev->block_read(fat_dev->dev, fat_part->start + sector,
+ count, buff);
+   if (ret != count)
+   return RES_ERROR;
+
+   return RES_OK;
+}
+
+DRESULT disk_write(BYTE pdrv, const BYTE *buff, DWORD sector, UINT count)
+{
+   int ret;
+
+   debug("%s(sector=%d, count=%u)\n", __func__, sector, count);
+
+   ret = fat_dev->block_write(fat_dev->dev, fat_part->start + sector,
+  count, buff);
+   if (ret != count)
+   return RES_ERROR;
+
+   return RES_OK;
+}
+
+DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void *buff)
+{
+   debug("%s(cmd=%d)\n", __func__, (int)cmd);
+
+   switch (cmd) {
+   case CTRL_SYNC:
+   return RES_OK;
+   default:
+   return RES_ERROR;
+   }
+}
+
+/* From Barebox v2015.07.0 fs/fat/fat.c */
+WCHAR ff_convert(WCHAR src, UINT dir)
+{
+   if (src <= 0x80)
+   return src;
+   else
+   return '?';
+}
+
+/* From Barebox v2015.07.0 fs/fat/fat.c */
+WCHAR ff_wtoupper(WCHAR chr)
+{
+   if (chr <= 0x80)
+   return toupper(chr);
+   else
+   return '?';
+}
+
+/* Functions that call into ff.c */
+
+int fat_set_blk_dev(block_dev_desc_t *dev, disk_partition_t *part)
+{
+   FRESULT ff_ret;
+
+   debug("%s()\n", __func__);
+
+   fat_dev = dev;
+   fat_part = part;
+
+   ff_ret = f_mount(_ff_fs, "0:", 1);
+   if (ff_ret != FR_OK) {
+   debug("f_mount() failed: %d\n", ff_ret);
+   fat_dev = NULL;
+   fat_part = NULL;
+   return -1;
+   }
+
+   debug("f_mount() succeeded\n");
+   return 0;
+}
+
+int fat_register_device(block_dev_desc_t *dev_desc, int part_no)
+{
+   disk_partition_t info;
+
+   /* First unregister any current FAT filesystem */
+   fat_dev = NULL;
+   fat_part = NULL;
+
+   /* Read the partition table, if present */
+   if (get_partition_info(dev_desc, part_no, )) {
+   if (part_no != 0) {
+   printf("** Partition %d not valid on device %d **\n",
+  part_no, dev_desc->dev);
+   return -1;
+   }
+
+   info.start = 0;
+   info.size = dev_desc->lba;
+   info.blksz = dev_desc->blksz;
+   info.name[0] = 0;
+   info.type[0] = 0;
+   info.bootable = 0;
+#ifdef CONFIG_PARTITION_UUIDS
+   info.uuid[0] = 0;
+#endif
+   }
+
+   return fat_set_blk_dev(dev_desc, );
+}
+
+int file_fat_detectfs(void)
+{
+   

[U-Boot] [PATCH V3 09/10] fat: switch to new FAT implementation

2015-10-02 Thread Stephen Warren
Modify the U-Boot build system to build the new FAT implementation in
fs/fat/ rather than the old implementation in fs/fat_orig/.

Signed-off-by: Stephen Warren 
---
 fs/Kconfig  | 2 +-
 fs/Makefile | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/Kconfig b/fs/Kconfig
index 6017a0136012..41bb0b9f3a47 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -8,7 +8,7 @@ source "fs/ext4/Kconfig"
 
 source "fs/reiserfs/Kconfig"
 
-source "fs/fat_orig/Kconfig"
+source "fs/fat/Kconfig"
 
 source "fs/jffs2/Kconfig"
 
diff --git a/fs/Makefile b/fs/Makefile
index 1614650fb6fe..51d06fccb61e 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -7,7 +7,7 @@
 #
 
 ifdef CONFIG_SPL_BUILD
-obj-$(CONFIG_SPL_FAT_SUPPORT) += fat_orig/
+obj-$(CONFIG_SPL_FAT_SUPPORT) += fat/
 obj-$(CONFIG_SPL_EXT_SUPPORT) += ext4/
 else
 obj-y  += fs.o
@@ -15,7 +15,7 @@ obj-y += fs.o
 obj-$(CONFIG_CMD_CBFS) += cbfs/
 obj-$(CONFIG_CMD_CRAMFS) += cramfs/
 obj-$(CONFIG_FS_EXT4) += ext4/
-obj-y += fat_orig/
+obj-y += fat/
 obj-$(CONFIG_CMD_JFFS2) += jffs2/
 obj-$(CONFIG_CMD_REISER) += reiserfs/
 obj-$(CONFIG_SANDBOX) += sandbox/
-- 
1.9.1

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


[U-Boot] [PATCH V3 07/10] fat: port integer.h to U-Boot types

2015-10-02 Thread Stephen Warren
ff.c uses a bunch of custom typedefs. Define these in terms of standard
types from , so they'll automatically be the correct size
for any build of U-Boot.

Signed-off-by: Stephen Warren 
---
v2: Make INT and UINT 32-bit types e.g. so that f_read() can read (or
at the least, report reading) more than 64KiB-1 bytes. Now,
./test/fs/fs-test.sh passes.
---
 fs/fat/integer.h | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/fs/fat/integer.h b/fs/fat/integer.h
index ef49fdd63423..019b68101122 100644
--- a/fs/fat/integer.h
+++ b/fs/fat/integer.h
@@ -5,6 +5,8 @@
 #ifndef _FF_INTEGER
 #define _FF_INTEGER
 
+#include 
+
 #ifdef _WIN32  /* Development platform */
 
 #include 
@@ -13,20 +15,20 @@
 #else  /* Embedded platform */
 
 /* This type MUST be 8-bit */
-typedef unsigned char  BYTE;
+typedef uint8_tBYTE;
 
 /* These types MUST be 16-bit */
-typedef short  SHORT;
-typedef unsigned short WORD;
-typedef unsigned short WCHAR;
+typedef int16_tSHORT;
+typedef uint16_t   WORD;
+typedef uint16_t   WCHAR;
 
 /* These types MUST be 16-bit or 32-bit */
-typedef intINT;
-typedef unsigned int   UINT;
+typedef int32_tINT;
+typedef uint32_t   UINT;
 
 /* These types MUST be 32-bit */
-typedef long   LONG;
-typedef unsigned long  DWORD;
+typedef int32_tLONG;
+typedef uint32_t   DWORD;
 
 #endif
 
-- 
1.9.1

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


[U-Boot] [PATCH V3 01/10] disk: support host devices in dev_print()

2015-10-02 Thread Stephen Warren
Add a case statement for IF_TYPE_HOST in dev_print() so that it prints
the device type rather than the "device type unknown" message.

Signed-off-by: Stephen Warren 
---
 disk/part.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/disk/part.c b/disk/part.c
index 43485c9148b0..4e72257434b6 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -179,6 +179,9 @@ void dev_print (block_dev_desc_t *dev_desc)
case IF_TYPE_DOC:
puts("device type DOC\n");
return;
+   case IF_TYPE_HOST:
+   puts("host device\n");
+   break;
case IF_TYPE_UNKNOWN:
puts("device type unknown\n");
return;
-- 
1.9.1

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


[U-Boot] [PATCH V3 05/10] fat: ff: read max contiguous file data

2015-10-02 Thread Stephen Warren
Enhance f_read() to find the maximum contiguous set of clusters to read,
and read it all at once (which is fast) rather one by one (which is
slow).

Signed-off-by: Stephen Warren 
---
V3: New patch.
---
 fs/fat/ff.c | 45 -
 1 file changed, 32 insertions(+), 13 deletions(-)

diff --git a/fs/fat/ff.c b/fs/fat/ff.c
index 478daa7d6b0b..0df5a9ddcf7c 100644
--- a/fs/fat/ff.c
+++ b/fs/fat/ff.c
@@ -2593,7 +2593,7 @@ FRESULT f_read (
 )
 {
FRESULT res;
-   DWORD clst, sect, remain;
+   DWORD clst, sect, remain, cfptr, cclst, maxclust;
UINT rcnt, cc;
BYTE csect, *rbuff = (BYTE*)buff;
 
@@ -2614,27 +2614,46 @@ FRESULT f_read (
if ((fp->fptr % SS(fp->fs)) == 0) { /* On the 
sector boundary? */
csect = (BYTE)(fp->fptr / SS(fp->fs) & (fp->fs->csize - 
1));/* Sector offset in the cluster */
if (!csect) {   
/* On the cluster boundary? */
-   if (fp->fptr == 0) {/* On 
the top of the file? */
-   clst = fp->sclust;  
/* Follow from the origin */
-   } else {
/* Middle or end of the file */
+   maxclust = 0;
+   cfptr = fp->fptr;
+   cclst = fp->clust;
+   for (;;) {
+   if (cfptr == 0) {   
/* On the top of the file? */
+   clst = fp->sclust;  
/* Follow from the origin */
+   } else {
/* Middle or end of the file */
 #if _USE_FASTSEEK
-   if (fp->cltbl)
-   clst = clmt_clust(fp, 
fp->fptr);/* Get cluster# from the CLMT */
-   else
+   if (fp->cltbl)
+   clst = clmt_clust(fp, 
cfptr);   /* Get cluster# from the CLMT */
+   else
 #endif
-   clst = get_fat(fp->fs, 
fp->clust);  /* Follow cluster chain on the FAT */
+   clst = get_fat(fp->fs, 
cclst);  /* Follow cluster chain on the FAT */
+   }
+   if (clst < 2) ABORT(fp->fs, FR_INT_ERR);
+   if (clst == 0x) ABORT(fp->fs, 
FR_DISK_ERR);
+   if (!maxclust) {
+   fp->clust = clst;   
/* Update current cluster */
+   } else {
+   if (clst != (cclst + 1))
+   break;
+   }
+   maxclust++;
+   if ((maxclust * fp->fs->csize * 
SS(fp->fs)) >= btr)
+   break;
+   cclst = clst;
+   cfptr += fp->fs->csize * SS(fp->fs);
}
-   if (clst < 2) ABORT(fp->fs, FR_INT_ERR);
-   if (clst == 0x) ABORT(fp->fs, 
FR_DISK_ERR);
-   fp->clust = clst;   
/* Update current cluster */
+   } else {
+   maxclust = 1;
}
sect = clust2sect(fp->fs, fp->clust);   /* Get current 
sector */
+   if (maxclust > 1)
+   fp->clust += (maxclust - 1);
if (!sect) ABORT(fp->fs, FR_INT_ERR);
sect += csect;
cc = btr / SS(fp->fs);  /* When 
remaining bytes >= sector size, */
if (cc) {   
/* Read maximum contiguous sectors directly */
-   if (csect + cc > fp->fs->csize) /* Clip at 
cluster boundary */
-   cc = fp->fs->csize - csect;
+   if (csect + cc > (fp->fs->csize * maxclust))
/* Clip at cluster boundary */
+   cc = (fp->fs->csize * maxclust) - csect;
if 

[U-Boot] [PATCH V3 02/10] fat: move to a different directory

2015-10-02 Thread Stephen Warren
A future patch will add a new implementation of the FAT filesystem in
fat/. Move the old version to fat_orig/ so that the patches which add
the new implementation can add it directly in the final location.

Signed-off-by: Stephen Warren 
---
 fs/Kconfig   | 2 +-
 fs/Makefile  | 4 ++--
 fs/{fat => fat_orig}/Kconfig | 0
 fs/{fat => fat_orig}/Makefile| 0
 fs/{fat => fat_orig}/fat.c   | 0
 fs/{fat => fat_orig}/fat_write.c | 0
 fs/{fat => fat_orig}/file.c  | 0
 7 files changed, 3 insertions(+), 3 deletions(-)
 rename fs/{fat => fat_orig}/Kconfig (100%)
 rename fs/{fat => fat_orig}/Makefile (100%)
 rename fs/{fat => fat_orig}/fat.c (100%)
 rename fs/{fat => fat_orig}/fat_write.c (100%)
 rename fs/{fat => fat_orig}/file.c (100%)

diff --git a/fs/Kconfig b/fs/Kconfig
index 41bb0b9f3a47..6017a0136012 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -8,7 +8,7 @@ source "fs/ext4/Kconfig"
 
 source "fs/reiserfs/Kconfig"
 
-source "fs/fat/Kconfig"
+source "fs/fat_orig/Kconfig"
 
 source "fs/jffs2/Kconfig"
 
diff --git a/fs/Makefile b/fs/Makefile
index 51d06fccb61e..1614650fb6fe 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -7,7 +7,7 @@
 #
 
 ifdef CONFIG_SPL_BUILD
-obj-$(CONFIG_SPL_FAT_SUPPORT) += fat/
+obj-$(CONFIG_SPL_FAT_SUPPORT) += fat_orig/
 obj-$(CONFIG_SPL_EXT_SUPPORT) += ext4/
 else
 obj-y  += fs.o
@@ -15,7 +15,7 @@ obj-y += fs.o
 obj-$(CONFIG_CMD_CBFS) += cbfs/
 obj-$(CONFIG_CMD_CRAMFS) += cramfs/
 obj-$(CONFIG_FS_EXT4) += ext4/
-obj-y += fat/
+obj-y += fat_orig/
 obj-$(CONFIG_CMD_JFFS2) += jffs2/
 obj-$(CONFIG_CMD_REISER) += reiserfs/
 obj-$(CONFIG_SANDBOX) += sandbox/
diff --git a/fs/fat/Kconfig b/fs/fat_orig/Kconfig
similarity index 100%
rename from fs/fat/Kconfig
rename to fs/fat_orig/Kconfig
diff --git a/fs/fat/Makefile b/fs/fat_orig/Makefile
similarity index 100%
rename from fs/fat/Makefile
rename to fs/fat_orig/Makefile
diff --git a/fs/fat/fat.c b/fs/fat_orig/fat.c
similarity index 100%
rename from fs/fat/fat.c
rename to fs/fat_orig/fat.c
diff --git a/fs/fat/fat_write.c b/fs/fat_orig/fat_write.c
similarity index 100%
rename from fs/fat/fat_write.c
rename to fs/fat_orig/fat_write.c
diff --git a/fs/fat/file.c b/fs/fat_orig/file.c
similarity index 100%
rename from fs/fat/file.c
rename to fs/fat_orig/file.c
-- 
1.9.1

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


[U-Boot] [PATCH V3 04/10] fat: ff: add ifdef to avoid unused function warning

2015-10-02 Thread Stephen Warren
Without this, any board that doesn't enable read-write FAT triggers:
fs/fat/ff.c:1331:6: warning: ‘gen_numname’ defined but not used 
[-Wunused-function]

... since gen_numname() is not referenced from dir_register() is ifdef'd
out.

Signed-off-by: Stephen Warren 
---
v2: New patch.
---
 fs/fat/ff.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/fat/ff.c b/fs/fat/ff.c
index 345c174155d1..478daa7d6b0b 100644
--- a/fs/fat/ff.c
+++ b/fs/fat/ff.c
@@ -1374,6 +1374,7 @@ void fit_lfn (
 /*---*/
 /* Create numbered name  */
 /*---*/
+#if !_FS_READONLY
 #if _USE_LFN
 static
 void gen_numname (
@@ -1426,6 +1427,7 @@ void gen_numname (
} while (j < 8);
 }
 #endif
+#endif
 
 
 
-- 
1.9.1

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


[U-Boot] [PATCH V3 06/10] fat: ffconf.h changes for U-Boot port

2015-10-02 Thread Stephen Warren
Turn on _FS_NORTC: This means we don't have to implement get_fattime()
which simplifies life for now.

Automatically set _FS_READONLY based on CONFIG_FAT_WRITE. This requires
including  since we reference CONFIG_*.

Set _USE_LFN to enable long filename handling; an essential feature.

Set _FS_RPATH so that paths components "." and ".." are correctly parsed
and handled. This enables paths such as "/extlinux/../foo" to work.

Set _USE_LABEL so that volume labels can be read.

Signed-off-by: Stephen Warren 
---
 fs/fat/ffconf.h | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/fs/fat/ffconf.h b/fs/fat/ffconf.h
index f4e8e8b1c6d9..34209e0ca13c 100644
--- a/fs/fat/ffconf.h
+++ b/fs/fat/ffconf.h
@@ -1,3 +1,5 @@
+#include 
+
 /*---/
 /  FatFs - FAT file system module configuration file  R0.11a (C)ChaN, 2015
 /---*/
@@ -8,7 +10,11 @@
 / Function Configurations
 /---*/
 
+#ifdef CONFIG_FAT_WRITE
 #define _FS_READONLY   0
+#else
+#define _FS_READONLY   1
+#endif
 /* This option switches read-only configuration. (0:Read/Write or 1:Read-only)
 /  Read-only configuration removes writing API functions, f_write(), f_sync(),
 /  f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree()
@@ -47,7 +53,7 @@
 /* This option switches fast seek feature. (0:Disable or 1:Enable) */
 
 
-#define _USE_LABEL 0
+#define _USE_LABEL 1
 /* This option switches volume label functions, f_getlabel() and f_setlabel().
 /  (0:Disable or 1:Enable) */
 
@@ -90,7 +96,7 @@
 */
 
 
-#define_USE_LFN0
+#define_USE_LFN1
 #define_MAX_LFN255
 /* The _USE_LFN option switches the LFN feature.
 /
@@ -124,7 +130,7 @@
 /  When _LFN_UNICODE is 0, this option has no effect. */
 
 
-#define _FS_RPATH  0
+#define _FS_RPATH  1
 /* This option configures relative path feature.
 /
 /   0: Disable relative path feature and remove related functions.
@@ -200,7 +206,7 @@
 /  data transfer. */
 
 
-#define _FS_NORTC  0
+#define _FS_NORTC  1
 #define _NORTC_MON 1
 #define _NORTC_MDAY1
 #define _NORTC_YEAR2015
-- 
1.9.1

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


[U-Boot] [PATCH 1/3] Revert "powerpc: ppc4xx: remove lwmon5 support"

2015-10-02 Thread Stefan Roese
This reverts commit 8fe11b8901a31d11990488c82bc23612589d57be.

I'll add support to lwmon5 in the next patch and will remove
support for the broken lcd4_lwmon5 as well.

Signed-off-by: Stefan Roese 
Cc: Masahiro Yamada 
---
 arch/powerpc/cpu/ppc4xx/Kconfig|   5 +
 arch/powerpc/include/asm/global_data.h |   6 +
 board/lwmon5/Kconfig   |   9 +
 board/lwmon5/MAINTAINERS   |   7 +
 board/lwmon5/Makefile  |   9 +
 board/lwmon5/config.mk |  18 +
 board/lwmon5/init.S|  75 
 board/lwmon5/kbd.c | 490 +++
 board/lwmon5/lwmon5.c  | 558 ++
 board/lwmon5/sdram.c   | 247 
 configs/lcd4_lwmon5_defconfig  |   6 +
 configs/lwmon5_defconfig   |   4 +
 doc/README.scrapyard   |   1 -
 drivers/video/mb862xx.c|   3 +-
 include/configs/lwmon5.h   | 692 +
 15 files changed, 2128 insertions(+), 2 deletions(-)
 create mode 100644 board/lwmon5/Kconfig
 create mode 100644 board/lwmon5/MAINTAINERS
 create mode 100644 board/lwmon5/Makefile
 create mode 100644 board/lwmon5/config.mk
 create mode 100644 board/lwmon5/init.S
 create mode 100644 board/lwmon5/kbd.c
 create mode 100644 board/lwmon5/lwmon5.c
 create mode 100644 board/lwmon5/sdram.c
 create mode 100644 configs/lcd4_lwmon5_defconfig
 create mode 100644 configs/lwmon5_defconfig
 create mode 100644 include/configs/lwmon5.h

diff --git a/arch/powerpc/cpu/ppc4xx/Kconfig b/arch/powerpc/cpu/ppc4xx/Kconfig
index 23ecc89..8d3ba8d 100644
--- a/arch/powerpc/cpu/ppc4xx/Kconfig
+++ b/arch/powerpc/cpu/ppc4xx/Kconfig
@@ -8,6 +8,10 @@ choice
prompt "Target select"
optional
 
+config TARGET_LWMON5
+   bool "Support lwmon5"
+   select SUPPORT_SPL
+
 config TARGET_T3CORP
bool "Support t3corp"
 
@@ -165,6 +169,7 @@ source "board/gdsys/405ex/Kconfig"
 source "board/gdsys/dlvision/Kconfig"
 source "board/gdsys/gdppc440etx/Kconfig"
 source "board/gdsys/intip/Kconfig"
+source "board/lwmon5/Kconfig"
 source "board/mosaixtech/icon/Kconfig"
 source "board/mpl/mip405/Kconfig"
 source "board/mpl/pip405/Kconfig"
diff --git a/arch/powerpc/include/asm/global_data.h 
b/arch/powerpc/include/asm/global_data.h
index 2527ef8..4090975 100644
--- a/arch/powerpc/include/asm/global_data.h
+++ b/arch/powerpc/include/asm/global_data.h
@@ -106,6 +106,12 @@ struct arch_global_data {
 #ifdef CONFIG_SYS_FPGA_COUNT
unsigned fpga_state[CONFIG_SYS_FPGA_COUNT];
 #endif
+#if defined(CONFIG_WD_MAX_RATE)
+   unsigned long long wdt_last;/* trace watch-dog triggering rate */
+#endif
+#if defined(CONFIG_LWMON5)
+   unsigned long kbd_status;
+#endif
 };
 
 #include 
diff --git a/board/lwmon5/Kconfig b/board/lwmon5/Kconfig
new file mode 100644
index 000..90566d8
--- /dev/null
+++ b/board/lwmon5/Kconfig
@@ -0,0 +1,9 @@
+if TARGET_LWMON5
+
+config SYS_BOARD
+   default "lwmon5"
+
+config SYS_CONFIG_NAME
+   default "lwmon5"
+
+endif
diff --git a/board/lwmon5/MAINTAINERS b/board/lwmon5/MAINTAINERS
new file mode 100644
index 000..7402ab6
--- /dev/null
+++ b/board/lwmon5/MAINTAINERS
@@ -0,0 +1,7 @@
+LWMON5 BOARD
+M: Stefan Roese 
+S: Maintained
+F: board/lwmon5/
+F: include/configs/lwmon5.h
+F: configs/lcd4_lwmon5_defconfig
+F: configs/lwmon5_defconfig
diff --git a/board/lwmon5/Makefile b/board/lwmon5/Makefile
new file mode 100644
index 000..02478ca
--- /dev/null
+++ b/board/lwmon5/Makefile
@@ -0,0 +1,9 @@
+#
+# (C) Copyright 2002-2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y  = lwmon5.o kbd.o sdram.o
+extra-y+= init.o
diff --git a/board/lwmon5/config.mk b/board/lwmon5/config.mk
new file mode 100644
index 000..d0348e8
--- /dev/null
+++ b/board/lwmon5/config.mk
@@ -0,0 +1,18 @@
+#
+# (C) Copyright 2002
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+# lwmon5 (440EPx)
+#
+
+PLATFORM_CPPFLAGS += -DCONFIG_440=1
+
+ifeq ($(debug),1)
+PLATFORM_CPPFLAGS += -DDEBUG
+endif
+
+ifeq ($(dbcr),1)
+PLATFORM_CPPFLAGS += -DCONFIG_SYS_INIT_DBCR=0x8cff
+endif
diff --git a/board/lwmon5/init.S b/board/lwmon5/init.S
new file mode 100644
index 000..e5207c2
--- /dev/null
+++ b/board/lwmon5/init.S
@@ -0,0 +1,75 @@
+/*
+ * (C) Copyright 2007
+ * Stefan Roese, DENX Software Engineering, s...@denx.de.
+ *
+ *  Copyright (C) 2002 Scott McNutt 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+/**
+ * TLB TABLE
+ *
+ * This table is used by the cpu boot code to setup the initial tlb
+ * entries. Rather than make broad assumptions in 

[U-Boot] [PATCH 3/3] ppc4xx: Remove lcd4_lwmon5 support

2015-10-02 Thread Stefan Roese
This platform has not gone into production. So lets remove it.

Signed-off-by: Stefan Roese 
Cc: Masahiro Yamada 
---
 arch/powerpc/cpu/ppc4xx/Kconfig |  1 -
 board/lwmon5/MAINTAINERS|  1 -
 board/lwmon5/lwmon5.c   |  8 --
 board/lwmon5/sdram.c|  2 --
 configs/lcd4_lwmon5_defconfig   |  6 
 include/configs/lwmon5.h| 63 +
 6 files changed, 1 insertion(+), 80 deletions(-)
 delete mode 100644 configs/lcd4_lwmon5_defconfig

diff --git a/arch/powerpc/cpu/ppc4xx/Kconfig b/arch/powerpc/cpu/ppc4xx/Kconfig
index 8d3ba8d..ce58d86 100644
--- a/arch/powerpc/cpu/ppc4xx/Kconfig
+++ b/arch/powerpc/cpu/ppc4xx/Kconfig
@@ -10,7 +10,6 @@ choice
 
 config TARGET_LWMON5
bool "Support lwmon5"
-   select SUPPORT_SPL
 
 config TARGET_T3CORP
bool "Support t3corp"
diff --git a/board/lwmon5/MAINTAINERS b/board/lwmon5/MAINTAINERS
index 7402ab6..3ea1888 100644
--- a/board/lwmon5/MAINTAINERS
+++ b/board/lwmon5/MAINTAINERS
@@ -3,5 +3,4 @@ M:  Stefan Roese 
 S: Maintained
 F: board/lwmon5/
 F: include/configs/lwmon5.h
-F: configs/lcd4_lwmon5_defconfig
 F: configs/lwmon5_defconfig
diff --git a/board/lwmon5/lwmon5.c b/board/lwmon5/lwmon5.c
index e9aa0b7..8ad6712 100644
--- a/board/lwmon5/lwmon5.c
+++ b/board/lwmon5/lwmon5.c
@@ -187,11 +187,9 @@ int misc_init_r(void)
u32 pbcr;
int size_val = 0;
u32 reg;
-#ifndef CONFIG_LCD4_LWMON5
unsigned long usb2d0cr = 0;
unsigned long usb2phy0cr, usb2h0cr = 0;
unsigned long sdr0_pfc1, sdr0_srst;
-#endif
 
/*
 * FLASH stuff...
@@ -222,7 +220,6 @@ int misc_init_r(void)
  CONFIG_ENV_ADDR_REDUND + 2 * CONFIG_ENV_SECT_SIZE - 1,
  _info[cfi_flash_num_flash_banks - 1]);
 
-#ifndef CONFIG_LCD4_LWMON5
/*
 * USB suff...
 */
@@ -296,7 +293,6 @@ int misc_init_r(void)
/* 7. Reassert internal PHY reset: */
mtsdr(SDR0_SRST1, SDR0_SRST1_USB20PHY);
udelay(1000);
-#endif
 
/*
 * Clear resets
@@ -304,9 +300,7 @@ int misc_init_r(void)
mtsdr(SDR0_SRST1, 0x);
mtsdr(SDR0_SRST0, 0x);
 
-#ifndef CONFIG_LCD4_LWMON5
printf("USB:   Host(int phy) Device(ext phy)\n");
-#endif
 
/*
 * Clear PLB4A0_ACR[WRP]
@@ -316,12 +310,10 @@ int misc_init_r(void)
reg = mfdcr(PLB4A0_ACR) & ~PLB4Ax_ACR_WRP_MASK;
mtdcr(PLB4A0_ACR, reg);
 
-#ifndef CONFIG_LCD4_LWMON5
/*
 * Init matrix keyboard
 */
misc_init_r_kbd();
-#endif
 
return 0;
 }
diff --git a/board/lwmon5/sdram.c b/board/lwmon5/sdram.c
index 5dfbb0b..bcb3449 100644
--- a/board/lwmon5/sdram.c
+++ b/board/lwmon5/sdram.c
@@ -147,7 +147,6 @@ static void program_ecc(u32 start_address,
  /
 phys_size_t initdram (int board_type)
 {
-#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_LCD4_LWMON5)
/* CL=4 */
mtsdram(DDR0_02, 0x);
 
@@ -241,7 +240,6 @@ phys_size_t initdram (int board_type)
 * exceptions are enabled.
 */
set_mcsr(get_mcsr());
-#endif /* CONFIG_SPL_BUILD */
 
return (CONFIG_SYS_MBYTES_SDRAM << 20);
 }
diff --git a/configs/lcd4_lwmon5_defconfig b/configs/lcd4_lwmon5_defconfig
deleted file mode 100644
index b911dbd..000
--- a/configs/lcd4_lwmon5_defconfig
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG_PPC=y
-CONFIG_4xx=y
-CONFIG_TARGET_LWMON5=y
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="LCD4_LWMON5"
-# CONFIG_CMD_SETEXPR is not set
diff --git a/include/configs/lwmon5.h b/include/configs/lwmon5.h
index 2a50bfe..26136a5 100644
--- a/include/configs/lwmon5.h
+++ b/include/configs/lwmon5.h
@@ -25,13 +25,8 @@
 
 #define CONFIG_SYS_GENERIC_BOARD
 
-#ifdef CONFIG_LCD4_LWMON5
-#defineCONFIG_SYS_TEXT_BASE0x0100 /* SPL U-Boot TEXT_BASE */
-#define CONFIG_HOSTNAMElcd4_lwmon5
-#else
 #define CONFIG_SYS_TEXT_BASE   0xFFF8
 #define CONFIG_HOSTNAMElwmon5
-#endif
 
 #define CONFIG_SYS_CLK_FREQ3330/* external freq to pll */
 
@@ -67,11 +62,9 @@
 #define CONFIG_SYS_PCI_MEMBASE2(CONFIG_SYS_PCI_MEMBASE1 + 
0x1000)
 #define CONFIG_SYS_PCI_MEMBASE3(CONFIG_SYS_PCI_MEMBASE2 + 
0x1000)
 
-#ifndef CONFIG_LCD4_LWMON5
 #define CONFIG_SYS_USB2D0_BASE 0xe100
 #define CONFIG_SYS_USB_DEVICE  0xe000
 #define CONFIG_SYS_USB_HOST0xe400
-#endif
 
 /*
  * Initial RAM & stack pointer
@@ -81,20 +74,13 @@
  * content during reset (GPT0_COMP6). This way we reserve the OCM (16k)
  * for logbuffer only. (GPT0_COMP1-COMP5 are reserved for logbuffer header.)
  */
-#ifndef CONFIG_LCD4_LWMON5
 #define CONFIG_SYS_INIT_RAM_DCACHE 1   /* d-cache as init ram  
*/
 #define CONFIG_SYS_INIT_RAM_ADDR   

[U-Boot] [PATCH 2/3] ppc4xx: Convert lwmon5 board to generic board

2015-10-02 Thread Stefan Roese
Add CONFIG_SYS_GENERIC_BOARD to lwmon5.h and CONFIG_DISPLAY_BOARDINFO
to Kconfig file.

Signed-off-by: Stefan Roese 
Cc: Masahiro Yamada 
---
 board/lwmon5/Kconfig | 4 
 include/configs/lwmon5.h | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/board/lwmon5/Kconfig b/board/lwmon5/Kconfig
index 90566d8..7b8c605 100644
--- a/board/lwmon5/Kconfig
+++ b/board/lwmon5/Kconfig
@@ -6,4 +6,8 @@ config SYS_BOARD
 config SYS_CONFIG_NAME
default "lwmon5"
 
+config DISPLAY_BOARDINFO
+   bool
+   default y
+
 endif
diff --git a/include/configs/lwmon5.h b/include/configs/lwmon5.h
index 513167e..2a50bfe 100644
--- a/include/configs/lwmon5.h
+++ b/include/configs/lwmon5.h
@@ -23,6 +23,8 @@
 #define CONFIG_440EPX  1   /* Specific PPC440EPx   */
 #define CONFIG_440 1   /* ... PPC440 family*/
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 #ifdef CONFIG_LCD4_LWMON5
 #defineCONFIG_SYS_TEXT_BASE0x0100 /* SPL U-Boot TEXT_BASE */
 #define CONFIG_HOSTNAMElcd4_lwmon5
-- 
2.5.3

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


[U-Boot] Command to create a partition table?

2015-10-02 Thread Masahiro Yamada
Hi guys,


I am searching for a command to create
a partition table (like fdisk command).

I can create a partition table by PC
for removable devics such as SD card,
but I want U-boot to do that for on-board devices
such as eMMC.

Does U-boot have one?



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


[U-Boot] Please pull u-boot-fdt

2015-10-02 Thread Simon Glass
The following changes since commit 1f8836396de8215b7f460616926052b32597bb29:

  Prepare v2015.10-rc4 (2015-09-28 16:57:42 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-fdt.git

for you to fetch changes up to 8809141907528550750420e14c24fa66e089b3f8:

  dts: Add a comment about CONFIG_OF_EMBED being for local use
(2015-09-28 22:30:31 -0600)


Simon Glass (1):
  dts: Add a comment about CONFIG_OF_EMBED being for local use

 dts/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ls102xa: Fix reset hang

2015-10-02 Thread Sinan Akman


  Hi Fabio

On 02/10/15 09:25 AM, Fabio Estevam wrote:

From: Fabio Estevam 

Since commit 623d96e89aca6("imx: wdog: correct wcr register settings")
issuing a 'reset' command causes the system to hang.

Unlike i.MX and Vybrid, the watchdog controller on LS102x is big-endian.

This means that the watchdog on LS1021 has been working by accident as
it does not use the big-endian accessors in drivers/watchdog/imx_watchdog.c.
Commit 623d96e89aca6("imx: wdog: correct wcr register settings") only
revelead the endianness problem on LS102x.

In order to fix the reset hang, introduce a reset_cpu() implementation that
is specific for ls102x, which accesses the watchdog WCR register in big-endian
format. All that is required to reset LS102x is to clear the SRS bit.

Reported-by: Sinan Akman 
Signed-off-by: Fabio Estevam 
---
  arch/arm/cpu/armv7/ls102xa/cpu.c | 21 +
  drivers/watchdog/Makefile|  2 +-
  2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/ls102xa/cpu.c b/arch/arm/cpu/armv7/ls102xa/cpu.c
index 8dd95d9..0de6f19 100644
--- a/arch/arm/cpu/armv7/ls102xa/cpu.c
+++ b/arch/arm/cpu/armv7/ls102xa/cpu.c
@@ -13,6 +13,7 @@
  #include 
  #include 
  #include 
+#include 
  
  #include "fsl_epu.h"
  
@@ -354,3 +355,23 @@ void smp_kick_all_cpus(void)

asm volatile("sev");
  }
  #endif
+
+struct watchdog_regs {
+   u16 wcr;/* Control */
+   u16 wsr;/* Service */
+   u16 wrsr;   /* Reset Status */
+};
+
+#define WCR_SRS(1 << 4)
+void reset_cpu(ulong addr)
+{
+   struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
+
+   clrbits_be16(>wcr, WCR_SRS);
+
+   while (1) {
+   /*
+* Let the watchdog trigger
+*/
+   }
+}
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 9e9cb55..a007ae8 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -7,7 +7,7 @@
  
  obj-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o

  obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
-ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610 ls102xa))
+ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610))
  obj-y += imx_watchdog.o
  endif
  obj-$(CONFIG_S5P)   += s5p_wdt.o


   Tested-by: Sinan Akman 

   Regards
   Sinan Akman

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


Re: [U-Boot] [PATCH] imx: mx6: correct enable_fec_anatop_clock

2015-10-02 Thread Stefano Babic
On 06/09/2015 11:15, Peng Fan wrote:
> We should follow 'read->set/clr bit->write' flow for enable_fec_anatop_clock,
> otherwise we may overridden configuration before enable_fec_anatop_clock.
> 
> Signed-off-by: Peng Fan 
> Cc: Stefano Babic 
> Cc: Cc: Fabio Estevam 
> ---
>  arch/arm/cpu/armv7/mx6/clock.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
> index ba6cc75..11efd12 100644
> --- a/arch/arm/cpu/armv7/mx6/clock.c
> +++ b/arch/arm/cpu/armv7/mx6/clock.c
> @@ -535,6 +535,8 @@ int enable_fec_anatop_clock(int fec_id, enum enet_freq 
> freq)
>   if (freq < ENET_25MHZ || freq > ENET_125MHZ)
>   return -EINVAL;
>  
> + reg = readl(>pll_enet);
> +
>   if (fec_id == 0) {
>   reg &= ~BM_ANADIG_PLL_ENET_DIV_SELECT;
>   reg |= BF_ANADIG_PLL_ENET_DIV_SELECT(freq);
> 

Applied to u-boot-imx, thanks!

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


[U-Boot] [PULL] Please pull u-boot-imx

2015-10-02 Thread Stefano Babic
Hi Tom,

please pull from u-boot-imx, thanks !

The following changes since commit 1f8836396de8215b7f460616926052b32597bb29:

  Prepare v2015.10-rc4 (2015-09-28 16:57:42 -0400)

are available in the git repository at:

  git://www.denx.de/git/u-boot-imx.git master

for you to fetch changes up to 7daaac5281db0788cde895a0add38ad5195b5be1:

  mx6sabre_common: Add DFU support (2015-10-02 10:51:20 +0200)


Albert ARIBAUD \(3ADEV\) (1):
  vf610: add support for Phytec PCM052

Albert ARIBAUD \\(3ADEV\\) (2):
  vf610: refactor DDRMC code
  I2C: mxc_i2c: make I2C1 and I2C2 optional

Fabio Estevam (1):
  mx6sabre_common: Add DFU support

Peng Fan (1):
  imx: mx6: correct enable_fec_anatop_clock

Soeren Moch (1):
  tbs2910: explicitly set boot address

 README|   8 +-
 arch/arm/Kconfig  |   5 +
 arch/arm/cpu/armv7/mx6/clock.c|   2 +
 arch/arm/imx-common/ddrmc-vf610.c | 193
+--
 arch/arm/include/asm/arch-vf610/ddrmc-vf610.h |  40 ---
 arch/arm/include/asm/arch-vf610/imx-regs.h|   6 +-
 board/freescale/vf610twr/vf610twr.c   | 156
-
 board/phytec/pcm052/Kconfig   |  15 +++
 board/phytec/pcm052/MAINTAINERS   |   6 +
 board/phytec/pcm052/Makefile  |   7 ++
 board/phytec/pcm052/imximage.cfg  |  17 +++
 board/phytec/pcm052/pcm052.c  | 515
+++
 board/toradex/colibri_vf/colibri_vf.c | 144 ---
 configs/pcm052_defconfig  |   6 +
 drivers/i2c/mxc_i2c.c |   6 +
 include/configs/apf27.h   |   2 +
 include/configs/aristainetos-common.h |   2 +
 include/configs/cgtqmx6eval.h |   2 +
 include/configs/cm_fx6.h  |   2 +
 include/configs/embestmx6boards.h |   2 +
 include/configs/flea3.h   |   2 +
 include/configs/gw_ventana.h  |   2 +
 include/configs/imx31_phycore.h   |   2 +
 include/configs/ls1021aqds.h  |   2 +
 include/configs/ls1021atwr.h  |   2 +
 include/configs/ls2085a_common.h  |   2 +
 include/configs/m53evk.h  |   2 +
 include/configs/mx25pdk.h |   2 +
 include/configs/mx35pdk.h |   2 +
 include/configs/mx53ard.h |   2 +
 include/configs/mx53evk.h |   2 +
 include/configs/mx53loco.h|   2 +
 include/configs/mx53smd.h |   2 +
 include/configs/mx6qsabreauto.h   |   2 +
 include/configs/mx6sabre_common.h |  10 ++
 include/configs/mx6sabresd.h  |   2 +
 include/configs/mx6slevk.h|   2 +
 include/configs/mx6sxsabresd.h|   2 +
 include/configs/mx6ul_14x14_evk.h |   2 +
 include/configs/mx7dsabresd.h |   2 +-
 include/configs/nitrogen6x.h  |   2 +
 include/configs/novena.h  |   2 +
 include/configs/ot1200.h  |   2 +
 include/configs/pcm052.h  | 231
+
 include/configs/platinum.h|   2 +
 include/configs/tbs2910.h |   4 +-
 include/configs/titanium.h|   2 +
 include/configs/tqma6.h   |   2 +
 include/configs/usbarmory.h   |   2 +
 include/configs/vf610twr.h|   2 +
 include/configs/wandboard.h   |   2 +
 include/configs/warp.h|   2 +
 include/configs/woodburn_common.h |   2 +
 53 files changed, 1212 insertions(+), 229 deletions(-)
 create mode 100644 board/phytec/pcm052/Kconfig
 create mode 100644 board/phytec/pcm052/MAINTAINERS
 create mode 100644 board/phytec/pcm052/Makefile
 create mode 100644 board/phytec/pcm052/imximage.cfg
 create mode 100644 board/phytec/pcm052/pcm052.c
 create mode 100644 configs/pcm052_defconfig
 create mode 100644 include/configs/pcm052.h


-- 
=
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] "Embedding" default script with uboot image

2015-10-02 Thread Zatkovský Dušan

Hi,

thx for answer.

My colleague found a way that he:

- converts txt script to u-boot form (by mkimage)
- converts uboot script to .o object ($(OBJCOPY) -I binary -O 
elf32-littlearm -B arm --rename-section .data=.rodata   boot_script 
boot_script.o)

- then:
extern unsigned char _binary_boot_script_start;
setenv_hex("boot_script_addr", (ulong)&_binary_boot_script_start);
run_command_list("source ${boot_script_addr}", -1, 0);

Seems it works OK. Thx you and also him :D

bye

--
Dusan

Dňa 2. 10. 2015 o 9:35 Przemyslaw Marczak napísal(a):

Hi,

On 09/30/2015 10:06 AM, Zatkovský Dušan wrote:

Really nobody?

--
Dusan

Dňa 22. 9. 2015 o 14:20 Zatkovský Dušan napísal(a):

Hi all,

Excuse my question if it was solved somewhere in forum, but I didn't
found an answer yet (maybe I can't find the right keywords).

I am building the uboot with yocto for imx6 board. I have started with
some freescale defaults,
edited environment for my needs, saved environment etc ... Now I want
to create a custom
"default" boot script, that will do some "heurestics", such as "look
if usb stick is present, then boot from it, else boot from emmc, 
etc...".

Currently I am storing that script on first partition on emmc and
loading it with ext2load.

But it has drawbacks:
- user should delete that file -> brick
- user should broke entire filesystem -> brick

I want this script to be "embedded" somehow with uboot image (which is
placed outside partition table on device), but I didn't found any doc
how to do that.
Currently I use CONFIG_EXTRA_ENV_SETTINGS for some basic stuffbut it
is unmaintainable for bigger scripts.

Any suggestions?

Thank you.
--
Dusan



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


The ELCE is coming, so probably people are busy.

Please check those few suggestions, which can help you:
- you can "cat" the binaries of U-Boot and your script into one binary
- you can get the address of your script in the code with few lines:

unsigned long *ptr = (unsigned long *)&_end; - start address of your DTB

ptr += fdt_totalsize(ptr) >> 2; - start address of your script

- you can add some header with "magic code" before your script binary

- check the size limit of your u-boot binary, because your script can 
be broken if the output binary exceeds the size, which can be loaded 
to RAM by SPL.


- also check if your bigger binary will not overwrite something on the 
flash layout


- to execute the script at every boot, you can modify same late 
function, like autoboot_command in common/autoboot.c ?


- so at this point, you can check your script's magic code - if added

- run script with:

char cmd[64];

sprintf(cmd, "source %p", ptr);
run_command(cmd, 0);

If you add some logic for checking if the script is valid (e.g. header 
with size and crc ?), then I think you can be sure, that it will work.


Best regards,


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


Re: [U-Boot] [Reproducible-builds] Reproducible U-Boot build support, using SOURCE_DATE_EPOCH

2015-10-02 Thread Paul Kocialkowski
Le mercredi 30 septembre 2015 à 08:50 -0700, Vagrant Cascadian a écrit :
> On 2015-09-28, Paul Kocialkowski wrote:
> > What do you think? Please let me know if I'm wrong.
> 
> This patch on top of 2015.10-rc4 seems to resolve the issue for me:
> 
> Index: u-boot/tools/default_image.c
> ===
> --- u-boot.orig/tools/default_image.c
> +++ u-boot/tools/default_image.c
> @@ -108,8 +108,6 @@ static void image_set_header(void *ptr,
>   fprintf(stderr, "%s: SOURCE_DATE_EPOCH is not valid\n",
>   __func__);
>   time = 0;
> - } else {
> - time = mktime(time_universal);
>   }
>   } else {
>   time = sbuf->st_mtime;
> 
> 
> It still checks for the validity of SOURCE_DATE_EPOCH using gmtime, but
> doesn't call mktime at all, just re-uses the value set from
> SOURCE_DATE_EPOCH.

That's a good plan! I guess we should also fully get rid of the
time_universal variable and make the check inline:

if (gmtime() == NULL)

and of course drop the else statement.

Would you like to craft that patch for upstream U-Boot?
If not, I'd be happy to do it.

Thanks for your work!

-- 
Paul Kocialkowski, Replicant developer

Replicant is a fully free Android distribution running on several
devices, a free software mobile operating system putting the emphasis on
freedom and privacy/security.

Website: https://www.replicant.us/
Blog: https://blog.replicant.us/
Wiki/tracker/forums: https://redmine.replicant.us/



signature.asc
Description: This is a digitally signed message part
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Revert "imx: wdog: correct wcr register settings"

2015-10-02 Thread Fabio Estevam
On Fri, Oct 2, 2015 at 1:30 AM, Wolfgang Denk  wrote:

> In message 
> 

Re: [U-Boot] [PATCH] Revert "imx: wdog: correct wcr register settings"

2015-10-02 Thread Fabio Estevam
On Fri, Oct 2, 2015 at 10:04 AM, Sinan Akman  wrote:

>   I'll test this little later on when I am in the lab, but why are
> we setting WCR_WDE anyways. We are not re-setting a new time
> out value so this should be irrelevant.
>
>   All we need is to clear the SRS bit, no need to set WCR_WDE
> and no / service sequence. I tested this earlier I know
> it works. So a correct patch for reset_cpu() for LS102x could be
> a single line SRS bit clear via _be32 which is all what we are intending
> to.

Thanks, just sent a patch using this method.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ls102xa: Fix reset hang

2015-10-02 Thread Fabio Estevam
From: Fabio Estevam 

Since commit 623d96e89aca6("imx: wdog: correct wcr register settings")
issuing a 'reset' command causes the system to hang.

Unlike i.MX and Vybrid, the watchdog controller on LS102x is big-endian.

This means that the watchdog on LS1021 has been working by accident as
it does not use the big-endian accessors in drivers/watchdog/imx_watchdog.c.
Commit 623d96e89aca6("imx: wdog: correct wcr register settings") only
revelead the endianness problem on LS102x.

In order to fix the reset hang, introduce a reset_cpu() implementation that 
is specific for ls102x, which accesses the watchdog WCR register in big-endian
format. All that is required to reset LS102x is to clear the SRS bit.

Reported-by: Sinan Akman 
Signed-off-by: Fabio Estevam 
---
 arch/arm/cpu/armv7/ls102xa/cpu.c | 21 +
 drivers/watchdog/Makefile|  2 +-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/ls102xa/cpu.c b/arch/arm/cpu/armv7/ls102xa/cpu.c
index 8dd95d9..0de6f19 100644
--- a/arch/arm/cpu/armv7/ls102xa/cpu.c
+++ b/arch/arm/cpu/armv7/ls102xa/cpu.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "fsl_epu.h"
 
@@ -354,3 +355,23 @@ void smp_kick_all_cpus(void)
asm volatile("sev");
 }
 #endif
+
+struct watchdog_regs {
+   u16 wcr;/* Control */
+   u16 wsr;/* Service */
+   u16 wrsr;   /* Reset Status */
+};
+
+#define WCR_SRS(1 << 4)
+void reset_cpu(ulong addr)
+{
+   struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
+
+   clrbits_be16(>wcr, WCR_SRS);
+
+   while (1) {
+   /*
+* Let the watchdog trigger
+*/
+   }
+}
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 9e9cb55..a007ae8 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -7,7 +7,7 @@
 
 obj-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o
 obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
-ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610 ls102xa))
+ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610))
 obj-y += imx_watchdog.o
 endif
 obj-$(CONFIG_S5P)   += s5p_wdt.o
-- 
1.9.1

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


Re: [U-Boot] [PATCH v3 09/10] vexpress64: juno: add alternate kernel and device tree filenames

2015-10-02 Thread Ryan Harkin
Hi Liviu,

On 2 October 2015 at 14:21, Liviu Dudau  wrote:

> Hi Ryan,
>
> On Thu, Oct 01, 2015 at 06:43:35PM +0100, Ryan Harkin wrote:
> > The default Juno firmware has renamed the kernel and device tree
> > filenames to norkern and board.dtb.
> >
> > Rather than change the default configuration to use the new names,
> > breaking those with the old firmware, attempt to load the existing
> > filename first.  If that fails, attempt to load the alternate filename.
>
> How about future proofing this and add a board.scr image in Juno firmware
> where a script can be stored (can the image be used by UEFI as well?).
>
> Now that you are adding support for testing if an image is present we can
> then source the script at boot.scr. That would allow Juno r1 for example
> to have a different boot script than r0 (smc911x ethernet port was designed
> as a backup solution until PCIe was functional, so one might not want to
> use it for booting).
>
> Thoughts?
>

Sounds like a good idea.  I'll have a play with it here and see what I can
come up with.


>
> Best regards,
> Liviu
>
> >
> > I've echo'd that we are loading the alternate file to counter the
> > output from "afs load" when the first load attempt fails.  For example,
> > I see this output on my Juno board:
> >
> > image "Image" not found in flash
> > Loading norkern instead of Image
> > loaded region 0 from 0850 to 8000, 00AB6318 bytes
> > image "juno" not found in flash
> > Loading board.dtb instead of juno
> > loaded region 0 from 0A00 to 8300, 3188 bytes
> >
> > Signed-off-by: Ryan Harkin 
> > Reviewed-by: Linus Walleij 
> > CC: David Feng 
> > CC: Bhupesh Sharma 
> > CC: Linus Walleij 
> > ---
> >  include/configs/vexpress_aemv8a.h | 16 ++--
> >  1 file changed, 14 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/configs/vexpress_aemv8a.h
> b/include/configs/vexpress_aemv8a.h
> > index c62c3ac..192568a 100644
> > --- a/include/configs/vexpress_aemv8a.h
> > +++ b/include/configs/vexpress_aemv8a.h
> > @@ -185,11 +185,13 @@
> >   * be copied into DRAM
> >   */
> >  #define CONFIG_EXTRA_ENV_SETTINGS\
> > - "kernel_name=Image\0"   \
> > + "kernel_name=norkern\0" \
> > + "kernel_alt_name=Image\0"   \
> >   "kernel_addr=0x8000\0" \
> >   "initrd_name=ramdisk.img\0" \
> >   "initrd_addr=0x8400\0"  \
> > - "fdt_name=juno\0" \
> > + "fdt_name=board.dtb\0" \
> > + "fdt_alt_name=juno\0" \
> >   "fdt_addr=0x8300\0" \
> >   "fdt_high=0x\0" \
> >   "initrd_high=0x\0" \
> > @@ -205,7 +207,17 @@
> >
> >  /* Copy the kernel and FDT to DRAM memory and boot */
> >  #define CONFIG_BOOTCOMMAND   "afs load ${kernel_name} ${kernel_addr} ;
> " \
> > + "if test $? -eq 1; then "\
> > + "  echo Loading ${kernel_alt_name} instead
> of "\
> > + "${kernel_name}; "\
> > + "  afs load ${kernel_alt_name}
> ${kernel_addr};"\
> > + "fi ; "\
> >   "afs load  ${fdt_name} ${fdt_addr} ; " \
> > + "if test $? -eq 1; then "\
> > + "  echo Loading ${fdt_alt_name} instead of
> "\
> > + "${fdt_name}; "\
> > + "  afs load ${fdt_alt_name} ${fdt_addr}; "\
> > + "fi ; "\
> >   "fdt addr ${fdt_addr}; fdt resize; " \
> >   "if afs load  ${initrd_name}
> ${initrd_addr} ; "\
> >   "then "\
> > --
> > 2.1.0
> >
> > ___
> > U-Boot mailing list
> > U-Boot@lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
>
> --
> ---
>.oooO
>(   )
> \ (  Oooo.
>  \_) (   )
>   ) /
>  (_/
>
>  One small step
>for me ...
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Add support for LZ4 decompression algorithm

2015-10-02 Thread Simon Glass
Hi Julius,

On 25 September 2015 at 18:27, Julius Werner  wrote:
> This patch adds support for LZ4-compressed FIT image contents. This
> algorithm has a slightly worse compression ration than LZO while being
> nearly twice as fast to decompress. When loading images from a fast
> storage medium this usually results in a boot time win.

Sounds like a useful addition.

>
> Compile-tested only since I don't have a U-Boot development system set
> up right now. The code was imported unchanged from coreboot where it's
> proven to work, though. I'm mostly interested in getting this recognized
> by mkImage for use in a downstream project.

I get this build error with sandbox.

test/built-in.o: In function `uncompress_using_lz4':
/home/sjg/c/src/third_party/u-boot/files/test/compression.c:278:
undefined reference to `ulz4fn'

You should be able to run the tests using:

make O=sandbox defconfig all
 ./sandbox/u-boot -c "ut_compression"

>
> Signed-off-by: Julius Werner 
> ---
>  README |  13 +++
>  common/bootm.c |  10 ++
>  common/image.c |   1 +
>  include/common.h   |   3 +
>  include/image.h|   1 +
>  lib/Makefile   |   1 +
>  lib/lz4.c  | 266 
> +
>  lib/lz4_wrapper.c  | 150 ++
>  test/compression.c |  57 
>  9 files changed, 502 insertions(+)
>  create mode 100644 lib/lz4.c
>  create mode 100644 lib/lz4_wrapper.c
>
> diff --git a/README b/README
> index a13705a..4c98285 100644
> --- a/README
> +++ b/README
> @@ -2035,6 +2035,19 @@ CBFS (Coreboot Filesystem) support
> the malloc area (as defined by CONFIG_SYS_MALLOC_LEN) should
> be at least 4MB.
>
> +   CONFIG_LZ4
> +
> +   If this option is set, support for lz4 compressed images
> +   is included. The LZ4 algorithm can run in-place as long as the
> +   compressed image is loaded to the end of the output buffer, 
> and
> +   trades lower compression ratios for much faster decompression.
> +
> +   NOTE: This implements the release version of the LZ4 frame
> +   format as generated by default by the 'lz4' command line tool.
> +   This is not the same as the outdated, less efficient legacy
> +   frame format currently (2015) implemented in the Linux kernel
> +   (generated by 'lz4 -l'). The two formats are incompatible.

Can you instead add this option to lib/Kconfig and put your help
there? We are moving away from the old CONFIGS.

> +
> CONFIG_LZMA
>
> If this option is set, support for lzma compressed
> diff --git a/common/bootm.c b/common/bootm.c
> index 667c934..0621363 100644
> --- a/common/bootm.c
> +++ b/common/bootm.c
> @@ -389,6 +389,16 @@ int bootm_decomp_image(int comp, ulong load, ulong 
> image_start, int type,
> break;
> }
>  #endif /* CONFIG_LZO */
> +#ifdef CONFIG_LZ4
> +   case IH_COMP_LZ4: {
> +   size_t size = ulz4fn(image_buf, image_len, load_buf, unc_len);
> +   if (!size)
> +   ret = -1;

Is that BOOTM_ERR_RESET?

> +   else
> +   image_len = size;
> +   break;
> +   }
> +#endif /* CONFIG_LZ4 */
> default:
> printf("Unimplemented compression type %d\n", comp);
> return BOOTM_ERR_UNIMPLEMENTED;
> diff --git a/common/image.c b/common/image.c
> index 1325e07..c33749d 100644
> --- a/common/image.c
> +++ b/common/image.c
> @@ -167,6 +167,7 @@ static const table_entry_t uimage_comp[] = {
> {   IH_COMP_GZIP,   "gzip", "gzip compressed",  },
> {   IH_COMP_LZMA,   "lzma", "lzma compressed",  },
> {   IH_COMP_LZO,"lzo",  "lzo compressed",   },
> +   {   IH_COMP_LZ4,"lz4",  "lz4 compressed",   },
> {   -1, "", "", },
>  };
>
> diff --git a/include/common.h b/include/common.h
> index 68b24d0..82c75e2 100644
> --- a/include/common.h
> +++ b/include/common.h
> @@ -826,6 +826,9 @@ int gzwrite(unsigned char *src, int len,
> u64 startoffs,
> u64 szexpected);
>
> +/* lib/lz4_wrapper.c */
> +size_t ulz4fn(const void *src, size_t srcn, void *dst, size_t dstn);
> +
>  /* lib/qsort.c */
>  void qsort(void *base, size_t nmemb, size_t size,
>int(*compar)(const void *, const void *));
> diff --git a/include/image.h b/include/image.h
> index 8a864ae..08ae24a 100644
> --- a/include/image.h
> +++ b/include/image.h
> @@ -259,6 +259,7 @@ struct lmb;
>  #define IH_COMP_BZIP2  2   /* bzip2 Compression Used   */
>  #define IH_COMP_LZMA   3   /* lzma  Compression Used   */
>  #define IH_COMP_LZO4   /* lzo   Compression Used   */

Re: [U-Boot] [PATCH] Revert "imx: wdog: correct wcr register settings"

2015-10-02 Thread Sinan Akman



On 02/10/15 07:39 AM, Fabio Estevam wrote:

On Fri, Oct 2, 2015 at 8:10 AM, Fabio Estevam  wrote:

On Fri, Oct 2, 2015 at 1:30 AM, Wolfgang Denk  wrote:


In message 

Re: [U-Boot] [PATCH] ls102xa: Fix reset hang

2015-10-02 Thread Fabio Estevam
On Fri, Oct 2, 2015 at 11:21 AM, Sinan Akman  wrote:

>Tested-by: Sinan Akman 

Thanks a lot for your help, Sinan!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] sunxi: Add generic defconfigs for A33 Q8 tablets with 1024x600 / 800x480 LCD

2015-10-02 Thread Chen-Yu Tsai
On Fri, Sep 25, 2015 at 4:06 PM, Hans de Goede  wrote:
> Hi,
>
> On 25-09-15 04:35, Chen-Yu Tsai wrote:
>>
>> On Thu, Sep 24, 2015 at 11:24 PM, Hans de Goede 
>> wrote:
>
>
> 
>
>>> diff --git a/configs/q8_a33_tablet_800x480_defconfig
>>> b/configs/q8_a33_tablet_800x480_defconfig
>>> new file mode 100644
>>> index 000..a9c2b62
>>> --- /dev/null
>>> +++ b/configs/q8_a33_tablet_800x480_defconfig
>>> @@ -0,0 +1,24 @@
>>> +CONFIG_ARM=y
>>> +CONFIG_ARCH_SUNXI=y
>>> +CONFIG_MACH_SUN8I_A33=y
>>> +CONFIG_DRAM_CLK=456
>>> +CONFIG_DRAM_ZQ=15291
>>> +CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
>>> +CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
>>> +CONFIG_USB0_ID_DET="PH8"
>>> +CONFIG_AXP_GPIO=y
>>>
>>> +CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:167,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0"
>>
>>
>> FYI my q8h-v1.5 uses a slightly different mode line:
>>
>>
>> x:800,y:480,depth:18,pclk_khz:36000,le:45,ri:209,up:22,lo:22,hs:1,vs:1,sync:3,vmode:0
>
>
> Yes, there are multiple modelines floating around for 800x480 panels, I've
> 2 A13 tablets and the modeline of the fex file from tablet a causes the
> images
> to not be properly centered on the screen of tablet b. Luckily the other way
> around does work, so for the q8_a13_tablet_defconfig I'm using the modeline
> from the fex file from tablet b. I hope we can do something similar with q8
> a23 and a33 800x480 tablets.
>
> I've been buying q8 tablets with cracked screens (people seem to drop them
> quite
> a lot) for cheap from a local 2nd hand website, so now I've 5 ever so
> slightly
> different models, I still need to make a generic q8 config for those, and
> see if
> I can find a modeline which works on all of them.
>
> That modeline should probably be a good one to use for the a33 defconfig
> too.
>
>> I'll find some time to give yours a test.

So it looks like your modeline works as well. I can't see any difference
between the two on screen. Speaking of the screen, mine is slightly off
vertically. Feels like it is 1 line lower than it should be. And the right
most end displays partially under the touchscreen with either modeline.

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


Re: [U-Boot] [PATCH v2 2/3] I2C: mxc_i2c: make I2C1 and I2C2 optional

2015-10-02 Thread Stefano Babic
On 21/09/2015 22:43, Albert ARIBAUD (3ADEV) wrote:
> The driver assumed that I2C1 and I2C2 were always enabled,
> and if they were not, then an asynchronous abort was (silently)
> raised, to be caught much later on in the Linux kernel.
> 
> Fix this by making I2C1 and I2C2 optional just like I2C3 and I2C4
> are.
> 
> To make the change binary-invariant, declare I2C1 and I2C2 in
> every include/configs/ file which defines CONFIG_SYS_I2C_MXC.
> 
> Also, while updating README about CONFIG_SYS_I2C_MXC_I2C1 and
> CONFIG_SYS_I2C_MXC_I2C2, add missing descriptions for I2C4 speed
> (CONFIG_SYS_MXC_I2C4_SPEED) and slave (CONFIG_SYS_MXC_I2C4_SLAVE)
> config options.
> 
> Signed-off-by: Albert ARIBAUD (3ADEV) 
> ---

Applied to u-boot-imx, thanks!

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 v2 1/3] vf610: refactor DDRMC code

2015-10-02 Thread Stefano Babic
On 21/09/2015 22:43, Albert ARIBAUD (3ADEV) wrote:
> The VF610 DDRMC driver code contains settings which are
> board-specific. Move these out to boards so that new boards
> can define their own without having to modify the driver.
> 
> Signed-off-by: Albert ARIBAUD (3ADEV) 
> ---

Applied to u-boot-imx, thanks!

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] tbs2910: explicitly set boot address

2015-10-02 Thread Stefano Babic
Hi Soeren,

On 01/10/2015 22:52, Soeren Moch wrote:
> On 01.10.2015 22:48, Soeren Moch wrote:
>> Set missing boot address in bootm command. This fixes the error:
>>  Wrong Image Format for bootm command
>>  ERROR: can't get kernel image!
>>
>> Reported-by: Uwe Scheffler 
>> Signed-off-by: Soeren Moch 
>> Tested-by: Uwe Scheffler 
>> ---
>> Cc: Stefano Babic 
>> Cc: Uwe Scheffler 
> 
> Stefano, Tom,
> 
> since this fixes a user reported error, can we pull this in for v2015.10?
> 

ok, I'll pick it up.

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] sunxi: Add generic defconfigs for A33 Q8 tablets with 1024x600 / 800x480 LCD

2015-10-02 Thread Hans de Goede

Hi,

On 02-10-15 10:49, Chen-Yu Tsai wrote:

On Fri, Sep 25, 2015 at 4:06 PM, Hans de Goede  wrote:

Hi,

On 25-09-15 04:35, Chen-Yu Tsai wrote:


On Thu, Sep 24, 2015 at 11:24 PM, Hans de Goede 
wrote:






diff --git a/configs/q8_a33_tablet_800x480_defconfig
b/configs/q8_a33_tablet_800x480_defconfig
new file mode 100644
index 000..a9c2b62
--- /dev/null
+++ b/configs/q8_a33_tablet_800x480_defconfig
@@ -0,0 +1,24 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN8I_A33=y
+CONFIG_DRAM_CLK=456
+CONFIG_DRAM_ZQ=15291
+CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
+CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
+CONFIG_USB0_ID_DET="PH8"
+CONFIG_AXP_GPIO=y

+CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:167,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0"



FYI my q8h-v1.5 uses a slightly different mode line:


x:800,y:480,depth:18,pclk_khz:36000,le:45,ri:209,up:22,lo:22,hs:1,vs:1,sync:3,vmode:0



Yes, there are multiple modelines floating around for 800x480 panels, I've
2 A13 tablets and the modeline of the fex file from tablet a causes the
images
to not be properly centered on the screen of tablet b. Luckily the other way
around does work, so for the q8_a13_tablet_defconfig I'm using the modeline
from the fex file from tablet b. I hope we can do something similar with q8
a23 and a33 800x480 tablets.

I've been buying q8 tablets with cracked screens (people seem to drop them
quite
a lot) for cheap from a local 2nd hand website, so now I've 5 ever so
slightly
different models, I still need to make a generic q8 config for those, and
see if
I can find a modeline which works on all of them.

That modeline should probably be a good one to use for the a33 defconfig
too.


I'll find some time to give yours a test.


So it looks like your modeline works as well. I can't see any difference
between the two on screen.


Great, thanks for testing this.


Speaking of the screen, mine is slightly off
vertically. Feels like it is 1 line lower than it should be. And the right
most end displays partially under the touchscreen with either modeline.


Yeah I've this with some other q8 tablets too, where the black bezel of the
touchscreen slightly overlaps part of the lcd which should be visible, I guess
this can be expected given the prices of these tablets.

Regards,

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


Re: [U-Boot] [PATCH v2] rockchip: Reconfigure the malloc based to point to system memory

2015-10-02 Thread Simon Glass
Hi,

On 1 October 2015 at 12:51, Sjoerd Simons  wrote:
> When malloc_base initially gets setup in the SPL it is based on the
> current (early) stack pointer, which for rockchip is pointing into SRAM.
> This means simple memory allocations happen in SRAM space, which is
> somewhat unfortunate. Specifically a bounce buffer for the mmc allocated
> in SRAM space seems to cause the mmc engine to stall/fail causing
> timeouts and a failure to load the main u-boot image.
>
> To resolve this, reconfigure the malloc_base to start at the relocated
> stack pointer after DRAM  has been setup.
>
> For reference, things did work fine on rockchip before 596380db was
> merged to fix memalign_simple due to a combination of rockchip SDRAM
> starting at address 0 and the dw_mmc driver not checking errors from
> bounce_buffer_start. As a result, when a bounce buffer needed to be
> allocated mem_align simple would fail and return NULL. The mmc driver
> ignored the error and happily continued with the bounce buffer address
> being set to 0, which just happened to work fine..
>
> Signed-off-by: Sjoerd Simons 
>
> ---
> A potentially better fix for this issue would be to reconfigure the
> malloc_base in spl_relocate_stack_gd following the same steps as is done
> for the initial setup. However at this point in the release cycle i
> preferred to do a minimal rockchip only fix (so those boards become
> bootable again) for this issue to minimize the potential impact on other
> boards.
>
> Changes in v2:
> - Also gd->malloc_ptr to 0 to not waste any potential space
>
>  arch/arm/mach-rockchip/board-spl.c | 5 +
>  1 file changed, 5 insertions(+)

Acked-by: Simon Glass 

>
> diff --git a/arch/arm/mach-rockchip/board-spl.c 
> b/arch/arm/mach-rockchip/board-spl.c
> index a241d96..982a1d9 100644
> --- a/arch/arm/mach-rockchip/board-spl.c
> +++ b/arch/arm/mach-rockchip/board-spl.c
> @@ -217,6 +217,11 @@ void board_init_f(ulong dummy)
> debug("DRAM init failed: %d\n", ret);
> return;
> }
> +
> +   /* Now that DRAM is initialized setup base pointer for simple malloc
> +* into RAM */

Little nit - can you fix the comment style? Or I can do that when
applying if you prefer.

> +   gd->malloc_base = CONFIG_SPL_STACK_R_ADDR;
> +   gd->malloc_ptr = 0;
>  }
>
>  static int setup_led(void)
> --
> 2.5.3
>

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


Re: [U-Boot] [PATCH 00/11] imx: mx6: support lcdif

2015-10-02 Thread Stefano Babic
Hi Peng,

I have not forgotten this series. Anyway, this has introduced aome
changes that could brick other boards and it is my opininio to postpone
it after 2015.10 release. Of course, I will send to you a full review
for that.

Best regards,
Stefano Babic


On 10/09/2015 12:28, Peng Fan wrote:
> This patch set is to introduce lcdif support for i.MX6.
> 
> Now only i.MX6UL support is in this patchset.
> Patchset tested on mx6ul_14x14_evk and mx6ul_9x9_evk
> (needs 9x9 SPL patch applied).
> 
> 1/11
> There are two LCD interface for i.MX6SX and one interface for i.MX6UL,
> so change the prototype mxs_set_lcdclk to handle different interface.
> 
> [2,3]/11
> I am not sure, but from my understanding, the 'board_' should be discarded.
> 
> 4/11
> mx28 and mx6ul/sx have similar register layout and bit definitions, so
> move related structure and bit definitions to imx-common.
> 
> [5,6,7]/11
> is to add related CCM macros, clock apis for enable lcdif on i.MX6
> 
> 8/11
> support lcdif for i.MX6UL 14x14/9x9 board
> 
> 9/11
> Introduce lcdif_power_down, to make system stable when reset or boot os
> 
> [10,11]/11
> Need to call lcdif_power_down, before trigger wdog reset or boot os.
> Or we may met unexpected system hang.
> 
> Peng Fan (11):
>   mxs: add parameter base_addr for mxs_set_lcdclk
>   sandisk: sfp: correct function name
>   xfi3: correct function name
>   imx: imx-common: move lcdif structure and macro definition to
> imx-common
>   imx: mx6: fix register address
>   imx: mx6: crm_reg: add LCDIF related macros
>   imx: mx6: add clock api for lcdif
>   imx: mx6ul_14x14_evk: support lcdif display
>   video: mxsfb: introduce lcdif_power_down
>   imx: mx6: implement reset_misc
>   imx: imx-common: power down lcdif before boot os
> 
>  arch/arm/cpu/arm926ejs/mxs/clock.c|   2 +-
>  arch/arm/cpu/armv7/mx6/clock.c| 239 
> ++
>  arch/arm/cpu/armv7/mx6/soc.c  |   8 +
>  arch/arm/imx-common/cpu.c |   3 +
>  arch/arm/include/asm/arch-mx6/clock.h |   2 +
>  arch/arm/include/asm/arch-mx6/crm_regs.h  |  34 ++-
>  arch/arm/include/asm/arch-mx6/imx-regs.h  |  15 +-
>  arch/arm/include/asm/arch-mxs/clock.h |   2 +-
>  arch/arm/include/asm/arch-mxs/regs-lcdif.h| 201 +-
>  arch/arm/include/asm/imx-common/regs-lcdif.h  | 222 
>  arch/arm/include/asm/imx-common/sys_proto.h   |   2 +
>  board/creative/xfi3/xfi3.c|   2 +-
>  board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c |  63 ++
>  board/sandisk/sansa_fuze_plus/sfp.c   |   2 +-
>  drivers/video/mxsfb.c |  19 +-
>  include/configs/mx6ul_14x14_evk.h |  18 ++
>  16 files changed, 620 insertions(+), 214 deletions(-)
>  create mode 100644 arch/arm/include/asm/imx-common/regs-lcdif.h
> 


-- 
=
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] mx6sabre_common: Add DFU support

2015-10-02 Thread Stefano Babic
On 23/09/2015 05:52, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Add DFU support.
> 
> Tested by flashing SPL and u-boot.img into SPI NOR flash with the
> following commands:
> 
> => setenv dfu_alt_info ${dfu_alt_info_spl}
> 
> => run dfuspi
> 
> On the host PC:
> 
> $ sudo dfu-util -D SPL -a spl
> 
> On the target:
> 
> CTRL+C
> => setenv dfu_alt_info ${dfu_alt_info_img}
> 
> => run dfuspi
> 
> On the host PC:
> 
> $ sudo dfu-util -D u-boot.img -a u-boot
> 
> Signed-off-by: Fabio Estevam 
> ---

Applied to u-boot-imx, thanks!

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 v2 1/3] nios2: map physical address to uncached virtual address

2015-10-02 Thread Simon Glass
On 1 October 2015 at 18:16, Thomas Chou  wrote:
> Hi Simon,
>
> On 10/02/2015 06:49 AM, Simon Glass wrote:

 Add ioremap() to map physical address to uncached virtual
 address. We need this to convert the reg address from the
 device tree.
>>
>> Can we not rely on the 'ranges' property to sort this out?
>
>
> The ranges translate address across buses/bridges. The address is still
> physical address. In the case of nios2, the virtual address map of mmu or
> nonmmu are different, though the physical address should be the same. So we
> really need sort of ioremap(). You may find a lots of call to ioremap() in
> linux drivers. It is quite standard. We also want to use the same dts/dtb
> for both u-boot and linux. I would suggest ioremap() is the way.

Yes I see this on another thread. Thanks for explaining it.

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


Re: [U-Boot] [PATCH] Revert "imx: wdog: correct wcr register settings"

2015-10-02 Thread Fabio Estevam
On Fri, Oct 2, 2015 at 8:10 AM, Fabio Estevam  wrote:
> On Fri, Oct 2, 2015 at 1:30 AM, Wolfgang Denk  wrote:
>
>> In message 
>> 

Re: [U-Boot] [PATCH v2 3/3] vf610: add support for Phytec PCM052

2015-10-02 Thread Stefano Babic
On 21/09/2015 22:43, Albert ARIBAUD (3ADEV) wrote:
> Devices supported are:
> - NFC (NAND FLASH)
> - MMC
> - QSPI (SPI NOR FLASH)
> - I2C (only bus 2)
> - I2C RTC
> - I2C EEPROM
> - FEC
> 
> Patch-series: 2
> - remove useless CONFIG_SYS_SPD_BUS_NUM from config
> - remove include of config_cmd_default.h
> - remove duplicate CONFIG_CMD_NET
> 
> Signed-off-by: Albert ARIBAUD (3ADEV) 
> ---

Applied to u-boot-imx, thanks!

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] ls102xa: Fix reset hang

2015-10-02 Thread Wolfgang Denk
Dear Fabio,

In message <1443792315-18997-1-git-send-email-feste...@gmail.com> you wrote:
> 
...
> Unlike i.MX and Vybrid, the watchdog controller on LS102x is big-endian.
...
> +struct watchdog_regs {
> + u16 wcr;/* Control */
> + u16 wsr;/* Service */
> + u16 wrsr;   /* Reset Status */
> +};
> +
> +#define WCR_SRS  (1 << 4)

This belongs to some watchdog (or processor) related header file.

As is, it duplicates code from drivers/watchdog/imx_watchdog.c which
is something we should not do.

> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 9e9cb55..a007ae8 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -7,7 +7,7 @@
>  
>  obj-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o
>  obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
> -ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610 ls102xa))
> +ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610))

So this fixes the reset problem for now - but what happens when
someone wants to use the watchdog for real?  Will we create a copy of
drivers/watchdog/imx_watchdog.c  using big-endian accessors?  This
cannot be right?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The only person who always got his work done by Friday
 was Robinson Crusoe.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] ls102xa: Fix reset hang

2015-10-02 Thread Wolfgang Denk
Dear Fabio Estevam,

In message <1443799557-26419-2-git-send-email-feste...@gmail.com> you wrote:
> 
> Since commit 623d96e89aca6("imx: wdog: correct wcr register settings")
> issuing a 'reset' command causes the system to hang.
> 
> Unlike i.MX and Vybrid, the watchdog controller on LS102x is big-endian.
> 
> This means that the watchdog on LS1021 has been working by accident as
> it does not use the big-endian accessors in drivers/watchdog/imx_watchdog.c.
> Commit 623d96e89aca6("imx: wdog: correct wcr register settings") only
> revelead the endianness problem on LS102x.
> 
> In order to fix the reset hang, introduce a reset_cpu() implementation that 
> is specific for ls102x, which accesses the watchdog WCR register in big-endian
> format. All that is required to reset LS102x is to clear the SRS bit.
> 
> Reported-by: Sinan Akman 
> Tested-by: Sinan Akman 
> Signed-off-by: Fabio Estevam 
> ---
> Changes since v1:
> - Do not add duplicate wdog struct (Wolfgang)

Thanks a lot!

Reviewed-by: Wolfgang Denk 

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Work 8 hours, sleep 8 hours; but not the same 8 hours.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Fix variation in timestamps caused by timezone differences.

2015-10-02 Thread Vagrant Cascadian
When building with SOURCE_DATE_EPOCH set, avoid use of mktime in
default_image.c, which converts the timestamp into localtime. This
causes variation based on timezone when building u-boot.img and
u-boot-sunxi-with-spl.bin targets.

Signed-off-by: Vagrant Cascadian 
---

 tools/default_image.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tools/default_image.c b/tools/default_image.c
index 18940af..3ed7014 100644
--- a/tools/default_image.c
+++ b/tools/default_image.c
@@ -89,7 +89,6 @@ static void image_set_header(void *ptr, struct stat *sbuf, 
int ifd,
 {
uint32_t checksum;
char *source_date_epoch;
-   struct tm *time_universal;
time_t time;
 
image_header_t * hdr = (image_header_t *)ptr;
@@ -103,13 +102,10 @@ static void image_set_header(void *ptr, struct stat 
*sbuf, int ifd,
if (source_date_epoch != NULL) {
time = (time_t) strtol(source_date_epoch, NULL, 10);
 
-   time_universal = gmtime();
-   if (time_universal == NULL) {
+   if (gmtime() == NULL) {
fprintf(stderr, "%s: SOURCE_DATE_EPOCH is not valid\n",
__func__);
time = 0;
-   } else {
-   time = mktime(time_universal);
}
} else {
time = sbuf->st_mtime;
-- 
2.1.4

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


[U-Boot] [PATCH v2 2/2] ls102xa: Fix reset hang

2015-10-02 Thread Fabio Estevam
From: Fabio Estevam 

Since commit 623d96e89aca6("imx: wdog: correct wcr register settings")
issuing a 'reset' command causes the system to hang.

Unlike i.MX and Vybrid, the watchdog controller on LS102x is big-endian.

This means that the watchdog on LS1021 has been working by accident as
it does not use the big-endian accessors in drivers/watchdog/imx_watchdog.c.
Commit 623d96e89aca6("imx: wdog: correct wcr register settings") only
revelead the endianness problem on LS102x.

In order to fix the reset hang, introduce a reset_cpu() implementation that 
is specific for ls102x, which accesses the watchdog WCR register in big-endian
format. All that is required to reset LS102x is to clear the SRS bit.

Reported-by: Sinan Akman 
Tested-by: Sinan Akman 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Do not add duplicate wdog struct (Wolfgang)

 arch/arm/cpu/armv7/ls102xa/cpu.c | 15 +++
 drivers/watchdog/Makefile|  2 +-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/ls102xa/cpu.c b/arch/arm/cpu/armv7/ls102xa/cpu.c
index 8dd95d9..e2eb5f3 100644
--- a/arch/arm/cpu/armv7/ls102xa/cpu.c
+++ b/arch/arm/cpu/armv7/ls102xa/cpu.c
@@ -13,6 +13,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "fsl_epu.h"
 
@@ -354,3 +356,16 @@ void smp_kick_all_cpus(void)
asm volatile("sev");
 }
 #endif
+
+void reset_cpu(ulong addr)
+{
+   struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
+
+   clrbits_be16(>wcr, WCR_SRS);
+
+   while (1) {
+   /*
+* Let the watchdog trigger
+*/
+   }
+}
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 9e9cb55..a007ae8 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -7,7 +7,7 @@
 
 obj-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o
 obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
-ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610 ls102xa))
+ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610))
 obj-y += imx_watchdog.o
 endif
 obj-$(CONFIG_S5P)   += s5p_wdt.o
-- 
1.9.1

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


[U-Boot] [PATCH v2 1/2] imx_watchdog: Add a header file for watchdog registers

2015-10-02 Thread Fabio Estevam
From: Fabio Estevam 

Create fsl_wdog.h to store the watchdog registers and bit fields.

This can be useful when accesses to the watchdog block are made from other
parts, such as arch/arm/ cpu code.

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Newly introduced

 drivers/watchdog/imx_watchdog.c | 14 +-
 include/fsl_wdog.h  | 18 ++
 2 files changed, 19 insertions(+), 13 deletions(-)
 create mode 100644 include/fsl_wdog.h

diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
index 9a77a54..0d77595 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -8,19 +8,7 @@
 #include 
 #include 
 #include 
-
-struct watchdog_regs {
-   u16 wcr;/* Control */
-   u16 wsr;/* Service */
-   u16 wrsr;   /* Reset Status */
-};
-
-#define WCR_WDZST  0x01
-#define WCR_WDBG   0x02
-#define WCR_WDE0x04/* WDOG enable */
-#define WCR_WDT0x08
-#define WCR_SRS0x10
-#define SET_WCR_WT(x)  (x << 8)
+#include 
 
 #ifdef CONFIG_IMX_WATCHDOG
 void hw_watchdog_reset(void)
diff --git a/include/fsl_wdog.h b/include/fsl_wdog.h
new file mode 100644
index 000..d15a70c
--- /dev/null
+++ b/include/fsl_wdog.h
@@ -0,0 +1,18 @@
+/*
+ * (C) Copyright 2015 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+struct watchdog_regs {
+   u16 wcr;/* Control */
+   u16 wsr;/* Service */
+   u16 wrsr;   /* Reset Status */
+};
+
+#define WCR_WDZST  0x01
+#define WCR_WDBG   0x02
+#define WCR_WDE0x04
+#define WCR_WDT0x08
+#define WCR_SRS0x10
+#define SET_WCR_WT(x)  (x << 8)
-- 
1.9.1

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


[U-Boot] [PATCH v2 1/2] imx_watchdog: Add a header file for watchdog registers

2015-10-02 Thread Fabio Estevam
From: Fabio Estevam 

Create fsl_wdog.h to store the watchdog registers and bit fields.

This can be useful when accesses to the watchdog block are made from other
parts, such as arch/arm/ cpu code.

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Newly introduced

 drivers/watchdog/imx_watchdog.c | 14 +-
 include/fsl_wdog.h  | 18 ++
 2 files changed, 19 insertions(+), 13 deletions(-)
 create mode 100644 include/fsl_wdog.h

diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
index 9a77a54..0d77595 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -8,19 +8,7 @@
 #include 
 #include 
 #include 
-
-struct watchdog_regs {
-   u16 wcr;/* Control */
-   u16 wsr;/* Service */
-   u16 wrsr;   /* Reset Status */
-};
-
-#define WCR_WDZST  0x01
-#define WCR_WDBG   0x02
-#define WCR_WDE0x04/* WDOG enable */
-#define WCR_WDT0x08
-#define WCR_SRS0x10
-#define SET_WCR_WT(x)  (x << 8)
+#include 
 
 #ifdef CONFIG_IMX_WATCHDOG
 void hw_watchdog_reset(void)
diff --git a/include/fsl_wdog.h b/include/fsl_wdog.h
new file mode 100644
index 000..d15a70c
--- /dev/null
+++ b/include/fsl_wdog.h
@@ -0,0 +1,18 @@
+/*
+ * (C) Copyright 2015 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+struct watchdog_regs {
+   u16 wcr;/* Control */
+   u16 wsr;/* Service */
+   u16 wrsr;   /* Reset Status */
+};
+
+#define WCR_WDZST  0x01
+#define WCR_WDBG   0x02
+#define WCR_WDE0x04
+#define WCR_WDT0x08
+#define WCR_SRS0x10
+#define SET_WCR_WT(x)  (x << 8)
-- 
1.9.1

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


[U-Boot] [PATCH v2] ls102xa: Fix reset hang

2015-10-02 Thread Fabio Estevam
From: Fabio Estevam 

Since commit 623d96e89aca6("imx: wdog: correct wcr register settings")
issuing a 'reset' command causes the system to hang.

Unlike i.MX and Vybrid, the watchdog controller on LS102x is big-endian.

This means that the watchdog on LS1021 has been working by accident as
it does not use the big-endian accessors in drivers/watchdog/imx_watchdog.c.
Commit 623d96e89aca6("imx: wdog: correct wcr register settings") only
revelead the endianness problem on LS102x.

In order to fix the reset hang, introduce a reset_cpu() implementation that 
is specific for ls102x, which accesses the watchdog WCR register in big-endian
format. All that is required to reset LS102x is to clear the SRS bit.

Reported-by: Sinan Akman 
Tested-by: Sinan Akman 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Do not add duplicate wdog struct (Wolfgang)

 arch/arm/cpu/armv7/ls102xa/cpu.c | 15 +++
 drivers/watchdog/Makefile|  2 +-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/ls102xa/cpu.c b/arch/arm/cpu/armv7/ls102xa/cpu.c
index 8dd95d9..e2eb5f3 100644
--- a/arch/arm/cpu/armv7/ls102xa/cpu.c
+++ b/arch/arm/cpu/armv7/ls102xa/cpu.c
@@ -13,6 +13,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "fsl_epu.h"
 
@@ -354,3 +356,16 @@ void smp_kick_all_cpus(void)
asm volatile("sev");
 }
 #endif
+
+void reset_cpu(ulong addr)
+{
+   struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
+
+   clrbits_be16(>wcr, WCR_SRS);
+
+   while (1) {
+   /*
+* Let the watchdog trigger
+*/
+   }
+}
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 9e9cb55..a007ae8 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -7,7 +7,7 @@
 
 obj-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o
 obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
-ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610 ls102xa))
+ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610))
 obj-y += imx_watchdog.o
 endif
 obj-$(CONFIG_S5P)   += s5p_wdt.o
-- 
1.9.1

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


Re: [U-Boot] [PATCH] ls102xa: Fix reset hang

2015-10-02 Thread Sinan Akman


  Hi Wolfgang

On 02/10/15 10:42 AM, Wolfgang Denk wrote:

Dear Fabio,

In message <1443792315-18997-1-git-send-email-feste...@gmail.com> you wrote:
...

Unlike i.MX and Vybrid, the watchdog controller on LS102x is big-endian.

...

+struct watchdog_regs {
+   u16 wcr;/* Control */
+   u16 wsr;/* Service */
+   u16 wrsr;   /* Reset Status */
+};
+
+#define WCR_SRS(1 << 4)

This belongs to some watchdog (or processor) related header file.

As is, it duplicates code from drivers/watchdog/imx_watchdog.c which
is something we should not do.


diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 9e9cb55..a007ae8 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -7,7 +7,7 @@
  
  obj-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o

  obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
-ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610 ls102xa))
+ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610))

So this fixes the reset problem for now - but what happens when
someone wants to use the watchdog for real?  Will we create a copy of
drivers/watchdog/imx_watchdog.c  using big-endian accessors?  This
cannot be right?


  I don't know if you've seen my earlier e-mail on this but I was 
suggesting

to bring watchdog to DM and then consider endian type from dts to implement
it properly. Would this not ultimately be the right solution ?

  Regards
  Sinan Akman


Best regards,

Wolfgang Denk



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


Re: [U-Boot] [PATCH] ls102xa: Fix reset hang

2015-10-02 Thread Sinan Akman



On 02/10/15 10:34 AM, Fabio Estevam wrote:

On Fri, Oct 2, 2015 at 11:21 AM, Sinan Akman  wrote:


Tested-by: Sinan Akman 

Thanks a lot for your help, Sinan!


  You are very welcome Fabio. Let's take a cleaner look
at this for 2016.01 to consider all the mixed endian type
peripheral blocks.

  Regards
  Sinan Akman

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


Re: [U-Boot] [PATCH] ls102xa: Fix reset hang

2015-10-02 Thread Fabio Estevam
On Fri, Oct 2, 2015 at 11:42 AM, Wolfgang Denk  wrote:

> So this fixes the reset problem for now - but what happens when
> someone wants to use the watchdog for real?  Will we create a copy of
> drivers/watchdog/imx_watchdog.c  using big-endian accessors?  This
> cannot be right?

If someone wants to use the watchdog for real on LS102x then this is a
new feature that needs to be properly implemented.

In the kernel we have a common watchdog driver for i.MX, Vybrid and
LS, which uses regmap and take the endianness into consideration. We
should make drivers/watchdog/imx_watchdog.c endianness-aware so that
it can work for all these different SoCs. I was not suggesting to
create a new copy of drivers/watchdog/imx_watchdog.c.

Regards,

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


[U-Boot] Pull request, u-boot-tegra/master

2015-10-02 Thread Tom Warren
Tom,

Please pull u-boot-tegra/master into U-Boot/master. Thanks!

All tegra builds are OK (32-bit and 64-bit), and P2571 T210 64-bit boots to
cmd prompt OK.

The following changes since commit 1f8836396de8215b7f460616926052b32597bb29:

  Prepare v2015.10-rc4 (2015-09-28 16:57:42 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-tegra.git master

for you to fetch changes up to fe82857c4b1667fff8108eab77340ae76016215a:

  gpio: tegra: use named constants (2015-10-02 11:05:56 -0700)


Stephen Warren (6):
  ARM: tegra: p2371-2180: import latest pinmux
  ARM: tegra: fix GPIO init table programming
  ARM: tegra: don't enable GPIOs until direction is set
  ARM: tegra: expand all SPL sizes to be consistent
  gpio: tegra: remove unused type
  gpio: tegra: use named constants

 board/nvidia/p2371-2180/pinmux-config-p2371-2180.h | 56
+
 drivers/gpio/tegra_gpio.c  | 58
++
 include/configs/tegra114-common.h  |  2 +-
 include/configs/tegra20-common.h   |  2 +-
 include/configs/tegra210-common.h  |  2 +-
 include/configs/tegra30-common.h   |  2 +-
 6 files changed, 65 insertions(+), 57 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 09/10] vexpress64: juno: add alternate kernel and device tree filenames

2015-10-02 Thread Liviu Dudau
Hi Ryan,

On Thu, Oct 01, 2015 at 06:43:35PM +0100, Ryan Harkin wrote:
> The default Juno firmware has renamed the kernel and device tree
> filenames to norkern and board.dtb.
> 
> Rather than change the default configuration to use the new names,
> breaking those with the old firmware, attempt to load the existing
> filename first.  If that fails, attempt to load the alternate filename.

How about future proofing this and add a board.scr image in Juno firmware
where a script can be stored (can the image be used by UEFI as well?).

Now that you are adding support for testing if an image is present we can
then source the script at boot.scr. That would allow Juno r1 for example
to have a different boot script than r0 (smc911x ethernet port was designed
as a backup solution until PCIe was functional, so one might not want to
use it for booting).

Thoughts?

Best regards,
Liviu

> 
> I've echo'd that we are loading the alternate file to counter the
> output from "afs load" when the first load attempt fails.  For example,
> I see this output on my Juno board:
> 
> image "Image" not found in flash
> Loading norkern instead of Image
> loaded region 0 from 0850 to 8000, 00AB6318 bytes
> image "juno" not found in flash
> Loading board.dtb instead of juno
> loaded region 0 from 0A00 to 8300, 3188 bytes
> 
> Signed-off-by: Ryan Harkin 
> Reviewed-by: Linus Walleij 
> CC: David Feng 
> CC: Bhupesh Sharma 
> CC: Linus Walleij 
> ---
>  include/configs/vexpress_aemv8a.h | 16 ++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/include/configs/vexpress_aemv8a.h 
> b/include/configs/vexpress_aemv8a.h
> index c62c3ac..192568a 100644
> --- a/include/configs/vexpress_aemv8a.h
> +++ b/include/configs/vexpress_aemv8a.h
> @@ -185,11 +185,13 @@
>   * be copied into DRAM
>   */
>  #define CONFIG_EXTRA_ENV_SETTINGS\
> - "kernel_name=Image\0"   \
> + "kernel_name=norkern\0" \
> + "kernel_alt_name=Image\0"   \
>   "kernel_addr=0x8000\0" \
>   "initrd_name=ramdisk.img\0" \
>   "initrd_addr=0x8400\0"  \
> - "fdt_name=juno\0" \
> + "fdt_name=board.dtb\0" \
> + "fdt_alt_name=juno\0" \
>   "fdt_addr=0x8300\0" \
>   "fdt_high=0x\0" \
>   "initrd_high=0x\0" \
> @@ -205,7 +207,17 @@
>  
>  /* Copy the kernel and FDT to DRAM memory and boot */
>  #define CONFIG_BOOTCOMMAND   "afs load ${kernel_name} ${kernel_addr} ; " \
> + "if test $? -eq 1; then "\
> + "  echo Loading ${kernel_alt_name} instead of "\
> + "${kernel_name}; "\
> + "  afs load ${kernel_alt_name} ${kernel_addr};"\
> + "fi ; "\
>   "afs load  ${fdt_name} ${fdt_addr} ; " \
> + "if test $? -eq 1; then "\
> + "  echo Loading ${fdt_alt_name} instead of "\
> + "${fdt_name}; "\
> + "  afs load ${fdt_alt_name} ${fdt_addr}; "\
> + "fi ; "\
>   "fdt addr ${fdt_addr}; fdt resize; " \
>   "if afs load  ${initrd_name} ${initrd_addr} ; "\
>   "then "\
> -- 
> 2.1.0
> 
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

-- 
---
   .oooO
   (   )
\ (  Oooo.
 \_) (   )
  ) /
 (_/

 One small step
   for me ...
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Porting UBI fixes (specially fastmap's) to U-Boot

2015-10-02 Thread Ezequiel Garcia
Hello Heiko,

According to Richard Weinberger, UBI fastmap is broken in U-Boot.
There are plenty
of fixes in Linux that we should pull in U-Boot to fix it.

Maybe you are already aware of this and you have some work-in-progress
patches to share?
Otherwise, I might be able to spend some time working on this in the next weeks.

Thanks!
-- 
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] ls102xa: Fix reset hang

2015-10-02 Thread York Sun


On 10/02/2015 08:25 AM, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Since commit 623d96e89aca6("imx: wdog: correct wcr register settings")
> issuing a 'reset' command causes the system to hang.
> 
> Unlike i.MX and Vybrid, the watchdog controller on LS102x is big-endian.
> 
> This means that the watchdog on LS1021 has been working by accident as
> it does not use the big-endian accessors in drivers/watchdog/imx_watchdog.c.
> Commit 623d96e89aca6("imx: wdog: correct wcr register settings") only
> revelead the endianness problem on LS102x.
> 
> In order to fix the reset hang, introduce a reset_cpu() implementation that 
> is specific for ls102x, which accesses the watchdog WCR register in big-endian
> format. All that is required to reset LS102x is to clear the SRS bit.
> 
> Reported-by: Sinan Akman 
> Tested-by: Sinan Akman 
> Signed-off-by: Fabio Estevam 
> ---
> Changes since v1:
> - Do not add duplicate wdog struct (Wolfgang)

Thanks a lot for fixing this.

York

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


Re: [U-Boot] [PULL] u-boot-atmel/master -> u-boot/master

2015-10-02 Thread Tom Rini
On Thu, Oct 01, 2015 at 09:44:12AM +0200, Andreas Bießmann wrote:

> Hi Tom,
> 
> here are two small fixes for v2015.10 regarding atmel boards.
> 
> Andreas
> 
> The following changes since commit 1f8836396de8215b7f460616926052b32597bb29:
> 
>   Prepare v2015.10-rc4 (2015-09-28 16:57:42 -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-atmel.git master
> 
> for you to fetch changes up to aca5d0830aab91680c2ef44e9cb2999cbea19f2f:
> 
>   arm, at91: small updates for the smartweb board (2015-10-01 09:34:59 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Please pull u-boot-marvell master

2015-10-02 Thread Tom Rini
On Thu, Oct 01, 2015 at 12:07:42AM +, Luka Perkov wrote:

> Hi Tom,
> 
> can you please pull these three commits containing two mvebu related
> fixes and one handy kwboot tool feature?
> 
> The following changes since commit 1f8836396de8215b7f460616926052b32597bb29:
> 
>   Prepare v2015.10-rc4 (2015-09-28 16:57:42 -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-marvell.git 
> 
> for you to fetch changes up to e29f1db3dd96901fb54d8faefed8cd2987704b68:
> 
>   tools: kwboot: Add support for UART boot mode patching for Armada XP/38x 
> (2015-10-01 02:02:06 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Please pull u-boot-sunxi master

2015-10-02 Thread Tom Rini
On Tue, Sep 29, 2015 at 02:00:38PM +0200, Hans de Goede wrote:

> Hi Tom,
> 
> Here is a (the final?) sunxi pull-req for v2015.10, highlights:
> 
> -Misc fixes / tweaks
> -Add support for 2 new boards
> 
> The following changes since commit 1f8836396de8215b7f460616926052b32597bb29:
> 
>   Prepare v2015.10-rc4 (2015-09-28 16:57:42 -0400)
> 
> are available in the git repository at:
> 
>   http://git.denx.de/u-boot-sunxi.git master
> 
> for you to fetch changes up to 46f166caad48ed38f6ccc0c2fc6d1828d15dacb2:
> 
>   sunxi: Add generic defconfigs for A33 Q8 tablets with 1024x600 / 800x480 
> LCD (2015-09-29 11:50:44 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Please pull u-boot-x86.git (take 2)

2015-10-02 Thread Tom Rini
On Tue, Sep 29, 2015 at 09:20:53AM -0600, Simon Glass wrote:

> Hi Tom.
> 
> This include one more bug fix.
> 
> The following changes since commit 1f8836396de8215b7f460616926052b32597bb29:
> 
>   Prepare v2015.10-rc4 (2015-09-28 16:57:42 -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-x86.git
> 
> for you to fetch changes up to 196193a4d4963a8dde00c7cdd0ec83b60ea61e61:
> 
>   x86: fsp: Report correct number of E820 table entries (2015-09-28
> 21:56:27 -0700)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Pull request: u-boot-net.git master

2015-10-02 Thread Tom Rini
On Wed, Sep 30, 2015 at 12:23:38PM -0500, Joe Hershberger wrote:
> The following changes since commit 1f8836396de8215b7f460616926052b32597bb29:

> 
>   Prepare v2015.10-rc4 (2015-09-28 16:57:42 -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-net.git master
> 
> for you to fetch changes up to 8ac46a98618ea21cf9900961fcff9cf803198271:
> 
>   sunxi: add NetConsole by default for Banana Pi/Pro (2015-09-29 21:54:46 
> -0500)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Relocation issue - need help!

2015-10-02 Thread Andy Fleming
On Thu, Oct 1, 2015 at 9:18 AM, Wolfgang Denk  wrote:
> Dear Andy,
>
> In message 
> 

[U-Boot] [PATCH] net: rtl8169: Build warning fixes for 64-bit

2015-10-02 Thread Stephen Warren
From: Stephen Warren 

Casting from dev->priv to pci_dev_t changes the value's size on a 64-bit
system. This causes the compiler to complain about casting a pointer to an
integer of a different (smaller) size. To avoid this, cast to an integer
of matching size first, then perform an int->int cast to perform the size
change. This signals explicitly that we do want to change the size, and
avoids the compiler warning. This is legitimate since we know the pointer
actually stores a small integer, not a pointer value.

Signed-off-by: Stephen Warren 
---
 drivers/net/rtl8169.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c
index ebd46b27e5fd..19422c4a2ace 100644
--- a/drivers/net/rtl8169.c
+++ b/drivers/net/rtl8169.c
@@ -581,7 +581,8 @@ int rtl8169_eth_recv(struct udevice *dev, int flags, uchar 
**packetp)
 #else
 static int rtl_recv(struct eth_device *dev)
 {
-   return rtl_recv_common((pci_dev_t)dev->priv, dev->iobase, NULL);
+   return rtl_recv_common((pci_dev_t)(unsigned long)dev->priv,
+  dev->iobase, NULL);
 }
 #endif /* nCONFIG_DM_ETH */
 
@@ -666,8 +667,8 @@ int rtl8169_eth_send(struct udevice *dev, void *packet, int 
length)
 #else
 static int rtl_send(struct eth_device *dev, void *packet, int length)
 {
-   return rtl_send_common((pci_dev_t)dev->priv, dev->iobase, packet,
-  length);
+   return rtl_send_common((pci_dev_t)(unsigned long)dev->priv,
+  dev->iobase, packet, length);
 }
 #endif
 
@@ -846,7 +847,8 @@ RESET - Finish setting up the ethernet interface
 ***/
 static int rtl_reset(struct eth_device *dev, bd_t *bis)
 {
-   rtl8169_common_start((pci_dev_t)dev->priv, dev->enetaddr);
+   rtl8169_common_start((pci_dev_t)(unsigned long)dev->priv,
+dev->enetaddr);
 
return 0;
 }
-- 
1.9.1

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


[U-Boot] [PATCH] fdt: fix fdtdec_get_pci_addr() for CONFIG_PHYS_64BIT

2015-10-02 Thread Stephen Warren
From: Stephen Warren 

PCI addresses are always represented as 3 cells in DT. (one cell for bus
and device, and two cells for a 64-bit addres). This does not vary based
on either the physical address size of the CPU, nor any #address-cells
property in DT (or more precisely, #address-cells must be set to 3 in any
PCIe controller's node).

Fix fdtdec_get_pci_addr() to use conversion functions that operate on
(fixed) cell-sized data rather than (varying) physical-address-sized
data, so that the function works on 64-bit systems.

Signed-off-by: Stephen Warren 
---
 lib/fdtdec.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 1fdb4f0d9ce9..275971d40096 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -219,13 +219,13 @@ int fdtdec_get_pci_addr(const void *blob, int node, enum 
fdt_pci_space type,
 
for (i = 0; i < num; i++) {
debug("pci address #%d: %08lx %08lx %08lx\n", i,
- (ulong)fdt_addr_to_cpu(cell[0]),
- (ulong)fdt_addr_to_cpu(cell[1]),
- (ulong)fdt_addr_to_cpu(cell[2]));
-   if ((fdt_addr_to_cpu(*cell) & type) == type) {
-   addr->phys_hi = fdt_addr_to_cpu(cell[0]);
-   addr->phys_mid = fdt_addr_to_cpu(cell[1]);
-   addr->phys_lo = fdt_addr_to_cpu(cell[2]);
+ (ulong)fdt32_to_cpu(cell[0]),
+ (ulong)fdt32_to_cpu(cell[1]),
+ (ulong)fdt32_to_cpu(cell[2]));
+   if ((fdt32_to_cpu(*cell) & type) == type) {
+   addr->phys_hi = fdt32_to_cpu(cell[0]);
+   addr->phys_mid = fdt32_to_cpu(cell[1]);
+   addr->phys_lo = fdt32_to_cpu(cell[1]);
break;
} else {
cell += (FDT_PCI_ADDR_CELLS +
-- 
1.9.1

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


Re: [U-Boot] [PULL] Please pull u-boot-imx

2015-10-02 Thread Tom Rini
On Fri, Oct 02, 2015 at 11:11:40AM +0200, Stefano Babic wrote:

> Hi Tom,
> 
> please pull from u-boot-imx, thanks !
> 
> The following changes since commit 1f8836396de8215b7f460616926052b32597bb29:
> 
>   Prepare v2015.10-rc4 (2015-09-28 16:57:42 -0400)
> 
> are available in the git repository at:
> 
>   git://www.denx.de/git/u-boot-imx.git master
> 
> for you to fetch changes up to 7daaac5281db0788cde895a0add38ad5195b5be1:
> 
>   mx6sabre_common: Add DFU support (2015-10-02 10:51:20 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Pull request, u-boot-tegra/master

2015-10-02 Thread Tom Rini
On Fri, Oct 02, 2015 at 11:15:51AM -0700, Tom Warren wrote:

> Tom,
> 
> Please pull u-boot-tegra/master into U-Boot/master. Thanks!
> 
> All tegra builds are OK (32-bit and 64-bit), and P2571 T210 64-bit boots to
> cmd prompt OK.
> 
> The following changes since commit 1f8836396de8215b7f460616926052b32597bb29:
> 
>   Prepare v2015.10-rc4 (2015-09-28 16:57:42 -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-tegra.git master
> 
> for you to fetch changes up to fe82857c4b1667fff8108eab77340ae76016215a:
> 
>   gpio: tegra: use named constants (2015-10-02 11:05:56 -0700)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v2 05/13] x86: Remove quotation mark in CONFIG_HOSTNAME

2015-10-02 Thread Simon Glass
On Monday, 28 September 2015, Bin Meng  wrote:
>
> CONFIG_HOSTNAME is an environment varible, so that quotation mark
> is not needed.
>
> Signed-off-by: Bin Meng 
>
> ---
>
> Changes in v2:
> - New patch to remove quotation mark in CONFIG_HOSTNAME
>
>  include/configs/x86-common.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)



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


Re: [U-Boot] [PATCH v2 12/13] cmd: bootvx: Add asmlinkage to the VxWorks x86 entry

2015-10-02 Thread Simon Glass
On Monday, 28 September 2015, Bin Meng  wrote:
>
> VxWorks on x86 uses stack to pass parameters.
>
> Reported-by: Jian Luo 
> Signed-off-by: Bin Meng 
>
> ---
>
> Changes in v2:
> - New patch to add asmlinkage to the VxWorks x86 entry
>
>  common/cmd_elf.c | 6 ++
>  1 file changed, 6 insertions(+)
>
>

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


Re: [U-Boot] [PATCH v2 11/13] cmd: bootvx: Pass E820 information to an x86 VxWorks kernel

2015-10-02 Thread Simon Glass
On Monday, 28 September 2015, Bin Meng  wrote:
>
> E820 is critical to the kernel as it provides system memory map
> information. Pass it to an x86 VxWorks kernel.
>
> Signed-off-by: Bin Meng 
> Reviewed-by: Tom Rini 
> Tested-by: Jian Luo 
> ---
>
> Changes in v2: None
>
>  common/cmd_elf.c  | 30 ++
>  include/vxworks.h | 29 +
>  2 files changed, 59 insertions(+)



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


Re: [U-Boot] [PATCH v2 04/13] x86: Move install_e820_map() out of zimage.c

2015-10-02 Thread Simon Glass
On Monday, 28 September 2015, Bin Meng  wrote:
>
> install_e820_map() has nothing to do with zimage related codes.
> Move it to a dedicated place.
>
> Signed-off-by: Bin Meng 
>
> ---
>
> Changes in v2:
> - New patch to move install_e820_map() out of zimage.c
>
>  arch/x86/include/asm/e820.h   |  3 +++
>  arch/x86/include/asm/zimage.h |  3 ---
>  arch/x86/lib/Makefile |  1 +
>  arch/x86/lib/e820.c   | 37 +
>  arch/x86/lib/zimage.c | 26 --
>  5 files changed, 41 insertions(+), 29 deletions(-)
>  create mode 100644 arch/x86/lib/e820.c
>

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


Re: [U-Boot] [PATCH] nios2: convert nios2 cpu to driver model

2015-10-02 Thread Simon Glass
On Wednesday, 30 September 2015, Thomas Chou  wrote:
>
> Convert nios2 cpu to driver model. The cpu parameters are
> extracted from device tree and saved to global data structure.
> We will use them to replace the custom_fpga.h .
>
> Signed-off-by: Thomas Chou 
> ---
> v2
>   move cpu param setup to arch_cpu_init_dm, remove probe.
> v3
>   fix coding style as Marek suggested.
>   select CMD_CPU.
> v4
>   revert to v1 probe method.
>   doc dts binding.
>   check uclass_first_device() return.
>   clean up as Simon suggested.
>
>  arch/Kconfig   |  3 ++
>  arch/nios2/cpu/cpu.c   | 88 
> --
>  arch/nios2/dts/3c120_devboard.dts  |  1 +
>  arch/nios2/include/asm/global_data.h   |  8 
>  configs/nios2-generic_defconfig|  3 +-
>  doc/device-tree-bindings/cpu/nios2.txt | 54 +
>  6 files changed, 152 insertions(+), 5 deletions(-)
>  create mode 100644 doc/device-tree-bindings/cpu/nios2.txt



 Reviewed-by: Simon Glass 
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] rockchip: Reconfigure the malloc based to point to system memory

2015-10-02 Thread Hans de Goede

Hi,

On 01-10-15 20:51, Sjoerd Simons wrote:

When malloc_base initially gets setup in the SPL it is based on the
current (early) stack pointer, which for rockchip is pointing into SRAM.
This means simple memory allocations happen in SRAM space, which is
somewhat unfortunate. Specifically a bounce buffer for the mmc allocated
in SRAM space seems to cause the mmc engine to stall/fail causing
timeouts and a failure to load the main u-boot image.

To resolve this, reconfigure the malloc_base to start at the relocated
stack pointer after DRAM  has been setup.

For reference, things did work fine on rockchip before 596380db was
merged to fix memalign_simple due to a combination of rockchip SDRAM
starting at address 0 and the dw_mmc driver not checking errors from
bounce_buffer_start. As a result, when a bounce buffer needed to be
allocated mem_align simple would fail and return NULL. The mmc driver
ignored the error and happily continued with the bounce buffer address
being set to 0, which just happened to work fine..

Signed-off-by: Sjoerd Simons 


Looks good to me, with the caveat that we really should do something
better (and revert this one) for v2016.01:

Reviewed-by: Hans de Goede 

Regards,

Hans




---
A potentially better fix for this issue would be to reconfigure the
malloc_base in spl_relocate_stack_gd following the same steps as is done
for the initial setup. However at this point in the release cycle i
preferred to do a minimal rockchip only fix (so those boards become
bootable again) for this issue to minimize the potential impact on other
boards.

Changes in v2:
- Also gd->malloc_ptr to 0 to not waste any potential space

  arch/arm/mach-rockchip/board-spl.c | 5 +
  1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-rockchip/board-spl.c 
b/arch/arm/mach-rockchip/board-spl.c
index a241d96..982a1d9 100644
--- a/arch/arm/mach-rockchip/board-spl.c
+++ b/arch/arm/mach-rockchip/board-spl.c
@@ -217,6 +217,11 @@ void board_init_f(ulong dummy)
debug("DRAM init failed: %d\n", ret);
return;
}
+
+   /* Now that DRAM is initialized setup base pointer for simple malloc
+* into RAM */
+   gd->malloc_base = CONFIG_SPL_STACK_R_ADDR;
+   gd->malloc_ptr = 0;
  }

  static int setup_led(void)


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


Re: [U-Boot] "Embedding" default script with uboot image

2015-10-02 Thread Przemyslaw Marczak

Hi,

On 09/30/2015 10:06 AM, Zatkovský Dušan wrote:

Really nobody?

--
Dusan

Dňa 22. 9. 2015 o 14:20 Zatkovský Dušan napísal(a):

Hi all,

Excuse my question if it was solved somewhere in forum, but I didn't
found an answer yet (maybe I can't find the right keywords).

I am building the uboot with yocto for imx6 board. I have started with
some freescale defaults,
edited environment for my needs, saved environment etc ... Now I want
to create a custom
"default" boot script, that will do some "heurestics", such as "look
if usb stick is present, then boot from it, else boot from emmc, etc...".
Currently I am storing that script on first partition on emmc and
loading it with ext2load.

But it has drawbacks:
- user should delete that file -> brick
- user should broke entire filesystem -> brick

I want this script to be "embedded" somehow with uboot image (which is
placed outside partition table on device), but I didn't found any doc
how to do that.
Currently I use CONFIG_EXTRA_ENV_SETTINGS for some basic stuffbut it
is unmaintainable for bigger scripts.

Any suggestions?

Thank you.
--
Dusan



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


The ELCE is coming, so probably people are busy.

Please check those few suggestions, which can help you:
- you can "cat" the binaries of U-Boot and your script into one binary
- you can get the address of your script in the code with few lines:

unsigned long *ptr = (unsigned long *)&_end; - start address of your DTB

ptr += fdt_totalsize(ptr) >> 2; - start address of your script

- you can add some header with "magic code" before your script binary

- check the size limit of your u-boot binary, because your script can be 
broken if the output binary exceeds the size, which can be loaded to RAM 
by SPL.


- also check if your bigger binary will not overwrite something on the 
flash layout


- to execute the script at every boot, you can modify same late 
function, like autoboot_command in common/autoboot.c ?


- so at this point, you can check your script's magic code - if added

- run script with:

char cmd[64];

sprintf(cmd, "source %p", ptr);
run_command(cmd, 0);

If you add some logic for checking if the script is valid (e.g. header 
with size and crc ?), then I think you can be sure, that it will work.


Best regards,
--
Przemyslaw Marczak
Samsung R Institute Poland
Samsung Electronics
p.marc...@samsung.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Porting UBI fixes (specially fastmap's) to U-Boot

2015-10-02 Thread Heiko Schocher

Hello,

Am 02.10.2015 um 20:46 schrieb Richard Weinberger:

Hi!

Am 02.10.2015 um 18:27 schrieb Ezequiel Garcia:

Hello Heiko,

According to Richard Weinberger, UBI fastmap is broken in U-Boot.
There are plenty
of fixes in Linux that we should pull in U-Boot to fix it.


Thanks for pointing!


BTW: it is not broken in terms of you broke it.


Puuh ;-)

In what way is it broken? If we update to 4.1, will ubi work (mount
an existing UBI partition with fastmap) on existing boards?


It is just the old fastmap version. In v4.1 fastmap saw
a massive update. Sadly this changes are a way to big for the stable tree.


What do you mean with "for the stable tree" ?


Maybe you are already aware of this and you have some work-in-progress
patches to share?
Otherwise, I might be able to spend some time working on this in the next weeks.


I'll happily help you!


I am next week in Dublin on the ELCE so I have no time to look into
this issue ... maybe the week after ...

But you can try to update to 4.1 mainline linux (or maybe 4.2?)
I hope it is not too complicated ... I am sorry, I have no patches
prepared for this

bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot