[U-Boot] [PATCH] doc: README.SPL: adjust for Kbuild and Kconfig

2014-08-05 Thread Masahiro Yamada
Reflect the latest build system to doc/README.SPL.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 doc/README.SPL | 28 ++--
 1 file changed, 6 insertions(+), 22 deletions(-)

diff --git a/doc/README.SPL b/doc/README.SPL
index 2b4b0b8..c283dcf 100644
--- a/doc/README.SPL
+++ b/doc/README.SPL
@@ -13,34 +13,29 @@ can be reused. No code duplication or symlinking is 
necessary anymore.
 How it works
 
 
-There is a new directory $(srctree)/spl which contains only a Makefile.
-The object files are built separately for SPL and placed in this directory.
+The object files for SPL are built separately and placed in the spl 
directory.
 The final binaries which are generated are u-boot-spl, u-boot-spl.bin and
 u-boot-spl.map.
 
-During the SPL build a variable named CONFIG_SPL_BUILD is exported
-in the make environment and also appended to CPPFLAGS with -DCONFIG_SPL_BUILD.
+A config option named CONFIG_SPL_BUILD is enabled by Kconfig for SPL.
 Source files can therefore be compiled for SPL with different settings.
-ARM-based boards have previously used the option CONFIG_PRELOADER for it.
 
 For example:
 
 ifeq ($(CONFIG_SPL_BUILD),y)
-COBJS-y += board_spl.o
+obj-y += board_spl.o
 else
-COBJS-y += board.o
+obj-y += board.o
 endif
 
-COBJS-$(CONFIG_SPL_BUILD) += foo.o
+obj-$(CONFIG_SPL_BUILD) += foo.o
 
 #ifdef CONFIG_SPL_BUILD
foo();
 #endif
 
 
-The building of SPL images can be with:
-
-#define CONFIG_SPL 1
+The building of SPL images can be enabled by CONFIG_SPL option in Kconfig.
 
 Because SPL images normally have a different text base, one has to be
 configured by defining CONFIG_SPL_TEXT_BASE. The linker script has to be
@@ -70,17 +65,6 @@ CONFIG_SPL_SPI_LOAD (drivers/mtd/spi/spi_spl_load.o)
 CONFIG_SPL_RAM_DEVICE (common/spl/spl.c)
 CONFIG_SPL_WATCHDOG_SUPPORT (drivers/watchdog/libwatchdog.o)
 
-Normally CPU is assumed to be the same between the SPL and normal
-u-boot build.  However it is possible to specify a different CPU for
-the SPL build for cases where the SPL is expected to run on a
-different CPU model from the main u-boot.  This is done by specifying
-an SPL CPU in boards.cfg as follows:
-
-   normal_cpu:spl_cpu
-
-This case CPU will be set to normal_cpu during the main u-boot
-build and spl_cpu during the SPL build.
-
 
 Debugging
 -
-- 
1.9.1

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


[U-Boot] [PATCH] doc: delete README.ARM-SoC

2014-08-05 Thread Masahiro Yamada
This document is too old and useless.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 doc/README.ARM-SoC | 31 ---
 1 file changed, 31 deletions(-)
 delete mode 100644 doc/README.ARM-SoC

diff --git a/doc/README.ARM-SoC b/doc/README.ARM-SoC
deleted file mode 100644
index d6bd624..000
--- a/doc/README.ARM-SoC
+++ /dev/null
@@ -1,31 +0,0 @@
-[By Steven Scholz steven.sch...@imc-berlin.de, 16 Aug 2004]
-
-Since the cpu/ directory gets clobbered with peripheral driver code I
-started cleaning up arch/arm/cpu/arm920t.
-
-I introduced the concept of Soc (system on a chip) into the ./cpu
-directory. That means that code that is cpu (i.e. core) specific
-resides in
-
-   $(CPUDIR)/
-
-and code that is specific to some SoC (i.e. vendor specific
-peripherals around the core) is moved into
-
-   $(CPUDIR)/$(SOC)/
-
-Thus a library/archive $(CPUDIR)/$(SOC)/lib$(SOC).a will be build
-and linked. Examples will be
-
-   arch/arm/cpu/arm920t/imx/
-   arch/arm/cpu/arm920t/s3c24x0
-
-One can select an SoC by passing the name of it to ./mkconfig just
-like
-
-   @./mkconfig $(@:_config=) arm arm920t vcma9 mpl s3c24x0
-
-If there's no VENDOR field (like mpl in the above line) one has to
-pass NULL instead:
-
-   @./mkconfig $(@:_config=) arm arm920t mx1ads NULL imx
-- 
1.9.1

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


Re: [U-Boot] [PATCH v2 02/16] sunxi: dram: Remove broken super-standby remnants

2014-08-05 Thread Ian Campbell
On Sun, 2014-08-03 at 05:32 +0300, Siarhei Siamashka wrote:
 If the dram-ppwrsctl (SDR_DPCR) register has the lowest bit set to 1,
 this means that DRAM is currently in self-refresh mode and retaining the
 old data. Since we have no idea what to do in this situation yet, just
 set this register to 0 and initialize DRAM in the same way as on any
 normal reboot (discarding whatever was stored there).
 
 This part of code was apparently used by the Allwinner boot0 bootloader
 to handle resume from the so-called super-standby mode. But this
 particular code got somehow mangled on the way from the boot0 bootloader
 to the u-boot-sunxi bootloader and has no chance of doing anything even
 remotely sane. For example:
 1. in the original boot0 code we had mctl_write_w(SDR_DPCR,
0x1651) (write to the register) and in the u-boot it now looks
like setbits_le32(dram-ppwrsctl, 0x1651) (set bits in the
register)
 2. in the original boot0 code it was issuing three commands 0x12, 0x17,
0x13 (Self-Refresh entry, Self-Refresh exit, Refresh), but in the
u-boot they have become 0x12, 0x12, 0x13 (Self-Refresh entry,
Self-Refresh entry, Refresh)
 
 Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


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


Re: [U-Boot] [PATCH v2 03/16] sunxi: dram: Respect the DDR3 reset timing requirements

2014-08-05 Thread Ian Campbell
On Sun, 2014-08-03 at 05:32 +0300, Siarhei Siamashka wrote:
 The RESET pin needs to be kept low for at least 200 us according
 to the DDR3 spec. So just do it the right way.
 
 This issue did not cause any visible major problems earlier, because
 the DRAM RESET pin is usually already low after the board reset. And
 the time gap before reaching the sunxi u-boot DRAM initialization
 code appeared to be sufficient.
 
 Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


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


Re: [U-Boot] [PATCH v2 04/16] sunxi: dram: Fix CKE delay handling for sun4i/sun5i

2014-08-05 Thread Ian Campbell
On Sun, 2014-08-03 at 05:32 +0300, Siarhei Siamashka wrote:
 Before driving the CKE pin (Clock Enable) high, the DDR3 spec requires
 to wait for additional 500 us after the RESET pin is de-asserted.
 
 The DRAM controller takes care of this delay by itself, using a
 configurable counter in the SDR_IDCR register. This works in the same
 way on sun4i/sun5i/sun7i hardware (even the default register value
 0x00c80064 is identical). Except that the counter is ticking a bit
 slower on sun7i (3 DRAM clock cycles instead of 2), resulting in
 longer actual delays for the same settings.
 
 This patch configures the SDR_IDCR register for all sun4i/sun5i/sun7i
 SoC variants and not just for sun7i alone. Also an explicit udelay(500)
 is added immediately after DDR3 reset for extra safety. This is a
 duplicated functionality. But since we don't have perfect documentation,
 it may be reasonable to play safe. Half a millisecond boot time increase
 is not that significant. Boot time can be always optimized later.
 Preferebly by the people, who have the hardware equipment to check the
 actual signals on the RESET and CKE lines and verify all the timings.
 
 The old code did not configure the SDR_IDCR register for sun4i/sun5i,
 but performed the DDR3 reset very early for sun4i/sun5i. This resulted
 in a larger time gap between the DDR3 reset and the DDR3 initialization
 steps and reduced the chances of CKE delay timing violation to cause
 real troubles.
 
 Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


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


Re: [U-Boot] [PATCH v2 05/16] sunxi: dram: Remove broken impedance and ODT configuration code

2014-08-05 Thread Ian Campbell
On Sun, 2014-08-03 at 05:32 +0300, Siarhei Siamashka wrote:
 We can safely remove it, because none of the currently supported
 boards uses these features.
 
 The existing implementation had multiple problems:
- unnecessary code duplication between sun4i/sun5i/sun7i
- ZQ calibration was never initiated explicitly, and could be
  only triggered by setting the highest bit in the 'zq' parameter
  in the 'dram_para' struct (this was never actually done for
  any of the known Allwinner devices).
- even if the ZQ calibration could be started, no attempts were
  made to wait for its completion, or checking whether the
  default automatically initiated ZQ calibration is still
  in progress
- ODT was only ever enabled on sun4i, but not on sun5i/sun7i
 
 Additionally, SDR_IOCR was set to 0x00cc only on sun4i. There
 are some hints in the Rockchip Linux kernel sources, indicating
 that these bits are related to the automatic I/O power down
 feature, which is poorly understood on sunxi hardware at the
 moment. Avoiding to set these bits on sun4i too does not seem to
 have any measurable/visible impact.
 
 The impedance and ODT configuration code will be re-introdeced in
 one of the next comits.
 
 Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


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


Re: [U-Boot] [PATCH v2 06/16] sunxi: dram: Do DDR3 reset in the same way on sun4i/sun5i/sun7i

2014-08-05 Thread Ian Campbell
On Sun, 2014-08-03 at 05:32 +0300, Siarhei Siamashka wrote:
 The older differences were likely justified by the need to mitigate
 the CKE delay timing violations on sun4i/sun5i. The CKE problem is
 already resolved, so now we can use the sun7i variant of this code
 everywhere.
 
 Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


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


Re: [U-Boot] [PATCH v2 07/16] sunxi: dram: Add 'await_bits_clear'/'await_bits_set' helper functions

2014-08-05 Thread Ian Campbell
On Sun, 2014-08-03 at 05:32 +0300, Siarhei Siamashka wrote:
 The old 'await_completion' function is not sufficient, because
 in some cases we want to wait for bits to be cleared, and in the
 other cases we want to wait for bits to be set. So split the
 'await_completion' into two new 'await_bits_clear' and
 'await_bits_set' functions.
 
 Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


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


Re: [U-Boot] [PATCH v2 08/16] sunxi: dram: Re-introduce the impedance calibration ond ODT

2014-08-05 Thread Ian Campbell
On Sun, 2014-08-03 at 05:32 +0300, Siarhei Siamashka wrote:
 The DRAM controller allows to configure impedance either by using the
 calibration against an external high precision 240 ohm resistor, or
 by skipping the calibration and loading pre-defined data. The DRAM
 controller register guide is available here:
 
 http://linux-sunxi.org/A10_DRAM_Controller_Register_Guide#SDR_ZQCR0
 
 The new code supports both of the impedance configuration modes:
- If the higher bits of the 'zq' parameter in the 'dram_para' struct
  are zero, then the lowest 8 bits are used as the ZPROG value, where
  two divisors encoded in lower and higher 4 bits. One divisor is
  used for calibrating the termination impedance, and another is used
  for the output impedance.
- If bits 27:8 in the 'zq' parameters are non-zero, then they are
  used as the pre-defined ZDATA value instead of performing the ZQ
  calibration.
 
 Two lowest bits in the 'odt_en' parameter enable ODT for the DQ and DQS
 lines individually. Enabling ODT for both DQ and DQS means that the
 'odt_en' parameter needs to be set to 3.
 
 Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


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


Re: [U-Boot] [PATCH v2 09/16] sunxi: dram: Configurable MBUS clock speed (use PLL5 or PLL6)

2014-08-05 Thread Ian Campbell
On Sun, 2014-08-03 at 05:32 +0300, Siarhei Siamashka wrote:
 The sun5i hardware (Allwinner A13) introduced configurable MBUS clock
 speed. Allwinner A13 uses only 16-bit data bus width to connect the
 external DRAM, which is halved compared to the 32-bit data bus of sun4i
 (Allwinner A10), so it does not make much sense to clock a wider
 internal bus at a very high speed. The Allwinner A13 manual specifies
 300 MHz MBUS clock speed limit and 533 MHz DRAM clock speed limit. Newer
 sun7i hardware (Allwinner A20) has a full width 32-bit external memory
 interface again, but still keeps the MBUS clock speed configurable.
 Clocking MBUS too low inhibits memory performance and one has to find
 the optimal MBUS/DRAM clock speed ratio, which may depend on many
 factors:
 http://linux-sunxi.org/A10_DRAM_Controller_Performance
 
 This patch introduces a new 'mbus_clock' parameter for the 'dram_para'
 struct and uses it as a desired MBUS clock speed target. If 'mbus_clock'
 is not set, 300 MHz is used by default to match the older hardcoded
 settings.
 
 PLL5P and PLL6 are both evaluated as possible clock sources. Preferring
 the one, which can provide higher clock frequency that is lower or
 equal to the 'mbus_clock' target. In the case of a tie, PLL5P has
 higher priority.
 
 Attempting to set the MBUS clock speed has no effect on sun4i, but does
 no harm either.
 
 Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


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


Re: [U-Boot] [PATCH v2 12/16] sunxi: dram: Add a helper function 'mctl_get_number_of_lanes'

2014-08-05 Thread Ian Campbell
On Sun, 2014-08-03 at 05:32 +0300, Siarhei Siamashka wrote:
 It is going to be useful in more than one place.
 
 Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


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


Re: [U-Boot] [PATCH v2 13/16] sunxi: dram: Configurable DQS gating window mode and delay

2014-08-05 Thread Ian Campbell
On Sun, 2014-08-03 at 05:32 +0300, Siarhei Siamashka wrote:
 The hardware DQS gate training is a bit unreliable and does not
 always find the best delay settings.
 
 So we introduce a 32-bit 'dqs_gating_delay' variable, where each
 byte encodes the DQS gating delay for each byte lane. The delay
 granularity is 1/4 cycle.
 
 Also we allow to enable the active DQS gating window mode, which
 works better than the passive mode in practice. The DDR3 spec
 says that there is a 0.9 cycles preamble and 0.3 cycle postamble.
 The DQS window has to be opened during preamble and closed during
 postamble. In the passive window mode, the gating window is opened
 and closed by just using the gating delay settings. And because
 of the 1/4 cycle delay granularity, accurately hitting the 0.3
 cycle long postamble is a bit tough. In the active window mode,
 the gating window is auto-closing with the help of monitoring
 the DQS line, which relaxes the gating delay accuracy requirements.
 
 But the hardware DQS gate training is still performed in the passive
 window mode. It is a more strict test, which is reducing the results
 variance compared to the training with active window mode.
 
 Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


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


Re: [U-Boot] [PATCH v2 14/16] sunxi: dram: Drop DDR2 support and assume only single rank DDR3 memory

2014-08-05 Thread Ian Campbell
On Sun, 2014-08-03 at 05:32 +0300, Siarhei Siamashka wrote:
 All the known Allwinner A10/A13/A20 devices are using just single rank
 DDR3 memory. So don't pretend that we support DDR2 or more than one
 rank, because nobody could ever test these configurations for real and
 they are likely broken. Support for these features can be added back
 in the case if such hardware actually exists.
 
 As part of this code cleanup, also replace division by 1024 with
 division by 1000 for the refresh timing calculations. This allows
 to use the original non-skewed tRFC timing table from the DRR3 spec
 and make code less confusing.
 
 Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


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


[U-Boot] [PATCH 3/3] scripts: objdiff: sync with Linux 3.16

2014-08-05 Thread Masahiro Yamada
Import scripts/objdiff improvements from Linux v3.16, which
consists of 7 commits written by me.

  commit 7fa0e6db3cedc9b70d68a4170f1352e2b1aa0f90
  scripts: objdiff: support directories for the augument of record command

  commit 8ac28bee76eec006aac5ba5c418878a607d53a9b
  scripts: objdiff: fix a comment

  commit 8b5d0f20d64f00ffd5685879f8eb3659379f5aaa
  scripts: objdiff: change the extension of disassembly from .o to .dis

  commit 18165efa8203a34d82f60a1831ea290e7304c654
  scripts: objdiff: improve path flexibility for record command

  commit 1ecc8e489abfdaa6d8d1689f7ff62fdf1adda30c
  scripts: objdiff: remove unnecessary code

  commit 5ab370e91af70d5f1b1dbaec78798a2ff236a2d5
  scripts: objdiff: direct error messages to stderr

  commit fd6e12423311697860f30d10398a0f9eb91977d2
  scripts: objdiff: get the path to .tmp_objdiff more simply

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 scripts/objdiff | 74 +++--
 1 file changed, 46 insertions(+), 28 deletions(-)

diff --git a/scripts/objdiff b/scripts/objdiff
index b3e4f10..62e51da 100755
--- a/scripts/objdiff
+++ b/scripts/objdiff
@@ -25,25 +25,47 @@
 #
 # Note: 'make mrproper' will also remove .tmp_objdiff
 
-GIT_DIR=`git rev-parse --git-dir`
+SRCTREE=$(cd $(git rev-parse --show-toplevel 2/dev/null); pwd)
 
-if [ -d $GIT_DIR ]; then
-   TMPD=${GIT_DIR%git}tmp_objdiff
-
-   [ -d $TMPD ] || mkdir $TMPD
-else
-   echo ERROR: git directory not found.
+if [ -z $SRCTREE ]; then
+   echo 2 ERROR: Not a git repository.
exit 1
 fi
 
+TMPD=$SRCTREE/.tmp_objdiff
+
 usage() {
-   echo Usage: $0 command args
-   echo   recordlist of object files
-   echo   diff  commitA commitB
-   echo   clean all | commit
+   echo 2 Usage: $0 command args
+   echo 2   recordlist of object files or directories
+   echo 2   diff  commitA commitB
+   echo 2   clean all | commit
exit 1
 }
 
+get_output_dir() {
+   dir=${1%/*}
+
+   if [ $dir = $1 ]; then
+   dir=.
+   fi
+
+   dir=$(cd $dir; pwd)
+
+   echo $TMPD/$CMT${dir#$SRCTREE}
+}
+
+do_objdump() {
+   dir=$(get_output_dir $1)
+   base=${1##*/}
+   dis=$dir/${base%.o}.dis
+
+   [ ! -d $dir ]  mkdir -p $dir
+
+   # remove addresses for a cleaner diff
+   # 
http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and
+   $OBJDUMP -D $1 | sed s/^[[:space:]]\+[0-9a-f]\+//  $dis
+}
+
 dorecord() {
[ $# -eq 0 ]  usage
 
@@ -52,20 +74,16 @@ dorecord() {
CMT=`git rev-parse --short HEAD`
 
OBJDUMP=${CROSS_COMPILE}objdump
-   OBJDIFFD=$TMPD/$CMT
-
-   [ ! -d $OBJDIFFD ]  mkdir -p $OBJDIFFD
 
-   for f in $FILES; do
-   dn=${f%/*}
-   bn=${f##*/}
-
-   [ ! -d $OBJDIFFD/$dn ]  mkdir -p $OBJDIFFD/$dn
-
-   # remove addresses for a more clear diff
-   # 
http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and
-   $OBJDUMP -D $f | sed s/^[[:space:]]\+[0-9a-f]\+// \
-   $OBJDIFFD/$dn/$bn
+   for d in $FILES; do
+   if [ -d $d ]; then
+   for f in $(find $d -name '*.o')
+   do
+   do_objdump $f
+   done
+   else
+   do_objdump $d
+   fi
done
 }
 
@@ -90,12 +108,12 @@ dodiff() {
DSTD=$TMPD/$DST
 
if [ ! -d $SRCD ]; then
-   echo ERROR: $SRCD doesn't exist
+   echo 2 ERROR: $SRCD doesn't exist
exit 1
fi
 
if [ ! -d $DSTD ]; then
-   echo ERROR: $DSTD doesn't exist
+   echo 2 ERROR: $DSTD doesn't exist
exit 1
fi
 
@@ -114,7 +132,7 @@ doclean() {
if [ -d $TMPD/$CMT ]; then
rm -rf $TMPD/$CMT
else
-   echo $CMT not found
+   echo 2 $CMT not found
fi
fi
 }
@@ -135,7 +153,7 @@ case $1 in
doclean $*
;;
*)
-   echo Unrecognized command '$1'
+   echo 2 Unrecognized command '$1'
exit 1
;;
 esac
-- 
1.9.1

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


[U-Boot] [PATCH 0/3] Kbuild: sync with Linux 3.16

2014-08-05 Thread Masahiro Yamada
Linux 3.16 is out now.

This series imports various Kbuild-related updates from Linux 3.16.

I am resending the same series which was put off before.

See the reply from Tom Rini
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/188802/focus=189010



Masahiro Yamada (3):
  kbuild: move extra gcc checks to scripts/Makefile.extrawarn
  kbuild: sync mixed targets handling with Linux 3.16
  scripts: objdiff: sync with Linux 3.16

 Makefile   | 12 
 scripts/Makefile.build | 61 --
 scripts/Makefile.extrawarn | 67 +
 scripts/mkmakefile | 15 +++---
 scripts/objdiff| 74 --
 5 files changed, 122 insertions(+), 107 deletions(-)
 create mode 100644 scripts/Makefile.extrawarn

-- 
1.9.1

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


[U-Boot] [PATCH 2/3] kbuild: sync mixed targets handling with Linux 3.16

2014-08-05 Thread Masahiro Yamada
make %_config all was supported for the first time in U-Boot:
  commit 53bca5ab
  kbuild: support simultaneous board configuration and make all

Surprisingly it had not been working in Linux Kernel for a long time.

So I sent back the patch to the Linux Kbuild community and it was
accepted with a little code improvement, at commit 9319f453.

Now, you can do make defconfig all or make %_defconfig all
in Linux too.

This commit updates some scripts to fill the code-diff
between Linux and U-Boot.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile   |  6 +++---
 scripts/mkmakefile | 15 ---
 2 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index e772c1c..dd07550 100644
--- a/Makefile
+++ b/Makefile
@@ -437,12 +437,12 @@ ifeq ($(mixed-targets),1)
 # We're called with mixed targets (*config and build targets).
 # Handle them one by one.
 
-PHONY += $(MAKECMDGOALS) build-one-by-one
+PHONY += $(MAKECMDGOALS) __build_one_by_one
 
-$(MAKECMDGOALS): build-one-by-one
+$(filter-out __build_one_by_one, $(MAKECMDGOALS)): __build_one_by_one
@:
 
-build-one-by-one:
+__build_one_by_one:
$(Q)set -e; \
for i in $(MAKECMDGOALS); do \
$(MAKE) -f $(srctree)/Makefile $$i; \
diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index 0cc0442..84af27b 100644
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
@@ -42,18 +42,11 @@ MAKEARGS += O=\$(if \$(patsubst 
/%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$
 
 MAKEFLAGS += --no-print-directory
 
-.PHONY: all \$(MAKECMDGOALS)
+.PHONY: __sub-make \$(MAKECMDGOALS)
 
-all:= \$(filter-out all Makefile,\$(MAKECMDGOALS))
+__sub-make:
+   \$(Q)\$(MAKE) \$(MAKEARGS) \$(MAKECMDGOALS)
 
-all:
-   \$(Q)\$(MAKE) \$(MAKEARGS) \$(all)
-
-Makefile:;
-
-\$(all): all
-   @:
-
-%/: all
+\$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make
@:
 EOF
-- 
1.9.1

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


[U-Boot] [PATCH 1/3] kbuild: move extra gcc checks to scripts/Makefile.extrawarn

2014-08-05 Thread Masahiro Yamada
This commit was imported from Linux Kernel:
commit a86fe353 written by me.

W=... provides extra gcc checks.

Having such code in scripts/Makefile.build results in the same flags
being added to KBUILD_CFLAGS multiple times becuase
scripts/Makefile.build is invoked every time Kbuild descends into
the subdirectories.

Since the top Makefile is already too cluttered, this commit moves
all of extra gcc check stuff to a new file scripts/Makefile.extrawarn,
which is included from the top Makefile.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile   |  6 ++---
 scripts/Makefile.build | 61 -
 scripts/Makefile.extrawarn | 67 ++
 3 files changed, 69 insertions(+), 65 deletions(-)
 create mode 100644 scripts/Makefile.extrawarn

diff --git a/Makefile b/Makefile
index 5e49545..e772c1c 100644
--- a/Makefile
+++ b/Makefile
@@ -109,10 +109,6 @@ ifeq ($(origin O), command line)
   KBUILD_OUTPUT := $(O)
 endif
 
-ifeq ($(origin W), command line)
-  export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W)
-endif
-
 # That's our default target when none is given on the command line
 PHONY := _all
 _all:
@@ -569,6 +565,8 @@ endif
 
 export CONFIG_SYS_TEXT_BASE
 
+include $(srctree)/scripts/Makefile.extrawarn
+
 # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
 KBUILD_CPPFLAGS += $(KCPPFLAGS)
 KBUILD_AFLAGS += $(KAFLAGS)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index baeaabe..6742ddd 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -66,67 +66,6 @@ ifeq ($(KBUILD_NOPEDANTIC),)
 endif
 endif
 
-#
-# make W=... settings
-#
-# W=1 - warnings that may be relevant and does not occur too often
-# W=2 - warnings that occur quite often but may still be relevant
-# W=3 - the more obscure warnings, can most likely be ignored
-#
-# $(call cc-option, -W...) handles gcc -W.. options which
-# are not supported by all versions of the compiler
-ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS
-warning-  := $(empty)
-
-warning-1 := -Wextra -Wunused -Wno-unused-parameter
-warning-1 += -Wmissing-declarations
-warning-1 += -Wmissing-format-attribute
-warning-1 += $(call cc-option, -Wmissing-prototypes)
-warning-1 += -Wold-style-definition
-warning-1 += $(call cc-option, -Wmissing-include-dirs)
-warning-1 += $(call cc-option, -Wunused-but-set-variable)
-warning-1 += $(call cc-disable-warning, missing-field-initializers)
-
-# Clang
-warning-1 += $(call cc-disable-warning, initializer-overrides)
-warning-1 += $(call cc-disable-warning, unused-value)
-warning-1 += $(call cc-disable-warning, format)
-warning-1 += $(call cc-disable-warning, unknown-warning-option)
-warning-1 += $(call cc-disable-warning, sign-compare)
-warning-1 += $(call cc-disable-warning, format-zero-length)
-warning-1 += $(call cc-disable-warning, uninitialized)
-warning-1 += $(call cc-option, -fcatch-undefined-behavior)
-
-warning-2 := -Waggregate-return
-warning-2 += -Wcast-align
-warning-2 += -Wdisabled-optimization
-warning-2 += -Wnested-externs
-warning-2 += -Wshadow
-warning-2 += $(call cc-option, -Wlogical-op)
-warning-2 += $(call cc-option, -Wmissing-field-initializers)
-
-warning-3 := -Wbad-function-cast
-warning-3 += -Wcast-qual
-warning-3 += -Wconversion
-warning-3 += -Wpacked
-warning-3 += -Wpadded
-warning-3 += -Wpointer-arith
-warning-3 += -Wredundant-decls
-warning-3 += -Wswitch-default
-warning-3 += $(call cc-option, -Wpacked-bitfield-compat)
-warning-3 += $(call cc-option, -Wvla)
-
-warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
-warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
-warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
-
-ifeq ($(strip $(warning)),)
-$(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown)
-endif
-
-KBUILD_CFLAGS += $(warning)
-endif
-
 include scripts/Makefile.lib
 
 ifdef host-progs
diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
new file mode 100644
index 000..6564350
--- /dev/null
+++ b/scripts/Makefile.extrawarn
@@ -0,0 +1,67 @@
+# ==
+#
+# make W=... settings
+#
+# W=1 - warnings that may be relevant and does not occur too often
+# W=2 - warnings that occur quite often but may still be relevant
+# W=3 - the more obscure warnings, can most likely be ignored
+#
+# $(call cc-option, -W...) handles gcc -W.. options which
+# are not supported by all versions of the compiler
+# ==
+
+ifeq ($(origin W), command line)
+  export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W)
+endif
+
+ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS
+warning-  := $(empty)
+
+warning-1 := -Wextra -Wunused -Wno-unused-parameter
+warning-1 += -Wmissing-declarations
+warning-1 += -Wmissing-format-attribute
+warning-1 += $(call cc-option, -Wmissing-prototypes)

Re: [U-Boot] [PATCH v2 00/16] sunxi: Allwinner A10/A13/A20 DRAM controller fixes

2014-08-05 Thread Ian Campbell
On Sun, 2014-08-03 at 05:32 +0300, Siarhei Siamashka wrote:
 This is version 2 of
 http://lists.denx.de/pipermail/u-boot/2014-July/183981.html
 
 Rebased on git://git.denx.de/u-boot-sunxi.git master branch (commit
 3340eab26d89176dd0bf543e6d2590665c577423 sun7i: Add bananapi board)

This all looks great, thanks!

I think this should be the primary subject of the next sunxi PR. A
change of this magnitude really ought to be in an rc1 so hopefully there
won't be any significant changes required (it doesn't look like there
should be to me).

I'm AFK from tomorrow until after when I expect rc1 to be so I'm not
around to prepare a PR -- Hans can you take care of it (if you agree
with my assessment of the patches, of course)? I've delegated them to
you in pw in anticipation.

Cheers,
Ian.

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


Re: [U-Boot] [PATCH 6/7] sunxi: Kconfig: move common settings into a shared code block

2014-08-05 Thread Ian Campbell
On Tue, 2014-08-05 at 09:24 +0800, Chen-Yu Tsai wrote:
 On Tue, Aug 5, 2014 at 5:26 AM, Ian Campbell i...@hellion.org.uk wrote:
  On Fri, 2014-08-01 at 09:46 +0200, Hans de Goede wrote:
  SYS_CPU, SYS_BOARD and SYS_SOC are identical for all sunxi boards, move
  them to a shared code block.
 
  Signed-off-by: Hans de Goede hdego...@redhat.com
 
  This is an improvement so:
  Acked-by: Ian Campbell i...@hellion.org.uk
 
  But eventually we could clean up even more, e.g.
 
  config SYS_CONFIG_NAME
  string
  default sun4i if TARGET_SUN4I
  default sun5i if TARGET_SUN5I
  etc
 
  Possibly even some things should be select'd rather than default'd.
 
 Selected sounds better. :)

