[U-Boot] [PATCH] tools: fix Makefile to clean-up fit_info and fit_check_sign

2014-03-28 Thread Masahiro Yamada
We should avoid the description in Makefile like this

ifdef CONFIG_FIT_SIGNATURE
hostprogs-y += fit_info$(SFX) fit_check_sign$(SFX)
endif

Otherwise, fit_info and fit_check_sign would never be cleaned
by make clean.

Cc: Heiko Schocher h...@denx.de
---
 tools/Makefile | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index c5c378c..c34df4f 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -60,9 +60,7 @@ hostprogs-y += mkenvimage$(SFX)
 mkenvimage$(SFX)-objs := crc32.o mkenvimage.o os_support.o
 
 hostprogs-y += dumpimage$(SFX) mkimage$(SFX)
-ifdef CONFIG_FIT_SIGNATURE
-hostprogs-y += fit_info$(SFX) fit_check_sign$(SFX)
-endif
+hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info$(SFX) fit_check_sign$(SFX)
 
 FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := image-sig.o
 # Flattened device tree objects
-- 
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] kbuild/makefile: allow building host tools separately

2014-03-28 Thread Masahiro Yamada
Hi Alexey,


 Sometimes it is required to build only host U-Boot tools without building
 U-Boot itself for either board.
 
 For example:
  * In buildroot uboot-tools could be built for host just to have an 
 ability
to create uImage.
  * Linux distributions ship mkimage utility as a separate substance.
 
 This patch allows building host U-Boot tools separately from U-Boot itself and
 what is more important user only needs to have host compiler (gcc).
 
 To build host tools just execute:
 =
 make tools HOST_TOOLS_ONLY=yes
 =



This may be the similar discussion to
http://u-boot.10912.n7.nabble.com/U-Boot-could-not-cross-compile-u-boot-tools-td174911.html
Providing a separate make target seems preferable.

Maybe like this?

To build host tools just execute:
=
make tools-only
=

And I am not happy about adding ifdef to everywhere.


So, how about a patch like this?




diff --git a/Makefile b/Makefile
index c744718..12e1075 100644
--- a/Makefile
+++ b/Makefile
@@ -409,7 +409,7 @@ timestamp_h := include/generated/timestamp_autogenerated.h
 
 no-dot-config-targets := clean clobber mrproper distclean \
 help %docs check% coccicheck \
-ubootversion backup
+ubootversion backup tools-only
 
 config-targets := 0
 mixed-targets  := 0
@@ -1128,6 +1128,9 @@ checkarmreloc: u-boot
 env: scripts_basic
$(Q)$(MAKE) $(build)=tools/$@
 
+tools-only: scripts_basic
+   $(Q)$(MAKE) $(build)=tools
+
 tools-all: export HOST_TOOLS_ALL=y
 tools-all: env tools ;
 





Best Regards
Masahiro Yamada

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


Re: [U-Boot] [PATCH v3 2/2] MarSBoard: add new board

2014-03-28 Thread Stefan Roese

On 27.03.2014 18:10, Eric Bénard wrote:

this board is produced by Embest/Element 14 and is based on i.MX6 Dual
The following features are tested :
- UART2 (console)
- eMMC
- uSDCard
- Ethernet
- USB Host (through 2 ports hub)
- HDMI output
- I2C 1/2
- SPI NOR Flash

Boot on SPI NOR and through USB loader are tested.

For more informations on this board :
http://www.embest-tech.com/shop/star/marsboard.html

As this board shares a lot with RiOTboard, both boards are supported by
the same code base which is renamed embest/mx6boards.

Signed-off-by: Eric Bénard e...@eukrea.com


Looks much better this way for my taste. Thanks for working on this.

Reviewed-by: Stefan Roese s...@denx.de

Thanks,
Stefan

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


[U-Boot] [PATCH 1/2 v3] net/phy: enable get_phy_id redefinable

2014-03-28 Thread Shengzhou Liu
As some PHYs have non-standard PHY ID registers, PHY Id can't
be read correctly by current get_phy_id function, so we enable
get_phy_id redefinable to permit specific PHY driver having own
specific get_phy_id function.

Signed-off-by: Shengzhou Liu shengzhou@freescale.com
---
v3: no change.
v2: use weak style.

 drivers/net/phy/phy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index c691fbb..230ed97 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -18,6 +18,7 @@
 #include phy.h
 #include errno.h
 #include linux/err.h
+#include linux/compiler.h
 
 /* Generic PHY support and helper functions */
 
