[U-Boot] [PATCH] tools: moveconfig: a tool to move CONFIGs from headers to defconfigs

2015-05-14 Thread Masahiro Yamada
This tool was originally written for my local use to ease the task
of tons of CONFIG moves, but there have been some requests for
mainlining it.
So, I have tidied up the code with nicer comments, and here it is.

See the comment block of the script for usage.

The first draft was
http://patchwork.ozlabs.org/patch/430422/

Main updates are:
  - Adapted to the single .config configuration
  - Support colored log
  - Support moving multiple options at once
(and take configs from an input file only)
  - Continue even if some boards fail
(Idea provided by Joe Hershberger)
  - More comments and code cleanups

Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 tools/moveconfig.py | 843 
 1 file changed, 843 insertions(+)
 create mode 100755 tools/moveconfig.py

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
new file mode 100755
index 000..02e2d6a
--- /dev/null
+++ b/tools/moveconfig.py
@@ -0,0 +1,843 @@
+#!/usr/bin/env python2
+#
+# Author: Masahiro Yamada yamada.masah...@socionext.com
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+
+Move config option(s) from headers to defconfig.
+
+Since Kconfig was introduced to U-Boot, we have worked on moving
+config options from headers to Kconfig (defconfig).
+
+This tool intends to help this tremendous work.
+
+
+Usage
+-
+
+This tool takes one input file.  (let's say 'recipe' file here.)
+The recipe describes the list of config options you want to move.
+Each line takes the form:
+config_name type default
+(the fields must be separated with whitespaces.)
+
+config_name is the name of config option.
+
+type is the type of the option.  It must be one of bool, tristate,
+string, int, and hex.
+
+default is the default value of the option.  It must be appropriate
+value corresponding to the value type.  It must be either y or n for
+the bool type.  Tristate options can also take m (although U-Boot has
+not supported the module feature).
+
+You can add two or more lines in the recipe file, so you can move
+multiple options at once.
+
+Let's say, for example, you want to move CONFIG_CMD_USB and
+CONFIG_SYS_TEXT_BASE.
+
+The type should be bool, hex, respectively.  So, the recipe file
+should look like this:
+
+  $ cat recipe
+  CONFIG_SYS_GENERIC_BOARD bool n
+  CONFIG_SYS_TEXT_BASE hex 0x
+
+And then run this tool giving the file name of the recipe
+
+  $ tools/moveconfig.py recipe
+
+The tool walks through all the defconfig files to move the config
+options specified by the recipe file.
+
+The log is also displayed on the terminal.
+
+Each line is printed in the format
+defconfig_name   :  action
+
+defconfig_name is the name of the defconfig
+(without the suffix _defconfig).
+
+action shows what the tool did for that defconfig.
+It looks like one of the followings:
+
+ - Move 'CONFIG_... '
+   This config option was moved to the defconfig
+
+ - Default value 'CONFIG_...'.  Do nothing.
+   The value of this option is the same as default.
+   We do not have to add it to the defconfig.
+
+ - 'CONFIG_...' already exists in Kconfig.  Do nothing.
+   This config option is already defined in Kconfig.
+   We do not need/want to touch it.
+
+ - Undefined.  Do nothing.
+   This config option was not found in the config header.
+   Nothing to do.
+
+ - Failed to process.  Skip.
+   An error occurred during processing this defconfig.  Skipped.
+   (If -e option is passed, the tool exits immediately on error.)
+
+Finally, you will be asked, Clean up headers? [y/n]:
+
+If you say 'y' here, the unnecessary config defines are removed
+from the config headers (include/configs/*.h).
+It just uses the regex method, so you should not rely on it.
+Just in case, please do 'git diff' to see what happened.
+
+
+How does it works?
+--
+
+This tool runs configuration and builds include/autoconf.mk for every
+defconfig.  The config options defined in Kconfig appear in the .config
+file (unless they are hidden because of unmet dependency.)
+On the other hand, the config options defined by board headers are seen
+in include/autoconf.mk.  The tool looks for the specified options in both
+of them to decide the appropriate action for the options.  If the option
+is found in the .config or the value is the same as the specified default,
+the option does not need to be touched.  If the option is found in
+include/autoconf.mk, but not in the .config, and the value is different
+from the default, the tools adds the option to the defconfig.
+
+For faster processing, this tool handles multi-threading.  It creates
+separate build directories where the out-of-tree build is run.  The
+temporary build directories are automatically created and deleted as
+needed.  The number of threads are chosen based on the number of the CPU
+cores of your system although you can change it via -j (--jobs) option.
+
+
+Toolchains
+--
+
+Appropriate 

Re: [U-Boot] [PATCH v3 01/10] moveconfig: Actually build autoconf.mk

2015-05-14 Thread Masahiro Yamada
2015-05-14 7:28 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 The existing target won't actually build the needed .mk file that is
 expected by the rest of the script. It seems that silentoldconfig does
 not actually cause this to be built any longer.

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com
 ---
 This patch is based on:
  Don't apply: tools: add a tool to move automatically CONFIGs from headers 
 to defconfigs
 from the list.

 Also dropped the patch that adds an arc cross-tool mapping.

 Changes in v3: None
 Changes in v2: None

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

 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index cb7f7ea..30dc4f6 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -301,7 +301,7 @@ class Slot:
  cmd = list(self.make_cmd)
  if cross_compile:
  cmd.append('CROSS_COMPILE=%s' % cross_compile)
 -cmd.append('silentoldconfig')
 +cmd.append('include/autoconf.mk')
  self.ps = subprocess.Popen(cmd, stdout=self.devnull)
  self.state = STATE_SILENTOLDCONFIG
  return False

Yup, the 'Don't apply' version is not working since I removed
scripts/multiconfig.sh.

I had locally modified this tool though I tweaked a bit differently.


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


Re: [U-Boot] [PATCH v3 05/10] moveconfig: Add a parameter to accept a list to build

2015-05-14 Thread Masahiro Yamada
2015-05-14 7:28 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 This is helpful to re-attempt to move failed boards from a previous run
 without starting over.

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

I like this idea, but I have just submitted a new version.

Would you mind rebasing this patch onto mine, or shall I do 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] [PATCH v3 08/10] moveconfig: Handle moving multiple configs at once

2015-05-14 Thread Masahiro Yamada
Hi Joe,

2015-05-14 7:28 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 Moving configs is a fairly slow process since each board config must
 pass through a compiler to evaluate the configs. Also, many configs
 are related in a way that makes sense to atomically move.

 Add support to tools/moveconfig.py to read multiple lines from the
 .moveconfig file and create a parser for each. After compiling the
 configs, simply run all the parsers on the autoconf.mk to find the
 state of each of those configs.

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


Sorry for leaving this scripts for such a long time.
(I have been busy in the Linux side lately.)
causing two people to develope a similar feature.

I thought the same thing.
My idea was to stop giving config attributes from the command arguments.
Instead, the name of the input file is given as the argument.


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


[U-Boot] [PATCH] imx: ventana: use stack relocation

2015-05-14 Thread Tim Harvey
Certain features we desire require a larger stack than is available by using
iRAM (most notably for us, env_mmc). Relocate the stack to DRAM so that
we can use these features.

Signed-off-by: Tim Harvey thar...@gateworks.com
---
 board/gateworks/gw_ventana/gw_ventana_spl.c | 3 ---
 configs/gwventana_defconfig | 2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c 
b/board/gateworks/gw_ventana/gw_ventana_spl.c
index 289a0b8..8d41bb4 100644
--- a/board/gateworks/gw_ventana/gw_ventana_spl.c
+++ b/board/gateworks/gw_ventana/gw_ventana_spl.c
@@ -565,9 +565,6 @@ void board_init_f(ulong dummy)
 
/* Clear the BSS. */
memset(__bss_start, 0, __bss_end - __bss_start);
-
-   /* load/boot image from boot device */
-   board_init_r(NULL, 0);
 }
 
 void reset_cpu(ulong addr)
diff --git a/configs/gwventana_defconfig b/configs/gwventana_defconfig
index d6bbdc1..b28fe4b 100644
--- a/configs/gwventana_defconfig
+++ b/configs/gwventana_defconfig
@@ -3,3 +3,5 @@ 
CONFIG_SYS_EXTRA_OPTIONS=IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL
 CONFIG_ARM=y
 CONFIG_TARGET_GW_VENTANA=y
 CONFIG_SYS_MALLOC_F=y
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_STACK_R_ADDR=0x1800
-- 
1.9.1

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


Re: [U-Boot] [PATCH] am33xx, spl, siemens: enable debug uart output again

2015-05-14 Thread Simon Glass
Hi Heiko,

On 14 May 2015 at 04:51, Tom Rini tr...@konsulko.com wrote:
 On Thu, May 14, 2015 at 12:37:40PM +0200, Heiko Schocher wrote:
 Hello Tom,

 Am 06.03.2015 08:24, schrieb Heiko Schocher:
 Hello Tom,
 
 Am 05.03.2015 15:50, schrieb Tom Rini:
 On Thu, Mar 05, 2015 at 09:46:50AM +0100, Heiko Schocher wrote:
 Hello Tom,
 
 Am 05.03.2015 07:22, schrieb Heiko Schocher:
 Hello Tom,
 
 Am 04.03.2015 17:40, schrieb Tom Rini:
 On Wed, Mar 04, 2015 at 08:42:58AM +0100, Heiko Schocher wrote:
 Hello Tom,
 
 Am 02.03.2015 14:59, schrieb Tom Rini:
 On Mon, Mar 02, 2015 at 07:56:41AM +0100, Heiko Schocher wrote:
 Hello Simon,
 
 Am 24.02.2015 14:31, schrieb Simon Glass:
 Hi Heiko,
 
 On 23 February 2015 at 23:18, Heiko Schocher h...@denx.de wrote:
 a6b541b090: TI ARMv7: Don't use GD before crt0.S has set it
 
 moves the init of the debug uart at the very end of SPL code.
 Enable it for the siemens board earlier, as they print
 ddr settings ... all debug output before board_init_r()
 is here currently useless. Maybe we must rework this
 globally?
 
 Assuming we are talking about U-Boot proper, the DDR init should
 happen in board_init_f(), specifically dram_init(). so I think this
 code should be updated.
 
 If it is SPL, then DDR init should happen in SPL's board_init_f().
 
 It is in SPL...
 
 sdram_init() is called from:
 
 ./arch/arm/cpu/armv7/am33xx/board.c from s_init() ...
 
 I sent a series a few weeks ago (available at u-boot-dm branch
 spl-working) related to this topic:
 
 http://patchwork.ozlabs.org/patch/438581/
 
 Ah ... Hmm... so ./arch/arm/cpu/armv7/am33xx/board.c needs
 a rework, right?
 
 Is a simple rename s_init() - board_init_f() correct?
 
 Right so, no, we can't just rename s_init to board_init_f.  This is 
 what
 I was talking about in the thread about the function Hans wants to add
 to enable some bits in CP15 on sunxi, iirc.
 
 In short, armv7 has a different set of abstraction hooks than the
 previous ARM cores (armv8 followed what we have for v7) and I'm not
 convinced in the end that it really won us anything.  See
 http://lists.denx.de/pipermail/u-boot/2015-January/202350.html
 
 For today you need to rework the Siemens code to print out the DDR
 values (when desired) in spl_board_init() as we do not, or will not
 shortly, have gd prior to board_init_f running.
 
 Hmm... first I thought, ok, no problem, move the output from the RAM
 parameters to spl_board_init() ... but thats only the half of the
 story ... They read the RAM parameters from an i2c eeprom, and if
 there are errors, they print this errors ... currently this does
 not work, and thats I think the more important case ... and I could
 not move this error printfs to somewhere, because if RAM is not
 working ... there is no later ...
 
 So I have to enable the console early ... maybe I missed something,
 but this worked fine in the past (and I think we should not break
 this, as this is an essential feature).
 
 OK, I missed something too.  I think this gets better now once I merge
 Simon's SPL series as we do all of this from board_init_f() and the
 siemens code should just work again.
 
 Yes, just saw your patch ;-)
 
 If they are in mainline (or do you have them somewhere in a git repo?),
 I test it again on the dxr2 board, thanks!
 
 If I am correct, all needed patches from you are in mainline, just
 tried this on the dxr2 board ... but I still need:
 
 diff --git a/board/siemens/common/board.c b/board/siemens/common/board.c
 index a39cbd0..8724604 100644
 --- a/board/siemens/common/board.c
 +++ b/board/siemens/common/board.c
 @@ -40,6 +40,11 @@ void set_uart_mux_conf(void)
 
   void set_mux_conf_regs(void)
   {
 +   /* enable early the console */
 +   gd-baudrate = CONFIG_BAUDRATE;
 +   serial_init();
 +   gd-have_console = 1;
 +
  /* Initalize the board header */
  enable_i2c0_pin_mux();
  i2c_set_bus_num(0);
 
 to see the console output ...
 
 Yes, if you want console prior to spl_board_init() then you need to do
 that where you are.
 
 
 Ah, ok... so this patch is OK?

 Just found this thread again, as I want to post updates for the am335x
 based siemens boards ... Is this patch [1] Ok, and can get applied?

 Thanks!

 bye,
 Heiko
 [1] Patchwork [U-Boot] am33xx, spl, siemens: enable debug uart output again
 https://patchwork.ozlabs.org/patch/446644/

 Hups... found this patch in patchwork marked as RFC and Delegated
 to me ... ?

 I'll look it over again then, thanks.

It's a bit confusing - am I right in thinking that this is called from
board_early_init_f() in arch/arm/cpu/armv7/am33xx/board.c? That in
turn is called from board_init_f() in the same file?

If so it seems OK, although I wonder if the SPL console setup could
happen in board_early_init_f() or even board_init_f() rather than
being buried so deep? It seems odd that setting up the mux registers
should enable the console, and I doubt people will find it easily.

Regards,
Simon

Re: [U-Boot] [PATCH] imx: ventana: use stack relocation

2015-05-14 Thread Simon Glass
On 14 May 2015 at 07:22, Tim Harvey thar...@gateworks.com wrote:
 Certain features we desire require a larger stack than is available by using
 iRAM (most notably for us, env_mmc). Relocate the stack to DRAM so that
 we can use these features.

 Signed-off-by: Tim Harvey thar...@gateworks.com
 ---
  board/gateworks/gw_ventana/gw_ventana_spl.c | 3 ---
  configs/gwventana_defconfig | 2 ++
  2 files changed, 2 insertions(+), 3 deletions(-)

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 v3 02/10] moveconfig: Continue moving even if one board fails

2015-05-14 Thread Masahiro Yamada
2015-05-14 7:28 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 Some compilers are hard to come by or have so few boards they are not
 worth messing with for this tool. Provide a list that need manual
 intervention and continue moving the bulk of boards.

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

 ---

 Changes in v3: None
 Changes in v2:
 -Print which compiler is missing

  tools/moveconfig.py | 35 ++-
  1 file changed, 30 insertions(+), 5 deletions(-)

 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index 30dc4f6..d9ae859 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -17,6 +17,7 @@ import os
  import re
  import shutil
  import subprocess
 +from subprocess import PIPE
  import sys
  import tempfile
  import time
 @@ -276,6 +277,13 @@ class Slot:
  self.state = STATE_DEFCONFIG
  return True

 +def defconfig_error(self, errmsg):
 +output = self.defconfig[:-len('_defconfig')].ljust(37) + ': '
 +print output + errmsg
 +
 +Save a list of targets that have to be checked by hand
 +open('moveconfig.failed', 'a+').write(%s\n % self.defconfig)
 +
  def poll(self):
  Check if the subprocess is running and invoke the .config
  parser if the subprocess is terminated.
 @@ -290,19 +298,25 @@ class Slot:
  return False

  if self.ps.poll() != 0:
 -sys.exit(failed to process '%s' % self.defconfig)
 +errmsg = 'ERROR - build error'
 +errout = self.ps.stderr.read()
 +if errout.find('gcc: command not found') != -1:
 +errmsg = 'ERROR - compiler not found (%s)' % 
 self.cross_compile
 +self.defconfig_error(errmsg)
 +self.state = STATE_IDLE
 +return True

  if self.state == STATE_SILENTOLDCONFIG:
  self.parser.update_defconfig(self.defconfig)
  self.state = STATE_IDLE
  return True

 -cross_compile = self.parser.get_cross_compile()
 +self.cross_compile = self.parser.get_cross_compile()
  cmd = list(self.make_cmd)
 -if cross_compile:
 -cmd.append('CROSS_COMPILE=%s' % cross_compile)
 +if self.cross_compile:
 +cmd.append('CROSS_COMPILE=%s' % self.cross_compile)
  cmd.append('include/autoconf.mk')
 -self.ps = subprocess.Popen(cmd, stdout=self.devnull)
 +self.ps = subprocess.Popen(cmd, stdout=self.devnull, stderr=PIPE)
  self.state = STATE_SILENTOLDCONFIG
  return False

 @@ -362,6 +376,7 @@ class Slots:

  def move_config(config_attr, jobs=1):
  check_top_directory()
 +
  print 'Moving %s (type: %s, default: %s, no_spl: %s) ...  (jobs: %d)' % (
  config_attr['config'],
  config_attr['type'],
 @@ -378,6 +393,10 @@ def move_config(config_attr, jobs=1):
  continue
  defconfigs.append(os.path.join(dirpath, filename))

 +Clean up any previous log of failed moves
 +if os.path.exists('moveconfig.failed'):
 +os.remove('moveconfig.failed')
 +
  slots = Slots(config_attr, jobs)

  # Main loop to process defconfig files:
 @@ -395,6 +414,12 @@ def move_config(config_attr, jobs=1):

  cleanup_headers(config_attr['config'])

 +if os.path.exists('moveconfig.failed'):
 +print '!!!  Some boards were not processed; move the config 
 manually.'
 +print '!!!  The list of failed boards are saved in moveconfig.failed'
 +print
 +print open('moveconfig.failed', 'r').read()
 +
  def main():
  try:
  cpu_count = multiprocessing.cpu_count()



I could successfully convert all the defconfigs with my toolchains,
but I thought this feature would be helpful.

I merged this feature in my new version with your signed-off-by
although the implementation is a bit different.



-- 
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] env_mmc: avoid stack allocation for env

2015-05-14 Thread Tim Harvey
On Wed, May 13, 2015 at 8:22 PM, Simon Glass s...@chromium.org wrote:
 Hi,

 On 13 May 2015 at 20:02, Simon Glass s...@chromium.org wrote:
 Hi,

 On 13 May 2015 at 16:40, Tim Harvey thar...@gateworks.com wrote:
 On Wed, May 13, 2015 at 12:58 PM, Tim Harvey thar...@gateworks.com wrote:
snip

 Tom,

 I don't really understand the CONFIG_SPL_STACK_R usage at all. The
 only thing that uses CONFIG_SPL_STACK_R is spl_relocate_stack_gd which
 is called from arch/arm/lib/crt0.S 'after' board_init_f() is called,
 which will never return for SPL because we loaded and jumped to
 u-boot.img.

 How is this working for the am335x stuff?

 Tom just forwarded me this thread. There is definitely something
 missing upstream compared to my local branch. I'll take a look and see
 what I missed.

 It should say CONFIG_SPL_STACK_R_ADDR instead of CONFIG_SPL_STACK_R

 As to the question about why CONFIG_SPL_STACK_R does not produce a
 compile error, it is defined to 1 in autoconf.h, which is a valid
 number. With the current value it sets the stack to 0xff28 which
 seems invalid to me (it is in reserved memory).

ok - makes sense I thought I was going crazy.


 It's a little bit of a mystery as to why this works on my beaglebone black.

probably just lucky address wrapping


 Anyway I have sent a patch to correct it.

 There are instructions in the README for using CONFIG_SPL_STACK_R, and
 for the new board init flow. Basically you need to return normally
 from your SPL board_init_f(). The code in crt0.S will then change the
 SPL stack to CONFIG_SPL_STACK_R_ADDR which should be in SDRAM and
 everything should be good.

 So perhaps what you are missing is that board_init_f() is now expected
 to return. It must not load U-Boot at this stage. That is supposed to
 happen in board_init_r().

I completely missed your recent commit regarding the stack relocation
(db910353a126d84fe8dff7a694ea792f50fcfb6a) - I must admit I don't have
time to keep up-to-date on the maillist.

As its a new thing that spl board_init_f should 'not' call
board_init_r, there are a lot of spl files that still call it directly
(as well as the weak implementation of board_init_f in
arch/arm/lib/spl.c). Of course, as I found out you really don't need
to remove that call unless you want to use stack relocation. The
documentation in arch/arm/lib/crt0.S is now out of date and doesn't
mention the fact that for SPL you should not call board_init_f -
perhaps this documentation should be removed and the README referred
to (or visa versa).

Thanks for clearing this up.

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


Re: [U-Boot] [PATCH V4 2/2] imx: mx27 remove redundant macro

2015-05-14 Thread Fabio Estevam
Hi Peng,

On Thu, May 14, 2015 at 7:03 AM, Peng Fan peng@freescale.com wrote:
 Use common macro in iomux-v3.h, remove redundant macro.

This is a bit misleading.

mx27 iomux is not compatible to iomux-v3.h at all.

Regards,

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


Re: [U-Boot] [PATCH v3 08/10] moveconfig: Handle moving multiple configs at once

2015-05-14 Thread Joe Hershberger
Hi Masahiro-san,

On Thu, May 14, 2015 at 9:37 AM, Masahiro Yamada
yamada.masah...@socionext.com wrote:
 Hi Joe,

 2015-05-14 7:28 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 Moving configs is a fairly slow process since each board config must
 pass through a compiler to evaluate the configs. Also, many configs
 are related in a way that makes sense to atomically move.

 Add support to tools/moveconfig.py to read multiple lines from the
 .moveconfig file and create a parser for each. After compiling the
 configs, simply run all the parsers on the autoconf.mk to find the
 state of each of those configs.

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


 Sorry for leaving this scripts for such a long time.
 (I have been busy in the Linux side lately.)
 causing two people to develope a similar feature.