The main thing I know about select is that one needs to be very careful
about when it is used, since it can have odd side effects

Ian.

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


[U-Boot] [PATCH v2 08/25] arm: marvell: Move arch-kirkwood/spi.h to arch-mvebu/spi.h

2014-08-05 Thread Stefan Roese
This move makes it possible to use this kirkwood SPI driver from other
MVEBU platforms as well. This will be used by the upcoming Armada XP
support.

Signed-off-by: Stefan Roese s...@denx.de
---

Changes in v2: None

 arch/arm/include/asm/{arch-kirkwood = arch-mvebu}/spi.h | 0
 drivers/spi/kirkwood_spi.c   | 2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename arch/arm/include/asm/{arch-kirkwood = arch-mvebu}/spi.h (100%)

diff --git a/arch/arm/include/asm/arch-kirkwood/spi.h 
b/arch/arm/include/asm/arch-mvebu/spi.h
similarity index 100%
rename from arch/arm/include/asm/arch-kirkwood/spi.h
rename to arch/arm/include/asm/arch-mvebu/spi.h
diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c
index de0e914..9710f12 100644
--- a/drivers/spi/kirkwood_spi.c
+++ b/drivers/spi/kirkwood_spi.c
@@ -13,8 +13,8 @@
 #include spi.h
 #include asm/io.h
 #include asm/arch/soc.h
-#include asm/arch/spi.h
 #include asm/arch/mpp.h
+#include asm/arch-mvebu/spi.h
 
 static struct kwspi_registers *spireg = (struct kwspi_registers *)KW_SPI_BASE;
 
-- 
2.0.4

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


[U-Boot] [PATCH v2 03/25] spi: kirkwood_spi.c: Some fixes and cleanup

2014-08-05 Thread Stefan Roese
This patch introduces the clrsetbits_le32() accessor functions in the
kirkwood SPI driver. Note that it also includes a fix:

-writel(~KWSPI_CSN_ACT | KWSPI_SMEMRDY, spireg-ctrl);
+writel(KWSPI_SMEMRDY, spireg-ctrl);

Here the bit KWSPI_CSN_ACT (0x1) should have been cleared. Instead
0xfffe is written into this control register. This is the main
reason to use the clrsetbits() functions now. As they make clearing
bits much less error prone.

Additionally KWSPI_IRQUNMASK is not used in spi_cs_activate() and
spi_cs_deactivate() any more. Its the wrong macro but has the same
value as the correct one (KWSPI_CSN_ACT).

This is in preparation for use of this driver on the Marvell Armada XP
platform as well.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---

Changes in v2: None

 drivers/spi/kirkwood_spi.c | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c
index 942a208..449e9f8 100644
--- a/drivers/spi/kirkwood_spi.c
+++ b/drivers/spi/kirkwood_spi.c
@@ -37,7 +37,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned 
int cs,
if (!slave)
return NULL;
 
-   writel(~KWSPI_CSN_ACT | KWSPI_SMEMRDY, spireg-ctrl);
+   writel(KWSPI_SMEMRDY, spireg-ctrl);
 
/* calculate spi clock prescaller using max_hz */
data = ((CONFIG_SYS_TCLK / 2) / max_hz) + 0x10;
@@ -137,12 +137,12 @@ void spi_init(void)
 
 void spi_cs_activate(struct spi_slave *slave)
 {
-   writel(readl(spireg-ctrl) | KWSPI_IRQUNMASK, spireg-ctrl);
+   setbits_le32(spireg-ctrl, KWSPI_CSN_ACT);
 }
 
 void spi_cs_deactivate(struct spi_slave *slave)
 {
-   writel(readl(spireg-ctrl)  KWSPI_IRQMASK, spireg-ctrl);
+   clrbits_le32(spireg-ctrl, KWSPI_CSN_ACT);
 }
 
 int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
@@ -161,8 +161,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, 
const void *dout,
 * handle data in 8-bit chunks
 * TBD: 2byte xfer mode to be enabled
 */
-   writel(((readl(spireg-cfg)  ~KWSPI_XFERLEN_MASK) |
-   KWSPI_XFERLEN_1BYTE), spireg-cfg);
+   clrsetbits_le32(spireg-cfg, KWSPI_XFERLEN_MASK, KWSPI_XFERLEN_1BYTE);
 
while (bitlen  4) {
debug(loopstart bitlen %d\n, bitlen);
@@ -172,7 +171,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, 
const void *dout,
if (dout)
tmpdout = *(u32 *) dout  0x0ff;
 
-   writel(~KWSPI_SMEMRDIRQ, spireg-irq_cause);
+   clrbits_le32(spireg-irq_cause, KWSPI_SMEMRDIRQ);
writel(tmpdout, spireg-dout); /* Write the data out */
debug(*** spi_xfer: ... %08x written, bitlen %d\n,
  tmpdout, bitlen);
-- 
2.0.4

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


[U-Boot] [PATCH v2 0/25] Add Marvell Armada XP MV78460 SoC support

2014-08-05 Thread Stefan Roese

This patch series adds support for the Marvell Armada XP SoC's. Specifically
the MV78460.

Basic support for the db-78460-bp evaluation board is added. Supporting the
following interfaces:
- UART
- SPI (including SPI NOR flash)
- I2C
- Ethernet (neta)

While doing this port, I tried to consolidate common Marvell code into
the arch/arm/mvebu-common directory. This directory should be used to
collect more common code for the MVEBU SoC's (Dove, Kirkwood, Armada 370,
Armada 380, Armada XP). I started with Kirkwood and some of its
interfaces. Dove is definitely a candidate to move some of its code
into thise directory as well.

Because of the renaming of some functions from kirkwood to mvebu (to make
them better usable on other MVEBU SoCs), this patch series not only
touches the ARM SoC specific files (in arch/arm/...). But also some
device drivers (e.g. SPI, I2C). Separating these driver specific patches
into different patches that are not depending on this ARM patch series
seems hard if not impossible. Thats why I would really like to get this
patch series to get  applied completely be one custodian. Not sure if
this could / should go through Tom directly? Only if all the subsystem
custodians have given their Acked-by ... of course.

Testing on Kirkwood based boards would be greatly appreciated. So anyone with
access to some of those board, please give this patch series a try. I really
hope that I didn't break anything while merging some of the code into the
common mvebu directory.

Please note that this Armada XP port still requires the Binary Header
(bin_hdr) from the Marvell U-Boot tree to be included as a binary blob
into the resulting image (u-boot.kwb) that can be booted by the MVEBU
BootROM. This binary bin_hdr is usually responsible for the DDR3
controller configuration and the DDR3 training. One way to extract this
bin_hdr binary from an existing Marvell boot image right now is to use
the kwbimage tool from Barebox. Please refer to the documentation
thats available there for more details.

Thanks,
Stefan

Changes in v2:
- Fixed issue in mbus_dt_setup_win() to also assign remappable windows
- Made mbus_dt_setup_win() non-static, so that it can be called from
  other files for board specific mbus window configuration
- Renamed target from db-78460-bp to db-mv784mp-gp as this matches
  the real eval board name
- Added optional '-a' parameter to use the timings for Armada XP, as they
  are incompatibel with the currently used ones for Kirkwood (etc).
- Rebased on latest U-Boot version already including the Kconfig
  support switch.
- Removed patch [PATCH v1 21/25] arm: kirkwood: Use mvebu new common mbus API
  as this breaks Kirkwood booting. This needs to be resolved at some time,
  but I don't have access to a Kirkwood based board with JTAG BDI access to
  debug it right now. Till somebody fixes this issue, lets just remove
  it from this series for now.
- Added basic support for the maxBCM MV78460 based board

Stefan Roese (25):
  sf: Add M25PX64 SPI NOR flash ID
  arm: kirkwood: spi.h: Add some missing parenthesis
  spi: kirkwood_spi.c: Some fixes and cleanup
  spi: kirkwood_spi.c: Make global variable static
  spi: kirkwood_spi.c: cosmetic: Fix minor coding style issues
  arm: kirkwood: Move some SoC files into new arch/arm/mvebu-common
  arm: marvell: Move arch/kirkwood.h to arch/soc.h
  arm: marvell: Move arch-kirkwood/spi.h to arch-mvebu/spi.h
  arm: marvell: Rework timer.c to make it usable for other MVEBU
platforms
  arm: mvebu: Add common mbus functions to use on Marvell SoCs
  spi: kirkwood_spi.c: Compile MPP (pin-mux) only for kirkwood SoC's
  arm: marvell: Extract kirkwood gpio functions into new common file
gpio.c
  spi: kirkwood_spi.c: Change KW_SPI_BASE to MVEBU_SPI_BASE
  arm: kirkwood: Change naming of dram functions from km_foo() to
mvebu_foo()
  net: mvneta.c: Add support for the ethernet controller of the Marvell
Armada XP SoC
  net: phy.h: Make PHY autonegotiation timeout configurable
  i2c: mvtwsi: Add support for Marvell Armada XP
  arm: armada-xp: Add basic support for Marvell Armada XP SoC
  arm: armada-xp: Add basic support for the Marvell DB-MV784MP-GP board
  arm: armada-xp: Add basic support for the maxBCM board
  arm: kirkwood: Remove some dead code from cpu.c
  tools/kwboot: Sync with latest barebox version to support Armada XP
  tools: Compile kwboot for Marvell Armada XP as those SoCs are now
supported
  tools: kwbimage: Add image version 1 support for Armada XP / 370
  Makefile: Add CONFIG_BUILD_TARGET to automatically build an special
image

 Makefile   |9 +
 README |8 +
 arch/arm/Kconfig   |8 +
 arch/arm/cpu/arm926ejs/kirkwood/Makefile   |4 +-
 arch/arm/cpu/arm926ejs/kirkwood/cpu.c  |   74 +-
 arch/arm/cpu/arm926ejs/kirkwood/mpp.c  |2 +-
 arch/arm/cpu/armv7/armada-xp/Makefile  

[U-Boot] [PATCH v2 06/25] arm: kirkwood: Move some SoC files into new arch/arm/mvebu-common

2014-08-05 Thread Stefan Roese
By moving some kirkwood files into a Marvell common directory, those files
can be used by other Marvell platforms as well. The name mvebu is taken
from the Linux kernel source tree. It has been chosen there to represent
the SoC's from the Marvell EBU (Engineering Business Unit). Those SoC's
currently are:

Armada 370/375/XP, Dove, mv78xx0, Kirkwood, Orion5x

This will be used by the upcoming Armada XP (MV78460) platform support.

Signed-off-by: Stefan Roese s...@denx.de
---

Changes in v2: None

 Makefile  |  4 
 arch/arm/cpu/arm926ejs/kirkwood/Makefile  |  4 +---
 arch/arm/mvebu-common/Makefile| 10 ++
 arch/arm/{cpu/arm926ejs/kirkwood = mvebu-common}/dram.c  |  8 +++-
 arch/arm/{cpu/arm926ejs/kirkwood = mvebu-common}/timer.c |  0
 5 files changed, 22 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/mvebu-common/Makefile
 rename arch/arm/{cpu/arm926ejs/kirkwood = mvebu-common}/dram.c (91%)
 rename arch/arm/{cpu/arm926ejs/kirkwood = mvebu-common}/timer.c (100%)

diff --git a/Makefile b/Makefile
index 5e49545..88e685a 100644
--- a/Makefile
+++ b/Makefile
@@ -653,6 +653,10 @@ ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs 
vf610))
 libs-y += arch/$(ARCH)/imx-common/
 endif
 
+ifneq (,$(filter $(SOC), kirkwood))
+libs-y += arch/$(ARCH)/mvebu-common/
+endif
+
 libs-$(CONFIG_ARM) += arch/arm/cpu/
 libs-$(CONFIG_PPC) += arch/powerpc/cpu/
 
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/Makefile 
b/arch/arm/cpu/arm926ejs/kirkwood/Makefile
index c230ce8..df4756e 100644
--- a/arch/arm/cpu/arm926ejs/kirkwood/Makefile
+++ b/arch/arm/cpu/arm926ejs/kirkwood/Makefile
@@ -7,7 +7,5 @@
 #
 
 obj-y  = cpu.o
-obj-y  += dram.o
-obj-y  += mpp.o
-obj-y  += timer.o
 obj-y  += cache.o
+obj-y  += mpp.o
diff --git a/arch/arm/mvebu-common/Makefile b/arch/arm/mvebu-common/Makefile
new file mode 100644
index 000..4d20d2c
--- /dev/null
+++ b/arch/arm/mvebu-common/Makefile
@@ -0,0 +1,10 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor www.marvell.com
+# Written-by: Prafulla Wadaskar prafu...@marvell.com
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y  = dram.o
+obj-y  += timer.o
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/dram.c 
b/arch/arm/mvebu-common/dram.c
similarity index 91%
rename from arch/arm/cpu/arm926ejs/kirkwood/dram.c
rename to arch/arm/mvebu-common/dram.c
index d73ae47..bb5989b 100644
--- a/arch/arm/cpu/arm926ejs/kirkwood/dram.c
+++ b/arch/arm/mvebu-common/dram.c
@@ -110,7 +110,13 @@ int dram_init(void)
if (gd-bd-bi_dram[i].start != gd-ram_size)
break;
 
-   gd-ram_size += gd-bd-bi_dram[i].size;
+   /*
+* Don't report more than 3GiB of SDRAM, otherwise there is no
+* address space left for the internal registers etc.
+*/
+   if ((gd-ram_size + gd-bd-bi_dram[i].size != 0) 
+   (gd-ram_size + gd-bd-bi_dram[i].size = (3  30)))
+   gd-ram_size += gd-bd-bi_dram[i].size;
 
}
 
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/timer.c 
b/arch/arm/mvebu-common/timer.c
similarity index 100%
rename from arch/arm/cpu/arm926ejs/kirkwood/timer.c
rename to arch/arm/mvebu-common/timer.c
-- 
2.0.4

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


[U-Boot] [PATCH v2 11/25] spi: kirkwood_spi.c: Compile MPP (pin-mux) only for kirkwood SoC's

2014-08-05 Thread Stefan Roese
Compile the pin multiplexing only on Kirkwood platforms. As the
Armada XP doesn't need it.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---

Changes in v2: None

 drivers/spi/kirkwood_spi.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c
index 9710f12..ce2ba96 100644
--- a/drivers/spi/kirkwood_spi.c
+++ b/drivers/spi/kirkwood_spi.c
@@ -13,22 +13,28 @@
 #include spi.h
 #include asm/io.h
 #include asm/arch/soc.h
+#ifdef CONFIG_KIRKWOOD
 #include asm/arch/mpp.h
+#endif
 #include asm/arch-mvebu/spi.h
 
 static struct kwspi_registers *spireg = (struct kwspi_registers *)KW_SPI_BASE;
 
+#ifdef CONFIG_KIRKWOOD
 static u32 cs_spi_mpp_back[2];
+#endif
 
 struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
unsigned int max_hz, unsigned int mode)
 {
struct spi_slave *slave;
u32 data;
+#ifdef CONFIG_KIRKWOOD
static const u32 kwspi_mpp_config[2][2] = {
{ MPP0_SPI_SCn, 0 }, /* if cs == 0 */
{ MPP7_SPI_SCn, 0 } /* if cs != 0 */
};
+#endif
 
if (!spi_cs_is_valid(bus, cs))
return NULL;
@@ -51,15 +57,19 @@ struct spi_slave *spi_setup_slave(unsigned int bus, 
unsigned int cs,
writel(KWSPI_SMEMRDIRQ, spireg-irq_cause);
writel(KWSPI_IRQMASK, spireg-irq_mask);
 
+#ifdef CONFIG_KIRKWOOD
/* program mpp registers to select  SPI_CSn */
kirkwood_mpp_conf(kwspi_mpp_config[cs ? 1 : 0], cs_spi_mpp_back);
+#endif
 
return slave;
 }
 
 void spi_free_slave(struct spi_slave *slave)
 {
+#ifdef CONFIG_KIRKWOOD
kirkwood_mpp_conf(cs_spi_mpp_back, NULL);
+#endif
free(slave);
 }
 
-- 
2.0.4

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


[U-Boot] [PATCH v2 04/25] spi: kirkwood_spi.c: Make global variable static

2014-08-05 Thread Stefan Roese
Signed-off-by: Stefan Roese s...@denx.de
Cc: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---

Changes in v2: None

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

diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c
index 449e9f8..7d1c1f9 100644
--- a/drivers/spi/kirkwood_spi.c
+++ b/drivers/spi/kirkwood_spi.c
@@ -18,7 +18,7 @@
 
 static struct kwspi_registers *spireg = (struct kwspi_registers *)KW_SPI_BASE;
 
-u32 cs_spi_mpp_back[2];
+static u32 cs_spi_mpp_back[2];
 
 struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
unsigned int max_hz, unsigned int mode)
-- 
2.0.4

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


[U-Boot] [PATCH v2 01/25] sf: Add M25PX64 SPI NOR flash ID

2014-08-05 Thread Stefan Roese
Add ID for this Numonix / STMicro chip.

Tested on Marvell DB-78460-BP board.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---

Changes in v2: None

 drivers/mtd/spi/sf_params.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi/sf_params.c b/drivers/mtd/spi/sf_params.c