@@ -577,7 +578,7 @@ static struct phy_device *phy_device_create(struct mii_dev 
*bus, int addr,
  * Description: Reads the ID registers of the PHY at @addr on the
  *   @bus, stores it in @phy_id and returns zero on success.
  */
-static int get_phy_id(struct mii_dev *bus, int addr, int devad, u32 *phy_id)
+int __weak get_phy_id(struct mii_dev *bus, int addr, int devad, u32 *phy_id)
 {
int phy_reg;
 
-- 
1.8.0


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


[U-Boot] [PATCH V3 2/4] arm: mx5: Avoid hardcoding memory sizes on MX53QSB

2014-03-28 Thread Marek Vasut
The DRAM size can be easily detected at runtime on i.MX53. Implement
such detection on MX53QSB and adjust the rest of the macros accordingly
to use the detected values.

An important thing to note here is that we had to override the function
for trimming the effective DRAM address, get_effective_memsize(). That
is because the function uses CONFIG_MAX_MEM_MAPPED as the upper bound of
the available DRAM and we don't have gd-bd-bi_dram[0].size set up at
the time the function is called, thus we cannot put this into the macro
CONFIG_MAX_MEM_MAPPED . Instead, we use custom override where we use the
size of the first DRAM block which we just detected.

Signed-off-by: Marek Vasut ma...@denx.de
Cc: Fabio Estevam fabio.este...@freescale.com
Cc: Stefano Babic sba...@denx.de
Cc: Wolfgang Denk w...@denx.de
---
 board/freescale/mx53loco/mx53loco.c | 31 ---
 include/configs/mx53loco.h  | 12 +---
 2 files changed, 29 insertions(+), 14 deletions(-)

V2: Use linux/sizes.h instead of asm/sizes.h
V3: - Drop use of sizes.h completely
- Add beefy comment as to why we override get_effective_memsize()
- Drop CONFIG_VERY_BIG_RAM and CONFIG_MAX_MEM_MAPPED as we no longer
  need it if we override get_effective_memsize()

diff --git a/board/freescale/mx53loco/mx53loco.c 
b/board/freescale/mx53loco/mx53loco.c
index 08dd66f..b32a97f 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -30,24 +30,41 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int dram_init(void)
+static uint32_t mx53_dram_size[2];
+
+phys_size_t get_effective_memsize(void)
 {
-   u32 size1, size2;
+   /*
+* WARNING: We must override get_effective_memsize() function here
+* to report only the size of the first DRAM bank. This is to make
+* U-Boot relocator place U-Boot into valid memory, that is, at the
+* end of the first DRAM bank. If we did not override this function
+* like so, U-Boot would be placed at the address of the first DRAM
+* bank + total DRAM size - sizeof(uboot), which in the setup where
+* each DRAM bank contains 512MiB of DRAM would result in placing
+* U-Boot into invalid memory area close to the end of the first
+* DRAM bank.
+*/
+   return mx53_dram_size[0];
+}
 
-   size1 = get_ram_size((void *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
-   size2 = get_ram_size((void *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
+int dram_init(void)
+{
+   mx53_dram_size[0] = get_ram_size((void *)PHYS_SDRAM_1, 1  30);
+   mx53_dram_size[1] = get_ram_size((void *)PHYS_SDRAM_2, 1  30);
 
-   gd-ram_size = size1 + size2;
+   gd-ram_size = mx53_dram_size[0] + mx53_dram_size[1];
 
return 0;
 }
+
 void dram_init_banksize(void)
 {
gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
-   gd-bd-bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+   gd-bd-bi_dram[0].size = mx53_dram_size[0];
 
gd-bd-bi_dram[1].start = PHYS_SDRAM_2;
-   gd-bd-bi_dram[1].size = PHYS_SDRAM_2_SIZE;
+   gd-bd-bi_dram[1].size = mx53_dram_size[1];
 }
 
 u32 get_board_rev(void)
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index 82e0249..5859f36 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -194,13 +194,11 @@
 
 /* Physical Memory Map */
 #define CONFIG_NR_DRAM_BANKS   2
-#define PHYS_SDRAM_1   CSD0_BASE_ADDR
-#define PHYS_SDRAM_1_SIZE  (512 * 1024 * 1024)
-#define PHYS_SDRAM_2   CSD1_BASE_ADDR
-#define PHYS_SDRAM_2_SIZE  (512 * 1024 * 1024)
-#define PHYS_SDRAM_SIZE (PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE)
-#define CONFIG_VERY_BIG_RAM
-#define CONFIG_MAX_MEM_MAPPED  PHYS_SDRAM_1_SIZE
+#define PHYS_SDRAM_1   CSD0_BASE_ADDR
+#define PHYS_SDRAM_1_SIZE  (gd-bd-bi_dram[0].size)
+#define PHYS_SDRAM_2   CSD1_BASE_ADDR
+#define PHYS_SDRAM_2_SIZE  (gd-bd-bi_dram[1].size)
+#define PHYS_SDRAM_SIZE(gd-ram_size)
 
 #define CONFIG_SYS_SDRAM_BASE  (PHYS_SDRAM_1)
 #define CONFIG_SYS_INIT_RAM_ADDR   (IRAM_BASE_ADDR)
-- 
1.9.0

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


[U-Boot] [PATCH V2 1/4] arm: mx5: Fix memory slowness on MX53QSB

2014-03-28 Thread Marek Vasut
Fix memory access slowness on i.MX53 MX53QSB board. Let us inspect the
issue: First of all, the i.MX53 CPU has two memory banks mapped at
0x7000_ and 0xb000_ and each of those can hold up to 1GiB of
DRAM memory. Notice that the memory area is not continuous. On MX53QSB,
each of the banks contain 512MiB of DRAM, which makes a total of 1GiB
of memory available to the system.

The problem is how the relocation of U-Boot is treated on i.MX53 . The
U-Boot is placed at the ((start of first DRAM partition) + (gd-ram_size)) .
This in turn poses a problem, since in our case, the gd-ram_size is 1GiB,
the first DRAM bank starts at 0x7000_ and contains 512MiB of memory.
Thus, with this algorithm, U-Boot is placed at offset:

0x7000_ + 1GiB - sizeof(u-boot and some small margin)

This is past the DRAM available in the first bank on MX53QSB, but is still
within the address range of the first DRAM bank. Because of the memory
wrap-around, the data can still be read and written to this area, but the
access is much slower.

There were two ideas how to solve this problem, first was to map both of
the available DRAM chunks next to one another by using MMU, second was to
define CONFIG_VERY_BIG_RAM and CONFIG_MAX_MEM_MAPPED to size of the memory
in the first DRAM bank. We choose the later because it turns out the former
is not applicable afterall. The former cannot be used in case Linux kernel
was loaded into the second DRAM bank area, which would be remapped and one
would try booting the kernel, since at some point before the kernel is started,
the MMU would be turned off, which would destroy the mapping and hang the
system.

Signed-off-by: Marek Vasut ma...@denx.de
Cc: Fabio Estevam fabio.este...@freescale.com
Cc: Stefano Babic sba...@denx.de
Cc: Wolfgang Denk w...@denx.de
---
 include/configs/mx53loco.h | 2 ++
 1 file changed, 2 insertions(+)

V2: Reword the commit message

diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index 1415584..82e0249 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -199,6 +199,8 @@
 #define PHYS_SDRAM_2   CSD1_BASE_ADDR
 #define PHYS_SDRAM_2_SIZE  (512 * 1024 * 1024)
 #define PHYS_SDRAM_SIZE (PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE)
+#define CONFIG_VERY_BIG_RAM
+#define CONFIG_MAX_MEM_MAPPED  PHYS_SDRAM_1_SIZE
 
 #define CONFIG_SYS_SDRAM_BASE  (PHYS_SDRAM_1)
 #define CONFIG_SYS_INIT_RAM_ADDR   (IRAM_BASE_ADDR)
-- 
1.9.0

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


[U-Boot] [PATCH V3 4/4] arm: mx5: Avoid hardcoding memory sizes on M53EVK

2014-03-28 Thread Marek Vasut
The DRAM size can be easily detected at runtime on i.MX53. Implement
such detection on M53EVK and adjust the rest of the macros accordingly
to use the detected values.

An important thing to note here is that we had to override the function
for trimming the effective DRAM address, get_effective_memsize(). That
is because the function uses CONFIG_MAX_MEM_MAPPED as the upper bound of
the available DRAM and we don't have gd-bd-bi_dram[0].size set up at
the time the function is called, thus we cannot put this into the macro
CONFIG_MAX_MEM_MAPPED . Instead, we use custom override where we use the
size of the first DRAM block which we just detected.

Signed-off-by: Marek Vasut ma...@denx.de
Cc: Fabio Estevam fabio.este...@freescale.com
Cc: Stefano Babic sba...@denx.de
Cc: Wolfgang Denk w...@denx.de
---
 board/denx/m53evk/m53evk.c | 31 ---
 include/configs/m53evk.h   |  8 +++-
 2 files changed, 27 insertions(+), 12 deletions(-)

V2: Use linux/sizes.h instead of asm/sizes.h
V3: - Drop use of sizes.h completely
- Add beefy comment as to why we override get_effective_memsize()
- Drop CONFIG_VERY_BIG_RAM and CONFIG_MAX_MEM_MAPPED as we no longer
  need it if we override get_effective_memsize()

diff --git a/board/denx/m53evk/m53evk.c b/board/denx/m53evk/m53evk.c
index 0f71a16..74f9501 100644
--- a/board/denx/m53evk/m53evk.c
+++ b/board/denx/m53evk/m53evk.c
@@ -31,24 +31,41 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int dram_init(void)
+static uint32_t mx53_dram_size[2];
+
+phys_size_t get_effective_memsize(void)
 {
-   u32 size1, size2;
+   /*
+* WARNING: We must override get_effective_memsize() function here
+* to report only the size of the first DRAM bank. This is to make
+* U-Boot relocator place U-Boot into valid memory, that is, at the
+* end of the first DRAM bank. If we did not override this function
+* like so, U-Boot would be placed at the address of the first DRAM
+* bank + total DRAM size - sizeof(uboot), which in the setup where
+* each DRAM bank contains 512MiB of DRAM would result in placing
+* U-Boot into invalid memory area close to the end of the first
+* DRAM bank.
+*/
+   return mx53_dram_size[0];
+}
 
-   size1 = get_ram_size((void *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
-   size2 = get_ram_size((void *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
+int dram_init(void)
+{
+   mx53_dram_size[0] = get_ram_size((void *)PHYS_SDRAM_1, 1  30);
+   mx53_dram_size[1] = get_ram_size((void *)PHYS_SDRAM_2, 1  30);
 
-   gd-ram_size = size1 + size2;
+   gd-ram_size = mx53_dram_size[0] + mx53_dram_size[1];
 
return 0;
 }
+
 void dram_init_banksize(void)
 {
gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
-   gd-bd-bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+   gd-bd-bi_dram[0].size = mx53_dram_size[0];
 
gd-bd-bi_dram[1].start = PHYS_SDRAM_2;
-   gd-bd-bi_dram[1].size = PHYS_SDRAM_2_SIZE;
+   gd-bd-bi_dram[1].size = mx53_dram_size[1];
 }
 
 static void setup_iomux_uart(void)
diff --git a/include/configs/m53evk.h b/include/configs/m53evk.h
index 6f8872e..f401470 100644
--- a/include/configs/m53evk.h
+++ b/include/configs/m53evk.h
@@ -46,15 +46,13 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2
 #define PHYS_SDRAM_1   CSD0_BASE_ADDR
-#define PHYS_SDRAM_1_SIZE  (512 * 1024 * 1024)
+#define PHYS_SDRAM_1_SIZE  (gd-bd-bi_dram[0].size)
 #define PHYS_SDRAM_2   CSD1_BASE_ADDR
-#define PHYS_SDRAM_2_SIZE  (512 * 1024 * 1024)
-#define PHYS_SDRAM_SIZE(PHYS_SDRAM_1_SIZE + 
PHYS_SDRAM_2_SIZE)
+#define PHYS_SDRAM_2_SIZE  (gd-bd-bi_dram[1].size)
+#define PHYS_SDRAM_SIZE(gd-ram_size)
 #define CONFIG_SYS_MALLOC_LEN  (10 * 1024 * 1024)
 #define CONFIG_SYS_MEMTEST_START   0x7000
 #define CONFIG_SYS_MEMTEST_END 0x8ff0
-#define CONFIG_VERY_BIG_RAM
-#define CONFIG_MAX_MEM_MAPPED  PHYS_SDRAM_1_SIZE
 
 #define CONFIG_SYS_SDRAM_BASE  (PHYS_SDRAM_1)
 #define CONFIG_SYS_INIT_RAM_ADDR   (IRAM_BASE_ADDR)
-- 
1.9.0

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


[U-Boot] [PATCH V2 3/4] arm: mx5: Fix memory slowness on M53EVK

2014-03-28 Thread Marek Vasut
Fix memory access slowness on i.MX53 M53EVK board. Let us inspect the
issue: First of all, the i.MX53 CPU has two memory banks mapped at
0x7000_ and 0xb000_ and each of those can hold up to 1GiB of
DRAM memory. Notice that the memory area is not continuous. On M53EVK,
each of the banks contain 512MiB of DRAM, which makes a total of 1GiB
of memory available to the system.

The problem is how the relocation of U-Boot is treated on i.MX53 . The
U-Boot is placed at the ((start of first DRAM partition) + (gd-ram_size)) .
This in turn poses a problem, since in our case, the gd-ram_size is 1GiB,
the first DRAM bank starts at 0x7000_ and contains 512MiB of memory.
Thus, with this algorithm, U-Boot is placed at offset:

0x7000_ + 1GiB - sizeof(u-boot and some small margin)

This is past the DRAM available in the first bank on M53EVK, but is still
within the address range of the first DRAM bank. Because of the memory
wrap-around, the data can still be read and written to this area, but the
access is much slower.

There were two ideas how to solve this problem, first was to map both of
the available DRAM chunks next to one another by using MMU, second was to
define CONFIG_VERY_BIG_RAM and CONFIG_MAX_MEM_MAPPED to size of the memory
in the first DRAM bank. We choose the later because it turns out the former
is not applicable afterall. The former cannot be used in case Linux kernel
was loaded into the second DRAM bank area, which would be remapped and one
would try booting the kernel, since at some point before the kernel is started,
the MMU would be turned off, which would destroy the mapping and hang the
system.

Signed-off-by: Marek Vasut ma...@denx.de
Cc: Fabio Estevam fabio.este...@freescale.com
Cc: Stefano Babic sba...@denx.de
Cc: Wolfgang Denk w...@denx.de
---
 include/configs/m53evk.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

V2: Reword the commit message

diff --git a/include/configs/m53evk.h b/include/configs/m53evk.h
index 16546c2..6f8872e 100644
--- a/include/configs/m53evk.h
+++ b/include/configs/m53evk.h
@@ -52,7 +52,9 @@
 #define PHYS_SDRAM_SIZE(PHYS_SDRAM_1_SIZE + 
PHYS_SDRAM_2_SIZE)
 #define CONFIG_SYS_MALLOC_LEN  (10 * 1024 * 1024)
 #define CONFIG_SYS_MEMTEST_START   0x7000
-#define CONFIG_SYS_MEMTEST_END 0xaff0
+#define CONFIG_SYS_MEMTEST_END 0x8ff0
+#define CONFIG_VERY_BIG_RAM
+#define CONFIG_MAX_MEM_MAPPED  PHYS_SDRAM_1_SIZE
 
 #define CONFIG_SYS_SDRAM_BASE  (PHYS_SDRAM_1)
 #define CONFIG_SYS_INIT_RAM_ADDR   (IRAM_BASE_ADDR)
-- 
1.9.0

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


Re: [U-Boot] [U-boot] unsigned long long in ARMv8

2014-03-28 Thread TigerLiu
Hi, All:

 how to map unsigned long long  to a long data type if compiling a
64bit u-boot?

I got the answer:

ARMv8 compiler will treat unsigned long long as u64 type.

 

Best wishes,

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


[U-Boot] [PATCH 2/2 v3] net/phy: Add support for CS4315/CS4340 PHY

2014-03-28 Thread Shengzhou Liu
Add support for Cortina CS4315/CS4340 10G PHY.
- This driver loads CS43xx firmware to initialize Cortina PHY.
- To define macro CONFIG_PHY_CORTINA will enable this driver.
- Cortina PHY has non-standard offset of PHY ID registers, so
  define own get_phy_id().

Signed-off-by: Shengzhou Liu shengzhou@freescale.com
---
v3: move devad as '0' in cortina.c instead of in phy.c to avoid impacting other 
phy.
v2: no change.

 drivers/net/phy/Makefile  |   1 +
 drivers/net/phy/cortina.c | 269 ++
 drivers/net/phy/phy.c |   3 +
 include/cortina.h |  73 +
 include/phy.h |   2 +
 5 files changed, 348 insertions(+)
 create mode 100644 drivers/net/phy/cortina.c
 create mode 100644 include/cortina.h

diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index dbf7bf7..b091962 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -24,3 +24,4 @@ obj-$(CONFIG_PHY_REALTEK) += realtek.o
 obj-$(CONFIG_PHY_SMSC) += smsc.o
 obj-$(CONFIG_PHY_TERANETICS) += teranetics.o
 obj-$(CONFIG_PHY_VITESSE) += vitesse.o
+obj-$(CONFIG_PHY_CORTINA) += cortina.o
diff --git a/drivers/net/phy/cortina.c b/drivers/net/phy/cortina.c
new file mode 100644
index 000..1418539
--- /dev/null
+++ b/drivers/net/phy/cortina.c
@@ -0,0 +1,269 @@
+/*
+ * Cortina CS4315/CS4340 10G PHY drivers
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ */
+
+#include config.h
+#include common.h
+#include linux/ctype.h
+#include linux/string.h
+#include linux/err.h
+#include phy.h
+#include cortina.h
+
+#ifndef CONFIG_PHYLIB_10G
+#error The Cortina PHY needs 10G support
+#endif
+
+struct cortina_reg_config cortina_reg_cfg[] = {
+   /* CS4315_enable_sr_mode */
+   {VILLA_GLOBAL_MSEQCLKCTRL, 0x8004},
+   {VILLA_MSEQ_OPTIONS, 0xf},
+   {VILLA_MSEQ_PC, 0x0},
+   {VILLA_MSEQ_BANKSELECT,0x4},
+   {VILLA_LINE_SDS_COMMON_SRX0_RX_CPA, 0x55},
+   {VILLA_LINE_SDS_COMMON_SRX0_RX_LOOP_FILTER, 0x30},
+   {VILLA_DSP_SDS_SERDES_SRX_DFE0_SELECT, 0x1},
+   {VILLA_DSP_SDS_DSP_COEF_DFE0_SELECT, 0x2},
+   {VILLA_LINE_SDS_COMMON_SRX0_RX_CPB, 0x2003},
+   {VILLA_DSP_SDS_SERDES_SRX_FFE_DELAY_CTRL, 0xF047},
+   {VILLA_MSEQ_ENABLE_MSB, 0x},
+   {VILLA_MSEQ_SPARE21_LSB, 0x6},
+   {VILLA_MSEQ_RESET_COUNT_LSB, 0x0},
+   {VILLA_MSEQ_SPARE12_MSB, 0x},
+   /*
+* to invert the receiver path, uncomment the next line
+* write (VILLA_MSEQ_SPARE12_MSB, 0x4000)
+*
+* SPARE2_LSB is used to configure the device while in sr mode to
+* enable power savings and to use the optical module LOS signal.
+* in power savings mode, the internal prbs checker can not be used.
+* if the optical module LOS signal is used as an input to the micro
+* code, then the micro code will wait until the optical module
+* LOS = 0 before turning on the adaptive equalizer.
+* Setting SPARE2_LSB bit 0 to 1 places the devie in power savings mode
+* while setting bit 0 to 0 disables power savings mode.
+* Setting SPARE2_LSB bit 2 to 0 configures the device to use the
+* optical module LOS signal while setting bit 2 to 1 configures the
+* device so that it will ignore the optical module LOS SPARE2_LSB = 0
+*/
+
+   /* enable power savings, ignore optical module LOS */
+   {VILLA_MSEQ_SPARE2_LSB, 0x5},
+
+   {VILLA_MSEQ_SPARE7_LSB, 0x1e},
+   {VILLA_MSEQ_BANKSELECT, 0x4},
+   {VILLA_MSEQ_SPARE9_LSB, 0x2},
+   {VILLA_MSEQ_SPARE3_LSB, 0x0F53},
+   {VILLA_MSEQ_SPARE3_MSB, 0x2006},
+   {VILLA_MSEQ_SPARE8_LSB, 0x3FF7},
+   {VILLA_MSEQ_SPARE8_MSB, 0x0A46},
+   {VILLA_MSEQ_COEF8_FFE0_LSB, 0xD500},
+   {VILLA_MSEQ_COEF8_FFE1_LSB, 0x0200},
+   {VILLA_MSEQ_COEF8_FFE2_LSB, 0xBA00},
+   {VILLA_MSEQ_COEF8_FFE3_LSB, 0x0100},
+   {VILLA_MSEQ_COEF8_FFE4_LSB, 0x0300},
+   {VILLA_MSEQ_COEF8_FFE5_LSB, 0x0300},
+   {VILLA_MSEQ_COEF8_DFE0_LSB, 0x0700},
+   {VILLA_MSEQ_COEF8_DFE0N_LSB, 0x0E00},
+   {VILLA_MSEQ_COEF8_DFE1_LSB, 0x0B00},
+   {VILLA_DSP_SDS_DSP_COEF_LARGE_LEAK, 0x2},
+   {VILLA_DSP_SDS_SERDES_SRX_DAC_ENABLEB_LSB, 0xD000},
+   {VILLA_MSEQ_POWER_DOWN_LSB, 0x},
+   {VILLA_MSEQ_POWER_DOWN_MSB, 0x0},
+   {VILLA_MSEQ_CAL_RX_SLICER, 0x80},
+   {VILLA_DSP_SDS_SERDES_SRX_DAC_BIAS_SELECT1_MSB, 0x3f},
+   {VILLA_GLOBAL_MSEQCLKCTRL, 0x4},
+   {VILLA_MSEQ_OPTIONS, 0x7},
+
+   /* set up min value for ffe1 */
+   {VILLA_MSEQ_COEF_INIT_SEL, 0x2},
+   {VILLA_DSP_SDS_DSP_PRECODEDINITFFE21, 0x41},
+
+   /* CS4315_sr_rx_pre_eq_set_4in */
+   {VILLA_GLOBAL_MSEQCLKCTRL, 0x8004},
+   {VILLA_MSEQ_OPTIONS, 0xf},
+   {VILLA_MSEQ_BANKSELECT, 0x4},
+   {VILLA_MSEQ_PC, 0x0},
+
+   /* for lengths from 3.5 to 4.5inches */
+   {VILLA_MSEQ_SERDES_PARAM_LSB, 0x0306},
+   

Re: [U-Boot] [PATCH v2 1/9] sunxi: initial sun7i clocks and timer support.

2014-03-28 Thread Ian Campbell
On Thu, 2014-03-27 at 23:36 +0100, Marek Vasut wrote:
 On Thursday, March 27, 2014 at 11:12:38 PM, Ian Campbell wrote:
  On Thu, 2014-03-27 at 23:00 +0100, Marek Vasut wrote:
   On Thursday, March 27, 2014 at 10:29:56 PM, Ian Campbell wrote:
On Mon, 2014-03-24 at 21:52 +0100, Marek Vasut wrote:
  +static struct sunxi_timer *timer_base =
  + ((struct sunxi_timer_reg
  *)SUNXI_TIMER_BASE)-timer[TIMER_NUM]; +
  +/* macro to read the 32 bit timer: since it decrements, we invert
  read value */ +#define READ_TIMER() (~readl(timer_base-val))
 
 This macro has to go, just use ~readl() in place. But still, why do
 you use that negation in ~readl() anyway ?

The comment right above it explains why: the timer counts backwards and
inverting it accounts for that.

This is subtle enough that I don't think using ~readl() in place in the
3 callers would be an improvement.
   
   Please do it, we don't want any implementers down the line using this
   READ_TIMER() call and getting hit by timer_base undefined . That
   macro hides the dependency on this symbol, while if you expanded it
   in-place, the dependency would be explicit. I really do want to see that
   macro gone, sorry.
  
  How about a static inline instead of the macro? I'm thinking with a
  body:
  {
struct sunxi_timer *timers =
(struct sunxi_timer_reg *)SUNXI_TIMER_BASE;
return timers[TIMER_NUM]-val;
  }
  With something similar in timer_init then both the macro and the static
  global timer_base can be dropped.
 
 That's just wrapping a readl() into another function, which seems unnecessary 
 really.

Sorry, but I think inlining the readl (and along with it the
interesting/subtle) inverting functionality is a terrible idea, it
should be wrapped in some sort of accessor precisely because it is not a
raw readl.

I'm going to make it a function as I suggested.

  BTW this macro is in arch/arm/cpu/armv7/sunxi/timer.c not a header, so
  I'm not sure which implementers down the line you were worried about
  using it in some other context where it breaks.
 
 People plumbing in the timer.c file who are not aware the macro has a 
 dependency 
 which is not passed as it's parameter.

What people? What plumbing? I've no idea what you are concerned about
here.

Ian.


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


Re: [U-Boot] [PATCH v2 1/9] sunxi: initial sun7i clocks and timer support.

2014-03-28 Thread Hans de Goede
Hi,

On 03/28/2014 09:20 AM, Ian Campbell wrote:
 On Thu, 2014-03-27 at 23:36 +0100, Marek Vasut wrote:
 On Thursday, March 27, 2014 at 11:12:38 PM, Ian Campbell wrote:
 On Thu, 2014-03-27 at 23:00 +0100, Marek Vasut wrote:
 On Thursday, March 27, 2014 at 10:29:56 PM, Ian Campbell wrote:
 On Mon, 2014-03-24 at 21:52 +0100, Marek Vasut wrote:
 +static struct sunxi_timer *timer_base =
 + ((struct sunxi_timer_reg
 *)SUNXI_TIMER_BASE)-timer[TIMER_NUM]; +
 +/* macro to read the 32 bit timer: since it decrements, we invert
 read value */ +#define READ_TIMER() (~readl(timer_base-val))

 This macro has to go, just use ~readl() in place. But still, why do
 you use that negation in ~readl() anyway ?

 The comment right above it explains why: the timer counts backwards and
 inverting it accounts for that.

 This is subtle enough that I don't think using ~readl() in place in the
 3 callers would be an improvement.

 Please do it, we don't want any implementers down the line using this
 READ_TIMER() call and getting hit by timer_base undefined . That
 macro hides the dependency on this symbol, while if you expanded it
 in-place, the dependency would be explicit. I really do want to see that
 macro gone, sorry.

 How about a static inline instead of the macro? I'm thinking with a
 body:
 {
   struct sunxi_timer *timers =
   (struct sunxi_timer_reg *)SUNXI_TIMER_BASE;
   return timers[TIMER_NUM]-val;
 }
 With something similar in timer_init then both the macro and the static
 global timer_base can be dropped.

 That's just wrapping a readl() into another function, which seems 
 unnecessary 
 really.
 
 Sorry, but I think inlining the readl (and along with it the
 interesting/subtle) inverting functionality is a terrible idea, it
 should be wrapped in some sort of accessor precisely because it is not a
 raw readl.
 
 I'm going to make it a function as I suggested.
 
 BTW this macro is in arch/arm/cpu/armv7/sunxi/timer.c not a header, so
 I'm not sure which implementers down the line you were worried about
 using it in some other context where it breaks.

 People plumbing in the timer.c file who are not aware the macro has a 
 dependency 
 which is not passed as it's parameter.
 
 What people? What plumbing? I've no idea what you are concerned about
 here.

I think what Marek is concerned about is people making some global u-boot change
which for some reason requires fixing up a bunch of platform specific files,
and they end up touching our timer.c without ever test-compiling it.

These kind of things happen in qemu / the kernel too. In this case they could 
move
a READ_TIMER() somewhere where the timer_base is not defined. Your suggestion of
making it a proper function will fix that though, and I think is the best 
solution.

Regards,

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


Re: [U-Boot] [PATCH v2 1/9] sunxi: initial sun7i clocks and timer support.

2014-03-28 Thread Marek Vasut
On Friday, March 28, 2014 at 09:20:17 AM, Ian Campbell wrote:
 On Thu, 2014-03-27 at 23:36 +0100, Marek Vasut wrote:
  On Thursday, March 27, 2014 at 11:12:38 PM, Ian Campbell wrote:
   On Thu, 2014-03-27 at 23:00 +0100, Marek Vasut wrote:
On Thursday, March 27, 2014 at 10:29:56 PM, Ian Campbell wrote:
 On Mon, 2014-03-24 at 21:52 +0100, Marek Vasut wrote:
   +static struct sunxi_timer *timer_base =
   + ((struct sunxi_timer_reg
   *)SUNXI_TIMER_BASE)-timer[TIMER_NUM]; +
   +/* macro to read the 32 bit timer: since it decrements, we
   invert read value */ +#define READ_TIMER()
   (~readl(timer_base-val))
  
  This macro has to go, just use ~readl() in place. But still, why
  do you use that negation in ~readl() anyway ?
 
 The comment right above it explains why: the timer counts backwards
 and inverting it accounts for that.
 
 This is subtle enough that I don't think using ~readl() in place in
 the 3 callers would be an improvement.

Please do it, we don't want any implementers down the line using this
READ_TIMER() call and getting hit by timer_base undefined . That
macro hides the dependency on this symbol, while if you expanded it
in-place, the dependency would be explicit. I really do want to see
that macro gone, sorry.
   
   How about a static inline instead of the macro? I'm thinking with a
   body:
   {
   
 struct sunxi_timer *timers =
 
 (struct sunxi_timer_reg *)SUNXI_TIMER_BASE;
 
 return timers[TIMER_NUM]-val;
   
   }
   With something similar in timer_init then both the macro and the static
   global timer_base can be dropped.
  
  That's just wrapping a readl() into another function, which seems
  unnecessary really.
 
 Sorry, but I think inlining the readl (and along with it the
 interesting/subtle) inverting functionality is a terrible idea, it
 should be wrapped in some sort of accessor precisely because it is not a
 raw readl.
 
 I'm going to make it a function as I suggested.
 
   BTW this macro is in arch/arm/cpu/armv7/sunxi/timer.c not a header, so
   I'm not sure which implementers down the line you were worried about
   using it in some other context where it breaks.
  
  People plumbing in the timer.c file who are not aware the macro has a
  dependency which is not passed as it's parameter.
 
 What people? What plumbing? I've no idea what you are concerned about
 here.

OK, I will wait for V3 of the patch since this discussion have gone awry . 
Let's 
talk about V3 , ok ? :)

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


Re: [U-Boot] [PATCH v2 1/9] sunxi: initial sun7i clocks and timer support.

2014-03-28 Thread Marek Vasut
On Friday, March 28, 2014 at 09:25:40 AM, Hans de Goede wrote:
 Hi,
 
 On 03/28/2014 09:20 AM, Ian Campbell wrote:
  On Thu, 2014-03-27 at 23:36 +0100, Marek Vasut wrote:
  On Thursday, March 27, 2014 at 11:12:38 PM, Ian Campbell wrote:
  On Thu, 2014-03-27 at 23:00 +0100, Marek Vasut wrote:
  On Thursday, March 27, 2014 at 10:29:56 PM, Ian Campbell wrote:
  On Mon, 2014-03-24 at 21:52 +0100, Marek Vasut wrote:
  +static struct sunxi_timer *timer_base =
  + ((struct sunxi_timer_reg
  *)SUNXI_TIMER_BASE)-timer[TIMER_NUM]; +
  +/* macro to read the 32 bit timer: since it decrements, we invert
  read value */ +#define READ_TIMER() (~readl(timer_base-val))
  
  This macro has to go, just use ~readl() in place. But still, why do
  you use that negation in ~readl() anyway ?
  
  The comment right above it explains why: the timer counts backwards
  and inverting it accounts for that.
  
  This is subtle enough that I don't think using ~readl() in place in
  the 3 callers would be an improvement.
  
  Please do it, we don't want any implementers down the line using this
  READ_TIMER() call and getting hit by timer_base undefined . That
  macro hides the dependency on this symbol, while if you expanded it
  in-place, the dependency would be explicit. I really do want to see
  that macro gone, sorry.
  
  How about a static inline instead of the macro? I'm thinking with a
  body:
  {
  
struct sunxi_timer *timers =

(struct sunxi_timer_reg *)SUNXI_TIMER_BASE;

return timers[TIMER_NUM]-val;
  
  }
  With something similar in timer_init then both the macro and the static
  global timer_base can be dropped.
  
  That's just wrapping a readl() into another function, which seems
  unnecessary really.
  
  Sorry, but I think inlining the readl (and along with it the
  interesting/subtle) inverting functionality is a terrible idea, it
  should be wrapped in some sort of accessor precisely because it is not a
  raw readl.
  
  I'm going to make it a function as I suggested.
  
  BTW this macro is in arch/arm/cpu/armv7/sunxi/timer.c not a header, so
  I'm not sure which implementers down the line you were worried about
  using it in some other context where it breaks.
  
  People plumbing in the timer.c file who are not aware the macro has a
  dependency which is not passed as it's parameter.
  
  What people? What plumbing? I've no idea what you are concerned about
  here.
 
 I think what Marek is concerned about is people making some global u-boot
 change which for some reason requires fixing up a bunch of platform
 specific files, and they end up touching our timer.c without ever
 test-compiling it.

We don't do such changes without test-compiling those (most of us don't and 
those who do ... well ... tsk tsk tsk ! ;-) ).

 These kind of things happen in qemu / the kernel too. In this case they
 could move a READ_TIMER() somewhere where the timer_base is not defined.

Yeah.

 Your suggestion of making it a proper function will fix that though, and I
 think is the best solution.

I think wrapping a plain readl() into a function is not necessary, but I will 
wait for V3 to see it in action and then I will decide .
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v7] nand/denali: Adding Denali NAND driver support

2014-03-28 Thread Masahiro Yamada
Hi Chin,


 To add the Denali NAND driver support into U-Boot. It required
 information such as register base address from configuration
 header file  within include/configs folder.
 
 Signed-off-by: Chin Liang See cl...@altera.com
 Cc: Artem Bityutskiy artem.bityuts...@linux.intel.com
 Cc: David Woodhouse david.woodho...@intel.com
 Cc: Brian Norris computersforpe...@gmail.com
 Cc: Scott Wood scottw...@freescale.com
 Cc: Masahiro Yamada yamad...@jp.panasonic.com
 ---
 Changes for v7
 - Adding Masahiro's code to support 64bit version controller
 - Removed unused stub functions
 - Enhanced the ECC calculation



This version works on Panasonic SoCs and
looks good enough to be applied.
Thanks!


Reviewed-by: Masahiro Yamada yamad...@jp.panasonic.com
Tested-by: Masahiro Yamada yamad...@jp.panasonic.com



Best Regards
Masahiro Yamada

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


Re: [U-Boot] Enabling uart 3 in arndale

2014-03-28 Thread armdev
Dear Tomasz,

On 16-Mar-2014, at 6:23 pm, Tomasz Figa tomasz.f...@gmail.com wrote:

 Hi,
 
 On 14.03.2014 09:04, armdev wrote:
 Hi,
 
 We are trying to enable the UART3 on COM18 pins of arndale board. The UART3 
 RXD and TXD are on pins 2 and 4 which as per the base board specification is 
 connected as
 
 XuRXD3 : UART_3_RXD/GPA1[4] : 2
 XuTXD3 : UART_3_TXD/GPA1[5] : 4
 
 As per the public reference manual of exynos 5250, there is a register 
 GPACON (0x1140_)
 Setting GPACON |= 0x0010_ should enable the pins, but I am not able to 
 see any output on UART3.
 
 Can you please suggest what is the right procedure
 
 The register is GPA1CON and its GPA1CON[4] and [5] bit fields need both to be 
 set to 0x2 - see Pad Control chapter of Exynos5250 public datasheet. Also 
 GPA1PUD should be reconfigured to disable default pull-down on both pins, 
 again you can find details of the register in the datasheet.
 
 Best regards,
 Tomasz

Based on the steps provided, we are still not able to get some output on UART3 
simultaneously with UART2.
Can you please help us find out what we are missing.

On the current u-boot, Following was the observation and steps to enable UART3 
on arndale

Observations / Questions
——
a) The board has the default UART set to UART2 which is at 0x12c2, while 
the include/configs/arndale.h has the UART_OFFSET set to 0x01.
Shouldn’t it be set to 0x2 ?

b) board_uart_init in board/samsung/arndale/arndale.c is configuring all the 
uarts, 
Clocks would be set properly for all 4 uarts ?

Steps / Code Modified
——
a) GPAICON[4] and [5] set to 0x2 in board/samsung/arndale/arndale.c
b) GPA1PUD [4] and [5] set to 0.

diff --git a/board/samsung/arndale/arndale.c b/board/samsung/arndale/arndale.c
index 9efc355..4fb291e 100644
--- a/board/samsung/arndale/arndale.c
+++ b/board/samsung/arndale/arndale.c
@@ -102,12 +102,18 @@ static int board_uart_init(void)
 int board_early_init_f(void)
 {
int err;
-
+   volatile unsigned int *gpa1con = (volatile unsigned int *)0x11400020;
+   volatile unsigned int *gpa1pud = (volatile unsigned int *)0x11400028;
err = board_uart_init();
if (err) {
debug(UART init failed\n);
return err;
}
+   serial_init_dev(2);
+   serial_setbrg_dev(2);
+   *gpa1con |= 0x0022; 
+   *gpa1pud = 0xf0ff; 
+
return err;
 }
 #endif

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


Re: [U-Boot] [PATCH v2 5/9] sunxi: generic sun7i build infrastructure.

2014-03-28 Thread Ian Campbell
On Thu, 2014-03-27 at 23:37 +0100, Marek Vasut wrote:
 On Thursday, March 27, 2014 at 11:05:21 PM, Ian Campbell wrote:
  On Mon, 2014-03-24 at 22:01 +0100, Marek Vasut wrote:
diff --git a/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds
b/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds new file mode 100644
index 000..cf02300
--- /dev/null
+++ b/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds
   
   This file is unreadable. Can you not actually merge it into
   u-boot-spl.lds with some #ifdef ?
  
  They look pretty much entirely different to me. I should sort out the
  whitespace and stuff though, it is a mess in that regard. Perhaps that
  will help.
 
 Likely, but is it really necessary for those two files to be so different or 
 is 
 this some legacy stuff in the sunxi-specific .lds file?

The standard lds file is pretty standard. This -fel version is for a
special boot mode which sunxi processors have[0] which allows for
booting over USB OTG, so the image needs to be built appropriately.

Ian.

[0] http://linux-sunxi.org/FEL




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


Re: [U-Boot] [PATCH v2 5/9] sunxi: generic sun7i build infrastructure.

2014-03-28 Thread Marek Vasut
On Friday, March 28, 2014 at 09:26:50 AM, Ian Campbell wrote:
 On Thu, 2014-03-27 at 23:37 +0100, Marek Vasut wrote:
  On Thursday, March 27, 2014 at 11:05:21 PM, Ian Campbell wrote:
   On Mon, 2014-03-24 at 22:01 +0100, Marek Vasut wrote:
 diff --git a/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds
 b/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds new file mode 100644
 index 000..cf02300
 --- /dev/null
 +++ b/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds

This file is unreadable. Can you not actually merge it into
u-boot-spl.lds with some #ifdef ?
   
   They look pretty much entirely different to me. I should sort out the
   whitespace and stuff though, it is a mess in that regard. Perhaps that
   will help.
  
  Likely, but is it really necessary for those two files to be so different
  or is this some legacy stuff in the sunxi-specific .lds file?
 
 The standard lds file is pretty standard. This -fel version is for a
 special boot mode which sunxi processors have[0] which allows for
 booting over USB OTG, so the image needs to be built appropriately.

OK, I will need to fix up my mk802 rev. 1 (the old and crappy one ! ) and check 
this FEL stuff. I would really want to avoid one more linker script if 
possible, 
since it adds to maintainance overhead and technological debt ... but if you 
say 
it's necessary, I will not block it.

btw. try popping up at #u-boot @ irc.freenode.net , it'd be nice to have you 
around!

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


Re: [U-Boot] beagle-bone fdt booting problem

2014-03-28 Thread Belisko Marek
Hello,

On Thu, Mar 27, 2014 at 4:28 PM, Simon Glass s...@chromium.org wrote:
 Hi,

 On 26 March 2014 00:10, Belisko Marek marek.beli...@gmail.com wrote:

 Hi,

 I'm playing with fdt booting on beaglebone board. I'm using latest
 u-boot git HEAD (2c072c958bb544c72f0e848375803dbd6971f022) + I've
 added to am335x_evm confing :
 #ifndef CONFIG_SPL_BUILD
 #define CONFIG_OF_CONTROL
 #define CONFIG_OF_SEPARATE
 #endif

 I took beaglebone devicetree from kernel. Then I took patch [1] to
 build image from u-boot and my compiled DT blob.

 Booting this image always fails with:
 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
 ** CONFIG_OF_CONTROL defined but no FDT - please see
 doc/README.fdt-control

 I poke around this and find out that when CONFIG_OF_SEPARATE is used
 then fdt_blob is set to address of .__end pointer. When evaluate image
 with hexdump it seems that fdt blob (in my particular case and
 configuration) is shifted by 312 bytes from .__end. When I point
 gd-fdt_blob (hack in code) to that address it boots fine. Any ideas
 what I'm doing wrong (I must do something wrong as it seems nobody
 complains  :)).

 [1] -
 http://git.denx.de/?p=u-boot/u-boot-x86.git;a=commit;h=d4ab2022cdfe098e93819c58188ad36174160872


 You might be best taking this from the u-boot-x86.git branch 'bone'. It is a
 little old but it does work.