Not too big a deal. Hopefully this will be in the tree soon so we can
stop managing this in every branch.

 I thought the same thing.
 My idea was to stop giving config attributes from the command arguments.
 Instead, the name of the input file is given as the argument.

That's fine. I was just trying to maintain your original features.

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


Re: [U-Boot] [PATCH 1/2] sunxi: video: Fix lvds panel support for sun6i+

2015-05-14 Thread Ian Campbell
On Thu, 2015-05-14 at 19:04 +0200, Hans de Goede wrote:
 We've never tested the lvds panel support on sun6i+ SoCs until now, and
 unsurprisingly the lvds code needed some fixes to work on my ga10h A33
 tablet with lvds panel. This makes the panel on that tablet actually work.
 
 Signed-off-by: Hans de Goede hdego...@redhat.com

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

Same for the ga10h defconfig in 2/2.


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


Re: [U-Boot] [PATCH 2/2] sunxi: Make dram odt-en configurable through Kconfig for A33 based boards

2015-05-14 Thread Ian Campbell
On Thu, 2015-05-14 at 18:55 +0200, Hans de Goede wrote:
  +config DRAM_ODT_EN
  +  int sunxi dram odt enable
  +  default 0
  +  ---help---
  +  Set this to 1 to enable dram odt (on die termination)
 
  Why is this an int rather than a bool?
 
 Because it is used directly as an int in the code, otherwise I
 need to add #ifdef-ery. I guess I could make it a bool and use
 IS_ENABLED(), but that does lead to slightly less readable code
 IMHO.

I'm afraid I think IS_ENABLED is the way to go though, it's the lesser
of two evils compared with using an int for a boolean option.

Ian.

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


[U-Boot] [PATCH 1/2] sunxi: video: Fix lvds panel support for sun6i+

2015-05-14 Thread Hans de Goede
We've never tested the lvds panel support on sun6i+ SoCs until now, and
unsurprisingly the lvds code needed some fixes to work on my ga10h A33
tablet with lvds panel. This makes the panel on that tablet actually work.