index ac886fd..b8186e9 100644
--- a/drivers/mtd/spi/sf_params.c
+++ b/drivers/mtd/spi/sf_params.c
@@ -71,6 +71,7 @@ const struct spi_flash_params spi_flash_params_table[] = {
{M25P32, 0x202016, 0x0,   64 * 1024,64,   0,  
  0},
{M25P64, 0x202017, 0x0,   64 * 1024,   128,   0,  
  0},
{M25P128,0x202018, 0x0,  256 * 1024,64,   0,  
  0},
+   {M25PX64,0x207117, 0x0,   64 * 1024,   128,   0,  
SECT_4K},
{N25Q32, 0x20ba16, 0x0,   64 * 1024,64, RD_FULL,  
   WR_QPP | SECT_4K},
{N25Q32A,0x20bb16, 0x0,   64 * 1024,64, RD_FULL,  
   WR_QPP | SECT_4K},
{N25Q64, 0x20ba17, 0x0,   64 * 1024,   128, RD_FULL,  
   WR_QPP | SECT_4K},
-- 
2.0.4

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


[U-Boot] [PATCH v2 17/25] i2c: mvtwsi: Add support for Marvell Armada XP

2014-08-05 Thread Stefan Roese
To support the Armada XP SoC, we just need to include the correct header.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Heiko Schocher h...@denx.de
---

Changes in v2: None

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

diff --git a/drivers/i2c/mvtwsi.c b/drivers/i2c/mvtwsi.c
index a2deae6..9b2ca1e 100644
--- a/drivers/i2c/mvtwsi.c
+++ b/drivers/i2c/mvtwsi.c
@@ -20,7 +20,7 @@
 
 #if defined(CONFIG_ORION5X)
 #include asm/arch/orion5x.h
-#elif defined(CONFIG_KIRKWOOD)
+#elif (defined(CONFIG_KIRKWOOD) || defined(CONFIG_ARMADA_XP))
 #include asm/arch/soc.h
 #elif defined(CONFIG_SUNXI)
 #include asm/arch/i2c.h
-- 
2.0.4

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


[U-Boot] [PATCH v2 14/25] arm: kirkwood: Change naming of dram functions from km_foo() to mvebu_foo()

2014-08-05 Thread Stefan Roese
Additionally the SDRAM address decoding register address is not hard coded
in the C code any more. A define is introduced for this base address.

This makes is possible to use those gpio functions from other MVEBU SoC's
as well.

Signed-off-by: Stefan Roese s...@denx.de
---

Changes in v2: None

 arch/arm/include/asm/arch-kirkwood/cpu.h|  6 +--
 arch/arm/include/asm/arch-kirkwood/soc.h|  1 +
 arch/arm/mvebu-common/dram.c| 53 +
 board/LaCie/net2big_v2/net2big_v2.c |  2 +-
 board/LaCie/netspace_v2/netspace_v2.c   |  2 +-
 board/LaCie/wireless_space/wireless_space.c |  2 +-
 board/Marvell/dreamplug/dreamplug.c |  2 +-
 board/Marvell/guruplug/guruplug.c   |  2 +-
 board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c |  2 +-
 board/Marvell/openrd/openrd.c   |  2 +-
 board/Marvell/rd6281a/rd6281a.c |  2 +-
 board/Marvell/sheevaplug/sheevaplug.c   |  2 +-
 board/Seagate/dockstar/dockstar.c   |  2 +-
 board/Seagate/goflexhome/goflexhome.c   |  2 +-
 board/buffalo/lsxl/lsxl.c   |  2 +-
 board/cloudengines/pogo_e02/pogo_e02.c  |  2 +-
 board/d-link/dns325/dns325.c|  2 +-
 board/iomega/iconnect/iconnect.c|  2 +-
 board/karo/tk71/tk71.c  |  2 +-
 board/keymile/km_arm/km_arm.c   |  4 +-
 board/raidsonic/ib62x0/ib62x0.c |  2 +-
 21 files changed, 50 insertions(+), 48 deletions(-)

diff --git a/arch/arm/include/asm/arch-kirkwood/cpu.h 
b/arch/arm/include/asm/arch-kirkwood/cpu.h
index 5900a15..926d347 100644
--- a/arch/arm/include/asm/arch-kirkwood/cpu.h
+++ b/arch/arm/include/asm/arch-kirkwood/cpu.h
@@ -140,9 +140,9 @@ struct kwgpio_registers {
  * functions
  */
 unsigned char get_random_hex(void);
-unsigned int kw_sdram_bar(enum memory_bank bank);
-unsigned int kw_sdram_bs(enum memory_bank bank);
-void kw_sdram_size_adjust(enum memory_bank bank);
+unsigned int mvebu_sdram_bar(enum memory_bank bank);
+unsigned int mvebu_sdram_bs(enum memory_bank bank);
+void mvebu_sdram_size_adjust(enum memory_bank bank);
 int kw_config_adr_windows(void);
 void mvebu_config_gpio(unsigned int gpp0_oe_val, unsigned int gpp1_oe_val,
unsigned int gpp0_oe, unsigned int gpp1_oe);
diff --git a/arch/arm/include/asm/arch-kirkwood/soc.h 
b/arch/arm/include/asm/arch-kirkwood/soc.h
index 379ce13..75120b1 100644
--- a/arch/arm/include/asm/arch-kirkwood/soc.h
+++ b/arch/arm/include/asm/arch-kirkwood/soc.h
@@ -22,6 +22,7 @@
 #define KW_REG_UNDOC_0x1470(KW_REGISTER(0x1470))
 #define KW_REG_UNDOC_0x1478(KW_REGISTER(0x1478))
 
+#define MVEBU_SDRAM_BASE   (KW_REGISTER(0x1500))
 #define KW_TWSI_BASE   (KW_REGISTER(0x11000))
 #define KW_UART0_BASE  (KW_REGISTER(0x12000))
 #define KW_UART1_BASE  (KW_REGISTER(0x12100))
diff --git a/arch/arm/mvebu-common/dram.c b/arch/arm/mvebu-common/dram.c
index e468136..db18791 100644
--- a/arch/arm/mvebu-common/dram.c
+++ b/arch/arm/mvebu-common/dram.c
@@ -14,27 +14,27 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-struct kw_sdram_bank {
+struct sdram_bank {
u32 win_bar;
u32 win_sz;
 };
 
-struct kw_sdram_addr_dec {
-   struct kw_sdram_banksdram_bank[4];
+struct sdram_addr_dec {
+   struct sdram_bank sdram_bank[4];
 };
 
-#define KW_REG_CPUCS_WIN_ENABLE(1  0)
-#define KW_REG_CPUCS_WIN_WR_PROTECT(1  1)
-#define KW_REG_CPUCS_WIN_WIN0_CS(x)(((x)  0x3)  2)
-#define KW_REG_CPUCS_WIN_SIZE(x)   (((x)  0xff)  24)
+#define REG_CPUCS_WIN_ENABLE   (1  0)
+#define REG_CPUCS_WIN_WR_PROTECT   (1  1)
+#define REG_CPUCS_WIN_WIN0_CS(x)   (((x)  0x3)  2)
+#define REG_CPUCS_WIN_SIZE(x)  (((x)  0xff)  24)
 
 /*
- * kw_sdram_bar - reads SDRAM Base Address Register
+ * mvebu_sdram_bar - reads SDRAM Base Address Register
  */
-u32 kw_sdram_bar(enum memory_bank bank)
+u32 mvebu_sdram_bar(enum memory_bank bank)
 {
-   struct kw_sdram_addr_dec *base =
-   (struct kw_sdram_addr_dec *)KW_REGISTER(0x1500);
+   struct sdram_addr_dec *base =
+   (struct sdram_addr_dec *)MVEBU_SDRAM_BASE;
u32 result = 0;
u32 enable = 0x01  readl(base-sdram_bank[bank].win_sz);
 
@@ -46,31 +46,31 @@ u32 kw_sdram_bar(enum memory_bank bank)
 }
 
 /*
- * kw_sdram_bs_set - writes SDRAM Bank size
+ * mvebu_sdram_bs_set - writes SDRAM Bank size
  */
-static void kw_sdram_bs_set(enum memory_bank bank, u32 size)
+static void mvebu_sdram_bs_set(enum memory_bank bank, u32 size)
 {
-   struct kw_sdram_addr_dec *base =
-   (struct kw_sdram_addr_dec *)KW_REGISTER(0x1500);
+   struct sdram_addr_dec *base =
+   (struct sdram_addr_dec *)MVEBU_SDRAM_BASE;
/* Read current register value */
u32 reg = readl(base-sdram_bank[bank].win_sz);
 

[U-Boot] [PATCH v2 07/25] arm: marvell: Move arch/kirkwood.h to arch/soc.h

2014-08-05 Thread Stefan Roese
This move makes is possible to use this header not only from kirkwood
platforms but from all Marvell mvebu platforms.

Signed-off-by: Stefan Roese s...@denx.de
---

Changes in v2: None

 arch/arm/cpu/arm926ejs/kirkwood/cpu.c| 2 +-
 arch/arm/cpu/arm926ejs/kirkwood/mpp.c| 2 +-
 arch/arm/include/asm/arch-kirkwood/config.h  | 2 +-
 arch/arm/include/asm/arch-kirkwood/{kirkwood.h = soc.h} | 0
 arch/arm/mvebu-common/dram.c | 2 +-
 arch/arm/mvebu-common/timer.c| 2 +-
 board/LaCie/net2big_v2/net2big_v2.c  | 2 +-
 board/LaCie/netspace_v2/netspace_v2.c| 2 +-
 board/LaCie/wireless_space/wireless_space.c  | 2 +-
 board/Marvell/dreamplug/dreamplug.c  | 2 +-
 board/Marvell/guruplug/guruplug.c| 2 +-
 board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c  | 2 +-
 board/Marvell/openrd/openrd.c| 2 +-
 board/Marvell/rd6281a/rd6281a.c  | 2 +-
 board/Marvell/sheevaplug/sheevaplug.c| 2 +-
 board/Seagate/dockstar/dockstar.c| 2 +-
 board/Seagate/goflexhome/goflexhome.c| 2 +-
 board/buffalo/lsxl/lsxl.c| 2 +-
 board/cloudengines/pogo_e02/pogo_e02.c   | 2 +-
 board/d-link/dns325/dns325.c | 2 +-
 board/iomega/iconnect/iconnect.c | 2 +-
 board/karo/tk71/tk71.c   | 2 +-
 board/keymile/km_arm/km_arm.c| 2 +-
 board/raidsonic/ib62x0/ib62x0.c  | 2 +-
 drivers/block/mvsata_ide.c   | 2 +-
 drivers/gpio/kw_gpio.c   | 2 +-
 drivers/i2c/mvtwsi.c | 2 +-
 drivers/mtd/nand/kirkwood_nand.c | 2 +-
 drivers/net/mvgbe.c  | 2 +-
 drivers/rtc/mvrtc.h  | 2 +-
 drivers/spi/kirkwood_spi.c   | 2 +-
 drivers/usb/host/ehci-marvell.c  | 2 +-
 32 files changed, 31 insertions(+), 31 deletions(-)
 rename arch/arm/include/asm/arch-kirkwood/{kirkwood.h = soc.h} (100%)

diff --git a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c 
b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c
index da80240..c8f90ba 100644
--- a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c
+++ b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c
@@ -12,7 +12,7 @@
 #include u-boot/md5.h
 #include asm/io.h
 #include asm/arch/cpu.h
-#include asm/arch/kirkwood.h
+#include asm/arch/soc.h
 
 #define BUFLEN 16
 
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/mpp.c 
b/arch/arm/cpu/arm926ejs/kirkwood/mpp.c
index 0ba6f09..7222504 100644
--- a/arch/arm/cpu/arm926ejs/kirkwood/mpp.c
+++ b/arch/arm/cpu/arm926ejs/kirkwood/mpp.c
@@ -12,7 +12,7 @@
 #include common.h
 #include asm/io.h
 #include asm/arch/cpu.h
-#include asm/arch/kirkwood.h
+#include asm/arch/soc.h
 #include asm/arch/mpp.h
 
 static u32 kirkwood_variant(void)
diff --git a/arch/arm/include/asm/arch-kirkwood/config.h 
b/arch/arm/include/asm/arch-kirkwood/config.h
index f7bfa0e..ccc8e4e 100644
--- a/arch/arm/include/asm/arch-kirkwood/config.h
+++ b/arch/arm/include/asm/arch-kirkwood/config.h
@@ -23,7 +23,7 @@
 #error SOC Name not defined
 #endif /* CONFIG_KW88F6281 */
 
-#include asm/arch/kirkwood.h
+#include asm/arch/soc.h
 #define CONFIG_ARM926EJS   1   /* Basic Architecture */
 #define CONFIG_SYS_CACHELINE_SIZE  32
/* default Dcache Line length for kirkwood */
diff --git a/arch/arm/include/asm/arch-kirkwood/kirkwood.h 
b/arch/arm/include/asm/arch-kirkwood/soc.h
similarity index 100%
rename from arch/arm/include/asm/arch-kirkwood/kirkwood.h
rename to arch/arm/include/asm/arch-kirkwood/soc.h
diff --git a/arch/arm/mvebu-common/dram.c b/arch/arm/mvebu-common/dram.c
index bb5989b..e468136 100644
--- a/arch/arm/mvebu-common/dram.c
+++ b/arch/arm/mvebu-common/dram.c
@@ -10,7 +10,7 @@
 #include common.h
 #include asm/io.h
 #include asm/arch/cpu.h
-#include asm/arch/kirkwood.h
+#include asm/arch/soc.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/arch/arm/mvebu-common/timer.c b/arch/arm/mvebu-common/timer.c
index a08f4a1..b7aa645 100644
--- a/arch/arm/mvebu-common/timer.c
+++ b/arch/arm/mvebu-common/timer.c
@@ -7,7 +7,7 @@
 
 #include common.h
 #include asm/io.h
-#include asm/arch/kirkwood.h
+#include asm/arch/soc.h
 
 #define UBOOT_CNTR 0   /* counter to use for uboot timer */
 
diff --git a/board/LaCie/net2big_v2/net2big_v2.c 
b/board/LaCie/net2big_v2/net2big_v2.c
index 4c3a9ba..471db77 100644
--- a/board/LaCie/net2big_v2/net2big_v2.c
+++ b/board/LaCie/net2big_v2/net2big_v2.c
@@ -13,7 +13,7 @@
 #include command.h
 #include i2c.h
 #include asm/arch/cpu.h
-#include asm/arch/kirkwood.h
+#include asm/arch/soc.h
 

[U-Boot] [PATCH v2 05/25] spi: kirkwood_spi.c: cosmetic: Fix minor coding style issues

2014-08-05 Thread Stefan Roese
Signed-off-by: Stefan Roese s...@denx.de
Cc: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---

Changes in v2: None

 drivers/spi/kirkwood_spi.c | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c
index 7d1c1f9..3d58bcc 100644
--- a/drivers/spi/kirkwood_spi.c
+++ b/drivers/spi/kirkwood_spi.c
@@ -46,7 +46,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned 
int cs,
 
/* program spi clock prescaller using max_hz */
writel(KWSPI_ADRLEN_3BYTE | data, spireg-cfg);
-   debug(data = 0x%08x \n, data);
+   debug(data = 0x%08x\n, data);
 
writel(KWSPI_SMEMRDIRQ, spireg-irq_cause);
writel(KWSPI_IRQMASK, spireg-irq_mask);
@@ -100,7 +100,6 @@ int spi_claim_bus(struct spi_slave *slave)
 
/* set new spi mpp and save current mpp config */
kirkwood_mpp_conf(spi_mpp_config, spi_mpp_backup);
-
 #endif
 
return board_spi_claim_bus(slave);
@@ -127,7 +126,7 @@ void spi_release_bus(struct spi_slave *slave)
  */
 int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 {
-   return (bus == 0  (cs == 0 || cs == 1));
+   return bus == 0  (cs == 0 || cs == 1);
 }
 #endif
 
@@ -169,7 +168,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, 
const void *dout,
 
/* Shift data so it's msb-justified */
if (dout)
-   tmpdout = *(u32 *) dout  0x0ff;
+   tmpdout = *(u32 *)dout  0xff;
 
clrbits_le32(spireg-irq_cause, KWSPI_SMEMRDIRQ);
writel(tmpdout, spireg-dout); /* Write the data out */
@@ -185,12 +184,11 @@ int spi_xfer(struct spi_slave *slave, unsigned int 
bitlen, const void *dout,
if (readl(spireg-irq_cause)  KWSPI_SMEMRDIRQ) {
isread = 1;
tmpdin = readl(spireg-din);
-   debug
-   (spi_xfer: din %p..%08x read\n,
-   din, tmpdin);
+   debug(spi_xfer: din %p..%08x read\n,
+ din, tmpdin);
 
if (din) {
-   *((u8 *) din) = (u8) tmpdin;
+   *((u8 *)din) = (u8)tmpdin;
din += 1;
}
if (dout)
-- 
2.0.4

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


[U-Boot] [PATCH v2 02/25] arm: kirkwood: spi.h: Add some missing parenthesis

2014-08-05 Thread Stefan Roese
Signed-off-by: Stefan Roese s...@denx.de
Cc: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---

Changes in v2: None

 arch/arm/include/asm/arch-kirkwood/spi.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/include/asm/arch-kirkwood/spi.h 
b/arch/arm/include/asm/arch-kirkwood/spi.h
index b1cf614..e512dce 100644
--- a/arch/arm/include/asm/arch-kirkwood/spi.h
+++ b/arch/arm/include/asm/arch-kirkwood/spi.h
@@ -43,10 +43,10 @@ struct kwspi_registers {
 #define KWSPI_XFERLEN_2BYTE(1  5)
 #define KWSPI_XFERLEN_MASK (1  5)
 #define KWSPI_ADRLEN_1BYTE 0
-#define KWSPI_ADRLEN_2BYTE 1  8
-#define KWSPI_ADRLEN_3BYTE 2  8
-#define KWSPI_ADRLEN_4BYTE 3  8
-#define KWSPI_ADRLEN_MASK  3  8
+#define KWSPI_ADRLEN_2BYTE (1  8)
+#define KWSPI_ADRLEN_3BYTE (2  8)
+#define KWSPI_ADRLEN_4BYTE (3  8)
+#define KWSPI_ADRLEN_MASK  (3  8)
 #define KWSPI_TIMEOUT  1
 
 #endif /* __KW_SPI_H__ */
-- 
2.0.4

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


[U-Boot] [PATCH v2 19/25] arm: armada-xp: Add basic support for the Marvell DB-MV784MP-GP board

2014-08-05 Thread Stefan Roese
This patch adds basic support for the Marvell DB-MV784MP-GP evaulation
board. This is the first board that uses the recently created
Armada XP 78460 SoC support.

Signed-off-by: Stefan Roese s...@denx.de

---

Changes in v2:
- Renamed target from db-78460-bp to db-mv784mp-gp as this matches
  the real eval board name

 arch/arm/Kconfig|   4 +
 board/Marvell/db-mv784mp-gp/Kconfig |  23 ++
 board/Marvell/db-mv784mp-gp/MAINTAINERS |   6 ++
 board/Marvell/db-mv784mp-gp/Makefile|   7 ++
 board/Marvell/db-mv784mp-gp/db-mv784mp-gp.c | 120 
 board/Marvell/db-mv784mp-gp/kwbimage.cfg|  12 +++
 configs/db-mv784mp-gp_defconfig |   2 +
 include/configs/db-mv784mp-gp.h |  67 
 8 files changed, 241 insertions(+)
 create mode 100644 board/Marvell/db-mv784mp-gp/Kconfig
 create mode 100644 board/Marvell/db-mv784mp-gp/MAINTAINERS
 create mode 100644 board/Marvell/db-mv784mp-gp/Makefile
 create mode 100644 board/Marvell/db-mv784mp-gp/db-mv784mp-gp.c
 create mode 100644 board/Marvell/db-mv784mp-gp/kwbimage.cfg
 create mode 100644 configs/db-mv784mp-gp_defconfig
 create mode 100644 include/configs/db-mv784mp-gp.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e385eda..884f248 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -233,6 +233,9 @@ config TARGET_DOCKSTAR
 config TARGET_GOFLEXHOME
bool Support goflexhome
 
+config TARGET_DB_MV784MP_GP
+   bool Support db-mv784mp-gp
+
 config TARGET_DEVKIT3250
bool Support devkit3250
 
@@ -784,6 +787,7 @@ source board/LaCie/net2big_v2/Kconfig
 source board/LaCie/netspace_v2/Kconfig
 source board/LaCie/wireless_space/Kconfig
 source board/Marvell/aspenite/Kconfig
+source board/Marvell/db-mv784mp-gp/Kconfig
 source board/Marvell/dkb/Kconfig
 source board/Marvell/dreamplug/Kconfig
 source board/Marvell/gplugd/Kconfig
diff --git a/board/Marvell/db-mv784mp-gp/Kconfig 
b/board/Marvell/db-mv784mp-gp/Kconfig
new file mode 100644
index 000..f94a444
--- /dev/null
+++ b/board/Marvell/db-mv784mp-gp/Kconfig
@@ -0,0 +1,23 @@
+if TARGET_DB_MV784MP_GP
+
+config SYS_CPU
+   string
+   default armv7
+
+config SYS_BOARD
+   string
+   default db-mv784mp-gp
+
+config SYS_VENDOR
+   string
+   default Marvell
+
+config SYS_SOC
+   string
+   default armada-xp
+
+config SYS_CONFIG_NAME
+   string
+   default db-mv784mp-gp
+
+endif
diff --git a/board/Marvell/db-mv784mp-gp/MAINTAINERS 
b/board/Marvell/db-mv784mp-gp/MAINTAINERS
new file mode 100644
index 000..a095f89
--- /dev/null
+++ b/board/Marvell/db-mv784mp-gp/MAINTAINERS
@@ -0,0 +1,6 @@
+DB_MV784MP_GP BOARD
+M: Stefan Roese s...@denx.de
+S: Maintained
+F: board/Marvell/db-mv784mp-gp/
+F: include/configs/db-mv784mp-gp.h
+F: configs/db-mv784mp-gp_defconfig
diff --git a/board/Marvell/db-mv784mp-gp/Makefile 
b/board/Marvell/db-mv784mp-gp/Makefile
new file mode 100644
index 000..8f5a7fb
--- /dev/null
+++ b/board/Marvell/db-mv784mp-gp/Makefile
@@ -0,0 +1,7 @@
+#
+# Copyright (C) 2014 Stefan Roese s...@denx.de
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y  := db-mv784mp-gp.o
diff --git a/board/Marvell/db-mv784mp-gp/db-mv784mp-gp.c 
b/board/Marvell/db-mv784mp-gp/db-mv784mp-gp.c
new file mode 100644
index 000..b3dae89
--- /dev/null
+++ b/board/Marvell/db-mv784mp-gp/db-mv784mp-gp.c
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2014 Stefan Roese s...@denx.de
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include miiphy.h
+#include asm/io.h
+#include asm/arch/cpu.h
+#include asm/arch/soc.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define BIT(nr)(1UL  (nr))
+
+#define ETH_PHY_CTRL_REG   0
+#define ETH_PHY_CTRL_POWER_DOWN_BIT11
+#define ETH_PHY_CTRL_POWER_DOWN_MASK   (1  ETH_PHY_CTRL_POWER_DOWN_BIT)
+
+/*
+ * Those values and defines are taken from the Marvell U-Boot version
+ * u-boot-2011.12-2014_T1.0 for the board rd78460gp aka
+ * RD-AXP-GP rev 1.0.
+ *
+ * GPPs
+ * MPP#NAMEIN/OUT
+ * --
+ * 21  SW_Reset_   OUT
+ * 25  Phy_Int#IN
+ * 28  SDI_WP  IN
+ * 29  SDI_Status  IN
+ * 54-61   On GPP Connector?
+ * 62  Switch InterruptIN
+ * 63-65   Reserved from SW Board  ?
+ * 66  SW_BRD connectedIN
+ */
+#define RD_78460_GP_GPP_OUT_ENA_LOW(~(BIT(21) | BIT(20)))
+#define RD_78460_GP_GPP_OUT_ENA_MID(~(BIT(26) | BIT(27)))
+#define RD_78460_GP_GPP_OUT_ENA_HIGH   (~(0x0))
+
+#define RD_78460_GP_GPP_OUT_VAL_LOW(BIT(21) | BIT(20))
+#define RD_78460_GP_GPP_OUT_VAL_MID(BIT(26) | BIT(27))
+#define RD_78460_GP_GPP_OUT_VAL_HIGH   0x0
+
+int board_early_init_f(void)
+{
+   /* Configure MPP */
+   writel(0x, MVEBU_MPP_BASE + 0x00);
+   

[U-Boot] [PATCH v2 21/25] arm: kirkwood: Remove some dead code from cpu.c

2014-08-05 Thread Stefan Roese
All those functions removed with this patch are not accessed at all. So lets
remove them.

Signed-off-by: Stefan Roese s...@denx.de
---

Changes in v2: None

 arch/arm/cpu/arm926ejs/kirkwood/cpu.c | 55 ---
 1 file changed, 55 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c 
b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c
index 00abcfd..c384565 100644
--- a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c
+++ b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c
@@ -9,13 +9,10 @@
 #include common.h
 #include netdev.h
 #include asm/cache.h
-#include u-boot/md5.h
 #include asm/io.h
 #include asm/arch/cpu.h
 #include asm/arch/soc.h
 
-#define BUFLEN 16
-
 void reset_cpu(unsigned long ignored)
 {
struct kwcpu_registers *cpureg =
@@ -29,31 +26,6 @@ void reset_cpu(unsigned long ignored)
 }
 
 /*
- * Generates Ramdom hex number reading some time varient system registers
- * and using md5 algorithm
- */
-unsigned char get_random_hex(void)
-{
-   int i;
-   u32 inbuf[BUFLEN];
-   u8 outbuf[BUFLEN];
-
-   /*
-* in case of 88F6281/88F6282/88F6192 A0,
-* Bit7 need to reset to generate random values in KW_REG_UNDOC_0x1470
-* Soc reg offsets KW_REG_UNDOC_0x1470 and KW_REG_UNDOC_0x1478 are
-* reserved regs and does not have names at this moment
-* (no errata available)
-*/
-   writel(readl(KW_REG_UNDOC_0x1478)  ~(1  7), KW_REG_UNDOC_0x1478);
-   for (i = 0; i  BUFLEN; i++) {
-   inbuf[i] = readl(KW_REG_UNDOC_0x1470);
-   }
-   md5((u8 *) inbuf, (BUFLEN * sizeof(u32)), outbuf);
-   return outbuf[outbuf[7] % 0x0f];
-}
-
-/*
  * Window Size
  * Used with the Base register to set the address window size and location.
  * Must be programmed from LSB to MSB as sequence of ones followed by
@@ -139,33 +111,6 @@ int kw_config_adr_windows(void)
 }
 
 /*
- * kw_config_mpp - Multi-Purpose Pins Functionality configuration
- *
- * Each MPP can be configured to different functionality through
- * MPP control register, ref (sec 6.1 of kirkwood h/w specification)
- *
- * There are maximum 64 Multi-Pourpose Pins on Kirkwood
- * Each MPP functionality can be configuration by a 4bit value
- * of MPP control reg, the value and associated functionality depends
- * upon used SoC varient
- */
-int kw_config_mpp(u32 mpp0_7, u32 mpp8_15, u32 mpp16_23, u32 mpp24_31,
-   u32 mpp32_39, u32 mpp40_47, u32 mpp48_55)
-{
-   u32 *mppreg = (u32 *) KW_MPP_BASE;
-
-   /* program mpp registers */
-   writel(mpp0_7, mppreg[0]);
-   writel(mpp8_15, mppreg[1]);
-   writel(mpp16_23, mppreg[2]);
-   writel(mpp24_31, mppreg[3]);
-   writel(mpp32_39, mppreg[4]);
-   writel(mpp40_47, mppreg[5]);
-   writel(mpp48_55, mppreg[6]);
-   return 0;
-}
-
-/*
  * SYSRSTn Duration Counter Support
  *
  * Kirkwood SoC implements a hardware-based SYSRSTn duration counter.
-- 
2.0.4

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


[U-Boot] [PATCH v2 10/25] arm: mvebu: Add common mbus functions to use on Marvell SoCs

2014-08-05 Thread Stefan Roese
These mbus functions are ported from Barebox. The Barebox version is
ported from Linux. These functions will be first used by the upcoming
Armada XP support. Later other Marvell SoC's will be adopted to use
these functions as well (Kirkwood, Orion).

Signed-off-by: Stefan Roese s...@denx.de

---

Changes in v2:
- Fixed issue in mbus_dt_setup_win() to also assign remappable windows
- Made mbus_dt_setup_win() non-static, so that it can be called from
  other files for board specific mbus window configuration

 arch/arm/mvebu-common/Makefile |   1 +
 arch/arm/mvebu-common/mbus.c   | 471 +
 include/linux/mbus.h   |  73 +++
 3 files changed, 545 insertions(+)
 create mode 100644 arch/arm/mvebu-common/mbus.c
 create mode 100644 include/linux/mbus.h

diff --git a/arch/arm/mvebu-common/Makefile b/arch/arm/mvebu-common/Makefile
index 4d20d2c..391a125 100644
--- a/arch/arm/mvebu-common/Makefile
+++ b/arch/arm/mvebu-common/Makefile
@@ -7,4 +7,5 @@
 #
 
 obj-y  = dram.o
+obj-$(CONFIG_ARMADA_XP) += mbus.o
 obj-y  += timer.o
diff --git a/arch/arm/mvebu-common/mbus.c b/arch/arm/mvebu-common/mbus.c
new file mode 100644
index 000..05c9ef2
--- /dev/null
+++ b/arch/arm/mvebu-common/mbus.c
@@ -0,0 +1,471 @@
+/*
+ * Address map functions for Marvell EBU SoCs (Kirkwood, Armada
+ * 370/XP, Dove, Orion5x and MV78xx0)
+ *
+ * Ported from the Barebox version to U-Boot by:
+ * Stefan Roese s...@denx.de
+ *
+ * The Barebox version is:
+ * Sebastian Hesselbarth sebastian.hesselba...@gmail.com
+ *
+ * based on mbus driver from Linux
+ *   (C) Copyright 2008 Marvell Semiconductor
+ *
+ * SPDX-License-Identifier:GPL-2.0
+ *
+ * The Marvell EBU SoCs have a configurable physical address space:
+ * the physical address at which certain devices (PCIe, NOR, NAND,
+ * etc.) sit can be configured. The configuration takes place through
+ * two sets of registers:
+ *
+ * - One to configure the access of the CPU to the devices. Depending
+ *   on the families, there are between 8 and 20 configurable windows,
+ *   each can be use to create a physical memory window that maps to a
+ *   specific device. Devices are identified by a tuple (target,
+ *   attribute).
+ *
+ * - One to configure the access to the CPU to the SDRAM. There are
+ *   either 2 (for Dove) or 4 (for other families) windows to map the
+ *   SDRAM into the physical address space.
+ *
+ * This driver:
+ *
+ * - Reads out the SDRAM address decoding windows at initialization
+ *   time, and fills the mbus_dram_info structure with these
+ *   informations. The exported function mv_mbus_dram_info() allow
+ *   device drivers to get those informations related to the SDRAM
+ *   address decoding windows. This is because devices also have their
+ *   own windows (configured through registers that are part of each
+ *   device register space), and therefore the drivers for Marvell
+ *   devices have to configure those device - SDRAM windows to ensure
+ *   that DMA works properly.
+ *
+ * - Provides an API for platform code or device drivers to
+ *   dynamically add or remove address decoding windows for the CPU -
+ *   device accesses. This API is mvebu_mbus_add_window_by_id(),
+ *   mvebu_mbus_add_window_remap_by_id() and
+ *   mvebu_mbus_del_window().
+ */
+
+#include common.h
+#include asm/errno.h
+#include asm/io.h
+#include asm/arch/cpu.h
+#include asm/arch/soc.h
+#include linux/mbus.h
+
+#define BIT(nr)(1UL  (nr))
+
+/* DDR target is the same on all platforms */
+#define TARGET_DDR 0
+
+/* CPU Address Decode Windows registers */
+#define WIN_CTRL_OFF   0x
+#define   WIN_CTRL_ENABLE   BIT(0)
+#define   WIN_CTRL_TGT_MASK 0xf0
+#define   WIN_CTRL_TGT_SHIFT4
+#define   WIN_CTRL_ATTR_MASK0xff00
+#define   WIN_CTRL_ATTR_SHIFT   8
+#define   WIN_CTRL_SIZE_MASK0x
+#define   WIN_CTRL_SIZE_SHIFT   16
+#define WIN_BASE_OFF   0x0004
+#define   WIN_BASE_LOW  0x
+#define   WIN_BASE_HIGH 0xf
+#define WIN_REMAP_LO_OFF   0x0008
+#define   WIN_REMAP_LOW 0x
+#define WIN_REMAP_HI_OFF   0x000c
+
+#define ATTR_HW_COHERENCY  (0x1  4)
+
+#define DDR_BASE_CS_OFF(n) (0x + ((n)  3))
+#define  DDR_BASE_CS_HIGH_MASK  0xf
+#define  DDR_BASE_CS_LOW_MASK   0xff00
+#define DDR_SIZE_CS_OFF(n) (0x0004 + ((n)  3))
+#define  DDR_SIZE_ENABLED   BIT(0)
+#define  DDR_SIZE_CS_MASK   0x1c
+#define  DDR_SIZE_CS_SHIFT  2
+#define  DDR_SIZE_MASK  0xff00
+
+#define DOVE_DDR_BASE_CS_OFF(n) ((n)  4)
+
+struct mvebu_mbus_state;
+
+struct mvebu_mbus_soc_data {
+   unsigned int num_wins;
+   unsigned int num_remappable_wins;
+   unsigned int (*win_cfg_offset)(const int win);
+   void (*setup_cpu_target)(struct mvebu_mbus_state *s);
+};
+
+struct mvebu_mbus_state mbus_state
+   __attribute__ ((section(.data)));
+static struct mbus_dram_target_info mbus_dram_info
+   

[U-Boot] [PATCH v2 22/25] tools/kwboot: Sync with latest barebox version to support Armada XP

2014-08-05 Thread Stefan Roese
The barebox version of the kwboot tool has evolved a bit. To support
Armada XP and Dove. Additionally a few minor fixes have been applied.
So lets sync with the latest barebox version.

Please note that the main difference between both versions now is, that
the U-Boot version still supports the -p option, to dynamically patch
an image for UART boot mode. I didn't test it now though.

Signed-off-by: Stefan Roese s...@denx.de

Tested-by: Luka Perkov l...@openwrt.org
---

Changes in v2:
- Added optional '-a' parameter to use the timings for Armada XP, as they
  are incompatibel with the currently used ones for Kirkwood (etc).

 tools/kwboot.c | 111 +
 1 file changed, 97 insertions(+), 14 deletions(-)

diff --git a/tools/kwboot.c b/tools/kwboot.c
index e773f01..1368b4c 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -1,5 +1,6 @@
 /*
- * Boot a Marvell Kirkwood SoC, with Xmodem over UART0.
+ * Boot a Marvell SoC, with Xmodem over UART0.
+ *  supports Kirkwood, Dove, Armada 370, Armada XP
  *
  * (c) 2012 Daniel Stodden daniel.stod...@gmail.com
  *
@@ -37,9 +38,18 @@ static unsigned char kwboot_msg_boot[] = {
0xBB, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77
 };
 
+static unsigned char kwboot_msg_debug[] = {
+   0xDD, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77
+};
+
+/* Defines known to work on Kirkwood */
 #define KWBOOT_MSG_REQ_DELAY   10 /* ms */
 #define KWBOOT_MSG_RSP_TIMEO   50 /* ms */
 
+/* Defines known to work on Armada XP */
+#define KWBOOT_MSG_REQ_DELAY_AXP   1000 /* ms */
+#define KWBOOT_MSG_RSP_TIMEO_AXP   1000 /* ms */
+
 /*
  * Xmodem Transfers
  */
@@ -62,6 +72,9 @@ struct kwboot_block {
 
 static int kwboot_verbose;
 
+static int msg_req_delay = KWBOOT_MSG_REQ_DELAY;
+static int msg_rsp_timeo = KWBOOT_MSG_RSP_TIMEO;
+
 static void
 kwboot_printv(const char *fmt, ...)
 {
@@ -184,6 +197,9 @@ kwboot_tty_send(int fd, const void *buf, size_t len)
int rc;
ssize_t n;
 
+   if (!buf)
+   return 0;
+
rc = -1;
 
do {
@@ -268,7 +284,10 @@ kwboot_bootmsg(int tty, void *msg)
int rc;
char c;
 
-   kwboot_printv(Sending boot message. Please reboot the target...);
+   if (msg == NULL)
+   kwboot_printv(Please reboot the target into UART boot 
mode...);
+   else
+   kwboot_printv(Sending boot message. Please reboot the 
target...);
 
do {
rc = tcflush(tty, TCIOFLUSH);
@@ -277,11 +296,11 @@ kwboot_bootmsg(int tty, void *msg)
 
rc = kwboot_tty_send(tty, msg, 8);
if (rc) {
-   usleep(KWBOOT_MSG_REQ_DELAY * 1000);
+   usleep(msg_req_delay * 1000);
continue;
}
 
-   rc = kwboot_tty_recv(tty, c, 1, KWBOOT_MSG_RSP_TIMEO);
+   rc = kwboot_tty_recv(tty, c, 1, msg_rsp_timeo);
 
kwboot_spinner();
 
@@ -293,6 +312,37 @@ kwboot_bootmsg(int tty, void *msg)
 }
 
 static int
+kwboot_debugmsg(int tty, void *msg)
+{
+   int rc;
+
+   kwboot_printv(Sending debug message. Please reboot the target...);
+
+   do {
+   char buf[16];
+
+   rc = tcflush(tty, TCIOFLUSH);
+   if (rc)
+   break;
+
+   rc = kwboot_tty_send(tty, msg, 8);
+   if (rc) {
+   usleep(msg_req_delay * 1000);
+   continue;
+   }
+
+   rc = kwboot_tty_recv(tty, buf, 16, msg_rsp_timeo);
+
+   kwboot_spinner();
+
+   } while (rc);
+
+   kwboot_printv(\n);
+
+   return rc;
+}
+
+static int
 kwboot_xm_makeblock(struct kwboot_block *block, const void *data,
size_t size, int pnum)
 {
@@ -300,6 +350,7 @@ kwboot_xm_makeblock(struct kwboot_block *block, const void 
*data,
size_t n;
int i;
 
+   block-soh = SOH;
block-pnum = pnum;
block-_pnum = ~block-pnum;
 
@@ -326,9 +377,15 @@ kwboot_xm_sendblock(int fd, struct kwboot_block *block)
if (rc)
break;
 
-   rc = kwboot_tty_recv(fd, c, 1, KWBOOT_BLK_RSP_TIMEO);
-   if (rc)
-   break;
+   do {
+   rc = kwboot_tty_recv(fd, c, 1, KWBOOT_BLK_RSP_TIMEO);
+   if (rc)
+   break;
+
+   if (c != ACK  c != NAK  c != CAN)
+   printf(%c, c);
+
+   } while (c != ACK  c != NAK  c != CAN);
 
if (c != ACK)
kwboot_progress(-1, '+');
@@ -511,7 +568,6 @@ kwboot_mmap_image(const char *path, size_t *size, int prot)
void *img;
 
rc = -1;
-   fd = -1;
img = NULL;
 
fd = open(path, O_RDONLY);
@@ -601,11 +657,16 @@ static void
 kwboot_usage(FILE *stream, char *progname)
 {

[U-Boot] [PATCH v2 12/25] arm: marvell: Extract kirkwood gpio functions into new common file gpio.c

2014-08-05 Thread Stefan Roese
This makes is possible to use those gpio functions from other MVEBU SoC's as 
well.

Signed-off-by: Stefan Roese s...@denx.de
---

Changes in v2: None

 arch/arm/cpu/arm926ejs/kirkwood/cpu.c   | 17 --
 arch/arm/include/asm/arch-kirkwood/cpu.h|  2 +-
 arch/arm/include/asm/arch-kirkwood/gpio.h   | 16 ++---
 arch/arm/include/asm/arch-kirkwood/soc.h|  4 ++--
 arch/arm/mvebu-common/Makefile  |  1 +
 arch/arm/mvebu-common/gpio.c| 30 +
 board/LaCie/net2big_v2/net2big_v2.c |  4 ++--
 board/LaCie/netspace_v2/netspace_v2.c   |  4 ++--
 board/LaCie/wireless_space/wireless_space.c |  4 ++--
 board/Marvell/dreamplug/dreamplug.c |  6 ++---
 board/Marvell/guruplug/guruplug.c   |  6 ++---
 board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c |  6 ++---
 board/Marvell/openrd/openrd.c   |  6 ++---
 board/Marvell/rd6281a/rd6281a.c |  6 ++---
 board/Marvell/sheevaplug/sheevaplug.c   |  6 ++---
 board/Seagate/dockstar/dockstar.c   |  8 +++
 board/Seagate/goflexhome/goflexhome.c   |  8 +++
 board/buffalo/lsxl/lsxl.c   |  6 ++---
 board/cloudengines/pogo_e02/pogo_e02.c  |  6 ++---
 board/d-link/dns325/dns325.c|  4 ++--
 board/iomega/iconnect/iconnect.c|  6 ++---
 board/karo/tk71/tk71.c  |  6 ++---
 board/keymile/km_arm/km_arm.c   |  4 ++--
 board/raidsonic/ib62x0/ib62x0.c |  6 ++---
 24 files changed, 93 insertions(+), 79 deletions(-)
 create mode 100644 arch/arm/mvebu-common/gpio.c

diff --git a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c 
b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c
index c8f90ba..00abcfd 100644
--- a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c
+++ b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c
@@ -139,23 +139,6 @@ int kw_config_adr_windows(void)
 }
 
 /*
- * kw_config_gpio - GPIO configuration
- */
-void kw_config_gpio(u32 gpp0_oe_val, u32 gpp1_oe_val, u32 gpp0_oe, u32 gpp1_oe)
-{
-   struct kwgpio_registers *gpio0reg =
-   (struct kwgpio_registers *)KW_GPIO0_BASE;
-   struct kwgpio_registers *gpio1reg =
-   (struct kwgpio_registers *)KW_GPIO1_BASE;
-
-   /* Init GPIOS to default values as per board requirement */
-   writel(gpp0_oe_val, gpio0reg-dout);
-   writel(gpp1_oe_val, gpio1reg-dout);
-   writel(gpp0_oe, gpio0reg-oe);
-   writel(gpp1_oe, gpio1reg-oe);
-}
-
-/*
  * kw_config_mpp - Multi-Purpose Pins Functionality configuration
  *
  * Each MPP can be configured to different functionality through
diff --git a/arch/arm/include/asm/arch-kirkwood/cpu.h 
b/arch/arm/include/asm/arch-kirkwood/cpu.h
index 97daa40..5900a15 100644
--- a/arch/arm/include/asm/arch-kirkwood/cpu.h
+++ b/arch/arm/include/asm/arch-kirkwood/cpu.h
@@ -144,7 +144,7 @@ unsigned int kw_sdram_bar(enum memory_bank bank);
 unsigned int kw_sdram_bs(enum memory_bank bank);
 void kw_sdram_size_adjust(enum memory_bank bank);
 int kw_config_adr_windows(void);
-void kw_config_gpio(unsigned int gpp0_oe_val, unsigned int gpp1_oe_val,
+void mvebu_config_gpio(unsigned int gpp0_oe_val, unsigned int gpp1_oe_val,
unsigned int gpp0_oe, unsigned int gpp1_oe);
 int kw_config_mpp(unsigned int mpp0_7, unsigned int mpp8_15,
unsigned int mpp16_23, unsigned int mpp24_31,
diff --git a/arch/arm/include/asm/arch-kirkwood/gpio.h 
b/arch/arm/include/asm/arch-kirkwood/gpio.h
index 5f4d786..aa8c5da 100644
--- a/arch/arm/include/asm/arch-kirkwood/gpio.h
+++ b/arch/arm/include/asm/arch-kirkwood/gpio.h
@@ -21,14 +21,14 @@
 
 #define GPIO_MAX   50
 #define GPIO_OFF(pin)  (((pin)  5) ? 0x0040 : 0x)
-#define GPIO_OUT(pin)  (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x00)
-#define GPIO_IO_CONF(pin)  (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x04)
-#define GPIO_BLINK_EN(pin) (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x08)
-#define GPIO_IN_POL(pin)   (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x0c)
-#define GPIO_DATA_IN(pin)  (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x10)
-#define GPIO_EDGE_CAUSE(pin)   (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x14)
-#define GPIO_EDGE_MASK(pin)(KW_GPIO0_BASE + GPIO_OFF(pin) + 0x18)
-#define GPIO_LEVEL_MASK(pin)   (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x1c)
+#define GPIO_OUT(pin)  (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x00)
+#define GPIO_IO_CONF(pin)  (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x04)
+#define GPIO_BLINK_EN(pin) (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x08)
+#define GPIO_IN_POL(pin)   (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x0c)
+#define GPIO_DATA_IN(pin)  (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x10)
+#define GPIO_EDGE_CAUSE(pin)   (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x14)
+#define GPIO_EDGE_MASK(pin)(MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x18)
+#define GPIO_LEVEL_MASK(pin)   (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x1c)
 
 /*
  * 

[U-Boot] [PATCH v2 09/25] arm: marvell: Rework timer.c to make it usable for other MVEBU platforms

2014-08-05 Thread Stefan Roese
This patch does the following:
- Rename defines and registers to not use kirkwood
- Remove unused defines
- Use clrsetbits() accessor functions
- Coding style cleanup
- Clear 25MHZ bit in timer controller register init for Armada XP

There is no functional change for kirkwood. At least not intentionally.

This will be used by the upcoming Armada XP support.

Signed-off-by: Stefan Roese s...@denx.de
---

Changes in v2: None

 arch/arm/include/asm/arch-kirkwood/soc.h |  2 +-
 arch/arm/mvebu-common/timer.c| 90 ++--
 2 files changed, 41 insertions(+), 51 deletions(-)

diff --git a/arch/arm/include/asm/arch-kirkwood/soc.h 
b/arch/arm/include/asm/arch-kirkwood/soc.h
index bc207f5..4261c35 100644
--- a/arch/arm/include/asm/arch-kirkwood/soc.h
+++ b/arch/arm/include/asm/arch-kirkwood/soc.h
@@ -33,7 +33,7 @@
 #define KW_SPI_BASE(KW_REGISTER(0x10600))
 #define KW_CPU_WIN_BASE(KW_REGISTER(0x2))
 #define KW_CPU_REG_BASE(KW_REGISTER(0x20100))
-#define KW_TIMER_BASE  (KW_REGISTER(0x20300))
+#define MVEBU_TIMER_BASE   (KW_REGISTER(0x20300))
 #define KW_REG_PCIE_BASE   (KW_REGISTER(0x4))
 #define KW_USB20_BASE  (KW_REGISTER(0x5))
 #define KW_EGIGA0_BASE (KW_REGISTER(0x72000))
diff --git a/arch/arm/mvebu-common/timer.c b/arch/arm/mvebu-common/timer.c
index b7aa645..40c4bc2 100644
--- a/arch/arm/mvebu-common/timer.c
+++ b/arch/arm/mvebu-common/timer.c
@@ -9,73 +9,66 @@
 #include asm/io.h
 #include asm/arch/soc.h
 
-#define UBOOT_CNTR 0   /* counter to use for uboot timer */
-
-/* Timer reload and current value registers */
-struct kwtmr_val {
-   u32 reload; /* Timer reload reg */
-   u32 val;/* Timer value reg */
-};
-
-/* Timer registers */
-struct kwtmr_registers {
-   u32 ctrl;   /* Timer control reg */
-   u32 pad[3];
-   struct kwtmr_val tmr[2];
-   u32 wdt_reload;
-   u32 wdt_val;
-};
-
-struct kwtmr_registers *kwtmr_regs = (struct kwtmr_registers *)KW_TIMER_BASE;
+#define UBOOT_CNTR 0   /* counter to use for U-Boot timer */
 
 /*
  * ARM Timers Registers Map
  */
-#define CNTMR_CTRL_REG kwtmr_regs-ctrl
-#define CNTMR_RELOAD_REG(tmrnum)   kwtmr_regs-tmr[tmrnum].reload
-#define CNTMR_VAL_REG(tmrnum)  kwtmr_regs-tmr[tmrnum].val
+#define CNTMR_CTRL_REG tmr_regs-ctrl
+#define CNTMR_RELOAD_REG(tmrnum)   tmr_regs-tmr[tmrnum].reload
+#define CNTMR_VAL_REG(tmrnum)  tmr_regs-tmr[tmrnum].val
 
 /*
  * ARM Timers Control Register
  * CPU_TIMERS_CTRL_REG (CTCR)
  */
 #define CTCR_ARM_TIMER_EN_OFFS(cntr)   (cntr * 2)
-#define CTCR_ARM_TIMER_EN_MASK(cntr)   (1  CTCR_ARM_TIMER_EN_OFFS)
 #define CTCR_ARM_TIMER_EN(cntr)(1  
CTCR_ARM_TIMER_EN_OFFS(cntr))
-#define CTCR_ARM_TIMER_DIS(cntr)   (0  CTCR_ARM_TIMER_EN_OFFS(cntr))
 
 #define CTCR_ARM_TIMER_AUTO_OFFS(cntr) ((cntr * 2) + 1)
-#define CTCR_ARM_TIMER_AUTO_MASK(cntr) (1  1)
 #define CTCR_ARM_TIMER_AUTO_EN(cntr)   (1  CTCR_ARM_TIMER_AUTO_OFFS(cntr))
-#define CTCR_ARM_TIMER_AUTO_DIS(cntr)  (0  CTCR_ARM_TIMER_AUTO_OFFS(cntr))
 
-/*
- * ARM Timer\Watchdog Reload Register
- * CNTMR_RELOAD_REG (TRR)
- */
-#define TRG_ARM_TIMER_REL_OFFS 0
-#define TRG_ARM_TIMER_REL_MASK 0x
+/* Only Armada XP have the 25MHz enable bit (Kirkwood doesn't) */
+#if defined(CONFIG_ARMADA_XP)
+#define CTCR_ARM_TIMER_25MHZ_OFFS(cntr)(cntr + 11)
+#define CTCR_ARM_TIMER_25MHZ(cntr) (1  CTCR_ARM_TIMER_25MHZ_OFFS(cntr))
+#else
+#define CTCR_ARM_TIMER_25MHZ(cntr) 0
+#endif
 
-/*
- * ARM Timer\Watchdog Register
- * CNTMR_VAL_REG (TVRG)
- */
-#define TVR_ARM_TIMER_OFFS 0
-#define TVR_ARM_TIMER_MASK 0x
-#define TVR_ARM_TIMER_MAX  0x
 #define TIMER_LOAD_VAL 0x
 
-#define READ_TIMER (readl(CNTMR_VAL_REG(UBOOT_CNTR)) / 
\
-(CONFIG_SYS_TCLK / 1000))
+#define timestamp  gd-arch.tbl
+#define lastdecgd-arch.lastinc
+
+/* Timer reload and current value registers */
+struct kwtmr_val {
+   u32 reload; /* Timer reload reg */
+   u32 val;/* Timer value reg */
+};
+
+/* Timer registers */
+struct kwtmr_registers {
+   u32 ctrl;   /* Timer control reg */
+   u32 pad[3];
+   struct kwtmr_val tmr[4];
+   u32 wdt_reload;
+   u32 wdt_val;
+};
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define timestamp gd-arch.tbl
-#define lastdec gd-arch.lastinc
+static struct kwtmr_registers *tmr_regs =
+   (struct kwtmr_registers *)MVEBU_TIMER_BASE;
+
+static inline ulong read_timer(void)
+{
+   return readl(CNTMR_VAL_REG(UBOOT_CNTR)) / (CONFIG_SYS_TCLK / 1000);
+}
 
 ulong get_timer_masked(void)
 {
-   ulong now = READ_TIMER;
+   ulong 

[U-Boot] [PATCH v2 16/25] net: phy.h: Make PHY autonegotiation timeout configurable

2014-08-05 Thread Stefan Roese
The Marvell MV78460 eval board DB-78460-BP seems to need a longer
PHY autonegotiation timeout than the standard 4 seconds. So lets
make this timeout configurable. If not defined in the board config
header the original 4000ms is used.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Joe Hershberger joe.hershber...@gmail.com
---

Changes in v2: None

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

diff --git a/include/phy.h b/include/phy.h
index d3ecd63..713742e 100644
--- a/include/phy.h
+++ b/include/phy.h
@@ -32,7 +32,9 @@
 #define PHY_10G_FEATURES   (PHY_GBIT_FEATURES | \
SUPPORTED_1baseT_Full)
 
+#ifndef PHY_ANEG_TIMEOUT
 #define PHY_ANEG_TIMEOUT   4000
+#endif
 
 
 typedef enum {
-- 
2.0.4

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


[U-Boot] [PATCH v2 18/25] arm: armada-xp: Add basic support for Marvell Armada XP SoC

2014-08-05 Thread Stefan Roese
This basic support for the Marvell Armada XP is base on the existing kirkwood
support. Which has been generatized by moving some common files into
common marvell locations.

This is in preparation for the upcoming Armada XP MV78460 support.

Signed-off-by: Stefan Roese s...@denx.de
---

Changes in v2: None

 Makefile |   2 +-
 arch/arm/cpu/armv7/armada-xp/Makefile|   7 +
 arch/arm/cpu/armv7/armada-xp/cpu.c   | 186 +++
 arch/arm/include/asm/arch-armada-xp/config.h |  80 
 arch/arm/include/asm/arch-armada-xp/cpu.h| 107 +++
 arch/arm/include/asm/arch-armada-xp/soc.h|  57 
 6 files changed, 438 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/cpu/armv7/armada-xp/Makefile
 create mode 100644 arch/arm/cpu/armv7/armada-xp/cpu.c
 create mode 100644 arch/arm/include/asm/arch-armada-xp/config.h
 create mode 100644 arch/arm/include/asm/arch-armada-xp/cpu.h
 create mode 100644 arch/arm/include/asm/arch-armada-xp/soc.h

diff --git a/Makefile b/Makefile
index 88e685a..d14fb67 100644
--- a/Makefile
+++ b/Makefile
@@ -653,7 +653,7 @@ ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs 
vf610))
 libs-y += arch/$(ARCH)/imx-common/
 endif
 
-ifneq (,$(filter $(SOC), kirkwood))
+ifneq (,$(filter $(SOC), armada-xp kirkwood))
 libs-y += arch/$(ARCH)/mvebu-common/
 endif
 
diff --git a/arch/arm/cpu/armv7/armada-xp/Makefile 
b/arch/arm/cpu/armv7/armada-xp/Makefile
new file mode 100644
index 000..885dcee
--- /dev/null
+++ b/arch/arm/cpu/armv7/armada-xp/Makefile
@@ -0,0 +1,7 @@
+#
+# Copyright (C) 2014 Stefan Roese s...@denx.de
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y  = cpu.o
diff --git a/arch/arm/cpu/armv7/armada-xp/cpu.c 
b/arch/arm/cpu/armv7/armada-xp/cpu.c
new file mode 100644
index 000..3ad43d2
--- /dev/null
+++ b/arch/arm/cpu/armv7/armada-xp/cpu.c
@@ -0,0 +1,186 @@
+/*
+ * Copyright (C) 2014 Stefan Roese s...@denx.de
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include netdev.h
+#include asm/io.h
+#include asm/arch/cpu.h
+#include asm/arch/soc.h
+
+#define DDR_BASE_CS_OFF(n) (0x + ((n)  3))
+#define DDR_SIZE_CS_OFF(n) (0x0004 + ((n)  3))
+
+static struct mbus_win windows[] = {
+   /* PCIE MEM address space */
+   { DEFADR_PCI_MEM, 256  20, CPU_TARGET_PCIE13, CPU_ATTR_PCIE_MEM },
+
+   /* PCIE IO address space */
+   { DEFADR_PCI_IO, 64  10, CPU_TARGET_PCIE13, CPU_ATTR_PCIE_IO },
+
+   /* SPI */
+   { DEFADR_SPIF, 8  20, CPU_TARGET_DEVICEBUS_BOOTROM_SPI,
+ CPU_ATTR_SPIFLASH },
+
+   /* NOR */
+   { DEFADR_BOOTROM, 8  20, CPU_TARGET_DEVICEBUS_BOOTROM_SPI,
+ CPU_ATTR_BOOTROM },
+};
+
+void reset_cpu(unsigned long ignored)
+{
+   struct mvebu_system_registers *reg =
+   (struct mvebu_system_registers *)MVEBU_SYSTEM_REG_BASE;
+
+   writel(readl(reg-rstoutn_mask) | 1, reg-rstoutn_mask);
+   writel(readl(reg-sys_soft_rst) | 1, reg-sys_soft_rst);
+   while (1)
+   ;
+}
+
+#if defined(CONFIG_DISPLAY_CPUINFO)
+int print_cpuinfo(void)
+{
+   u16 devid = (readl(MVEBU_REG_PCIE_DEVID)  16)  0x;
+   u8 revid = readl(MVEBU_REG_PCIE_REVID)  0xff;
+
+   puts(SoC:   );
+
+   switch (devid) {
+   case SOC_MV78460_ID:
+   puts(MV78460-);
+   break;
+   default:
+   puts(Unknown-);
+   break;
+   }
+
+   switch (revid) {
+   case 1:
+   puts(A0\n);
+   break;
+   case 2:
+   puts(B0\n);
+   break;
+   default:
+   puts(??\n);
+   break;
+   }
+
+   return 0;
+}
+#endif /* CONFIG_DISPLAY_CPUINFO */
+
+/*
+ * This function initialize Controller DRAM Fastpath windows.
+ * It takes the CS size information from the 0x1500 scratch registers
+ * and sets the correct windows sizes and base addresses accordingly.
+ *
+ * These values are set in the scratch registers by the Marvell
+ * DDR3 training code, which is executed by the BootROM before the
+ * main payload (U-Boot) is executed. This training code is currently
+ * only available in the Marvell U-Boot version. It needs to be
+ * ported to mainline U-Boot SPL at some point.
+ */
+static void update_sdram_window_sizes(void)
+{
+   u64 base = 0;
+   u32 size, temp;
+   int i;
+
+   for (i = 0; i  SDRAM_MAX_CS; i++) {
+   size = readl((MVEBU_SDRAM_SCRATCH + (i * 8)))  SDRAM_ADDR_MASK;
+   if (size != 0) {
+   size |= ~(SDRAM_ADDR_MASK);
+
+   /* Set Base Address */
+   temp = (base  0xFF00ll) | ((base  32)  0xF);
+   writel(temp, MVEBU_SDRAM_BASE + DDR_BASE_CS_OFF(i));
+
+   /*
+* Check if out of max window size and resize
+* the window
+*/
+ 

[U-Boot] [PATCH v2 15/25] net: mvneta.c: Add support for the ethernet controller of the Marvell Armada XP SoC

2014-08-05 Thread Stefan Roese
This patch adds support for the NETA ethernet controller which is integrated
in the Marvell Armada XP SoC's. This port is based on the Linux driver which
has been stripped of the in U-Boot unused portions.

Tested on the Marvell MV78460 eval board db-78460-bp.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Joe Hershberger joe.hershber...@gmail.com
---

Changes in v2: None

 drivers/net/Makefile |1 +
 drivers/net/mvneta.c | 1653 ++
 include/netdev.h |1 +
 3 files changed, 1655 insertions(+)
 create mode 100644 drivers/net/mvneta.c

diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 7cc6b6f..07f4c13 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -40,6 +40,7 @@ obj-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
 obj-$(CONFIG_MPC5xxx_FEC) += mpc5xxx_fec.o
 obj-$(CONFIG_MPC512x_FEC) += mpc512x_fec.o
 obj-$(CONFIG_MVGBE) += mvgbe.o
+obj-$(CONFIG_MVNETA) += mvneta.o
 obj-$(CONFIG_NATSEMI) += natsemi.o
 obj-$(CONFIG_DRIVER_NE2000) += ne2000.o ne2000_base.o
 obj-$(CONFIG_DRIVER_AX88796L) += ax88796.o ne2000_base.o
diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
new file mode 100644
index 000..a2a69b4
--- /dev/null
+++ b/drivers/net/mvneta.c
@@ -0,0 +1,1653 @@
+/*
+ * Driver for Marvell NETA network card for Armada XP and Armada 370 SoCs.
+ *
+ * U-Boot version:
+ * Copyright (C) 2014 Stefan Roese s...@denx.de
+ *
+ * Based on the Linux version which is:
+ * Copyright (C) 2012 Marvell
+ *
+ * Rami Rosen ros...@marvell.com
+ * Thomas Petazzoni thomas.petazz...@free-electrons.com
+ *
+ * SPDX-License-Identifier:GPL-2.0
+ */
+
+#include common.h
+#include net.h
+#include netdev.h
+#include config.h
+#include malloc.h
+#include asm/io.h
+#include asm/errno.h
+#include phy.h
+#include miiphy.h
+#include watchdog.h
+#include asm/arch/cpu.h
+#include asm/arch/soc.h
+#include linux/compat.h
+#include linux/mbus.h
+
+#if !defined(CONFIG_PHYLIB)
+# error Marvell mvneta requires PHYLIB
+#endif
+
+/* Some linux - U-Boot compatibility stuff */
+#define netdev_err(dev, fmt, args...)  \
+   printf(fmt, ##args)
+#define netdev_warn(dev, fmt, args...) \
+   printf(fmt, ##args)
+#define netdev_info(dev, fmt, args...) \
+   printf(fmt, ##args)
+
+#define CONFIG_NR_CPUS 1
+#define BIT(nr)(1UL  (nr))
+#define ETH_HLEN   14  /* Total octets in header */
+
+/* 2(HW hdr) 14(MAC hdr) 4(CRC) 32(extra for cache prefetch) */
+#define WRAP   (2 + ETH_HLEN + 4 + 32)
+#define MTU1500
+#define RX_BUFFER_SIZE (ALIGN(MTU + WRAP, ARCH_DMA_MINALIGN))
+
+#define MVNETA_SMI_TIMEOUT 1
+
+/* Registers */
+#define MVNETA_RXQ_CONFIG_REG(q)(0x1400 + ((q)  2))
+#define MVNETA_RXQ_HW_BUF_ALLOCBIT(1)
+#define  MVNETA_RXQ_PKT_OFFSET_ALL_MASK (0xf 8)
+#define  MVNETA_RXQ_PKT_OFFSET_MASK(offs)   ((offs)  8)
+#define MVNETA_RXQ_THRESHOLD_REG(q) (0x14c0 + ((q)  2))
+#define  MVNETA_RXQ_NON_OCCUPIED(v) ((v)  16)
+#define MVNETA_RXQ_BASE_ADDR_REG(q) (0x1480 + ((q)  2))
+#define MVNETA_RXQ_SIZE_REG(q)  (0x14a0 + ((q)  2))
+#define  MVNETA_RXQ_BUF_SIZE_SHIFT  19
+#define  MVNETA_RXQ_BUF_SIZE_MASK   (0x1fff  19)
+#define MVNETA_RXQ_STATUS_REG(q)(0x14e0 + ((q)  2))
+#define  MVNETA_RXQ_OCCUPIED_ALL_MASK   0x3fff
+#define MVNETA_RXQ_STATUS_UPDATE_REG(q) (0x1500 + ((q)  2))
+#define  MVNETA_RXQ_ADD_NON_OCCUPIED_SHIFT  16
+#define  MVNETA_RXQ_ADD_NON_OCCUPIED_MAX255
+#define MVNETA_PORT_RX_RESET0x1cc0
+#define  MVNETA_PORT_RX_DMA_RESET   BIT(0)
+#define MVNETA_PHY_ADDR 0x2000
+#define  MVNETA_PHY_ADDR_MASK   0x1f
+#define MVNETA_SMI  0x2004
+#define  MVNETA_PHY_REG_MASK0x1f
+/* SMI register fields */
+#define MVNETA_SMI_DATA_OFFS   0   /* Data */
+#define MVNETA_SMI_DATA_MASK   (0x  MVNETA_SMI_DATA_OFFS)
+#define MVNETA_SMI_DEV_ADDR_OFFS   16  /* PHY device address */
+#define MVNETA_SMI_REG_ADDR_OFFS   21  /* PHY device reg addr*/
+#define MVNETA_SMI_OPCODE_OFFS 26  /* Write/Read opcode */
+#define MVNETA_SMI_OPCODE_READ (1  MVNETA_SMI_OPCODE_OFFS)
+#define MVNETA_SMI_READ_VALID  (1  27)   /* Read Valid */
+#define MVNETA_SMI_BUSY(1  28)   /* Busy */
+#define MVNETA_MBUS_RETRY   0x2010
+#define MVNETA_UNIT_INTR_CAUSE  0x2080
+#define MVNETA_UNIT_CONTROL 0x20B0
+#define  MVNETA_PHY_POLLING_ENABLE  BIT(1)
+#define MVNETA_WIN_BASE(w)  (0x2200 + ((w)  3))
+#define MVNETA_WIN_SIZE(w)  

[U-Boot] [PATCH v2 23/25] tools: Compile kwboot for Marvell Armada XP as those SoCs are now supported

2014-08-05 Thread Stefan Roese
Signed-off-by: Stefan Roese s...@denx.de
Tested-by: Luka Perkov l...@openwrt.org
---

Changes in v2: None

 tools/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/Makefile b/tools/Makefile
index 90e966d..7495f17 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -139,6 +139,7 @@ ubsha1-objs := os_support.o ubsha1.o lib/sha1.o
 HOSTCFLAGS_ubsha1.o := -pedantic
 
 hostprogs-$(CONFIG_KIRKWOOD) += kwboot
+hostprogs-$(CONFIG_ARMADA_XP) += kwboot
 hostprogs-y += proftool
 hostprogs-$(CONFIG_STATIC_RELA) += relocate-rela
 
-- 
2.0.4

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


Re: [U-Boot] [PATCH] drivers: rtc: remove dead drivers

2014-08-05 Thread Stefano Babic
Hi Tom, hi Masahiro,

On 04/08/2014 19:30, Tom Rini wrote:
 On Wed, Jul 30, 2014 at 07:20:03PM +0900, Masahiro Yamada wrote:
 
 The following configs are not defined at all:

  - CONFIG_RTC_DS1388
  - CONFIG_RTC_ISL1208
  - CONFIG_RTC_MX27
  - CONFIG_RTC_PL031
  - CONFIG_RTC_RS5C372A
  - CONFIG_SYS_DS1388_TCR_VAL

 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 
 I'm inclined to NAK this.  I can't speak to MX27 (Stefano?)
 but in other
 cases those RTCs can be breadboarded up on other EVMs or otherwise
 used in things that aren't quite upstream.

I agree with Tom. RTC_MX27 was tested and submitted with the armadeus
apf27 board, but then another RTC was chosen on this target. The
RTC_MX27 remains ready to be used.
It is easy to enable this driver on some other targets - if these kind
of drivers are not explicitely broken, I think we should let live in
mainline.

Best regards,
Stefano

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


[U-Boot] [PATCH v2 25/25] Makefile: Add CONFIG_BUILD_TARGET to automatically build an special image

2014-08-05 Thread Stefan Roese
Add target to build it automatically upon make / MAKEALL. This can/should
be set by board / cpu specific headers if a special U-Boot image is
required for this SoC / board.

E.g. used by Marvell Armada XP to automatically build the u-boot.kwb
target.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Masahiro Yamada yamad...@jp.panasonic.com

---

Changes in v2:
- Rebased on latest U-Boot version already including the Kconfig
  support switch.
- Removed patch [PATCH v1 21/25] arm: kirkwood: Use mvebu new common mbus API
  as this breaks Kirkwood booting. This needs to be resolved at some time,
  but I don't have access to a Kirkwood based board with JTAG BDI access to
  debug it right now. Till somebody fixes this issue, lets just remove
  it from this series for now.
- Added basic support for the maxBCM MV78460 based board

 Makefile | 5 +
 README   | 8 
 2 files changed, 13 insertions(+)

diff --git a/Makefile b/Makefile
index d14fb67..a89735f 100644
--- a/Makefile
+++ b/Makefile
@@ -759,6 +759,11 @@ endif
 endif
 endif
 
+# Add optional build target if defined in board/cpu/soc headers
+ifneq ($(CONFIG_BUILD_TARGET),)
+ALL-y += $(CONFIG_BUILD_TARGET:%=%)
+endif
+
 LDFLAGS_u-boot += $(LDFLAGS_FINAL)
 ifneq ($(CONFIG_SYS_TEXT_BASE),)
 LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
diff --git a/README b/README
index f704eb3..55e410b 100644
--- a/README
+++ b/README
@@ -2672,6 +2672,14 @@ CBFS (Coreboot Filesystem) support
200 ms.
 
 - Configuration Management:
+   CONFIG_BUILD_TARGET
+
+   Some SoCs need special image types (e.g. U-Boot binary
+   with a special header) as build targets. By defining
+   CONFIG_BUILD_TARGET in the SoC / board header, this
+   special image will be automatically built upon calling
+   make / MAKEALL.
+
CONFIG_IDENT_STRING
 
If defined, this string will be added to the U-Boot
-- 
2.0.4

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


[U-Boot] [PATCH v2 13/25] spi: kirkwood_spi.c: Change KW_SPI_BASE to MVEBU_SPI_BASE

2014-08-05 Thread Stefan Roese
This makes is possible to use this SPI driver from other MVEBU SoC's as well.
As the upcoming Armada XP support will do.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---

Changes in v2: None

 arch/arm/include/asm/arch-kirkwood/soc.h | 2 +-
 drivers/spi/kirkwood_spi.c   | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-kirkwood/soc.h 
b/arch/arm/include/asm/arch-kirkwood/soc.h
index 37cbae9..379ce13 100644
--- a/arch/arm/include/asm/arch-kirkwood/soc.h
+++ b/arch/arm/include/asm/arch-kirkwood/soc.h
@@ -30,7 +30,7 @@
 #define MVEBU_GPIO1_BASE   (KW_REGISTER(0x10140))
 #define KW_RTC_BASE(KW_REGISTER(0x10300))
 #define KW_NANDF_BASE  (KW_REGISTER(0x10418))
-#define KW_SPI_BASE(KW_REGISTER(0x10600))
+#define MVEBU_SPI_BASE (KW_REGISTER(0x10600))
 #define KW_CPU_WIN_BASE(KW_REGISTER(0x2))
 #define KW_CPU_REG_BASE(KW_REGISTER(0x20100))
 #define MVEBU_TIMER_BASE   (KW_REGISTER(0x20300))
diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c
index ce2ba96..e7b0982 100644
--- a/drivers/spi/kirkwood_spi.c
+++ b/drivers/spi/kirkwood_spi.c
@@ -18,7 +18,8 @@
 #endif
 #include asm/arch-mvebu/spi.h
 
-static struct kwspi_registers *spireg = (struct kwspi_registers *)KW_SPI_BASE;
+static struct kwspi_registers *spireg =
+   (struct kwspi_registers *)MVEBU_SPI_BASE;
 
 #ifdef CONFIG_KIRKWOOD
 static u32 cs_spi_mpp_back[2];
-- 
2.0.4

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


[U-Boot] [PATCH v2 20/25] arm: armada-xp: Add basic support for the maxBCM board

2014-08-05 Thread Stefan Roese
The maxBCM board is equipped with the Marvell Armada-XP MV78460 SoC. It
integrates an SPI NOR flash and an Marvell 88E6185 switch.

Signed-off-by: Stefan Roese s...@denx.de
---

Changes in v2: None

 arch/arm/Kconfig  |  4 +++
 board/maxbcm/Kconfig  | 19 
 board/maxbcm/MAINTAINERS  |  6 
 board/maxbcm/Makefile |  7 +
 board/maxbcm/kwbimage.cfg | 12 
 board/maxbcm/maxbcm.c | 77 +++
 configs/maxbcm_defconfig  |  2 ++
 include/configs/maxbcm.h  | 67 +
 8 files changed, 194 insertions(+)
 create mode 100644 board/maxbcm/Kconfig
 create mode 100644 board/maxbcm/MAINTAINERS
 create mode 100644 board/maxbcm/Makefile
 create mode 100644 board/maxbcm/kwbimage.cfg
 create mode 100644 board/maxbcm/maxbcm.c
 create mode 100644 configs/maxbcm_defconfig
 create mode 100644 include/configs/maxbcm.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 884f248..a77a08d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -236,6 +236,9 @@ config TARGET_GOFLEXHOME
 config TARGET_DB_MV784MP_GP
bool Support db-mv784mp-gp
 
+config TARGET_MAXBCM
+   bool Support maxbcm
+
 config TARGET_DEVKIT3250
bool Support devkit3250
 
@@ -909,6 +912,7 @@ source board/logicpd/imx31_litekit/Kconfig
 source board/logicpd/omap3som/Kconfig
 source board/logicpd/zoom1/Kconfig
 source board/matrix_vision/mvblx/Kconfig
+source board/maxbcm/Kconfig
 source board/mpl/vcma9/Kconfig
 source board/nokia/rx51/Kconfig
 source board/nvidia/beaver/Kconfig
diff --git a/board/maxbcm/Kconfig b/board/maxbcm/Kconfig
new file mode 100644
index 000..d34e2ab
--- /dev/null
+++ b/board/maxbcm/Kconfig
@@ -0,0 +1,19 @@
+if TARGET_MAXBCM
+
+config SYS_CPU
+   string
+   default armv7
+
+config SYS_BOARD
+   string
+   default maxbcm
+
+config SYS_SOC
+   string
+   default armada-xp
+
+config SYS_CONFIG_NAME
+   string
+   default maxbcm
+
+endif
diff --git a/board/maxbcm/MAINTAINERS b/board/maxbcm/MAINTAINERS
new file mode 100644
index 000..3c8af21
--- /dev/null
+++ b/board/maxbcm/MAINTAINERS
@@ -0,0 +1,6 @@
+MAXBCM BOARD
+M: Stefan Roese s...@denx.de
+S: Maintained
+F: board/maxbcm/
+F: include/configs/maxbcm.h
+F: configs/maxbcm_defconfig
diff --git a/board/maxbcm/Makefile b/board/maxbcm/Makefile
new file mode 100644
index 000..37c17d6
--- /dev/null
+++ b/board/maxbcm/Makefile
@@ -0,0 +1,7 @@
+#
+# Copyright (C) 2014 Stefan Roese s...@denx.de
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y  := maxbcm.o
diff --git a/board/maxbcm/kwbimage.cfg b/board/maxbcm/kwbimage.cfg
new file mode 100644
index 000..5a3bc67
--- /dev/null
+++ b/board/maxbcm/kwbimage.cfg
@@ -0,0 +1,12 @@
+#
+# Copyright (C) 2014 Stefan Roese s...@denx.de
+#
+
+# Armada XP uses version 1 image format
+VERSION1
+
+# Boot Media configurations
+BOOT_FROM  spi
+
+# Binary Header (bin_hdr) with DDR3 training code
+BINARY board/maxbcm/binary.0 005b 0068
diff --git a/board/maxbcm/maxbcm.c b/board/maxbcm/maxbcm.c
new file mode 100644
index 000..7fc83ee
--- /dev/null
+++ b/board/maxbcm/maxbcm.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2014 Stefan Roese s...@denx.de
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include miiphy.h
+#include asm/io.h
+#include asm/arch/cpu.h
+#include asm/arch/soc.h
+#include linux/mbus.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* Base addresses for the external device chip selects */
+#define DEV_CS0_BASE   0xe000
+#define DEV_CS1_BASE   0xe100
+#define DEV_CS2_BASE   0xe200
+#define DEV_CS3_BASE   0xe300
+
+/* Needed for dynamic (board-specific) mbus configuration */
+extern struct mvebu_mbus_state mbus_state;
+
+int board_early_init_f(void)
+{
+   /*
+* Don't configure MPP (pin multiplexing) and GPIO here,
+* its already done in bin_hdr
+*/
+
+   /*
+* Setup some board specific mbus address windows
+*/
+   mbus_dt_setup_win(mbus_state, DEV_CS0_BASE, 16  20,
+ CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_DEV_CS0);
+   mbus_dt_setup_win(mbus_state, DEV_CS1_BASE, 16  20,
+ CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_DEV_CS1);
+   mbus_dt_setup_win(mbus_state, DEV_CS2_BASE, 16  20,
+ CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_DEV_CS2);
+   mbus_dt_setup_win(mbus_state, DEV_CS3_BASE, 16  20,
+ CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_DEV_CS3);
+
+   return 0;
+}
+
+int board_init(void)
+{
+   /* adress of boot parameters */
+   gd-bd-bi_boot_params = mvebu_sdram_bar(0) + 0x100;
+
+   return 0;
+}
+
+int checkboard(void)
+{
+   puts(Board: maxBCM\n);
+
+   return 0;
+}
+
+#ifdef CONFIG_RESET_PHY_R
+/* Configure and enable MV88E6185 switch */
+void reset_phy(void)
+{
+   u16 

[U-Boot] [PATCH v2 24/25] tools: kwbimage: Add image version 1 support for Armada XP / 370

2014-08-05 Thread Stefan Roese
This patch integrates the Barebox version of this kwbimage.c file into
U-Boot. As this version supports the image version 1 type for the
Armada XP / 370 SoCs.

It was easier to integrate the existing and known to be working Barebox
source than to update the current U-Boot version to support this
v1 image header format. Now all Marvell MVEBU SoCs are supported:

Image type 0: Kirkwood  Dove
Image type 1: Armada 370  Armada XP

Please note that the current v1 support has this restuction (same as
has Barebox version):

Not implemented: support for the register headers and secure headers
in v1 images

Tested on Marvell DB-78460-BP eval board.

Signed-off-by: Stefan Roese s...@denx.de
Tested-by: Luka Perkov l...@openwrt.org
---

Changes in v2: None

 tools/kwbimage.c | 1050 --
 1 file changed, 782 insertions(+), 268 deletions(-)

diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index 109d616..1120e9b 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -1,364 +1,805 @@
 /*
- * (C) Copyright 2008
- * Marvell Semiconductor www.marvell.com
- * Written-by: Prafulla Wadaskar prafu...@marvell.com
+ * Image manipulator for Marvell SoCs
+ *  supports Kirkwood, Dove, Armada 370, and Armada XP
+ *
+ * (C) Copyright 2013 Thomas Petazzoni
+ * thomas.petazz...@free-electrons.com
  *
  * SPDX-License-Identifier:GPL-2.0+
+ *
+ * Not implemented: support for the register headers and secure
+ * headers in v1 images
  */
 
 #include imagetool.h
 #include image.h
+#include stdint.h
 #include kwbimage.h
 
-/*
- * Supported commands for configuration file
- */
-static table_entry_t kwbimage_cmds[] = {
-   {CMD_BOOT_FROM, BOOT_FROM,boot command, },
-   {CMD_NAND_ECC_MODE, NAND_ECC_MODE,NAND mode,},
-   {CMD_NAND_PAGE_SIZE,NAND_PAGE_SIZE,   NAND size,},
-   {CMD_SATA_PIO_MODE, SATA_PIO_MODE,SATA mode,},
-   {CMD_DDR_INIT_DELAY,DDR_INIT_DELAY,   DDR init dly, },
-   {CMD_DATA,  DATA, Reg Write Data, },
-   {CMD_INVALID,   , , },
+#define ALIGN_SUP(x, a) (((x) + (a - 1))  ~(a - 1))
+
+/* Structure of the main header, version 0 (Kirkwood, Dove) */
+struct main_hdr_v0 {
+   uint8_t  blockid;   /*0 */
+   uint8_t  nandeccmode;   /*1 */
+   uint16_t nandpagesize;  /*2-3   */
+   uint32_t blocksize; /*4-7   */
+   uint32_t rsvd1; /*8-11  */
+   uint32_t srcaddr;   /*12-15 */
+   uint32_t destaddr;  /*16-19 */
+   uint32_t execaddr;  /*20-23 */
+   uint8_t  satapiomode;   /*24*/
+   uint8_t  rsvd3; /*25*/
+   uint16_t ddrinitdelay;  /*26-27 */
+   uint16_t rsvd2; /*28-29 */
+   uint8_t  ext;   /*30*/
+   uint8_t  checksum;  /*31*/
+};
+
+struct ext_hdr_v0_reg {
+   uint32_t raddr;
+   uint32_t rdata;
+};
+
+#define EXT_HDR_V0_REG_COUNT ((0x1dc - 0x20) / sizeof(struct ext_hdr_v0_reg))
+
+struct ext_hdr_v0 {
+   uint32_t  offset;
+   uint8_t   reserved[0x20 - sizeof(uint32_t)];
+   struct ext_hdr_v0_reg rcfg[EXT_HDR_V0_REG_COUNT];
+   uint8_t   reserved2[7];
+   uint8_t   checksum;
+};
+
+/* Structure of the main header, version 1 (Armada 370, Armada XP) */
+struct main_hdr_v1 {
+   uint8_t  blockid;   /* 0 */
+   uint8_t  reserved1; /* 1 */
+   uint16_t reserved2; /* 2-3 */
+   uint32_t blocksize; /* 4-7 */
+   uint8_t  version;   /* 8 */
+   uint8_t  headersz_msb;  /* 9 */
+   uint16_t headersz_lsb;  /* A-B */
+   uint32_t srcaddr;   /* C-F */
+   uint32_t destaddr;  /* 10-13 */
+   uint32_t execaddr;  /* 14-17 */
+   uint8_t  reserved3; /* 18 */
+   uint8_t  nandblocksize; /* 19 */
+   uint8_t  nandbadblklocation;/* 1A */
+   uint8_t  reserved4; /* 1B */
+   uint16_t reserved5; /* 1C-1D */
+   uint8_t  ext;   /* 1E */
+   uint8_t  checksum;  /* 1F */
 };
 
 /*
- * Supported Boot options for configuration file
+ * Header for the optional headers, version 1 (Armada 370, Armada XP)
  */
-static table_entry_t kwbimage_bootops[] = {
-   {IBR_HDR_SPI_ID,spi,  SPI Flash,},
-   {IBR_HDR_NAND_ID,   nand, NAND Flash,   },
-   {IBR_HDR_SATA_ID,   sata, Sata port,},
-   {IBR_HDR_PEX_ID,pex,  PCIe port,},
-   {IBR_HDR_UART_ID,   uart, Serial port,  },
-   {-1,, Invalid,  },
+struct opt_hdr_v1 {
+   uint8_t  headertype;
+   

[U-Boot] mmc: question about capacity detection

2014-08-05 Thread Hannes Petermaier

hi folks,

i am actually trying to enable the enhanced data area on an 4GB emmc 
device, this i've done successfully with the linux mmc-utils and the 
card has after this partitioning 2GB user-partition.


Linux kernel deals correctly with the card.

U-Boot doesn't:


MMC: block number 0x301 exceeds max(0x0)
spl: mmc blk read err - 0
### ERROR ### Please RESET the board ###


So i debugged around and found the capacity-calculation, which i don't 
fully understand.


if (mmc-high_capacity) {
csize = (mmc-csd[1]  0x3f)  16
| (mmc-csd[2]  0x)  16;
cmult = 8;
} else {
csize = (mmc-csd[1]  0x3ff)  2
| (mmc-csd[2]  0xc000)  30;
cmult = (mmc-csd[2]  0x00038000)  15;
}

The else path does for my opinion the right calculation according the 
mmc-specification, the high_capacity path i do not understand at all, 
neither i found some specification for this.


In fact my 4GB card (with 2GB enhanced area) works only with the else 
path.

my csd Registers:

MMC-card dection:
ocr: 0xc0ff8080
csd[0] : 0xd04f0132
csd[1] : 0x0f5a13ff
csd[2] : 0xffe7
csd[3] : 0x8a4000f1
c_size : 0x003f
c_mult : 0x0008

U-Boot (BuR V2.0)# mmc info
Device: OMAP SD/MMC
Manufacturer ID: fe
OEM: 14e
Name: MMC04
Tran Speed: 5200
Rd Block Len: 512
MMC version 4.41
High Capacity: Yes
Capacity: 4 TiB
Bus Width: 1-bit

any ideas ?

best regards,
Hannes





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


Re: [U-Boot] [PATCH 12/18] arm: mx6: add support for Compulab cm-fx6 CoM

2014-08-05 Thread Nikita Kiryanov



On 04/08/14 18:12, Marek Vasut wrote:

On Monday, August 04, 2014 at 04:41:03 PM, Nikita Kiryanov wrote:

On 03/08/14 17:09, Marek Vasut wrote:

On Sunday, August 03, 2014 at 09:34:42 AM, Nikita Kiryanov wrote:

Add initial support for Compulab CM-FX6 CoM.
Support includes MMC, SPI flash, and SPL with dynamic DRAM detection.

Cc: Igor Grinberg grinb...@compulab.co.il
Cc: Stefano Babic sba...@denx.de
Cc: Tom Rini tr...@ti.com
Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
---

   arch/arm/cpu/armv7/mx6/ddr.c   |   1 -
   board/compulab/cm_fx6/Makefile |  12 ++
   board/compulab/cm_fx6/cm_fx6.c | 108 ++
   board/compulab/cm_fx6/common.c |  83 
   board/compulab/cm_fx6/common.h |  36 
   board/compulab/cm_fx6/imximage.cfg |   8 +
   board/compulab/cm_fx6/spl.c| 400

+ boards.cfg
|

2 +

   include/configs/cm_fx6.h   | 227 +
   9 files changed, 876 insertions(+), 1 deletion(-)
   create mode 100644 board/compulab/cm_fx6/Makefile
   create mode 100644 board/compulab/cm_fx6/cm_fx6.c
   create mode 100644 board/compulab/cm_fx6/common.c
   create mode 100644 board/compulab/cm_fx6/common.h
   create mode 100644 board/compulab/cm_fx6/imximage.cfg
   create mode 100644 board/compulab/cm_fx6/spl.c
   create mode 100644 include/configs/cm_fx6.h

diff --git a/arch/arm/cpu/armv7/mx6/ddr.c b/arch/arm/cpu/armv7/mx6/ddr.c
index d3891dc..219263a 100644
--- a/arch/arm/cpu/armv7/mx6/ddr.c
+++ b/arch/arm/cpu/armv7/mx6/ddr.c
@@ -4,7 +4,6 @@

*
* SPDX-License-Identifier: GPL-2.0+
*/

-

   #include common.h
   #include linux/types.h
   #include asm/arch/mx6-ddr.h


Drop this piece ;-)


Yep...


[...]


+++ b/board/compulab/cm_fx6/cm_fx6.c


[...]


+static ulong bank1_size;
+static ulong bank2_size;
+
+#define MMDC1_MDCTL 0x21B
+static int probe_mmdc_config(void)
+{
+   u32 val = readl(0x21B);
+   switch (val) {
+   case 0x8318: /* DDR_16BIT_256MB */
+   gd-ram_size = 0x1000;
+   bank1_size  = 0x1000;
+   bank2_size  = 0;
+   break;
+   case 0x8319: /* DDR_32BIT_512MB */
+   gd-ram_size = 0x2000;
+   bank1_size  = 0x2000;
+   bank2_size  = 0;
+   break;


imx_ddr_size() won't cut it here ?


It doesn't handle 4GB correctly (returns 0). I suppose
I can make a patch which caps the return value of
imx_ddr_size() for MX6 socs to 3840MB.
What do you think?


That you should check the U-Boot ML, since that's what I did yesterday ;-) But
still, this is rather sad practice -- instead of fixing a bug in code which you
do know about, you implement such a workaround :-(


Actually, I only learned of this bug yesterday after you asked about
imx_ddr_size(). Glad to hear you already fixed it; I'll look at it for
the v2.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] zynq: spl: Add vectors section to linker script

2014-08-05 Thread Michal Simek
On 08/04/2014 12:51 PM, Peter Crosthwaite wrote:
 The vectors section contains the _start symbol which is used as the
 program entry point. Add it to the linker script in same fasion as done

fashion

 for regular u-boot. This allows for correct generation of an spl elf
 with a non-zero entry point.
 
 Similar change was applied to sunxi platform in
 9e5f80d823e3fd2a685b10ecf02009e34b86cff9.


sunxi: Fix u-boot-spl.lds to refer to .vectors
(sha1: 9e5f80d823e3fd2a685b10ecf02009e34b86cff9)


 
 This also allows for placement of the vector table at the hivecs
 location by setting the TEXT_BASE to 0x.
 
 Signed-off-by: Peter Crosthwaite crosthwaite.pe...@gmail.com
 ---
  arch/arm/cpu/armv7/zynq/u-boot-spl.lds | 1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/arch/arm/cpu/armv7/zynq/u-boot-spl.lds 
 b/arch/arm/cpu/armv7/zynq/u-boot-spl.lds
 index 0c4501e..0f2f756 100644
 --- a/arch/arm/cpu/armv7/zynq/u-boot-spl.lds
 +++ b/arch/arm/cpu/armv7/zynq/u-boot-spl.lds
 @@ -22,6 +22,7 @@ SECTIONS
   .text :
   {
   __image_copy_start = .;
 + *(.vectors)
   CPUDIR/start.o (.text*)
   *(.text*)
   }  .sram
 


Just two issues in commit message but
Tested-by: Michal Simek michal.si...@xilinx.com

If there is no issue from others I will apply it to zynq branch.

Thanks,
Michal

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


Re: [U-Boot] [PATCH 7/7] sunxi: Add environment settings to make extlinux.conf booting work

2014-08-05 Thread Hans de Goede
Hi,

On 08/04/2014 11:29 PM, Ian Campbell wrote:
 On Fri, 2014-08-01 at 15:05 -0500, Dennis Gilmore wrote:
 On Fri, 01 Aug 2014 12:57:31 -0600
 Stephen Warren swar...@wwwdotorg.org wrote:

 On 08/01/2014 01:46 AM, Hans de Goede wrote:
 Automatic booting using an extlinux.conf file requires various
 environment variables to be set.

 Acked-by: Stephen Warren swar...@nvidia.com

 I'd personally be tempted to set fdt_high=0x, 
 initrd_high=0x to stop U-Boot copying the DT/initrd from the 
 load location to some other location under 256M, but that's just an 
 optimization and entirely optional.

 There has been quite a few times where using 0xff has caused
 issues. I really think you should set bootm_size to something
 reasonable.
 
 Which we do FWIW, bootm_size=0x1000\0 is retained by this patch. I
 think this was discussed/agreed during the initial upstreaming (but I've
 not checked the archives to confirm my recollection)

Right, and that is 256M which is the smallest amount of memory found
on any allwinner board (there is only one 256M board, all others
are 512M or more).

Regards,

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


Re: [U-Boot] [PATCH 7/7] sunxi: Add environment settings to make extlinux.conf booting work

2014-08-05 Thread Hans de Goede
Hi,

On 08/04/2014 11:27 PM, Ian Campbell wrote:
 On Fri, 2014-08-01 at 09:46 +0200, Hans de Goede wrote:
 Automatic booting using an extlinux.conf file requires various environment
 variables to be set.
  
 -#define CONFIG_SYS_LOAD_ADDR0x4800 /* default load 
 address */
 +#define CONFIG_SYS_LOAD_ADDR0x4200 /* default load 
 address */
  
  /* standalone support */
 -#define CONFIG_STANDALONE_LOAD_ADDR 0x4800
 +#define CONFIG_STANDALONE_LOAD_ADDR 0x4200
 
 I think these two changes need to be explained in the commit log.
 Otherwise looks good.

Good idea, I'll amend the commit log for this.

Regards,

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


[U-Boot] u-boot ppc does not work with gcc 4.8

2014-08-05 Thread Dirk Eibach
In my latest u-boot builds I had some strange behaviour that I finally
tracked down to not fixed up flash addresses in relocated u-boot.
These addresses come from symbols in the .data.rel.ro.local section
that is not handled by u-boot linker scripts at the moment.

Some background on relro: http://www.airs.com/blog/archives/189

Joerg Albert already inquired about this on the gcc ML:
https://gcc.gnu.org/ml/gcc-help/2014-02/msg00017.html and he already
suggested a solution:
https://gcc.gnu.org/ml/gcc-help/2014-02/msg00054.html

So there a three things to notice:
1. Do not use gcc 4.8 and u-boot at the moment.
2. You might not notice that you have a problem until you erase u-boot
from flash (and get your cache flushed).
3. Handling relro properly should be on the TODO-List

Maybe this is already common knowledge an maybe somebody is already
working on this - but I did not notice yet. So in this case: sorry for
the noise :)

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


Re: [U-Boot] [PATCH v1] arm: include config.h in vectors.S

2014-08-05 Thread Chris Packham
On 14/07/14 17:01, Chris Packham wrote:
 In order to use configuration flags it is necessary to include config.h.
 Without this arm targets that use CONFIG_USE_IRQ or CONFIG_SPL_BUILD
 won't get the correct code.
 
 Signed-off-by: Chris Packham judge.pack...@gmail.com
 ---
 Resent without corporate disclaimer
 
  arch/arm/lib/vectors.S |1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/arch/arm/lib/vectors.S b/arch/arm/lib/vectors.S
 index e6538ef..a8b6c53 100644
 --- a/arch/arm/lib/vectors.S
 +++ b/arch/arm/lib/vectors.S
 @@ -12,6 +12,7 @@
   *
   * SPDX-License-Identifier:  GPL-2.0+
   */
 +#include config.h
  
  /*
   *
 

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


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

2014-08-05 Thread Masahiro Yamada
Hi Chin Liang See,


Ping again.


Is your v9 patch ready?

We have made lots of effort
to review and test this driver.

I want this patch on the mainline
and I need your help for that.

Please send v9.


Thanks

Masahiro Yamada





On Fri, 11 Jul 2014 20:59:26 +0900
Masahiro Yamada yamad...@jp.panasonic.com wrote:

 Hi Chin,
 
 
 Could you fix the problems Scott pointed out
 and post v9?
 
 I am really looking forward this patch on the mainstream
 and I believe we are almost there.
 
 I need your help to get to our goal.
 
 
 Thanks,
 
 Masahiro Yamada
 
 
 
 On Wed, 18 Jun 2014 20:42:32 -0500
 Chin Liang See cl...@altera.com wrote:
 
  On Tue, 2014-06-10 at 21:45 +0900, Masahiro Yamada wrote:
   Hi Chin,
   
   
   On Tue, 10 Jun 2014 00:42:19 -0500
   Chin Liang See cl...@altera.com wrote:
   
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
   
   
   Thanks for posting v8 when you are busy!
   
   Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
   Reviewed-by: Masahiro Yamada yamad...@jp.panasonic.com
   Tested-by: Masahiro Yamada yamad...@jp.panasonic.com
   
   
   
   Scott,
   Could you apply this patch please?
   
   
  
  
  Thanks Masahiro
  
  Hi Scott / Tom,
  
  Can you help to apply this patch?
  Thanks
  
  Chin Liang
  
   
   Best Regards
   Masahiro Yamada
   
 
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot

--
パナソニック(株) システムLSI事業部
第二事業ディビジョン
開発グループ 第三開発チーム
山田 真弘 yamad...@jp.panasonic.com
〒617-8520  京都府長岡京市神足焼町1番地
外線 : 050-3783-5420
内線 : 7-664-2813, 社内ポスト: 664-772

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 06/15] kirkwood: kconfig: refactor Kconfig and defconfig

2014-08-05 Thread Luka Perkov
Hi Masahiro,

On Mon, Aug 04, 2014 at 10:19:19PM +0900, Masahiro Yamada wrote:
 Becuase the board select menu in arch/arm/Kconfig is too big,
 move the KirkWood board select menu to kirkwood/Kconfig.
 
 Consolidate also common settings (CONFIG_SYS_CPU=arm926ejs and
 CONFIG_SYS_SOC=kirkwood).
 
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Cc: Prafulla Wadaskar prafu...@marvell.com
 ---

I have just a few minor style comments below...

 +config TARGET_DREAMPLUG
 + bool Dreamplug Board

This sould be DramPlug Board.

 +config TARGET_GURUPLUG
 + bool Guruplug Board

This sould be GuruPlug Board.

 +config TARGET_SHEEVAPLUG
 + bool Sheevaplug Board

This sould be SheevaPlug Board.

 +config TARGET_IB62X0
 + bool Ib62x0 Board

This sould be ib62x0 Board.

 +config TARGET_GOFLEXHOME
 + bool Goflexhome Board

This sould be GoFlex Home Board.

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


Re: [U-Boot] mmc: question about capacity detection

2014-08-05 Thread Hannes Petermaier

On 2014-08-05 09:20, Hannes Petermaier wrote:

hi folks,

i am actually trying to enable the enhanced data area on an 4GB emmc 
device, this i've done successfully with the linux mmc-utils and the 
card has after this partitioning 2GB user-partition.


Linux kernel deals correctly with the card.

U-Boot doesn't:


MMC: block number 0x301 exceeds max(0x0)
spl: mmc blk read err - 0
### ERROR ### Please RESET the board ###


So i debugged around and found the capacity-calculation, which i don't 
fully understand.


if (mmc-high_capacity) {
csize = (mmc-csd[1]  0x3f)  16
| (mmc-csd[2]  0x)  16;
cmult = 8;
} else {
csize = (mmc-csd[1]  0x3ff)  2
| (mmc-csd[2]  0xc000)  30;
cmult = (mmc-csd[2]  0x00038000)  15;
}

The else path does for my opinion the right calculation according the 
mmc-specification, the high_capacity path i do not understand at 
all, neither i found some specification for this.


In fact my 4GB card (with 2GB enhanced area) works only with the 
else path.

my csd Registers:

MMC-card dection:
ocr: 0xc0ff8080
csd[0] : 0xd04f0132
csd[1] : 0x0f5a13ff
csd[2] : 0xffe7
csd[3] : 0x8a4000f1
c_size : 0x003f
c_mult : 0x0008

U-Boot (BuR V2.0)# mmc info
Device: OMAP SD/MMC
Manufacturer ID: fe
OEM: 14e
Name: MMC04
Tran Speed: 5200
Rd Block Len: 512
MMC version 4.41
High Capacity: Yes
Capacity: 4 TiB
Bus Width: 1-bit

any ideas ?

best regards,
Hannes

I've digged a bit deeper and found an (for me, as newbie in this) 
interesting webpage:


http://www.hjreggel.net/cardspeed/special-sd.html

there i've found the key to understand the high_capacity path:
...In CSD Version 2.0, the C_SIZE field was extended to 22 bit. The 
C_SIZE_MULT was dropped, assuming a preset multiplier of 2^10 . The 
READ_BL_LEN was kept, but the only value allowed is 9, indicating a 
block length of 512 bytes.


So the code should be as following:

-   if (mmc-high_capacity) {
+   if (mmc-high_capacity  mmc-read_bl_len == MMC_MAX_BLOCK_LEN) {

i'am correct in my thinking ? please some comment.
if yes - i will format a patch for this

best regards,
Hannes




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


Re: [U-Boot] [PATCH 0/15] arm: kconfig: move board select menus and other settings to SoC dir

2014-08-05 Thread Michal Simek
On 08/04/2014 03:19 PM, Masahiro Yamada wrote:
 There are lots of boards supported in ARM architecture.
 The board select menu in arch/arm/Kconfig is already too fat.
 
 This series introduces platform select between arch select and
 board select.
 
   ARCH select (ARM)
|-- Platform select
|-- Board select
 
 Many (not all) of boards have been moved to $(SOC)/Kconfig.
 
 I built all the boards and confirmed the same binareis are
 produced with/without thie series.
 
  Prerequisites
  -
 Apply
 http://patchwork.ozlabs.org/patch/374416/
 to avoid a conflict in doc/README.scrapyard
 
 Apply
 http://patchwork.ozlabs.org/patch/375467/
 to avoid a conflict in configs/jetson-tk1_defconfig
 

Any repo/branch will be more then helpful.

Thanks,
Michal

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




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


Re: [U-Boot] [PATCH 06/15] kirkwood: kconfig: refactor Kconfig and defconfig

2014-08-05 Thread Masahiro Yamada
Hi Luka,



On Tue, 5 Aug 2014 10:54:56 +0200
Luka Perkov l...@openwrt.org wrote:

 Hi Masahiro,
 
 On Mon, Aug 04, 2014 at 10:19:19PM +0900, Masahiro Yamada wrote:
  Becuase the board select menu in arch/arm/Kconfig is too big,
  move the KirkWood board select menu to kirkwood/Kconfig.
  
  Consolidate also common settings (CONFIG_SYS_CPU=arm926ejs and
  CONFIG_SYS_SOC=kirkwood).
  
  Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
  Cc: Prafulla Wadaskar prafu...@marvell.com
  ---
 
 I have just a few minor style comments below...
 
  +config TARGET_DREAMPLUG
  +   bool Dreamplug Board
 
 This sould be DramPlug Board.

I assume this is a typo.

DreamPlug Board  ?



I will fix in v2.

Thanks for pointing out it.



Best Regards
Masahiro Yamada

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


Re: [U-Boot] Quick guide to Kconfig

2014-08-05 Thread Ian Campbell
On Mon, 2014-08-04 at 17:35 +0200, Hans de Goede wrote:
 Hi,
 
 On 08/04/2014 04:27 PM, Tom Rini wrote:
  On Fri, Aug 01, 2014 at 01:37:54PM +0900, Masahiro Yamada wrote:
  
  [snip]
  We had multiple entries in boards.cfg per board
  (with some differences in the options field)
  and I generated the correspoing defconfig files.
 
  But I guess it would be painful to maintain lots of defconfigs.
 
  I expect board maintainers will consolidate defconfigs like you are
  trying to do, and eventually, we will have one defconfig per board in
  the future.
  
  So I was thinking about this a bit this morning since I have lots of
  defconfigs I want to merge together as well (see am335x_evm*).  I
  suspect the answer is board maintainers will want a README in their
  directory.  But today we're inconsistent in a few places.  First, it's
  most often board/.../README but we have a few README.somethings (I'm
  guilty there too.  And despite 702e601 we have some board-level (I'd
  consider at least) details in docs/ still.
  
  Would board/sunxi/README work for the sunxi cases?  Or is that going to
  get too unwieldy?
 
 board/sunxi/README will work fine for sunxi documentation as far as I
 can see right now.

A bunch of the sort of thing I imaging would be there probably ought
instead to go into Kconfig help sections for the symbols which they are
documenting.

Ian.


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


Re: [U-Boot] [PATCH v2 00/16] sunxi: Allwinner A10/A13/A20 DRAM controller fixes

2014-08-05 Thread Hans de Goede
Hi,

On 08/05/2014 09:02 AM, Ian Campbell wrote:
 On Sun, 2014-08-03 at 05:32 +0300, Siarhei Siamashka wrote:
 This is version 2 of
 http://lists.denx.de/pipermail/u-boot/2014-July/183981.html

 Rebased on git://git.denx.de/u-boot-sunxi.git master branch (commit
 3340eab26d89176dd0bf543e6d2590665c577423 sun7i: Add bananapi board)
 
 This all looks great, thanks!

Indeed, many thanks for working on this and for the rebase.

 I think this should be the primary subject of the next sunxi PR. A
 change of this magnitude really ought to be in an rc1 so hopefully there
 won't be any significant changes required (it doesn't look like there
 should be to me).
 
 I'm AFK from tomorrow until after when I expect rc1 to be so I'm not
 around to prepare a PR -- Hans can you take care of it (if you agree
 with my assessment of the patches, of course)? I've delegated them to
 you in pw in anticipation.

Ok, I've also reviewed this, and ran some tests, and this looks good,
I agree with trying to get this into RC-1.

But currently we already have a pull-req pending for Albert. So for
now I've pushed this to u-boot-sunxi/next, with u-boot-sunxi/master
still reflecting the pull-req send to Albert.

I guess it is probably best to send a new pull-req to Albert
superseding the old one. Albert how would you prefer to handle this ?

Regards,

Hans


p.s.

Siarhei Siamashka, I've seen your Single u-boot binary patches,
and I'll try to review them during the coming days.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/15] arm: kconfig: move board select menus and other settings to SoC dir

2014-08-05 Thread Masahiro Yamada
Hi Michal,



On Tue, 05 Aug 2014 11:04:14 +0200
Michal Simek mon...@monstr.eu wrote:

 On 08/04/2014 03:19 PM, Masahiro Yamada wrote:
  There are lots of boards supported in ARM architecture.
  The board select menu in arch/arm/Kconfig is already too fat.
  
  This series introduces platform select between arch select and
  board select.
  
ARCH select (ARM)
 |-- Platform select
 |-- Board select
  
  Many (not all) of boards have been moved to $(SOC)/Kconfig.
  
  I built all the boards and confirmed the same binareis are
  produced with/without thie series.
  
   Prerequisites
   -
  Apply
  http://patchwork.ozlabs.org/patch/374416/
  to avoid a conflict in doc/README.scrapyard
  
  Apply
  http://patchwork.ozlabs.org/patch/375467/
  to avoid a conflict in configs/jetson-tk1_defconfig
  
 
 Any repo/branch will be more then helpful.


OK. Please try:

git clone git://github.com/masahir0y/u-boot-kbuild.git
cd u-boot-kbuild
git checkout arm-refactor



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 1/5] mx6: imx-regs: Remove unused 'omux' field from iomux struct

2014-08-05 Thread Stefano Babic
Hi Fabio,

On 01/08/2014 13:49, Fabio Estevam wrote:
 From: Fabio Estevam fabio.este...@freescale.com
 
 'omux' field is not used anywhere and such layout is not valid for mx6solox.
 
 Instead of adding more ifdef's into the structure, let's simply remove this 
 unused 'omux' field.
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---
  arch/arm/include/asm/arch-mx6/imx-regs.h | 2 --
  1 file changed, 2 deletions(-)
 
 diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h 
 b/arch/arm/include/asm/arch-mx6/imx-regs.h
 index 437b434..d4ce8a8 100644
 --- a/arch/arm/include/asm/arch-mx6/imx-regs.h
 +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
 @@ -404,8 +404,6 @@ struct iomuxc {
   u8 reserved[0x4000];
  #endif
   u32 gpr[14];
 - u32 omux[5];
 - /* mux and pad registers */
  };
  
  #define IOMUXC_GPR2_COUNTER_RESET_VAL_OFFSET 20
 

No issues with the whole series. I will apply it to u-boot-imx.

Acked-by: Stefano Babic sba...@denx.de

Regards,
Stefano

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


Re: [U-Boot] [PATCH 06/15] kirkwood: kconfig: refactor Kconfig and defconfig

2014-08-05 Thread Luka Perkov
Hi Masahiro,

On Tue, Aug 05, 2014 at 06:08:21PM +0900, Masahiro Yamada wrote:
 On Tue, 5 Aug 2014 10:54:56 +0200
   +config TARGET_DREAMPLUG
   + bool Dreamplug Board
  
  This sould be DramPlug Board.
 
 I assume this is a typo.
 
 DreamPlug Board  ?

Yes, sorry.

 I will fix in v2.

Great, thanks.

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


[U-Boot] hw_watchdog

2014-08-05 Thread and...@polkaspots.com

How can I find out if hw_watchdog is enabled on my U-Boot?
Is there a timing variable that I need to set in u-boot-env
Or that part of the code is executed earlier.

Bassically what im experienceing is that sometimes, in some unknown 
conditions, U-Boot will freeze, at the point when is relocating to RAM. 
I belive.

O dont get anything else after DRAM:  64 M.

Kernel which I'm using is 3.10.
Any advice will be very much appreciated.

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


Re: [U-Boot] [PATCH] video: add cfb console driver for sunxi

2014-08-05 Thread Hans de Goede
Hi,

On 08/02/2014 06:14 PM, Luc Verhaegen wrote:
 This adds a fixed mode hdmi driver (lcd to be added in future) for the
 sunxi platform. Current config is such that 8MB is shaved off at the top
 of the RAM. Simplefb support is available for kernels that know how to
 use it.

I've been trying to follow all the discussion in this thread, and here
is what I think we should do:

1) There has been some discussion about using this console-driver
in u-boot without generating the simplefb dt node. This means yet another
variation in how all the bits fit together, so I don't think we should do
this. Note I realize that the original patch did not have a specific
config option for this, but it was mentioned later in the thread.
TL;DR: Enabling the console driver will always generate the simplefb dt
node.

2) I think we can worry about what to do with the reserved memory\when not 
using simplefb
(or when switching from simplefb to kms) later. For now lets focus on the
issue with the clocks.

3) To me the issue with clocks seems simple, we should modify the
devicetree binding for simplefb to support a clocks property, and modify
the simplefb kernel code to get + prep_and_enable any clocks specified
in the dt node.

This means parsing enough of the dt to find the clocks to be able to
specify phandles to them in the added node. I don't know how hard it will
be to do this in u-boot, but IMHO it is simply the right thing to do, so
this is how it should be done.

If others agree that specifying the clocks in the simplefb dt node is
the right way to ensure that the clocks don't get enabled I'm willing
at taking a shot on coding this.

Regards,

Hans



 
 Signed-off-by: Luc Verhaegen l...@skynet.be
 ---
  arch/arm/include/asm/arch-sunxi/sunxi_display.h |   21 +
  board/sunxi/board.c |   14 +
  drivers/video/Makefile  |1 +
  drivers/video/sunxi_display.c   |  639 
 +++
  include/configs/sunxi-common.h  |   34 ++
  5 files changed, 709 insertions(+), 0 deletions(-)
  create mode 100644 arch/arm/include/asm/arch-sunxi/sunxi_display.h
  create mode 100644 drivers/video/sunxi_display.c
 
 diff --git a/arch/arm/include/asm/arch-sunxi/sunxi_display.h 
 b/arch/arm/include/asm/arch-sunxi/sunxi_display.h
 new file mode 100644
 index 000..4456778
 --- /dev/null
 +++ b/arch/arm/include/asm/arch-sunxi/sunxi_display.h
 @@ -0,0 +1,21 @@
 +/*
 + * (C) Copyright 2014 Luc Verhaegen l...@skynet.be
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation's version 2 and any
 + * later version the License.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + */
 +#ifndef _SUNXI_DISPLAY_H_
 +#define _SUNXI_DISPLAY_H_
 +
 +#ifdef CONFIG_VIDEO_DT_SIMPLEFB
 +void sunxi_simplefb_setup(void *blob);
 +#endif
 +
 +#endif /* _SUNXI_DISPLAY_H_ */
 diff --git a/board/sunxi/board.c b/board/sunxi/board.c
 index 2179e23..e819b12 100644
 --- a/board/sunxi/board.c
 +++ b/board/sunxi/board.c
 @@ -26,6 +26,10 @@
  #include asm/io.h
  #include net.h
  
 +#ifdef CONFIG_VIDEO
 +#include asm/arch-sunxi/sunxi_display.h
 +#endif
 +
  DECLARE_GLOBAL_DATA_PTR;
  
  /* add board specific code here */
 @@ -185,3 +189,13 @@ int misc_init_r(void)
   return 0;
  }
  #endif
 +
 +#ifdef CONFIG_OF_BOARD_SETUP
 +void
 +ft_board_setup(void *blob, bd_t *bd)
 +{
 +#ifdef CONFIG_VIDEO_DT_SIMPLEFB
 + sunxi_simplefb_setup(blob);
 +#endif
 +}
 +#endif /* CONFIG_OF_BOARD_SETUP */
 diff --git a/drivers/video/Makefile b/drivers/video/Makefile
 index 945f35d..9a25c84 100644
 --- a/drivers/video/Makefile
 +++ b/drivers/video/Makefile
 @@ -38,6 +38,7 @@ obj-$(CONFIG_VIDEO_SANDBOX_SDL) += sandbox_sdl.o
  obj-$(CONFIG_VIDEO_SED13806) += sed13806.o
  obj-$(CONFIG_VIDEO_SM501) += sm501.o
  obj-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o videomodes.o
 +obj-$(CONFIG_VIDEO_SUNXI) += sunxi_display.o
  obj-$(CONFIG_VIDEO_TEGRA) += tegra.o
  obj-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o
  obj-$(CONFIG_FORMIKE) += formike.o
 diff --git a/drivers/video/sunxi_display.c b/drivers/video/sunxi_display.c
 new file mode 100644
 index 000..251fb67
 --- /dev/null
 +++ b/drivers/video/sunxi_display.c
 @@ -0,0 +1,639 @@
 +/*
 + * (C) Copyright 2013-2014 Luc Verhaegen l...@skynet.be
 + *
 + * Display driver for Allwinner SoCs.
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation's version 2 and any
 + * later version the License.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; 

Re: [U-Boot] [PATCH v2 1/3] image: introduce genimg_get_kernel_addr()

2014-08-05 Thread Simon Glass
On 4 August 2014 18:43, Bryan Wu coolo...@gmail.com wrote:
 Kernel address is normally stored as a string argument of bootm or bootz.
 This function is taken out from boot_get_kernel() of bootm.c, which can be
 reused by others.

 Signed-off-by: Bryan Wu pe...@nvidia.com
 Tested-by: Stephen Warren swar...@nvidia.com
 Reviewed-by: Stephen Warren swar...@nvidia.com

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


Re: [U-Boot] [PATCH v2 3/3] bootm: use genimg_get_kernel_addr()

2014-08-05 Thread Simon Glass
On 4 August 2014 18:43, Bryan Wu coolo...@gmail.com wrote:
 Use the new API which is originally taken out from boot_get_kernel
 of bootm.c

 Signed-off-by: Bryan Wu pe...@nvidia.com
 Tested-by: Stephen Warren swar...@nvidia.com
 Reviewed-by: Stephen Warren swar...@nvidia.com

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


Re: [U-Boot] [PATCH 12/18] arm: mx6: add support for Compulab cm-fx6 CoM

2014-08-05 Thread Marek Vasut
On Tuesday, August 05, 2014 at 09:36:27 AM, Nikita Kiryanov wrote:

[...]

  imx_ddr_size() won't cut it here ?
  
  It doesn't handle 4GB correctly (returns 0). I suppose
  I can make a patch which caps the return value of
  imx_ddr_size() for MX6 socs to 3840MB.
  What do you think?
  
  That you should check the U-Boot ML, since that's what I did yesterday
  ;-) But still, this is rather sad practice -- instead of fixing a bug in
  code which you do know about, you implement such a workaround :-(
 
 Actually, I only learned of this bug yesterday after you asked about
 imx_ddr_size(). Glad to hear you already fixed it; I'll look at it for
 the v2.

I did the capping, yep. HTH :)

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


Re: [U-Boot] hw_watchdog

2014-08-05 Thread Hannes Petermaier

On 2014-08-05 13:07, and...@polkaspots.com wrote:

How can I find out if hw_watchdog is enabled on my U-Boot?
Is there a timing variable that I need to set in u-boot-env
Or that part of the code is executed earlier.

Bassically what im experienceing is that sometimes, in some unknown 
conditions, U-Boot will freeze, at the point when is relocating to 
RAM. I belive.

O dont get anything else after DRAM:  64 M.

Kernel which I'm using is 3.10.
Any advice will be very much appreciated.

Thanks.



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

Hi andrew,
on which plattform you are ?

best regards,
hannes

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


Re: [U-Boot] [PATCH 1/3] config: introduce a generic $bootcmd

2014-08-05 Thread Simon Glass
Hi Stephen  Dennis,

On 4 August 2014 12:04, Stephen Warren swar...@wwwdotorg.org wrote:
 On 08/04/2014 04:13 AM, Simon Glass wrote:

 Hi Stephen,

 On 31 July 2014 17:00, Stephen Warren swar...@wwwdotorg.org wrote:

 On 07/31/2014 04:03 PM, Simon Glass wrote:


 Hi Stephen,

 On 30 July 2014 23:37, Stephen Warren swar...@wwwdotorg.org wrote:


 From: Dennis Gilmore den...@ausil.us

Thanks for the doc pointers.


 This generic $bootcmd, and associated support macros, automatically
 searches a defined set of storage devices (or network protocols) for an
 extlinux configuration file or U-Boot boot script in various
 standardized
 locations. Distros that install such a boot config file/script in those
 standard locations will get easy-to-set-up booting on HW that enables
 this generic $bootcmd.

 Boards can define the set of devices from which boot is attempted, and
 the order in which they are attempted. Users may later customize this
 set/order by edting $boot_targets.

 Users may interrupt the boot process and boot from a specific device
 simply by executing e.g.:

 $ run bootcmd_mmc1
 or:
 $ run bootcmd_pxe

 This patch was originally written by Dennis Gilmore based on Tegra and
 rpi_b boot scripts. I have made the following modifications since then:

 * Boards must define the BOOT_TARGET_DEVICES macro in order to specify
 the set of devices (and order) from which to attempt boot. If
 needed,
 we can define a default directly in config_distro_bootcmd.h.

 * Removed $env_import and related variables; nothing used them, and I
 think it's better for boards to pre-load an environment
 customization
 file using CONFIG_PREBOOT if they need.

 * Renamed a bunch of variables to suit my whims:-)

 Signed-off-by: Dennis Gilmore den...@ausil.us
 Signed-off-by: Stephen Warren swar...@nvidia.com



 I do understand the desirability of getting something sorted in this
 area. But I am not thrilled with all the macro magic. How does this
 fit with the new Kconfig setup? It encourages a single setting for
 each variable, and I feel that the #ifdefs are not compatible with
 that.



 I think Kconfig would be completely unsuitable for this kind of detailed
 configuration. Kconfig is great for enabling/disabling features, but
 applying it here feels too much to me. Equally, Kconfig is rather new in
 U-Boot. It'd be better to enable the feature so that distros can rely on
 it,
 and then refactor it later if required.


 Are you saying that we can reimplement this in a nicer way and distros
 will still see the same behaviour?


 I expect we could.

 The only thing distros should rely upon is that if they put extlinux.conf in
 the right directory on their media, it will get loaded and executed.

 There are obviously various ways that could be implemented in U-Boot, or
 indeed other bootloaders.

OK, that makes me more comfortable.



 I do feel that actually implementing the boot script as U-Boot
 environment
 variables is much preferred over hard-coding any algorithm into U-Boot.
 That
 way, the user can easily modify the scripts as they desire. If we just
 put
 e.g. $boot_targets into the environment or DT, but none of the other
 scripts
 in this patch, the user would be much more severely restricted in how
 they
 could reconfigure the system to act how they want.


 But that worries me. It means that it is easy for one board to deviate
 from what is essentially an undocumented boot standard, and then we
 will end up having to support that use case in the future.

 Or if it is documented, where is that?


 I was talking about an end-user changing the boot process.

 An individual board could only change the boot scripts by either not using
 config_distro_bootcmd.h, or by explicitly overriding something that it does.
 Either of those would simply mean that the board doesn't provide the
 standard boot environment to distros, and as such wouldn't be expected to
 boot distros in the standard way.

OK, so long as that is clear then all is well. I thought you meant the
board author could change the scripts in order to tweak the process.


 Note that all we're talking about here is that U-Boot can search all (or
 perhaps most) attached storage devices for extlinux.conf and interpret it
 correctly. This patch adds the search for part; the definition of
 interpret it correctly is already part of the implementation of the pxe
 and sysboot commands in U-Boot.

OK.



 Would it be possible to put the settings in the device tree somehow
 instead of CONFIGs?



 At least part of the information isn't a HW description, but rather
 user-/vendor configuration. So, I don't think it's appropriate to put
 this
 into DT. Equally, very few U-Boot platforms currently use DT, and I
 certainly hope it doesn't become mandatory in any way. So, using DT for
 this
 purpose would severely limit the platforms where this feature was
 available.


 The only platforms I see support for in your series are Tegra (which
 has DT) and Raspberry 

Re: [U-Boot] SPL broken on i.mx31 platforms

2014-08-05 Thread Fabio Estevam
Hi Magnus,

On Mon, Aug 4, 2014 at 5:23 PM, Magnus Lilja lilja.mag...@gmail.com wrote:

 I have now done some tests on i.MX31 PDK:
 * v2013.04 and v2014.04 works
 * v2014.07 and tip of tree as of this mail does not work

 To make it work (both v2014.07 and tip of tree) I only have to change
 the ldr pc, _reset to b reset. I do not have to apply the nop-part
 of the patch.

Could you please submit this change as a formal patch to the list?
Please Cc Albert Aribaud on it.

 On a different note I noticed that I received a warning that the PDK
 board does not use generic board, I will try to fix this but I don't
 know how much work that is and when I can submit a patch.

Just add #define CONFIG_SYS_GENERIC_BOARD into the board config file
and give it a try.

If it works, please send this patch as well (with Stefano Babic on Cc).

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


Re: [U-Boot] SPL broken on i.mx31 platforms

2014-08-05 Thread Magnus Lilja
Hi Fabio,

On 5 August 2014 14:28, Fabio Estevam feste...@gmail.com wrote:
 Hi Magnus,

 On Mon, Aug 4, 2014 at 5:23 PM, Magnus Lilja lilja.mag...@gmail.com wrote:

 I have now done some tests on i.MX31 PDK:
 * v2013.04 and v2014.04 works
 * v2014.07 and tip of tree as of this mail does not work

 To make it work (both v2014.07 and tip of tree) I only have to change
 the ldr pc, _reset to b reset. I do not have to apply the nop-part
 of the patch.

 Could you please submit this change as a formal patch to the list?
 Please Cc Albert Aribaud on it.

I would expect Helmut to create a formal patch then I can test that
and add a Tested-by.

 On a different note I noticed that I received a warning that the PDK
 board does not use generic board, I will try to fix this but I don't
 know how much work that is and when I can submit a patch.

 Just add #define CONFIG_SYS_GENERIC_BOARD into the board config file
 and give it a try.

 If it works, please send this patch as well (with Stefano Babic on Cc).

That I can do.

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


Re: [U-Boot] [PATCH 01/18] spl: improve spi configuration

2014-08-05 Thread Nikita Kiryanov



On 03/08/14 16:44, Marek Vasut wrote:

On Sunday, August 03, 2014 at 09:34:31 AM, Nikita Kiryanov wrote:

Currently we can define CONFIG_SPL_SPI_any parameter except SPI MODE.
Define CONFIG_SPL_SPI_MODE option, and provide a default value for
backwards compatibility.
Default values are also provided for the rest of the spi_flash_probe
parameters (like we do in cmd_sf), to help with config file brevity.

Cc: Jagannadha Sutradharudu Teki jagannadh.t...@gmail.com
Cc: Tom Rini tr...@ti.com
Signed-off-by: Nikita Kiryanov nik...@compulab.co.il


You might actually be even more bold and check if you cannot fall back to the
CONFIG_DEFAULT_SPI_MODE etc. What do you think ?


Not a fan of the idea. It will:
- Complicate the #ifdefs
- Complicate the relationship between CONFIG_DEFAULT_SPI_* and
  CONFIG_SPL_SPI_* #defines
- Not get much use: most boards do not #define CONFIG_DEFAULT_SPI_*
  values in the config files, and of the ones that do, only two
  (dra7xx_evm and cm_fx6) use SPI in SPL.


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 v3 1/4] usb/gadget: fastboot: add sparse image definitions

2014-08-05 Thread Tom Rini
On Thu, Jul 31, 2014 at 10:32:51AM -0700, Steve Rae wrote:
 
 
 On 14-07-30 06:25 PM, Marek Vasut wrote:
 On Thursday, June 26, 2014 at 10:13:21 PM, Steve Rae wrote:
 - to prepare for the support of fastboot sparse images
 
 Signed-off-by: Steve Rae s...@broadcom.com
 ---
 This file is ASIS from:
 
 https://raw.githubusercontent.com/AOSB/android_system_core/master/libspars
 e/sparse_format.h (commit 28fa5bc347390480fe190294c6c385b6a9f0d68b)
 except for the __UBOOT__ conditional include.
 
 Changes in v3: None
 Changes in v2: None
 
   include/sparse_format.h | 58
 + 1 file changed, 58
 insertions(+)
   create mode 100644 include/sparse_format.h
 
 diff --git a/include/sparse_format.h b/include/sparse_format.h
 new file mode 100644
 index 000..21fbd05
 --- /dev/null
 +++ b/include/sparse_format.h
 @@ -0,0 +1,58 @@
 +/*
 + * Copyright (C) 2010 The Android Open Source Project
 + *
 + * Licensed under the Apache License, Version 2.0 (the License);
 + * you may not use this file except in compliance with the License.
 + * You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing, software
 + * distributed under the License is distributed on an AS IS BASIS,
 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 implied. + * See the License for the specific language governing
 permissions and + * limitations under the License.
 
 Please use the SPDX licence identifiers (pelase see Licenses/README)?

And again, the license itself _is_ a problem.

[snip]
 To clarify:
 I am taking this file ASIS from the location stated in the commit
 message
 Do we _really_ want to modify _anything_ in this file (especially
 when the content is not changing); or do we want to leaving it
 pristine?

I'd be fine with it being pristine if it was a GPL-compatible license.

-- 
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 v5 05/11] exynos: dts: Adjust device tree files for U-Boot

2014-08-05 Thread Tom Rini
On Mon, Aug 04, 2014 at 02:46:02PM -0600, Simon Glass wrote:
 Hi Tom,
 
 On 4 August 2014 09:54, Tom Rini tr...@ti.com wrote:
  On Mon, Aug 04, 2014 at 06:01:58AM -0600, Simon Glass wrote:
  Hi Tom,
 
  On 30 July 2014 09:34, Simon Glass s...@chromium.org wrote:
   Hi Tom,
  
   On 28 July 2014 21:27, Tom Rini tr...@ti.com wrote:
   On Mon, Jul 28, 2014 at 06:11:32AM -0600, Simon Glass wrote:
  
   The pinctrl bindings used by Linux are an incomplete description of the
   hardware. It is possible in most cases to determine the register 
   address
   of each, but not in all cases. By adding an additional property we can
   fix this, and avoid adding a table to U-Boot for every single Exynos
   SOC.
  
   So here's my fear..
  
   [snip]
   @@ -49,7 +57,7 @@
 i2c@12ca {
 #address-cells = 1;
 #size-cells = 0;
   - compatible = samsung,s3c2440-i27c;
   + compatible = samsung,s3c2440-i2c;
 reg = 0x12CA 0x100;
 interrupts = 0 60 0;
 };
  
   Except for the above (what's going on? pulling in a typo fix from
   upstream?) they're legal regular non-U-Boot-prefixed changes.  Are
   they going back into the master copy in Linux?
  
   Oops I missed this email. The typo is just my mistake - we don't need
   this change and the typo is in the previous patch.
  
  
   diff --git a/arch/arm/dts/exynos5420-pinctrl.dtsi 
   b/arch/arm/dts/exynos5420-pinctrl.dtsi
   index b3e63d1..df31f37 100644
   --- a/arch/arm/dts/exynos5420-pinctrl.dtsi
   +++ b/arch/arm/dts/exynos5420-pinctrl.dtsi
   @@ -13,6 +13,18 @@
*/
  
/ {
   + /* Replicate the ordering of 
   arch/arm/include/asm/arch-exynos/gpio.h */
   + pinctrl@1401 {
   + };
   + pinctrl@1340 {
   + };
   + pinctrl@1341 {
   + };
   + pinctrl@1400 {
   + };
   + pinctrl@0386 {
   + };
  
   So this isn't going to head back to Linux, clearly...
  
   Is there some way we can contain our changes under includes perhaps?
  
   I hope that this one could go away, since the order of GPIOs doesn't
   ultimately matter. At present we assume a particular order due to the
   numbering of GPIOs. But once we move to named GPIOs in the device tree
   we can drop this ordering patch.
  
   In general, yes we could create a new include file for the U-Boot
   device tree additions.
 
  Update: I took a look at the includes. I can create a new file, like
  arch/arm/dts/exynos4210-pinctrl.dtsi which I include from
  arch/arm/dts/exynos4210.dtsi. But I think I will still need to modify
  arch/arm/dts/exynos4210.dtsi. The alternative is to put the changes in
  something like exynos4210-u-boot.dtsi and include those in every board
  file that uses that include.
 
  With arch/arm/dts/exynos4210-pinctrl.dtsi + arch/arm/dts/exynos4210.dtsi
  the modification to the later is just to include the former, right?  I'm
  OK with that.
 
 Almost, but we still need the #address-cells and #size-cells
 properties in the pinctrl nodes.

And these, as you said I think, are HW description things that should be
included in the master DT file upstream, right?

-- 
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 01/18] spl: improve spi configuration

2014-08-05 Thread Marek Vasut
On Tuesday, August 05, 2014 at 03:28:04 PM, Nikita Kiryanov wrote:
 On 03/08/14 16:44, Marek Vasut wrote:
  On Sunday, August 03, 2014 at 09:34:31 AM, Nikita Kiryanov wrote:
  Currently we can define CONFIG_SPL_SPI_any parameter except SPI MODE.
  Define CONFIG_SPL_SPI_MODE option, and provide a default value for
  backwards compatibility.
  Default values are also provided for the rest of the spi_flash_probe
  parameters (like we do in cmd_sf), to help with config file brevity.
  
  Cc: Jagannadha Sutradharudu Teki jagannadh.t...@gmail.com
  Cc: Tom Rini tr...@ti.com
  Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
  
  You might actually be even more bold and check if you cannot fall back to
  the CONFIG_DEFAULT_SPI_MODE etc. What do you think ?
 
 Not a fan of the idea. It will:
 - Complicate the #ifdefs
 - Complicate the relationship between CONFIG_DEFAULT_SPI_* and
CONFIG_SPL_SPI_* #defines
 - Not get much use: most boards do not #define CONFIG_DEFAULT_SPI_*
values in the config files, and of the ones that do, only two
(dra7xx_evm and cm_fx6) use SPI in SPL.

On the other hand, it's now only a matter of time until we get CONFIG_TPL_SPI_* 
m which gives us _another_ set of defines. So the question is -- what is your 
proposition to keep the amount of new ad-hoc defines low and cater for this 
case?

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 0/3] Add some missing buildman features and deprecate MAKEALL

2014-08-05 Thread Simon Glass
Hi Tom,

On 4 August 2014 15:23, Tom Rini tr...@ti.com wrote:
 On Mon, Aug 04, 2014 at 02:41:45PM -0600, Simon Glass wrote:
 Hi Tom,

 On 4 August 2014 07:23, Tom Rini tr...@ti.com wrote:
  On Mon, Jul 28, 2014 at 11:53:27PM -0600, Simon Glass wrote:
 
  Buildman has been around for a little over a year and is used by a fair
  number of U-Boot developers. However quite a few people still use MAKEALL.
 
  Buildman was intended to replace MAKEALL, so perhaps now is a good time to
  start that process.
 
  OK, lets start.  First, I had to make up a special directory with
  symlinks to the various toolchains, in order to get them to work with
  buildman, due to the various layouts:
 
  $ ls -l ~/work/u-boot/toolchain-links/
  total 4
  lrwxrwxrwx 1 trini trini 38 Aug  1 17:09 arc_gnu_4.8-R2_prebuilt_uclibc_be 
  - /opt/arc_gnu_4.8-R2_prebuilt_uclibc_be
  lrwxrwxrwx 1 trini trini 38 Aug  1 17:09 arc_gnu_4.8-R2_prebuilt_uclibc_le 
  - /opt/arc_gnu_4.8-R2_prebuilt_uclibc_le
  lrwxrwxrwx 1 trini trini 24 Aug  1 17:10 bfin-elf - 
  /opt/uClinux-45/bfin-elf
  lrwxrwxrwx 1 trini trini 32 Aug  1 17:09 m68k-linux - 
  /opt/gcc-4.9.0-nolibc/m68k-linux
  lrwxrwxrwx 1 trini trini 34 Aug  1 17:09 microblazeel-xilinx-linux-gnu - 
  /opt/microblazeel-xilinx-linux-gnu
  lrwxrwxrwx 1 trini trini 32 Aug  1 17:09 microblaze-xilinx-linux-gnu - 
  /opt/microblaze-xilinx-linux-gnu
  lrwxrwxrwx 1 trini trini 66 Aug  1 17:15 mips32-linux - 
  /opt/eldk-5.2.1/mips/sysroots/i686-eldk-linux/usr/bin/mips32-linux
  lrwxrwxrwx 1 trini trini 36 Aug  1 17:09 nds32le-linux-glibc-v1f - 
  /opt/nds32le/nds32le-linux-glibc-v1f
  lrwxrwxrwx 1 trini trini 20 Aug  1 17:09 sparc-elf-3.4.4 - 
  /opt/sparc-elf-3.4.4
 
  I tried a few things but I couldn't get a toolchain section setup that
  found all of those.  Second:

 OK, can you give me a trace of the output of 'buildman
 --list-tool-chains' - I should be able to figure out what is wrong.

 Sure but I think the problem was I couldn't get it to recurse all the
 way down, just a few levels (which isn't a bad thing exactly, it'd be
 going pretty deep otherwise).

It looks at the path you give, and then appends bin/ and usr/bin as
well. Then it looks for something ending in gcc in each directory. You
may need to specify additional search paths to make this work. My
output with ~/.buildman:

# Buildman settings file

[toolchain]
root: /
#rest: /home/sjg/c/buildall/toolchains/*
#eldk: /opt/eldk4.2/usr/bin
#arm: /home/sjg/c/tools/arm-unknown-eabi
avr32: /home/sjg/c/buildall/toolchains/avr32
#m68k: /home/sjg/c/buildall/toolchains/m68k-linux
m68k: /usr/local/m68k-uclinux-tools
arm: /opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux
eldk: /opt/eldk-5.2.1/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux

[toolchain-alias]
x86: i386

[make-flags]
src=/home/sjg/c/src
chroot=/home/sjg/c/chroot
vboot=USE_STDINT=1 VBOOT_DEBUG=1 MAKEFLAGS_VBOOT=DEBUG=1 CFLAGS_EXTRA_VBOOT=-DUN
ROLL_LOOPS VBOOT_SOURCE=${src}/platform/vboot_reference
chromeos_coreboot=VBOOT=${chroot}/build/link/usr ${vboot}
chromeos_daisy=VBOOT=${chroot}/build/daisy/usr ${vboot}

is:

./tools/buildman/buildman --list-tool-chains
Scanning for tool chains
   - scanning path '/'
  - looking in '/.'
  - looking in '/bin'
  - looking in '/usr/bin'
 - found '/usr/bin/gcc'
Tool chain test:  OK
 - found '/usr/bin/c89-gcc'
Tool chain test:  OK
 - found '/usr/bin/c99-gcc'
Tool chain test:  OK
 - found '/usr/bin/x86_64-linux-gnu-gcc'
Tool chain test:  OK
   - scanning path '/home/sjg/c/buildall/toolchains/avr32'
  - looking in '/home/sjg/c/buildall/toolchains/avr32/.'
  - looking in '/home/sjg/c/buildall/toolchains/avr32/bin'
  - looking in '/home/sjg/c/buildall/toolchains/avr32/usr/bin'
 - found
'/home/sjg/c/buildall/toolchains/avr32/usr/bin/avr32-buildroot-linux-uclibc-gcc'
Tool chain test:  OK
 - found '/home/sjg/c/buildall/toolchains/avr32/usr/bin/avr32-linux-gcc'
Tool chain test:  OK
   - scanning path '/usr/local/m68k-uclinux-tools'
  - looking in '/usr/local/m68k-uclinux-tools/.'
  - looking in '/usr/local/m68k-uclinux-tools/bin'
  - looking in '/usr/local/m68k-uclinux-tools/usr/bin'
   - scanning path
'/opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux'
  - looking in
'/opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux/.'
  - looking in
'/opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux/bin'
 - found
'/opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux/bin/arm-linux-gnueabihf-gcc'
Tool chain test:  OK
  - looking in
'/opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux/usr/bin'
   - scanning path
'/opt/eldk-5.2.1/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux'
  - looking in
'/opt/eldk-5.2.1/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux/.'
 - found
'/opt/eldk-5.2.1/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux/./powerpc-linux-gcc'
Tool chain test:  

Re: [U-Boot] [RFC PATCH v2 0/2] Make Python scripts compatible with older versions

2014-08-05 Thread Tom Rini
On Tue, Aug 05, 2014 at 02:05:20AM +, Yan, Miao wrote:

  OK, what host distribution are you using?  I'm going to guess RHEL5 (or
  compatible)... If so, yes, I think we need to support that as a host 
  platform so
  long as it's still supported by RedHat.
 
 
 It's CentOS 5, which still has several years of life time :-(

That's what I figured, so yes, we need to work there.

-- 
Tom


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


Re: [U-Boot] [PATCH v2 0/3] Add some missing buildman features and deprecate MAKEALL

2014-08-05 Thread Simon Glass
Hi Tom,

On 5 August 2014 08:06, Simon Glass s...@chromium.org wrote:
 Hi Tom,

 On 4 August 2014 15:23, Tom Rini tr...@ti.com wrote:
 On Mon, Aug 04, 2014 at 02:41:45PM -0600, Simon Glass wrote:
 Hi Tom,

 On 4 August 2014 07:23, Tom Rini tr...@ti.com wrote:
[ship]

  I also didn't quite see how to plugin an arm64 toolchain.

 I haven't tried - can you please point me to one and I'll give it a go.

 There should be something newer than
 https://launchpad.net/linaro-toolchain-binaries but I'm failing to find
 it quickly.

 OK I'll take a look.

This line in ~/.buildman works for me:

aarch64: /opt/linaro/gcc-linaro-aarch64-none-elf-4.8-2013.10_linux

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


Re: [U-Boot] [PATCH v2 0/3] Add some missing buildman features and deprecate MAKEALL

2014-08-05 Thread Tom Rini
On Tue, Aug 05, 2014 at 08:06:25AM -0600, Simon Glass wrote:
 Hi Tom,
 
 On 4 August 2014 15:23, Tom Rini tr...@ti.com wrote:
  On Mon, Aug 04, 2014 at 02:41:45PM -0600, Simon Glass wrote:
  Hi Tom,
 
  On 4 August 2014 07:23, Tom Rini tr...@ti.com wrote:
   On Mon, Jul 28, 2014 at 11:53:27PM -0600, Simon Glass wrote:
  
   Buildman has been around for a little over a year and is used by a fair
   number of U-Boot developers. However quite a few people still use 
   MAKEALL.
  
   Buildman was intended to replace MAKEALL, so perhaps now is a good time 
   to
   start that process.
  
   OK, lets start.  First, I had to make up a special directory with
   symlinks to the various toolchains, in order to get them to work with
   buildman, due to the various layouts:
  
   $ ls -l ~/work/u-boot/toolchain-links/
   total 4
   lrwxrwxrwx 1 trini trini 38 Aug  1 17:09 
   arc_gnu_4.8-R2_prebuilt_uclibc_be - 
   /opt/arc_gnu_4.8-R2_prebuilt_uclibc_be
   lrwxrwxrwx 1 trini trini 38 Aug  1 17:09 
   arc_gnu_4.8-R2_prebuilt_uclibc_le - 
   /opt/arc_gnu_4.8-R2_prebuilt_uclibc_le
   lrwxrwxrwx 1 trini trini 24 Aug  1 17:10 bfin-elf - 
   /opt/uClinux-45/bfin-elf
   lrwxrwxrwx 1 trini trini 32 Aug  1 17:09 m68k-linux - 
   /opt/gcc-4.9.0-nolibc/m68k-linux
   lrwxrwxrwx 1 trini trini 34 Aug  1 17:09 microblazeel-xilinx-linux-gnu 
   - /opt/microblazeel-xilinx-linux-gnu
   lrwxrwxrwx 1 trini trini 32 Aug  1 17:09 microblaze-xilinx-linux-gnu - 
   /opt/microblaze-xilinx-linux-gnu
   lrwxrwxrwx 1 trini trini 66 Aug  1 17:15 mips32-linux - 
   /opt/eldk-5.2.1/mips/sysroots/i686-eldk-linux/usr/bin/mips32-linux
   lrwxrwxrwx 1 trini trini 36 Aug  1 17:09 nds32le-linux-glibc-v1f - 
   /opt/nds32le/nds32le-linux-glibc-v1f
   lrwxrwxrwx 1 trini trini 20 Aug  1 17:09 sparc-elf-3.4.4 - 
   /opt/sparc-elf-3.4.4
  
   I tried a few things but I couldn't get a toolchain section setup that
   found all of those.  Second:
 
  OK, can you give me a trace of the output of 'buildman
  --list-tool-chains' - I should be able to figure out what is wrong.
 
  Sure but I think the problem was I couldn't get it to recurse all the
  way down, just a few levels (which isn't a bad thing exactly, it'd be
  going pretty deep otherwise).
 
 It looks at the path you give, and then appends bin/ and usr/bin as
 well. Then it looks for something ending in gcc in each directory. You
 may need to specify additional search paths to make this work. My
 output with ~/.buildman:
 
 # Buildman settings file
 
 [toolchain]
 root: /
 #rest: /home/sjg/c/buildall/toolchains/*
 #eldk: /opt/eldk4.2/usr/bin
 #arm: /home/sjg/c/tools/arm-unknown-eabi
 avr32: /home/sjg/c/buildall/toolchains/avr32
 #m68k: /home/sjg/c/buildall/toolchains/m68k-linux
 m68k: /usr/local/m68k-uclinux-tools
 arm: /opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux
 eldk: /opt/eldk-5.2.1/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux

Ah-ha, OK.  I think we need to update the README slightly, I was
thinking it was just a few keywords based on how it is now.  So I would
need to re-work my config similar to yours and then yes, it would find
everything as well.

[snip]
  That's closer, yeah.  Oh, and -c 1 seems to do be what I want, except I
  get:
  $ ./tools/buildman/buildman -se 'blackfin' -c 1
  No section: 'make-flags'
  Traceback (most recent call last):
File ./tools/buildman/buildman, line 135, in module
  control.DoBuildman(options, args)
File /home/trini/work/u-boot/u-boot/tools/buildman/control.py, line 
  138, in DoBuildman
  1)
File 
  /home/trini/work/u-boot/u-boot/tools/buildman/../patman/patchstream.py, 
  line 389, in GetMetaDataForList
  stdout = command.RunPipe(pipe, capture=True).stdout
File 
  /home/trini/work/u-boot/u-boot/tools/buildman/../patman/command.py, line 
  50, in RunPipe
  user_pipestr =  '|'.join([' '.join(pipe) for pipe in pipe_list])
  TypeError: sequence item 8: expected string, NoneType found
 
 That's because it doesn't have a branch (-b branch). If you are just
 wanting to build the current checked-out tree, you could apply the v3
 series which supports that.

ah, ok.

   Next up, is there some way to have multiple toolchains for an arch
   available?  On some compute resources I have at work I throw
   arm/eldk4.2, arm/eldk5.2, arm/linaro-2013.03 (since we've pinned to that
   for some projects) and some various combos for powerpc as well.  I
   didn't see how to do that with buildman aside from different ~/.buildman
   files per invocation.
 
  Yes I remember you talking about this before. One option would be to
  add toolchain as a new dimension in the matrix. It might be painful
  though. So to be clear, you want to define multiple toolchains for an
  arch, and have buildman always build with all of them?
 
  Well, a --config-file= would be good enough so I could have
  buildman-eldk54.cfg, buildman-eldk42.cfg, etc, etc.
 
 OK I'll add a new patch to a v4 series to implement that. It's pretty
 trivial so 

Re: [U-Boot] [PATCH v2 0/3] Add some missing buildman features and deprecate MAKEALL

2014-08-05 Thread Simon Glass
Hi Jeroen,

On 4 August 2014 14:56, Jeroen Hofstee jer...@myspectrum.nl wrote:
 Hello Simon,


 On 04-08-14 22:41, Simon Glass wrote:

 Hi Tom,

 On 4 August 2014 07:23, Tom Rini tr...@ti.com wrote:

 On Mon, Jul 28, 2014 at 11:53:27PM -0600, Simon Glass wrote:

 Buildman has been around for a little over a year and is used by a fair
 number of U-Boot developers. However quite a few people still use
 MAKEALL.

 Buildman was intended to replace MAKEALL, so perhaps now is a good time
 to
 start that process.

 OK, lets start.  First, I had to make up a special directory with
 symlinks to the various toolchains, in order to get them to work with
 buildman, due to the various layouts:

 $ ls -l ~/work/u-boot/toolchain-links/
 total 4
 lrwxrwxrwx 1 trini trini 38 Aug  1 17:09
 arc_gnu_4.8-R2_prebuilt_uclibc_be - /opt/arc_gnu_4.8-R2_prebuilt_uclibc_be
 lrwxrwxrwx 1 trini trini 38 Aug  1 17:09
 arc_gnu_4.8-R2_prebuilt_uclibc_le - /opt/arc_gnu_4.8-R2_prebuilt_uclibc_le
 lrwxrwxrwx 1 trini trini 24 Aug  1 17:10 bfin-elf -
 /opt/uClinux-45/bfin-elf
 lrwxrwxrwx 1 trini trini 32 Aug  1 17:09 m68k-linux -
 /opt/gcc-4.9.0-nolibc/m68k-linux
 lrwxrwxrwx 1 trini trini 34 Aug  1 17:09 microblazeel-xilinx-linux-gnu -
 /opt/microblazeel-xilinx-linux-gnu
 lrwxrwxrwx 1 trini trini 32 Aug  1 17:09 microblaze-xilinx-linux-gnu -
 /opt/microblaze-xilinx-linux-gnu
 lrwxrwxrwx 1 trini trini 66 Aug  1 17:15 mips32-linux -
 /opt/eldk-5.2.1/mips/sysroots/i686-eldk-linux/usr/bin/mips32-linux
 lrwxrwxrwx 1 trini trini 36 Aug  1 17:09 nds32le-linux-glibc-v1f -
 /opt/nds32le/nds32le-linux-glibc-v1f
 lrwxrwxrwx 1 trini trini 20 Aug  1 17:09 sparc-elf-3.4.4 -
 /opt/sparc-elf-3.4.4

 I tried a few things but I couldn't get a toolchain section setup that
 found all of those.  Second:

 OK, can you give me a trace of the output of 'buildman
 --list-tool-chains' - I should be able to figure out what is wrong.


 Like Tom, I tried this a bit. (and ended up faking clang is gcc). There
 are at least some assumptions cc = gcc and strlen(cc) == 3.

OK I will change that in v4.


 (testing the MMC pull request)
 $ ./tools/buildman/buildman -b master
 'arc|blackfin|m68k|microblaze|nds32|sparc|mips'
 No section: 'make-flags'
 Building 11 commits for 121 boards (6 threads, 1 job per thread)
 Cloning repo for thread 0
 Cloning repo for thread 1
 Cloning repo for thread 2
 Cloning repo for thread 3
 Cloning repo for thread 4
 Cloning repo for thread 5
   1155   88   88 /1331   axs101

 So it's nice that it spit out a thread per commit, but I really only
 care right now if master builds right.  And I've gone blind and can't
 find the end result logs of what failed to build (88 failures doesn't
 quite match the warning/errors I get for my wrapper around
 toolchains+MAKEALL).

 You can use the -s flag to see the broken builds, and -se to see
 errors also. Is that what you mean?

 The output is in ../branch/commit/board but if you want to keep
 the binaries, you need -k also.


 Like Tom, I saw fancy output, like merged not being a property
 or something. I like to see the warnings and errors directly, but -e?
 failed to do so. (or at least I didn't spend enough time to get it to work)

With the v3 series you can use the -v option to display all output
while it builds. The -e option displays summarised information,
interned to avoid you getting the same error 100 times for 100
different boards.


 I also didn't quite see how to plugin an arm64 toolchain.

 I haven't tried - can you please point me to one and I'll give it a go.

 Next up, is there some way to have multiple toolchains for an arch
 available?  On some compute resources I have at work I throw
 arm/eldk4.2, arm/eldk5.2, arm/linaro-2013.03 (since we've pinned to that
 for some projects) and some various combos for powerpc as well.  I
 didn't see how to do that with buildman aside from different ~/.buildman
 files per invocation.

 Yes I remember you talking about this before. One option would be to
 add toolchain as a new dimension in the matrix. It might be painful
 though. So to be clear, you want to define multiple toolchains for an
 arch, and have buildman always build with all of them?


 I would like this as well. For serious changing I typically build with
 MAKEALL with clang and gcc (for ARM) + gcc for powerpc if it is
 a overall change.

OK I'll add a config file option.


 But since clang always warns it is actually not a viable target for
 buildman at all.

Why does it always warn?

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


Re: [U-Boot] [PATCH v5 05/11] exynos: dts: Adjust device tree files for U-Boot

2014-08-05 Thread Simon Glass
Hi Tom,

On 5 August 2014 08:07, Tom Rini tr...@ti.com wrote:
 On Mon, Aug 04, 2014 at 02:46:02PM -0600, Simon Glass wrote:
 Hi Tom,

 On 4 August 2014 09:54, Tom Rini tr...@ti.com wrote:
  On Mon, Aug 04, 2014 at 06:01:58AM -0600, Simon Glass wrote:
  Hi Tom,
 
  On 30 July 2014 09:34, Simon Glass s...@chromium.org wrote:
   Hi Tom,
  
   On 28 July 2014 21:27, Tom Rini tr...@ti.com wrote:
   On Mon, Jul 28, 2014 at 06:11:32AM -0600, Simon Glass wrote:
  
   The pinctrl bindings used by Linux are an incomplete description of 
   the
   hardware. It is possible in most cases to determine the register 
   address
   of each, but not in all cases. By adding an additional property we can
   fix this, and avoid adding a table to U-Boot for every single Exynos
   SOC.
  
   So here's my fear..
  
   [snip]
   @@ -49,7 +57,7 @@
 i2c@12ca {
 #address-cells = 1;
 #size-cells = 0;
   - compatible = samsung,s3c2440-i27c;
   + compatible = samsung,s3c2440-i2c;
 reg = 0x12CA 0x100;
 interrupts = 0 60 0;
 };
  
   Except for the above (what's going on? pulling in a typo fix from
   upstream?) they're legal regular non-U-Boot-prefixed changes.  Are
   they going back into the master copy in Linux?
  
   Oops I missed this email. The typo is just my mistake - we don't need
   this change and the typo is in the previous patch.
  
  
   diff --git a/arch/arm/dts/exynos5420-pinctrl.dtsi 
   b/arch/arm/dts/exynos5420-pinctrl.dtsi
   index b3e63d1..df31f37 100644
   --- a/arch/arm/dts/exynos5420-pinctrl.dtsi
   +++ b/arch/arm/dts/exynos5420-pinctrl.dtsi
   @@ -13,6 +13,18 @@
*/
  
/ {
   + /* Replicate the ordering of 
   arch/arm/include/asm/arch-exynos/gpio.h */
   + pinctrl@1401 {
   + };
   + pinctrl@1340 {
   + };
   + pinctrl@1341 {
   + };
   + pinctrl@1400 {
   + };
   + pinctrl@0386 {
   + };
  
   So this isn't going to head back to Linux, clearly...
  
   Is there some way we can contain our changes under includes perhaps?
  
   I hope that this one could go away, since the order of GPIOs doesn't
   ultimately matter. At present we assume a particular order due to the
   numbering of GPIOs. But once we move to named GPIOs in the device tree
   we can drop this ordering patch.
  
   In general, yes we could create a new include file for the U-Boot
   device tree additions.
 
  Update: I took a look at the includes. I can create a new file, like
  arch/arm/dts/exynos4210-pinctrl.dtsi which I include from
  arch/arm/dts/exynos4210.dtsi. But I think I will still need to modify
  arch/arm/dts/exynos4210.dtsi. The alternative is to put the changes in
  something like exynos4210-u-boot.dtsi and include those in every board
  file that uses that include.
 
  With arch/arm/dts/exynos4210-pinctrl.dtsi + arch/arm/dts/exynos4210.dtsi
  the modification to the later is just to include the former, right?  I'm
  OK with that.

 Almost, but we still need the #address-cells and #size-cells
 properties in the pinctrl nodes.

 And these, as you said I think, are HW description things that should be
 included in the master DT file upstream, right?

Well we only need them because we are added 'reg' properties to the
subnodes. There would certainly be no harm in including them upstream.
The only bad thing I'm doing is the 'Replicate the ordering' bit. That
should just go away once the GPIO numbering doesn't matter anymore
(which requires that we use the device tree binding in GPIOs - this is
the next step!).

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


[U-Boot] [PATCH v4 06/13] buildman: Refactor output options

2014-08-05 Thread Simon Glass
We need the output options to be available in several places. It's a pain
to pass them into each function. Make them properties of the builder and
add a single function to set them up. At the same time, add a function which
produces summary output using these options.

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

Changes in v4: None
Changes in v3:
- Add new patch to refactor output options

Changes in v2: None

 tools/buildman/builder.py | 46 +++---
 tools/buildman/control.py |  8 
 2 files changed, 31 insertions(+), 23 deletions(-)

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index e2da0eb..f3d0435 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -235,6 +235,20 @@ class Builder:
 for t in self.threads:
 del t
 
+def SetDisplayOptions(self, show_errors, show_sizes, show_detail,
+  show_bloat):
+Setup display options for the builder.
+
+show_errors: True to show summarised error/warning info
+show_sizes: Show size deltas
+show_detail: Show detail for each board
+show_bloat: Show detail for each function
+
+self._show_errors = show_errors
+self._show_sizes = show_sizes
+self._show_detail = show_detail
+self._show_bloat = show_bloat
+
 def _AddTimestamp(self):
 Add a new timestamp to the list and record the build period.
 
@@ -891,9 +905,18 @@ class Builder:
 print Boards not built (%d): %s % (len(not_built),
 ', '.join(not_built))
 
+def ProduceResultSummary(self, commit_upto, commits, board_selected):
+board_dict, err_lines = self.GetResultSummary(board_selected,
+commit_upto, read_func_sizes=self._show_bloat)
+if commits:
+msg = '%02d: %s' % (commit_upto + 1,
+commits[commit_upto].subject)
+print self.col.Color(self.col.BLUE, msg)
+self.PrintResultSummary(board_selected, board_dict,
+err_lines if self._show_errors else [],
+self._show_sizes, self._show_detail, self._show_bloat)
 
-def ShowSummary(self, commits, board_selected, show_errors, show_sizes,
-show_detail, show_bloat):
+def ShowSummary(self, commits, board_selected):
 Show a build summary for U-Boot for a given board list.
 
 Reset the result summary, then repeatedly call GetResultSummary on
@@ -902,27 +925,13 @@ class Builder:
 Args:
 commit: Commit objects to summarise
 board_selected: Dict containing boards to summarise
-show_errors: Show errors that occured
-show_sizes: Show size deltas
-show_detail: Show detail for each board
-show_bloat: Show detail for each function
 
 self.commit_count = len(commits) if commits else 1
 self.commits = commits
 self.ResetResultSummary(board_selected)
 
 for commit_upto in range(0, self.commit_count, self._step):
-board_dict, err_lines = self.GetResultSummary(board_selected,
-commit_upto, read_func_sizes=show_bloat)
-if commits:
-msg = '%02d: %s' % (commit_upto + 1,
-commits[commit_upto].subject)
-else:
-msg = 'current'
-print self.col.Color(self.col.BLUE, msg)
-self.PrintResultSummary(board_selected, board_dict,
-err_lines if show_errors else [], show_sizes, show_detail,
-show_bloat)
+self.ProduceResultSummary(commit_upto, commits, board_selected)
 
 
 def SetupBuild(self, board_selected, commits):
@@ -1032,14 +1041,13 @@ class Builder:
 if dirname not in dir_list:
 shutil.rmtree(dirname)
 
-def BuildBoards(self, commits, board_selected, show_errors, keep_outputs):
+def BuildBoards(self, commits, board_selected, keep_outputs):
 Build all commits for a list of boards
 
 Args:
 commits: List of commits to be build, each a Commit object
 boards_selected: Dict of selected boards, key is target name,
 value is Board object
-show_errors: True to show summarised error/warning info
 keep_outputs: True to save build output files
 
 self.commit_count = len(commits) if commits else 1
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 12a9699..d8fa74b 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -207,13 +207,13 @@ def DoBuildman(options, args):
 print GetActionSummary(options.summary, commits, board_selected,
options)
 
+builder.SetDisplayOptions(options.show_errors, options.show_sizes,
+

[U-Boot] [PATCH v4 0/13] Add some missing buildman features and deprecate MAKEALL

2014-08-05 Thread Simon Glass
Buildman has been around for a little over a year and is used by a fair
number of U-Boot developers. However quite a few people still use MAKEALL.

Buildman was intended to replace MAKEALL, so perhaps now is a good time to
start that process.

The reasons to deprecate MAKEALL are:
- We don't want to maintain two build systems
- Buildman is typically faster
- Buildman has a lot more features

This series adds a few features to buildman to fill some gaps, adds some
information into the README on how to migrate from MAKEALL, and adds a
deprecation message to MAKEALL.

Changes in v4:
- Fix missing import in builder.py
- Fix typo in commit message
- Add new patch to remove unused non-incremental build method code
- Add new patch to allow the config file to be specified
- Add new patch to show a message when there are no errors
- Add new patch to search for *cc instead of *gcc
- Add new path to add a few more toolchain examples to the README

Changes in v3:
- Add new patch to build current source tree
- Add new patch to move BuilderThread code to its own file
- Add new patch to sort command line options
- Add new patch to refactor output options
- Add new patch to add a verbose option

Changes in v2:
- Add new patch to fix existing typos
- Minor changes to the text

Simon Glass (13):
  buildman: Fix a few typos
  buildman: Add some notes about moving from MAKEALL
  buildman: Allow building of current source tree
  buildman: Move BuilderThread code to its own file
  buildman: Sort command line options
  buildman: Refactor output options
  buildman: Add verbose option to display errors as they happen
  buildman: Remove unused non-incremental build method code
  buildman: Add an option to specify the buildman config file
  buildman: Add a message indicating there are no errors
  buildman: Search for *cc instead of *gcc for the compiler
  buildman: Add a few more toolchain examples to the README
  RFC: Deprecate MAKEALL

 MAKEALL |   4 +
 tools/buildman/README   | 150 +--
 tools/buildman/builder.py   | 544 ++--
 tools/buildman/builderthread.py | 434 
 tools/buildman/buildman.py  |  16 +-
 tools/buildman/control.py   | 101 +---
 tools/buildman/test.py  |   1 -
 tools/buildman/toolchain.py |   2 +-
 8 files changed, 718 insertions(+), 534 deletions(-)
 create mode 100644 tools/buildman/builderthread.py

-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v4 07/13] buildman: Add verbose option to display errors as they happen

2014-08-05 Thread Simon Glass
Normally buildman operates in two passes - one to do the build and another
to summarise the errors. Add a verbose option (-v) to display build problems
as they happen. With -e also given, this will display errors too.

When building the current source tree (rather than a list of commits in a
branch), both -v and -e are enabled automatically.

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

Changes in v4: None
Changes in v3:
- Add new patch to add a verbose option

Changes in v2: None

 tools/buildman/README  | 46 --
 tools/buildman/builder.py  | 16 +---
 tools/buildman/buildman.py |  2 ++
 tools/buildman/control.py  |  4 +++-
 4 files changed, 54 insertions(+), 14 deletions(-)

diff --git a/tools/buildman/README b/tools/buildman/README
index 1c919af..6ba24c0 100644
--- a/tools/buildman/README
+++ b/tools/buildman/README
@@ -41,9 +41,10 @@ Theory of Operation
 
 Buildman is a builder. It is not make, although it runs make. It does not
 produce any useful output on the terminal while building, except for
-progress information. All the output (errors, warnings and binaries if you
-are ask for them) is stored in output directories, which you can look at
-while the build is progressing, or when it is finished.
+progress information (except with -v, see below). All the output (errors,
+warnings and binaries if you are ask for them) is stored in output
+directories, which you can look at while the build is progressing, or when
+it is finished.
 
 Buildman produces a concise summary of which boards succeeded and failed.
 It shows which commit introduced which board failure using a simple
@@ -77,12 +78,17 @@ Buildman automatically selects the correct tool chain for 
each board. You
 must supply suitable tool chains, but buildman takes care of selecting the
 right one.
 
-Buildman always builds a branch, and always builds the upstream commit as
-well, for comparison. It cannot build individual commits at present, unless
-(maybe) you point it at an empty branch. Put all your commits in a branch,
-set the branch's upstream to a valid value, and all will be well. Otherwise
-buildman will perform random actions. Use -n to check what the random
-actions might be.
+Buildman generally builds a branch (with the -b flag), and in this case
+builds the upstream commit as well, for comparison. It cannot build
+individual commits at present, unless (maybe) you point it at an empty
+branch. Put all your commits in a branch, set the branch's upstream to a
+valid value, and all will be well. Otherwise buildman will perform random
+actions. Use -n to check what the random actions might be.
+
+If you just want to build the current source tree, leave off the -b flag.
+This will display results and errors as they happen. You can still look
+at them later using -s. Note that buildman will assume that the source
+has changed, and will build all specified boards in this case.
 
 Buildman is optimised for building many commits at once, for many boards.
 On multi-core machines, Buildman is fast because it uses most of the
@@ -659,6 +665,15 @@ It is expected that any variables added are dealt with in 
U-Boot's
 config.mk file and documented in the README.
 
 
+Quick Sanity Check
+==
+
+If you have made changes and want to do a quick sanity check of the
+currently-checked-out source, run buildman without the -b flag. This will
+build the selected boards and display build status and errors as it runs
+(i.e. -v amd -e are enabled automatically).
+
+
 Other options
 =
 
@@ -685,7 +700,15 @@ First you need to set up your tool chains - see the 
'Setting up' section
 for details. Once you have your required toolchain(s) detected then you are
 ready to go.
 
-Buildman works on entire branches, so the normal use is:
+To build the current source tree, run buildman without a -b flag:
+
+   ./tools/buildman/buildman list of things to build
+
+This will build the current source tree for the given boards and display
+the results and errors.
+
+However buildman usually works on entire branches, and for that you must
+specify a board flag:
 
./tools/buildman/buildman -b branch_name list of things to build
 
@@ -698,6 +721,9 @@ buildman just shows a summary, with red indicating that a 
commit introduced
 an error and green indicating that a commit fixed an error. Use the -e
 flag to see the full errors.
 
+If you really want to see build results as they happen, use -v when doing a
+build (and -e if you want to see errors as well).
+
 You don't need to stick around on that branch while buildman is running. It
 checks out its own copy of the source code, so you can change branches,
 add commits, etc. without affecting the build in progress.
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index f3d0435..af8f3f3 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -321,7 +321,8 @@ class Builder:
 Process the result of a 

[U-Boot] [PATCH v4 05/13] buildman: Sort command line options

2014-08-05 Thread Simon Glass
These options have got slightly out of order. Fix them.

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

Changes in v4:
- Fix typo in commit message

Changes in v3:
- Add new patch to sort command line options

Changes in v2: None

 tools/buildman/buildman.py | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py
index 42847ac..da6025a 100755
--- a/tools/buildman/buildman.py
+++ b/tools/buildman/buildman.py
@@ -70,6 +70,9 @@ parser.add_option('-c', '--count', dest='count', type='int',
 parser.add_option('-C', '--force-reconfig', dest='force_reconfig',
action='store_true', default=False,
help='Reconfigure for every commit (disable incremental build)')
+parser.add_option('-d', '--detail', dest='show_detail',
+   action='store_true', default=False,
+   help='Show detailed information for each board in summary')
 parser.add_option('-e', '--show_errors', action='store_true',
default=False, help='Show errors and warnings')
 parser.add_option('-f', '--force-build', dest='force_build',
@@ -78,9 +81,6 @@ parser.add_option('-f', '--force-build', dest='force_build',
 parser.add_option('-F', '--force-build-failures', dest='force_build_failures',
action='store_true', default=False,
help='Force build of previously-failed build')
-parser.add_option('-d', '--detail', dest='show_detail',
-   action='store_true', default=False,
-   help='Show detailed information for each board in summary')
 parser.add_option('-g', '--git', type='string',
help='Git repo containing branch to build', default='.')
 parser.add_option('-H', '--full-help', action='store_true', dest='full_help',
@@ -96,6 +96,9 @@ parser.add_option('--list-tool-chains', action='store_true', 
default=False,
help='List available tool chains')
 parser.add_option('-n', '--dry-run', action='store_true', dest='dry_run',
default=False, help=Do a try run (describe actions, but no nothing))
+parser.add_option('-o', '--output-dir', type='string',
+   dest='output_dir', default='..',
+   help='Directory where all builds happen and buildman has its workspace 
(default is ../)')
 parser.add_option('-Q', '--quick', action='store_true',
default=False, help='Do a rough build, with limited warning resolution')
 parser.add_option('-s', '--summary', action='store_true',
@@ -110,9 +113,6 @@ 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='Directory where all builds happen and buildman has its workspace 
(default is ../)')
 
 parser.usage = buildman -b branch [options]
 
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v4 01/13] buildman: Fix a few typos

2014-08-05 Thread Simon Glass
There are several typos in the README - fix them.

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

Changes in v4: None
Changes in v3: None
Changes in v2:
- Add new patch to fix existing typos

 tools/buildman/README | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/buildman/README b/tools/buildman/README
index c30c1d4..a5d181c 100644
--- a/tools/buildman/README
+++ b/tools/buildman/README
@@ -71,8 +71,8 @@ directory. It clones this repository into a copy for each 
thread, and the
 threads do not affect the state of your git repository. Any checkouts done
 by the thread affect only the working directory for that thread.
 
-Buildman automatically selects the correct toolchain for each board. You
-must supply suitable toolchains, but buildman takes care of selecting the
+Buildman automatically selects the correct tool chain for each board. You
+must supply suitable tool chains, but buildman takes care of selecting the
 right one.
 
 Buildman always builds a branch, and always builds the upstream commit as
@@ -287,7 +287,7 @@ If it can't detect the upstream branch, try checking out 
the branch, and
 doing something like 'git branch --set-upstream branch upstream/master'
 or something similar.
 
-As an exmmple:
+As an example:
 
 Dry run, so not doing much. But I would do this:
 
@@ -339,7 +339,7 @@ Building 18 commits for 1059 boards (4 threads, 1 job per 
thread)
   528   36  124 /19062  1:13:30  : SIMPC8313_SP
 
 This means that it is building 19062 board/commit combinations. So far it
-has managed to succesfully build 528. Another 36 have built with warnings,
+has managed to successfully build 528. Another 36 have built with warnings,
 and 124 more didn't build at all. Buildman expects to complete the process
 in an hour and 15 minutes. Use this time to buy a faster computer.
 
@@ -413,7 +413,7 @@ again.
 
 At commit 16, the error moves - you can see that the old error at line 120
 is fixed, but there is a new one at line 126. This is probably only because
-we added some code and moved the broken line futher down the file.
+we added some code and moved the broken line father down the file.
 
 If many boards have the same error, then -e will display the error only
 once. This makes the output as concise as possible.
@@ -491,7 +491,7 @@ You can also use -d to see a detailed size breakdown for 
each board. This
 list is sorted in order from largest growth to largest reduction.
 
 It is possible to go a little further with the -B option (--bloat). This
-shows where U-Boot has bloted, breaking the size change down to the function
+shows where U-Boot has bloated, breaking the size change down to the function
 level. Example output is below:
 
 $ ./tools/buildman/buildman -b us-mem4 -sSdB
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v4 02/13] buildman: Add some notes about moving from MAKEALL

2014-08-05 Thread Simon Glass
For those used to MAKEALL, buildman seems strange. Add some notes to ease
the transition.

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

Changes in v4: None
Changes in v3: None
Changes in v2:
- Minor changes to the text

 tools/buildman/README | 92 +++
 1 file changed, 92 insertions(+)

diff --git a/tools/buildman/README b/tools/buildman/README
index a5d181c..1c919af 100644
--- a/tools/buildman/README
+++ b/tools/buildman/README
@@ -3,6 +3,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+(Please read 'How to change from MAKEALL' if you are used to that tool)
+
 What is this?
 =
 
@@ -663,6 +665,96 @@ Other options
 Buildman has various other command line options. Try --help to see them.
 
 
+How to change from MAKEALL
+==
+
+Buildman includes most of the features of MAKEALL and is generally faster
+and easier to use. In particular it builds entire branches: if a particular
+commit introduces an error in a particular board, buildman can easily show
+you this, even if a later commit fixes that error.
+
+The reasons to deprecate MAKEALL are:
+- We don't want to maintain two build systems
+- Buildman is typically faster
+- Buildman has a lot more features
+
+But still, many people will be sad to lose MAKEALL. If you are used to
+MAKEALL, here are a few pointers.
+
+First you need to set up your tool chains - see the 'Setting up' section
+for details. Once you have your required toolchain(s) detected then you are
+ready to go.
+
+Buildman works on entire branches, so the normal use is:
+
+   ./tools/buildman/buildman -b branch_name list of things to build
+
+followed by (afterwards, or perhaps concurrently in another terminal):
+
+   ./tools/buildman/buildman -b branch_name -s list of things to build
+
+to see the results of the build. Rather than showing you all the output,
+buildman just shows a summary, with red indicating that a commit introduced
+an error and green indicating that a commit fixed an error. Use the -e
+flag to see the full errors.
+
+You don't need to stick around on that branch while buildman is running. It
+checks out its own copy of the source code, so you can change branches,
+add commits, etc. without affecting the build in progress.
+
+The list of things to build can include board names, architectures or the
+like. There are no flags to disambiguate since ambiguities are rare. Using
+the examples from MAKEALL:
+
+Examples:
+  - build all Power Architecture boards:
+  MAKEALL -a powerpc
+  MAKEALL --arch powerpc
+  MAKEALL powerpc
+  ** buildman -b branch powerpc
+  - build all PowerPC boards manufactured by vendor esd:
+  MAKEALL -a powerpc -v esd
+  ** buildman -b branch esd
+  - build all PowerPC boards manufactured either by keymile or siemens:
+  MAKEALL -a powerpc -v keymile -v siemens
+  ** buildman -b branch keymile siemens
+  - build all Freescale boards with MPC83xx CPUs, plus all 4xx boards:
+  MAKEALL -c mpc83xx -v freescale 4xx
+  ** buildman -b branch mpc83xx freescale 4xx
+
+Buildman automatically tries to use all the CPUs in your machine. If you
+are building a lot of boards it will use one thread for every CPU core
+it detects in your machine. This is like MAKEALL's BUILD_NBUILDS option.
+You can use the -T flag to change the number of threads. If you are only
+building a few boards, buildman will automatically run make with the -j
+flag to increase the number of concurrent make tasks. It isn't normally
+that helpful to fiddle with this option, but if you use the BUILD_NCPUS
+option in MAKEALL then -j is the equivalent in buildman.
+
+Buildman puts its output in ../branch_name by default but you can change
+this with the -o option. Buildman normally does out-of-tree builds: use -i
+to disable that if you really want to. But be careful that once you have
+used -i you pollute buildman's copies of the source tree, and you will need
+to remove the build directory (normally ../branch_name) to run buildman
+in normal mode (without -i).
+
+Buildman doesn't keep the output result normally, but use the -k option to
+do this.
+
+Please read 'Theory of Operation' a few times as it will make a lot of
+things clearer.
+
+Some options you might like are:
+
+   -B shows which functions are growing/shrinking in which commit - great
+for finding code bloat.
+   -S shows image sizes for each commit (just an overall summary)
+   -u shows boards that you haven't built yet
+   --step 0 will build just the upstream commit and the last commit of your
+branch. This is often a quick sanity check that your branch doesn't
+break anything. But note this does not check bisectability!
+
+
 TODO
 
 
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v4 09/13] buildman: Add an option to specify the buildman config file

2014-08-05 Thread Simon Glass
Add a new --config-file option (-G) to specify a different configuration
file from the default ~/.buildman.

Reported-by: Tom Rini tr...@ti.com
Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v4:
- Add new patch to allow the config file to be specified

Changes in v3: None
Changes in v2: None

 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 f32557f..6ca8dc6 100755
--- a/tools/buildman/buildman.py
+++ b/tools/buildman/buildman.py
@@ -83,6 +83,8 @@ parser.add_option('-F', '--force-build-failures', 
dest='force_build_failures',
help='Force build of previously-failed build')
 parser.add_option('-g', '--git', type='string',
help='Git repo containing branch to build', default='.')
+parser.add_option('-G', '--config-file', type='string',
+   help='Path to buildman config file', default='')
 parser.add_option('-H', '--full-help', action='store_true', dest='full_help',
default=False, help='Display the README file')
 parser.add_option('-i', '--in-tree', dest='in_tree',
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index cc8593f..0c9e2cb 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -86,7 +86,7 @@ def DoBuildman(options, args):
 
 gitutil.Setup()
 
-bsettings.Setup()
+bsettings.Setup(options.config_file)
 options.git_dir = os.path.join(options.git, '.git')
 
 toolchains = toolchain.Toolchains()
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v4 12/13] buildman: Add a few more toolchain examples to the README

2014-08-05 Thread Simon Glass
The current README is a bit sparse in this area, so add a few more
examples.

Suggested-by: Tom Rini tr...@ti.com
Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v4:
- Add new path to add a few more toolchain examples to the README

Changes in v3: None
Changes in v2: None

 tools/buildman/README | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/buildman/README b/tools/buildman/README
index 6ba24c0..aaf0a10 100644
--- a/tools/buildman/README
+++ b/tools/buildman/README
@@ -134,6 +134,8 @@ example:
 root: /
 rest: /toolchains/*
 eldk: /opt/eldk-4.2
+arm: /opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux
+aarch64: /opt/linaro/gcc-linaro-aarch64-none-elf-4.8-2013.10_linux
 
 [toolchain-alias]
 x86: i386
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v4 11/13] buildman: Search for *cc instead of *gcc for the compiler

2014-08-05 Thread Simon Glass
Compiler names normally end with cc, but not always gcc. So update the
detection logic.

Reported-by: Jeroen Hofstee jer...@myspectrum.nl
Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v4:
- Add new patch to search for *cc instead of *gcc

Changes in v3: None
Changes in v2: None

 tools/buildman/toolchain.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py
index 1b9771f..e4fcf1b 100644
--- a/tools/buildman/toolchain.py
+++ b/tools/buildman/toolchain.py
@@ -146,7 +146,7 @@ class Toolchains:
 for subdir in ['.', 'bin', 'usr/bin']:
 dirname = os.path.join(path, subdir)
 if verbose: print   - looking in '%s' % dirname
-for fname in glob.glob(dirname + '/*gcc'):
+for fname in glob.glob(dirname + '/*cc'):
 if verbose: print  - found '%s' % fname
 self.Add(fname, True, verbose)
 
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v4 04/13] buildman: Move BuilderThread code to its own file

2014-08-05 Thread Simon Glass
The builder.py file is getting too long, so split out some code.

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

Changes in v4:
- Fix missing import in builder.py

Changes in v3:
- Add new patch to move BuilderThread code to its own file

Changes in v2: None

 tools/buildman/builder.py   | 439 +---
 tools/buildman/builderthread.py | 434 +++
 2 files changed, 442 insertions(+), 431 deletions(-)
 create mode 100644 tools/buildman/builderthread.py

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index d2b72d5..e2da0eb 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -6,7 +6,6 @@
 #
 
 import collections
-import errno
 from datetime import datetime, timedelta
 import glob
 import os
@@ -15,9 +14,9 @@ import Queue
 import shutil
 import string
 import sys
-import threading
 import time
 
+import builderthread
 import command
 import gitutil
 import terminal
@@ -97,428 +96,6 @@ OUTCOME_OK, OUTCOME_WARNING, OUTCOME_ERROR, OUTCOME_UNKNOWN 
= range(4)
 trans_valid_chars = string.maketrans(/: , ---)
 
 
-def Mkdir(dirname):
-Make a directory if it doesn't already exist.
-
-Args:
-dirname: Directory to create
-
-try:
-os.mkdir(dirname)
-except OSError as err:
-if err.errno == errno.EEXIST:
-pass
-else:
-raise
-
-class BuilderJob:
-Holds information about a job to be performed by a thread
-
-Members:
-board: Board object to build
-commits: List of commit options to build.
-
-def __init__(self):
-self.board = None
-self.commits = []
-
-
-class ResultThread(threading.Thread):
-This thread processes results from builder threads.
-
-It simply passes the results on to the builder. There is only one
-result thread, and this helps to serialise the build output.
-
-def __init__(self, builder):
-Set up a new result thread
-
-Args:
-builder: Builder which will be sent each result
-
-threading.Thread.__init__(self)
-self.builder = builder
-
-def run(self):
-Called to start up the result thread.
-
-We collect the next result job and pass it on to the build.
-
-while True:
-result = self.builder.out_queue.get()
-self.builder.ProcessResult(result)
-self.builder.out_queue.task_done()
-
-
-class BuilderThread(threading.Thread):
-This thread builds U-Boot for a particular board.
-
-An input queue provides each new job. We run 'make' to build U-Boot
-and then pass the results on to the output queue.
-
-Members:
-builder: The builder which contains information we might need
-thread_num: Our thread number (0-n-1), used to decide on a
-temporary directory
-
-def __init__(self, builder, thread_num):
-Set up a new builder thread
-threading.Thread.__init__(self)
-self.builder = builder
-self.thread_num = thread_num
-
-def Make(self, commit, brd, stage, cwd, *args, **kwargs):
-Run 'make' on a particular commit and board.
-
-The source code will already be checked out, so the 'commit'
-argument is only for information.
-
-Args:
-commit: Commit object that is being built
-brd: Board object that is being built
-stage: Stage of the build. Valid stages are:
-distclean - can be called to clean source
-config - called to configure for a board
-build - the main make invocation - it does the build
-args: A list of arguments to pass to 'make'
-kwargs: A list of keyword arguments to pass to command.RunPipe()
-
-Returns:
-CommandResult object
-
-return self.builder.do_make(commit, brd, stage, cwd, *args,
-**kwargs)
-
-def RunCommit(self, commit_upto, brd, work_dir, do_config, force_build,
-  force_build_failures):
-Build a particular commit.
-
-If the build is already done, and we are not forcing a build, we skip
-the build and just return the previously-saved results.
-
-Args:
-commit_upto: Commit number to build (0...n-1)
-brd: Board object to build
-work_dir: Directory to which the source will be checked out
-do_config: True to run a make board_defconfig on the source
-force_build: Force a build even if one was previously done
-force_build_failures: Force a bulid if the previous result showed
-failure
-
-Returns:
-tuple containing:
-- CommandResult object containing the results of the build
-- boolean indicating whether 'make config' is still needed
-
-# Create 

[U-Boot] [PATCH v4 08/13] buildman: Remove unused non-incremental build method code

2014-08-05 Thread Simon Glass
The non-incremental build method is no longer used, so remove it.

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

Changes in v4:
- Add new patch to remove unused non-incremental build method code

Changes in v3: None
Changes in v2: None

 tools/buildman/builder.py | 34 --
 tools/buildman/test.py|  1 -
 2 files changed, 35 deletions(-)

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index af8f3f3..f148b93 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -955,40 +955,6 @@ class Builder:
 self.upto = self.warned = self.fail = 0
 self._timestamps = collections.deque()
 
-def BuildBoardsForCommit(self, board_selected, keep_outputs):
-Build all boards for a single commit
-self.SetupBuild(board_selected)
-self.count = len(board_selected)
-for brd in board_selected.itervalues():
-job = BuilderJob()
-job.board = brd
-job.commits = None
-job.keep_outputs = keep_outputs
-self.queue.put(brd)
-
-self.queue.join()
-self.out_queue.join()
-print
-self.ClearLine(0)
-
-def BuildCommits(self, commits, board_selected, show_errors, keep_outputs):
-Build all boards for all commits (non-incremental)
-self.commit_count = len(commits)
-
-self.ResetResultSummary(board_selected)
-for self.commit_upto in range(self.commit_count):
-self.SelectCommit(commits[self.commit_upto])
-self.SelectOutputDir()
-builderthread.Mkdir(self.output_dir)
-
-self.BuildBoardsForCommit(board_selected, keep_outputs)
-board_dict, err_lines = self.GetResultSummary()
-self.PrintResultSummary(board_selected, board_dict,
-err_lines if show_errors else [])
-
-if self.already_done:
-print '%d builds already done' % self.already_done
-
 def GetThreadDir(self, thread_num):
 Get the directory path to the working dir for a thread.
 
diff --git a/tools/buildman/test.py b/tools/buildman/test.py
index 068784a..6f96c18 100644
--- a/tools/buildman/test.py
+++ b/tools/buildman/test.py
@@ -136,7 +136,6 @@ class TestBuild(unittest.TestCase):
 build.do_make = self.Make
 board_selected = self.boards.GetSelectedDict()
 
-#build.BuildCommits(self.commits, board_selected, False)
 build.BuildBoards(self.commits, board_selected, False, False)
 build.ShowSummary(self.commits, board_selected, True, False,
   False, False)
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v4 10/13] buildman: Add a message indicating there are no errors

2014-08-05 Thread Simon Glass
If buildman finds no problems it prints nothing. This can be a bit confusing,
so add a message that all is well.

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

Changes in v4:
- Add new patch to show a message when there are no errors

Changes in v3: None
Changes in v2: None

 tools/buildman/builder.py | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index f148b93..e33f31e 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -891,10 +891,13 @@ class Builder:
 self.col.MAGENTA)
 for arch, target_list in arch_list.iteritems():
 print '%10s: %s' % (arch, target_list)
+self._error_lines += 1
 if better_err:
 print self.col.Color(self.col.GREEN, '\n'.join(better_err))
+self._error_lines += 1
 if worse_err:
 print self.col.Color(self.col.RED, '\n'.join(worse_err))
+self._error_lines += 1
 
 if show_sizes:
 self.PrintSizeSummary(board_selected, board_dict, show_detail,
@@ -937,9 +940,12 @@ class Builder:
 self.commit_count = len(commits) if commits else 1
 self.commits = commits
 self.ResetResultSummary(board_selected)
+self._error_lines = 0
 
 for commit_upto in range(0, self.commit_count, self._step):
 self.ProduceResultSummary(commit_upto, commits, board_selected)
+if not self._error_lines:
+print self.col.Color(self.col.GREEN, '(no errors to report)')
 
 
 def SetupBuild(self, board_selected, commits):
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v4 13/13] RFC: Deprecate MAKEALL

2014-08-05 Thread Simon Glass
Since buildman now includes most of the features of MAKEALL it is probably
time to talk about deprecating MAKEALL.

Comments welcome.

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

Changes in v4: None
Changes in v3: None
Changes in v2: None

 MAKEALL | 4 
 1 file changed, 4 insertions(+)

diff --git a/MAKEALL b/MAKEALL
index 929fe88..dbbf74b 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -60,6 +60,10 @@ usage()
exit ${ret}
 }
 
+echo ** Note: MAKEALL is deprecated - please use buildman instead
+echo ** See tools/buildman/README for details
+echo
+
 SHORT_OPTS=ha:c:v:s:b:lmMCnr
 
LONG_OPTS=help,arch:,cpu:,vendor:,soc:,board:,list,maintainers,mails,check,continue,rebuild-errors
 
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v4 03/13] buildman: Allow building of current source tree

2014-08-05 Thread Simon Glass
Originally buildman had some support for building the current source tree.
However this was dropped before it was submitted, as part of the effort to
make it faster when building entire branches.

Reinstate this support. If no -b option is given, buildman will build the
current source tree.

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

Changes in v4: None
Changes in v3:
- Add new patch to build current source tree

Changes in v2: None

 tools/buildman/builder.py | 71 +---
 tools/buildman/control.py | 91 ++-
 2 files changed, 108 insertions(+), 54 deletions(-)

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index 48408ff..d2b72d5 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -248,21 +248,34 @@ class BuilderThread(threading.Thread):
 
 if self.toolchain:
 # Checkout the right commit
-if commit_upto is not None:
+if self.builder.commits:
 commit = self.builder.commits[commit_upto]
 if self.builder.checkout:
 git_dir = os.path.join(work_dir, '.git')
 gitutil.Checkout(commit.hash, git_dir, work_dir,
  force=True)
 else:
-commit = self.builder.commit # Ick, fix this for 
BuildCommits()
+commit = 'current'
 
 # Set up the environment and command line
 env = self.toolchain.MakeEnvironment()
 Mkdir(out_dir)
 args = []
+cwd = work_dir
 if not self.builder.in_tree:
-args.append('O=build')
+if commit_upto is None:
+# In this case we are building in the original source
+# directory (i.e. the current directory where buildman
+# is invoked. The output directory is set to this
+# thread's selected work directory.
+#
+# Symlinks can confuse U-Boot's Makefile since
+# we may use '..' in our path, so remove them.
+work_dir = os.path.realpath(work_dir)
+args.append('O=%s/build' % work_dir)
+cwd = None
+else:
+args.append('O=build')
 args.append('-s')
 if self.builder.num_jobs is not None:
 args.extend(['-j', str(self.builder.num_jobs)])
@@ -272,14 +285,14 @@ class BuilderThread(threading.Thread):
 
 # If we need to reconfigure, do that now
 if do_config:
-result = self.Make(commit, brd, 'distclean', work_dir,
+result = self.Make(commit, brd, 'distclean', cwd,
 'distclean', *args, env=env)
-result = self.Make(commit, brd, 'config', work_dir,
+result = self.Make(commit, brd, 'config', cwd,
 *(args + config_args), env=env)
 config_out = result.combined
 do_config = False   # No need to configure next time
 if result.return_code == 0:
-result = self.Make(commit, brd, 'build', work_dir, *args,
+result = self.Make(commit, brd, 'build', cwd, *args,
 env=env)
 result.stdout = config_out + result.stdout
 else:
@@ -478,8 +491,10 @@ class BuilderThread(threading.Thread):
 self.builder.out_queue.put(result)
 else:
 # Just build the currently checked-out build
-result = self.RunCommit(None, True)
-result.commit_upto = self.builder.upto
+result, request_config = self.RunCommit(None, brd, work_dir, True,
+True, self.builder.force_build_failures)
+result.commit_upto = 0
+self._WriteResult(result, job.keep_outputs)
 self.builder.out_queue.put(result)
 
 def run(self):
@@ -491,12 +506,16 @@ class BuilderThread(threading.Thread):
 alive = True
 while True:
 job = self.builder.queue.get()
+if self.builder.active and alive:
+self.RunJob(job)
+'''
 try:
 if self.builder.active and alive:
 self.RunJob(job)
 except Exception as err:
 alive = False
 print err
+'''
 self.builder.queue.task_done()
 
 
@@ -763,10 +782,13 @@ class Builder:
 Args:
 commit_upto: Commit number to use (0..self.count-1)
 
-

[U-Boot] Building u-boot for IMX6

2014-08-05 Thread Alexandre Delove
Hello

I am trying to build an u-boot for a sabrelite with an IMX6Q, so i downloaded 
the last package (u-boot-2014.07.tar.bz2) on this link = 
ftp://ftp.denx.de/../../../pub/u-boot/.
When i launched make mx6qsabrelite_config, everything was fine (Configuring for 
mx6qsabrelite - Board: nitrogen6x, Options: 
IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX6Q,DDR_MB=1024,SABRELITE) 
but then, when i launch make all they are some problems:

  GEN include/autoconf.mk.dep
cc1: error: bad value (armv5) for -march= switch
  GEN include/autoconf.mk
cc1: error: bad value (armv5) for -march= switch
  CHK include/config/uboot.release
  CHK include/generated/version_autogenerated.h
  CHK include/generated/timestamp_autogenerated.h
  UPD include/generated/timestamp_autogenerated.h
  CC  lib/asm-offsets.s
lib/asm-offsets.c:1:0: error: bad value (armv5) for -march= switch
 /*
 ^
make[1]: *** [lib/asm-offsets.s] Erreur 1
make: *** [prepare0] Erreur 2

Does anybody knows what can i do in order to fix this?

Thanks

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


Re: [U-Boot] Building u-boot for IMX6

2014-08-05 Thread Fabio Estevam
On Tue, Aug 5, 2014 at 12:31 PM, Fabio Estevam feste...@gmail.com wrote:

 export CROSS_COMPILE=/usr/bin/arm-linux-gnueabi


I meant export CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- (with a
minus in the end)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Building u-boot for IMX6

2014-08-05 Thread Fabio Estevam
On Tue, Aug 5, 2014 at 12:06 PM, Alexandre Delove
alexandre.del...@telecom-paristech.fr wrote:
 Hello

 I am trying to build an u-boot for a sabrelite with an IMX6Q, so i downloaded 
 the last package (u-boot-2014.07.tar.bz2) on this link = 
 ftp://ftp.denx.de/../../../pub/u-boot/.
 When i launched make mx6qsabrelite_config, everything was fine (Configuring 
 for mx6qsabrelite - Board: nitrogen6x, Options: 
 IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX6Q,DDR_MB=1024,SABRELITE)
  but then, when i launch make all they are some problems:

   GEN include/autoconf.mk.dep
 cc1: error: bad value (armv5) for -march= switch
   GEN include/autoconf.mk
 cc1: error: bad value (armv5) for -march= switch
   CHK include/config/uboot.release
   CHK include/generated/version_autogenerated.h
   CHK include/generated/timestamp_autogenerated.h
   UPD include/generated/timestamp_autogenerated.h
   CC  lib/asm-offsets.s
 lib/asm-offsets.c:1:0: error: bad value (armv5) for -march= switch
  /*
  ^
 make[1]: *** [lib/asm-offsets.s] Erreur 1
 make: *** [prepare0] Erreur 2

 Does anybody knows what can i do in order to fix this?

It seems you are missing to use and export your crosscompiler:

export ARCH=arm
export CROSS_COMPILE=/usr/bin/arm-linux-gnueabi
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] ARM: tegra: Add support for norrin board

2014-08-05 Thread Stephen Warren

On 08/04/2014 03:57 PM, Allen Martin wrote:

Norrin (PM370) is a Tegra124 clamshell board that is very similar to
venice2, but it has a different panel, the sdcard cd and wp sense are
flipped, and it has a different revision of the AS3722 PMIC.  This
board is also refered to as nyan in the ChromeOS trees.



diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e385eda94cdf..f4e0f5a42c14 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -716,6 +716,9 @@ config TARGET_DALMORE
  config TARGET_JETSON_TK1
bool Support jetson-tk1

+config TARGET_NORRIN
+   bool Support norrin
+


Note that this patch is going to conflict with:
http://patchwork.ozlabs.org/patch/376287/
tegra: kconfig: move board select menu and common settings

... since that moves all the Tegra board options into sub-menus. At some 
point, this or that patch will need to be rebased on the other, or 
merged with each-other



@@ -912,6 +915,7 @@ source board/nvidia/cardhu/Kconfig
  source board/nvidia/dalmore/Kconfig
  source board/nvidia/harmony/Kconfig
  source board/nvidia/jetson-tk1/Kconfig
+source board/nvidia/norrin/Kconfig


Indentation looks wrong there.


diff --git a/board/nvidia/venice2/as3722_init.h 
b/board/nvidia/venice2/as3722_init.h



-#ifdef CONFIG_BOARD_JETSON_TK1
+#if defined(CONFIG_BOARD_JETSON_TK1) || defined(CONFIG_BOARD_NORRIN)


Let's use CONFIG_TARGET_NORRIN directly here. This is the variable 
that's set up by Kconfig. It means that norrin_defconfig won't have to 
set up the extra/custom CONFIG_BOARD_NORRIN.


I've already sent a patch to fix this same issue for Jetson TK1:

http://patchwork.ozlabs.org/patch/375467/
ARM: tegra: remove custom define for Jetson TK1


diff --git a/configs/norrin_defconfig b/configs/norrin_defconfig



+CONFIG_SYS_EXTRA_OPTIONS=BOARD_NORRIN=


Per my comment above, you can remove that one line.

Aside from those issues, this patch looks fine.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   >