It was based on that patches just [1] was reworked to fit latest
u-boot (applied with errors):

diff --git a/Makefile b/Makefile
index 538c3bf..0505678 100644
--- a/Makefile
+++ b/Makefile
@@ -752,8 +752,13 @@ u-boot-dtb.bin: u-boot.bin dts/dt.dtb FORCE
 quiet_cmd_copy = COPY$@
   cmd_copy = cp $ $@

+ifneq ($(DEV_TREE_BIN),)
+u-boot.dtb:
+   cp $(DEV_TREE_BIN) $@
+else
 u-boot.dtb: dts/dt.dtb
$(call cmd,copy)
+endif

 OBJCOPYFLAGS_u-boot.hex := -O ihex

@@ -799,7 +804,7 @@ MKIMAGEFLAGS_u-boot.kwb = -n
$(srctree)/$(CONFIG_SYS_KWD_CONFIG:%=%) \
 MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:%=%) \
-R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:%=%) -T pblimage

-u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
+u-boot.img u-boot.kwb u-boot.pbl: u-boot$(if
$(CONFIG_OF_SEPARATE),-dtb,).bin FORCE
$(call if_changed,mkimage)

 u-boot.imx: u-boot.bin

 The patches for this were never applied unfortunately. I'll update them to
 mainline again at some point and resubmit.
OK. Basically it was working I just hit 2 issues. One with odd skip
312 bytes and second
that signature wasn't added to final image and verification was check
only sha1 not rsa2048 ( I check when enable debug for some modules):
 Verifying Hash Integrity ... fit_image_verify_required_sigs: No
signature node found: FDT_ERR_NOTFOUND
I took some patches from next (which seems fixed signature issue) but
it doesn't solve above problem.

 Regards,
 Simon


BR,

marek

-- 
as simple and primitive as possible
-
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/2] RiOTboard: add new board

2014-03-28 Thread Wolfgang Denk
Dear Eric Bénard,

In message 1395940250-2213-1-git-send-email-e...@eukrea.com you wrote:
 this board is produced by Embest/Element 14 and is based on i.MX6 Solo
 The following features are tested :


You might use the clrbits / setbits / clrsetbits I/O accesses here:

 + /* Turn on LDB0, LDB1, IPU,IPU DI0 clocks */
 + reg = readl(mxc_ccm-CCGR3);
 + reg |=  MXC_CCM_CCGR3_LDB_DI0_MASK | MXC_CCM_CCGR3_LDB_DI1_MASK;
 + writel(reg, mxc_ccm-CCGR3);

setbits_le32(mxc_ccm-CCGR3,
MXC_CCM_CCGR3_LDB_DI0_MASK | MXC_CCM_CCGR3_LDB_DI1_MASK);

?

 + /* set LDB0, LDB1 clk select to 011/011 */
 + reg = readl(mxc_ccm-cs2cdr);
 + reg = ~(MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK
 +  | MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK);
 + reg |= (3  MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_OFFSET)
 +   | (3  MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_OFFSET);
 + writel(reg, mxc_ccm-cs2cdr);

clrsetbits_le32(mxc_ccm-cs2cdr,
MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK |
MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK,
(3  MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_OFFSET) |
(3  MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_OFFSET));

?

 + reg = readl(mxc_ccm-cscmr2);
 + reg |= MXC_CCM_CSCMR2_LDB_DI0_IPU_DIV | MXC_CCM_CSCMR2_LDB_DI1_IPU_DIV;
 + writel(reg, mxc_ccm-cscmr2);

etc.  


 +#define CONFIG_ARP_TIMEOUT 200UL

Do you need this on your boards?


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Unibus timeout fatal trap program lost sorry  -  An  error  message
printed by DEC's RSTS operating system for the PDP-11
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/2] MarSBoard: add new board

2014-03-28 Thread Wolfgang Denk
Dear Eric Bénard,

In message 1395940250-2213-2-git-send-email-e...@eukrea.com you wrote:
 this board is produced by Embest/Element 14 and is based on i.MX6 Dual
 The following features are tested :
...
 As this board shares a lot with RiOTboard, both boards are supported by
 the same code base which is renamed embest/mx6boards.

This looks much better than the original code  Thanks a lot!


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If a computer can't directly address all the RAM you can  use,  it's
just a toy. - anonymous comp.sys.amiga posting, non-sequitir
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH RFC] fsl_esdhc: flush cache after non-read operation

2014-03-28 Thread Hector Palacios
Cache was invalidated on the read operation, but it should
also be flushed otherwise.

Signed-off-by: Hector Palacios hector.palac...@digi.com
---

Notes:
After enabling L2 cache on i.MX6 I found out that many times
when running the 'gpt' command to partition a uSD card, the
data was not written at all, or was badly written to the media.

This patch seems to solve it but I'm not sure if that's the
right place to flush the cache. Could someone please comment?

Thank you.

 drivers/mmc/fsl_esdhc.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index e945c0a470ca..5ef575eb0272 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -253,6 +253,16 @@ static int esdhc_setup_data(struct mmc *mmc, struct 
mmc_data *data)
return 0;
 }
 
+static void check_and_flush_dcache_range
+   (struct mmc_cmd *cmd,
+struct mmc_data *data) {
+   unsigned start = (unsigned)data-dest ;
+   unsigned size = roundup(ARCH_DMA_MINALIGN,
+   data-blocks*data-blocksize);
+   unsigned end = start+size ;
+   flush_dcache_range(start, end);
+}
+
 static void check_and_invalidate_dcache_range
(struct mmc_cmd *cmd,
 struct mmc_data *data) {
@@ -401,6 +411,8 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct 
mmc_data *data)
 #endif
if (data-flags  MMC_DATA_READ)
check_and_invalidate_dcache_range(cmd, data);
+   else
+   check_and_flush_dcache_range(cmd, data);
}
 
esdhc_write32(regs-irqstat, -1);
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] am335x_evm: Drop CONFIG_SPL_ETH_SUPPORT from default build

2014-03-28 Thread Tom Rini
On the boards this target supports this option is either non possible
without hardware mods (Beaglebone White/Black) or not supported due to
board design.  Drop this and regain some space.

Signed-off-by: Tom Rini tr...@ti.com
---
 include/configs/am335x_evm.h |3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 2020e7f..884a42b 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -208,9 +208,6 @@
 #define CONFIG_BOOTCOUNT_LIMIT
 #define CONFIG_BOOTCOUNT_AM33XX
 
-/* CPSW support */
-#define CONFIG_SPL_ETH_SUPPORT
-
 /* USB gadget RNDIS */
 #define CONFIG_SPL_MUSB_NEW_SUPPORT
 
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH RFC] fsl_esdhc: flush cache after non-read operation

2014-03-28 Thread Fabio Estevam
On Fri, Mar 28, 2014 at 7:15 AM, Hector Palacios
hector.palac...@digi.com wrote:
 Cache was invalidated on the read operation, but it should
 also be flushed otherwise.

 Signed-off-by: Hector Palacios hector.palac...@digi.com

Thanks, Hector.

Adding Marek on Cc as well.


 ---

 Notes:
 After enabling L2 cache on i.MX6 I found out that many times
 when running the 'gpt' command to partition a uSD card, the
 data was not written at all, or was badly written to the media.

 This patch seems to solve it but I'm not sure if that's the
 right place to flush the cache. Could someone please comment?

 Thank you.

  drivers/mmc/fsl_esdhc.c | 12 
  1 file changed, 12 insertions(+)

 diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
 index e945c0a470ca..5ef575eb0272 100644
 --- a/drivers/mmc/fsl_esdhc.c
 +++ b/drivers/mmc/fsl_esdhc.c
 @@ -253,6 +253,16 @@ static int esdhc_setup_data(struct mmc *mmc, struct 
 mmc_data *data)
 return 0;
  }

 +static void check_and_flush_dcache_range
 +   (struct mmc_cmd *cmd,
 +struct mmc_data *data) {
 +   unsigned start = (unsigned)data-dest ;
 +   unsigned size = roundup(ARCH_DMA_MINALIGN,
 +   data-blocks*data-blocksize);
 +   unsigned end = start+size ;
 +   flush_dcache_range(start, end);
 +}
 +
  static void check_and_invalidate_dcache_range
 (struct mmc_cmd *cmd,
  struct mmc_data *data) {
 @@ -401,6 +411,8 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, 
 struct mmc_data *data)
  #endif
 if (data-flags  MMC_DATA_READ)
 check_and_invalidate_dcache_range(cmd, data);
 +   else
 +   check_and_flush_dcache_range(cmd, data);
 }

 esdhc_write32(regs-irqstat, -1);
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v7] nand/denali: Adding Denali NAND driver support

2014-03-28 Thread Chin Liang See
Hi Masahiro,

On Fri, 2014-03-28 at 18:21 +0900, Masahiro Yamada wrote:
 Hi Chin,
 
 
  To add the Denali NAND driver support into U-Boot. It required
  information such as register base address from configuration
  header file  within include/configs folder.
  
  Signed-off-by: Chin Liang See cl...@altera.com
  Cc: Artem Bityutskiy artem.bityuts...@linux.intel.com
  Cc: David Woodhouse david.woodho...@intel.com
  Cc: Brian Norris computersforpe...@gmail.com
  Cc: Scott Wood scottw...@freescale.com
  Cc: Masahiro Yamada yamad...@jp.panasonic.com
  ---
  Changes for v7
  - Adding Masahiro's code to support 64bit version controller
  - Removed unused stub functions
  - Enhanced the ECC calculation
 
 
 
 This version works on Panasonic SoCs and
 looks good enough to be applied.
 Thanks!
 

Great to hear that.
It was a fun experience to work with you to get this patch work for both
32bit and 64 bit controller.

Thanks
Chin Liang


 
 Reviewed-by: Masahiro Yamada yamad...@jp.panasonic.com
 Tested-by: Masahiro Yamada yamad...@jp.panasonic.com
 
 
 
 Best Regards
 Masahiro Yamada
 


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


Re: [U-Boot] [PATCH] we don't went version control for .cmd files

