Re: [U-Boot] [PATCH] mx6sabresd: Disable PCI driver

2014-06-21 Thread Fabio Estevam
On Fri, Jun 20, 2014 at 6:41 PM, Marek Vasut ma...@denx.de wrote:
 On Friday, June 20, 2014 at 07:00:28 PM, Fabio Estevam wrote:
 From: Fabio Estevam fabio.este...@freescale.com

 Currently we have a kernel hang when U-boot PCI driver is enabled.

 Disable it until a better solution is found.

 Signed-off-by: Fabio Estevam fabio.este...@freescale.com

 This looks like solving a bug on a wrong end. It is the kernel that needs to 
 be
 fixed, not U-Boot.

Since there is no fix in the kernel I prefer to remove this from
U-boot from the time being to avoid the kernel hang.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 08/22] dm: Use '*' to indicate a device is activated

2014-06-21 Thread Simon Glass
On 24 May 2014 15:21, Simon Glass s...@chromium.org wrote:
 Make both dm enumeration commands support showing whether a driver is active
 or not, and use a consistent indicator (an asterisk).

 Signed-off-by: Simon Glass s...@chromium.org
 ---

  test/dm/cmd_dm.c | 11 ++-
  1 file changed, 6 insertions(+), 5 deletions(-)


Rebased to master and applied to u-boot-dm/master.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] include/dm.h: fix inclusion guard

2014-06-21 Thread Simon Glass
On 10 June 2014 20:48, Simon Glass s...@chromium.org wrote:
 On 10 June 2014 17:52, Jeroen Hofstee jer...@myspectrum.nl wrote:
 cc: Simon Glass s...@chromium.org
 Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl

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

Applied to u-boot-dm/master, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] patman: Only apply patches when we know the original HEAD

2014-06-21 Thread Simon Glass
Hi Masahiro,

On 11 June 2014 23:27, Simon Glass s...@chromium.org wrote:
 When patman applies the patches it checks out a new branch, uses 'git am'
 to apply the patches one by one, and then tries to go back to the old
 branch. If you try this when the branch is 'undefined', this doesn't work
 as patman cannot restore the correct branch after applying the patches.
 It seems that 'undefined' is created by git and is persistent after it is
 created, so that you can end up on quite an old branch.

 Add a check for the 'undefined' branch to avoid this.

 Reported-by: Masahiro Yamada yamad...@jp.panasonic.com
 Signed-off-by: Simon Glass s...@chromium.org

Can you please check if this fixes the problem you reported? If so I
would like to get it into this release.

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


[U-Boot] [RFC] ARM: bump minimum arch to armv4t when supported