Signed-off-by: Hans de Goede hdego...@redhat.com
---
 arch/arm/include/asm/arch-sunxi/clock_sun6i.h |  3 +++
 arch/arm/include/asm/arch-sunxi/display.h | 12 
 drivers/video/sunxi_display.c | 18 +-
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h 
b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
index bacd70a..6465f21 100644
--- a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
+++ b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
@@ -331,6 +331,9 @@ struct sunxi_ccm_reg {
 #define AHB_RESET_OFFSET_LCD1  5
 #define AHB_RESET_OFFSET_LCD0  4
 
+/* ahb_reset2 offsets */
+#define AHB_RESET_OFFSET_LVDS  0
+
 /* apb2 reset */
 #define APB2_RESET_UART_SHIFT  (16)
 #define APB2_RESET_UART_MASK   (0xff  APB2_RESET_UART_SHIFT)
diff --git a/arch/arm/include/asm/arch-sunxi/display.h 
b/arch/arm/include/asm/arch-sunxi/display.h
index 5e94253..ae95417 100644
--- a/arch/arm/include/asm/arch-sunxi/display.h
+++ b/arch/arm/include/asm/arch-sunxi/display.h
@@ -363,6 +363,11 @@ struct sunxi_tve_reg {
 #define SUNXI_LCDC_TCON0_TIMING_H_TOTAL(n) (((n) - 1)  16)
 #define SUNXI_LCDC_TCON0_TIMING_V_BP(n)(((n) - 1)  0)
 #define SUNXI_LCDC_TCON0_TIMING_V_TOTAL(n) (((n) * 2)  16)
+#ifdef CONFIG_SUNXI_GEN_SUN6I
+#define SUNXI_LCDC_TCON0_LVDS_CLK_SEL_TCON0(1  20)
+#else
+#define SUNXI_LCDC_TCON0_LVDS_CLK_SEL_TCON00 /* NA */
+#endif
 #define SUNXI_LCDC_TCON0_LVDS_INTF_BITWIDTH(n) ((n)  26)
 #define SUNXI_LCDC_TCON0_LVDS_INTF_ENABLE  (1  31)
 #define SUNXI_LCDC_TCON0_IO_POL_DCLK_PHASE(x)  ((x)  28)
@@ -372,8 +377,15 @@ struct sunxi_tve_reg {
 #define SUNXI_LCDC_TCON1_TIMING_H_TOTAL(n) (((n) - 1)  16)
 #define SUNXI_LCDC_TCON1_TIMING_V_BP(n)(((n) - 1)  0)
 #define SUNXI_LCDC_TCON1_TIMING_V_TOTAL(n) (((n) * 2)  16)
+#ifdef CONFIG_SUNXI_GEN_SUN6I
+#define SUNXI_LCDC_LVDS_ANA0   0x40040320
+#define SUNXI_LCDC_LVDS_ANA0_EN_MB (1  31)
+#define SUNXI_LCDC_LVDS_ANA0_DRVC  (1  24)
+#define SUNXI_LCDC_LVDS_ANA0_DRVD(x)   ((x)  20)
+#else
 #define SUNXI_LCDC_LVDS_ANA0   0x3f31
 #define SUNXI_LCDC_LVDS_ANA0_UPDATE(1  22)
+#endif
 #define SUNXI_LCDC_LVDS_ANA1_INIT1 (0x1f  26 | 0x1f  10)
 #define SUNXI_LCDC_LVDS_ANA1_INIT2 (0x1f  16 | 0x1f  00)
 
diff --git a/drivers/video/sunxi_display.c b/drivers/video/sunxi_display.c
index 48dbdf5..269083b 100644
--- a/drivers/video/sunxi_display.c
+++ b/drivers/video/sunxi_display.c
@@ -558,8 +558,12 @@ static void sunxi_lcdc_init(void)
/* Clock on */
setbits_le32(ccm-ahb_gate1, 1  AHB_GATE_OFFSET_LCD0);
 #ifdef CONFIG_VIDEO_LCD_IF_LVDS
+#ifdef CONFIG_SUNXI_GEN_SUN6I
+   setbits_le32(ccm-ahb_reset2_cfg, 1  AHB_RESET_OFFSET_LVDS);
+#else
setbits_le32(ccm-lvds_clk_cfg, CCM_LVDS_CTRL_RST);
 #endif
+#endif
 
/* Init lcdc */
writel(0, lcdc-ctrl); /* Disable tcon */
@@ -582,6 +586,16 @@ static void sunxi_lcdc_enable(void)
 #ifdef CONFIG_VIDEO_LCD_IF_LVDS
setbits_le32(lcdc-tcon0_lvds_intf, SUNXI_LCDC_TCON0_LVDS_INTF_ENABLE);
setbits_le32(lcdc-lvds_ana0, SUNXI_LCDC_LVDS_ANA0);
+#ifdef CONFIG_SUNXI_GEN_SUN6I
+   udelay(2); /* delay at least 1200 ns */
+   setbits_le32(lcdc-lvds_ana0, SUNXI_LCDC_LVDS_ANA0_EN_MB);
+   udelay(2); /* delay at least 1200 ns */
+   setbits_le32(lcdc-lvds_ana0, SUNXI_LCDC_LVDS_ANA0_DRVC);
+   if (sunxi_display.depth == 18)
+   setbits_le32(lcdc-lvds_ana0, SUNXI_LCDC_LVDS_ANA0_DRVD(0x7));
+   else
+   setbits_le32(lcdc-lvds_ana0, SUNXI_LCDC_LVDS_ANA0_DRVD(0xf));
+#else
setbits_le32(lcdc-lvds_ana0, SUNXI_LCDC_LVDS_ANA0_UPDATE);
udelay(2); /* delay at least 1200 ns */
setbits_le32(lcdc-lvds_ana1, SUNXI_LCDC_LVDS_ANA1_INIT1);
@@ -589,6 +603,7 @@ static void sunxi_lcdc_enable(void)
setbits_le32(lcdc-lvds_ana1, SUNXI_LCDC_LVDS_ANA1_INIT2);
setbits_le32(lcdc-lvds_ana0, SUNXI_LCDC_LVDS_ANA0_UPDATE);
 #endif
+#endif
 }
 
 static void sunxi_lcdc_panel_enable(void)
@@ -706,7 +721,8 @@ static void sunxi_lcdc_tcon0_mode_set(const struct 
ctfb_res_modes *mode,
 #endif
 #ifdef CONFIG_VIDEO_LCD_IF_LVDS
val = (sunxi_display.depth == 18) ? 1 : 0;
-   writel(SUNXI_LCDC_TCON0_LVDS_INTF_BITWIDTH(val), 
lcdc-tcon0_lvds_intf);
+   writel(SUNXI_LCDC_TCON0_LVDS_INTF_BITWIDTH(val) |
+  SUNXI_LCDC_TCON0_LVDS_CLK_SEL_TCON0, lcdc-tcon0_lvds_intf);
 #endif
 
if (sunxi_display.depth == 18 || sunxi_display.depth == 16) {
-- 
2.3.6

___
U-Boot mailing list
U-Boot@lists.denx.de

Re: [U-Boot] [PATCH v3 04/10] moveconfig: Always run savedefconfig on the moved config

2015-05-14 Thread Joe Hershberger
Hi Masahiro-san.

On Thu, May 14, 2015 at 10:15 AM, Masahiro Yamada
yamada.masah...@socionext.com wrote:
 2015-05-14 7:28 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 This will ensure that the order of the defconfig entries will always
 match that of the Kconfig files. After one slightly painful (but
 still early in the process) pass over all boards, this should keep
 the defconfigs clean from here on.

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


 I a bit hesitate to always enable this feature
 because savedefconfig might make git-diff  noisier.

That should never be the case. Its consistent use should always lead
to the least noisy diff.

 Is it possible to make it optional?
 -s, --savedefconfig  or --no-savedefconfig?

It is possible, but I recommend against it. Its inconsistent use would
lead to noisy diffs.

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


Re: [U-Boot] [PATCH] nand: mxs_nand_spl: support use of env in SPL

2015-05-14 Thread Scott Wood
On Thu, 2015-05-14 at 08:12 -0700, Tim Harvey wrote:
 It turns out that this is needed because env_nand.c:readenv() calls
 nand_read_skip_bad, which uses the mtd layer. For SPL the
 functionality of readenv() is pretty much already in
 nand_spl_load_image() so I find if do the following (instead of making
 any changes to mxs_nand_spl.c) which allows the mtd layers to not be
 used I save 4KB in the SPL:
 
 diff --git a/common/env_nand.c b/common/env_nand.c
 index cc7e979..97d10a2 100644
 --- a/common/env_nand.c
 +++ b/common/env_nand.c
 @@ -260,6 +260,9 @@ int saveenv(void)
  }
  #endif /* CMD_SAVEENV */
 
 +#if defined(CONFIG_SPL_BUILD)
 +#define readenv(offset, buf) nand_spl_load_image(offset, CONFIG_ENV_SIZE, 
 buf)
 +#else
  static int readenv(size_t offset, u_char *buf)
  {
 size_t end = offset + CONFIG_ENV_RANGE;
 @@ -295,6 +298,7 @@ static int readenv(size_t offset, u_char *buf)
 
 return 0;
  }
 +#endif /* #if defined(CONFIG_SPL_BUILD) */
 
  #ifdef CONFIG_ENV_OFFSET_OOB
  int get_nand_env_oob(nand_info_t *nand, unsigned long *result)
 
 I don't think I'm loosing any necessary functionality in the SPL by
 doing the above and it saves me 4KB in the SPL which is precious
 space.

I'd prefer a function over a macro, but OK.

readenv() itself looks like it could be greatly simplified by dropping
the loop and bad block check, since nand_read_skip_bad() handles that.

-Scott


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


[U-Boot] [PATCH] env_nand: use nand_spl_load_image for readenv if SPL

2015-05-14 Thread Tim Harvey
The readenv() implementation of env_nand uses the mtd layer which is
unnecessary overhead in SPL when we already have a nand_spl_load_image()
function that doesn't need it. Using this instead eliminates the need
to provide a mtd_read for SPL env as well as reduces code (4KB savings in IMX6
SPL).

Signed-off-by: Tim Harvey thar...@gateworks.com
---
 common/env_nand.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/common/env_nand.c b/common/env_nand.c
index 7fc7558..bab89fd 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -260,6 +260,12 @@ int saveenv(void)
 }
 #endif /* CMD_SAVEENV */
 
+#if defined(CONFIG_SPL_BUILD)
+static int readenv(size_t offset, u_char *buf)
+{
+   return nand_spl_load_image(offset, CONFIG_ENV_SIZE, buf);
+}
+#else
 static int readenv(size_t offset, u_char *buf)
 {
size_t end = offset + CONFIG_ENV_RANGE;
@@ -295,6 +301,7 @@ static int readenv(size_t offset, u_char *buf)
 
return 0;
 }
+#endif /* #if defined(CONFIG_SPL_BUILD) */
 
 #ifdef CONFIG_ENV_OFFSET_OOB
 int get_nand_env_oob(nand_info_t *nand, unsigned long *result)
-- 
1.9.1

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


Re: [U-Boot] [PATCH 2/2] sunxi: Make dram odt-en configurable through Kconfig for A33 based boards

2015-05-14 Thread Hans de Goede

Hi,

On 05/13/2015 09:26 PM, Ian Campbell wrote:

On Wed, 2015-05-13 at 17:09 +0200, Hans de Goede wrote:

diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 940b6c7..d4ae6c7 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -95,6 +95,14 @@ config DRAM_ZQ
---help---
Set the dram zq value.

+if MACH_SUN8I_A33


Shouldn't this be a depends on MACH_SUN8I_A33 in the entry itself? I
see we use if a lot in this file, is there a reason for that or just how
it has been done?


No special reason, just copy paste from elsewhere.


In any case using if here is at least consistent so no strong objection
on that grounds.


+config DRAM_ODT_EN
+   int sunxi dram odt enable
+   default 0
+   ---help---
+   Set this to 1 to enable dram odt (on die termination)


Why is this an int rather than a bool?


Because it is used directly as an int in the code, otherwise I
need to add #ifdef-ery. I guess I could make it a bool and use
IS_ENABLED(), but that does lead to slightly less readable code
IMHO.

Regards,

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


Re: [U-Boot] [PATCH v3 07/10] moveconfig: Ignore duplicate configs when moving

2015-05-14 Thread Joe Hershberger
Hi Masahiro-san,

On Thu, May 14, 2015 at 10:36 AM, Masahiro Yamada
yamada.masah...@socionext.com wrote:
 2015-05-14 7:28 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 When moving configs, it is important to know what was defined in the
 config header even if it duplicates the configs coming from Kconfig.

 tools/moveconfig.py now defines KCONFIG_IGNORE_DUPLICATES to prevent the
 filtering from happening and selecting wrong values for the defconfig.

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

 ---

 Changes in v3:
 -New for version 3

 Changes in v2: None

  scripts/Makefile.autoconf | 3 ++-
  tools/moveconfig.py   | 1 +
  2 files changed, 3 insertions(+), 1 deletion(-)

 diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf
 index f054081..36bfa17 100644
 --- a/scripts/Makefile.autoconf
 +++ b/scripts/Makefile.autoconf
 @@ -58,7 +58,8 @@ quiet_cmd_autoconf = GEN $@
 $(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM $(srctree)/include/common.h 
  $@.tmp  { \
 sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp |
\
 while read line; do  
\
 -   if ! grep -q $${line%=*}= 
 include/config/auto.conf; then  \
 +   if [ -n ${KCONFIG_IGNORE_DUPLICATES} ] ||  
\
 +  ! grep -q $${line%=*}= 
 include/config/auto.conf; then  \
 echo $$line;   
\
 fi   
\
 done  $@;   
\
 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index 9135e1d..97ff597 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -340,6 +340,7 @@ class Slot:
  cmd = list(self.make_cmd)
  if self.cross_compile:
  cmd.append('CROSS_COMPILE=%s' % self.cross_compile)
 +cmd.append('KCONFIG_IGNORE_DUPLICATES=1')
  cmd.append('include/autoconf.mk')
  self.ps = subprocess.Popen(cmd, stdout=self.devnull, stderr=PIPE)
  self.state = STATE_SILENTOLDCONFIG


 This patch is not clear to me.

This was specifically a problem when moving a config that defaulted to
true in the Kconfig. That meant that it would be duplicate removed
from the include since it was already true (by default) in the
Kconfig. So it had the effect of disabling that config in every board.
This stops the filtering in the case where we are trying to move
configs instead of trying to build the board in this mixed config
system environment.

 Isn't it the same concept as u-boot.cfg
 instroduced by commit 741e58e0fc8.

I don't believe it is the same thing because this will still include
the configs enabled through the config header, but (I think) not those
from Kconfig.  And anyway, we are evaluating autoconf.mk, not
u-boot.cfg.

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


[U-Boot] [U-boot] [PATCH] env_nand: simplify readenv()

2015-05-14 Thread Tim Harvey
nand_read_skip_bad() already loops over blocks and handles bad block check
so eliminate this redundant logic.

Signed-off-by: Tim Harvey thar...@gateworks.com
---
 common/env_nand.c | 32 ++--
 1 file changed, 6 insertions(+), 26 deletions(-)

diff --git a/common/env_nand.c b/common/env_nand.c
index bab89fd..2036a0e 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -268,35 +268,15 @@ static int readenv(size_t offset, u_char *buf)
 #else
 static int readenv(size_t offset, u_char *buf)
 {
-   size_t end = offset + CONFIG_ENV_RANGE;
-   size_t amount_loaded = 0;
-   size_t blocksize, len;
-   u_char *char_ptr;
+   nand_info_t *nand = nand_info[0];
+   size_t len;
 
-   blocksize = nand_info[0].erasesize;
-   if (!blocksize)
+   len = CONFIG_ENV_SIZE;
+   debug(%s: offset=0x%08x len=0x%08x\n, __func__, offset, len);
+   if (nand_read_skip_bad(nand, offset, len, NULL, nand-size, buf))
return 1;
 
-   len = min(blocksize, (size_t)CONFIG_ENV_SIZE);
-   debug(%s: offset=0x%08x blocksize=0x%08x len=0x%08x\n,
- __func__, offset, blocksize, len);
-
-   while (amount_loaded  CONFIG_ENV_SIZE  offset  end) {
-   if (nand_block_isbad(nand_info[0], offset)) {
-   offset += blocksize;
-   } else {
-   char_ptr = buf[amount_loaded];
-   if (nand_read_skip_bad(nand_info[0], offset,
-  len, NULL,
-  nand_info[0].size, char_ptr))
-   return 1;
-
-   offset += blocksize;
-   amount_loaded += len;
-   }
-   }
-
-   if (amount_loaded != CONFIG_ENV_SIZE)
+   if (len != CONFIG_ENV_SIZE)
return 1;
 
return 0;
-- 
1.9.1

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


Re: [U-Boot] [PATCH v3 10/10] moveconfig: Add a switch to only cleanup headers

2015-05-14 Thread Joe Hershberger
Hi Masahiro-san,

On Thu, May 14, 2015 at 9:51 AM, Masahiro Yamada
yamada.masah...@socionext.com wrote:
 2015-05-14 7:28 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 In some case you may want to only cleanup the headers. Make it possible
 without waiting for all boards to compile.

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

 ---

 Changes in v3:
 -New for version 3

 Changes in v2: None

  tools/moveconfig.py | 83 
 -
  1 file changed, 44 insertions(+), 39 deletions(-)

 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index bb087d4..d63f47f 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -412,48 +412,50 @@ class Slots:
  def move_config(config_attrs, options):
  check_top_directory()

 -for config_attr in config_attrs:
 -print 'Moving %s (type: %s, default: %s, no_spl: %s)' % (
 -config_attr['config'],
 -config_attr['type'],
 -config_attr['default'],
 -config_attr['no_spl_support'])
 -print '%d jobs...' % options.jobs
 -
 -if options.defconfigs:
 -defconfigs = [line.strip() for line in open(options.defconfigs, 
 'r')]
 -else:
 -# All the defconfig files to be processed
 -defconfigs = []
 -for (dirpath, dirnames, filenames) in os.walk('configs'):
 -dirpath = dirpath[len('configs') + 1:]
 -for filename in fnmatch.filter(filenames, '*_defconfig'):
 -if fnmatch.fnmatch(filename, '.*'):
 -continue
 -defconfigs.append(os.path.join(dirpath, filename))
 -
 -Clean up any previous log of failed moves
 -if os.path.exists('moveconfig.failed'):
 -os.remove('moveconfig.failed')
 -
 -slots = Slots(config_attrs, options)
 -
 -# Main loop to process defconfig files:
 -#  Add a new subprocess into a vacant slot.
 -#  Sleep if there is no available slot.
 -for i, defconfig in enumerate(defconfigs):
 -while not slots.add(defconfig, i, len(defconfigs)):
 -while not slots.available():
 -# No available slot: sleep for a while
 -time.sleep(SLEEP_TIME)
 -
 -# wait until all the subprocesses finish
 -while not slots.empty():
 -time.sleep(SLEEP_TIME)
 +if not options.clean_only:
 +for config_attr in config_attrs:
 +print 'Moving %s (type: %s, default: %s, no_spl: %s)' % (
 +config_attr['config'],
 +config_attr['type'],
 +config_attr['default'],
 +config_attr['no_spl_support'])
 +print '%d jobs...' % options.jobs
 +
 +if options.defconfigs:
 +defconfigs = [line.strip() for line in
 +open(options.defconfigs, 'r')]
 +else:
 +# All the defconfig files to be processed
 +defconfigs = []
 +for (dirpath, dirnames, filenames) in os.walk('configs'):
 +dirpath = dirpath[len('configs') + 1:]
 +for filename in fnmatch.filter(filenames, '*_defconfig'):
 +if fnmatch.fnmatch(filename, '.*'):
 +continue
 +defconfigs.append(os.path.join(dirpath, filename))
 +
 +Clean up any previous log of failed moves
 +if os.path.exists('moveconfig.failed'):
 +os.remove('moveconfig.failed')
 +
 +slots = Slots(config_attrs, options)
 +
 +# Main loop to process defconfig files:
 +#  Add a new subprocess into a vacant slot.
 +#  Sleep if there is no available slot.
 +for i, defconfig in enumerate(defconfigs):
 +while not slots.add(defconfig, i, len(defconfigs)):
 +while not slots.available():
 +# No available slot: sleep for a while
 +time.sleep(SLEEP_TIME)
 +
 +# wait until all the subprocesses finish
 +while not slots.empty():
 +time.sleep(SLEEP_TIME)

  cleanup_headers(config_attrs)

 -if os.path.exists('moveconfig.failed'):
 +if (not options.clean_only)  os.path.exists('moveconfig.failed'):
  print '!!!  Some boards were not processed; move the config 
 manually.'
  print '!!!  The list of failed boards are saved in 
 moveconfig.failed'
  print


 I am OK with this feature, but this 'if' statement ranges over many code 
 lines.

 Perhaps, moving the cleanup_headers to the main function is simpler?


 def main():
 [snip]

 if not options.clean_only:
   move_config(config_attrs, options)

 cleanup_headers(config_attrs)

OK.

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


[U-Boot] [PATCH 2/2] sunxi: Add ga10h v1.1 defconfig

2015-05-14 Thread Hans de Goede
The ga10h is an 10 tablet with an A33 or A23 soc, 1G RAM, 8G or 16G nand,
sdio wifi, 2 micro usb ports, 1 otg and 1 host and 1 micro sd slot.

This commit adds a defconfig for the v1.1 pcb with an a33 soc.

Signed-off-by: Hans de Goede hdego...@redhat.com
---
 board/sunxi/MAINTAINERS  |  1 +
 configs/ga10h_v1_1_defconfig | 29 +
 2 files changed, 30 insertions(+)
 create mode 100644 configs/ga10h_v1_1_defconfig

diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS
index 55febd1..22d560a 100644
--- a/board/sunxi/MAINTAINERS
+++ b/board/sunxi/MAINTAINERS
@@ -37,6 +37,7 @@ F:configs/Orangepi_mini_defconfig
 F: configs/qt840a_defconfig
 F: configs/Wits_Pro_A20_DKT_defconfig
 F: include/configs/sun8i.h
+F: configs/ga10h_v1_1_defconfig
 F: configs/Ippo_q8h_v1_2_defconfig
 F: configs/Ippo_q8h_v1_2_a33_1024x600_defconfig
 F: include/configs/sun9i.h
diff --git a/configs/ga10h_v1_1_defconfig b/configs/ga10h_v1_1_defconfig
new file mode 100644
index 000..c859544
--- /dev/null
+++ b/configs/ga10h_v1_1_defconfig
@@ -0,0 +1,29 @@
+# The ga10h is an 10 tablet with an A33 or A23 soc, 1G RAM, 8G or 16G nand,
+# sdio wifi, 2 micro usb ports, 1 otg and 1 host and 1 micro sd slot.
+#
+# This defconfig is for the v1.1 pcb with an a33 soc.
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS=CONS_INDEX=5
+CONFIG_DEFAULT_DEVICE_TREE=sun8i-a33-ippo-q8h-v1.2-lcd1024x600
+CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB0_VBUS_PIN=AXP0-VBUS-ENABLE
+CONFIG_USB0_VBUS_DET=AXP0-VBUS-DETECT
+CONFIG_AXP_GPIO=y
+CONFIG_VIDEO_LCD_MODE=x:1024,y:600,depth:18,pclk_khz:52000,le:138,ri:162,up:22,lo:10,hs:20,vs:3,sync:3,vmode:0
+CONFIG_VIDEO_LCD_PANEL_LVDS=y
+CONFIG_VIDEO_LCD_DCLK_PHASE=0
+CONFIG_VIDEO_LCD_POWER=PH7
+CONFIG_VIDEO_LCD_BL_EN=PH6
+CONFIG_VIDEO_LCD_BL_PWM=PH0
+#CONFIG_VIDEO_LCD_BL_PWM_ACTIVE_LOW=n
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN8I_A33=y
+CONFIG_DRAM_CLK=432
+# zq = 0x3bbb
+CONFIG_DRAM_ZQ=15291
+CONFIG_DRAM_ODT_EN=1
+# Wifi power
+CONFIG_AXP221_DLDO1_VOLT=3300
+# aldo1 is connected to VCC-IO, VCC-PD, VCC-USB and VCC-HP
+CONFIG_AXP221_ALDO1_VOLT=3000
-- 
2.3.6

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


Re: [U-Boot] [PATCH V4 2/2] imx: mx27 remove redundant macro

2015-05-14 Thread Simon Glass
Hi,

On 14 May 2015 at 09:31, Fabio Estevam feste...@gmail.com wrote:
 Hi Peng,

 On Thu, May 14, 2015 at 7:03 AM, Peng Fan peng@freescale.com wrote:
 Use common macro in iomux-v3.h, remove redundant macro.

 This is a bit misleading.

 mx27 iomux is not compatible to iomux-v3.h at all.

If you'd like to respin this patch I can accept it up until tomorrow
morning, when I hope to send a pull request. If you would rather that
I drop this patch, then I can drop both (since the other one depends
on this one).

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


Re: [U-Boot] [PATCH v3 04/10] moveconfig: Always run savedefconfig on the moved config

2015-05-14 Thread Masahiro Yamada
2015-05-14 7:28 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 This will ensure that the order of the defconfig entries will always
 match that of the Kconfig files. After one slightly painful (but
 still early in the process) pass over all boards, this should keep
 the defconfigs clean from here on.

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


I a bit hesitate to always enable this feature
because savedefconfig might make git-diff  noisier.

Is it possible to make it optional?
-s, --savedefconfig  or --no-savedefconfig?



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


Re: [U-Boot] [PATCH v3 07/10] moveconfig: Ignore duplicate configs when moving

2015-05-14 Thread Masahiro Yamada
2015-05-14 7:28 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 When moving configs, it is important to know what was defined in the
 config header even if it duplicates the configs coming from Kconfig.

 tools/moveconfig.py now defines KCONFIG_IGNORE_DUPLICATES to prevent the
 filtering from happening and selecting wrong values for the defconfig.

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

 ---

 Changes in v3:
 -New for version 3

 Changes in v2: None

  scripts/Makefile.autoconf | 3 ++-
  tools/moveconfig.py   | 1 +
  2 files changed, 3 insertions(+), 1 deletion(-)

 diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf
 index f054081..36bfa17 100644
 --- a/scripts/Makefile.autoconf
 +++ b/scripts/Makefile.autoconf
 @@ -58,7 +58,8 @@ quiet_cmd_autoconf = GEN $@
 $(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM $(srctree)/include/common.h  
 $@.tmp  { \
 sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp | 
   \
 while read line; do   
   \
 -   if ! grep -q $${line%=*}= include/config/auto.conf; 
 then  \
 +   if [ -n ${KCONFIG_IGNORE_DUPLICATES} ] ||   
   \
 +  ! grep -q $${line%=*}= include/config/auto.conf; 
 then  \
 echo $$line;
   \
 fi
   \
 done  $@;
   \
 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index 9135e1d..97ff597 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -340,6 +340,7 @@ class Slot:
  cmd = list(self.make_cmd)
  if self.cross_compile:
  cmd.append('CROSS_COMPILE=%s' % self.cross_compile)
 +cmd.append('KCONFIG_IGNORE_DUPLICATES=1')
  cmd.append('include/autoconf.mk')
  self.ps = subprocess.Popen(cmd, stdout=self.devnull, stderr=PIPE)
  self.state = STATE_SILENTOLDCONFIG


This patch is not clear to me.

Isn't it the same concept as u-boot.cfg
instroduced by commit 741e58e0fc8.


-- 
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 V4 1/2] i2c: mxc: refactor i2c driver and support dm

2015-05-14 Thread Simon Glass
Hi Peng,

On 14 May 2015 at 04:03, Peng Fan peng@freescale.com wrote:
 1. Introduce a new structure `struct mxc_i2c_bus`, this structure will
used for non-DM and DM.
 2. Remove `struct mxc_i2c_regs` structure, but use register offset to access
registers based on `base` entry of `struct mxc_i2c_bus`.
 3. Remove most `#ifdef I2C_QUIRK_REG`. Using driver_data to contain platform
flags. A new flag is introduced, I2C_QUIRK_FLAG.
 4. Most functions use `struct mxc_i2c_bus` as one of the parameters.
Make most functions common to DM and non-DM, try to avoid duplicated code.
 5. Support DM, but pinctrl is not included. Pinmux setting is still set
by setup_i2c, but we do not need bus_i2c_init for DM.
 6. struct i2c_parms and struct sram_data are removed.
 7. Remove bus_i2c_read bus_i2c_write prototype in header file. The frist
paramter of bus_i2c_init is modified to i2c index. Add new prototype
i2c_idle_bus and force_bus_idle. Since bus_i2c_init is not good for
DM I2C and pinctrl is missed, we use a weak function for i2c_idle_bus.
Board file take the responsibility to implement this function, like this:

int i2c_idle_bus(struct mxc_i2c_bus *i2c_bus)
{
if (i2c_bus-index == 0)
force_bus_idle(i2c_pads_info0);
else if (i2c_bus-index == 1)
force_bus_idle(i2c_pads_info1);
else
xx
}

 8. Introduce a weak function, enable_i2c_clk
 9. Tested on an i.MX7 platform. Log info:
  = dm tree
  Class   Probed   Name
  
  root[ + ]root_driver
  simple_bus  [   ]|-- soc
  simple_bus  [   ]|   |-- aips-bus@3000
  simple_bus  [   ]|   |   |-- anatop@3036
  simple_bus  [   ]|   |   `-- snvs@3037
  simple_bus  [   ]|   |-- aips-bus@3040
  simple_bus  [   ]|   `-- aips-bus@3080
  i2c [   ]|   |-- i2c@30a2
  i2c [   ]|   `-- i2c@30a4
  simple_bus  [   ]`-- regulators
  = i2c dev 0
  Setting bus to 0
  = i2c probe
  Valid chip addresses: 08 50
  = i2c md 8 31
  0031: 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08

 Signed-off-by: Peng Fan peng@freescale.com
 Acked-by: Simon Glass s...@chromium.org
 ---

  Changes v4:
  1. fix build errors
  2. Introduce a weak function enable_i2c_clk.
  3. add Simon's Acked-by.
  4. Add test log in commit log.

I still get one build break here, fixed by the second commit:

02: i2c: mxc: refactor i2c driver and support dm
   arm:  +   apf27
+In file included from ../arch/arm/include/asm/imx-common/mxc_i2c.h:8:0,
+ from ../drivers/i2c/mxc_i2c.c:21:
w+../arch/arm/include/asm/imx-common/iomux-v3.h:175:0: warning:
GPIO_PORTA redefined [enabled by default]
w+In file included from ../drivers/i2c/mxc_i2c.c:19:0:
w+include/asm/arch/imx-regs.h:457:0: note: this is the location of the
previous definition
w+../arch/arm/include/asm/imx-common/iomux-v3.h:176:0: warning:
GPIO_PORTB redefined [enabled by default]
w+include/asm/arch/imx-regs.h:458:0: note: this is the location of the
previous definition
w+../arch/arm/include/asm/imx-common/iomux-v3.h:177:0: warning:
GPIO_PORTC redefined [enabled by default]
w+include/asm/arch/imx-regs.h:459:0: note: this is the location of the
previous definition
w+../arch/arm/include/asm/imx-common/iomux-v3.h:178:0: warning:
GPIO_PORTD redefined [enabled by default]
w+include/asm/arch/imx-regs.h:460:0: note: this is the location of the
previous definition
w+../arch/arm/include/asm/imx-common/iomux-v3.h:179:0: warning:
GPIO_PORTE redefined [enabled by default]
w+include/asm/arch/imx-regs.h:461:0: note: this is the location of the
previous definition
w+../arch/arm/include/asm/imx-common/iomux-v3.h:180:0: warning:
GPIO_PORTF redefined [enabled by default]
w+include/asm/arch/imx-regs.h:462:0: note: this is the location of the
previous definition
03: imx: mx27 remove redundant macro
   arm: apf27
-In file included from ../arch/arm/include/asm/imx-common/mxc_i2c.h:8:0,
- from ../drivers/i2c/mxc_i2c.c:21:
w-../arch/arm/include/asm/imx-common/iomux-v3.h:175:0: warning:
GPIO_PORTA redefined [enabled by default]
w-In file included from ../drivers/i2c/mxc_i2c.c:19:0:
w-include/asm/arch/imx-regs.h:457:0: note: this is the location of the
previous definition
w-../arch/arm/include/asm/imx-common/iomux-v3.h:176:0: warning:
GPIO_PORTB redefined [enabled by default]
w-include/asm/arch/imx-regs.h:458:0: note: this is the location of the
previous definition
w-../arch/arm/include/asm/imx-common/iomux-v3.h:177:0: warning:
GPIO_PORTC redefined [enabled by default]
w-include/asm/arch/imx-regs.h:459:0: note: this is the location of the
previous definition
w-../arch/arm/include/asm/imx-common/iomux-v3.h:178:0: warning:
GPIO_PORTD redefined [enabled by default]
w-include/asm/arch/imx-regs.h:460:0: note: this is the location of the
previous definition

Re: [U-Boot] [PATCH V4 2/2] imx: mx27 remove redundant macro

2015-05-14 Thread Simon Glass
On 14 May 2015 at 04:03, Peng Fan peng@freescale.com wrote:
 Use common macro in iomux-v3.h, remove redundant macro.

 Signed-off-by: Peng Fan peng@freescale.com
 ---

 Changes v4:
  New patch.
  we include mxc_i2c.h in driver/i2c/mxc_i2c.c in patch 1/2.
  mxc_i2c.h includes iomux-v3.h.
  Since iomux-v3.h have some macros which also exists in
  asm/arch-xx/imx-regs.h, this will introudce compile warnings
  such as redefined macro.

 Changes v3:
  none

 Changes v2:
  none

  arch/arm/cpu/arm926ejs/mx27/generic.c  |  1 +
  arch/arm/include/asm/arch-mx27/imx-regs.h  | 22 --
  arch/arm/include/asm/imx-common/iomux-v3.h | 22 --
  board/armadeus/apf27/apf27.c   |  1 +
  board/armadeus/apf27/fpga.c|  1 +
  board/logicpd/imx27lite/imx27lite.c|  1 +
  6 files changed, 20 insertions(+), 28 deletions(-)

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


[U-Boot] [PATCH] vexpress64: let Juno wait for root device

2015-05-14 Thread Linus Walleij
The Juno reference design typically plugs the root FS
on a USB stick. We need to wait a bit for the root to
appear so tell this on the default command line.

Signed-off-by: Linus Walleij linus.wall...@linaro.org
---
 include/configs/vexpress_aemv8a.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/vexpress_aemv8a.h 
b/include/configs/vexpress_aemv8a.h
index e9d9ae3a88be..2b41fc5e361e 100644
--- a/include/configs/vexpress_aemv8a.h
+++ b/include/configs/vexpress_aemv8a.h
@@ -206,6 +206,7 @@
 /* Assume we boot with root on the first partition of a USB stick */
 #define CONFIG_BOOTARGSconsole=ttyAMA0,115200n8  \
root=/dev/sda1 rw  \
+   rootwait \
earlyprintk=pl011,0x7ff8 debug 
user_debug=31 \
loglevel=9
 
-- 
1.9.3

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


Re: [U-Boot] [PATCH v3 10/10] moveconfig: Add a switch to only cleanup headers

2015-05-14 Thread Masahiro Yamada
2015-05-14 7:28 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 In some case you may want to only cleanup the headers. Make it possible
 without waiting for all boards to compile.

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

 ---

 Changes in v3:
 -New for version 3

 Changes in v2: None

  tools/moveconfig.py | 83 
 -
  1 file changed, 44 insertions(+), 39 deletions(-)

 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index bb087d4..d63f47f 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -412,48 +412,50 @@ class Slots:
  def move_config(config_attrs, options):
  check_top_directory()

 -for config_attr in config_attrs:
 -print 'Moving %s (type: %s, default: %s, no_spl: %s)' % (
 -config_attr['config'],
 -config_attr['type'],
 -config_attr['default'],
 -config_attr['no_spl_support'])
 -print '%d jobs...' % options.jobs
 -
 -if options.defconfigs:
 -defconfigs = [line.strip() for line in open(options.defconfigs, 'r')]
 -else:
 -# All the defconfig files to be processed
 -defconfigs = []
 -for (dirpath, dirnames, filenames) in os.walk('configs'):
 -dirpath = dirpath[len('configs') + 1:]
 -for filename in fnmatch.filter(filenames, '*_defconfig'):
 -if fnmatch.fnmatch(filename, '.*'):
 -continue
 -defconfigs.append(os.path.join(dirpath, filename))
 -
 -Clean up any previous log of failed moves
 -if os.path.exists('moveconfig.failed'):
 -os.remove('moveconfig.failed')
 -
 -slots = Slots(config_attrs, options)
 -
 -# Main loop to process defconfig files:
 -#  Add a new subprocess into a vacant slot.
 -#  Sleep if there is no available slot.
 -for i, defconfig in enumerate(defconfigs):
 -while not slots.add(defconfig, i, len(defconfigs)):
 -while not slots.available():
 -# No available slot: sleep for a while
 -time.sleep(SLEEP_TIME)
 -
 -# wait until all the subprocesses finish
 -while not slots.empty():
 -time.sleep(SLEEP_TIME)
 +if not options.clean_only:
 +for config_attr in config_attrs:
 +print 'Moving %s (type: %s, default: %s, no_spl: %s)' % (
 +config_attr['config'],
 +config_attr['type'],
 +config_attr['default'],
 +config_attr['no_spl_support'])
 +print '%d jobs...' % options.jobs
 +
 +if options.defconfigs:
 +defconfigs = [line.strip() for line in
 +open(options.defconfigs, 'r')]
 +else:
 +# All the defconfig files to be processed
 +defconfigs = []
 +for (dirpath, dirnames, filenames) in os.walk('configs'):
 +dirpath = dirpath[len('configs') + 1:]
 +for filename in fnmatch.filter(filenames, '*_defconfig'):
 +if fnmatch.fnmatch(filename, '.*'):
 +continue
 +defconfigs.append(os.path.join(dirpath, filename))
 +
 +Clean up any previous log of failed moves
 +if os.path.exists('moveconfig.failed'):
 +os.remove('moveconfig.failed')
 +
 +slots = Slots(config_attrs, options)
 +
 +# Main loop to process defconfig files:
 +#  Add a new subprocess into a vacant slot.
 +#  Sleep if there is no available slot.
 +for i, defconfig in enumerate(defconfigs):
 +while not slots.add(defconfig, i, len(defconfigs)):
 +while not slots.available():
 +# No available slot: sleep for a while
 +time.sleep(SLEEP_TIME)
 +
 +# wait until all the subprocesses finish
 +while not slots.empty():
 +time.sleep(SLEEP_TIME)

  cleanup_headers(config_attrs)

 -if os.path.exists('moveconfig.failed'):
 +if (not options.clean_only)  os.path.exists('moveconfig.failed'):
  print '!!!  Some boards were not processed; move the config 
 manually.'
  print '!!!  The list of failed boards are saved in moveconfig.failed'
  print


I am OK with this feature, but this 'if' statement ranges over many code lines.

Perhaps, moving the cleanup_headers to the main function is simpler?


def main():
[snip]

if not options.clean_only:
  move_config(config_attrs, options)

cleanup_headers(config_attrs)





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


[U-Boot] [PATCH] arch/arm/lib/bootm-fdt.c: Guard the include of asm/armv7.h

2015-05-14 Thread Tom Rini
With d6b72da0 we started including this file unconditionally.  This
isn't allowed in a file that we also use on armv8.  This will get
cleaned up a bit better once we really start using these same features
(and have similar fdt updates needed) on armv8.

Signed-off-by: Tom Rini tr...@konsulko.com
---
 arch/arm/lib/bootm-fdt.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/lib/bootm-fdt.c b/arch/arm/lib/bootm-fdt.c
index 0eb10a8..7677358 100644
--- a/arch/arm/lib/bootm-fdt.c
+++ b/arch/arm/lib/bootm-fdt.c
@@ -17,7 +17,9 @@
 
 #include common.h
 #include fdt_support.h
+#ifdef CONFIG_ARMV7_NONSEC
 #include asm/armv7.h
+#endif
 #include asm/psci.h
 
 DECLARE_GLOBAL_DATA_PTR;
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH] nand: mxs_nand_spl: support use of env in SPL

2015-05-14 Thread Tim Harvey
On Wed, May 13, 2015 at 4:38 PM, Scott Wood scottw...@freescale.com wrote:
 On Fri, 2015-05-08 at 14:39 -0700, Tim Harvey wrote:
 -int nand_spl_load_image(uint32_t offs, unsigned int size, void *buf)
 +int mtd_read(struct mtd_info *mtd, loff_t offs, size_t size, size_t *retlen,
 +  uchar *buf)
  {
   struct nand_chip *chip;
   unsigned int page;
   unsigned int nand_page_per_block;
   unsigned int sz = 0;
 + nand_info_t *info = nand_info[0];

 Any reason not to use the passed-in mtd pointer (and fix the
 nand_spl_load_image wrapper to pass in nand_info[0])?

Hi Scott,

No reason - I think I just got confused because I didn't realize
nand_info_t was a typedef for struct mtd_info.


 +/* setup mtd and nand structs and init mxs_nand driver */
 +static int mxs_nand_init(void)
 +{
 + nand_info_t *info = nand_info[0];
 +
 + /* return if already initalized */
 + if (nand_chip.numchips)
 + return 0;
 +
 + /* init mxs nand driver */
 + board_nand_init(nand_chip);
 + info-priv = nand_chip;
 + /* set mtd functions */
 + nand_chip.cmdfunc = mxs_nand_command;
 + nand_chip.numchips = 1;
 +
 + /* identify flash device */
 + puts(NAND : );
 + if (mxs_flash_ident(info)) {
 + printf(Failed to identify\n);
 + return -1;
 + }
 +
 + /* allocate and initialize buffers */
 + nand_chip.buffers = memalign(ARCH_DMA_MINALIGN,
 +  sizeof(*nand_chip.buffers));
 + nand_chip.oob_poi = nand_chip.buffers-databuf + info-writesize;
 + /* setup flash layout (does not scan as we override that) */
 + info-size = nand_chip.chipsize;
 + nand_chip.scan_bbt(info);
 +
 + printf(%llu MiB\n, (info-size / (1024 * 1024)));
 + return 0;
 +}

 Why did this function need to be moved?

 +int nand_spl_load_image(uint32_t offs, unsigned int size, void *buf)
 +{
 + return mtd_read(NULL, offs, size, NULL, buf);
 +}

 It'd be nice to keep the wrapper near the function it wraps.

It doesn't need to be moved and moving the location of the wrapper as
well makes the patch much easier to read/review.


 I don't see any other such wrappers; is there no other driver that
 currently works with SPL env?

I don't know - this got me digging into why I needed mtd_read()
implemented all of the sudden once I enabled CONFIG_SPL_ENV_SUPPORT.

It turns out that this is needed because env_nand.c:readenv() calls
nand_read_skip_bad, which uses the mtd layer. For SPL the
functionality of readenv() is pretty much already in
nand_spl_load_image() so I find if do the following (instead of making
any changes to mxs_nand_spl.c) which allows the mtd layers to not be
used I save 4KB in the SPL:

diff --git a/common/env_nand.c b/common/env_nand.c
index cc7e979..97d10a2 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -260,6 +260,9 @@ int saveenv(void)
 }
 #endif /* CMD_SAVEENV */

+#if defined(CONFIG_SPL_BUILD)
+#define readenv(offset, buf) nand_spl_load_image(offset, CONFIG_ENV_SIZE, buf)
+#else
 static int readenv(size_t offset, u_char *buf)
 {
size_t end = offset + CONFIG_ENV_RANGE;
@@ -295,6 +298,7 @@ static int readenv(size_t offset, u_char *buf)

return 0;
 }
+#endif /* #if defined(CONFIG_SPL_BUILD) */

 #ifdef CONFIG_ENV_OFFSET_OOB
 int get_nand_env_oob(nand_info_t *nand, unsigned long *result)

I don't think I'm loosing any necessary functionality in the SPL by
doing the above and it saves me 4KB in the SPL which is precious
space.


  int nand_default_bbt(struct mtd_info *mtd)
  {
   return 0;
 @@ -223,6 +232,7 @@ int nand_default_bbt(struct mtd_info *mtd)

  void nand_init(void)
  {
 + mxs_nand_init();
  }

 Do you still need the return if already initialized check with this
 change?  How is this change related to the rest?

The check can now be eliminated as I'm moving the init to where it
likely should have been all along instead of in nand_spl_load_image().
In fact, what should be done is to simply rename the static int
mxs_nand_init() to nand_init() instead of calling the static function.

So while I could revise the above patch based on some of the things
you pointed out here it wouldn't be necessary (although I could do it
as a cleanup) with the above patch instead of env_nand.c.

What do you think?

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


[U-Boot] Uboot 2011-12 watchdog enable build failed

2015-05-14 Thread deepak kumar Pradhan
Hi,

Pardon me if I am sending this mail to wrong community.

I am new to uboot loader and trying to enable watchdog in uboot for freescale
P1020RDB_PC cpu for NAND.
I enabled the CONFIG_WATCHDOG flag in include/configs/p1_p2_rdb_pc.
h file.
When I building the uboot source code i am getting the bellow errors as

uboot-custom/nand_spl/board/freescale/p1_p2_rdb_pc/cache.c:39:
undefined reference to `watchdog_reset'

'uboot-custom/nand_spl/board/freescale/p1_p2_rdb_pc/cache.c:47:
undefined reference to `watchdog_reset'' 

Can someone point me what I am missing for nand uboot?

When I am building the same source code for SPI, I am able to build
successfully.

Can you please suggest me or point me what steps do I need to follow
to enable watchdog in Uboot?
Thanks in advance.

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


[U-Boot] Bug: boot_fdt_add_mem_rsv_regions() can drop upper 32 bits of physical addresses

2015-05-14 Thread Dan Hettena
When phys_addr_t is 32 bits wide, boot_fdt_add_mem_rsv_regions() implicitly 
uses only the low 32 bits of each memory reservation's address and length to 
determine what to reserve. So, for example, an FDT memory reservation like

/memreserve/ 0x18000 0x4000;

will actually reserve physical memory starting at 0x8000, not 0x18000 
(though the printf() will claim it is reserving starting at 0x18000).

Dan

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


[U-Boot] i.MX53 USB Client not working

2015-05-14 Thread Matthew Starr
I have a custom board loosely based off the i.MX53 QSB with a dedicated USB 
client port and separate dedicated USB host port.  I am trying to get USB 
client functionality working in mainline u-boot 2015.04.  I have verified that 
USB client/gadget functionality works when booted into Linux on the board.  In 
u-boot I have tried testing USB client with USB Mass Storage, DFU, and FastBoot 
and none of them seem to work.
 
Here is my USB client #defines from my config header file:
#define CONFIG_CI_UDC
#define CONFIG_USBD_HS
#define CONFIG_USB_GADGET_DUALSPEED
#define CONFIG_USB_GADGET
#define CONFIG_CMD_USB_MASS_STORAGE
#define CONFIG_USB_GADGET_MASS_STORAGE
#define CONFIG_USBDOWNLOAD_GADGET
#define CONFIG_USB_GADGET_VBUS_DRAW 2
#define CONFIG_USB_ETHER
#define CONFIG_USB_ETH_CDC
#define CONFIG_G_DNL_VENDOR_NUM 0x0525
#define CONFIG_G_DNL_PRODUCT_NUM0xa4a5
#define CONFIG_G_DNL_MANUFACTURER   FSL
#define CONFIG_SYS_CACHELINE_SIZE   64

Additionally here are my #defines for the USB host functionality:
/* USB Host Configs */
#define CONFIG_CMD_USB
#define CONFIG_USB_EHCI
#define CONFIG_USB_EHCI_MX5
#define CONFIG_USB_STORAGE
#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX
#define CONFIG_USB_ETHER_MCS7830
#define CONFIG_USB_ETHER_SMSC95XX
#define CONFIG_MXC_USB_PORT 1
#define CONFIG_MXC_USB_PORTSC   (PORT_PTS_UTMI | PORT_PTS_PTW)
#define CONFIG_MXC_USB_FLAGS0

Here is my board file content related to USB:
 #ifdef CONFIG_USB_EHCI_MX5
static void setup_usb(void)
{
imx_iomux_v3_setup_pad(MX53_PAD_GPIO_0__GPIO1_0);
}
 
 int board_ehci_hcd_init(int port)
{
/* Enable USB_H1_VBUS power with GPIO1_0 */
gpio_direction_output(IMX_GPIO_NR(1, 0), 1);
return 0;
}
#endif
 
int board_usb_phy_mode(int port)
{  
if (port == 1)
return USB_INIT_HOST;
else   
return USB_INIT_DEVICE;
}
 
Then later on in board_init(), I have:
#ifdef CONFIG_USB_EHCI_MX5
setup_usb();
#endif

When I run the 'ums 0 mmc 0' command, I get the following:
UMS: disk start sector: 0x0, count: 0xe88000
and then I get an infinite spinning progress indicator.  At this point when I 
connect the USB cable to a Host PC, I see nothing on the host PC side (Windows 
or Liunx).
 
Any ideas on what I am missing to get USB client working or any hints on how to 
debug this further.

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


Re: [U-Boot] [U-boot] [PATCH] env_nand: simplify readenv()

2015-05-14 Thread Scott Wood
On Thu, 2015-05-14 at 11:48 -0700, Tim Harvey wrote:
 nand_read_skip_bad() already loops over blocks and handles bad block check
 so eliminate this redundant logic.
 
 Signed-off-by: Tim Harvey thar...@gateworks.com
 ---
  common/env_nand.c | 32 ++--
  1 file changed, 6 insertions(+), 26 deletions(-)
 
 diff --git a/common/env_nand.c b/common/env_nand.c
 index bab89fd..2036a0e 100644
 --- a/common/env_nand.c
 +++ b/common/env_nand.c
 @@ -268,35 +268,15 @@ static int readenv(size_t offset, u_char *buf)
  #else
  static int readenv(size_t offset, u_char *buf)
  {
 - size_t end = offset + CONFIG_ENV_RANGE;
 - size_t amount_loaded = 0;
 - size_t blocksize, len;
 - u_char *char_ptr;
 + nand_info_t *nand = nand_info[0];
 + size_t len;
  
 - blocksize = nand_info[0].erasesize;
 - if (!blocksize)
 + len = CONFIG_ENV_SIZE;
 + debug(%s: offset=0x%08x len=0x%08x\n, __func__, offset, len);
 + if (nand_read_skip_bad(nand, offset, len, NULL, nand-size, buf))
   return 1;

The limit should be min(nand-size - offset, CONFIG_ENV_RANGE).

-Scott


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


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

2015-05-14 Thread Tom Rini
On Wed, May 13, 2015 at 12:23:01PM -0700, Tom Warren wrote:

 OK, Tom.  Ready to be pulled into U-Boot/master. Thanks!
 
 ./MAKEALL -s tegra is OK, nyan-big boots to console OK.
 
 The following changes since commit bd328eb38274ffaf04caaa8a6ecc09b7e19a650e:
 
   Clean all defconfigs with savedefconfig (2015-05-12 18:10:26 -0400)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-tegra.git master
 
 for you to fetch changes up to 237c36379c76f7f6647bb11c03aa9c5cb9a4972f:
 
   ARM: tegra: move NVIDIA common files to arch/arm/mach-tegra (2015-05-13
 09:46:19 -0700)
 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/2] Use map_sysmem when accessing memory in setexpr

2015-05-14 Thread Tom Rini
On Mon, May 11, 2015 at 01:53:13PM -0500, Joe Hershberger wrote:

 The setexpr command used to segfault when accessing memory in sandbox.
 The pointer accesses should be mapped.
 
 Signed-off-by: Joe Hershberger joe.hershber...@ni.com
 Cc: Simon Glass s...@chromium.org
 Reviewed-by: Simon Glass s...@chromium.org

Applied to u-boot/master, thanks!

-- 
Tom


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


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

2015-05-14 Thread Tom Rini
On Wed, May 13, 2015 at 01:04:41PM +0200, Andreas Bießmann wrote:

 Hi Tom,
 
 please pull the following changes into u-boot/master.
 
 The following changes since commit bd328eb38274ffaf04caaa8a6ecc09b7e19a650e:
 
   Clean all defconfigs with savedefconfig (2015-05-12 18:10:26 -0400)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-atmel.git master
 
 for you to fetch changes up to 9aee8d835751773ad7a6b8d618566814c0a3205c:
 
   ARM: at91: trival: fix typo for the nand partition name (2015-05-13 
 13:01:28 +0200)
 

Applied to u-boot/master, thanks!

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


Re: [U-Boot] please pull u-boot-arc master

2015-05-14 Thread Tom Rini
On Wed, May 13, 2015 at 04:26:41PM +, Alexey Brodkin wrote:

 Hi Tom,
 
 The following changes since commit bd328eb38274ffaf04caaa8a6ecc09b7e19a650e:
 
   Clean all defconfigs with savedefconfig (2015-05-12 18:10:26 -0400)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-arc.git 
 
 for you to fetch changes up to 4e31e5676f0158119783def2ab9851b6bc7e6648:
 
   arc: remove dummy target (2015-05-13 19:20:35 +0300)
 

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] [PATCH v2] env_nand: simplify readenv()

2015-05-14 Thread Tim Harvey
nand_read_skip_bad() already loops over blocks and handles bad block check
so eliminate this redundant logic.

Signed-off-by: Tim Harvey thar...@gateworks.com
---
v2: fix limit

 common/env_nand.c | 32 ++--
 1 file changed, 6 insertions(+), 26 deletions(-)

diff --git a/common/env_nand.c b/common/env_nand.c
index bab89fd..78e7b58 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -268,35 +268,15 @@ static int readenv(size_t offset, u_char *buf)
 #else
 static int readenv(size_t offset, u_char *buf)
 {
-   size_t end = offset + CONFIG_ENV_RANGE;
-   size_t amount_loaded = 0;
-   size_t blocksize, len;
-   u_char *char_ptr;
+   nand_info_t *nand = nand_info[0];
+   size_t len;
 
-   blocksize = nand_info[0].erasesize;
-   if (!blocksize)
+   len = min((size_t)nand-size - offset, (size_t)CONFIG_ENV_RANGE);
+   debug(%s: offset=0x%08x len=0x%08x\n, __func__, offset, len);
+   if (nand_read_skip_bad(nand, offset, len, NULL, nand-size, buf))
return 1;
 
-   len = min(blocksize, (size_t)CONFIG_ENV_SIZE);
-   debug(%s: offset=0x%08x blocksize=0x%08x len=0x%08x\n,
- __func__, offset, blocksize, len);
-
-   while (amount_loaded  CONFIG_ENV_SIZE  offset  end) {
-   if (nand_block_isbad(nand_info[0], offset)) {
-   offset += blocksize;
-   } else {
-   char_ptr = buf[amount_loaded];
-   if (nand_read_skip_bad(nand_info[0], offset,
-  len, NULL,
-  nand_info[0].size, char_ptr))
-   return 1;
-
-   offset += blocksize;
-   amount_loaded += len;
-   }
-   }
-
-   if (amount_loaded != CONFIG_ENV_SIZE)
+   if (len != CONFIG_ENV_SIZE)
return 1;
 
return 0;
-- 
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] env_nand: simplify readenv()

2015-05-14 Thread Scott Wood
On Thu, 2015-05-14 at 14:35 -0700, Tim Harvey wrote:
 nand_read_skip_bad() already loops over blocks and handles bad block check
 so eliminate this redundant logic.
 
 Signed-off-by: Tim Harvey thar...@gateworks.com
 ---
 v2: fix limit
 
  common/env_nand.c | 32 ++--
  1 file changed, 6 insertions(+), 26 deletions(-)
 
 diff --git a/common/env_nand.c b/common/env_nand.c
 index bab89fd..78e7b58 100644
 --- a/common/env_nand.c
 +++ b/common/env_nand.c
 @@ -268,35 +268,15 @@ static int readenv(size_t offset, u_char *buf)
  #else
  static int readenv(size_t offset, u_char *buf)
  {
 - size_t end = offset + CONFIG_ENV_RANGE;
 - size_t amount_loaded = 0;
 - size_t blocksize, len;
 - u_char *char_ptr;
 + nand_info_t *nand = nand_info[0];
 + size_t len;
  
 - blocksize = nand_info[0].erasesize;
 - if (!blocksize)
 + len = min((size_t)nand-size - offset, (size_t)CONFIG_ENV_RANGE);

This should be the limit (lim, what you currently have as nand-size),
not len.


 + debug(%s: offset=0x%08x len=0x%08x\n, __func__, offset, len);
 + if (nand_read_skip_bad(nand, offset, len, NULL, nand-size, buf))
   return 1;

-Scott


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


Re: [U-Boot] i.MX53 USB Client not working

2015-05-14 Thread Matthew Starr
It appears that setting CONFIG_MXC_USB_PORT to 0 then loads the OTG port on the 
i.MX53.  The code appears to be in drivers/usb/host/ehci-mx5.c.The problem 
then is that the USB host port is then not usable since my i.MX53 board 
dedicates the OTG port to USB client functionality only.

Now I am trying to get both USB Host port 1 and USB OTG port 0 working at the 
same time.  Does u-boot allow using multiple USB controller ports at the same 
time?

Best regards,
 Matthew Starr

 -Original Message-
 From: U-Boot [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Matthew
 Starr
 Sent: Thursday, May 14, 2015 9:37 AM
 To: u-boot@lists.denx.de
 Subject: [U-Boot] i.MX53 USB Client not working
 
 I have a custom board loosely based off the i.MX53 QSB with a dedicated USB
 client port and separate dedicated USB host port.  I am trying to get USB
 client functionality working in mainline u-boot 2015.04.  I have verified that
 USB client/gadget functionality works when booted into Linux on the board.
 In u-boot I have tried testing USB client with USB Mass Storage, DFU, and
 FastBoot and none of them seem to work.
 
 Here is my USB client #defines from my config header file:
 #define CONFIG_CI_UDC
 #define CONFIG_USBD_HS
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
 #define CONFIG_USB_GADGET_MASS_STORAGE
 #define CONFIG_USBDOWNLOAD_GADGET
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 #define CONFIG_USB_ETHER
 #define CONFIG_USB_ETH_CDC
 #define CONFIG_G_DNL_VENDOR_NUM 0x0525
 #define CONFIG_G_DNL_PRODUCT_NUM0xa4a5
 #define CONFIG_G_DNL_MANUFACTURER   FSL
 #define CONFIG_SYS_CACHELINE_SIZE   64
 
 Additionally here are my #defines for the USB host functionality:
 /* USB Host Configs */
 #define CONFIG_CMD_USB
 #define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_MX5
 #define CONFIG_USB_STORAGE
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_ASIX
 #define CONFIG_USB_ETHER_MCS7830
 #define CONFIG_USB_ETHER_SMSC95XX
 #define CONFIG_MXC_USB_PORT 1
 #define CONFIG_MXC_USB_PORTSC   (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS0
 
 Here is my board file content related to USB:
  #ifdef CONFIG_USB_EHCI_MX5
 static void setup_usb(void)
 {
 imx_iomux_v3_setup_pad(MX53_PAD_GPIO_0__GPIO1_0);
 }
 
  int board_ehci_hcd_init(int port)
 {
 /* Enable USB_H1_VBUS power with GPIO1_0 */
 gpio_direction_output(IMX_GPIO_NR(1, 0), 1);
 return 0;
 }
 #endif
 
 int board_usb_phy_mode(int port)
 {
 if (port == 1)
 return USB_INIT_HOST;
 else
 return USB_INIT_DEVICE;
 }
 
 Then later on in board_init(), I have:
 #ifdef CONFIG_USB_EHCI_MX5
 setup_usb();
 #endif
 
 When I run the 'ums 0 mmc 0' command, I get the following:
 UMS: disk start sector: 0x0, count: 0xe88000 and then I get an infinite
 spinning progress indicator.  At this point when I connect the USB cable to a
 Host PC, I see nothing on the host PC side (Windows or Liunx).
 
 Any ideas on what I am missing to get USB client working or any hints on how
 to debug this further.
 
 Best regards,
  Matthew Starr
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V4 2/2] imx: mx27 remove redundant macro

2015-05-14 Thread Fan Peng
Hi,

On 5/15/2015 12:31 AM, Simon Glass wrote:
 Hi,

 On 14 May 2015 at 09:31, Fabio Estevam feste...@gmail.com wrote:
 Hi Peng,

 On Thu, May 14, 2015 at 7:03 AM, Peng Fan peng@freescale.com wrote:
 Use common macro in iomux-v3.h, remove redundant macro.
 This is a bit misleading.

 mx27 iomux is not compatible to iomux-v3.h at all.
Ok. I am not familiar with mx27. I'll move the GPIO_PORT[A,B,Cxxx] to 
gpio.h, but not in imx-regs.h for mx27.
 If you'd like to respin this patch I can accept it up until tomorrow
 morning, when I hope to send a pull request. If you would rather that
 I drop this patch, then I can drop both (since the other one depends
 on this one).
I'll respin this patch. If this delays your PR, you can drop them first. 
I'll  resend out patch v5 soon.

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


Re: [U-Boot] [PATCH v4] dm: sf: Add Atmel DataFlash spi flash driver

2015-05-14 Thread Wang Haikun
On 5/14/2015 6:50 PM, Jagan Teki wrote:
 On 14 May 2015 at 14:57, Haikun Wang haikun.w...@freescale.com wrote:
 Atmel DataFlash chips have commands different from common spi
 flash commands.
 Atmel DataFlash also have special page-size.
 This driver add support for accessing Atmel DataFlash.
 It is based on the Driver Model.
 Example:
 = sf probe 1:0
 SPI DataFlash: Detected AT45DB021B with page size 264 Bytes, erase size 264 
 Bytes, total 264 KiB, revision d
 = sf erase 0 42000
 SF: 270336 bytes @ 0x0 Erased: OK
 = mw.l 8200 45444342 2
 = sf write 8200 0 42000
 SF: 270336 bytes @ 0x0 Written: OK
 = sf read 8300 0 42000
 SF: 270336 bytes @ 0x0 Read: OK
 = cmp.b 8200 8300 42000
 Total of 270336 byte(s) were the same

 Signed-off-by: Haikun Wang haikun.w...@freescale.com
 ---
 Verified with AT45DB021B on LS1021AQDS.

 Changes in v4:
 - Use dev_get_priv and dev_get_uclass_priv
 - Add test log to commit message

 Changes in v3:
 - 1. Rename file spi_dataflash.c to sf_dataflash.c
 - 2. Add comment for array dataflash_data

 Changes in v2:
 - 1. Correct comment style
 - 2. Use get_timer in dataflash_waitready to check whether timeout
 - 3. Remove struct spi_flash * in struct dataflash, and get it from 
 udevice-uclass_priv
 - 4. Replace spi_flash_write_common with spi_flash_cmd_write
 - 5. Replace spi_flash_read with spi_flash_cmd_read
 - 6. Change type of varible status form char to u8 in dataflash_status
 - 7. Change add_dataflash's argument type due to change 3
 - 8. Add claim_bus and release_bus in erase/write/read due to change 4  5

 Changes in v1: None
   drivers/mtd/spi/Makefile   |   1 +
   drivers/mtd/spi/sf_dataflash.c | 711 
 +
   2 files changed, 712 insertions(+)
   create mode 100644 drivers/mtd/spi/sf_dataflash.c

 diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
 index c61b784..8adec3d 100644
 --- a/drivers/mtd/spi/Makefile
 +++ b/drivers/mtd/spi/Makefile
 @@ -15,6 +15,7 @@ endif
   #ifndef CONFIG_DM_SPI
   obj-$(CONFIG_SPI_FLASH) += sf_probe.o
   #endif
 +obj-$(CONFIG_DM_SF_DATAFLASH) += sf_dataflash.o

 This looks confuse to me,  CONFIG_SF_DATAFLASH looks simpler.
Fine.

 For long run all the driver stuff could move to DM, no need to specify
 explicitly.

 BTW:
 Did you define this any board config?
I will add it to LS1021AQDS board config and submit a separate patch.

[snip]

Best regards,
Wang Haikun

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


[U-Boot] [PATCH V5 1/2] i2c: mxc: refactor i2c driver and support dm

2015-05-14 Thread Peng Fan
1. Introduce a new structure `struct mxc_i2c_bus`, this structure will
   used for non-DM and DM.
2. Remove `struct mxc_i2c_regs` structure, but use register offset to access
   registers based on `base` entry of `struct mxc_i2c_bus`.
3. Remove most `#ifdef I2C_QUIRK_REG`. Using driver_data to contain platform
   flags. A new flag is introduced, I2C_QUIRK_FLAG.
4. Most functions use `struct mxc_i2c_bus` as one of the parameters.
   Make most functions common to DM and non-DM, try to avoid duplicated code.
5. Support DM, but pinctrl is not included. Pinmux setting is still set
   by setup_i2c, but we do not need bus_i2c_init for DM.
6. struct i2c_parms and struct sram_data are removed.
7. Remove bus_i2c_read bus_i2c_write prototype in header file. The frist
   paramter of bus_i2c_init is modified to i2c index. Add new prototype
   i2c_idle_bus and force_bus_idle. Since bus_i2c_init is not good for
   DM I2C and pinctrl is missed, we use a weak function for i2c_idle_bus.
   Board file take the responsibility to implement this function, like this:
   
   int i2c_idle_bus(struct mxc_i2c_bus *i2c_bus)
   {
   if (i2c_bus-index == 0)
   force_bus_idle(i2c_pads_info0);
   else if (i2c_bus-index == 1)
   force_bus_idle(i2c_pads_info1);
   else
   xx
   }
   
8. Introduce a weak function, enable_i2c_clk
9. Tested on an i.MX7 platform. Log info:
 = dm tree
 Class   Probed   Name
 
 root[ + ]root_driver
 simple_bus  [   ]|-- soc
 simple_bus  [   ]|   |-- aips-bus@3000
 simple_bus  [   ]|   |   |-- anatop@3036
 simple_bus  [   ]|   |   `-- snvs@3037
 simple_bus  [   ]|   |-- aips-bus@3040
 simple_bus  [   ]|   `-- aips-bus@3080
 i2c [   ]|   |-- i2c@30a2
 i2c [   ]|   `-- i2c@30a4
 simple_bus  [   ]`-- regulators
 = i2c dev 0
 Setting bus to 0
 = i2c probe
 Valid chip addresses: 08 50
 = i2c md 8 31
 0031: 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08

Signed-off-by: Peng Fan peng@freescale.com
Acked-by: Simon Glass s...@chromium.org
---

 Changes v5:
  none

 Changes v4:
 1. fix build errors
 2. Introduce a weak function enable_i2c_clk.
 3. add Simon's Acked-by.
 4. Add test log in commit log.

 Changes v3:
  1. remove bus_i2c_init for DM, introuduce a weak function i2c_idle_bus.
  2. remove static return type for force_idle_bus, since we need to call
 it in i2c_idle_bus which may be implemented in board file. This does
 not hurt for non-DM.

 Changes v2:
  1. Refactor driver, remove register access based on structure, but use
'base + offset'
  2. Introduce mxc_i2c_bus structure
  3. Introduce I2C_QUIRK_FLAG and remove most I2C_QUIRK_REG and use
 driver_data to contain the flags for different platforms
  4.  Avoid duplicated code between DM and non-DM part
  5. The function name i2c_init_transfer is not changed.
  6. Remove bus_i2c_read/write prototype from header file
  7. change bus_i2c_init's first parameter to i2c index
  8. Rename patch name, since refactor non-DM part.

 arch/arm/imx-common/i2c-mxv7.c|   7 +-
 arch/arm/include/asm/imx-common/mxc_i2c.h |  38 +-
 drivers/i2c/mxc_i2c.c | 581 --
 3 files changed, 433 insertions(+), 193 deletions(-)

diff --git a/arch/arm/imx-common/i2c-mxv7.c b/arch/arm/imx-common/i2c-mxv7.c
index 1a632e7..f3a5c3f 100644
--- a/arch/arm/imx-common/i2c-mxv7.c
+++ b/arch/arm/imx-common/i2c-mxv7.c
@@ -12,7 +12,7 @@
 #include asm/imx-common/mxc_i2c.h
 #include watchdog.h
 
-static int force_idle_bus(void *priv)
+int force_idle_bus(void *priv)
 {
int i;
int sda, scl;
@@ -99,8 +99,9 @@ int setup_i2c(unsigned i2c_index, int speed, int slave_addr,
if (ret)
goto err_idle;
 
-   bus_i2c_init(i2c_bases[i2c_index], speed, slave_addr,
-   force_idle_bus, p);
+#ifndef CONFIG_DM_I2C
+   bus_i2c_init(i2c_index, speed, slave_addr, force_idle_bus, p);
+#endif
 
return 0;
 
diff --git a/arch/arm/include/asm/imx-common/mxc_i2c.h 
b/arch/arm/include/asm/imx-common/mxc_i2c.h
index af86163..355b25e 100644
--- a/arch/arm/include/asm/imx-common/mxc_i2c.h
+++ b/arch/arm/include/asm/imx-common/mxc_i2c.h
@@ -19,6 +19,36 @@ struct i2c_pads_info {
struct i2c_pin_ctrl sda;
 };
 
+/*
+ * Information about i2c controller
+ * struct mxc_i2c_bus - information about the i2c[x] bus
+ * @index: i2c bus index
+ * @base: Address of I2C bus controller
+ * @driver_data: Flags for different platforms, such as I2C_QUIRK_FLAG.
+ * @speed: Speed of I2C bus
+ * @pads_info: pinctrl info for this i2c bus, will be used when pinctrl is ok.
+ * The following two is only to be compatible with non-DM part.
+ * @idle_bus_fn: function to force bus idle
+ * @idle_bus_data: parameter for idle_bus_fun
+ */
+struct mxc_i2c_bus {
+   /*
+* board file 

[U-Boot] [PATCH V5 2/2] imx: mx27 move GPIO_PORTx to gpio.h

2015-05-14 Thread Peng Fan
These GPIO_PORTx macros should be in gpio.h, but not in imx-regs.h.

Also, imx-regs.h and iomux-v3.h has same macro defintion for
GPIO_PORTx, and both of them are included in mxc_i2c.c(include
mxc_i2c.h). This will incur build warnings with macro redefinition.

Since iomux-v3.h is not compatible with mx27, we can not simply
include iomux-v3.h for mx27, so move the GPIO_PORTx to gpio.h to
fix the build warning.

Signed-off-by: Peng Fan peng@freescale.com
---

Changes v5:
 Take Fabio's suggestion.
 Since iomux-v3.h is not compatible with mx27, we can not directly
 include iomux-v3.h for mx27. Move the GPIO_PORTx to gpio.h which
 should be not in imx-regs.h.

Changes v4:
 New patch.
 we include mxc_i2c.h in driver/i2c/mxc_i2c.c in patch 1/2.
 mxc_i2c.h includes iomux-v3.h.
 Since iomux-v3.h have some macros which also exists in
 asm/arch-xx/imx-regs.h, this will introudce compile warnings
 such as redefined macro.

Changes v3:
 none

Changes v2:
 none

 arch/arm/include/asm/arch-mx27/gpio.h | 20 
 arch/arm/include/asm/arch-mx27/imx-regs.h | 22 --
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx27/gpio.h 
b/arch/arm/include/asm/arch-mx27/gpio.h
index 1e38b93..a8a1ed6 100644
--- a/arch/arm/include/asm/arch-mx27/gpio.h
+++ b/arch/arm/include/asm/arch-mx27/gpio.h
@@ -36,4 +36,24 @@ struct gpio_port_regs {
struct gpio_regs port[6];
 };
 
+/*
+ *  GPIO Module and I/O Multiplexer
+ */
+#define PORTA 0
+#define PORTB 1
+#define PORTC 2
+#define PORTD 3
+#define PORTE 4
+#define PORTF 5
+
+#define GPIO_PIN_MASK  0x1f
+#define GPIO_PORT_SHIFT5
+#define GPIO_PORT_MASK (0x7  GPIO_PORT_SHIFT)
+#define GPIO_PORTA (PORTA  GPIO_PORT_SHIFT)
+#define GPIO_PORTB (PORTB  GPIO_PORT_SHIFT)
+#define GPIO_PORTC (PORTC  GPIO_PORT_SHIFT)
+#define GPIO_PORTD (PORTD  GPIO_PORT_SHIFT)
+#define GPIO_PORTE (PORTE  GPIO_PORT_SHIFT)
+#define GPIO_PORTF (PORTF  GPIO_PORT_SHIFT)
+
 #endif
diff --git a/arch/arm/include/asm/arch-mx27/imx-regs.h 
b/arch/arm/include/asm/arch-mx27/imx-regs.h
index 92c847e..7402e31 100644
--- a/arch/arm/include/asm/arch-mx27/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx27/imx-regs.h
@@ -138,16 +138,6 @@ struct gpt_regs {
u32 gpt_tstat;
 };
 
-/*
- *  GPIO Module and I/O Multiplexer
- */
-#define PORTA 0
-#define PORTB 1
-#define PORTC 2
-#define PORTD 3
-#define PORTE 4
-#define PORTF 5
-
 /* IIM Control Registers */
 struct iim_regs {
u32 iim_stat;
@@ -449,18 +439,6 @@ struct fuse_bank0_regs {
 #define GPIO5_BASE_ADDR 0x10015400
 #define GPIO6_BASE_ADDR 0x10015500
 
-#define GPIO_PIN_MASK  0x1f
-
-#define GPIO_PORT_SHIFT5
-#define GPIO_PORT_MASK (0x7  GPIO_PORT_SHIFT)
-
-#define GPIO_PORTA (PORTA  GPIO_PORT_SHIFT)
-#define GPIO_PORTB (PORTB  GPIO_PORT_SHIFT)
-#define GPIO_PORTC (PORTC  GPIO_PORT_SHIFT)
-#define GPIO_PORTD (PORTD  GPIO_PORT_SHIFT)
-#define GPIO_PORTE (PORTE  GPIO_PORT_SHIFT)
-#define GPIO_PORTF (PORTF  GPIO_PORT_SHIFT)
-
 #define GPIO_OUT   (1  8)
 #define GPIO_IN(0  8)
 #define GPIO_PUEN  (1  9)
-- 
1.8.4


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


[U-Boot] [PATCH v2] tools: moveconfig: a tool to move CONFIGs from headers to defconfigs

2015-05-14 Thread Masahiro Yamada
This tool was originally written for my local use to ease the task
of tons of CONFIG moves, but there have been some requests for
mainlining it.
So, I have tidied up the code with nicer comments, and here it is.

See the comment block of the script for usage.

The first draft was
http://patchwork.ozlabs.org/patch/430422/

Main updates are:
  - Adapted to the single .config configuration
  - Support colored log
  - Support moving multiple options at once
(and take configs via input file only)
  - Continue even if some boards fail
(Idea provided by Joe Hershberger)
  - Add more options
  - More comments and code cleanups

Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

Changes in v2:
  - Fix comments
  - Map arc toolchain
  - Add dry-run option

 tools/moveconfig.py | 853 
 1 file changed, 853 insertions(+)
 create mode 100755 tools/moveconfig.py

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
new file mode 100755
index 000..c39ea95
--- /dev/null
+++ b/tools/moveconfig.py
@@ -0,0 +1,853 @@
+#!/usr/bin/env python2
+#
+# Author: Masahiro Yamada yamada.masah...@socionext.com
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+
+Move config options from headers to defconfig files.
+
+Since Kconfig was introduced to U-Boot, we have worked on moving
+config options from headers to Kconfig (defconfig).
+
+This tool intends to help this tremendous work.
+
+
+Usage
+-
+
+This tool takes one input file.  (let's say 'recipe' file here.)
+The recipe describes the list of config options you want to move.
+Each line takes the form:
+config_name type default
+(the fields must be separated with whitespaces.)
+
+config_name is the name of config option.
+
+type is the type of the option.  It must be one of bool, tristate,
+string, int, and hex.
+
+default is the default value of the option.  It must be appropriate
+value corresponding to the option type.  It must be either y or n for
+the bool type.  Tristate options can also take m (although U-Boot has
+not supported the module feature).
+
+You can add two or more lines in the recipe file, so you can move
+multiple options at once.
+
+Let's say, for example, you want to move CONFIG_CMD_USB and
+CONFIG_SYS_TEXT_BASE.
+
+The type should be bool, hex, respectively.  So, the recipe file
+should look like this:
+
+  $ cat recipe
+  CONFIG_CMD_USB bool n
+  CONFIG_SYS_TEXT_BASE hex 0x
+
+And then run this tool giving the file name of the recipe
+
+  $ tools/moveconfig.py recipe
+
+The tool walks through all the defconfig files to move the config
+options specified by the recipe file.
+
+The log is also displayed on the terminal.
+
+Each line is printed in the format
+defconfig_name   :  action
+
+defconfig_name is the name of the defconfig
+(without the suffix _defconfig).
+
+action shows what the tool did for that defconfig.
+It looks like one of the followings:
+
+ - Move 'CONFIG_... '
+   This config option was moved to the defconfig
+
+ - Default value 'CONFIG_...'.  Do nothing.
+   The value of this option is the same as default.
+   We do not have to add it to the defconfig.
+
+ - 'CONFIG_...' already exists in Kconfig.  Do nothing.
+   This config option is already defined in Kconfig.
+   We do not need/want to touch it.
+
+ - Undefined.  Do nothing.
+   This config option was not found in the config header.
+   Nothing to do.
+
+ - Failed to process.  Skip.
+   An error occurred during processing this defconfig.  Skipped.
+   (If -e option is passed, the tool exits immediately on error.)
+
+Finally, you will be asked, Clean up headers? [y/n]:
+
+If you say 'y' here, the unnecessary config defines are removed
+from the config headers (include/configs/*.h).
+It just uses the regex method, so you should not rely on it.
+Just in case, please do 'git diff' to see what happened.
+
+
+How does it works?
+--
+
+This tool runs configuration and builds include/autoconf.mk for every
+defconfig.  The config options defined in Kconfig appear in the .config
+file (unless they are hidden because of unmet dependency.)
+On the other hand, the config options defined by board headers are seen
+in include/autoconf.mk.  The tool looks for the specified options in both
+of them to decide the appropriate action for the options.  If the option
+is found in the .config or the value is the same as the specified default,
+the option does not need to be touched.  If the option is found in
+include/autoconf.mk, but not in the .config, and the value is different
+from the default, the tools adds the option to the defconfig.
+
+For faster processing, this tool handles multi-threading.  It creates
+separate build directories where the out-of-tree build is run.  The
+temporary build directories are automatically created and deleted as
+needed.  The number of threads are chosen based on the number of the CPU
+cores of your system 

[U-Boot] [PATCH][v3] powerpc/b4860qds:Update README for DIP switch information

2015-05-14 Thread Raghav Dogra
The board manual desribes ON as boolean 1 and OFF as boolean 0.
Updating README with correct boolean values.

Signed-off-by: Raghav Dogra rag...@freescale.com
---
Changes for v2:
 -Reduced the description
 -Modified the heading

Changes for v3:
 -Modified the description
 -Modified the subject
 -Reduced the changes

 doc/README.b4860qds | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/README.b4860qds b/doc/README.b4860qds
index eada0c7..6fcc3bd 100644
--- a/doc/README.b4860qds
+++ b/doc/README.b4860qds
@@ -119,7 +119,7 @@ B4860QDS Default Settings
 Switch Settings
 
 
-SW1OFF [0] OFF [1] OFF [1] OFF [0] OFF [1] OFF [0] OFF [1] OFF [1]
+SW1OFF [0] OFF [0] OFF [0] OFF [0] OFF [0] OFF [0] OFF [0] OFF [0]
 SW2ON  ON  ON  ON  ON  ON  OFF OFF
 SW3OFF OFF OFF ON  OFF OFF ON  OFF
 SW5OFF OFF OFF OFF OFF OFF ON  ON
-- 
1.9.1


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


Re: [U-Boot] [PATCH v3 07/10] moveconfig: Ignore duplicate configs when moving

2015-05-14 Thread Masahiro Yamada
Hi Joe,

2015-05-15 3:02 GMT+09:00 Joe Hershberger joe.hershber...@gmail.com:
 Hi Masahiro-san,

 On Thu, May 14, 2015 at 10:36 AM, Masahiro Yamada
 yamada.masah...@socionext.com wrote:
 2015-05-14 7:28 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 When moving configs, it is important to know what was defined in the
 config header even if it duplicates the configs coming from Kconfig.

 tools/moveconfig.py now defines KCONFIG_IGNORE_DUPLICATES to prevent the
 filtering from happening and selecting wrong values for the defconfig.

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

 ---

 Changes in v3:
 -New for version 3

 Changes in v2: None

  scripts/Makefile.autoconf | 3 ++-
  tools/moveconfig.py   | 1 +
  2 files changed, 3 insertions(+), 1 deletion(-)

 diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf
 index f054081..36bfa17 100644
 --- a/scripts/Makefile.autoconf
 +++ b/scripts/Makefile.autoconf
 @@ -58,7 +58,8 @@ quiet_cmd_autoconf = GEN $@
 $(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM $(srctree)/include/common.h 
  $@.tmp  { \
 sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp |   
 \
 while read line; do 
 \
 -   if ! grep -q $${line%=*}= 
 include/config/auto.conf; then  \
 +   if [ -n ${KCONFIG_IGNORE_DUPLICATES} ] || 
 \
 +  ! grep -q $${line%=*}= 
 include/config/auto.conf; then  \
 echo $$line;  
 \
 fi  
 \
 done  $@;  
 \
 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index 9135e1d..97ff597 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -340,6 +340,7 @@ class Slot:
  cmd = list(self.make_cmd)
  if self.cross_compile:
  cmd.append('CROSS_COMPILE=%s' % self.cross_compile)
 +cmd.append('KCONFIG_IGNORE_DUPLICATES=1')
  cmd.append('include/autoconf.mk')
  self.ps = subprocess.Popen(cmd, stdout=self.devnull, stderr=PIPE)
  self.state = STATE_SILENTOLDCONFIG


 This patch is not clear to me.

 This was specifically a problem when moving a config that defaulted to
 true in the Kconfig. That meant that it would be duplicate removed
 from the include since it was already true (by default) in the
 Kconfig. So it had the effect of disabling that config in every board.
 This stops the filtering in the case where we are trying to move
 configs instead of trying to build the board in this mixed config
 system environment.


Uh, make sense.

I was almost forgetting how the don't apply version was implemented.

My new one parses .config, defconfig as well as autoconf.mk,
so please check if we still need to this hack.



 Isn't it the same concept as u-boot.cfg
 instroduced by commit 741e58e0fc8.

 I don't believe it is the same thing because this will still include
 the configs enabled through the config header, but (I think) not those
 from Kconfig.  And anyway, we are evaluating autoconf.mk, not
 u-boot.cfg.

Now, I understood your intention.

u-boot.cfg is not useful for this tool,
although u-boot.cfg also includes configs from Kconfig.


-- 
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] am33xx, spl, siemens: enable debug uart output again

2015-05-14 Thread Heiko Schocher

Hello Simon,

Am 14.05.2015 14:46, schrieb Simon Glass:

Hi Heiko,

On 14 May 2015 at 04:51, Tom Rini tr...@konsulko.com wrote:

On Thu, May 14, 2015 at 12:37:40PM +0200, Heiko Schocher wrote:

Hello Tom,

Am 06.03.2015 08:24, schrieb Heiko Schocher:

Hello Tom,

Am 05.03.2015 15:50, schrieb Tom Rini:

On Thu, Mar 05, 2015 at 09:46:50AM +0100, Heiko Schocher wrote:

Hello Tom,

Am 05.03.2015 07:22, schrieb Heiko Schocher:

Hello Tom,

Am 04.03.2015 17:40, schrieb Tom Rini:

On Wed, Mar 04, 2015 at 08:42:58AM +0100, Heiko Schocher wrote:

Hello Tom,

Am 02.03.2015 14:59, schrieb Tom Rini:

On Mon, Mar 02, 2015 at 07:56:41AM +0100, Heiko Schocher wrote:

Hello Simon,

Am 24.02.2015 14:31, schrieb Simon Glass:

Hi Heiko,

On 23 February 2015 at 23:18, Heiko Schocher h...@denx.de wrote:

a6b541b090: TI ARMv7: Don't use GD before crt0.S has set it

moves the init of the debug uart at the very end of SPL code.
Enable it for the siemens board earlier, as they print
ddr settings ... all debug output before board_init_r()
is here currently useless. Maybe we must rework this
globally?


Assuming we are talking about U-Boot proper, the DDR init should
happen in board_init_f(), specifically dram_init(). so I think this
code should be updated.

If it is SPL, then DDR init should happen in SPL's board_init_f().


It is in SPL...

sdram_init() is called from:

./arch/arm/cpu/armv7/am33xx/board.c from s_init() ...


I sent a series a few weeks ago (available at u-boot-dm branch
spl-working) related to this topic:

http://patchwork.ozlabs.org/patch/438581/


Ah ... Hmm... so ./arch/arm/cpu/armv7/am33xx/board.c needs
a rework, right?

Is a simple rename s_init() - board_init_f() correct?


Right so, no, we can't just rename s_init to board_init_f.  This is what
I was talking about in the thread about the function Hans wants to add
to enable some bits in CP15 on sunxi, iirc.

In short, armv7 has a different set of abstraction hooks than the
previous ARM cores (armv8 followed what we have for v7) and I'm not
convinced in the end that it really won us anything.  See
http://lists.denx.de/pipermail/u-boot/2015-January/202350.html

For today you need to rework the Siemens code to print out the DDR
values (when desired) in spl_board_init() as we do not, or will not
shortly, have gd prior to board_init_f running.


Hmm... first I thought, ok, no problem, move the output from the RAM
parameters to spl_board_init() ... but thats only the half of the
story ... They read the RAM parameters from an i2c eeprom, and if
there are errors, they print this errors ... currently this does
not work, and thats I think the more important case ... and I could
not move this error printfs to somewhere, because if RAM is not
working ... there is no later ...

So I have to enable the console early ... maybe I missed something,
but this worked fine in the past (and I think we should not break
this, as this is an essential feature).


OK, I missed something too.  I think this gets better now once I merge
Simon's SPL series as we do all of this from board_init_f() and the
siemens code should just work again.


Yes, just saw your patch ;-)

If they are in mainline (or do you have them somewhere in a git repo?),
I test it again on the dxr2 board, thanks!


If I am correct, all needed patches from you are in mainline, just
tried this on the dxr2 board ... but I still need:

diff --git a/board/siemens/common/board.c b/board/siemens/common/board.c
index a39cbd0..8724604 100644
--- a/board/siemens/common/board.c
+++ b/board/siemens/common/board.c
@@ -40,6 +40,11 @@ void set_uart_mux_conf(void)

  void set_mux_conf_regs(void)
  {
+   /* enable early the console */
+   gd-baudrate = CONFIG_BAUDRATE;
+   serial_init();
+   gd-have_console = 1;
+
 /* Initalize the board header */
 enable_i2c0_pin_mux();
 i2c_set_bus_num(0);

to see the console output ...


Yes, if you want console prior to spl_board_init() then you need to do
that where you are.



Ah, ok... so this patch is OK?


Just found this thread again, as I want to post updates for the am335x
based siemens boards ... Is this patch [1] Ok, and can get applied?

Thanks!

bye,
Heiko
[1] Patchwork [U-Boot] am33xx, spl, siemens: enable debug uart output again
https://patchwork.ozlabs.org/patch/446644/

Hups... found this patch in patchwork marked as RFC and Delegated
to me ... ?


I'll look it over again then, thanks.


It's a bit confusing - am I right in thinking that this is called from
board_early_init_f() in arch/arm/cpu/armv7/am33xx/board.c? That in
turn is called from board_init_f() in the same file?


I think so, yes (Could not currently power on the board, so I look
in it, if I have it again accessable)


If so it seems OK, although I wonder if the SPL console setup could
happen in board_early_init_f() or even board_init_f() rather than
being buried so deep? It seems odd that setting up the mux registers
should enable the console, and I doubt people will find it 

[U-Boot] [PATCH v2] arm, imx6: add support for aristainetos2 board

2015-05-14 Thread Heiko Schocher
add support for imx6dl based aristainetos2 board

U-Boot 2015.04-rc5-00066-g60f6ed4 (Apr 10 2015 - 08:46:27)

CPU:   Freescale i.MX6DL rev1.1 at 792 MHz
Reset cause: WDOG
Board: aristaitenos2
   Watchdog enabled
I2C:   ready
DRAM:  1 GiB
NAND:  1024 MiB
MMC:   FSL_SDHC: 0
SF: Detected N25Q128A with page size 256 Bytes, erase size 64 KiB, total 16 MiB
Display: lg4573 (480x800)
In:serial
Out:   serial
Err:   serial
Net:   FEC [PRIME]
Hit any key to stop autoboot:  0
=

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

---

Changes in v2:
- add comment from Stefano Babic:
  - adapt for i2c fixes suggested by Stefano Babic
  - remove lgdisplay var
  - remove CONFIG_PHY_MICREL_KSZ9031
  - rename enable_spi to enable_spi_display
  - rotate logo remains in board code

 arch/arm/Kconfig  |   5 +
 board/aristainetos2/Kconfig   |  12 +
 board/aristainetos2/MAINTAINERS   |   6 +
 board/aristainetos2/Makefile  |  12 +
 board/aristainetos2/aristainetos2.c   | 922 ++
 board/aristainetos2/aristainetos2.cfg |  34 ++
 board/aristainetos2/axi.cfg   |  22 +
 board/aristainetos2/clocks.cfg|  24 +
 board/aristainetos2/ddr-setup.cfg |  59 +++
 board/aristainetos2/nt5cc256m16cp.cfg |  60 +++
 configs/aristainetos2_defconfig   |   3 +
 include/configs/aristainetos2.h   | 352 +
 12 files changed, 1511 insertions(+)
 create mode 100644 board/aristainetos2/Kconfig
 create mode 100644 board/aristainetos2/MAINTAINERS
 create mode 100644 board/aristainetos2/Makefile
 create mode 100644 board/aristainetos2/aristainetos2.c
 create mode 100644 board/aristainetos2/aristainetos2.cfg
 create mode 100644 board/aristainetos2/axi.cfg
 create mode 100644 board/aristainetos2/clocks.cfg
 create mode 100644 board/aristainetos2/ddr-setup.cfg
 create mode 100644 board/aristainetos2/nt5cc256m16cp.cfg
 create mode 100644 configs/aristainetos2_defconfig
 create mode 100644 include/configs/aristainetos2.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 49bcad1..287a9ff 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -523,6 +523,10 @@ config TARGET_ARISTAINETOS
bool Support aristainetos
select CPU_V7
 
+config TARGET_ARISTAINETOS2
+   bool Support aristainetos2
+   select CPU_V7
+
 config TARGET_MX6QARM2
bool Support mx6qarm2
select CPU_V7
@@ -856,6 +860,7 @@ source arch/arm/cpu/armv8/Kconfig
 source arch/arm/imx-common/Kconfig
 
 source board/aristainetos/Kconfig
+source board/aristainetos2/Kconfig
 source board/BuR/kwb/Kconfig
 source board/BuR/tseries/Kconfig
 source board/CarMediaLab/flea3/Kconfig
diff --git a/board/aristainetos2/Kconfig b/board/aristainetos2/Kconfig
new file mode 100644
index 000..2cf13e4
--- /dev/null
+++ b/board/aristainetos2/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_ARISTAINETOS2
+
+config SYS_BOARD
+   default aristainetos2
+
+config SYS_SOC
+   default mx6
+
+config SYS_CONFIG_NAME
+   default aristainetos2
+
+endif
diff --git a/board/aristainetos2/MAINTAINERS b/board/aristainetos2/MAINTAINERS
new file mode 100644
index 000..d155f86
--- /dev/null
+++ b/board/aristainetos2/MAINTAINERS
@@ -0,0 +1,6 @@
+ARISTAINETOS BOARD
+M: Heiko Schocher h...@denx.de
+S: Maintained
+F: board/aristainetos2/
+F: include/configs/aristainetos2.h
+F: configs/aristainetos2_defconfig
diff --git a/board/aristainetos2/Makefile b/board/aristainetos2/Makefile
new file mode 100644
index 000..2513744
--- /dev/null
+++ b/board/aristainetos2/Makefile
@@ -0,0 +1,12 @@
+#
+# (C) Copyright 2015
+# Heiko Schocher, DENX Software Engineering, h...@denx.de.
+#
+# Copyright (C) 2007, Guennadi Liakhovetski l...@denx.de
+#
+# (C) Copyright 2011 Freescale Semiconductor, Inc.
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y  := aristainetos2.o
diff --git a/board/aristainetos2/aristainetos2.c 
b/board/aristainetos2/aristainetos2.c
new file mode 100644
index 000..3a7aac0
--- /dev/null
+++ b/board/aristainetos2/aristainetos2.c
@@ -0,0 +1,922 @@
+/*
+ * (C) Copyright 2015
+ * Heiko Schocher, DENX Software Engineering, h...@denx.de.
+ *
+ * Based on:
+ * Copyright (C) 2012 Freescale Semiconductor, Inc.
+ *
+ * Author: Fabio Estevam fabio.este...@freescale.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include asm/arch/clock.h
+#include asm/arch/imx-regs.h
+#include asm/arch/iomux.h
+#include asm/arch/mx6-pins.h
+#include asm/errno.h
+#include asm/gpio.h
+#include asm/imx-common/iomux-v3.h
+#include asm/imx-common/boot_mode.h
+#include asm/imx-common/mxc_i2c.h
+#include asm/imx-common/video.h
+#include mmc.h
+#include fsl_esdhc.h
+#include micrel.h
+#include miiphy.h
+#include netdev.h
+#include asm/arch/mxc_hdmi.h
+#include asm/arch/crm_regs.h
+#include linux/fb.h
+#include ipu_pixfmt.h
+#include asm/io.h
+#include asm/arch/sys_proto.h
+#include pwm.h
+#include spi.h
+#include video.h
+#include ../drivers/video/ipu.h
+#if 

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

2015-05-14 Thread Michal Simek
On 05/13/2015 09:32 PM, Joe Hershberger wrote:
 Hi Michal,
 
 On Wed, May 13, 2015 at 6:40 AM, Michal Simek michal.si...@xilinx.com wrote:
 Targets with CONFIG_NEEDS_MANUAL_RELOC do not use REL/RELA
 relocation (mostly only GOT) where functions aray are not
 updated. This patch is fixing function pointers passed to phy_register
 function.
 This patch was tested on Microblaze architecture.

 Signed-off-by: Michal Simek michal.si...@xilinx.com
 ---
 
 Applied to u-boot-net/next, thanks!

Thanks. Hopefully this will go to 2015.07 because it is bug fix. :-)

Thanks,
Michal

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


[U-Boot] [PATCH 1/1] board: Add Toby-Churchill SL50 board support.

2015-05-14 Thread Enric Balletbo i Serra
Add support for Lightwriter SL50 series board, a small, robust and portable
Voice Output Communication Aids (VOCA) designed to meet the particular and
changing needs of people with speech loss resulting from a wide range of
acquired, progressive and congenital conditions.

Signed-off-by: Enric Balletbo i Serra enric.balle...@collabora.com
---
 arch/arm/Kconfig  |   6 +
 board/tcl/sl50/Kconfig|  34 
 board/tcl/sl50/MAINTAINERS|   6 +
 board/tcl/sl50/Makefile   |  13 ++
 board/tcl/sl50/board.c| 387 ++
 board/tcl/sl50/board.h|  22 +++
 board/tcl/sl50/mux.c  | 161 ++
 configs/am335x_sl50_defconfig |   7 +
 include/configs/am335x_sl50.h | 141 +++
 9 files changed, 777 insertions(+)
 create mode 100644 board/tcl/sl50/Kconfig
 create mode 100644 board/tcl/sl50/MAINTAINERS
 create mode 100644 board/tcl/sl50/Makefile
 create mode 100644 board/tcl/sl50/board.c
 create mode 100644 board/tcl/sl50/board.h
 create mode 100644 board/tcl/sl50/mux.c
 create mode 100644 configs/am335x_sl50_defconfig
 create mode 100644 include/configs/am335x_sl50.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1c7cf7f..7fd4848 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -377,6 +377,11 @@ config TARGET_AM335X_EVM
select DM_SERIAL
select DM_GPIO
 
+config TARGET_AM335X_SL50
+   bool Support am335x_sl50
+   select CPU_V7
+   select SUPPORT_SPL
+
 config TARGET_AM43XX_EVM
bool Support am43xx_evm
select CPU_V7
@@ -946,6 +951,7 @@ source board/st/stv0991/Kconfig
 source board/sunxi/Kconfig
 source board/syteco/zmx25/Kconfig
 source board/tbs/tbs2910/Kconfig
+source board/tcl/sl50/Kconfig
 source board/ti/am335x/Kconfig
 source board/ti/am43xx/Kconfig
 source board/birdland/bav335x/Kconfig
diff --git a/board/tcl/sl50/Kconfig b/board/tcl/sl50/Kconfig
new file mode 100644
index 000..2b93aa2
--- /dev/null
+++ b/board/tcl/sl50/Kconfig
@@ -0,0 +1,34 @@
+if TARGET_AM335X_SL50
+
+config SYS_BOARD
+   default sl50
+
+config SYS_VENDOR
+   default tcl
+
+config SYS_SOC
+   default am33xx
+
+config SYS_CONFIG_NAME
+   default am335x_sl50
+
+config CONS_INDEX
+   int UART used for console
+   range 1 6
+   default 1
+   help
+ The AM335x SoC has a total of 6 UARTs (UART0 to UART5 as referenced
+ in documentation, etc) available to it.  Depending on your specific
+ board you may want something other than UART0 as for example the IDK
+ uses UART3 so enter 4 here.
+
+config DM
+   default y
+
+config DM_GPIO
+   default y if DM
+
+config DM_SERIAL
+   default y if DM
+
+endif
diff --git a/board/tcl/sl50/MAINTAINERS b/board/tcl/sl50/MAINTAINERS
new file mode 100644
index 000..29f1e3d
--- /dev/null
+++ b/board/tcl/sl50/MAINTAINERS
@@ -0,0 +1,6 @@
+SL50 BOARD
+M: Enric Balletbo i Serra enric.balle...@collabora.com
+S: Maintained
+F: board/tcl/sl50/
+F: include/configs/am335x_sl50.h
+F: configs/am335x_sl50_defconfig
diff --git a/board/tcl/sl50/Makefile b/board/tcl/sl50/Makefile
new file mode 100644
index 000..d4a548c
--- /dev/null
+++ b/board/tcl/sl50/Makefile
@@ -0,0 +1,13 @@
+#
+# Makefile
+#
+# Copyright (C) 2015 Toby Churchill Ltd - http://www.toby-churchill.com/
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+ifeq ($(CONFIG_SKIP_LOWLEVEL_INIT),)
+obj-y  := mux.o
+endif
+
+obj-y  += board.o
diff --git a/board/tcl/sl50/board.c b/board/tcl/sl50/board.c
new file mode 100644
index 000..e0163e1
--- /dev/null
+++ b/board/tcl/sl50/board.c
@@ -0,0 +1,387 @@
+/*
+ * board.c
+ *
+ * Board functions for TCL SL50 board
+ *
+ * Copyright (C) 2015 Toby Churchill Ltd - http://www.toby-churchill.com/
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include errno.h
+#include spl.h
+#include asm/arch/cpu.h
+#include asm/arch/hardware.h
+#include asm/arch/omap.h
+#include asm/arch/ddr_defs.h
+#include asm/arch/clock.h
+#include asm/arch/gpio.h
+#include asm/arch/mmc_host_def.h
+#include asm/arch/sys_proto.h
+#include asm/arch/mem.h
+#include asm/io.h
+#include asm/emif.h
+#include asm/gpio.h
+#include i2c.h
+#include miiphy.h
+#include cpsw.h
+#include power/tps65217.h
+#include power/tps65910.h
+#include environment.h
+#include watchdog.h
+#include environment.h
+#include board.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
+
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+
+static const struct ddr_data ddr3_sl50_data = {
+   .datardsratio0 = MT41K256M16HA125E_RD_DQS,
+   .datawdsratio0 = MT41K256M16HA125E_WR_DQS,
+   .datafwsratio0 = MT41K256M16HA125E_PHY_FIFO_WE,
+   .datawrsratio0 = MT41K256M16HA125E_PHY_WR_DATA,
+};
+
+static const struct cmd_control ddr3_sl50_cmd_ctrl_data = {
+   .cmd0csratio = MT41K256M16HA125E_RATIO,
+   .cmd0iclkout = MT41K256M16HA125E_INVERT_CLKOUT,
+
+   

[U-Boot] [PATCH 0/1] Add Toby-Churchill SL50 board support

2015-05-14 Thread Enric Balletbo i Serra
This patch series adds support for SL50 board based on TI AM335x SoC.

Best regards,

Enric Balletbo i Serra (1):
  board: Add Toby-Churchill SL50 board support.

 arch/arm/Kconfig  |   6 +
 board/tcl/sl50/Kconfig|  34 
 board/tcl/sl50/MAINTAINERS|   6 +
 board/tcl/sl50/Makefile   |  13 ++
 board/tcl/sl50/board.c| 387 ++
 board/tcl/sl50/board.h|  22 +++
 board/tcl/sl50/mux.c  | 161 ++
 configs/am335x_sl50_defconfig |   7 +
 include/configs/am335x_sl50.h | 141 +++
 9 files changed, 777 insertions(+)
 create mode 100644 board/tcl/sl50/Kconfig
 create mode 100644 board/tcl/sl50/MAINTAINERS
 create mode 100644 board/tcl/sl50/Makefile
 create mode 100644 board/tcl/sl50/board.c
 create mode 100644 board/tcl/sl50/board.h
 create mode 100644 board/tcl/sl50/mux.c
 create mode 100644 configs/am335x_sl50_defconfig
 create mode 100644 include/configs/am335x_sl50.h

-- 
2.1.0

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


[U-Boot] [PATCH] powerpc/t1024: update fman liodn for mac1

2015-05-14 Thread Shengzhou Liu
MAC1 acts as 1G/10G dual-role MAC on T1024. We introduce
macro SET_FMAN_RX_10G_TYPE2_LIODN for 10G MACs which have
same Port ID and same offset of address with 1G MAC.
Update it to match with the setting of fman in t1024 device
tree, otherwise there is no 'fsl,liodn' in
/proc/device-tree/soc@ffe00/fman@40/port@88000/

Signed-off-by: Shengzhou Liu shengzhou@freescale.com
---
 arch/powerpc/cpu/mpc85xx/t1024_ids.c | 3 +--
 arch/powerpc/include/asm/fsl_liodn.h | 6 ++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/t1024_ids.c 
b/arch/powerpc/cpu/mpc85xx/t1024_ids.c
index 132689b..8a1092e 100644
--- a/arch/powerpc/cpu/mpc85xx/t1024_ids.c
+++ b/arch/powerpc/cpu/mpc85xx/t1024_ids.c
@@ -51,11 +51,10 @@ int liodn_tbl_sz = ARRAY_SIZE(liodn_tbl);
 
 #ifdef CONFIG_SYS_DPAA_FMAN
 struct liodn_id_table fman1_liodn_tbl[] = {
-   SET_FMAN_RX_1G_LIODN(1, 0, 88),
+   SET_FMAN_RX_10G_TYPE2_LIODN(1, 0, 88),
SET_FMAN_RX_1G_LIODN(1, 1, 89),
SET_FMAN_RX_1G_LIODN(1, 2, 90),
SET_FMAN_RX_1G_LIODN(1, 3, 91),
-   SET_FMAN_RX_10G_LIODN(1, 0, 94),
 };
 int fman1_liodn_tbl_sz = ARRAY_SIZE(fman1_liodn_tbl);
 #endif
diff --git a/arch/powerpc/include/asm/fsl_liodn.h 
b/arch/powerpc/include/asm/fsl_liodn.h
index 811f034..6206bee 100644
--- a/arch/powerpc/include/asm/fsl_liodn.h
+++ b/arch/powerpc/include/asm/fsl_liodn.h
@@ -145,6 +145,12 @@ extern void fdt_fixup_liodn(void *blob);
FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 16), \
CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_10G_OFFSET) \
 
+/* enetNum is 0, 1, 2... so we + 8 for type-2 10g to get to HW Port ID */
+#define SET_FMAN_RX_10G_TYPE2_LIODN(fmNum, enetNum, liodn) \
+   SET_LIODN_ENTRY_1(fsl,fman-port-10g-rx, liodn, \
+   FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 8), \
+   CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_1G_OFFSET) \
+
 /*
  * handle both old and new versioned SEC properties:
  * fsl,secX.Y became fsl,sec-vX.Y during development
-- 
2.1.0.27.g96db324

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


Re: [U-Boot] [PATCH] am33xx, spl, siemens: enable debug uart output again

2015-05-14 Thread Heiko Schocher

Hello Tom,

Am 06.03.2015 08:24, schrieb Heiko Schocher:

Hello Tom,

Am 05.03.2015 15:50, schrieb Tom Rini:

On Thu, Mar 05, 2015 at 09:46:50AM +0100, Heiko Schocher wrote:

Hello Tom,

Am 05.03.2015 07:22, schrieb Heiko Schocher:

Hello Tom,

Am 04.03.2015 17:40, schrieb Tom Rini:

On Wed, Mar 04, 2015 at 08:42:58AM +0100, Heiko Schocher wrote:

Hello Tom,

Am 02.03.2015 14:59, schrieb Tom Rini:

On Mon, Mar 02, 2015 at 07:56:41AM +0100, Heiko Schocher wrote:

Hello Simon,

Am 24.02.2015 14:31, schrieb Simon Glass:

Hi Heiko,

On 23 February 2015 at 23:18, Heiko Schocher h...@denx.de wrote:

a6b541b090: TI ARMv7: Don't use GD before crt0.S has set it

moves the init of the debug uart at the very end of SPL code.
Enable it for the siemens board earlier, as they print
ddr settings ... all debug output before board_init_r()
is here currently useless. Maybe we must rework this
globally?


Assuming we are talking about U-Boot proper, the DDR init should
happen in board_init_f(), specifically dram_init(). so I think this
code should be updated.

If it is SPL, then DDR init should happen in SPL's board_init_f().


It is in SPL...

sdram_init() is called from:

./arch/arm/cpu/armv7/am33xx/board.c from s_init() ...


I sent a series a few weeks ago (available at u-boot-dm branch
spl-working) related to this topic:

http://patchwork.ozlabs.org/patch/438581/


Ah ... Hmm... so ./arch/arm/cpu/armv7/am33xx/board.c needs
a rework, right?

Is a simple rename s_init() - board_init_f() correct?


Right so, no, we can't just rename s_init to board_init_f.  This is what
I was talking about in the thread about the function Hans wants to add
to enable some bits in CP15 on sunxi, iirc.

In short, armv7 has a different set of abstraction hooks than the
previous ARM cores (armv8 followed what we have for v7) and I'm not
convinced in the end that it really won us anything.  See
http://lists.denx.de/pipermail/u-boot/2015-January/202350.html

For today you need to rework the Siemens code to print out the DDR
values (when desired) in spl_board_init() as we do not, or will not
shortly, have gd prior to board_init_f running.


Hmm... first I thought, ok, no problem, move the output from the RAM
parameters to spl_board_init() ... but thats only the half of the
story ... They read the RAM parameters from an i2c eeprom, and if
there are errors, they print this errors ... currently this does
not work, and thats I think the more important case ... and I could
not move this error printfs to somewhere, because if RAM is not
working ... there is no later ...

So I have to enable the console early ... maybe I missed something,
but this worked fine in the past (and I think we should not break
this, as this is an essential feature).


OK, I missed something too.  I think this gets better now once I merge
Simon's SPL series as we do all of this from board_init_f() and the
siemens code should just work again.


Yes, just saw your patch ;-)

If they are in mainline (or do you have them somewhere in a git repo?),
I test it again on the dxr2 board, thanks!


If I am correct, all needed patches from you are in mainline, just
tried this on the dxr2 board ... but I still need:

diff --git a/board/siemens/common/board.c b/board/siemens/common/board.c
index a39cbd0..8724604 100644
--- a/board/siemens/common/board.c
+++ b/board/siemens/common/board.c
@@ -40,6 +40,11 @@ void set_uart_mux_conf(void)

  void set_mux_conf_regs(void)
  {
+   /* enable early the console */
+   gd-baudrate = CONFIG_BAUDRATE;
+   serial_init();
+   gd-have_console = 1;
+
 /* Initalize the board header */
 enable_i2c0_pin_mux();
 i2c_set_bus_num(0);

to see the console output ...


Yes, if you want console prior to spl_board_init() then you need to do
that where you are.



Ah, ok... so this patch is OK?


Just found this thread again, as I want to post updates for the am335x
based siemens boards ... Is this patch [1] Ok, and can get applied?

Thanks!

bye,
Heiko
[1] Patchwork [U-Boot] am33xx, spl, siemens: enable debug uart output again
https://patchwork.ozlabs.org/patch/446644/

Hups... found this patch in patchwork marked as RFC and Delegated
to me ... ?
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] dm: sf: Add Atmel DataFlash spi flash driver

2015-05-14 Thread Jagan Teki
On 14 May 2015 at 14:57, Haikun Wang haikun.w...@freescale.com wrote:
 Atmel DataFlash chips have commands different from common spi
 flash commands.
 Atmel DataFlash also have special page-size.
 This driver add support for accessing Atmel DataFlash.
 It is based on the Driver Model.
 Example:
 = sf probe 1:0
 SPI DataFlash: Detected AT45DB021B with page size 264 Bytes, erase size 264 
 Bytes, total 264 KiB, revision d
 = sf erase 0 42000
 SF: 270336 bytes @ 0x0 Erased: OK
 = mw.l 8200 45444342 2
 = sf write 8200 0 42000
 SF: 270336 bytes @ 0x0 Written: OK
 = sf read 8300 0 42000
 SF: 270336 bytes @ 0x0 Read: OK
 = cmp.b 8200 8300 42000
 Total of 270336 byte(s) were the same

 Signed-off-by: Haikun Wang haikun.w...@freescale.com
 ---
 Verified with AT45DB021B on LS1021AQDS.

 Changes in v4:
 - Use dev_get_priv and dev_get_uclass_priv
 - Add test log to commit message

 Changes in v3:
 - 1. Rename file spi_dataflash.c to sf_dataflash.c
 - 2. Add comment for array dataflash_data

 Changes in v2:
 - 1. Correct comment style
 - 2. Use get_timer in dataflash_waitready to check whether timeout
 - 3. Remove struct spi_flash * in struct dataflash, and get it from 
 udevice-uclass_priv
 - 4. Replace spi_flash_write_common with spi_flash_cmd_write
 - 5. Replace spi_flash_read with spi_flash_cmd_read
 - 6. Change type of varible status form char to u8 in dataflash_status
 - 7. Change add_dataflash's argument type due to change 3
 - 8. Add claim_bus and release_bus in erase/write/read due to change 4  5

 Changes in v1: None
  drivers/mtd/spi/Makefile   |   1 +
  drivers/mtd/spi/sf_dataflash.c | 711 
 +
  2 files changed, 712 insertions(+)
  create mode 100644 drivers/mtd/spi/sf_dataflash.c

 diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
 index c61b784..8adec3d 100644
 --- a/drivers/mtd/spi/Makefile
 +++ b/drivers/mtd/spi/Makefile
 @@ -15,6 +15,7 @@ endif
  #ifndef CONFIG_DM_SPI
  obj-$(CONFIG_SPI_FLASH) += sf_probe.o
  #endif
 +obj-$(CONFIG_DM_SF_DATAFLASH) += sf_dataflash.o

This looks confuse to me,  CONFIG_SF_DATAFLASH looks simpler.

For long run all the driver stuff could move to DM, no need to specify
explicitly.

BTW:
Did you define this any board config?

  obj-$(CONFIG_CMD_SF) += sf.o
  obj-$(CONFIG_SPI_FLASH) += sf_ops.o sf_params.o
  obj-$(CONFIG_SPI_FLASH_SANDBOX) += sandbox.o
 diff --git a/drivers/mtd/spi/sf_dataflash.c b/drivers/mtd/spi/sf_dataflash.c
 new file mode 100644
 index 000..d287db8
 --- /dev/null
 +++ b/drivers/mtd/spi/sf_dataflash.c
 @@ -0,0 +1,711 @@
 +/*
 + *
 + * Atmel DataFlash probing
 + *
 + * Copyright (C) 2004-2009, 2015 Freescale Semiconductor, Inc.
 + * Haikun Wang (haikun.w...@freescale.com)
 + *
 + * SPDX-License-Identifier:GPL-2.0+
 +*/
 +#include common.h
 +#include dm.h
 +#include errno.h
 +#include fdtdec.h
 +#include spi.h
 +#include spi_flash.h
 +#include div64.h
 +#include linux/err.h
 +#include linux/math64.h
 +
 +#include sf_internal.h
 +
 +/*
 + * DataFlash is a kind of SPI flash.  Most AT45 chips have two buffers in
 + * each chip, which may be used for double buffered I/O; but this driver
 + * doesn't (yet) use these for any kind of i/o overlap or prefetching.
 + *
 + * Sometimes DataFlash is packaged in MMC-format cards, although the
 + * MMC stack can't (yet?) distinguish between MMC and DataFlash
 + * protocols during enumeration.
 + */
 +
 +/* reads can bypass the buffers */
 +#define OP_READ_CONTINUOUS 0xE8
 +#define OP_READ_PAGE   0xD2
 +
 +/* group B requests can run even while status reports busy */
 +#define OP_READ_STATUS 0xD7/* group B */
 +
 +/* move data between host and buffer */
 +#define OP_READ_BUFFER10xD4/* group B */
 +#define OP_READ_BUFFER20xD6/* group B */
 +#define OP_WRITE_BUFFER1   0x84/* group B */
 +#define OP_WRITE_BUFFER2   0x87/* group B */
 +
 +/* erasing flash */
 +#define OP_ERASE_PAGE  0x81
 +#define OP_ERASE_BLOCK 0x50
 +
 +/* move data between buffer and flash */
 +#define OP_TRANSFER_BUF1   0x53
 +#define OP_TRANSFER_BUF2   0x55
 +#define OP_MREAD_BUFFER1   0xD4
 +#define OP_MREAD_BUFFER2   0xD6
 +#define OP_MWERASE_BUFFER1 0x83
 +#define OP_MWERASE_BUFFER2 0x86
 +#define OP_MWRITE_BUFFER1  0x88/* sector must be pre-erased */
 +#define OP_MWRITE_BUFFER2  0x89/* sector must be pre-erased */
 +
 +/* write to buffer, then write-erase to flash */
 +#define OP_PROGRAM_VIA_BUF10x82
 +#define OP_PROGRAM_VIA_BUF20x85
 +
 +/* compare buffer to flash */
 +#define OP_COMPARE_BUF10x60
 +#define OP_COMPARE_BUF20x61
 +
 +/* read flash to buffer, then write-erase to flash */
 +#define OP_REWRITE_VIA_BUF10x58
 +#define OP_REWRITE_VIA_BUF20x59
 +
 +/*
 + * newer chips report JEDEC manufacturer and device IDs; chip
 + * serial number and OTP bits; and per-sector 

Re: [U-Boot] [PATCH] am33xx, spl, siemens: enable debug uart output again

2015-05-14 Thread Tom Rini
On Thu, May 14, 2015 at 12:37:40PM +0200, Heiko Schocher wrote:
 Hello Tom,
 
 Am 06.03.2015 08:24, schrieb Heiko Schocher:
 Hello Tom,
 
 Am 05.03.2015 15:50, schrieb Tom Rini:
 On Thu, Mar 05, 2015 at 09:46:50AM +0100, Heiko Schocher wrote:
 Hello Tom,
 
 Am 05.03.2015 07:22, schrieb Heiko Schocher:
 Hello Tom,
 
 Am 04.03.2015 17:40, schrieb Tom Rini:
 On Wed, Mar 04, 2015 at 08:42:58AM +0100, Heiko Schocher wrote:
 Hello Tom,
 
 Am 02.03.2015 14:59, schrieb Tom Rini:
 On Mon, Mar 02, 2015 at 07:56:41AM +0100, Heiko Schocher wrote:
 Hello Simon,
 
 Am 24.02.2015 14:31, schrieb Simon Glass:
 Hi Heiko,
 
 On 23 February 2015 at 23:18, Heiko Schocher h...@denx.de wrote:
 a6b541b090: TI ARMv7: Don't use GD before crt0.S has set it
 
 moves the init of the debug uart at the very end of SPL code.
 Enable it for the siemens board earlier, as they print
 ddr settings ... all debug output before board_init_r()
 is here currently useless. Maybe we must rework this
 globally?
 
 Assuming we are talking about U-Boot proper, the DDR init should
 happen in board_init_f(), specifically dram_init(). so I think this
 code should be updated.
 
 If it is SPL, then DDR init should happen in SPL's board_init_f().
 
 It is in SPL...
 
 sdram_init() is called from:
 
 ./arch/arm/cpu/armv7/am33xx/board.c from s_init() ...
 
 I sent a series a few weeks ago (available at u-boot-dm branch
 spl-working) related to this topic:
 
 http://patchwork.ozlabs.org/patch/438581/
 
 Ah ... Hmm... so ./arch/arm/cpu/armv7/am33xx/board.c needs
 a rework, right?
 
 Is a simple rename s_init() - board_init_f() correct?
 
 Right so, no, we can't just rename s_init to board_init_f.  This is 
 what
 I was talking about in the thread about the function Hans wants to add
 to enable some bits in CP15 on sunxi, iirc.
 
 In short, armv7 has a different set of abstraction hooks than the
 previous ARM cores (armv8 followed what we have for v7) and I'm not
 convinced in the end that it really won us anything.  See
 http://lists.denx.de/pipermail/u-boot/2015-January/202350.html
 
 For today you need to rework the Siemens code to print out the DDR
 values (when desired) in spl_board_init() as we do not, or will not
 shortly, have gd prior to board_init_f running.
 
 Hmm... first I thought, ok, no problem, move the output from the RAM
 parameters to spl_board_init() ... but thats only the half of the
 story ... They read the RAM parameters from an i2c eeprom, and if
 there are errors, they print this errors ... currently this does
 not work, and thats I think the more important case ... and I could
 not move this error printfs to somewhere, because if RAM is not
 working ... there is no later ...
 
 So I have to enable the console early ... maybe I missed something,
 but this worked fine in the past (and I think we should not break
 this, as this is an essential feature).
 
 OK, I missed something too.  I think this gets better now once I merge
 Simon's SPL series as we do all of this from board_init_f() and the
 siemens code should just work again.
 
 Yes, just saw your patch ;-)
 
 If they are in mainline (or do you have them somewhere in a git repo?),
 I test it again on the dxr2 board, thanks!
 
 If I am correct, all needed patches from you are in mainline, just
 tried this on the dxr2 board ... but I still need:
 
 diff --git a/board/siemens/common/board.c b/board/siemens/common/board.c
 index a39cbd0..8724604 100644
 --- a/board/siemens/common/board.c
 +++ b/board/siemens/common/board.c
 @@ -40,6 +40,11 @@ void set_uart_mux_conf(void)
 
   void set_mux_conf_regs(void)
   {
 +   /* enable early the console */
 +   gd-baudrate = CONFIG_BAUDRATE;
 +   serial_init();
 +   gd-have_console = 1;
 +
  /* Initalize the board header */
  enable_i2c0_pin_mux();
  i2c_set_bus_num(0);
 
 to see the console output ...
 
 Yes, if you want console prior to spl_board_init() then you need to do
 that where you are.
 
 
 Ah, ok... so this patch is OK?
 
 Just found this thread again, as I want to post updates for the am335x
 based siemens boards ... Is this patch [1] Ok, and can get applied?
 
 Thanks!
 
 bye,
 Heiko
 [1] Patchwork [U-Boot] am33xx, spl, siemens: enable debug uart output again
 https://patchwork.ozlabs.org/patch/446644/
 
 Hups... found this patch in patchwork marked as RFC and Delegated
 to me ... ?

I'll look it over again then, thanks.

-- 
Tom


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


Re: [U-Boot] [PATCH] spl: Correct address in spl_relocate_stack_gd()

2015-05-14 Thread Tom Rini
On Wed, May 13, 2015 at 09:15:21PM -0600, Simon Glass wrote:

 During the Kconfig conversion one of the changes was missed.
 CONFIG_SPL_STACK_R should be CONFIG_SPL_STACK_R_ADDR since we want the
 address.
 
 Reported-by: Tim Harvey thar...@gateworks.com
 Signed-off-by: Simon Glass s...@chromium.org

Applied to u-boot/master, thanks!

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


[U-Boot] [PATCH] arc: gitignore: ignore ARC DTBs

2015-05-14 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
---

 arch/arc/dts/.gitignore | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 arch/arc/dts/.gitignore

diff --git a/arch/arc/dts/.gitignore b/arch/arc/dts/.gitignore
new file mode 100644
index 000..b60ed20
--- /dev/null
+++ b/arch/arc/dts/.gitignore
@@ -0,0 +1 @@
+*.dtb
-- 
1.9.1

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


[U-Boot] [PATCH V4 1/2] i2c: mxc: refactor i2c driver and support dm

2015-05-14 Thread Peng Fan
1. Introduce a new structure `struct mxc_i2c_bus`, this structure will
   used for non-DM and DM.
2. Remove `struct mxc_i2c_regs` structure, but use register offset to access
   registers based on `base` entry of `struct mxc_i2c_bus`.
3. Remove most `#ifdef I2C_QUIRK_REG`. Using driver_data to contain platform
   flags. A new flag is introduced, I2C_QUIRK_FLAG.
4. Most functions use `struct mxc_i2c_bus` as one of the parameters.
   Make most functions common to DM and non-DM, try to avoid duplicated code.
5. Support DM, but pinctrl is not included. Pinmux setting is still set
   by setup_i2c, but we do not need bus_i2c_init for DM.
6. struct i2c_parms and struct sram_data are removed.
7. Remove bus_i2c_read bus_i2c_write prototype in header file. The frist
   paramter of bus_i2c_init is modified to i2c index. Add new prototype
   i2c_idle_bus and force_bus_idle. Since bus_i2c_init is not good for
   DM I2C and pinctrl is missed, we use a weak function for i2c_idle_bus.
   Board file take the responsibility to implement this function, like this:
   
   int i2c_idle_bus(struct mxc_i2c_bus *i2c_bus)
   {
   if (i2c_bus-index == 0)
   force_bus_idle(i2c_pads_info0);
   else if (i2c_bus-index == 1)
   force_bus_idle(i2c_pads_info1);
   else
   xx
   }
   
8. Introduce a weak function, enable_i2c_clk
9. Tested on an i.MX7 platform. Log info:
 = dm tree
 Class   Probed   Name
 
 root[ + ]root_driver
 simple_bus  [   ]|-- soc
 simple_bus  [   ]|   |-- aips-bus@3000
 simple_bus  [   ]|   |   |-- anatop@3036
 simple_bus  [   ]|   |   `-- snvs@3037
 simple_bus  [   ]|   |-- aips-bus@3040
 simple_bus  [   ]|   `-- aips-bus@3080
 i2c [   ]|   |-- i2c@30a2
 i2c [   ]|   `-- i2c@30a4
 simple_bus  [   ]`-- regulators
 = i2c dev 0
 Setting bus to 0
 = i2c probe
 Valid chip addresses: 08 50
 = i2c md 8 31
 0031: 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08

Signed-off-by: Peng Fan peng@freescale.com
Acked-by: Simon Glass s...@chromium.org
---

 Changes v4:
 1. fix build errors
 2. Introduce a weak function enable_i2c_clk.
 3. add Simon's Acked-by.
 4. Add test log in commit log.

 Changes v3:
  1. remove bus_i2c_init for DM, introuduce a weak function i2c_idle_bus.
  2. remove static return type for force_idle_bus, since we need to call
 it in i2c_idle_bus which may be implemented in board file. This does
 not hurt for non-DM.

 Changes v2:
  1. Refactor driver, remove register access based on structure, but use
'base + offset'
  2. Introduce mxc_i2c_bus structure
  3. Introduce I2C_QUIRK_FLAG and remove most I2C_QUIRK_REG and use
 driver_data to contain the flags for different platforms
  4.  Avoid duplicated code between DM and non-DM part
  5. The function name i2c_init_transfer is not changed.
  6. Remove bus_i2c_read/write prototype from header file
  7. change bus_i2c_init's first parameter to i2c index
  8. Rename patch name, since refactor non-DM part.

 arch/arm/imx-common/i2c-mxv7.c|   7 +-
 arch/arm/include/asm/imx-common/mxc_i2c.h |  38 +-
 drivers/i2c/mxc_i2c.c | 581 --
 3 files changed, 433 insertions(+), 193 deletions(-)

diff --git a/arch/arm/imx-common/i2c-mxv7.c b/arch/arm/imx-common/i2c-mxv7.c
index 1a632e7..f3a5c3f 100644
--- a/arch/arm/imx-common/i2c-mxv7.c
+++ b/arch/arm/imx-common/i2c-mxv7.c
@@ -12,7 +12,7 @@
 #include asm/imx-common/mxc_i2c.h
 #include watchdog.h
 
-static int force_idle_bus(void *priv)
+int force_idle_bus(void *priv)
 {
int i;
int sda, scl;
@@ -99,8 +99,9 @@ int setup_i2c(unsigned i2c_index, int speed, int slave_addr,
if (ret)
goto err_idle;
 
-   bus_i2c_init(i2c_bases[i2c_index], speed, slave_addr,
-   force_idle_bus, p);
+#ifndef CONFIG_DM_I2C
+   bus_i2c_init(i2c_index, speed, slave_addr, force_idle_bus, p);
+#endif
 
return 0;
 
diff --git a/arch/arm/include/asm/imx-common/mxc_i2c.h 
b/arch/arm/include/asm/imx-common/mxc_i2c.h
index af86163..355b25e 100644
--- a/arch/arm/include/asm/imx-common/mxc_i2c.h
+++ b/arch/arm/include/asm/imx-common/mxc_i2c.h
@@ -19,6 +19,36 @@ struct i2c_pads_info {
struct i2c_pin_ctrl sda;
 };
 
+/*
+ * Information about i2c controller
+ * struct mxc_i2c_bus - information about the i2c[x] bus
+ * @index: i2c bus index
+ * @base: Address of I2C bus controller
+ * @driver_data: Flags for different platforms, such as I2C_QUIRK_FLAG.
+ * @speed: Speed of I2C bus
+ * @pads_info: pinctrl info for this i2c bus, will be used when pinctrl is ok.
+ * The following two is only to be compatible with non-DM part.
+ * @idle_bus_fn: function to force bus idle
+ * @idle_bus_data: parameter for idle_bus_fun
+ */
+struct mxc_i2c_bus {
+   /*
+* board file can use this index to 

[U-Boot] [PATCH v4] dm: sf: Add Atmel DataFlash spi flash driver

2015-05-14 Thread Haikun Wang
Atmel DataFlash chips have commands different from common spi
flash commands.
Atmel DataFlash also have special page-size.
This driver add support for accessing Atmel DataFlash.
It is based on the Driver Model.
Example:
= sf probe 1:0
SPI DataFlash: Detected AT45DB021B with page size 264 Bytes, erase size 264 
Bytes, total 264 KiB, revision d
= sf erase 0 42000
SF: 270336 bytes @ 0x0 Erased: OK
= mw.l 8200 45444342 2
= sf write 8200 0 42000
SF: 270336 bytes @ 0x0 Written: OK
= sf read 8300 0 42000
SF: 270336 bytes @ 0x0 Read: OK
= cmp.b 8200 8300 42000
Total of 270336 byte(s) were the same

Signed-off-by: Haikun Wang haikun.w...@freescale.com
---
Verified with AT45DB021B on LS1021AQDS.

Changes in v4:
- Use dev_get_priv and dev_get_uclass_priv
- Add test log to commit message

Changes in v3:
- 1. Rename file spi_dataflash.c to sf_dataflash.c
- 2. Add comment for array dataflash_data

Changes in v2:
- 1. Correct comment style
- 2. Use get_timer in dataflash_waitready to check whether timeout
- 3. Remove struct spi_flash * in struct dataflash, and get it from 
udevice-uclass_priv
- 4. Replace spi_flash_write_common with spi_flash_cmd_write 
- 5. Replace spi_flash_read with spi_flash_cmd_read 
- 6. Change type of varible status form char to u8 in dataflash_status
- 7. Change add_dataflash's argument type due to change 3
- 8. Add claim_bus and release_bus in erase/write/read due to change 4  5

Changes in v1: None
 drivers/mtd/spi/Makefile   |   1 +
 drivers/mtd/spi/sf_dataflash.c | 711 +
 2 files changed, 712 insertions(+)
 create mode 100644 drivers/mtd/spi/sf_dataflash.c

diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index c61b784..8adec3d 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -15,6 +15,7 @@ endif
 #ifndef CONFIG_DM_SPI
 obj-$(CONFIG_SPI_FLASH) += sf_probe.o
 #endif
+obj-$(CONFIG_DM_SF_DATAFLASH) += sf_dataflash.o
 obj-$(CONFIG_CMD_SF) += sf.o
 obj-$(CONFIG_SPI_FLASH) += sf_ops.o sf_params.o
 obj-$(CONFIG_SPI_FLASH_SANDBOX) += sandbox.o
diff --git a/drivers/mtd/spi/sf_dataflash.c b/drivers/mtd/spi/sf_dataflash.c
new file mode 100644
index 000..d287db8
--- /dev/null
+++ b/drivers/mtd/spi/sf_dataflash.c
@@ -0,0 +1,711 @@
+/*
+ *
+ * Atmel DataFlash probing
+ *
+ * Copyright (C) 2004-2009, 2015 Freescale Semiconductor, Inc.
+ * Haikun Wang (haikun.w...@freescale.com)
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+*/
+#include common.h
+#include dm.h
+#include errno.h
+#include fdtdec.h
+#include spi.h
+#include spi_flash.h
+#include div64.h
+#include linux/err.h
+#include linux/math64.h
+
+#include sf_internal.h
+
+/*
+ * DataFlash is a kind of SPI flash.  Most AT45 chips have two buffers in
+ * each chip, which may be used for double buffered I/O; but this driver
+ * doesn't (yet) use these for any kind of i/o overlap or prefetching.
+ *
+ * Sometimes DataFlash is packaged in MMC-format cards, although the
+ * MMC stack can't (yet?) distinguish between MMC and DataFlash
+ * protocols during enumeration.
+ */
+
+/* reads can bypass the buffers */
+#define OP_READ_CONTINUOUS 0xE8
+#define OP_READ_PAGE   0xD2
+
+/* group B requests can run even while status reports busy */
+#define OP_READ_STATUS 0xD7/* group B */
+
+/* move data between host and buffer */
+#define OP_READ_BUFFER10xD4/* group B */
+#define OP_READ_BUFFER20xD6/* group B */
+#define OP_WRITE_BUFFER1   0x84/* group B */
+#define OP_WRITE_BUFFER2   0x87/* group B */
+
+/* erasing flash */
+#define OP_ERASE_PAGE  0x81
+#define OP_ERASE_BLOCK 0x50
+
+/* move data between buffer and flash */
+#define OP_TRANSFER_BUF1   0x53
+#define OP_TRANSFER_BUF2   0x55
+#define OP_MREAD_BUFFER1   0xD4
+#define OP_MREAD_BUFFER2   0xD6
+#define OP_MWERASE_BUFFER1 0x83
+#define OP_MWERASE_BUFFER2 0x86
+#define OP_MWRITE_BUFFER1  0x88/* sector must be pre-erased */
+#define OP_MWRITE_BUFFER2  0x89/* sector must be pre-erased */
+
+/* write to buffer, then write-erase to flash */
+#define OP_PROGRAM_VIA_BUF10x82
+#define OP_PROGRAM_VIA_BUF20x85
+
+/* compare buffer to flash */
+#define OP_COMPARE_BUF10x60
+#define OP_COMPARE_BUF20x61
+
+/* read flash to buffer, then write-erase to flash */
+#define OP_REWRITE_VIA_BUF10x58
+#define OP_REWRITE_VIA_BUF20x59
+
+/*
+ * newer chips report JEDEC manufacturer and device IDs; chip
+ * serial number and OTP bits; and per-sector writeprotect.
+ */
+#define OP_READ_ID 0x9F
+#define OP_READ_SECURITY   0x77
+#define OP_WRITE_SECURITY_REVC 0x9A
+#define OP_WRITE_SECURITY  0x9B/* revision D */
+
+
+struct dataflash {
+   uint8_t command[16];
+   unsigned short  page_offset;/* offset in flash address */
+};
+
+/*
+ * Return the status of the DataFlash device.
+ */
+static 

[U-Boot] [PATCH] ls1021atwr: added deep sleep support in uboot

2015-05-14 Thread Yuantian.Tang
From: Tang Yuantian yuantian.t...@freescale.com

Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
---
 arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h |  4 ++
 board/freescale/ls1021atwr/ls1021atwr.c   | 68 ++-
 include/configs/ls1021atwr.h  |  7 ++-
 3 files changed, 75 insertions(+), 4 deletions(-)

diff --git a/arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h 
b/arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h
index a8122c1..bbd5955 100644
--- a/arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h
+++ b/arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h
@@ -370,6 +370,10 @@ struct ccsr_serdes {
 #define DDR_DDR_ZQ_CNTL0x89080600
 #define DDR_CS0_CONFIG_2   0
 #define DDR_SDRAM_CFG_MEM_EN   0x8000
+#define SDRAM_CFG2_D_INIT  0x0010
+#define DDR_CDR2_VREF_TRAIN_EN 0x0080
+#define SDRAM_CFG2_FRC_SR  0x8000
+#define SDRAM_CFG_BI   0x0001
 
 /* DDR memory controller registers */
 struct ccsr_ddr {
diff --git a/board/freescale/ls1021atwr/ls1021atwr.c 
b/board/freescale/ls1021atwr/ls1021atwr.c
index ed5bd27..2c8d6d1 100644
--- a/board/freescale/ls1021atwr/ls1021atwr.c
+++ b/board/freescale/ls1021atwr/ls1021atwr.c
@@ -21,6 +21,7 @@
 #include tsec.h
 #include fsl_sec.h
 #include spl.h
+#include ../common/sleep.h
 #ifdef CONFIG_U_QE
 #include ../../../drivers/qe/qe.h
 #endif
@@ -147,6 +148,7 @@ unsigned int get_soc_major_rev(void)
 void ddrmc_init(void)
 {
struct ccsr_ddr *ddr = (struct ccsr_ddr *)CONFIG_SYS_FSL_DDR_ADDR;
+   u32 temp_sdram_cfg;
 
out_be32(ddr-sdram_cfg, DDR_SDRAM_CFG);
 
@@ -160,7 +162,22 @@ void ddrmc_init(void)
out_be32(ddr-timing_cfg_4, DDR_TIMING_CFG_4);
out_be32(ddr-timing_cfg_5, DDR_TIMING_CFG_5);
 
-   out_be32(ddr-sdram_cfg_2,  DDR_SDRAM_CFG_2);
+#ifdef CONFIG_DEEP_SLEEP
+   if (is_warm_boot()) {
+   out_be32(ddr-sdram_cfg_2,
+DDR_SDRAM_CFG_2  ~SDRAM_CFG2_D_INIT);
+   out_be32(ddr-init_addr, CONFIG_SYS_SDRAM_BASE);
+   out_be32(ddr-init_ext_addr, (1  31));
+
+   /* DRAM VRef will not be trained */
+   out_be32(ddr-ddr_cdr2,
+DDR_DDR_CDR2  ~DDR_CDR2_VREF_TRAIN_EN);
+   } else
+#endif
+   {
+   out_be32(ddr-sdram_cfg_2, DDR_SDRAM_CFG_2);
+   out_be32(ddr-ddr_cdr2, DDR_DDR_CDR2);
+   }
 
out_be32(ddr-sdram_mode, DDR_SDRAM_MODE);
out_be32(ddr-sdram_mode_2, DDR_SDRAM_MODE_2);
@@ -173,14 +190,35 @@ void ddrmc_init(void)
out_be32(ddr-ddr_wrlvl_cntl_3, DDR_DDR_WRLVL_CNTL_3);
 
out_be32(ddr-ddr_cdr1, DDR_DDR_CDR1);
-   out_be32(ddr-ddr_cdr2, DDR_DDR_CDR2);
 
out_be32(ddr-sdram_clk_cntl, DDR_SDRAM_CLK_CNTL);
out_be32(ddr-ddr_zq_cntl, DDR_DDR_ZQ_CNTL);
 
out_be32(ddr-cs0_config_2, DDR_CS0_CONFIG_2);
udelay(1);
-   out_be32(ddr-sdram_cfg, DDR_SDRAM_CFG | DDR_SDRAM_CFG_MEM_EN);
+
+#ifdef CONFIG_DEEP_SLEEP
+   if (is_warm_boot()) {
+   /* enter self-refresh */
+   temp_sdram_cfg = in_be32(ddr-sdram_cfg_2);
+   temp_sdram_cfg |= SDRAM_CFG2_FRC_SR;
+   out_be32(ddr-sdram_cfg_2, temp_sdram_cfg);
+
+   temp_sdram_cfg = (DDR_SDRAM_CFG_MEM_EN | SDRAM_CFG_BI);
+   } else
+#endif
+   temp_sdram_cfg = (DDR_SDRAM_CFG_MEM_EN  ~SDRAM_CFG_BI);
+
+   out_be32(ddr-sdram_cfg, DDR_SDRAM_CFG | temp_sdram_cfg);
+
+#ifdef CONFIG_DEEP_SLEEP
+   if (is_warm_boot()) {
+   /* exit self-refresh */
+   temp_sdram_cfg = in_be32(ddr-sdram_cfg_2);
+   temp_sdram_cfg = ~SDRAM_CFG2_FRC_SR;
+   out_be32(ddr-sdram_cfg_2, temp_sdram_cfg);
+   }
+#endif
 }
 
 int dram_init(void)
@@ -190,6 +228,11 @@ int dram_init(void)
 #endif
 
gd-ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
+
+#if defined(CONFIG_DEEP_SLEEP)  !defined(CONFIG_SPL_BUILD)
+   fsl_dp_resume();
+#endif
+
return 0;
 }
 
@@ -384,6 +427,11 @@ int board_early_init_f(void)
out_le32(cci-slave[2].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
}
 
+#if defined(CONFIG_DEEP_SLEEP)
+   if (is_warm_boot())
+   fsl_dp_disable_console();
+#endif
+
return 0;
 }
 
@@ -395,6 +443,11 @@ void board_init_f(ulong dummy)
 
get_clocks();
 
+#if defined(CONFIG_DEEP_SLEEP)
+   if (is_warm_boot())
+   fsl_dp_disable_console();
+#endif
+
preloader_console_init();
 
dram_init();
@@ -563,6 +616,15 @@ int misc_init_r(void)
 }
 #endif
 
+#if defined(CONFIG_DEEP_SLEEP)
+void board_sleep_prepare(void)
+{
+#ifdef CONFIG_LS102XA_NS_ACCESS
+   enable_devices_ns_access(ns_dev, ARRAY_SIZE(ns_dev));
+#endif
+}
+#endif
+
 int ft_board_setup(void *blob, bd_t *bd)
 {
ft_cpu_setup(blob, bd);
diff --git a/include/configs/ls1021atwr.h 

[U-Boot] [PATCH V4 2/2] imx: mx27 remove redundant macro

2015-05-14 Thread Peng Fan
Use common macro in iomux-v3.h, remove redundant macro.

Signed-off-by: Peng Fan peng@freescale.com
---

Changes v4:
 New patch.
 we include mxc_i2c.h in driver/i2c/mxc_i2c.c in patch 1/2.
 mxc_i2c.h includes iomux-v3.h.
 Since iomux-v3.h have some macros which also exists in
 asm/arch-xx/imx-regs.h, this will introudce compile warnings
 such as redefined macro.

Changes v3:
 none

Changes v2:
 none

 arch/arm/cpu/arm926ejs/mx27/generic.c  |  1 +
 arch/arm/include/asm/arch-mx27/imx-regs.h  | 22 --
 arch/arm/include/asm/imx-common/iomux-v3.h | 22 --
 board/armadeus/apf27/apf27.c   |  1 +
 board/armadeus/apf27/fpga.c|  1 +
 board/logicpd/imx27lite/imx27lite.c|  1 +
 6 files changed, 20 insertions(+), 28 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/mx27/generic.c 
b/arch/arm/cpu/arm926ejs/mx27/generic.c
index 5ee9f07..53d52e5 100644
--- a/arch/arm/cpu/arm926ejs/mx27/generic.c
+++ b/arch/arm/cpu/arm926ejs/mx27/generic.c
@@ -12,6 +12,7 @@
 #include asm/arch/imx-regs.h
 #include asm/arch/clock.h
 #include asm/arch/gpio.h
+#include asm/imx-common/iomux-v3.h
 #ifdef CONFIG_MXC_MMC
 #include asm/arch/mxcmmc.h
 #endif
diff --git a/arch/arm/include/asm/arch-mx27/imx-regs.h 
b/arch/arm/include/asm/arch-mx27/imx-regs.h
index 92c847e..7402e31 100644
--- a/arch/arm/include/asm/arch-mx27/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx27/imx-regs.h
@@ -138,16 +138,6 @@ struct gpt_regs {
u32 gpt_tstat;
 };
 
-/*
- *  GPIO Module and I/O Multiplexer
- */
-#define PORTA 0
-#define PORTB 1
-#define PORTC 2
-#define PORTD 3
-#define PORTE 4
-#define PORTF 5
-
 /* IIM Control Registers */
 struct iim_regs {
u32 iim_stat;
@@ -449,18 +439,6 @@ struct fuse_bank0_regs {
 #define GPIO5_BASE_ADDR 0x10015400
 #define GPIO6_BASE_ADDR 0x10015500
 
-#define GPIO_PIN_MASK  0x1f
-
-#define GPIO_PORT_SHIFT5
-#define GPIO_PORT_MASK (0x7  GPIO_PORT_SHIFT)
-
-#define GPIO_PORTA (PORTA  GPIO_PORT_SHIFT)
-#define GPIO_PORTB (PORTB  GPIO_PORT_SHIFT)
-#define GPIO_PORTC (PORTC  GPIO_PORT_SHIFT)
-#define GPIO_PORTD (PORTD  GPIO_PORT_SHIFT)
-#define GPIO_PORTE (PORTE  GPIO_PORT_SHIFT)
-#define GPIO_PORTF (PORTF  GPIO_PORT_SHIFT)
-
 #define GPIO_OUT   (1  8)
 #define GPIO_IN(0  8)
 #define GPIO_PUEN  (1  9)
diff --git a/arch/arm/include/asm/imx-common/iomux-v3.h 
b/arch/arm/include/asm/imx-common/iomux-v3.h
index e0a49be..086486c 100644
--- a/arch/arm/include/asm/imx-common/iomux-v3.h
+++ b/arch/arm/include/asm/imx-common/iomux-v3.h
@@ -169,15 +169,25 @@ typedef u64 iomux_v3_cfg_t;
 
 #define IOMUX_CONFIG_SION  0x10
 
+/*
+ *  GPIO Module and I/O Multiplexer
+ */
+#define PORTA 0
+#define PORTB 1
+#define PORTC 2
+#define PORTD 3
+#define PORTE 4
+#define PORTF 5
+
 #define GPIO_PIN_MASK  0x1f
 #define GPIO_PORT_SHIFT5
 #define GPIO_PORT_MASK (0x7  GPIO_PORT_SHIFT)
-#define GPIO_PORTA (0  GPIO_PORT_SHIFT)
-#define GPIO_PORTB (1  GPIO_PORT_SHIFT)
-#define GPIO_PORTC (2  GPIO_PORT_SHIFT)
-#define GPIO_PORTD (3  GPIO_PORT_SHIFT)
-#define GPIO_PORTE (4  GPIO_PORT_SHIFT)
-#define GPIO_PORTF (5  GPIO_PORT_SHIFT)
+#define GPIO_PORTA (PORTA  GPIO_PORT_SHIFT)
+#define GPIO_PORTB (PORTB  GPIO_PORT_SHIFT)
+#define GPIO_PORTC (PORTC  GPIO_PORT_SHIFT)
+#define GPIO_PORTD (PORTD  GPIO_PORT_SHIFT)
+#define GPIO_PORTE (PORTE  GPIO_PORT_SHIFT)
+#define GPIO_PORTF (PORTF  GPIO_PORT_SHIFT)
 
 void imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad);
 void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
diff --git a/board/armadeus/apf27/apf27.c b/board/armadeus/apf27/apf27.c
index 30e720d..f718e5c 100644
--- a/board/armadeus/apf27/apf27.c
+++ b/board/armadeus/apf27/apf27.c
@@ -17,6 +17,7 @@
 #include asm/arch/gpio.h
 #include asm/gpio.h
 #include asm/errno.h
+#include asm/imx-common/iomux-v3.h
 #include apf27.h
 #include crc.h
 #include fpga.h
diff --git a/board/armadeus/apf27/fpga.c b/board/armadeus/apf27/fpga.c
index 65a4812..af68244 100644
--- a/board/armadeus/apf27/fpga.c
+++ b/board/armadeus/apf27/fpga.c
@@ -13,6 +13,7 @@
 
 #include asm/arch/imx-regs.h
 #include asm/gpio.h
+#include asm/imx-common/iomux-v3.h
 #include asm/io.h
 #include command.h
 #include config.h
diff --git a/board/logicpd/imx27lite/imx27lite.c 
b/board/logicpd/imx27lite/imx27lite.c
index 07b07a0..576187b 100644
--- a/board/logicpd/imx27lite/imx27lite.c
+++ b/board/logicpd/imx27lite/imx27lite.c
@@ -10,6 +10,7 @@
 #include asm/io.h
 #include asm/arch/imx-regs.h
 #include asm/gpio.h
+#include asm/imx-common/iomux-v3.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
-- 
1.8.4


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


[U-Boot] [PATCH v2] README.scrapyard: add entries for dead board, T4240EMU and sc3

2015-05-14 Thread Masahiro Yamada
Follow-up commit 7fc63cca611b (mpc85xx/T4240EMU: Remove T4240EMU
board), and commit 27e721564591 (ppc4xx: Remove sc3 board),
filling the blank fields.

Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
---

Changes in v2:
  - rebased on commit 4588d61a284

 doc/README.scrapyard | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/doc/README.scrapyard b/doc/README.scrapyard
index aa2b07b..a62bd0b 100644
--- a/doc/README.scrapyard
+++ b/doc/README.scrapyard
@@ -12,9 +12,11 @@ The list should be sorted in reverse chronological order.
 
 BoardArchCPUCommit  Removed Last known 
maintainer/contact
 
=
-afeb9260 arm arm926ejs  -   -   Sergey 
Lapin sla...@ossfans.org
-tny_a9260arm arm926ejs  -   -   Albin 
Tonnerre albin.tonne...@free-electrons.com
-sbc35_a9g20  arm arm926ejs  -   -   Albin 
Tonnerre albin.tonne...@free-electrons.com
+afeb9260 arm arm926ejs  f6b42c142015-05-13  Sergey 
Lapin sla...@ossfans.org
+tny_a9260arm arm926ejs  f6b42c142015-05-13  Albin 
Tonnerre albin.tonne...@free-electrons.com
+sbc35_a9g20  arm arm926ejs  f6b42c142015-05-13  Albin 
Tonnerre albin.tonne...@free-electrons.com
+sc3  powerpc ppc4xx 27e721562015-05-10  Heiko 
Schocher h...@denx.de
+T4240EMU powerpc mpc85xx7fc63cca2015-05-05  York Sun 
york...@freescale.com
 koratpowerpc ppc4xx 5043045d2015-03-17  Larry 
Johnson l...@acm.org
 galaxy5200   powerpc mpc5xxx41eb4e5c2015-03-17  Eric 
Millbrandt emillbra...@dekaresearch.com
 W7OLMC   powerpc ppc4xx 6beecd5d2015-03-17  Erik 
Theisen ethei...@mindspring.com
-- 
1.9.1

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