2014-03-28 Thread Pavel Machek
Hi!

  My build leaves files such as
  
  ./common/.fdt_support.o.cmd
  ./common/.console.o.cmd
  ./common/.main.o.cmd
  ./common/.cmd_load.o.cmd
  ./common/.flash.o.cmd
  ./common/.env_flags.o.cmd
  ./common/.cmd_source.o.cmd
  ./common/.built-in.o.cmd
  
  . Git usage would be slightly nicer if those were ignored. My u-boot
  is based on v2013.01.01... hmm. I expected Altera to have slightly
  newer version. That may explain stuff.
 
 .*.cmd files were introduced by Kbuild at v2014.04-rc1
 and correctly ignored.
 v2013.01.01 you are using has nothing to do with Kbuild.
 
 I guess you built at u-boot/master (.*.cmd files were generated)
 and then you checked out v2013.01.01.

Yes, I guess that's what happened.

 And one more thing.
 Your patch is not applicable at all.
 Please do not post a patch based on such an old tag.

Sorry for the noise,
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] OMAP: common: consolidate fake USB ethernet MAC address creation

2014-03-28 Thread Nishanth Menon
TI platforms such as OMAP5uevm, PandaBoard, use equivalent
logic to generate fake USB MAC address from device unique DIE ID.

Consolidate this to a generic location such that other TI platforms such
as BeagleBoard-XM can also use the same.

NOTE: at this point in time, I dont yet see a need for a generic dummy
ethernet MAC address creation function, but if there is a need in the
future, this can be further abstracted out.

Signed-off-by: Nishanth Menon n...@ti.com
---

 arch/arm/cpu/armv7/omap-common/utils.c |   21 +
 arch/arm/include/asm/omap_common.h |2 ++
 board/ti/omap5_uevm/evm.c  |   25 -
 board/ti/panda/panda.c |   21 ++---
 4 files changed, 37 insertions(+), 32 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/utils.c 
b/arch/arm/cpu/armv7/omap-common/utils.c
index aabf2bd..1696c2d 100644
--- a/arch/arm/cpu/armv7/omap-common/utils.c
+++ b/arch/arm/cpu/armv7/omap-common/utils.c
@@ -5,6 +5,7 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 #include common.h
+#include asm/arch/sys_proto.h
 static void do_cancel_out(u32 *num, u32 *den, u32 factor)
 {
while (1) {
@@ -39,3 +40,23 @@ void cancel_out(u32 *num, u32 *den, u32 den_limit)
*den = (*den + 1) / 2;
}
 }
+
+void __weak usb_fake_mac_from_die_id(u32 *id)
+{
+   uint8_t device_mac[6];
+
+   if (!getenv(usbethaddr)) {
+   /*
+* create a fake MAC address from the processor ID code.
+* first byte is 0x02 to signify locally administered.
+*/
+   device_mac[0] = 0x02;
+   device_mac[1] = id[3]  0xff;
+   device_mac[2] = id[2]  0xff;
+   device_mac[3] = id[1]  0xff;
+   device_mac[4] = id[0]  0xff;
+   device_mac[5] = (id[0]  8)  0xff;
+
+   eth_setenv_enetaddr(usbethaddr, device_mac);
+   }
+}
diff --git a/arch/arm/include/asm/omap_common.h 
b/arch/arm/include/asm/omap_common.h
index 04925bc..729723a 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -574,6 +574,8 @@ void abb_setup(u32 fuse, u32 ldovbb, u32 setup, u32 control,
   u32 txdone, u32 txdone_mask, u32 opp);
 s8 abb_setup_ldovbb(u32 fuse, u32 ldovbb);
 
+void usb_fake_mac_from_die_id(u32 *id);
+
 /* HW Init Context */
 #define OMAP_INIT_CONTEXT_SPL  0
 #define OMAP_INIT_CONTEXT_UBOOT_FROM_NOR   1
diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c
index 3eaa5ac..4666b38 100644
--- a/board/ti/omap5_uevm/evm.c
+++ b/board/ti/omap5_uevm/evm.c
@@ -119,28 +119,19 @@ static void enable_host_clocks(void)
 int misc_init_r(void)
 {
int reg;
-   uint8_t device_mac[6];
+   u32 id[4];
 
 #ifdef CONFIG_PALMAS_POWER
palmas_init_settings();
 #endif
 
-   if (!getenv(usbethaddr)) {
-   reg = DIE_ID_REG_BASE + DIE_ID_REG_OFFSET;
-
-   /*
-* create a fake MAC address from the processor ID code.
-* first byte is 0x02 to signify locally administered.
-*/
-   device_mac[0] = 0x02;
-   device_mac[1] = readl(reg + 0x10)  0xff;
-   device_mac[2] = readl(reg + 0xC)  0xff;
-   device_mac[3] = readl(reg + 0x8)  0xff;
-   device_mac[4] = readl(reg)  0xff;
-   device_mac[5] = (readl(reg)  8)  0xff;
-
-   eth_setenv_enetaddr(usbethaddr, device_mac);
-   }
+   reg = DIE_ID_REG_BASE + DIE_ID_REG_OFFSET;
+
+   id[0] = readl(reg);
+   id[1] = readl(reg + 0x8);
+   id[2] = readl(reg + 0xC);
+   id[3] = readl(reg + 0x10);
+   usb_fake_mac_from_die_id(id);
 
return 0;
 }
diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c
index 5ab6db9..82f30d5 100644
--- a/board/ti/panda/panda.c
+++ b/board/ti/panda/panda.c
@@ -193,7 +193,7 @@ int misc_init_r(void)
 {
int phy_type;
u32 auxclk, altclksrc;
-   uint8_t device_mac[6];
+   u32 id[4];
 
/* EHCI is not supported on ES1.0 */
if (omap_revision() == OMAP4430_ES1_0)
@@ -247,20 +247,11 @@ int misc_init_r(void)
 
writel(altclksrc, scrm-altclksrc);
 
-   if (!getenv(usbethaddr)) {
-   /*
-* create a fake MAC address from the processor ID code.
-* first byte is 0x02 to signify locally administered.
-*/
-   device_mac[0] = 0x02;
-   device_mac[1] = readl(STD_FUSE_DIE_ID_3)  0xff;
-   device_mac[2] = readl(STD_FUSE_DIE_ID_2)  0xff;
-   device_mac[3] = readl(STD_FUSE_DIE_ID_1)  0xff;
-   device_mac[4] = readl(STD_FUSE_DIE_ID_0)  0xff;
-   device_mac[5] = (readl(STD_FUSE_DIE_ID_0)  8)  0xff;
-
-   eth_setenv_enetaddr(usbethaddr, device_mac);
-   }
+   id[0] = readl(STD_FUSE_DIE_ID_0);
+   id[1] = 

[U-Boot] [PATCH 3/3] OMAP3: beagle-xm: generate fake USB ethernet MAC address from dieid

2014-03-28 Thread Nishanth Menon
Similar to OMAP5uEVM, PandaBoard, BeagleBoard-XM has a USB based
ethernet without MAC address embedded. So fake a MAC address following
the similar strategy used on OMAP5 and PandaBoard family.

Signed-off-by: Nishanth Menon n...@ti.com
---

 arch/arm/include/asm/arch-omap3/sys_proto.h |1 +
 board/ti/beagle/beagle.c|   11 +++
 2 files changed, 12 insertions(+)

diff --git a/arch/arm/include/asm/arch-omap3/sys_proto.h 
b/arch/arm/include/asm/arch-omap3/sys_proto.h
index 1f62941..ce6b22b 100644
--- a/arch/arm/include/asm/arch-omap3/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap3/sys_proto.h
@@ -8,6 +8,7 @@
 #ifndef _SYS_PROTO_H_
 #define _SYS_PROTO_H_
 #include linux/mtd/omap_gpmc.h
+#include asm/omap_common.h
 
 typedef struct {
u32 mtype;
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index 9669a32..0674afd 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -316,6 +316,7 @@ int misc_init_r(void)
struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;
struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
struct control_prog_io *prog_io_base = (struct control_prog_io 
*)OMAP34XX_CTRL_BASE;
+   bool generate_fake_mac = false;
 
/* Enable i2c2 pullup resisters */
writel(~(PRG_I2C2_PULLUPRESX), prog_io_base-io1);
@@ -349,6 +350,7 @@ int misc_init_r(void)
TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
TWL4030_PM_RECEIVER_DEV_GRP_P1);
+   generate_fake_mac = true;
break;
case REVISION_XM_C:
printf(Beagle xM Rev C\n);
@@ -359,6 +361,7 @@ int misc_init_r(void)
TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
TWL4030_PM_RECEIVER_DEV_GRP_P1);
+   generate_fake_mac = true;
break;
default:
printf(Beagle unknown 0x%02x\n, get_board_revision());
@@ -368,6 +371,7 @@ int misc_init_r(void)
TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
TWL4030_PM_RECEIVER_DEV_GRP_P1);
+   generate_fake_mac = true;
}
 
switch (get_expansion_id()) {
@@ -486,6 +490,13 @@ int misc_init_r(void)
musb_register(musb_plat, musb_board_data, (void *)MUSB_BASE);
 #endif
 
+   if (generate_fake_mac) {
+   u32 id[4];
+
+   get_dieid(id);
+   usb_fake_mac_from_die_id(id);
+   }
+
return 0;
 }
 
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH 1/6] add README.distro file

2014-03-28 Thread Tom Rini
On Tue, Mar 25, 2014 at 02:24:14PM -0600, Stephen Warren wrote:
 On 03/20/2014 04:12 PM, Dennis Gilmore wrote:
[snip]
  +You should not set initrd_high and fdt_high to 0x as the user 
  should
  +not need to edit the memory locations having the initramfs and dtb being
  +relocatable is best to ensure the system will boot in all situations. 
 
 Perhaps CONFIG_SYS_BOOTMAPSZ is worth a mention too. The commit
 description for 7f1b767aea94 ARM: tegra: define CONFIG_SYS_BOOTMAPSZ
 might be useful when writing this part of the document.

I would swear (and I just dug up the notes from the last time I was
looking at this) that no, CONFIG_SYS_BOOTMAPSZ is not sufficient because
it doesn't cover the ramdisk case, which is important for generic
distro, unless you also add in initrd_high=top-of-lowmem-value or know
it'll be in an always-good spot and set it to 0x.

-- 
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 for u-boot-tegra/master info ARM/master

2014-03-28 Thread Tom Warren
Have they all been ACKed? Sorry, been really busy with normal NVIDIA stuff.

If they're ready, I can apply them with Stephen's pinmux changes and send
another PR to Albert.


On Wed, Mar 26, 2014 at 4:15 PM, Stefan Agner ste...@agner.ch wrote:

 Hi Tom,

  Stephen Warren (1):
ARM: tegra: make all I2C ports open-drain
 
   board/nvidia/dalmore/pinmux-config-dalmore.h | 16 
   board/nvidia/venice2/pinmux-config-venice2.h | 16 
   2 files changed, 16 insertions(+), 16 deletions(-)

 Is there something holding you back including my USB changes (v5)?

 --
 Stefan


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


[U-Boot] [PATCH] am335x_evm: Clarify when we build board_eth_init

2014-03-28 Thread Tom Rini
If we build this function in cases where we would be discarding it
anyhow we still end up with maybe unused warnings.  Rather than litter
the function with __maybe_unused, just spell out when to build it.

Signed-off-by: Tom Rini tr...@ti.com
---
 board/ti/am335x/board.c |   18 --
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 7609a18..554398f 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -573,8 +573,22 @@ static struct cpsw_platform_data cpsw_data = {
 };
 #endif
 
-#if defined(CONFIG_DRIVER_TI_CPSW) || \
-   (defined(CONFIG_USB_ETHER)  defined(CONFIG_MUSB_GADGET))
+/*
+ * This function will:
+ * Read the eFuse for MAC addresses, and set ethaddr/eth1addr/usbnet_devaddr
+ * in the environment
+ * Perform fixups to the PHY present on certain boards.  We only need this
+ * function in:
+ * - SPL with either CPSW or USB ethernet support
+ * - Full U-Boot, with either CPSW or USB ethernet
+ * Build in only these cases to avoid warnings about unused variables
+ * when we build an SPL that has neither option but full U-Boot will.
+ */
+#if ((defined(CONFIG_SPL_ETH_SUPPORT) || defined(CONFIG_SPL_USBETH_SUPPORT)) \
+defined(CONFIG_SPL_BUILD)) || \
+   ((defined(CONFIG_DRIVER_TI_CPSW) || \
+ defined(CONFIG_USB_ETHER)  defined(CONFIG_MUSB_GADGET))  \
+!defined(CONFIG_SPL_BUILD))
 int board_eth_init(bd_t *bis)
 {
int rv, n = 0;
-- 
1.7.9.5

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


Re: [U-Boot] sparc: consolidate CONFIG_{LEON, LEON2, LEON3} definition

2014-03-28 Thread Tom Rini
On Fri, Mar 28, 2014 at 11:34:49AM +0900, Masahiro Yamada wrote:

 Hi Tom,
 
 On Thu, 27 Mar 2014 13:00:19 -0400
 Tom Rini tr...@ti.com wrote:
 
  On Thu, Mar 13, 2014 at 07:48:57PM +0900, Masahiro Yamada wrote:
  
   CONFIG_LEON is already defined in
   arch/sparc/cpu/{leon2,leon3}/config.mk.
   Remove the redundant definition in board header files.
   
   All leon3 boards define CONFIG_LEON3 in board header files.
   Move the definition to arch/sparc/cpu/leon3/config.mk.
   
   CONFIG_LEON2 can be move to arch/sparc/cpu/leon2/config.mk
   as well.
   
   Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
   Cc: Daniel Hellstrom dan...@gaisler.com
  
  Applied to u-boot/next, thanks!
 
 Why did today's updates go to u-boot/next, not u-boot/master?

I'm trying to slow down what's pulled in and since sparc doesn't build
for me today (unrelated to Kbuild), I figured I'd hold this one off for
the next release, while I was adding other stuff to /next anyhow.

-- 
Tom


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


[U-Boot] [PATCH v3 05/10] mtd: Build nand_util.o for CONFIG_ENV_IS_IN_NAND in SPL

2014-03-28 Thread Tom Rini
Acked-by: Scott Wood scottw...@freescale.com
Signed-off-by: Tom Rini tr...@ti.com
---
Changes in v2:
- Surround adding nand_util.o with CONFIG_SPL_ENV_SUPPORT test
---
 drivers/mtd/nand/Makefile |3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 02b149c..4eb354d 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -18,6 +18,9 @@ obj-$(CONFIG_SPL_NAND_LOAD) += nand_spl_load.o
 obj-$(CONFIG_SPL_NAND_ECC) += nand_ecc.o
 obj-$(CONFIG_SPL_NAND_BASE) += nand_base.o
 obj-$(CONFIG_SPL_NAND_INIT) += nand.o
+ifeq ($(CONFIG_SPL_ENV_SUPPORT),y)
+obj-$(CONFIG_ENV_IS_IN_NAND) += nand_util.o
+endif
 
 else # not spl
 
-- 
1.7.9.5

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


[U-Boot] [PATCH v2] powerpc/cpu/mpc85xx: Add MAC address for layer 2 switch

2014-03-28 Thread Codrin Ciubotariu
T1040RDB and T1040QDS boards have an integrated l2 switch.
The switch needs a MAC address for Layer 2 protocols
(MSTP, LLDP, LACP, etc). Setting a MAC address on l2switchaddr will add
a MAC in device-tree, under node l2switch.

Signed-off-by: Codrin Ciubotariu codrin.ciubota...@freescale.com
Cc: York Sun york...@freescale.com
---

Changes v2:
- replaced board macros with SoC macro;
- added more comments;

 arch/powerpc/cpu/mpc85xx/fdt.c | 29 +
 1 file changed, 29 insertions(+)

diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c b/arch/powerpc/cpu/mpc85xx/fdt.c
index 33bc900..35bd013 100644
--- a/arch/powerpc/cpu/mpc85xx/fdt.c
+++ b/arch/powerpc/cpu/mpc85xx/fdt.c
@@ -582,6 +582,33 @@ static void fdt_fixup_usb(void *fdt)
 #define fdt_fixup_usb(x)
 #endif
 
+#if defined(CONFIG_PPC_T1040)
+static void fdt_fixup_l2_switch(void *blob)
+{
+   uchar l2swaddr[6];
+   int node;
+
+   /* The l2switch node from device-tree has
+* compatible string vitesse-9953 */
+   node = fdt_node_offset_by_compatible(blob, -1, vitesse-9953);
+   if (node == -FDT_ERR_NOTFOUND)
+   /* no l2switch node has been found */
+   return;
+
+   /* Get MAC address for the l2switch from l2switchaddr*/
+   if (!eth_getenv_enetaddr(l2switchaddr, l2swaddr)) {
+   printf(Warning: MAC address for l2switch not found\n);
+   memset(l2swaddr, 0, sizeof(l2swaddr));
+   }
+
+   /* Add MAC address to l2switch node */
+   fdt_setprop(blob, node, local-mac-address, l2swaddr,
+   sizeof(l2swaddr));
+}
+#else
+#define fdt_fixup_l2_switch(x)
+#endif
+
 void ft_cpu_setup(void *blob, bd_t *bd)
 {
int off;
@@ -719,6 +746,8 @@ void ft_cpu_setup(void *blob, bd_t *bd)
clock-frequency, gd-bus_clk/2, 1);
 
fdt_fixup_usb(blob);
+
+   fdt_fixup_l2_switch(blob);
 }
 
 /*
-- 
1.7.11.7


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


[U-Boot] [PATCH v3 04/10] mtd: Add a CONFIG_SPL_MTD_SUPPORT for a more full NAND subsystem in SPL

2014-03-28 Thread Tom Rini
This mainly converts the am335x_spl_bch driver to the normal format
which means a slight change to nand_info within the driver.

Acked-by: Scott Wood scottw...@freescale.com
Signed-off-by: Tom Rini tr...@ti.com
---
Changes in v2:
- Document CONFIG_SPL_MTD_SUPPORT in the README
---
 README|4 +++
 drivers/mtd/nand/am335x_spl_bch.c |   54 ++---
 include/configs/ti_armv7_common.h |1 +
 spl/Makefile  |1 +
 4 files changed, 33 insertions(+), 27 deletions(-)

diff --git a/README b/README
index 216f0c7..b035033 100644
--- a/README
+++ b/README
@@ -3314,6 +3314,10 @@ FIT uImage format:
Support for NAND boot using simple NAND drivers that
expose the cmd_ctrl() interface.
 
+   CONFIG_SPL_MTD_SUPPORT
+   Support for the MTD subsystem within SPL.  Useful for
+   environment on NAND support within SPL.
+
CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
Set for the SPL on PPC mpc8xxx targets, support for
drivers/ddr/fsl/libddr.o in SPL binary.
diff --git a/drivers/mtd/nand/am335x_spl_bch.c 
b/drivers/mtd/nand/am335x_spl_bch.c
index c84851b..bd89b06 100644
--- a/drivers/mtd/nand/am335x_spl_bch.c
+++ b/drivers/mtd/nand/am335x_spl_bch.c
@@ -16,7 +16,7 @@
 #include linux/mtd/nand_ecc.h
 
 static int nand_ecc_pos[] = CONFIG_SYS_NAND_ECCPOS;
-static nand_info_t mtd;
+nand_info_t nand_info[1];
 static struct nand_chip nand_chip;
 
 #define ECCSTEPS   (CONFIG_SYS_NAND_PAGE_SIZE / \
@@ -30,12 +30,12 @@ static struct nand_chip nand_chip;
 static int nand_command(int block, int page, uint32_t offs,
u8 cmd)
 {
-   struct nand_chip *this = mtd.priv;
+   struct nand_chip *this = nand_info[0].priv;
int page_addr = page + block * CONFIG_SYS_NAND_PAGE_COUNT;
void (*hwctrl)(struct mtd_info *mtd, int cmd,
unsigned int ctrl) = this-cmd_ctrl;
 
-   while (!this-dev_ready(mtd))
+   while (!this-dev_ready(nand_info[0]))
;
 
/* Emulate NAND_CMD_READOOB */
@@ -45,11 +45,11 @@ static int nand_command(int block, int page, uint32_t offs,
}
 