2014-06-21 Thread Jeroen Hofstee
U-boot typically uses an -march lower then actually supported
by the architecture to be backwards compatible with older
compilers. For armv4 this also causes problems occasionally,
like selected processor does not support ARM mode `bx lr'.
Although this case is actually a llvm bug afaik, it should be
possible to correct it for GNU tools with --fix-v4bx, but that
seems to be bugged as well (at least I cannot get it working).

Since there is exactly 1 board in u-boot (jornada) which
actually is armv4, I propose to increase the arch for the
others to armv4t. As far as I can make some sense of ARM
versions the other chips should have these instructions.

cc: Albert Aribaud albert.u.b...@aribaud.net
Not-signed-off-since-rfc: Jeroen Hofstee jer...@myspectrum.nl
---
 arch/arm/cpu/arm720t/config.mk   | 2 +-
 arch/arm/cpu/arm920t/config.mk   | 2 +-
 arch/arm/cpu/arm946es/config.mk  | 2 +-
 arch/arm/cpu/arm_intcm/config.mk | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/arm720t/config.mk b/arch/arm/cpu/arm720t/config.mk
index 772fb41..245c52f 100644
--- a/arch/arm/cpu/arm720t/config.mk
+++ b/arch/arm/cpu/arm720t/config.mk
@@ -6,4 +6,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi
+PLATFORM_CPPFLAGS += -march=armv4t -mtune=arm7tdmi
diff --git a/arch/arm/cpu/arm920t/config.mk b/arch/arm/cpu/arm920t/config.mk
index 799afff..de02775 100644
--- a/arch/arm/cpu/arm920t/config.mk
+++ b/arch/arm/cpu/arm920t/config.mk
@@ -5,4 +5,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_CPPFLAGS += -march=armv4
+PLATFORM_CPPFLAGS += -march=armv4t
diff --git a/arch/arm/cpu/arm946es/config.mk b/arch/arm/cpu/arm946es/config.mk
index 438668d..c74a33c 100644
--- a/arch/arm/cpu/arm946es/config.mk
+++ b/arch/arm/cpu/arm946es/config.mk
@@ -5,4 +5,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_CPPFLAGS +=  -march=armv4
+PLATFORM_CPPFLAGS +=  -march=armv4t
diff --git a/arch/arm/cpu/arm_intcm/config.mk b/arch/arm/cpu/arm_intcm/config.mk
index 438668d..c74a33c 100644
--- a/arch/arm/cpu/arm_intcm/config.mk
+++ b/arch/arm/cpu/arm_intcm/config.mk
@@ -5,4 +5,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_CPPFLAGS +=  -march=armv4
+PLATFORM_CPPFLAGS +=  -march=armv4t
-- 
1.8.3.2

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


[U-Boot] [PATCH 0/2] yaffs2: fix clang warnings and small cleanup

2014-06-21 Thread Jeroen Hofstee
ignores checkpatch warning:

CHECK: if this code is redundant consider removing it
#120: FILE: fs/yaffs2/yaffsfs.c:3186:
+#if 0

since this was already in u-boot.

Jeroen Hofstee (2):
  yaffs2: cosmetic: remove self assignments
  yaffs2: preprocessor cleanup

 fs/yaffs2/yaffs_guts.c   | 32 ++--
 fs/yaffs2/yaffs_verify.c |  4 
 fs/yaffs2/yaffsfs.c  |  8 +---
 3 files changed, 11 insertions(+), 33 deletions(-)

-- 
1.8.3.2

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


[U-Boot] [PATCH 1/2] yaffs2: cosmetic: remove self assignments

2014-06-21 Thread Jeroen Hofstee
Remove self assignments which is just dead code to prevent
compiler warnings about non used arguments. For u-boot this
does not prevent any warning though, on the contrary it actual
introduces warnings when compiling with clang. Remove them.

Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl
---
 fs/yaffs2/yaffs_guts.c   | 11 ---
 fs/yaffs2/yaffs_verify.c |  4 
 fs/yaffs2/yaffsfs.c  |  8 +---
 3 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/fs/yaffs2/yaffs_guts.c b/fs/yaffs2/yaffs_guts.c
index 21441fd..1fa5910 100644
--- a/fs/yaffs2/yaffs_guts.c
+++ b/fs/yaffs2/yaffs_guts.c
@@ -219,18 +219,11 @@ static void yaffs_handle_chunk_wr_ok(struct yaffs_dev 
*dev, int nand_chunk,
 const u8 *data,
 const struct yaffs_ext_tags *tags)
 {
-   dev = dev;
-   nand_chunk = nand_chunk;
-   data = data;
-   tags = tags;
 }
 
 static void yaffs_handle_chunk_update(struct yaffs_dev *dev, int nand_chunk,
  const struct yaffs_ext_tags *tags)
 {
-   dev = dev;
-   nand_chunk = nand_chunk;
-   tags = tags;
 }
 
 void yaffs_handle_chunk_error(struct yaffs_dev *dev,
@@ -814,8 +807,6 @@ struct yaffs_tnode *yaffs_find_tnode_0(struct yaffs_dev 
*dev,
int required_depth;
int level = file_struct-top_level;
 
-   dev = dev;
-
/* Check sane level and chunk Id */
if (level  0 || level  YAFFS_TNODES_MAX_LEVEL)
return NULL;
@@ -3214,7 +3205,6 @@ static void yaffs_load_name_from_oh(struct yaffs_dev 
*dev, YCHAR *name,
}
} else {
 #else
-   dev = dev;
{
 #endif
yaffs_strncpy(name, oh_name, buff_size - 1);
@@ -3258,7 +3248,6 @@ static void yaffs_load_oh_from_name(struct yaffs_dev 
*dev, YCHAR *oh_name,
}
} else {
 #else
-   dev = dev;
{
 #endif
yaffs_strncpy(oh_name, name, YAFFS_MAX_NAME_LENGTH - 1);
diff --git a/fs/yaffs2/yaffs_verify.c b/fs/yaffs2/yaffs_verify.c
index 97734a9..3fef28b 100644
--- a/fs/yaffs2/yaffs_verify.c
+++ b/fs/yaffs2/yaffs_verify.c
@@ -19,20 +19,17 @@
 
 int yaffs_skip_verification(struct yaffs_dev *dev)
 {
-   dev = dev;
return !(yaffs_trace_mask 
 (YAFFS_TRACE_VERIFY | YAFFS_TRACE_VERIFY_FULL));
 }
 
 static int yaffs_skip_full_verification(struct yaffs_dev *dev)
 {
-   dev = dev;
return !(yaffs_trace_mask  (YAFFS_TRACE_VERIFY_FULL));
 }
 
 static int yaffs_skip_nand_verification(struct yaffs_dev *dev)
 {
-   dev = dev;
return !(yaffs_trace_mask  (YAFFS_TRACE_VERIFY_NAND));
 }
 
@@ -521,6 +518,5 @@ void yaffs_verify_free_chunks(struct yaffs_dev *dev)
 
 int yaffs_verify_file_sane(struct yaffs_obj *in)
 {
-   in = in;
return YAFFS_OK;
 }
diff --git a/fs/yaffs2/yaffsfs.c b/fs/yaffs2/yaffsfs.c
index 334598e..41e5f01 100644
--- a/fs/yaffs2/yaffsfs.c
+++ b/fs/yaffs2/yaffsfs.c
@@ -3136,10 +3136,6 @@ int yaffs_link(const YCHAR *oldpath, const YCHAR 
*linkpath)
 
 int yaffs_mknod(const YCHAR *pathname, mode_t mode, dev_t dev)
 {
-   pathname = pathname;
-   mode = mode;
-   dev = dev;
-
yaffsfs_SetError(-EINVAL);
return -1;
 }
@@ -3187,9 +3183,7 @@ int yaffs_set_error(int error)
 
 int yaffs_dump_dev(const YCHAR *path)
 {
-#if 1
-   path = path;
-#else
+#if 0
YCHAR *rest;
 
struct yaffs_obj *obj = yaffsfs_FindRoot(path, rest);
-- 
1.8.3.2

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


[U-Boot] [PATCH 2/2] yaffs2: preprocessor cleanup

2014-06-21 Thread Jeroen Hofstee
Current code uses the preprocessor to and else case
to an statement without an if condition at all. Although
this works, change the optional code to return early, so
it is contained within the #ifdef.

Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl
---
 fs/yaffs2/yaffs_guts.c | 21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/fs/yaffs2/yaffs_guts.c b/fs/yaffs2/yaffs_guts.c
index 1fa5910..32e6ff2 100644
--- a/fs/yaffs2/yaffs_guts.c
+++ b/fs/yaffs2/yaffs_guts.c
@@ -3203,19 +3203,18 @@ static void yaffs_load_name_from_oh(struct yaffs_dev 
*dev, YCHAR *name,
} else {
yaffs_strncpy(name, oh_name + 1, buff_size - 1);
}
-   } else {
-#else
-   {
-#endif
-   yaffs_strncpy(name, oh_name, buff_size - 1);
+
+   return;
}
+#endif
+
+   yaffs_strncpy(name, oh_name, buff_size - 1);
 }
 
 static void yaffs_load_oh_from_name(struct yaffs_dev *dev, YCHAR *oh_name,
const YCHAR *name)
 {
 #ifdef CONFIG_YAFFS_AUTO_UNICODE
-
int is_ascii;
YCHAR *w;
 
@@ -3246,12 +3245,12 @@ static void yaffs_load_oh_from_name(struct yaffs_dev 
*dev, YCHAR *oh_name,
*oh_name = 0;
yaffs_strncpy(oh_name + 1, name, YAFFS_MAX_NAME_LENGTH 
- 2);
}
-   } else {
-#else
-   {
-#endif
-   yaffs_strncpy(oh_name, name, YAFFS_MAX_NAME_LENGTH - 1);
+
+   return;
}
+#endif
+
+   yaffs_strncpy(oh_name, name, YAFFS_MAX_NAME_LENGTH - 1);
 }
 
 /* UpdateObjectHeader updates the header on NAND for an object.
-- 
1.8.3.2

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


Re: [U-Boot] [PATCH 2/2] yaffs2: preprocessor cleanup

2014-06-21 Thread Jeroen Hofstee
On za, 2014-06-21 at 20:58 +0200, Jeroen Hofstee wrote:
 Current code uses the preprocessor to and else case
 to an statement without an if condition at all. Although
 this works, change the optional code to return early, so
 it is contained within the #ifdef.
 
 Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl
 ---

Attempt 2:

Current code uses the preprocessor to change an else case
to a statement without any if condition at all. Although
this works, change the optional code to return early, so
all optional code is contained within a single #ifdef.




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


Re: [U-Boot] [PATCH] mx6sabresd: Disable PCI driver

2014-06-21 Thread Jeroen Hofstee
On za, 2014-06-21 at 11:00 -0300, Fabio Estevam wrote:
 On Fri, Jun 20, 2014 at 6:41 PM, Marek Vasut ma...@denx.de wrote:
  On Friday, June 20, 2014 at 07:00:28 PM, Fabio Estevam wrote:
  From: Fabio Estevam fabio.este...@freescale.com
 
  Currently we have a kernel hang when U-boot PCI driver is enabled.
 
  Disable it until a better solution is found.
 
  Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 
  This looks like solving a bug on a wrong end. It is the kernel that needs 
  to be
  fixed, not U-Boot.
 
 Since there is no fix in the kernel I prefer to remove this from
 U-boot from the time being to avoid the kernel hang.

this sounds evil, just fix/workaround it in your linux version.

Regards,
Jeroen


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


[U-Boot] Please pull u-boot-dm.git

2014-06-21 Thread Simon Glass
Hi Tom,

Here are two that were left behind.


The following changes since commit 39b6d07fd7e692736cdb05a000b1c84ab43de4fb:

  Merge branch 'master' of git://git.denx.de/u-boot-dm (2014-06-20
20:03:51 -0400)

are available in the git repository at:

  master

for you to fetch changes up to 4af5b1445c2c17b72f515134d510d37e05a344f1:

  dm: Use '*' to indicate a device is activated (2014-06-21 10:12:43 -0600)


Jeroen Hofstee (1):
  include/dm.h: fix inclusion guard

Simon Glass (1):
  dm: Use '*' to indicate a device is activated

 include/dm.h |  2 +-
 test/dm/cmd_dm.c | 11 ++-
 2 files changed, 7 insertions(+), 6 deletions(-)

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


Re: [U-Boot] Please pull u-boot-dm.git

2014-06-21 Thread Simon Glass
Hi Tom,

On 20 June 2014 18:05, Tom Rini tr...@ti.com wrote:
 git request-pull upstream/master name-in-git-remote

Thanks for that - I do always get an error now, although I'm not sure why:

$ git request-pull upstream/master master
fatal: 'master' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
warn: No match for commit 4af5b1445c2c17b72f515134d510d37e05a344f1
found at master
warn: Are you sure you pushed 'HEAD' there?
The following changes since commit 39b6d07fd7e692736cdb05a000b1c84ab43de4fb:

  Merge branch 'master' of git://git.denx.de/u-boot-dm (2014-06-20
20:03:51 -0400)
...


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


[U-Boot] [PATCH] mx6: add support of multi-processor command

2014-06-21 Thread Gabriel Huau
Signed-off-by: Gabriel Huau cont...@huau-gabriel.fr
---
 arch/arm/cpu/armv7/mx6/Makefile  |   1 +
 arch/arm/cpu/armv7/mx6/mp.c  | 131 +++
 arch/arm/include/asm/arch-mx6/imx-regs.h |  13 +++
 3 files changed, 145 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/mx6/mp.c

diff --git a/arch/arm/cpu/armv7/mx6/Makefile b/arch/arm/cpu/armv7/mx6/Makefile
index d7285fc..ec08526 100644
--- a/arch/arm/cpu/armv7/mx6/Makefile
+++ b/arch/arm/cpu/armv7/mx6/Makefile
@@ -9,3 +9,4 @@
 
 obj-y  := soc.o clock.o
 obj-$(CONFIG_SECURE_BOOT)+= hab.o
+obj-$(CONFIG_MP) += mp.o
diff --git a/arch/arm/cpu/armv7/mx6/mp.c b/arch/arm/cpu/armv7/mx6/mp.c
new file mode 100644
index 000..a805be8
--- /dev/null
+++ b/arch/arm/cpu/armv7/mx6/mp.c
@@ -0,0 +1,131 @@
+/*
+ * (C) Copyright 2014
+ * Gabriel Huau cont...@huau-gabriel.fr
+ *
+ * (C) Copyright 2009 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include asm/io.h
+#include asm/errno.h
+#include asm/arch/imx-regs.h
+
+int cpu_reset(int nr)
+{
+   uint32_t reg;
+   struct src *src = (struct src *)SRC_BASE_ADDR;
+
+   reg = __raw_readl(src-scr);
+
+   switch (nr) {
+   case 1:
+   reg |= SRC_SCR_CORE_1_RESET_MASK;
+   break;
+
+   case 2:
+   reg |= SRC_SCR_CORE_2_RESET_MASK;
+   break;
+
+   case 3:
+   reg |= SRC_SCR_CORE_3_RESET_MASK;
+   break;
+   }
+
+   /* Software reset of the CPU N */
+   __raw_writel(reg, src-scr);
+
+   return 0;
+}
+
+int cpu_status(int nr)
+{
+   uint32_t reg;
+   struct src *src = (struct src *)SRC_BASE_ADDR;
+
+   reg = __raw_readl(src-scr);
+
+   switch (nr) {
+   case 1:
+   printf(core 1: %d\n, !!(reg  SRC_SCR_CORE_1_ENABLE_MASK));
+   break;
+
+   case 2:
+   printf(core 2: %d\n, !!(reg  SRC_SCR_CORE_2_ENABLE_MASK));
+   break;
+
+   case 3:
+   printf(core 3: %d\n, !!(reg  SRC_SCR_CORE_3_ENABLE_MASK));
+   break;
+   }
+
+   return 0;
+}
+
+int cpu_release(int nr, int argc, char *const argv[])
+{
+   uint32_t reg;
+   struct src *src = (struct src *)SRC_BASE_ADDR;
+   uint32_t boot_addr;
+
+   boot_addr = simple_strtoul(argv[0], NULL, 16);
+   reg = __raw_readl(src-scr);
+
+   switch (nr) {
+   case 1:
+   __raw_writel(boot_addr, src-gpr3);
+   reg |= SRC_SCR_CORE_1_ENABLE_MASK;
+   break;
+
+   case 2:
+   __raw_writel(boot_addr, src-gpr5);
+   reg |= SRC_SCR_CORE_2_ENABLE_MASK;
+   break;
+
+   case 3:
+   __raw_writel(boot_addr, src-gpr7);
+   reg |= SRC_SCR_CORE_3_ENABLE_MASK;
+   break;
+   }
+
+   /* CPU N is ready to start */
+   __raw_writel(reg, src-scr);
+
+   return 0;
+}
+
+int is_core_valid(unsigned int nr)
+{
+   if (nr  0 || nr = CONFIG_NUM_CPUS)
+   return 0;
+
+   return 1;
+}
+
+int cpu_disable(int nr)
+{
+   uint32_t reg;
+   struct src *src = (struct src *)SRC_BASE_ADDR;
+
+   reg = __raw_readl(src-scr);
+
+   switch (nr) {
+   case 1:
+   reg = ~SRC_SCR_CORE_1_ENABLE_MASK;
+   break;
+
+   case 2:
+   reg = ~SRC_SCR_CORE_2_ENABLE_MASK;
+   break;
+
+   case 3:
+   reg = ~SRC_SCR_CORE_3_ENABLE_MASK;
+   break;
+   }
+
+   /* Disable the CPU N */
+   __raw_writel(reg, src-scr);
+
+   return 0;
+}
diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h 
b/arch/arm/include/asm/arch-mx6/imx-regs.h
index 1f19727..3f8c2ee 100644
--- a/arch/arm/include/asm/arch-mx6/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
@@ -225,6 +225,19 @@
 
 extern void imx_get_mac_from_fuse(int dev_id, unsigned char *mac);
 
+#define SRC_SCR_CORE_1_RESET_OFFSET 14
+#define SRC_SCR_CORE_1_RESET_MASK   (1SRC_SCR_CORE_1_RESET_OFFSET)
+#define SRC_SCR_CORE_2_RESET_OFFSET 15
+#define SRC_SCR_CORE_2_RESET_MASK   (1SRC_SCR_CORE_2_RESET_OFFSET)
+#define SRC_SCR_CORE_3_RESET_OFFSET 16
+#define SRC_SCR_CORE_3_RESET_MASK   (1SRC_SCR_CORE_3_RESET_OFFSET)
+#define SRC_SCR_CORE_1_ENABLE_OFFSET22
+#define SRC_SCR_CORE_1_ENABLE_MASK  (1SRC_SCR_CORE_1_ENABLE_OFFSET)
+#define SRC_SCR_CORE_2_ENABLE_OFFSET23
+#define SRC_SCR_CORE_2_ENABLE_MASK  (1SRC_SCR_CORE_2_ENABLE_OFFSET)
+#define SRC_SCR_CORE_3_ENABLE_OFFSET24
+#define SRC_SCR_CORE_3_ENABLE_MASK  (1SRC_SCR_CORE_3_ENABLE_OFFSET)
+
 /* System Reset Controller (SRC) */
 struct src {
u32 scr;
-- 
2.0.0.rc2

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


Re: [U-Boot] [PATCH] mx6: add support of multi-processor command

2014-06-21 Thread Fabio Estevam
On Sat, Jun 21, 2014 at 3:29 PM, Gabriel Huau cont...@huau-gabriel.fr wrote:
 Signed-off-by: Gabriel Huau cont...@huau-gabriel.fr

Please provide a commit log explaining in details the purpose of the
multi-processor command.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2] imx: nitrogen6x: Add support for GENERIC_BOARD

2014-06-21 Thread Eric Nelson
Enable CONFIG_SYS_GENERIC_BOARD, so that we get rid of the following
warning on boot:

Warning: Your board does not use generic board. Please read
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed.

Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
---
V2 expands on the commit message as requested by Mark and suggested by Stefano.

 include/configs/nitrogen6x.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index b2b17ce..43d1971 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -26,6 +26,8 @@
 #define CONFIG_REVISION_TAG
 #define CONFIG_SYS_GENERIC_BOARD
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN  (10 * 1024 * 1024)
 
-- 
1.9.1

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


Re: [U-Boot] [PATCH V2] imx: nitrogen6x: Add support for GENERIC_BOARD

2014-06-21 Thread Fabio Estevam
On Sat, Jun 21, 2014 at 6:31 PM, Eric Nelson
eric.nel...@boundarydevices.com wrote:
 --- a/include/configs/nitrogen6x.h
 +++ b/include/configs/nitrogen6x.h
 @@ -26,6 +26,8 @@
  #define CONFIG_REVISION_TAG
  #define CONFIG_SYS_GENERIC_BOARD

 +#define CONFIG_SYS_GENERIC_BOARD
 +

Looks like something went wrong here as we see
CONFIG_SYS_GENERIC_BOARD twice now :-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] mx6: add support of multi-processor command

2014-06-21 Thread Gabriel Huau
This allows u-boot to load different OS or Bare Metal application on the
different cores of the i.MX6DQ.
For example: we can run Android on cpu0 and a RT OS like QNX/FreeRTOS on cpu1.

Signed-off-by: Gabriel Huau cont...@huau-gabriel.fr
---
 arch/arm/cpu/armv7/mx6/Makefile  |   1 +
 arch/arm/cpu/armv7/mx6/mp.c  | 131 +++
 arch/arm/include/asm/arch-mx6/imx-regs.h |  13 +++
 3 files changed, 145 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/mx6/mp.c

diff --git a/arch/arm/cpu/armv7/mx6/Makefile b/arch/arm/cpu/armv7/mx6/Makefile
index d7285fc..ec08526 100644
--- a/arch/arm/cpu/armv7/mx6/Makefile
+++ b/arch/arm/cpu/armv7/mx6/Makefile
@@ -9,3 +9,4 @@
 
 obj-y  := soc.o clock.o
 obj-$(CONFIG_SECURE_BOOT)+= hab.o
+obj-$(CONFIG_MP) += mp.o
diff --git a/arch/arm/cpu/armv7/mx6/mp.c b/arch/arm/cpu/armv7/mx6/mp.c
new file mode 100644
index 000..a805be8
--- /dev/null
+++ b/arch/arm/cpu/armv7/mx6/mp.c
@@ -0,0 +1,131 @@
+/*
+ * (C) Copyright 2014
+ * Gabriel Huau cont...@huau-gabriel.fr
+ *
+ * (C) Copyright 2009 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include asm/io.h
+#include asm/errno.h
+#include asm/arch/imx-regs.h
+
+int cpu_reset(int nr)
+{
+   uint32_t reg;
+   struct src *src = (struct src *)SRC_BASE_ADDR;
+
+   reg = __raw_readl(src-scr);
+
+   switch (nr) {
+   case 1:
+   reg |= SRC_SCR_CORE_1_RESET_MASK;
+   break;
+
+   case 2:
+   reg |= SRC_SCR_CORE_2_RESET_MASK;
+   break;
+
+   case 3:
+   reg |= SRC_SCR_CORE_3_RESET_MASK;
+   break;
+   }
+
+   /* Software reset of the CPU N */
+   __raw_writel(reg, src-scr);
+
+   return 0;
+}
+
+int cpu_status(int nr)
+{
+   uint32_t reg;
+   struct src *src = (struct src *)SRC_BASE_ADDR;
+
+   reg = __raw_readl(src-scr);
+
+   switch (nr) {
+   case 1:
+   printf(core 1: %d\n, !!(reg  SRC_SCR_CORE_1_ENABLE_MASK));
+   break;
+
+   case 2:
+   printf(core 2: %d\n, !!(reg  SRC_SCR_CORE_2_ENABLE_MASK));
+   break;
+
+   case 3:
+   printf(core 3: %d\n, !!(reg  SRC_SCR_CORE_3_ENABLE_MASK));
+   break;
+   }
+
+   return 0;
+}
+
+int cpu_release(int nr, int argc, char *const argv[])
+{
+   uint32_t reg;
+   struct src *src = (struct src *)SRC_BASE_ADDR;
+   uint32_t boot_addr;
+
+   boot_addr = simple_strtoul(argv[0], NULL, 16);
+   reg = __raw_readl(src-scr);
+
+   switch (nr) {
+   case 1:
+   __raw_writel(boot_addr, src-gpr3);
+   reg |= SRC_SCR_CORE_1_ENABLE_MASK;
+   break;
+
+   case 2:
+   __raw_writel(boot_addr, src-gpr5);
+   reg |= SRC_SCR_CORE_2_ENABLE_MASK;
+   break;
+
+   case 3:
+   __raw_writel(boot_addr, src-gpr7);
+   reg |= SRC_SCR_CORE_3_ENABLE_MASK;
+   break;
+   }
+
+   /* CPU N is ready to start */
+   __raw_writel(reg, src-scr);
+
+   return 0;
+}
+
+int is_core_valid(unsigned int nr)
+{
+   if (nr  0 || nr = CONFIG_NUM_CPUS)
+   return 0;
+
+   return 1;
+}
+
+int cpu_disable(int nr)
+{
+   uint32_t reg;
+   struct src *src = (struct src *)SRC_BASE_ADDR;
+
+   reg = __raw_readl(src-scr);
+
+   switch (nr) {
+   case 1:
+   reg = ~SRC_SCR_CORE_1_ENABLE_MASK;
+   break;
+
+   case 2:
+   reg = ~SRC_SCR_CORE_2_ENABLE_MASK;
+   break;
+
+   case 3:
+   reg = ~SRC_SCR_CORE_3_ENABLE_MASK;
+   break;
+   }
+
+   /* Disable the CPU N */
+   __raw_writel(reg, src-scr);
+
+   return 0;
+}
diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h 
b/arch/arm/include/asm/arch-mx6/imx-regs.h
index 1f19727..3f8c2ee 100644
--- a/arch/arm/include/asm/arch-mx6/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
@@ -225,6 +225,19 @@
 
 extern void imx_get_mac_from_fuse(int dev_id, unsigned char *mac);
 
+#define SRC_SCR_CORE_1_RESET_OFFSET 14
+#define SRC_SCR_CORE_1_RESET_MASK   (1SRC_SCR_CORE_1_RESET_OFFSET)
+#define SRC_SCR_CORE_2_RESET_OFFSET 15
+#define SRC_SCR_CORE_2_RESET_MASK   (1SRC_SCR_CORE_2_RESET_OFFSET)
+#define SRC_SCR_CORE_3_RESET_OFFSET 16
+#define SRC_SCR_CORE_3_RESET_MASK   (1SRC_SCR_CORE_3_RESET_OFFSET)
+#define SRC_SCR_CORE_1_ENABLE_OFFSET22
+#define SRC_SCR_CORE_1_ENABLE_MASK  (1SRC_SCR_CORE_1_ENABLE_OFFSET)
+#define SRC_SCR_CORE_2_ENABLE_OFFSET23
+#define SRC_SCR_CORE_2_ENABLE_MASK  (1SRC_SCR_CORE_2_ENABLE_OFFSET)
+#define SRC_SCR_CORE_3_ENABLE_OFFSET24
+#define SRC_SCR_CORE_3_ENABLE_MASK  (1SRC_SCR_CORE_3_ENABLE_OFFSET)
+
 /* System Reset Controller (SRC) */
 struct src {
u32 scr;
-- 
2.0.0


[U-Boot] [PATCH v7 2/2] mpc8313: add CONFIG_SYS_GENERIC_BOARD to ids8313 board

2014-06-21 Thread Heiko Schocher
- add CONFIG_SYS_GENERIC_BOARD
- remove CONFIG_OF_CONTROL to boot again

Signed-off-by: Heiko Schocher h...@denx.de
Acked-by: Kim Phillips kim.phill...@freescale.com
Cc: Simon Glass s...@chromium.org

---
- changes for v2:
  - added acked-by from Kim
- changes for v3:
  none
- changes for v4:
  none
- changes for v5:
  none
- changes for v6:
  none
- changes for v7:
  none

 include/configs/ids8313.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
index 1de5750..3e55247 100644
--- a/include/configs/ids8313.h
+++ b/include/configs/ids8313.h
@@ -19,6 +19,8 @@
 #define CONFIG_MPC8313
 #define CONFIG_IDS8313
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 #define CONFIG_FSL_ELBC
 
 #define CONFIG_MISC_INIT_R
@@ -582,6 +584,5 @@
 #define CONFIG_RSA
 #define CONFIG_SHA1
 #define CONFIG_SHA256
-#define CONFIG_OF_CONTROL
 
 #endif /* __CONFIG_H */
-- 
1.8.3.1

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


[U-Boot] [PATCH v7 1/2] lib, fdt: move fdtdec_get_int() out of lib/fdtdec.c

2014-06-21 Thread Heiko Schocher
move fdtdec_get_int() out of lib/fdtdec.c into lib/fdtdec_common.c
as this function is also used, if CONFIG_OF_CONTROL is not
used. Poped up on the ids8313 board using signed FIT images,
and activating CONFIG_SYS_GENERIC_BOARD. Without this patch
it shows on boot:

No valid FDT found - please append one to U-Boot binary, use u-boot-dtb.bin or 
define CONFIG_OF_EMBED. For sandbox, use -d file.dtb

With this patch, it boots again with CONFIG_SYS_GENERIC_BOARD
enabled.

Signed-off-by: Heiko Schocher h...@denx.de
Acked-by: Simon Glass s...@chromium.org
Cc: Tom Rini tr...@ti.com

---
- changes for v2:
  - remove fdtdec_get_int() in lib/fdtdec.c
  - only one fdtdec_get_int() implementation
 Tested on the ids8313 board (on host and target side)
- changes for v3:
  use fdt_getprop() instead fdt_getprop_w() so we avoid a cast
  as Simon suggested.
- changes for v4:
  none
- changes for v5:
  - keep debug for non host side as Simon Glass suggested.
  - add Acked-by from Simon Glass
- changes for v6
  - rebased against commit d8a97f934c64a7ba6f11da5e4cc7f3be57fcb82d
  - compile fdtdec_common.c only if CONFIG_OF_CONTROL or CONFIG_FIT
is enabled, to prevent link errors when using old compilers
on sparc, blackfin and nds32 architectures, as Tom Rini suggested
- changes for v7:
  - do not use #ifdef in lib/Makefile, as duplicates get
filtered out.
  - rebased against 39b6d07fd7e692736cdb05a000b1c84ab43de4fb

 lib/Makefile|  2 ++
 lib/fdtdec.c| 36 
 lib/fdtdec_common.c | 38 ++
 tools/Makefile  |  1 +
 4 files changed, 41 insertions(+), 36 deletions(-)
 create mode 100644 lib/fdtdec_common.c

diff --git a/lib/Makefile b/lib/Makefile
index 377ab13..68210a5 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -23,6 +23,8 @@ obj-$(CONFIG_USB_TTY) += circbuf.o
 obj-y += crc7.o
 obj-y += crc8.o
 obj-y += crc16.o
+obj-$(CONFIG_FIT) += fdtdec_common.o
+obj-$(CONFIG_OF_CONTROL) += fdtdec_common.o
 obj-$(CONFIG_OF_CONTROL) += fdtdec.o
 obj-$(CONFIG_TEST_FDTDEC) += fdtdec_test.o
 obj-$(CONFIG_GZIP) += gunzip.o
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 13d3d2f..aaa6620 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -111,24 +111,6 @@ fdt_addr_t fdtdec_get_addr(const void *blob, int node,
return fdtdec_get_addr_size(blob, node, prop_name, NULL);
 }
 
-s32 fdtdec_get_int(const void *blob, int node, const char *prop_name,
-   s32 default_val)
-{
-   const s32 *cell;
-   int len;
-
-   debug(%s: %s: , __func__, prop_name);
-   cell = fdt_getprop(blob, node, prop_name, len);
-   if (cell  len = sizeof(s32)) {
-   s32 val = fdt32_to_cpu(cell[0]);
-
-   debug(%#x (%d)\n, val, val);
-   return val;
-   }
-   debug((not found)\n);
-   return default_val;
-}
-
 uint64_t fdtdec_get_uint64(const void *blob, int node, const char *prop_name,
uint64_t default_val)
 {
@@ -648,22 +630,4 @@ int fdtdec_read_fmap_entry(const void *blob, int node, 
const char *name,
 
return 0;
 }
-#else
-#include libfdt.h
-#include fdt_support.h
-
-int fdtdec_get_int(const void *blob, int node, const char *prop_name,
-   int default_val)
-{
-   const int *cell;
-   int len;
-
-   cell = fdt_getprop_w((void *)blob, node, prop_name, len);
-   if (cell  len = sizeof(int)) {
-   int val = fdt32_to_cpu(cell[0]);
-
-   return val;
-   }
-   return default_val;
-}
 #endif
diff --git a/lib/fdtdec_common.c b/lib/fdtdec_common.c
new file mode 100644
index 000..757931a
--- /dev/null
+++ b/lib/fdtdec_common.c
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2014
+ * Heiko Schocher, DENX Software Engineering, h...@denx.de.
+ *
+ * Based on lib/fdtdec.c:
+ * Copyright (c) 2011 The Chromium OS Authors.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef USE_HOSTCC
+#include common.h
+#include libfdt.h
+#include fdtdec.h
+#else
+#include libfdt.h
+#include fdt_support.h
+
+#define debug(...)
+#endif
+
+int fdtdec_get_int(const void *blob, int node, const char *prop_name,
+   int default_val)
+{
+   const int *cell;
+   int len;
+
+   debug(%s: %s: , __func__, prop_name);
+   cell = fdt_getprop(blob, node, prop_name, len);
+   if (cell  len = sizeof(int)) {
+   int val = fdt32_to_cpu(cell[0]);
+
+   debug(%#x (%d)\n, val, val);
+   return val;
+   }
+   debug((not found)\n);
+   return default_val;
+}
diff --git a/tools/Makefile b/tools/Makefile
index 3a1180f..61b2048 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -69,6 +69,7 @@ dumpimage-mkimage-objs := aisimage.o \
common/bootm.o \
lib/crc32.o \
default_image.o \
+   lib/fdtdec_common.o \
lib/fdtdec.o \
fit_common.o \
  

[U-Boot] [PATCH v7 0/2] mpc8313: ids8313 board updates

2014-06-21 Thread Heiko Schocher
- add CONFIG_SYS_GENERIC_BOARD to the ids8313 board,
  therefore fdtdec_get_int() is moved out of lib/fdtdec.c
  as lib/fdtdec.c is only compiled if CONFIG_OF_CONTROL
  is defined, but defining this for the ids8313 board
  leads in conjunction with CONFIG_SYS_GENERIC_BOARD
  in booting error:

No valid FDT found - please append one to U-Boot binary, use u-boot-dtb.bin or 
define CONFIG_OF_EMBED. For sandbox, use -d file.dtb

  So move the common used function fdtdec_get_int()
  out of lib/fdtdec.c into lib/fdtdec_common.c

Cc: Simon Glass s...@chromium.org
Cc: Kim Phillips kim.phill...@freescale.com
Cc: Wolfgang Denk w...@denx.de
Cc: Tom Rini tr...@ti.com
Cc: Michael Conrad michael.con...@ids.de

Heiko Schocher (2):
  lib, fdt: move fdtdec_get_int() out of lib/fdtdec.c
  mpc8313: add CONFIG_SYS_GENERIC_BOARD to ids8313 board

 include/configs/ids8313.h |  3 ++-
 lib/Makefile  |  2 ++
 lib/fdtdec.c  | 36 
 lib/fdtdec_common.c   | 38 ++
 tools/Makefile|  1 +
 5 files changed, 43 insertions(+), 37 deletions(-)
 create mode 100644 lib/fdtdec_common.c

-- 
1.8.3.1

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