/* Begin command latch cycle */
-   hwctrl(mtd, cmd, NAND_CTRL_CLE | NAND_CTRL_CHANGE);
+   hwctrl(nand_info[0], cmd, NAND_CTRL_CLE | NAND_CTRL_CHANGE);
 
if (cmd == NAND_CMD_RESET) {
-   hwctrl(mtd, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE);
-   while (!this-dev_ready(mtd))
+   hwctrl(nand_info[0], NAND_CMD_NONE, NAND_NCE | 
NAND_CTRL_CHANGE);
+   while (!this-dev_ready(nand_info[0]))
;
return 0;
}
@@ -60,35 +60,35 @@ static int nand_command(int block, int page, uint32_t offs,
 
/* Set ALE and clear CLE to start address cycle */
/* Column address */
-   hwctrl(mtd, offs  0xff,
+   hwctrl(nand_info[0], offs  0xff,
   NAND_CTRL_ALE | NAND_CTRL_CHANGE); /* A[7:0] */
-   hwctrl(mtd, (offs  8)  0xff, NAND_CTRL_ALE); /* A[11:9] */
+   hwctrl(nand_info[0], (offs  8)  0xff, NAND_CTRL_ALE); /* A[11:9] */
/* Row address */
-   hwctrl(mtd, (page_addr  0xff), NAND_CTRL_ALE); /* A[19:12] */
-   hwctrl(mtd, ((page_addr  8)  0xff),
+   hwctrl(nand_info[0], (page_addr  0xff), NAND_CTRL_ALE); /* A[19:12] */
+   hwctrl(nand_info[0], ((page_addr  8)  0xff),
   NAND_CTRL_ALE); /* A[27:20] */
 #ifdef CONFIG_SYS_NAND_5_ADDR_CYCLE
/* One more address cycle for devices  128MiB */
-   hwctrl(mtd, (page_addr  16)  0x0f,
+   hwctrl(nand_info[0], (page_addr  16)  0x0f,
   NAND_CTRL_ALE); /* A[31:28] */
 #endif
-   hwctrl(mtd, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE);
+   hwctrl(nand_info[0], NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE);
 
if (cmd == NAND_CMD_READ0) {
/* Latch in address */
-   hwctrl(mtd, NAND_CMD_READSTART,
+   hwctrl(nand_info[0], NAND_CMD_READSTART,
   NAND_CTRL_CLE | NAND_CTRL_CHANGE);
-   hwctrl(mtd, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE);
+   hwctrl(nand_info[0], NAND_CMD_NONE, NAND_NCE | 
NAND_CTRL_CHANGE);
 
/*
 * Wait a while for the data to be ready
 */
-   while (!this-dev_ready(mtd))
+   while (!this-dev_ready(nand_info[0]))
;
} else if (cmd == NAND_CMD_RNDOUT) {
-   hwctrl(mtd, NAND_CMD_RNDOUTSTART, NAND_CTRL_CLE |
+   hwctrl(nand_info[0], NAND_CMD_RNDOUTSTART, NAND_CTRL_CLE |
NAND_CTRL_CHANGE);
-   hwctrl(mtd, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE);
+   hwctrl(nand_info[0], NAND_CMD_NONE, NAND_NCE | 
NAND_CTRL_CHANGE);
}
 
return 0;
@@ -96,7 +96,7 

[U-Boot] [PATCH v3 02/10] env_mmc.c: Allow environment to be used within SPL

2014-03-28 Thread Tom Rini
Inside of SPL we only concern ourself with one MMC device, so instead of
being able to use CONFIG_SYS_MMC_ENV_DEV we need to use 0 in SPL.
Switch the code to use a 'dev' variable to facilitate this.

Signed-off-by: Tom Rini tr...@ti.com
---
 common/env_mmc.c |   45 +
 1 file changed, 37 insertions(+), 8 deletions(-)

diff --git a/common/env_mmc.c b/common/env_mmc.c
index 045428c..d42168b 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -64,6 +64,14 @@ int env_init(void)
 
 static int init_mmc_for_env(struct mmc *mmc)
 {
+#ifdef CONFIG_SYS_MMC_ENV_PART
+   int dev = CONFIG_SYS_MMC_ENV_DEV;
+
+#ifdef CONFIG_SPL_BUILD
+   dev = 0;
+#endif
+#endif
+
if (!mmc) {
puts(No MMC card found\n);
return -1;
@@ -76,8 +84,7 @@ static int init_mmc_for_env(struct mmc *mmc)
 
 #ifdef CONFIG_SYS_MMC_ENV_PART
if (CONFIG_SYS_MMC_ENV_PART != mmc-part_num) {
-   if (mmc_switch_part(CONFIG_SYS_MMC_ENV_DEV,
-   CONFIG_SYS_MMC_ENV_PART)) {
+   if (mmc_switch_part(dev, CONFIG_SYS_MMC_ENV_PART)) {
puts(MMC partition switch failed\n);
return -1;
}
@@ -90,9 +97,13 @@ static int init_mmc_for_env(struct mmc *mmc)
 static void fini_mmc_for_env(struct mmc *mmc)
 {
 #ifdef CONFIG_SYS_MMC_ENV_PART
+   int dev = CONFIG_SYS_MMC_ENV_DEV;
+
+#ifdef CONFIG_SPL_BUILD
+   dev = 0;
+#endif
if (CONFIG_SYS_MMC_ENV_PART != mmc-part_num)
-   mmc_switch_part(CONFIG_SYS_MMC_ENV_DEV,
-   mmc-part_num);
+   mmc_switch_part(dev, mmc-part_num);
 #endif
 }
 
@@ -174,12 +185,16 @@ static inline int read_env(struct mmc *mmc, unsigned long 
size,
   unsigned long offset, const void *buffer)
 {
uint blk_start, blk_cnt, n;
+   int dev = CONFIG_SYS_MMC_ENV_DEV;
+
+#ifdef CONFIG_SPL_BUILD
+   dev = 0;
+#endif
 
blk_start   = ALIGN(offset, mmc-read_bl_len) / mmc-read_bl_len;
blk_cnt = ALIGN(size, mmc-read_bl_len) / mmc-read_bl_len;
 
-   n = mmc-block_dev.block_read(CONFIG_SYS_MMC_ENV_DEV, blk_start,
-   blk_cnt, (uchar *)buffer);
+   n = mmc-block_dev.block_read(dev, blk_start, blk_cnt, (uchar *)buffer);
 
return (n == blk_cnt) ? 0 : -1;
 }
@@ -188,16 +203,23 @@ static inline int read_env(struct mmc *mmc, unsigned long 
size,
 void env_relocate_spec(void)
 {
 #if !defined(ENV_IS_EMBEDDED)
-   struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV);
+   struct mmc *mmc;
u32 offset1, offset2;
int read1_fail = 0, read2_fail = 0;
int crc1_ok = 0, crc2_ok = 0;
env_t *ep;
int ret;
+   int dev = CONFIG_SYS_MMC_ENV_DEV;
 
ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env1, 1);
ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env2, 1);
 
+#ifdef CONFIG_SPL_BUILD
+   dev = 0;
+#endif
+
+   mmc = find_mmc_device(dev);
+
if (tmp_env1 == NULL || tmp_env2 == NULL) {
puts(Can't allocate buffers for environment\n);
ret = 1;
@@ -274,9 +296,16 @@ void env_relocate_spec(void)
 {
 #if !defined(ENV_IS_EMBEDDED)
ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
-   struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV);
+   struct mmc *mmc;
u32 offset;
int ret;
+   int dev = CONFIG_SYS_MMC_ENV_DEV;
+
+#ifdef CONFIG_SPL_BUILD
+   dev = 0;
+#endif
+
+   mmc = find_mmc_device(dev);
 
if (init_mmc_for_env(mmc)) {
ret = 1;
-- 
1.7.9.5

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


[U-Boot] [PATCH v3 01/10] fw_env.c: Switch get_config to use '%ms' in sscanf

2014-03-28 Thread Tom Rini
We currently limit ourself to 16 characters for the device name to read
the environment from.  This is insufficient for /dev/mmcblk0boot1 to
work for example.  Switch to '%ms' which gives us a dynamically
allocated buffer instead.  We're short lived enough to not bother
free()ing the buffer.

Signed-off-by: Tom Rini tr...@ti.com

---
Changes in v2:
- Rework to use '%ms' in get_config per Wolfgang

Signed-off-by: Tom Rini tr...@ti.com
---
 tools/env/fw_env.c |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index d228cc3..f5cd521 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -40,7 +40,7 @@
_min1  _min2 ? _min1 : _min2; })
 
 struct envdev_s {
-   char devname[16];   /* Device name */
+   const char *devname;/* Device name */
ulong devoff;   /* Device offset */
ulong env_size; /* environment size */
ulong erase_size;   /* device erase size */
@@ -1243,7 +1243,7 @@ static int parse_config ()
return -1;
}
 #else
-   strcpy (DEVNAME (0), DEVICE1_NAME);
+   DEVNAME (0) = DEVICE1_NAME;
DEVOFFSET (0) = DEVICE1_OFFSET;
ENVSIZE (0) = ENV1_SIZE;
/* Default values are: erase-size=env-size */
@@ -1258,7 +1258,7 @@ static int parse_config ()
 #endif
 
 #ifdef HAVE_REDUND
-   strcpy (DEVNAME (1), DEVICE2_NAME);
+   DEVNAME (1) = DEVICE2_NAME;
DEVOFFSET (1) = DEVICE2_OFFSET;
ENVSIZE (1) = ENV2_SIZE;
/* Default values are: erase-size=env-size */
@@ -1297,6 +1297,7 @@ static int get_config (char *fname)
int i = 0;
int rc;
char dump[128];
+   char *devname;
 
fp = fopen (fname, r);
if (fp == NULL)
@@ -1307,8 +1308,8 @@ static int get_config (char *fname)
if (dump[0] == '#')
continue;
 
-   rc = sscanf (dump, %s %lx %lx %lx %lx,
-DEVNAME (i),
+   rc = sscanf (dump, %ms %lx %lx %lx %lx,
+devname,
 DEVOFFSET (i),
 ENVSIZE (i),
 DEVESIZE (i),
@@ -1317,6 +1318,8 @@ static int get_config (char *fname)
if (rc  3)
continue;
 
+   DEVNAME(i) = devname;
+
if (rc  4)
/* Assume the erase size is the same as the env-size */
DEVESIZE(i) = ENVSIZE(i);
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH 1/6] add README.distro file

2014-03-28 Thread Stephen Warren
On 03/28/2014 09:42 AM, Tom Rini wrote:
 On Tue, Mar 25, 2014 at 02:24:14PM -0600, Stephen Warren wrote:
 On 03/20/2014 04:12 PM, Dennis Gilmore wrote:
 [snip]
 +You should not set initrd_high and fdt_high to 0x as the user 
 should
 +not need to edit the memory locations having the initramfs and dtb being
 +relocatable is best to ensure the system will boot in all situations. 

 Perhaps CONFIG_SYS_BOOTMAPSZ is worth a mention too. The commit
 description for 7f1b767aea94 ARM: tegra: define CONFIG_SYS_BOOTMAPSZ
 might be useful when writing this part of the document.
 
 I would swear (and I just dug up the notes from the last time I was
 looking at this) that no, CONFIG_SYS_BOOTMAPSZ is not sufficient because
 it doesn't cover the ramdisk case, which is important for generic
 distro, unless you also add in initrd_high=top-of-lowmem-value or know
 it'll be in an always-good spot and set it to 0x.

Isn't that a bug? In other words, shouldn't CONFIG_SYS_BOOTMAPSZ affect
a ramdisk too?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] add README.distro file

2014-03-28 Thread Tom Rini
On Fri, Mar 28, 2014 at 10:11:20AM -0600, Stephen Warren wrote:
 On 03/28/2014 09:42 AM, Tom Rini wrote:
  On Tue, Mar 25, 2014 at 02:24:14PM -0600, Stephen Warren wrote:
  On 03/20/2014 04:12 PM, Dennis Gilmore wrote:
  [snip]
  +You should not set initrd_high and fdt_high to 0x as the user 
  should
  +not need to edit the memory locations having the initramfs and dtb being
  +relocatable is best to ensure the system will boot in all situations. 
 
  Perhaps CONFIG_SYS_BOOTMAPSZ is worth a mention too. The commit
  description for 7f1b767aea94 ARM: tegra: define CONFIG_SYS_BOOTMAPSZ
  might be useful when writing this part of the document.
  
  I would swear (and I just dug up the notes from the last time I was
  looking at this) that no, CONFIG_SYS_BOOTMAPSZ is not sufficient because
  it doesn't cover the ramdisk case, which is important for generic
  distro, unless you also add in initrd_high=top-of-lowmem-value or know
  it'll be in an always-good spot and set it to 0x.
 
 Isn't that a bug? In other words, shouldn't CONFIG_SYS_BOOTMAPSZ affect
 a ramdisk too?

No, because it's a per-arch thing on if you can have a ramdisk in high
memory or not (and then the kernel deals with it), iirc.  I _think_ this
is one of those cases where ARM is much more strict about things than
other architectures, but I lack the easy access to other platforms that
I used to have.

-- 
Tom


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


[U-Boot] [PATCH v3 06/10] am335x_evm: Make SPL_OS also check the boot_os variable for falcon mode

2014-03-28 Thread Tom Rini
We use the same variable as a3m071 in the environment to determine if we
should boot into Linux or U-Boot.  This is useful on boards like
Beaglebone Black or AM335x GP EVM where we have persistent storage for
the environment.

Signed-off-by: Tom Rini tr...@ti.com
---
 board/ti/am335x/board.c |   13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 554398f..ce7a8b0 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -30,6 +30,7 @@
 #include power/tps65910.h
 #include environment.h
 #include watchdog.h
+#include environment.h
 #include board.h
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -219,7 +220,17 @@ static struct emif_regs ddr3_evm_emif_reg_data = {
 int spl_start_uboot(void)
 {
/* break into full u-boot on 'c' */
-   return (serial_tstc()  serial_getc() == 'c');
+   if (serial_tstc()  serial_getc() == 'c')
+   return 1;
+
+#ifdef CONFIG_SPL_ENV_SUPPORT
+   env_init();
+   env_relocate_spec();
+   if (getenv_yesno(boot_os) != 1)
+   return 1;
+#endif
+
+   return 0;
 }
 #endif
 
-- 
1.7.9.5

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


Re: [U-Boot] [RESEND PATCH v3 2/2] keystone2: net: add keystone ethernet driver

2014-03-28 Thread Tom Rini
On Fri, Mar 21, 2014 at 05:01:43PM -0400, Murali Karicheri wrote:

 Ethernet driver configures the CPSW, SGMI and Phy and uses
 the the Navigator APIs. The driver supports 4 Ethernet ports and
 can work with only one port at a time.
 
 Port configurations are defined in board.c.
 
 Signed-off-by: Vitaly Andrianov vita...@ti.com
 Signed-off-by: Murali Karicheri m-kariche...@ti.com
 Signed-off-by: WingMan Kwok w-kw...@ti.com
[snip]
 +#define reg_rmw(addr, value, mask) \
 + writel(((readl(addr)  (~(mask))) | (value)), (addr))

Don't we have something in asm/io.h that does this already?

-- 
Tom


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


[U-Boot] [PATCH v3 10/10] spl_mmc/CONFIG_SPL_OS_BOOT: Allow environment to determine what to boot

2014-03-28 Thread Tom Rini
We add two new environment variables, falcon_args_file and
falcon_image_file, which when set will override the compiled in default
values for falcon mode.

Signed-off-by: Tom Rini tr...@ti.com
---
 common/spl/spl_fat.c |   27 +++
 doc/README.falcon|4 
 2 files changed, 31 insertions(+)

diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index 1e532d5..56be943 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -74,11 +74,38 @@ end:
 int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition)
 {
int err;
+   __maybe_unused char *file;
 
err = spl_register_fat_device(block_dev, partition);
if (err)
return err;
 
+#if defined(CONFIG_SPL_ENV_SUPPORT)  defined(CONFIG_SPL_OS_BOOT)
+   file = getenv(falcon_args_file);
+   if (file) {
+   err = file_fat_read(file, (void *)CONFIG_SYS_SPL_ARGS_ADDR, 0);
+   if (err = 0) {
+   printf(spl: error reading image %s, err - %d, falling 
back to default\n,
+  file, err);
+   goto defaults;
+   }
+   file = getenv(falcon_image_file);
+   if (file) {
+   err = spl_load_image_fat(block_dev, partition, file);
+   if (err != 0) {
+   puts(spl: falling back to default\n);
+   goto defaults;
+   }
+
+   return 0;
+   } else
+   puts(spl: falcon_image_file not set in environment, 
falling back to default\n);
+   } else
+   puts(spl: falcon_args_file not set in environment, falling 
back to default\n);
+
+defaults:
+#endif
+
err = file_fat_read(CONFIG_SPL_FAT_LOAD_ARGS_NAME,
(void *)CONFIG_SYS_SPL_ARGS_ADDR, 0);
if (err = 0) {
diff --git a/doc/README.falcon b/doc/README.falcon
index bccf6c9..82a254b 100644
--- a/doc/README.falcon
+++ b/doc/README.falcon
@@ -89,6 +89,10 @@ mode.  In this case the following variables may be supported:
 boot_os :  Set to yes/Yes/true/True/1 to enable booting to OS,
any other value to fall back to U-Boot (including
unset)
+falcon_args_file : Filename to load as the 'args' portion of falcon mode
+   rather than the hard-coded value.
+falcon_image_file :Filename to load as the OS image portion of falcon
+   mode rather than the hard-coded value.
 
 Using spl command
 -
-- 
1.7.9.5

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


Re: [U-Boot] [RESEND PATCH v3 2/2] keystone2: net: add keystone ethernet driver

2014-03-28 Thread Karicheri, Muralidharan
-Original Message-
From: Tom Rini [mailto:tom.r...@gmail.com] On Behalf Of Rini, Tom
Sent: Friday, March 28, 2014 11:50 AM
To: Karicheri, Muralidharan
Cc: u-boot@lists.denx.de; Kwok, WingMan
Subject: Re: [U-Boot] [RESEND PATCH v3 2/2] keystone2: net: add keystone 
ethernet
driver

On Fri, Mar 21, 2014 at 05:01:43PM -0400, Murali Karicheri wrote:

 Ethernet driver configures the CPSW, SGMI and Phy and uses the the
 Navigator APIs. The driver supports 4 Ethernet ports and can work with
 only one port at a time.

 Port configurations are defined in board.c.

 Signed-off-by: Vitaly Andrianov vita...@ti.com
 Signed-off-by: Murali Karicheri m-kariche...@ti.com
 Signed-off-by: WingMan Kwok w-kw...@ti.com
[snip]
 +#define reg_rmw(addr, value, mask) \
 +writel(((readl(addr)  (~(mask))) | (value)), (addr))

Don't we have something in asm/io.h that does this already?

Tom,

I did a scan of arch/arm/include/asm/io.h. I can't find a read/modify/write
function. Am I missing something?

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


Re: [U-Boot] [PATCH v4 7/9] k2hk: add support for k2hk SOC and EVM

2014-03-28 Thread Tom Rini
On Thu, Mar 27, 2014 at 11:59:10AM -0400, Murali Karicheri wrote:

 From: Vitaly Andrianov vita...@ti.com
 
 k2hk EVM is based on Texas Instruments Keystone2 Hawking/Kepler
 SoC. Keystone2 SoC has ARM v7 Cortex-A15 MPCore processor. Please
 refer the ti/k2hk_evm/README for details on the board, build and other
 information.
 
 This patch add support for keystone architecture and k2hk evm.
[snip]
 +#define reg_rmw(reg, mask, val) \
 + __raw_writel((__raw_readl((reg))  ~(mask)) | ((val)  (mask)) , \
 +  (reg));
 +
 +#define reg_setbits(reg, bits) \
 + __raw_writel((__raw_readl(reg) | (bits)) , (reg));
 +
 +#define reg_clrbits(reg, bits)   \
 + __raw_writel((__raw_readl(reg)  ~(bits)) , (reg));

I think the first one is just another way of saying clrsetbits_le32 (or
can be re-written as such), but reg_setbits/reg_clrbits are convertable
to setbits/clrbits.

-- 
Tom


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


[U-Boot] [PATCH v3 03/10] env_mmc.c: Remove NULL check on tmp_env1/2

2014-03-28 Thread Tom Rini
With 452a272 we moved to allocating these variables on the stack.  So
they will never now be NULL so remove these checks.

Signed-off-by: Tom Rini tr...@ti.com
---
 common/env_mmc.c |6 --
 1 file changed, 6 deletions(-)

diff --git a/common/env_mmc.c b/common/env_mmc.c
index d42168b..f47bd77 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -220,12 +220,6 @@ void env_relocate_spec(void)
 
mmc = find_mmc_device(dev);
 
-   if (tmp_env1 == NULL || tmp_env2 == NULL) {
-   puts(Can't allocate buffers for environment\n);
-   ret = 1;
-   goto err;
-   }
-
if (init_mmc_for_env(mmc)) {
ret = 1;
goto err;
-- 
1.7.9.5

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


[U-Boot] [PATCH v3 07/10] README: Add CONFIG_SPL_OS_BOOT to README

2014-03-28 Thread Tom Rini
Signed-off-by: Tom Rini tr...@ti.com
---
 README |4 
 1 file changed, 4 insertions(+)

diff --git a/README b/README
index b035033..56ecaa1 100644
--- a/README
+++ b/README
@@ -3242,6 +3242,10 @@ FIT uImage format:
supports MMC, NAND and YMODEM loading of U-Boot and NAND
NAND loading of the Linux Kernel.
 
+   CONFIG_SPL_OS_BOOT
+   Enable booting directly to an OS from SPL.
+   See also: doc/README.falcon
+
CONFIG_SPL_DISPLAY_PRINT
For ARM, enable an optional function to print more information
about the running system.
-- 
1.7.9.5

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


Re: [U-Boot] Xilinx Zed Board resets with Master

2014-03-28 Thread Tim Sander
Hi Michal
 On 03/27/2014 05:32 PM, Tim Sander wrote:
  Hi Michal
  
  Am Donnerstag, 27. März 2014, 14:17:41 schrieb Michal Simek:
  Please check and may be you can try u-boot-dtb.elf.
  
  Mh,  don't know how to create this kind of file?
  
  Jagan maybe knows more but I don't think u-boot-dtb.elf is generated.
  Just u-boot-dtb.bin is generated which should be copied as data file
  in xmd and not sure if binary file can be directly used for bootgen.
  
  If adding the dtb file in the boot.bif file is not the right way and no
  elf file with dtb is generated: What is the right way to generate an
  image for use with the SD-Card?
 
 you can just use static u-boot configuration.
I assume you mean static configuration a config with OF_CONTROL disabled.
Ok, i have tried to boot that with bootgen. That does not work.
Loading that into memory and booting it from within the debugger works
though. In both cases with or without OF_CONTROL enabled.
 I have never tried to add dtb as partition to boot.bin.
 If you want to use this dtb driver u-boot I would suggest you
 to look at u-boot SPL which should be able to handle binary formats
 with dtbs.
So my main focus is to test CONFIG_ARMV7_NONSEC to boot linux in 
normal mode. I wanted to test recent mainline with that. So focusing on 
u-boot SPL is to far off my targets. So i am happy with hardware debugger 
loadeing for the time beeing.

Getting back to CONFIG_ARMV7_NONSEC. This is unfortunatly not working with the 
Zynq.  Currently the board switches to monitor mode but when the u-boot 
switches to normal mode it jumps to PC:0xc  (LR:0x10) which seems like a data 
abort exeption or some other secure mode violation exception?
Is there a good way to find out what happened? I am currently stuck with this 
and my local FAE has also no idea. Attached is a patch which at least works 
until the return from the monitor mode.

Best regards
Tim
From bdbb2bcb70226ca5ad0873b3235f668d5d06a1df Mon Sep 17 00:00:00 2001
From: Tim Sander t...@krieglstein.org
Date: Fri, 28 Mar 2014 16:11:22 +0100
Subject: [PATCH] experimental TrustZone for Zynq (defunct)

---
 arch/arm/cpu/armv7/nonsec_virt.S |   18 +-
 arch/arm/cpu/armv7/virt-v7.c |   20 ++-
 arch/arm/cpu/u-boot.lds  |1 +
 arch/arm/dts/zynq-zed.dts|  337 +-
 arch/arm/include/asm/armv7.h |8 +-
 board/xilinx/zynq/board.c|   17 ++
 include/configs/zynq-common.h|4 +-
 include/configs/zynq_zed.h   |7 +
 8 files changed, 395 insertions(+), 17 deletions(-)

diff --git a/arch/arm/cpu/armv7/nonsec_virt.S b/arch/arm/cpu/armv7/nonsec_virt.S
index 6367e09..c0d406c 100644
--- a/arch/arm/cpu/armv7/nonsec_virt.S
+++ b/arch/arm/cpu/armv7/nonsec_virt.S
@@ -52,7 +52,15 @@ _secure_monitor:
 	mcreq	p15, 4, r0, c12, c0, 0		@ write HVBAR
 #endif
 
-	movs	pc, lr@ return to non-secure SVC
+	@ Reset CNTVOFF to 0 before leaving monitor mode
+	mrc	p15, 0, r0, c0, c1, 1		@ read ID_PFR1
+	ands	r0, r0, #CPUID_ARM_GENTIMER_MASK	@ test arch timer bits
+	movne	r0, #0
+	mcrrne	p15, 4, r0, r0, c14		@ Reset CNTVOFF to zero
+
+	mov sp,r2	@ restore stack pointer from caller (eq to secure mode stack)
+
+	movs	pc, lr	@ return to non-secure SVC
 
 _hyp_trap:
 	mrs	lr, elr_hyp	@ for older asm: .byte 0x00, 0xe3, 0x0e, 0xe1
@@ -152,11 +160,19 @@ ENTRY(_nonsec_init)
 
 	mrc	p15, 0, ip, c12, c0, 0		@ save secure copy of VBAR
 
+	stmfd sp!,{r2}	@ save r2 as it is clobbered in monitor mode
+	mov r1,sp
 	isb
 	smc	#0@ call into MONITOR mode
 
 	mcr	p15, 0, ip, c12, c0, 0		@ write non-secure copy of VBAR
 
+	ldr r1,=0xC5087A@ this is the value the register has in secure mode (ALIGNMENT!)
+	mcr p15,0,r1,c1,c0,0			@ write control register 
+
+	ldr r1,=0x
+	mcr p15,0,r1,c3,c0,0			@ write Domain Access Control Register
+
 	mov	r1, #1
 	str	r1, [r3, #GICC_CTLR]		@ enable non-secure CPU i/f
 	add	r2, r2, #GIC_DIST_OFFSET
diff --git a/arch/arm/cpu/armv7/virt-v7.c b/arch/arm/cpu/armv7/virt-v7.c
index 2cd604f..b540dbc 100644
--- a/arch/arm/cpu/armv7/virt-v7.c
+++ b/arch/arm/cpu/armv7/virt-v7.c
@@ -46,7 +46,9 @@ static unsigned long get_gicd_base_address(void)
 	 * which we know only for sure for those two CPUs.
 	 */
 	asm(mrc p15, 0, %0, c0, c0, 0\n : =r(midr));
+	debug(midr: %x masked:%x\n,midr,midr  MIDR_PRIMARY_PART_MASK);
 	switch (midr  MIDR_PRIMARY_PART_MASK) {
+	case MIDR_CORTEX_A9_R0P0:
 	case MIDR_CORTEX_A9_R0P1:
 	case MIDR_CORTEX_A15_R0P0:
 	case MIDR_CORTEX_A7_R0P0:
@@ -59,6 +61,7 @@ static unsigned long get_gicd_base_address(void)
 	/* get the GIC base address from the CBAR register */
 	asm(mrc p15, 4, %0, c15, c0, 0\n : =r (periphbase));
 
+	debug(periphbase: %x working_address:%x\n,periphbase, (periphbase  CBAR_MASK)+GIC_DIST_OFFSET);
 	/* the PERIPHBASE can be mapped above 4 GB (lower 8 bits used to
 	 * encode this). Bail out here since we cannot access this without
 	 * enabling paging.
@@ -132,7 +135,8 @@ int armv7_switch_nonsec(void)
 	

Re: [U-Boot] [PATCH] ARM: tegra: make all I2C ports open-drain

2014-03-28 Thread Tom Rini
On Wed, Mar 26, 2014 at 01:54:19PM -0600, Stephen Warren wrote:
 On 03/21/2014 03:27 PM, Tom Warren wrote:
  I've updated u-boot-tegra/next with this patch, rebased it against ARM 
  master, and pushed it to Denx. All tegra boards build OK.
  
  Albert - if you want, you can use u-boot-tegra/next to bring in this patch, 
  or apply it to ARM master yourself, or I can do a formal PR. Let me know. 
  Or TomR can just apply it to Denx master.
 
 I haven't seen any response to this, so I assume simply sending a pull
 request is the best way forward.

Yes, please shoot out pull requests, 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 RFC] fsl_esdhc: flush cache after non-read operation

2014-03-28 Thread Eric Nelson

Hi Hector,

On 03/28/2014 06:49 AM, Fabio Estevam wrote:

On Fri, Mar 28, 2014 at 7:15 AM, Hector Palacios
hector.palac...@digi.com wrote:

Cache was invalidated on the read operation, but it should
also be flushed otherwise.

Signed-off-by: Hector Palacios hector.palac...@digi.com


Thanks, Hector.

Adding Marek on Cc as well.



---

Notes:
 After enabling L2 cache on i.MX6 I found out that many times
 when running the 'gpt' command to partition a uSD card, the
 data was not written at all, or was badly written to the media.

 This patch seems to solve it but I'm not sure if that's the
 right place to flush the cache. Could someone please comment?

 Thank you.

  drivers/mmc/fsl_esdhc.c | 12 
  1 file changed, 12 insertions(+)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index e945c0a470ca..5ef575eb0272 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -253,6 +253,16 @@ static int esdhc_setup_data(struct mmc *mmc, struct 
mmc_data *data)
 return 0;
  }

+static void check_and_flush_dcache_range
+   (struct mmc_cmd *cmd,
+struct mmc_data *data) {
+   unsigned start = (unsigned)data-dest ;
+   unsigned size = roundup(ARCH_DMA_MINALIGN,
+   data-blocks*data-blocksize);
+   unsigned end = start+size ;
+   flush_dcache_range(start, end);
+}
+
  static void check_and_invalidate_dcache_range
 (struct mmc_cmd *cmd,
  struct mmc_data *data) {
@@ -401,6 +411,8 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct 
mmc_data *data)
  #endif
 if (data-flags  MMC_DATA_READ)
 check_and_invalidate_dcache_range(cmd, data);
+   else
+   check_and_flush_dcache_range(cmd, data);
 }


Since this comes after the wait for completion, this is
clearly not the right fix.

If this patch is fixing the problem, the issue must be somewhere else.

Can you verify that the call to flush_dcache_range() in the 
esdhc_setup_data routine is being called prior to esdhc_send_command?



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


[U-Boot] [PATCH 0/3] OMAP3: support fake USB Ethernet MAC address for OMAP3 BeagleBoard-XM

2014-03-28 Thread Nishanth Menon

BeagleBoard-XM unfortunately is plagued by lack of proper MAC address in USB
resulting in custom uEnv.txt and risk of MAC address conflict in the network.

NOTE:
a) if user wants to manually set/override the mac address, then they can change
the environment variable prior to 'usb start'
b) If a new board file would like to create it's own version of this, the weak
function can be overriden as well.
c) There does not yet seem a need to create a generic fake ethernet MAC address
logic, hence, not done pending such a need.

Nishanth Menon (3):
  OMAP: common: consolidate fake USB ethernet MAC address creation
  omap3/sys_info: provide interface to read die id
  OMAP3: beagle-xm: generate fake USB ethernet MAC address from dieid

 arch/arm/cpu/armv7/omap-common/utils.c  |   22 ++
 arch/arm/cpu/armv7/omap3/sys_info.c |   19 ++-
 arch/arm/include/asm/arch-omap3/sys_proto.h |2 ++
 arch/arm/include/asm/omap_common.h  |2 ++
 board/ti/beagle/beagle.c|   11 +++
 board/ti/omap5_uevm/evm.c   |   25 -
 board/ti/panda/panda.c  |   21 ++---
 7 files changed, 65 insertions(+), 37 deletions(-)

-- 
1.7.9.5

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


[U-Boot] How to convert iMX6 IOMux data to U-Boot format

2014-03-28 Thread David Müller (ELSOFT AG)
Hello

Is there a tool or script to convert the iMX6 IOmux data generated to
the Freescale IOMux tool into the format used by U-Boot?

Any hints are appreciated.

Dave

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


[U-Boot] [PATCH v3 08/10] README.falcon: Document environment variables for falcon mode

2014-03-28 Thread Tom Rini
Signed-off-by: Tom Rini tr...@ti.com
---
 doc/README.falcon |9 +
 1 file changed, 9 insertions(+)

diff --git a/doc/README.falcon b/doc/README.falcon
index 6357b1e..bccf6c9 100644
--- a/doc/README.falcon
+++ b/doc/README.falcon
@@ -80,6 +80,15 @@ spl_start_uboot() : required
Returns 0 if SPL should start the kernel, 1 if U-Boot
must be started.
 
+Environment variables
+-
+
+A board may chose to look at the environment for decisions about falcon
+mode.  In this case the following variables may be supported:
+
+boot_os :  Set to yes/Yes/true/True/1 to enable booting to OS,
+   any other value to fall back to U-Boot (including
+   unset)
 
 Using spl command
 -
-- 
1.7.9.5

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


[U-Boot] [PATCH v3 09/10] a3m071: Make spl_start_uboot test like getenv_yesno does

2014-03-28 Thread Tom Rini
This change makes the behaviour slightly more rebust and will match
other implementations which can use getenv_yesno directly.

Acked-by: Stefan Roese s...@denx.de
Signed-off-by: Tom Rini tr...@ti.com
---
 board/a3m071/a3m071.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/board/a3m071/a3m071.c b/board/a3m071/a3m071.c
index 7aeefb2..b96ba81 100644
--- a/board/a3m071/a3m071.c
+++ b/board/a3m071/a3m071.c
@@ -412,7 +412,8 @@ int spl_start_uboot(void)
 
env_init();
getenv_f(boot_os, s, sizeof(s));
-   if ((s != NULL)  (strcmp(s, yes) == 0))
+   if ((s != NULL)  (*s == '1' || *s == 'y' || *s == 'Y' ||
+   *s == 't' || *s == 'T'))
return 0;
 
return 1;
-- 
1.7.9.5

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


[U-Boot] [PATCH 2/3] omap3/sys_info: provide interface to read die id

2014-03-28 Thread Nishanth Menon
introduce get_die_id() function which allows generation of
information such as fake MAC address from the processor ID code.

Signed-off-by: Nishanth Menon n...@ti.com
---

 arch/arm/cpu/armv7/omap3/sys_info.c |   19 ++-
 arch/arm/include/asm/arch-omap3/sys_proto.h |1 +
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap3/sys_info.c 
b/arch/arm/cpu/armv7/omap3/sys_info.c
index 258786b..bef5f05 100644
--- a/arch/arm/cpu/armv7/omap3/sys_info.c
+++ b/arch/arm/cpu/armv7/omap3/sys_info.c
@@ -41,11 +41,23 @@ static char *rev_s_37xx[CPU_37XX_MAX_REV] = {
 #endif /* CONFIG_DISPLAY_CPUINFO */
 
 /*
+ * get_dieid(u32 *id) - read die ID
+ */
+void get_dieid(u32 *id)
+{
+   struct ctrl_id *id_base = (struct ctrl_id *)OMAP34XX_ID_L4_IO_BASE;
+
+   id[3] = readl(id_base-die_id_0);
+   id[2] = readl(id_base-die_id_1);
+   id[1] = readl(id_base-die_id_2);
+   id[0] = readl(id_base-die_id_3);
+}
+
+/*
  * dieid_num_r(void) - read and set die ID
  */
 void dieid_num_r(void)
 {
-   struct ctrl_id *id_base = (struct ctrl_id *)OMAP34XX_ID_L4_IO_BASE;
char *uid_s, die_id[34];
u32 id[4];
 
@@ -54,10 +66,7 @@ void dieid_num_r(void)
uid_s = getenv(dieid#);
 
if (uid_s == NULL) {
-   id[3] = readl(id_base-die_id_0);
-   id[2] = readl(id_base-die_id_1);
-   id[1] = readl(id_base-die_id_2);
-   id[0] = readl(id_base-die_id_3);
+   get_dieid(id);
sprintf(die_id, %08x%08x%08x%08x, id[0], id[1], id[2], id[3]);
setenv(dieid#, die_id);
uid_s = die_id;
diff --git a/arch/arm/include/asm/arch-omap3/sys_proto.h 
b/arch/arm/include/asm/arch-omap3/sys_proto.h
index 44fa66f..1f62941 100644
--- a/arch/arm/include/asm/arch-omap3/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap3/sys_proto.h
@@ -69,6 +69,7 @@ void make_cs1_contiguous(void);
 void omap_nand_switch_ecc(uint32_t, uint32_t);
 void power_init_r(void);
 void dieid_num_r(void);
+void get_dieid(u32 *id);
 void do_omap3_emu_romcode_call(u32 service_id, u32 parameters);
 void omap3_gp_romcode_call(u32 service_id, u32 parameter);
 u32 warm_reset(void);
-- 
1.7.9.5

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


[U-Boot] [PATCH v2 1/3] TI: Add, use a DEFAULT_LINUX_BOOT_ENV environment string

2014-03-28 Thread Tom Rini
To deal with a reoccurring problem properly we need to specify addresses
for the Linux kernel, Flatted Device Tree and ramdisk that obey the
constraints within the kernel's Documentation/arm/Booting file but also
make sure that we relocate things within a valid address range.

It is possible with these addresses to also set fdt_high and initrd_high
to the value of 0x.  We don't do this by default to allow for
the most likely success of people using custom addresses however.

Signed-off-by: Tom Rini tr...@ti.com

---
Changes in v2:
- Change to 256MB as this is a must-use uppper value rather than a limit
  compared with known memory size, so was failing on some platforms.  We
  only use this stanza on platforms we know have more than 256MB memory.
---
 include/configs/am335x_evm.h  |5 +
 include/configs/am43xx_evm.h  |5 +
 include/configs/ti_armv7_common.h |   22 +-
 include/configs/ti_omap4_common.h |4 +---
 include/configs/ti_omap5_common.h |5 +
 5 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 884a42b..9064ed1 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -61,11 +61,8 @@
 
 #ifndef CONFIG_SPL_BUILD
 #define CONFIG_EXTRA_ENV_SETTINGS \
-   loadaddr=0x8020\0 \
-   fdtaddr=0x80F8\0 \
-   fdt_high=0x\0 \
+   DEFAULT_LINUX_BOOT_ENV \
boot_fdt=try\0 \
-   rdaddr=0x8100\0 \
bootpart=0:2\0 \
bootdir=/boot\0 \
bootfile=zImage\0 \
diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h
index 614857d..2c5 100644
--- a/include/configs/am43xx_evm.h
+++ b/include/configs/am43xx_evm.h
@@ -112,10 +112,7 @@
 
 #ifndef CONFIG_SPL_BUILD
 #define CONFIG_EXTRA_ENV_SETTINGS \
-   loadaddr=0x8020\0 \
-   fdtaddr=0x80F8\0 \
-   fdt_high=0x\0 \
-   rdaddr=0x8100\0 \
+   DEFAULT_LINUX_BOOT_ENV \
fdtfile=undefined\0 \
bootpart=0:2\0 \
bootdir=/boot\0 \
diff --git a/include/configs/ti_armv7_common.h 
b/include/configs/ti_armv7_common.h
index 69d69a5..9feec1a 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -36,8 +36,28 @@
 /*
  * Our DDR memory always starts at 0x8000 and U-Boot shall have
  * relocated itself to higher in memory by the time this value is used.
+ * However, set this to a 32MB offset to allow for easier Linux kernel
+ * booting as the default is often used as the kernel load address.
  */
-#define CONFIG_SYS_LOAD_ADDR   0x8000
+#define CONFIG_SYS_LOAD_ADDR   0x8200
+
+/*
+ * We setup defaults based on constraints from the Linux kernel, which should
+ * also be safe elsewhere.  We have the default load at 32MB into DDR (for
+ * the kernel), FDT above 128MB (the maximum location for the end of the
+ * kernel), and the ramdisk 512KB above that (allowing for hopefully never
+ * seen large trees).  We say all of this must be within the first 256MB
+ * as that will normally be within the kernel lowmem and thus visible via
+ * bootm_size and we only run on platforms with 256MB or more of memory.
+ */
+#define DEFAULT_LINUX_BOOT_ENV \
+   loadaddr=0x8200\0 \
+   kernel_addr_r=0x8200\0 \
+   fdtaddr=0x8800\0 \
+   fdt_addr_r=0x8800\0 \
+   rdaddr=0x8808\0 \
+   ramdisk_addr_r=0x8808\0 \
+   bootm_size=0x1000\0
 
 /*
  * Default to a quick boot delay.
diff --git a/include/configs/ti_omap4_common.h 
b/include/configs/ti_omap4_common.h
index bcb5eab..387f570 100644
--- a/include/configs/ti_omap4_common.h
+++ b/include/configs/ti_omap4_common.h
@@ -87,10 +87,8 @@
  * Environment setup
  */
 #define CONFIG_EXTRA_ENV_SETTINGS \
-   loadaddr=0x8200\0 \
+   DEFAULT_LINUX_BOOT_ENV \
console=ttyO2,115200n8\0 \
-   fdt_high=0x\0 \
-   fdtaddr=0x80f8\0 \
fdtfile=undefined\0 \
bootpart=0:2\0 \
bootdir=/boot\0 \
diff --git a/include/configs/ti_omap5_common.h 
b/include/configs/ti_omap5_common.h
index 7b10fbd..2443d55 100644
--- a/include/configs/ti_omap5_common.h
+++ b/include/configs/ti_omap5_common.h
@@ -70,10 +70,7 @@
 #endif
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
-   loadaddr=0x8020\0 \
-   fdtaddr=0x80F8\0 \
-   fdt_high=0x\0 \
-   rdaddr=0x8100\0 \
+   DEFAULT_LINUX_BOOT_ENV \
console= CONSOLEDEV ,115200n8\0 \
fdtfile=undefined\0 \
bootpart=0:2\0 \
-- 
1.7.9.5

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


[U-Boot] [PATCH v2 2/3] am335x_evm: Update the ramdisk args, we pass things in just fine via DT

2014-03-28 Thread Tom Rini
Signed-off-by: Tom Rini tr...@ti.com
---
 include/configs/am335x_evm.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 9064ed1..b22c9c1 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -79,7 +79,7 @@
nfsopts=nolock\0 \
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname} \
::off\0 \
-   ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M\0 \
+   ramroot=/dev/ram0 rw\0 \
ramrootfstype=ext2\0 \
mmcargs=setenv bootargs console=${console}  \
${optargs}  \
-- 
1.7.9.5

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


[U-Boot] [PATCH v2 3/3] am43xx_evm: Update the ramdisk args, we pass things in just fine via DT

2014-03-28 Thread Tom Rini
Signed-off-by: Tom Rini tr...@ti.com
---
 include/configs/am43xx_evm.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h
index 2c5..2d9825b 100644
--- a/include/configs/am43xx_evm.h
+++ b/include/configs/am43xx_evm.h
@@ -128,7 +128,7 @@
usbroot=/dev/sda2 rw\0 \
usbrootfstype=ext4 rootwait\0 \
usbdev=0\0 \
-   ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M\0 \
+   ramroot=/dev/ram0 rw\0 \
ramrootfstype=ext2\0 \
mmcargs=setenv bootargs console=${console}  \
${optargs}  \
-- 
1.7.9.5

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


Re: [U-Boot] tools: fix Makefile to clean-up fit_info and fit_check_sign

2014-03-28 Thread Tom Rini
On Fri, Mar 28, 2014 at 03:09:51PM +0900, Masahiro Yamada wrote:

 We should avoid the description in Makefile like this
 
 ifdef CONFIG_FIT_SIGNATURE
 hostprogs-y += fit_info$(SFX) fit_check_sign$(SFX)
 endif
 
 Otherwise, fit_info and fit_check_sign would never be cleaned
 by make clean.
 
 Cc: Heiko Schocher h...@denx.de
 
 ---
 tools/Makefile | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
 
 diff --git a/tools/Makefile b/tools/Makefile
 index c5c378c..c34df4f 100644
 --- a/tools/Makefile
 +++ b/tools/Makefile
 @@ -60,9 +60,7 @@ hostprogs-y += mkenvimage$(SFX)
  mkenvimage$(SFX)-objs := crc32.o mkenvimage.o os_support.o
  
  hostprogs-y += dumpimage$(SFX) mkimage$(SFX)
 -ifdef CONFIG_FIT_SIGNATURE
 -hostprogs-y += fit_info$(SFX) fit_check_sign$(SFX)
 -endif
 +hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info$(SFX) fit_check_sign$(SFX)
  
  FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := image-sig.o
  # Flattened device tree objects

What tree is this against, exactly?

-- 
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] [RFC PATCH 04/17] kconfig: add defconfig files for all boards

2014-03-28 Thread Daniel Schwierzeck
2014-03-28 3:25 GMT+01:00 Masahiro Yamada yamad...@jp.panasonic.com:

 Those boards have linker errors, but I do not understand yet why. For
 example on ARM the linker complains about multiple definition of
 board_init() and board_eth_init(). The solely difference is that there
 are one or two additional intermediate objects (board/built-in.o and
 if necessary board/VENDOR/built-in.o). But board/built-in.o and
 board/BOARD/built-in.o respectively board/VENDOR/BOARD/built-in.o
 contain the same symbols and object code. The strange thing is that
 the error only affects some boards.

 Have you figured out the multiple definition error?

 They are nasty ones and have their own linker scripts.   :-(
 For cm_t335 board, board/compulab/cm_t335/u-boot.lds needs modifying.

   --- a/board/compulab/cm_t335/u-boot.lds
   +++ b/board/compulab/cm_t335/u-boot.lds
   @@ -19,7 +19,7 @@ SECTIONS
   {
   *(.__image_copy_start)
   CPUDIR/start.o (.text*)
   -   board/compulab/cm_t335/built-in.o (.text*)
   +   board/built-in.o (.text*)
   *(.text*)
   }


that would fix it. But I looked through several linker scripts and saw
that some boards use that for size optimization. I think we should
ignore board/built-in.o and keep the direct linking of
board/BOARD/built-in.o respectively board/VENDOR/BOARD/built-in.o and
optionally board/vendor/common/built-in.o

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


[U-Boot] [PATCH] buildman: make output dir configurable

2014-03-28 Thread Daniel Schwierzeck
Add an option to specify the output directory to override the
default path '../'. This is useful for building in a ramdisk.

Signed-off-by: Daniel Schwierzeck daniel.schwierz...@gmail.com
Cc: Simon Glass s...@chromium.org
---
 tools/buildman/buildman.py | 2 ++
 tools/buildman/control.py  | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py
index 8822efe..0d95246 100755
--- a/tools/buildman/buildman.py
+++ b/tools/buildman/buildman.py
@@ -101,6 +101,8 @@ parser.add_option('-T', '--threads', type='int',
default=None, help='Number of builder threads to use')
 parser.add_option('-u', '--show_unknown', action='store_true',
default=False, help='Show boards with unknown build result')
+parser.add_option('-o', '--output-dir', type='string',
+   dest='output_dir', default='..', help='Output directory')
 
 parser.usage = buildman -b branch [options]
 
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 8e6a08f..d2f4102 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -145,7 +145,7 @@ def DoBuildman(options, args):
 options.step = len(series.commits) - 1
 
 # Create a new builder with the selected options
-output_dir = os.path.join('..', options.branch)
+output_dir = os.path.join(options.output_dir, options.branch)
 builder = Builder(toolchains, output_dir, options.git_dir,
 options.threads, options.jobs, checkout=True,
 show_unknown=options.show_unknown, step=options.step)
-- 
1.8.3.2

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


[U-Boot] [PATCH] blackfin: mmc: Correct mmc_host_is_spi and bfin_sdh.c

2014-03-28 Thread Tom Rini
In the recent mmc cleanup, the mmc_host_is_spi macro was broken and
bfin_sdh.c had mmc-bus_width turned into mmc_bus_width(mmc), both of
which were incorrect.

Signed-off-by: Tom Rini tr...@ti.com
---
 drivers/mmc/bfin_sdh.c |2 +-
 include/mmc.h  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/bfin_sdh.c b/drivers/mmc/bfin_sdh.c
index 7b35d8e..bcd6a3e 100644
--- a/drivers/mmc/bfin_sdh.c
+++ b/drivers/mmc/bfin_sdh.c
@@ -238,7 +238,7 @@ static void bfin_sdh_set_ios(struct mmc *mmc)
u16 cfg = 0;
u16 clk_ctl = 0;
 
-   if (mmc_bus_width(mmc) == 4) {
+   if (mmc-bus_width == 4) {
cfg = bfin_read_SDH_CFG();
 #ifndef RSI_BLKSZ
cfg = ~PD_SDDAT3;
diff --git a/include/mmc.h b/include/mmc.h
index 0172979..8a82974 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -360,7 +360,7 @@ void mmc_set_preinit(struct mmc *mmc, int preinit);
 
 #ifdef CONFIG_GENERIC_MMC
 #ifdef CONFIG_MMC_SPI
-#define mmc_host_is_spi(mmc)   ((mmc)-cfg.host_caps  MMC_MODE_SPI)
+#define mmc_host_is_spi(mmc)   ((mmc)-cfg-host_caps  MMC_MODE_SPI)
 #else
 #define mmc_host_is_spi(mmc)   0
 #endif
-- 
1.7.9.5

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


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

2014-03-28 Thread Tom Rini
On Sun, Mar 23, 2014 at 02:21:37AM +0100, Marek Vasut wrote:

 The following changes since commit 2c072c958bb544c72f0e848375803dbd6971f022:

   sandbox: config: Enable cros_ec emulation and related items (2014-03-17
 20:05:50 -0600)

 are available in the git repository at:

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

 for you to fetch changes up to 7d0b605abb1f2dbccf4abb502f3b1fc9f97f2552:

   dfu: mmc: Replace calls to u-boot commands with native mmc API (2014-03-23
 02:20:10 +0100)

 
 Heiko Schocher (3):
   usb, dfu: extract flush code into seperate function
   usb: dfu: introduce dfuMANIFEST state
   am335x, dfu: add DFU_MANIFEST_POLL_TIMEOUT to the siemens boards

 Łukasz Majewski (1):
   dfu: mmc: Replace calls to u-boot commands with native mmc API

  README | 10 ++
  drivers/dfu/dfu.c  | 42 
 ++
  drivers/dfu/dfu_mmc.c  | 31 ---
  drivers/usb/gadget/f_dfu.c | 48 
 ++--
  include/configs/siemens-am33x-common.h |  1
  include/dfu.h  |  4 
  6 files changed, 103 insertions(+), 33 deletions(-)

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 misc

2014-03-28 Thread Tom Rini
On Sat, Mar 22, 2014 at 04:31:19PM -0700, Simon Glass wrote:

 Hi Tom,
 
 Here are a few more things from my patchwork queue. I have tested with 
 buildman.
 
 
 
 The following changes since commit 2c072c958bb544c72f0e848375803dbd6971f022:
 
   sandbox: config: Enable cros_ec emulation and related items
 (2014-03-17 20:05:50 -0600)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-x86.git
 
 for you to fetch changes up to 659c89da8e48d44395120aeb2dd0d02d3fb24b67:
 
   patman: Use Patch-cc: instead of Cc: (2014-03-22 14:47:30 -0600)
 
 
 Patrice Bouchand (2):
   Add lzmadec command
   sandbox: Enable CONFIG_CMD_LZMADEC in sandbox.h
 
 Simon Glass (1):
   patman: Use Patch-cc: instead of Cc:
 
  common/Makefile |  3 +++
  common/cmd_lzmadec.c| 52
 
  include/configs/sandbox.h   |  2 ++
  tools/patman/README | 21 -
  tools/patman/patchstream.py |  4 ++--
  5 files changed, 71 insertions(+), 11 deletions(-)
  create mode 100644 common/cmd_lzmadec.c

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-mmc 24032014

2014-03-28 Thread Tom Rini
On Mon, Mar 24, 2014 at 03:03:45PM +0200, Pantelis Antoniou wrote:

 Hi Tom,
 
 The following changes since commit 2c072c958bb544c72f0e848375803dbd6971f022:
 
   sandbox: config: Enable cros_ec emulation and related items (2014-03-17 
 20:05:50 -0600)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-mmc.git master
 
 for you to fetch changes up to eea4e6fe82fef9975e0153644935b89882890450:
 
   dfu: mmc: Replace calls to u-boot commands with native mmc API (2014-03-24 
 12:59:54 +0200)
 
 
 Pantelis Antoniou (3):
   mmc: Remove ops from struct mmc and put in mmc_ops
   mmc: Convert mmc struct's name array to a pointer
   mmc: Split mmc struct, rework mmc initialization (v2)
 
 Łukasz Majewski (1):
   dfu: mmc: Replace calls to u-boot commands with native mmc API
 
  arch/arm/include/asm/arch-davinci/sdmmc_defs.h |   1 +
  arch/arm/include/asm/arch-tegra/tegra_mmc.h|   4 
  common/cmd_mmc.c   |   2 +-
  common/cmd_mmc_spi.c   |   2 +-
  drivers/dfu/dfu_mmc.c  |  31 
 ---
  drivers/mmc/arm_pl180_mmci.c   |  50 
 +++---
  drivers/mmc/arm_pl180_mmci.h   |   4 
  drivers/mmc/bfin_sdh.c |  40 
 
  drivers/mmc/davinci_mmc.c  |  41 
 ++---
  drivers/mmc/dw_mmc.c   |  58 
 +++---
  drivers/mmc/fsl_esdhc.c|  65 
 +
  drivers/mmc/ftsdc010_mci.c |  63 
 ---
  drivers/mmc/gen_atmel_mci.c|  53 
 -
  drivers/mmc/mmc.c  |  99 
 +--
  drivers/mmc/mmc_spi.c  |  50 
 +++---
  drivers/mmc/mmc_write.c|   3 ++-
  drivers/mmc/mxcmmc.c   |  45 
 +
  drivers/mmc/mxsmmc.c   |  48 
 
  drivers/mmc/omap_hsmmc.c   | 142 
 +++---
  drivers/mmc/pxa_mmc_gen.c  |  70 
 +++---
  drivers/mmc/sdhci.c|  84 
 +++-
  drivers/mmc/sh_mmcif.c |  52 
 ++--
  drivers/mmc/tegra_mmc.c|  53 
 +
  include/dwmmc.h|   2 ++
  include/fsl_esdhc.h|   4 
  include/mmc.h  |  48 
 ++--
  include/sdhci.h|   2 ++
  27 files changed, 621 insertions(+), 495 deletions(-)

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] am335x_evm: Drop CONFIG_SPL_ETH_SUPPORT from default build

2014-03-28 Thread Tom Rini
On Fri, Mar 28, 2014 at 09:11:42AM -0400, Tom Rini wrote:

 On the boards this target supports this option is either non possible
 without hardware mods (Beaglebone White/Black) or not supported due to
 board design.  Drop this and regain some space.
 
 Signed-off-by: Tom Rini tr...@ti.com

Applied to u-boot/master (as we need to trim the size due to mmc
cleanups), 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] am335x_evm: Clarify when we build board_eth_init

2014-03-28 Thread Tom Rini
On Fri, Mar 28, 2014 at 11:42:08AM -0400, Tom Rini wrote:

 If we build this function in cases where we would be discarding it
 anyhow we still end up with maybe unused warnings.  Rather than litter
 the function with __maybe_unused, just spell out when to build it.
 
 Signed-off-by: Tom Rini tr...@ti.com

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] kbuild: Rename UIMAGE to MKIMAGE

2014-03-28 Thread Tom Rini
On Fri, Mar 14, 2014 at 05:00:14AM +0100, Marek Vasut wrote:

 U-Boot uses the 'mkimage' tool to produce various image types,
 not only uImage image type. Rename the invocation name from
 UIMAGE to MKIMAGE.
 
 The following command was used to do the replacement:
 git grep 'quiet_cmd_mkimage.* = UIMAGE' | cut -d : -f 1 | \
  xargs -i sed -i s@\(quiet_cmd_mkimage\)\(.*\) = UIMAGE @\1\2 = MKIMAGE@ {}
 
 Signed-off-by: Marek Vasut ma...@denx.de
 Cc: Tom Rini tr...@ti.com
 Cc: Masahiro Yamada yamad...@jp.panasonic.com
 Acked-by: Masahiro Yamada yamad...@jp.panasonic.com

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] spl: Fix guardian macros in spl.h

2014-03-28 Thread Tom Rini
On Wed, Mar 19, 2014 at 02:02:55AM +0100, Marek Vasut wrote:

 Fix the macros guarding the spl.h header for various platforms. Due to
 a typo and a propagation of it, the macros went out-of-sync with their
 ifdef check, so fix this.
 
 Signed-off-by: Marek Vasut ma...@denx.de
 Cc: Tom Rini tr...@ti.com

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] common, env: Fix support for environment in i2c eeprom

2014-03-28 Thread Tom Rini
On Wed, Mar 19, 2014 at 10:25:08AM +0100, Matthias Fuchs wrote:

 When using CONFIG_SYS_I2C i2c needs to be initialized by
 i2c_init_all(). This is done in some places but not in
 eeprom_init().
 
 Signed-off-by: Matthias Fuchs matthias.fu...@esd.eu

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] kbuild: move asm-offsets.c from SoC directory to arch/$(ARCH)/lib

2014-03-28 Thread Tom Rini
On Tue, Mar 18, 2014 at 04:38:13PM +0900, Masahiro Yamada wrote:

 U-Boot has supported two kinds of asm-offsets.h.
 
 One is generic for all architectures and its source is located at
 ./lib/asm-offsets.c.
 
 The other is SoC specific and its source is under SoC directory.
 The problem here is that only boards with SoC directory can use
 the asm-offsets infrastructure.
 Putting asm-offsets.c right under CPU directory does not work.
 
 Now a new demand is coming. PowerPC folks want to use asm-offsets.
 But no PowerPC boards have SoC directory.
 
 It seems inconsistent that some boards add asm-offsets.c to SoC
 directoreis and some to CPU directories.
 It looks more reasonable to put asm-offsets.c under arch/$(ARCH)/lib.
 
 This commit merges asm-offsets.c under SoC directories into
 arch/$(ARCH)/lib/asm-offsets.c.
 
 By the way, I doubt the necessity of some entries in asm-offsets.c.
 I am leaving refactoring to the board maintainers.
 Please check TODO in the comment blocks in
 arch/{arm,nds32}/lib/asm-offsets.c.
 
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Cc: Yuantian Tang yuantian.t...@freescale.com

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] [U-Boot, v2] Logo: TIZEN: Change booting logo size to official size.

2014-03-28 Thread Tom Rini
On Fri, Mar 21, 2014 at 06:18:02PM +0900, Jonghwa Lee wrote:

 Since TIZEN group has been used 450 X 140 bmp logo for lunchbox,
 this patch tries to change the logo size from 500 X 150 to official size.
 By reducing image size, we also save about 35KB.
 
 To make row aligned 4 bytes, add 2 pixels to row. Therefore the real width
 of image size is 452.
 
 Signed-off-by: Jonghwa Lee jonghwa3@samsung.com
 Reviewed-by : Przemyslaw Marczak p.marc...@samsung.com

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] axs101: flush DMA buffer descriptors before DMA transactons starts

2014-03-28 Thread Tom Rini
On Fri, Mar 21, 2014 at 04:57:47PM +0400, Alexey Brodkin wrote:

 CPU sets DMA buffer descriptors with data required for inetrnal DMA such as:
  * Ownership of BD
  * Buffer size
  * Pointer to data buffer in memory
 
 Then we need to make sure DMA engine of NAND controller gets proper data.
 For this we flush buffer rescriptor.
 
 Then we're  ready for DMA transaction.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com

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] net/designware: align DMA buffer descriptors to D$ line

2014-03-28 Thread Tom Rini
On Fri, Mar 21, 2014 at 04:16:57PM +0400, Alexey Brodkin wrote:

 It's important to have ability to flush/invalidate each DMA buffer descriptor
 individually to prevent incoherency of adjacent BDs.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com

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] Start the deprecation process for generic board

2014-03-28 Thread Tom Rini
On Sat, Mar 22, 2014 at 05:14:51PM -0600, Simon Glass wrote:

 We should move forward to remove the old board init code. Add a
 prominent message to encourage maintainers to get started on this
 work.
 
 Signed-off-by: Simon Glass s...@chromium.org

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] kbuild: create a build directory automatically for out-of-tree build

2014-03-28 Thread Tom Rini
On Mon, Mar 24, 2014 at 01:55:27PM +0900, Masahiro Yamada wrote:

 Prior to Kbuild, the build system created a build directory,
 when it did not exist, for out-of-tree build.
 
 This feature was dropped when we switched to Kbuild
 because many of lines in makefiles were copied from Linux Kernel.
 (In Linux Kernel, we have to create a build directory by ourselves
 before starting build.)
 
 That feature seems worth reviving for less typing
 even if our code and Linux Kernel diverge.
 
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Suggested-by: Simon Glass s...@chromium.org
 Acked-by: Simon Glass s...@chromium.org
 Tested-by: Simon Glass s...@chromium.org

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] [U-Boot, v5, 2/4] cpu: exynos4: add ace sha base address

2014-03-28 Thread Tom Rini
On Tue, Mar 25, 2014 at 10:58:20AM +0100, Przemyslaw Marczak wrote:

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 Cc: Minkyu Kang mk7.k...@samsung.com

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] [U-Boot, v5, 3/4] drivers: crypto: ace_sha: add implementation of hardware based lib rand

2014-03-28 Thread Tom Rini
On Tue, Mar 25, 2014 at 10:58:21AM +0100, Przemyslaw Marczak wrote:

 This patch adds implementation of rand library based on hardware random
 number generator of security subsystem in Exynos SOC.
 
 This library includes:
 - srand()  - used for seed hardware block
 - rand()   - returns random number
 - rand_r() - the same as above with given seed
 
 which depends on CONFIG_EXYNOS_ACE_SHA and CONFIG_LIB_HW_RAND.
 
 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 cc: Akshay Saraswat aksha...@samsung.com
 cc: ARUN MANKUZHI aru...@samsung.com
 cc: Minkyu Kang mk7.k...@samsung.com
 Cc: Michael Walle mich...@walle.cc
 Cc: Tom Rini tr...@ti.com
 Cc: Masahiro Yamada yamad...@jp.panasonic.com

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] [U-Boot, v5, 1/4] lib: rand: introduce new configs: CONFIG_LIB_RAND and CONFIG_LIB_HW_RAND

2014-03-28 Thread Tom Rini
On Tue, Mar 25, 2014 at 10:58:19AM +0100, Przemyslaw Marczak wrote:

 New configs:
 - CONFIG_LIB_RAND- to enable implementation of rand library in lib/rand.c
 - CONFIG_LIB_HW_RAND - to enable hardware based implementations of lib rand
 
 Other changes:
 - add CONFIG_LIB_RAND to boards configs which needs rand()
 - put only one rand.o dependency in lib/Makefile
 
 CONFIG_LIB_HW_RAND should be defined for drivers which implements rand library
 (declared in include/common.h):
 - void srand(unsigned int seed)
 - unsigned int rand(void)
 - unsigned int rand_r(unsigned int *seedp)
 
 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 Cc: Michael Walle mich...@walle.cc
 Cc: Tom Rini tr...@ti.com
 Cc: Masahiro Yamada yamad...@jp.panasonic.com

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] blackfin: mmc: Correct mmc_host_is_spi and bfin_sdh.c

2014-03-28 Thread Tom Rini
On Fri, Mar 28, 2014 at 04:56:47PM -0400, Tom Rini wrote:

 In the recent mmc cleanup, the mmc_host_is_spi macro was broken and
 bfin_sdh.c had mmc-bus_width turned into mmc_bus_width(mmc), both of
 which were incorrect.
 
 Signed-off-by: Tom Rini tr...@ti.com

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] [U-Boot, v5, 4/4] trats/trats2: enable exynos ace sha subsystem and hardware based lib rand

2014-03-28 Thread Tom Rini
On Tue, Mar 25, 2014 at 10:58:22AM +0100, Przemyslaw Marczak wrote:

 This allows to use exynos random number generator by enabling configs:
 - CONFIG_EXYNOS_ACE_SHA
 - CONFIG_LIB_HW_RAND
 
 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 Acked-by: Lukasz Majewski l.majew...@samsung.com
 cc: Piotr Wilczek p.wilc...@samsung.com
 cc: Minkyu Kang mk7.k...@samsung.com

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] kbuild: fix bugs in cleaning targets

2014-03-28 Thread Tom Rini
On Fri, Mar 28, 2014 at 02:55:02PM +0900, Masahiro Yamada wrote:

 make clean, make clobber, make mrproper and make distclean
 missed to clean-up some files when they were run with
 O=some_dir option.
 
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Reported-by: Wolfgang Denk w...@denx.de

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] kbuild/makefile: allow building host tools separately

2014-03-28 Thread Alexey Brodkin
Hi Masahiro-san,

On Fri, 2014-03-28 at 15:36 +0900, Masahiro Yamada wrote:
 Hi Alexey,

 This may be the similar discussion to
 http://u-boot.10912.n7.nabble.com/U-Boot-could-not-cross-compile-u-boot-tools-td174911.html

It looks not that relevant to me.
For example even before switching U-Boot to Kbuild it was not possible
to build host tools simply without patching sources/headers or
configuring real target. Or I might be missing something here.

 Providing a separate make target seems preferable.
 
 Maybe like this?
 
 To build host tools just execute:
 =
 make tools-only
 =

Fully agree. I thought about it right after I sent you initial patch.

 And I am not happy about adding ifdef to everywhere.

So do I. But I don't see other way around unfortunately.

 
 So, how about a patch like this?
 
 
 
 
 diff --git a/Makefile b/Makefile
 index c744718..12e1075 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -409,7 +409,7 @@ timestamp_h := include/generated/timestamp_autogenerated.h
  
  no-dot-config-targets := clean clobber mrproper distclean \
  help %docs check% coccicheck \
 -ubootversion backup
 +ubootversion backup tools-only
  
  config-targets := 0
  mixed-targets  := 0
 @@ -1128,6 +1128,9 @@ checkarmreloc: u-boot
  env: scripts_basic
 $(Q)$(MAKE) $(build)=tools/$@
  
 +tools-only: scripts_basic
 +   $(Q)$(MAKE) $(build)=tools
 +
  tools-all: export HOST_TOOLS_ALL=y
  tools-all: env tools ;
  

Doesn't work for me:

$ make tools-only
  HOSTCC  scripts/basic/fixdep
  HOSTCC  tools/aisimage.o
  HOSTCC  tools/crc32.o
  HOSTCC  tools/default_image.o
  HOSTCC  tools/dumpimage.o
In file included from include/version.h:11:0,
 from tools/dumpimage.c:11:
include/timestamp.h:11:47: fatal error:
generated/timestamp_autogenerated.h: No such file or directory
 #include generated/timestamp_autogenerated.h
   ^
compilation terminated.
make[1]: *** [tools/dumpimage.o] Error 1
make: *** [tools-only] Error 2


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


[U-Boot] [PATCH] powerpc/mpc85xx: Add workaround for erratum A007212

2014-03-28 Thread York Sun
Erratum A007212 for DDR is about a runaway condition for DDR PLL
oscilliator. Please refer to erratum document for detail.
For this workaround to work, DDR PLL needs to be disabled in RCW.
However, u-boot needs to know the expected PLL ratio. We put the
ratio in a reserved field RCW[18:23]. U-boot will skip this workaround
if DDR PLL ratio is set, or the reserved field is not set.

Workaround for erratum A007212 applies to selected versions of
B4/T4 SoCs. It is safe to apply the workaround to all versions. It
is helpful for upgrading SoC without changing u-boot. In case DDR
PLL is disabled by RCW (part of the erratum workaround), we need this
u-boot workround to bring up DDR clock.

Signed-off-by: York Sun york...@freescale.com
---
 arch/powerpc/cpu/mpc85xx/cmd_errata.c |   19 
 arch/powerpc/cpu/mpc85xx/cpu_init.c   |   69 +
 arch/powerpc/cpu/mpc85xx/speed.c  |7 +++
 arch/powerpc/include/asm/config_mpc85xx.h |2 +
 arch/powerpc/include/asm/immap_85xx.h |2 +
 5 files changed, 99 insertions(+)

diff --git a/arch/powerpc/cpu/mpc85xx/cmd_errata.c 
b/arch/powerpc/cpu/mpc85xx/cmd_errata.c
index 8b79c05..42b6331 100644
--- a/arch/powerpc/cpu/mpc85xx/cmd_errata.c
+++ b/arch/powerpc/cpu/mpc85xx/cmd_errata.c
@@ -113,6 +113,21 @@ static void check_erratum_a4580(uint32_t svr)
 }
 #endif
 
+#ifdef CONFIG_SYS_FSL_ERRATUM_A007212
+/*
+ * This workaround can be implemented in PBI, or by u-boot.
+ */
+static void check_erratum_a007212(void)
+{
+   u32 __iomem *plldgdcr = (void *)(CONFIG_SYS_DCSRBAR + 0x21c20);
+
+   if (in_be32(plldgdcr)  0x1fe) {
+   /* check if PLL ratio is set by workaround */
+   puts(Work-around for Erratum A007212 enabled\n);
+   }
+}
+#endif
+
 static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_CPU_A011
@@ -277,6 +292,10 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
if (has_erratum_a006261())
puts(Work-around for Erratum A006261 enabled\n);
 #endif
+#ifdef CONFIG_SYS_FSL_ERRATUM_A007212
+   check_erratum_a007212();
+#endif
+
return 0;
 }
 
diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index 81aeadd..4f27bcc 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -267,6 +267,71 @@ static void corenet_tb_init(void)
 }
 #endif
 
+#ifdef CONFIG_SYS_FSL_ERRATUM_A007212
+void fsl_erratum_a007212_workaround(void)
+{
+   ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+   u32 ddr_pll_ratio;
+   u32 __iomem *plldgdcr1 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c20);
+   u32 __iomem *plldadcr1 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c28);
+   u32 __iomem *dpdovrcr4 = (void *)(CONFIG_SYS_DCSRBAR + 0x21e80);
+#if (CONFIG_NUM_DDR_CONTROLLERS = 2)
+   u32 __iomem *plldgdcr2 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c40);
+   u32 __iomem *plldadcr2 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c48);
+#if (CONFIG_NUM_DDR_CONTROLLERS = 3)
+   u32 __iomem *plldgdcr3 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c60);
+   u32 __iomem *plldadcr3 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c68);
+#endif
+#endif
+   /*
+* Even this workaround applies to selected version of SoCs, it is
+* safe to apply to all versions, with the limitation of odd ratios.
+* If RCW has disabled DDR PLL, we have to apply this workaround,
+* otherwise DDR will not work.
+*/
+   ddr_pll_ratio = (in_be32(gur-rcwsr[0]) 
+   FSL_CORENET_RCWSR0_MEM_PLL_RAT_SHIFT) 
+   FSL_CORENET_RCWSR0_MEM_PLL_RAT_MASK;
+   /* check if RCW sets ratio to 0, required by this workaround */
+   if (ddr_pll_ratio != 0)
+   return;
+   ddr_pll_ratio = (in_be32(gur-rcwsr[0]) 
+   FSL_CORENET_RCWSR0_MEM_PLL_RAT_RESV_SHIFT) 
+   FSL_CORENET_RCWSR0_MEM_PLL_RAT_MASK;
+   /* check if reserved bits have the desired ratio */
+   if (ddr_pll_ratio == 0) {
+   printf(Error: Unknown DDR PLL ratio!\n);
+   return;
+   }
+   ddr_pll_ratio = 1;
+
+   setbits_be32(plldadcr1, 0x0201);
+#if (CONFIG_NUM_DDR_CONTROLLERS = 2)
+   setbits_be32(plldadcr2, 0x0201);
+#if (CONFIG_NUM_DDR_CONTROLLERS = 3)
+   setbits_be32(plldadcr3, 0x0201);
+#endif
+#endif
+   setbits_be32(dpdovrcr4, 0xe000);
+   out_be32(plldgdcr1, 0x0801 | (ddr_pll_ratio  1));
+#if (CONFIG_NUM_DDR_CONTROLLERS = 2)
+   out_be32(plldgdcr2, 0x0801 | (ddr_pll_ratio  1));
+#if (CONFIG_NUM_DDR_CONTROLLERS = 3)
+   out_be32(plldgdcr3, 0x0801 | (ddr_pll_ratio  1));
+#endif
+#endif
+   udelay(100);
+   clrbits_be32(plldadcr1, 0x0201);
+#if (CONFIG_NUM_DDR_CONTROLLERS = 2)
+   clrbits_be32(plldadcr2, 0x0201);
+#if (CONFIG_NUM_DDR_CONTROLLERS = 3)
+