[U-Boot] [PATCH 17/21] tools: moveconfig: display log when savedefconfig occurs

2016-05-18 Thread Masahiro Yamada
Now, "make savedefconfig" does not always happen.  Display the log
when it happens.

Signed-off-by: Masahiro Yamada 
---

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

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index cb26b14..80542c5 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -681,7 +681,8 @@ class Slot:
 if not updated:
 self.finish(True)
 return True
-"""Save off the defconfig in a consistent way"""
+self.log += color_text(self.options.color, COLOR_LIGHT_GREEN,
+   "Syncing by savedefconfig...\n")
 cmd = list(self.make_cmd)
 cmd.append('savedefconfig')
 self.ps = subprocess.Popen(cmd, stdout=self.devnull,
-- 
1.9.1

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


[U-Boot] [PATCH 20/21] tools: moveconfig: add --force-sync option

2016-05-18 Thread Masahiro Yamada
Now, this tools invokes "make savedefconfig" only when it needs to
do so, but there might be cases where a user wants the tool to do
savedefconfig forcibly, for example, some defconfigs were already
out of sync and the user wants to fix it as well.

Signed-off-by: Masahiro Yamada 
---

 tools/moveconfig.py | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 65cc5b3..acc3dbb 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -152,6 +152,11 @@ Available options
Exit immediately if Make exits with a non-zero status while processing
a defconfig file.
 
+ -s, --force-sync
+   Do "make savedefconfig" forcibly for all the defconfig files.
+   If not specified, "make savedefconfig" only occurs for cases
+   where at least one CONFIG was moved.
+
  -H, --headers-only
Only cleanup the headers; skip the defconfig processing
 
@@ -704,11 +709,15 @@ class Slot:
 (updated, log) = self.parser.update_dotconfig()
 self.log += log
 
-if not updated:
+if not self.options.force_sync and not updated:
 self.finish(True)
 return True
-self.log += color_text(self.options.color, COLOR_LIGHT_GREEN,
-   "Syncing by savedefconfig...\n")
+if updated:
+self.log += color_text(self.options.color, COLOR_LIGHT_GREEN,
+   "Syncing by savedefconfig...\n")
+else:
+self.log += "Syncing by savedefconfig (forced by option)...\n"
+
 cmd = list(self.make_cmd)
 cmd.append('savedefconfig')
 self.ps = subprocess.Popen(cmd, stdout=self.devnull,
@@ -919,6 +928,8 @@ def main():
 parser.add_option('-e', '--exit-on-error', action='store_true',
   default=False,
   help='exit immediately on any error')
+parser.add_option('-s', '--force-sync', action='store_true', default=False,
+  help='force sync by savedefconfig')
 parser.add_option('-H', '--headers-only', dest='cleanup_headers_only',
   action='store_true', default=False,
   help='only cleanup the headers')
-- 
1.9.1

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


Re: [U-Boot] [PATCH RESEND 2/2] cmd: fdt: add fdt overlay application subcommand

2016-05-18 Thread Pantelis Antoniou
Hi Maxime,

> On May 10, 2016, at 14:45 , Maxime Ripard  
> wrote:
> 

[snip]

> How do you want me to proceed?
> 
> Thanks!
> Maxime
> 
> -- 
> Maxime Ripard, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com

FYI an updated dtc patch has been sent. Hopefully this time will get in.

Regards

— Pantelis

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


[U-Boot] [PATCH 19/21] tools: moveconfig: report when defconfig is updated

2016-05-18 Thread Masahiro Yamada
There are various factors that determine if the given defconfig is
updated, and it is probably what users are more interested in.

Show the log when the defconfig is updated.  Also, copy the file
only when the file content was really updated to avoid changing
the time stamp needlessly.

Signed-off-by: Masahiro Yamada 
---

 tools/moveconfig.py | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 9c73b30..65cc5b3 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -172,6 +172,7 @@ To see the complete list of supported options, run
 
 """
 
+import filecmp
 import fnmatch
 import multiprocessing
 import optparse
@@ -717,9 +718,16 @@ class Slot:
 
 if self.state == STATE_SAVEDEFCONFIG:
 self.log += self.parser.check_defconfig()
-if not self.options.dry_run:
-shutil.move(os.path.join(self.build_dir, 'defconfig'),
-os.path.join('configs', self.defconfig))
+orig_defconfig = os.path.join('configs', self.defconfig)
+new_defconfig = os.path.join(self.build_dir, 'defconfig')
+updated = not filecmp.cmp(orig_defconfig, new_defconfig)
+
+if updated:
+self.log += color_text(self.options.color, COLOR_LIGHT_GREEN,
+   "defconfig was updated.\n")
+
+if not self.options.dry_run and updated:
+shutil.move(new_defconfig, orig_defconfig)
 self.finish(True)
 return True
 
-- 
1.9.1

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


[U-Boot] [PATCH 00/21] tools: moveconfig: many fixes, improvements, code clean-ups

2016-05-18 Thread Masahiro Yamada

Masahiro Yamada (21):
  tools: moveconfig: fix --dry-run option
  tools: moveconfig: rename update_defconfig() to update_dotconfig()
  tools: moveconfig: remove redundant else: after sys.exit()
  tools: moveconfig: check directory relocation before compilers
  tools: moveconfig: check compilers before starting defconfig walk
  tools: moveconfig: exit with error message for not clean directory
  tools: moveconfig: increment number of processed files monotonically
  tools: moveconfig: do not rely on type and default value given by
users
  tools: moveconfig: drop code for handling type and default value
  tools: moveconfig: allow to give CONFIG names as argument directly
  tools: moveconfig: add --undef option to move CONFIGs with default y
  tools: moveconfig: compute file paths just once
  tools: moveconfig: move log output code out of Kconfig Parser class
  tools: moveconfig: display log atomically in more readable format
  tools: moveconfig: refactor code to go back to idle state
  tools: moveconfig: skip savedefconfig if .config was not updated
  tools: moveconfig: display log when savedefconfig occurs
  tools: moveconfig: report when CONFIGs are removed by savedefconfig
  tools: moveconfig: report when defconfig is updated
  tools: moveconfig: add --force-sync option
  tools: moveconfig: allow to run without any CONFIG specified

 scripts/Makefile.autoconf |   3 +-
 tools/moveconfig.py   | 621 +-
 2 files changed, 339 insertions(+), 285 deletions(-)

-- 
1.9.1

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


[U-Boot] [PATCH 11/21] tools: moveconfig: add --undef option to move CONFIGs with default y

2016-05-18 Thread Masahiro Yamada
Since 96464badc794 ("moveconfig: Always run savedefconfig on the
moved config"), this tool can not correctly move bool configs with
the default value y.

The reason is like follows:

We are supposed to add the config entries in Kconfig for the options
we are moving before running this tool.  Otherwise, the moved options
would all disappear during the "make savedefconfig" stage.

Let's say we want to move CONFIG_FOO to Kconfig, making it an option
with "default y".  The first thing we need to do is to create an entry
like follows:

  config FOO
  bool "foo"
  default y

So, CONFIG_FOO=y will be set in the .config for every defconfig.

Commit 7740f653e6b3 ("moveconfig: Ignore duplicate configs when
moving") introduced KCONFIG_IGNORE_DUPLICATES to fix the false
negative (= boards that should be converted to "=y" are misconverted
to "not set") problem.  With that commit, the CONFIGs in the .config
are now duplicated to include/autoconf.mk unless they are defined to
a different value or #undef'ed in the board header.  It causes false
positive problem this time; boards without #define/#undef CONFIG_FOO
in their header should be converted to "not set", but misconverted
to "=y" actually.

This commit intends to handle such cases correctly.  Anyway, we need
to create a Kconfig entry beforehand to persevere savedefconfig.
But, we do not want to propagate CONFIGs coming from "default y"
to the include/autoconf.mk.  To achieve it, the new option --undef
is here!

We can move bool option with default y in this way:
 1. create an entry in Kconfig
 2. run "tools/moveconfig.py --undef=CONFIG_FOO CONFIG_FOO"

This option can appear multiple times in the command line, so that
we can move multiple options at a time.

Signed-off-by: Masahiro Yamada 
---

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

diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf
index 01a739d..57c6e9f 100644
--- a/scripts/Makefile.autoconf
+++ b/scripts/Makefile.autoconf
@@ -39,7 +39,8 @@ UBOOTINCLUDE:= \
-include $(srctree)/include/linux/kconfig.h
 
 c_flags := $(KBUILD_CFLAGS) $(KBUILD_CPPFLAGS) $(PLATFORM_CPPFLAGS) \
-   $(UBOOTINCLUDE) $(NOSTDINC_FLAGS)
+   $(UBOOTINCLUDE) $(NOSTDINC_FLAGS) \
+   $(KBUILD_MOVECONFIG_FLAGS)
 
 quiet_cmd_autoconf_dep = GEN $@
   cmd_autoconf_dep = $(CC) -x c -DDO_DEPS_ONLY -M -MP $(c_flags) \
diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 7ff6e71..b509f49 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -74,6 +74,27 @@ 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 to move bool option with 'default y'?
+-
+
+Moving bool options with 'default y' is a bit tricky.  In general use
+of this tool, CONFIGs set in the .config are all duplicated to the
+include/autoconf.mk, that is, CONFIGs with 'default y' Kconfig entry
+will squelch the defines that came from the board header.  In order to
+know whether the board header defined those CONFIGs or not, you must
+stop the target CONFIGs from being propagated to the include/autoconf.mk.
+The option -U (--undef) can be used to do this.
+
+For example, if you want to move CONFIG_FOO and make it an option with
+'default y', you need to do create an entry in Kconfig
+
+  config FOO
+  bool "foo"
+  default y
+
+and then run
+
+  $ tools/moveconfig.py -U CONFIG_FOO CONFIG_FOO
 
 How does it work?
 -
@@ -134,6 +155,10 @@ Available options
Specify the number of threads to run simultaneously.  If not specified,
the number of threads is the same as the number of CPU cores.
 
+ -U, --undef
+   Undefine the given CONFIG option when generating include/autoconf.mk.
+   This is generally useful to move a boolean option with "default y".
+
  -v, --verbose
Show any build errors as boards are built
 
@@ -569,6 +594,13 @@ class Slot:
 self.state = STATE_IDLE
 self.failed_boards = []
 
+if options.undef:
+undef_path = os.path.join(self.build_dir, 'undef.h')
+with open(undef_path, 'w') as f:
+for config in options.undef:
+f.write('#undef %s\n' % config)
+self.make_cmd += ("KBUILD_MOVECONFIG_FLAGS=-include %s" % 
undef_path, )
+
 def __del__(self):
 """Delete the working directory
 
@@ -838,6 +870,9 @@ def main():
   help='only cleanup the headers')
 parser.add_option('-j', '--jobs', type='int', default=cpu_count,
   help='the number of jobs to run simultaneously')
+parser.add_option('-U', '--undef', action='append', default=[],
+  

[U-Boot] [PATCH 18/21] tools: moveconfig: report when CONFIGs are removed by savedefconfig

2016-05-18 Thread Masahiro Yamada
This is a rare case, but there is still possibility that some CONFIG
is moved to the .config, but it is removed by "make savedefconfig".
(For example, it happens when the specified CONFIG has no prompt in
the Kconfig entry, i.e. it is not user-configurable.)

It might be an unexpected case.  So, display the log in this case
(in yellow color to gain user's attention if --color option is given).

Signed-off-by: Masahiro Yamada 
---

 tools/moveconfig.py | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 80542c5..9c73b30 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -432,6 +432,7 @@ class KconfigParser:
 self.autoconf = os.path.join(build_dir, 'include', 'autoconf.mk')
 self.config_autoconf = os.path.join(build_dir, 'include', 'config',
 'auto.conf')
+self.defconfig = os.path.join(build_dir, 'defconfig')
 
 def get_cross_compile(self):
 """Parse .config file and return CROSS_COMPILE.
@@ -564,11 +565,35 @@ class KconfigParser:
 f.write(value + '\n')
 updated = True
 
+self.results = results
 os.remove(self.config_autoconf)
 os.remove(self.autoconf)
 
 return (updated, log)
 
+def check_defconfig(self):
+"""Check the defconfig after savedefconfig
+
+Returns:
+  Return additional log if moved CONFIGs were removed again by
+  'make savedefconfig'.
+"""
+
+log = ''
+
+with open(self.defconfig) as f:
+defconfig_lines = f.readlines()
+
+for (action, value) in self.results:
+if action != ACTION_MOVE:
+continue
+if not value + '\n' in defconfig_lines:
+log += color_text(self.options.color, COLOR_YELLOW,
+  "'%s' was removed by savedefconfig.\n" %
+  value)
+
+return log
+
 class Slot:
 
 """A slot to store a subprocess.
@@ -691,6 +716,7 @@ class Slot:
 return False
 
 if self.state == STATE_SAVEDEFCONFIG:
+self.log += self.parser.check_defconfig()
 if not self.options.dry_run:
 shutil.move(os.path.join(self.build_dir, 'defconfig'),
 os.path.join('configs', self.defconfig))
-- 
1.9.1

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


[U-Boot] [PATCH 21/21] tools: moveconfig: allow to run without any CONFIG specified

2016-05-18 Thread Masahiro Yamada
I found "tools/moveconfig -s" might be useful for defconfig re-sync.
I could optimize it for re-sync if I wanted, but I do not want to
make the code complex for this feature.

Signed-off-by: Masahiro Yamada 
---

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

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index acc3dbb..a9f7c50 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -871,10 +871,13 @@ def move_config(configs, options):
   options: option flags
 """
 if len(configs) == 0:
-print 'Nothing to do. exit.'
-sys.exit(0)
-
-print 'Move %s (jobs: %d)' % (', '.join(configs), options.jobs)
+if options.force_sync:
+print 'No CONFIG is specified. You are probably syncing 
defconfigs.',
+else:
+print 'Neigher CONFIG nor --force-sync is specified. Nothing will 
happen.',
+else:
+print 'Move ' + ', '.join(configs),
+print '(jobs: %d)\n' % options.jobs
 
 if options.defconfigs:
 defconfigs = [line.strip() for line in open(options.defconfigs)]
@@ -944,7 +947,7 @@ def main():
 
 (options, configs) = parser.parse_args()
 
-if len(configs) == 0:
+if len(configs) == 0 and not options.force_sync:
 parser.print_usage()
 sys.exit(1)
 
-- 
1.9.1

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


[U-Boot] [PATCH 07/21] tools: moveconfig: increment number of processed files monotonically

2016-05-18 Thread Masahiro Yamada
Currently, the progress " * defconfigs out of 1133" does not increase
monotonically.

Moreover, the number of processed defconfigs does not match the total
number of defconfigs when this tool finishes, like:

 1132 defconfigs out of 1133
Clean up headers? [y/n]:

It looks like the task was not completed, and some users might feel
upset about it.

Signed-off-by: Masahiro Yamada 
---

 tools/moveconfig.py | 65 -
 1 file changed, 49 insertions(+), 16 deletions(-)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 3da4726..5e78266 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -388,6 +388,29 @@ def cleanup_headers(config_attrs, dry_run):
patterns, dry_run)
 
 ### classes ###
+class Progress:
+
+"""Progress Indicator"""
+
+def __init__(self, total):
+"""Create a new progress indicator.
+
+Arguments:
+  total: A number of defconfig files to process.
+"""
+self.current = 0
+self.total = total
+
+def inc(self):
+"""Increment the number of processed defconfig files."""
+
+self.current += 1
+
+def show(self):
+"""Display the progress."""
+print ' %d defconfigs out of %d\r' % (self.current, self.total),
+sys.stdout.flush()
+
 class KconfigParser:
 
 """A parser of .config and include/autoconf.mk."""
@@ -395,17 +418,19 @@ class KconfigParser:
 re_arch = re.compile(r'CONFIG_SYS_ARCH="(.*)"')
 re_cpu = re.compile(r'CONFIG_SYS_CPU="(.*)"')
 
-def __init__(self, config_attrs, options, build_dir):
+def __init__(self, config_attrs, options, progress, build_dir):
 """Create a new parser.
 
 Arguments:
   config_attrs: A list of dictionaris, each of them includes the name,
 the type, and the default value of the target config.
   options: option flags.
+  progress: A progress indicator
   build_dir: Build directory.
 """
 self.config_attrs = config_attrs
 self.options = options
+self.progress = progress
 self.build_dir = build_dir
 
 def get_cross_compile(self):
@@ -541,6 +566,7 @@ class KconfigParser:
 # Some threads are running in parallel.
 # Print log in one shot to not mix up logs from different threads.
 print log,
+self.progress.show()
 
 with open(dotconfig_path, 'a') as f:
 for (action, value) in results:
@@ -559,21 +585,24 @@ class Slot:
 for faster processing.
 """
 
-def __init__(self, config_attrs, options, devnull, make_cmd):
+def __init__(self, config_attrs, options, progress, devnull, make_cmd):
 """Create a new process slot.
 
 Arguments:
   config_attrs: A list of dictionaris, each of them includes the name,
 the type, and the default value of the target config.
   options: option flags.
+  progress: A progress indicator.
   devnull: A file object of '/dev/null'.
   make_cmd: command name of GNU Make.
 """
 self.options = options
+self.progress = progress
 self.build_dir = tempfile.mkdtemp()
 self.devnull = devnull
 self.make_cmd = (make_cmd, 'O=' + self.build_dir)
-self.parser = KconfigParser(config_attrs, options, self.build_dir)
+self.parser = KconfigParser(config_attrs, options, progress,
+self.build_dir)
 self.state = STATE_IDLE
 self.failed_boards = []
 
@@ -592,7 +621,7 @@ class Slot:
 pass
 shutil.rmtree(self.build_dir)
 
-def add(self, defconfig, num, total):
+def add(self, defconfig):
 """Assign a new subprocess for defconfig and add it to the slot.
 
 If the slot is vacant, create a new subprocess for processing the
@@ -613,8 +642,6 @@ class Slot:
stderr=subprocess.PIPE)
 self.defconfig = defconfig
 self.state = STATE_DEFCONFIG
-self.num = num
-self.total = total
 return True
 
 def poll(self):
@@ -643,6 +670,8 @@ class Slot:
 print >> sys.stderr, color_text(self.options.color,
 COLOR_LIGHT_CYAN,
 self.ps.stderr.read())
+self.progress.inc()
+self.progress.show()
 if self.options.exit_on_error:
 sys.exit("Exit on error.")
 # If --exit-on-error flag is not set, skip this board and continue.
@@ -654,9 +683,6 @@ class Slot:
 if self.state == STATE_AUTOCONF:
 self.parser.update_dotconfig(self.defconfig)
 
-print ' %d defconfigs out of %d\r' % (self.num + 1, self.total),
-sys.stdout.flush()
-
 """Save off the defconfig in a consistent way""

[U-Boot] [PATCH 08/21] tools: moveconfig: do not rely on type and default value given by users

2016-05-18 Thread Masahiro Yamada
Commit 96464badc794 ("moveconfig: Always run savedefconfig on the
moved config") changed the work flow of this tool a lot from the
original intention when this tool was designed first.

Since then, before running this tool, users must edit the Kconfig to
add the menu entries for the configs they are moving.  It means users
had already specified the type and the default value for each CONFIG
via the Kconfig entries.  Nevertheless, users are still required to
dictate the same type and the default value in each line of the input
file.  So, my idea here is to deprecate the latter.

Before moving forward with it, there is one thing worth mentioning;
since the savedefconfig re-sync was introduced, there is a case this
tool can not handle correctly.

Let's say we are moving CONFIG_FOO from board headers to Kconfig,
and we want to make it "default y" option.  First, we are supposed
to create an entry:

  config FOO
  bool "foo"
  default y

CONFIG_FOO=y will appear in the .config for every processed defconfig.
It will be duplicated to the include/autoconf.mk as well unless the
board explicitly #undef's it.  Therefore, the defconfig without
"#define CONFIG_FOO" or "#undef CONFIG_FOO" that should be converted
to "unset" would be misconverted to "=y".

Anyway, this has been a problem for a while.  Yet, I am not inclined
to revert that commit because the "create a Kconfig entry beforehand,
and sync with savedefconfig" approach has been successful in practical
use cases.  I will come back to this problem with a different solution
in a few commits later.

For other use cases, I see no reason to require redundant dictation
in the input file of this tool.  Instead, the tool can know the types
and default values by parsing the .config file.

This commit changes the tool to use the CONFIG names, but ignore the
types and default values given by the input file.

This commit also fixes one bug.  Before this commit, the tool could
not move a integer-typed CONFIG with value 1.

For example, assume we are moving CONFIG_CONS_INDEX.  Please note
this is a integer type option.

Many board headers define this CONFIG as 1.

  #define CONFIG_CONS_INDEX1

It will be converted to

  CONFIG_CONS_INDEX=y

and moved to include/autoconf.mk, by the tools/scripts/define2mk.sed.
It will cause "make savedefconfig" to fail due to the type conflict.

This commit takes care of it by detecting the type and converting the
CONFIG value correctly.

Signed-off-by: Masahiro Yamada 
---

 tools/moveconfig.py | 88 ++---
 1 file changed, 43 insertions(+), 45 deletions(-)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 5e78266..ee0afbd 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -70,13 +70,17 @@ 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.
+ - CONFIG_... is not defined in Kconfig.  Do nothing.
+   The entry for this CONFIG was not found in Kconfig.
+   There are two common cases:
+ - You forgot to create an entry for the CONFIG before running
+   this tool, or made a typo in a CONFIG passed to this tool.
+ - The entry was hidden due to unmet 'depends on'.
+   This is correct behavior.
+
+ - 'CONFIG_...' is the same as the define in Kconfig.  Do nothing.
+   The define in the config header matched the one in Kconfig.
+   We do not need to touch it.
 
  - Undefined.  Do nothing.
This config option was not found in the config header.
@@ -216,9 +220,8 @@ STATE_AUTOCONF = 2
 STATE_SAVEDEFCONFIG = 3
 
 ACTION_MOVE = 0
-ACTION_DEFAULT_VALUE = 1
-ACTION_ALREADY_EXIST = 2
-ACTION_UNDEFINED = 3
+ACTION_NO_ENTRY = 1
+ACTION_NO_CHANGE = 2
 
 COLOR_BLACK= '0;30'
 COLOR_RED  = '0;31'
@@ -464,7 +467,7 @@ class KconfigParser:
 
 return CROSS_COMPILE.get(arch, None)
 
-def parse_one_config(self, config_attr, defconfig_lines, autoconf_lines):
+def parse_one_config(self, config_attr, dotconfig_lines, autoconf_lines):
 """Parse .config, defconfig, include/autoconf.mk for one config.
 
 This function looks for the config options in the lines from
@@ -474,7 +477,7 @@ class KconfigParser:
 Arguments:
   config_attr: A dictionary including the name, the type,
and the default value of the target config.
-  defconfig_lines: lines from the original defconfig file.
+  dotconfig_lines: lines from the .config file.
   autoconf_lines: lines from the include/autoconf.mk file.
 
 Returns:
@@ -484,42 +487,40 @@ class KconfigParser:
 config = config_attr['config']
 not_set = '# %s is no

[U-Boot] [PATCH 09/21] tools: moveconfig: drop code for handling type and default value

2016-05-18 Thread Masahiro Yamada
Now types and defalut values given by the input file are just
ignored.  Delete unnecessary code.

Signed-off-by: Masahiro Yamada 
---

 tools/moveconfig.py | 105 +++-
 1 file changed, 29 insertions(+), 76 deletions(-)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index ee0afbd..c452c7a 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -360,12 +360,11 @@ def cleanup_one_header(header_path, patterns, dry_run):
 if not i in matched:
 f.write(line)
 
-def cleanup_headers(config_attrs, dry_run):
+def cleanup_headers(configs, dry_run):
 """Delete config defines from board headers.
 
 Arguments:
-  config_attrs: A list of dictionaris, each of them includes the name,
-the type, and the default value of the target config.
+  configs: A list of CONFIGs to remove.
   dry_run: make no changes, but still display log.
 """
 while True:
@@ -378,8 +377,7 @@ def cleanup_headers(config_attrs, dry_run):
 return
 
 patterns = []
-for config_attr in config_attrs:
-config = config_attr['config']
+for config in configs:
 patterns.append(re.compile(r'#\s*define\s+%s\W' % config))
 patterns.append(re.compile(r'#\s*undef\s+%s\W' % config))
 
@@ -421,17 +419,16 @@ class KconfigParser:
 re_arch = re.compile(r'CONFIG_SYS_ARCH="(.*)"')
 re_cpu = re.compile(r'CONFIG_SYS_CPU="(.*)"')
 
-def __init__(self, config_attrs, options, progress, build_dir):
+def __init__(self, configs, options, progress, build_dir):
 """Create a new parser.
 
 Arguments:
-  config_attrs: A list of dictionaris, each of them includes the name,
-the type, and the default value of the target config.
+  configs: A list of CONFIGs to move.
   options: option flags.
   progress: A progress indicator
   build_dir: Build directory.
 """
-self.config_attrs = config_attrs
+self.configs = configs
 self.options = options
 self.progress = progress
 self.build_dir = build_dir
@@ -467,7 +464,7 @@ class KconfigParser:
 
 return CROSS_COMPILE.get(arch, None)
 
-def parse_one_config(self, config_attr, dotconfig_lines, autoconf_lines):
+def parse_one_config(self, config, dotconfig_lines, autoconf_lines):
 """Parse .config, defconfig, include/autoconf.mk for one config.
 
 This function looks for the config options in the lines from
@@ -475,8 +472,7 @@ class KconfigParser:
 which action should be taken for this defconfig.
 
 Arguments:
-  config_attr: A dictionary including the name, the type,
-   and the default value of the target config.
+  config: CONFIG name to parse.
   dotconfig_lines: lines from the .config file.
   autoconf_lines: lines from the include/autoconf.mk file.
 
@@ -484,7 +480,6 @@ class KconfigParser:
   A tupple of the action for this defconfig and the line
   matched for the config.
 """
-config = config_attr['config']
 not_set = '# %s is not set' % config
 
 for line in dotconfig_lines:
@@ -538,8 +533,8 @@ class KconfigParser:
 with open(autoconf_path) as f:
 autoconf_lines = f.readlines()
 
-for config_attr in self.config_attrs:
-result = self.parse_one_config(config_attr, dotconfig_lines,
+for config in self.configs:
+result = self.parse_one_config(config, dotconfig_lines,
autoconf_lines)
 results.append(result)
 
@@ -583,12 +578,11 @@ class Slot:
 for faster processing.
 """
 
-def __init__(self, config_attrs, options, progress, devnull, make_cmd):
+def __init__(self, configs, options, progress, devnull, make_cmd):
 """Create a new process slot.
 
 Arguments:
-  config_attrs: A list of dictionaris, each of them includes the name,
-the type, and the default value of the target config.
+  configs: A list of CONFIGs to move.
   options: option flags.
   progress: A progress indicator.
   devnull: A file object of '/dev/null'.
@@ -599,8 +593,7 @@ class Slot:
 self.build_dir = tempfile.mkdtemp()
 self.devnull = devnull
 self.make_cmd = (make_cmd, 'O=' + self.build_dir)
-self.parser = KconfigParser(config_attrs, options, progress,
-self.build_dir)
+self.parser = KconfigParser(configs, options, progress, self.build_dir)
 self.state = STATE_IDLE
 self.failed_boards = []
 
@@ -731,12 +724,11 @@ class Slots:
 
 """Controller of the array of subprocess slots."""
 
-def __init__(self, config_attrs, options, progress):
+def __init__(self, configs, options, progress):
 """Create 

[U-Boot] [PATCH 13/21] tools: moveconfig: move log output code out of Kconfig Parser class

2016-05-18 Thread Masahiro Yamada
This will help further improvement/clean-up.

Signed-off-by: Masahiro Yamada 
---

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

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 9f38a08..96ada0d 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -416,18 +416,16 @@ class KconfigParser:
 re_arch = re.compile(r'CONFIG_SYS_ARCH="(.*)"')
 re_cpu = re.compile(r'CONFIG_SYS_CPU="(.*)"')
 
-def __init__(self, configs, options, progress, build_dir):
+def __init__(self, configs, options, build_dir):
 """Create a new parser.
 
 Arguments:
   configs: A list of CONFIGs to move.
   options: option flags.
-  progress: A progress indicator
   build_dir: Build directory.
 """
 self.configs = configs
 self.options = options
-self.progress = progress
 self.dotconfig = os.path.join(build_dir, '.config')
 self.autoconf = os.path.join(build_dir, 'include', 'autoconf.mk')
 self.config_autoconf = os.path.join(build_dir, 'include', 'config',
@@ -516,10 +514,12 @@ class KconfigParser:
 This function parses the generated .config and include/autoconf.mk
 searching the target options.
 Move the config option(s) to the .config as needed.
-Also, display the log to show what happened to the .config.
 
 Arguments:
   defconfig: defconfig name.
+
+Returns:
+  Return log string
 """
 
 results = []
@@ -553,11 +553,6 @@ class KconfigParser:
 
 log += log_msg(self.options.color, log_color, defconfig, actlog)
 
-# Some threads are running in parallel.
-# Print log in one shot to not mix up logs from different threads.
-print log,
-self.progress.show()
-
 with open(self.dotconfig, 'a') as f:
 for (action, value) in results:
 if action == ACTION_MOVE:
@@ -566,6 +561,8 @@ class KconfigParser:
 os.remove(self.config_autoconf)
 os.remove(self.autoconf)
 
+return log
+
 class Slot:
 
 """A slot to store a subprocess.
@@ -590,7 +587,7 @@ class Slot:
 self.build_dir = tempfile.mkdtemp()
 self.devnull = devnull
 self.make_cmd = (make_cmd, 'O=' + self.build_dir)
-self.parser = KconfigParser(configs, options, progress, self.build_dir)
+self.parser = KconfigParser(configs, options, self.build_dir)
 self.state = STATE_IDLE
 self.failed_boards = []
 
@@ -676,7 +673,7 @@ class Slot:
 return True
 
 if self.state == STATE_AUTOCONF:
-self.parser.update_dotconfig(self.defconfig)
+self.log = self.parser.update_dotconfig(self.defconfig)
 
 """Save off the defconfig in a consistent way"""
 cmd = list(self.make_cmd)
@@ -690,7 +687,11 @@ class Slot:
 if not self.options.dry_run:
 shutil.move(os.path.join(self.build_dir, 'defconfig'),
 os.path.join('configs', self.defconfig))
+# Some threads are running in parallel.
+# Print log in one shot to not mix up logs from different threads.
+print self.log,
 self.progress.inc()
+self.progress.show()
 self.state = STATE_IDLE
 return True
 
@@ -844,7 +845,6 @@ def move_config(configs, options):
 while not slots.empty():
 time.sleep(SLEEP_TIME)
 
-progress.show()
 print ''
 slots.show_failed_boards()
 
-- 
1.9.1

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


[U-Boot] [PATCH 02/21] tools: moveconfig: rename update_defconfig() to update_dotconfig()

2016-05-18 Thread Masahiro Yamada
Commit 96464badc794 ("moveconfig: Always run savedefconfig on the
moved config") changed how defconfig files were updated.

Since then, the function update_defconfig() does not modify defconfig
files at all (instead, they are updated by "make savedefconfig").

The name update_dotconfig() is a better fit for this function.
Also, update the comment block to match the actual behavior.

Signed-off-by: Masahiro Yamada 
---

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

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index fd98e41..9029287 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -459,13 +459,13 @@ class KconfigParser:
 
 return (action, value)
 
-def update_defconfig(self, defconfig):
-"""Parse files for the config options and update the defconfig.
+def update_dotconfig(self, defconfig):
+"""Parse files for the config options and update the .config.
 
 This function parses the given defconfig, the generated .config
 and include/autoconf.mk searching the target options.
-Move the config option(s) to the defconfig or do nothing if unneeded.
-Also, display the log to show what happened to this defconfig.
+Move the config option(s) to the .config as needed.
+Also, display the log to show what happened to the .config.
 
 Arguments:
   defconfig: defconfig name.
@@ -632,7 +632,7 @@ class Slot:
 return True
 
 if self.state == STATE_AUTOCONF:
-self.parser.update_defconfig(self.defconfig)
+self.parser.update_dotconfig(self.defconfig)
 
 print ' %d defconfigs out of %d\r' % (self.num + 1, self.total),
 sys.stdout.flush()
-- 
1.9.1

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


[U-Boot] [PATCH 03/21] tools: moveconfig: remove redundant else: after sys.exit()

2016-05-18 Thread Masahiro Yamada
Nesting by "else:" is not generally useful after such statements
as return, break, and sys.exit(), etc.

Signed-off-by: Masahiro Yamada 
---

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

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 9029287..1332bd2 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -623,13 +623,11 @@ class Slot:
 COLOR_LIGHT_CYAN, errout)
 if self.options.exit_on_error:
 sys.exit("Exit on error.")
-else:
-# If --exit-on-error flag is not set,
-# skip this board and continue.
-# Record the failed board.
-self.failed_boards.append(self.defconfig)
-self.state = STATE_IDLE
-return True
+# If --exit-on-error flag is not set, skip this board and continue.
+# Record the failed board.
+self.failed_boards.append(self.defconfig)
+self.state = STATE_IDLE
+return True
 
 if self.state == STATE_AUTOCONF:
 self.parser.update_dotconfig(self.defconfig)
-- 
1.9.1

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


[U-Boot] [PATCH 06/21] tools: moveconfig: exit with error message for not clean directory

2016-05-18 Thread Masahiro Yamada
When the source tree is not clean, this tool raises an exception
with a message like follows:

Traceback (most recent call last):
  File "tools/moveconfig.py", line 939, in 
main()
  File "tools/moveconfig.py", line 934, in main
move_config(config_attrs, options)
  File "tools/moveconfig.py", line 808, in move_config
while not slots.available():
  File "tools/moveconfig.py", line 733, in available
if slot.poll():
  File "tools/moveconfig.py", line 645, in poll
self.parser.update_dotconfig(self.defconfig)
  File "tools/moveconfig.py", line 503, in update_dotconfig
with open(autoconf_path) as f:
IOError: [Errno 2] No such file or directory: 
'/tmp/tmpDtzCgl/include/autoconf.mk'

This does not explain clearly what is wrong.  Show an appropriate
error message "srctree is not clean, please run 'make mrproper'"
in such a situation.

Signed-off-by: Masahiro Yamada 
---

 tools/moveconfig.py | 8 
 1 file changed, 8 insertions(+)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 7e916c2..3da4726 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -252,6 +252,12 @@ def check_top_directory():
 if not os.path.exists(f):
 sys.exit('Please run at the top of source directory.')
 
+def check_clean_directory():
+"""Exit if the source tree is not clean."""
+for f in ('.config', 'include/config'):
+if os.path.exists(f):
+sys.exit("srctree is not clean, please run 'make mrproper'")
+
 def get_make_cmd():
 """Get the command name of GNU Make.
 
@@ -932,6 +938,8 @@ def main():
 
 check_top_directory()
 
+check_clean_directory()
+
 update_cross_compile(options.color)
 
 if not options.cleanup_headers_only:
-- 
1.9.1

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


[U-Boot] [PATCH 12/21] tools: moveconfig: compute file paths just once

2016-05-18 Thread Masahiro Yamada
The paths to .config, include/autoconf.mk, include/config/auto.conf
are not changed during the defconfig walk.  Compute them only once
when a new class instance is created.

Signed-off-by: Masahiro Yamada 
---

 tools/moveconfig.py | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index b509f49..9f38a08 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -428,7 +428,10 @@ class KconfigParser:
 self.configs = configs
 self.options = options
 self.progress = progress
-self.build_dir = build_dir
+self.dotconfig = os.path.join(build_dir, '.config')
+self.autoconf = os.path.join(build_dir, 'include', 'autoconf.mk')
+self.config_autoconf = os.path.join(build_dir, 'include', 'config',
+'auto.conf')
 
 def get_cross_compile(self):
 """Parse .config file and return CROSS_COMPILE.
@@ -442,8 +445,7 @@ class KconfigParser:
 """
 arch = ''
 cpu = ''
-dotconfig = os.path.join(self.build_dir, '.config')
-for line in open(dotconfig):
+for line in open(self.dotconfig):
 m = self.re_arch.match(line)
 if m:
 arch = m.group(1)
@@ -520,14 +522,12 @@ class KconfigParser:
   defconfig: defconfig name.
 """
 
-dotconfig_path = os.path.join(self.build_dir, '.config')
-autoconf_path = os.path.join(self.build_dir, 'include', 'autoconf.mk')
 results = []
 
-with open(dotconfig_path) as f:
+with open(self.dotconfig) as f:
 dotconfig_lines = f.readlines()
 
-with open(autoconf_path) as f:
+with open(self.autoconf) as f:
 autoconf_lines = f.readlines()
 
 for config in self.configs:
@@ -558,13 +558,13 @@ class KconfigParser:
 print log,
 self.progress.show()
 
-with open(dotconfig_path, 'a') as f:
+with open(self.dotconfig, 'a') as f:
 for (action, value) in results:
 if action == ACTION_MOVE:
 f.write(value + '\n')
 
-os.remove(os.path.join(self.build_dir, 'include', 'config', 
'auto.conf'))
-os.remove(autoconf_path)
+os.remove(self.config_autoconf)
+os.remove(self.autoconf)
 
 class Slot:
 
-- 
1.9.1

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


[U-Boot] [PATCH 15/21] tools: moveconfig: refactor code to go back to idle state

2016-05-18 Thread Masahiro Yamada
Move similar code to finish() function.

Signed-off-by: Masahiro Yamada 
---

 tools/moveconfig.py | 37 +
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index cf4004f..da7120d 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -664,13 +664,7 @@ class Slot:
 if self.options.verbose:
 self.log += color_text(self.options.color, COLOR_LIGHT_CYAN,
self.ps.stderr.read())
-self.show_log(sys.stderr)
-if self.options.exit_on_error:
-sys.exit("Exit on error.")
-# If --exit-on-error flag is not set, skip this board and continue.
-# Record the failed board.
-self.failed_boards.append(self.defconfig)
-self.state = STATE_IDLE
+self.finish(False)
 return True
 
 if self.state == STATE_AUTOCONF:
@@ -688,21 +682,14 @@ class Slot:
 if not self.options.dry_run:
 shutil.move(os.path.join(self.build_dir, 'defconfig'),
 os.path.join('configs', self.defconfig))
-self.show_log()
-self.state = STATE_IDLE
+self.finish(True)
 return True
 
 self.cross_compile = self.parser.get_cross_compile()
 if self.cross_compile is None:
 self.log += color_text(self.options.color, COLOR_YELLOW,
"Compiler is missing.  Do nothing.\n")
-self.show_log(sys.stderr)
-if self.options.exit_on_error:
-sys.exit("Exit on error.")
-# If --exit-on-error flag is not set, skip this board and continue.
-# Record the failed board.
-self.failed_boards.append(self.defconfig)
-self.state = STATE_IDLE
+self.finish(False)
 return True
 
 cmd = list(self.make_cmd)
@@ -715,11 +702,12 @@ class Slot:
 self.state = STATE_AUTOCONF
 return False
 
-def show_log(self, file=sys.stdout):
-"""Display log along with progress.
+def finish(self, success):
+"""Display log along with progress and go to the idle state.
 
 Arguments:
-  file: A file object to which the log string is sent.
+  success: Should be True when the defconfig was processed
+   successfully, or False when it fails.
 """
 # output at least 30 characters to hide the "* defconfigs out of *".
 log = self.defconfig.ljust(30) + '\n'
@@ -727,9 +715,18 @@ class Slot:
 log += '\n'.join([ '' + s for s in self.log.split('\n') ])
 # Some threads are running in parallel.
 # Print log atomically to not mix up logs from different threads.
-print >> file, log
+print >> (sys.stdout if success else sys.stderr), log
+
+if not success:
+if self.options.exit_on_error:
+sys.exit("Exit on error.")
+# If --exit-on-error flag is not set, skip this board and continue.
+# Record the failed board.
+self.failed_boards.append(self.defconfig)
+
 self.progress.inc()
 self.progress.show()
+self.state = STATE_IDLE
 
 def get_failed_boards(self):
 """Returns a list of failed boards (defconfigs) in this slot.
-- 
1.9.1

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


[U-Boot] [PATCH 01/21] tools: moveconfig: fix --dry-run option

2016-05-18 Thread Masahiro Yamada
Since commit 96464badc794 ("moveconfig: Always run savedefconfig on
the moved config"), --dry-run option is broken.

The --dry-run option prevents the .config from being modified,
but defconfig files might be updated by "make savedefconfig"
regardless of the --dry-run option.

Move the "if not self.options.dry_run" conditional to the correct
place.

Fixes 96464badc794 ("moveconfig: Always run savedefconfig on the moved config")
Signed-off-by: Masahiro Yamada 

---

 tools/moveconfig.py | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 68631b7..fd98e41 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -511,11 +511,10 @@ class KconfigParser:
 # Print log in one shot to not mix up logs from different threads.
 print log,
 
-if not self.options.dry_run:
-with open(dotconfig_path, 'a') as f:
-for (action, value) in results:
-if action == ACTION_MOVE:
-f.write(value + '\n')
+with open(dotconfig_path, 'a') as f:
+for (action, value) in results:
+if action == ACTION_MOVE:
+f.write(value + '\n')
 
 os.remove(os.path.join(self.build_dir, 'include', 'config', 
'auto.conf'))
 os.remove(autoconf_path)
@@ -647,9 +646,9 @@ class Slot:
 return False
 
 if self.state == STATE_SAVEDEFCONFIG:
-defconfig_path = os.path.join(self.build_dir, 'defconfig')
-shutil.move(defconfig_path,
-os.path.join('configs', self.defconfig))
+if not self.options.dry_run:
+shutil.move(os.path.join(self.build_dir, 'defconfig'),
+os.path.join('configs', self.defconfig))
 self.state = STATE_IDLE
 return True
 
-- 
1.9.1

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


[U-Boot] [PATCH 16/21] tools: moveconfig: skip savedefconfig if .config was not updated

2016-05-18 Thread Masahiro Yamada
If no CONFIG option is moved to the .config, no need to sync the
defconfig file.  This accelerates the processing by skipping
unneeded "make savedefconfig".

Signed-off-by: Masahiro Yamada 
---

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

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index da7120d..cb26b14 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -521,10 +521,13 @@ class KconfigParser:
   defconfig: defconfig name.
 
 Returns:
-  Return log string
+  Return a tuple of (updated flag, log string).
+  The "updated flag" is True if the .config was updated, False
+  otherwise.  The "log string" shows what happend to the .config.
 """
 
 results = []
+updated = False
 
 with open(self.dotconfig) as f:
 dotconfig_lines = f.readlines()
@@ -559,11 +562,12 @@ class KconfigParser:
 for (action, value) in results:
 if action == ACTION_MOVE:
 f.write(value + '\n')
+updated = True
 
 os.remove(self.config_autoconf)
 os.remove(self.autoconf)
 
-return log
+return (updated, log)
 
 class Slot:
 
@@ -646,8 +650,11 @@ class Slot:
 If the configuration is successfully finished, assign a new
 subprocess to build include/autoconf.mk.
 If include/autoconf.mk is generated, invoke the parser to
-parse the .config and the include/autoconf.mk, and then set the
-slot back to the idle state.
+parse the .config and the include/autoconf.mk, moving
+config options to the .config as needed.
+If the .config was updated, run "make savedefconfig" to sync
+it, update the original defconfig, and then set the slot back
+to the idle state.
 
 Returns:
   Return True if the subprocess is terminated, False otherwise
@@ -668,8 +675,12 @@ class Slot:
 return True
 
 if self.state == STATE_AUTOCONF:
-self.log += self.parser.update_dotconfig()
+(updated, log) = self.parser.update_dotconfig()
+self.log += log
 
+if not updated:
+self.finish(True)
+return True
 """Save off the defconfig in a consistent way"""
 cmd = list(self.make_cmd)
 cmd.append('savedefconfig')
-- 
1.9.1

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


[U-Boot] [PATCH 14/21] tools: moveconfig: display log atomically in more readable format

2016-05-18 Thread Masahiro Yamada
Before this commit, the log was displayed in the format:

   : 
   : 
   : 

When we move multiple CONFIGs at the same time, we see as many
 strings as actions for every defconfig, which is
redundant information.

Moreover, since normal log and error log are displayed separately,
Messages from different threads could be mixed, like this:

  : 
  : 
  : 
  : 
  : 

This commit makes sure to call "print" once a defconfig, which
enables atomic logging for each defconfig.  It also makes it
possible to refactor the log format as follows:










Signed-off-by: Masahiro Yamada 
---

 tools/moveconfig.py | 73 ++---
 1 file changed, 42 insertions(+), 31 deletions(-)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 96ada0d..cf4004f 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -30,13 +30,17 @@ The tool walks through all the defconfig files and move the 
given CONFIGs.
 
 The log is also displayed on the terminal.
 
-Each line is printed in the format
-   :  
+The log is printed for each defconfig as follows:
 
- is the name of the defconfig
-(without the suffix _defconfig).
+
+
+
+
+...
 
- shows what the tool did for that defconfig.
+ is the name of the defconfig.
+
+ shows what the tool did for that defconfig.
 It looks like one of the followings:
 
  - Move 'CONFIG_... '
@@ -274,15 +278,13 @@ def get_make_cmd():
 def color_text(color_enabled, color, string):
 """Return colored string."""
 if color_enabled:
-return '\033[' + color + 'm' + string + '\033[0m'
+# LF should not be surrounded by the escape sequence.
+# Otherwise, additional whitespace or line-feed might be printed.
+return '\n'.join([ '\033[' + color + 'm' + s + '\033[0m' if s else ''
+   for s in string.split('\n') ])
 else:
 return string
 
-def log_msg(color_enabled, color, defconfig, msg):
-"""Return the formated line for the log."""
-return defconfig[:-len('_defconfig')].ljust(37) + ': ' + \
-color_text(color_enabled, color, msg) + '\n'
-
 def update_cross_compile(color_enabled):
 """Update per-arch CROSS_COMPILE via environment variables
 
@@ -508,7 +510,7 @@ class KconfigParser:
 
 return (ACTION_MOVE, new_val)
 
-def update_dotconfig(self, defconfig):
+def update_dotconfig(self):
 """Parse files for the config options and update the .config.
 
 This function parses the generated .config and include/autoconf.mk
@@ -551,7 +553,7 @@ class KconfigParser:
 else:
 sys.exit("Internal Error. This should not happen.")
 
-log += log_msg(self.options.color, log_color, defconfig, actlog)
+log += color_text(self.options.color, log_color, actlog) + '\n'
 
 with open(self.dotconfig, 'a') as f:
 for (action, value) in results:
@@ -634,6 +636,7 @@ class Slot:
stderr=subprocess.PIPE)
 self.defconfig = defconfig
 self.state = STATE_DEFCONFIG
+self.log = ''
 return True
 
 def poll(self):
@@ -656,14 +659,12 @@ class Slot:
 return False
 
 if self.ps.poll() != 0:
-print >> sys.stderr, log_msg(self.options.color, COLOR_LIGHT_RED,
- self.defconfig, "Failed to process."),
+self.log += color_text(self.options.color, COLOR_LIGHT_RED,
+   "Failed to process.\n")
 if self.options.verbose:
-print >> sys.stderr, color_text(self.options.color,
-COLOR_LIGHT_CYAN,
-self.ps.stderr.read())
-self.progress.inc()
-self.progress.show()
+self.log += color_text(self.options.color, COLOR_LIGHT_CYAN,
+   self.ps.stderr.read())
+self.show_log(sys.stderr)
 if self.options.exit_on_error:
 sys.exit("Exit on error.")
 # If --exit-on-error flag is not set, skip this board and continue.
@@ -673,7 +674,7 @@ class Slot:
 return True
 
 if self.state == STATE_AUTOCONF:
-self.log = self.parser.update_dotconfig(self.defconfig)
+self.log += self.parser.update_dotconfig()
 
 """Save off the defconfig in a consistent way"""
 cmd = list(self.make_cmd)
@@ -687,21 +688,15 @@ class Slot:
 if not self.options.dry_run:
 shutil.move(os.path.join(self.build_dir, 'defconfig'),
 os.path.join('configs', self.defconfig))
-# Some threads are running in parallel.
-# Print log in one shot to not mix up logs from different threads.
-print self.log,
-  

[U-Boot] [PATCH 05/21] tools: moveconfig: check compilers before starting defconfig walk

2016-05-18 Thread Masahiro Yamada
Since commit 25400090b1e2 ("moveconfig: Print a message for
missing compiler"), this tool parses error messages generated by
"make include/config/auto.conf" every time an error occurs in order
to detect missing compiler.

Instead of that, we can look for compilers in the PATH environment
only once before starting the defconfig walk.  If specified compilers
are missing, "make include/config/auto.conf" will apparently fail
for corresponding architectures.  So, the tool can just report
"Compiler is missing." and skip those boards.

Signed-off-by: Masahiro Yamada 
---

 tools/moveconfig.py | 71 -
 1 file changed, 48 insertions(+), 23 deletions(-)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index ce8245a..7e916c2 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -82,7 +82,12 @@ It looks like one of the followings:
This config option was not found in the config header.
Nothing to do.
 
- - Failed to process.  Skip.
+ - Compiler is missing.  Do nothing.
+   The compiler specified for this architecture was not found
+   in your PATH environment.
+   (If -e option is passed, the tool exits immediately.)
+
+ - Failed to process.
An error occurred during processing this defconfig.  Skipped.
(If -e option is passed, the tool exits immediately on error.)
 
@@ -272,7 +277,7 @@ def log_msg(color_enabled, color, defconfig, msg):
 return defconfig[:-len('_defconfig')].ljust(37) + ': ' + \
 color_text(color_enabled, color, msg) + '\n'
 
-def update_cross_compile():
+def update_cross_compile(color_enabled):
 """Update per-arch CROSS_COMPILE via environment variables
 
 The default CROSS_COMPILE values are available
@@ -286,6 +291,9 @@ def update_cross_compile():
 
 export CROSS_COMPILE_ARM=...
 export CROSS_COMPILE_POWERPC=...
+
+Then, this function checks if specified compilers really exist in your
+PATH environment.
 """
 archs = []
 
@@ -299,8 +307,20 @@ def update_cross_compile():
 for arch in archs:
 env = 'CROSS_COMPILE_' + arch.upper()
 cross_compile = os.environ.get(env)
-if cross_compile:
-CROSS_COMPILE[arch] = cross_compile
+if not cross_compile:
+cross_compile = CROSS_COMPILE.get(arch, '')
+
+for path in os.environ["PATH"].split(os.pathsep):
+gcc_path = os.path.join(path, cross_compile + 'gcc')
+if os.path.isfile(gcc_path) and os.access(gcc_path, os.X_OK):
+break
+else:
+print >> sys.stderr, color_text(color_enabled, COLOR_YELLOW,
+ 'warning: %sgcc: not found in PATH.  %s architecture boards 
will be skipped'
+% (cross_compile, arch))
+cross_compile = None
+
+CROSS_COMPILE[arch] = cross_compile
 
 def cleanup_one_header(header_path, patterns, dry_run):
 """Clean regex-matched lines away from a file.
@@ -387,6 +407,10 @@ class KconfigParser:
 
 Returns:
   A string storing the compiler prefix for the architecture.
+  Return a NULL string for architectures that do not require
+  compiler prefix (Sandbox and native build is the case).
+  Return None if the specified compiler is missing in your PATH.
+  Caller should distinguish '' and None.
 """
 arch = ''
 cpu = ''
@@ -400,13 +424,14 @@ class KconfigParser:
 if m:
 cpu = m.group(1)
 
-assert arch, 'Error: arch is not defined in %s' % defconfig
+if not arch:
+return None
 
 # fix-up for aarch64
 if arch == 'arm' and cpu == 'armv8':
 arch = 'aarch64'
 
-return CROSS_COMPILE.get(arch, '')
+return CROSS_COMPILE.get(arch, None)
 
 def parse_one_config(self, config_attr, defconfig_lines, autoconf_lines):
 """Parse .config, defconfig, include/autoconf.mk for one config.
@@ -606,21 +631,12 @@ class Slot:
 return False
 
 if self.ps.poll() != 0:
-errmsg = 'Failed to process.'
-errout = self.ps.stderr.read()
-if errout.find('gcc: command not found') != -1:
-errmsg = 'Compiler not found ('
-errmsg += color_text(self.options.color, COLOR_YELLOW,
- self.cross_compile)
-errmsg += color_text(self.options.color, COLOR_LIGHT_RED,
- ')')
-print >> sys.stderr, log_msg(self.options.color,
- COLOR_LIGHT_RED,
- self.defconfig,
- errmsg),
+print >> sys.stderr, log_msg(self.options.color, COLOR_LIGHT_RED,
+ self.defconfig, "Failed to process."),
 if self.options.verbose:
 print >> sys.st

[U-Boot] [PATCH 10/21] tools: moveconfig: allow to give CONFIG names as argument directly

2016-05-18 Thread Masahiro Yamada
We still pass the input file with CONFIG name, type, default value
in each line, but the last two fields are just ignored by the tool.
So, let's deprecate the input file and allow users to give CONFIG
names directly from the command line.  The types and default values
are automatically detected and handled nicely by the tool.

Going forward, we can use this tool more easily like:

  tools/moveconfig.py CONFIG_FOO CONFIG_BAR

Update the documentation and fix some typos I noticed while I was
working on.

Signed-off-by: Masahiro Yamada 
---

 tools/moveconfig.py | 108 ++--
 1 file changed, 20 insertions(+), 88 deletions(-)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index c452c7a..7ff6e71 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -17,44 +17,16 @@ 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:
-  
-(the fields must be separated with whitespaces.)
-
- is the name of config option.
-
- is the type of the option.  It must be one of bool, tristate,
-string, int, and hex.
-
- 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
-
-Next you must edit the Kconfig to add the menu entries for the configs
+First, you must edit the Kconfig to add the menu entries for the configs
 you are moving.
 
-And then run this tool giving the file name of the recipe
+And then run this tool giving CONFIG names you want to move.
+For example, if you want to move CONFIG_CMD_USB and CONFIG_SYS_TEXT_BASE,
+simply type as follows:
 
-  $ tools/moveconfig.py recipe
+  $ tools/moveconfig.py CONFIG_CMD_USB CONFIG_SYS_TEXT_BASE
 
-The tool walks through all the defconfig files to move the config
-options specified by the recipe file.
+The tool walks through all the defconfig files and move the given CONFIGs.
 
 The log is also displayed on the terminal.
 
@@ -103,19 +75,19 @@ 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?
---
+How does it work?
+-
 
 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.
+of them to decide the appropriate action for the options.  If the given
+config option is found in the .config, but its value does not match the
+one from the board header, the config option in the .config is replaced
+with the define in the board header.  Then, the .config is synced by
+"make savedefconfig" and the defconfig is updated with it.
 
 For faster processing, this tool handles multi-threading.  It creates
 separate build directories where the out-of-tree build is run.  The
@@ -148,7 +120,7 @@ Available options
   Specify a file containing a list of defconfigs to move
 
  -n, --dry-run
-   Peform a trial run that does not make any changes.  It is useful to
+   Perform a trial run that does not make any changes.  It is useful to
see what is going to happen before one actually runs it.
 
  -e, --exit-on-error
@@ -844,42 +816,6 @@ def move_config(configs, options):
 print ''
 slots.show_failed_boards()
 
-def bad_recipe(filename, linenum, msg):
-"""Print error message with the file name and the line number and exit."""
-sys.exit("%s: line %d: error : " % (filename, linenum) + msg)
-
-def parse_recipe(filename):
-"""Parse the recipe file and retrieve CONFIGs to move.
-
-This function parses the given recipe file and gets the name,
-the type, and the default value of the target config options.
-
-Arguments:
-  filename: path to file to be parsed.
-Returns:
-  A list of CONFIGs to move.
-"""
-configs = []
-linenum = 1
-
-for l

[U-Boot] [PATCH 04/21] tools: moveconfig: check directory relocation before compilers

2016-05-18 Thread Masahiro Yamada
We must make sure this tool is run from the top of source directory
before calling update_cross_compile().  Otherwise, the following
exception is thrown:

Traceback (most recent call last):
  File "./moveconfig.py", line 918, in 
main()
  File "./moveconfig.py", line 908, in main
update_cross_compile()
  File "./moveconfig.py", line 292, in update_cross_compile
for arch in os.listdir('arch'):
OSError: [Errno 2] No such file or directory: 'arch'

Signed-off-by: Masahiro Yamada 
---

 tools/moveconfig.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 1332bd2..ce8245a 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -905,10 +905,10 @@ def main():
 
 config_attrs = parse_recipe(args[0])
 
-update_cross_compile()
-
 check_top_directory()
 
+update_cross_compile()
+
 if not options.cleanup_headers_only:
 move_config(config_attrs, options)
 
-- 
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 00/13] usb: dwc3: rework DWC3 and convert UniPhier xHCI driver to DM

2016-05-18 Thread Masahiro Yamada
Hi Marek,

2016-05-17 20:01 GMT+09:00 Masahiro Yamada :
> Hi Marek,
>
>
> 2016-05-16 23:46 GMT+09:00 Marek Vasut :
>
>>>  delete mode 100644 drivers/usb/host/xhci-uniphier.c
>>>
>> CCing Roger, so he can check this series. I will review it later today
>> or tomorrow.
>>
>
> 01-03 are probably OK, but 04- might have conflicts with
> Roger's work.
>
> Maybe we should take our time to figure out how we should arrange this.


Could you drop 04- from your repository, for now?

Perhaps, we should discuss this DWC3 topic more carefully?


-- 
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 v2 3/3] dm: gpio: Implement open drain for MPC85XX GPIO

2016-05-18 Thread Mario Six
On Thu, May 19, 2016 at 5:59 AM, Simon Glass  wrote:
> Hi Mario,
>
> On 10 May 2016 at 01:51, Mario Six  wrote:
>> This patch implements the open-drain setting feature for the MPC85XX
>> GPIO controller.
>>
>> Signed-off-by: Mario Six 
>> ---
>>
>> v3:
>> - Added missing commit message
>> - Fixed white space issues in function headers
>>
>> ---
>>  drivers/gpio/Kconfig|  6 +++---
>>  drivers/gpio/mpc85xx_gpio.c | 19 +++
>>  2 files changed, 22 insertions(+), 3 deletions(-)
>
> Reviewed-by: Simon Glass 
>
> But please see below.
>
>>
>> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
>> index 068ee63..b250622 100644
>> --- a/drivers/gpio/Kconfig
>> +++ b/drivers/gpio/Kconfig
>> @@ -162,9 +162,9 @@ config MPC85XX_GPIO
>>   configurable to match the actual GPIO count of the SoC (e.g. the
>>   32/32/23 banks of the P1022 SoC).
>>
>> - The standard functions of input/output mode, and output value 
>> setting
>> - are supported; the open-drain capability of the controller is not
>> - supported yet.
>> + Aside from the standard functions of input/output mode, and output
>> + value setting, the open-drain feature, which can configure 
>> individual
>> + GPIOs to work as open-drain outputs, is supported.
>>
>>   The driver has been tested on MPC85XX, but it is likely that other
>>   PowerQUICC III devices will work as well.
>> diff --git a/drivers/gpio/mpc85xx_gpio.c b/drivers/gpio/mpc85xx_gpio.c
>> index acf0414..dc6193c 100644
>> --- a/drivers/gpio/mpc85xx_gpio.c
>> +++ b/drivers/gpio/mpc85xx_gpio.c
>> @@ -73,6 +73,25 @@ static inline void mpc85xx_gpio_set_high(struct ccsr_gpio 
>> *base,
>> setbits_be32(&base->gpdir, gpios);
>>  }
>>
>> +static inline int mpc85xx_gpio_open_drain_val(struct ccsr_gpio *base,
>> + unsigned int mask)
>> +{
>> +   /* Read the requested values */
>> +   return in_be32(&base->gpodr) & mask;
>> +}
>> +
>> +static inline void mpc85xx_gpio_open_drain_on(struct ccsr_gpio *base,
>> + unsigned int gpios)
>> +{
>> +   setbits_be32(&base->gpodr, gpios);
>
> Why gpios? This would normally be 'offset', indicating that it is the
> GPIO offset within the bank.
>
> Also the code seems odd - don't you need to convert the value into a mask?
>

Ah, yes. Sorry, just noticed that I missed the actual
mpc85xx_gpio_{set,get}_open_drain functions when merging the patches. You might
notice that nothing is actually added to the dm_gpio_ops structure as well
(that's what I get for trying to follow the original code style too closely).
Will add those in v4, and the test/dm/gpio.c / sandbox additions as well.

>> +}
>> +
>> +static inline void mpc85xx_gpio_open_drain_off(struct ccsr_gpio *base,
>> +  unsigned int gpios)
>> +{
>> +   clrbits_be32(&base->gpodr, gpios);
>> +}
>> +
>>  static int mpc85xx_gpio_direction_input(struct udevice *dev, unsigned int 
>> gpio)
>>  {
>> struct mpc85xx_gpio_data *data = dev_get_priv(dev);
>> --
>> 2.7.0.GIT
>>
>
> Regards,
> Simon

Thanks for reviewing!

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


Re: [U-Boot] [PATCH v2] test/py: Support setting up specific timeout

2016-05-18 Thread Michal Simek
On 18.5.2016 21:00, Stephen Warren wrote:
> On 05/18/2016 11:00 AM, Michal Simek wrote:
>> Large file transfers, flash erasing and more complicated tests
>> requires more time to finish. Provide a way to setup specific
>> timeout directly in test.
>>
>> For example description for 50s test:
>> timeout = 5
>> with u_boot_console.temporary_timeout(timeout):
>>u_boot_console.run_command(...)
> 
>> diff --git a/test/py/u_boot_console_base.py
>> b/test/py/u_boot_console_base.py
> 
>> +class ConsoleSetupTimeout(object):
> 
>> +def __init__(self, console, timeout):
>> +self.p = console.p
>> +self.orig_timeout = self.p.timeout
>> +self.p.timeout = timeout
> 
>> +def __exit__(self, extype, value, traceback):
>> +if not self.p:
>> +return
> 
> That test can't fail, since __init__ already used self.p in a way that
> would have triggered an exception during the constructor, which I
> believe would cause neither __enter__ nor __exit__ to ever be called
> since the object would not exist.
> 
> Still, this does no harm, so either way,
> Reviewed-by: Stephen Warren 

I have tested it without that checking and you are right.
I have sent v3 which remove this with your Reviewed-by line.

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


[U-Boot] [PATCH v3] test/py: Support setting up specific timeout

2016-05-18 Thread Michal Simek
Large file transfers, flash erasing and more complicated tests
requires more time to finish. Provide a way to setup specific
timeout directly in test.

For example description for 50s test:
timeout = 5
with u_boot_console.temporary_timeout(timeout):
  u_boot_console.run_command(...)

Signed-off-by: Michal Simek 
Reviewed-by: Stephen Warren 
---

Changes in v3:
- Remove if not self.p checking from __exit__ reported by Stephen

Changes in v2:
- save console.p instead of simple console
- Some fixes in comments
- Save orig_timeout directly in class
- Remove get_spawn call
- Test if self.p exists

 test/py/u_boot_console_base.py | 31 +++
 1 file changed, 31 insertions(+)

diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py
index f7434363fbcb..815fa64d5ff3 100644
--- a/test/py/u_boot_console_base.py
+++ b/test/py/u_boot_console_base.py
@@ -56,6 +56,22 @@ class ConsoleDisableCheck(object):
 self.console.disable_check_count[self.check_type] -= 1
 self.console.eval_bad_patterns()
 
+class ConsoleSetupTimeout(object):
+"""Context manager (for Python's with statement) that temporarily sets up
+timeout for specific command. This is useful when execution time is greater
+then default 30s."""
+
+def __init__(self, console, timeout):
+self.p = console.p
+self.orig_timeout = self.p.timeout
+self.p.timeout = timeout
+
+def __enter__(self):
+return self
+
+def __exit__(self, extype, value, traceback):
+self.p.timeout = self.orig_timeout
+
 class ConsoleBase(object):
 """The interface through which test functions interact with the U-Boot
 console. This primarily involves executing shell commands, capturing their
@@ -391,3 +407,18 @@ class ConsoleBase(object):
 """
 
 return ConsoleDisableCheck(self, check_type)
+
+def temporary_timeout(self, timeout):
+"""Temporarily set up different timeout for commands.
+
+Create a new context manager (for use with the "with" statement) which
+temporarily change timeout.
+
+Args:
+timeout: Time in milliseconds.
+
+Returns:
+A context manager object.
+"""
+
+return ConsoleSetupTimeout(self, timeout)
-- 
1.9.1

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


Re: [U-Boot] [PATCH v1 01/12] common: bootdelay: move CONFIG_BOOTDELAY into a Kconfig option

2016-05-18 Thread Viresh Kumar
On 19-05-16, 07:22, Heiko Schocher wrote:
> Sorry for that ... I used patman  and forgot the "-m" no maintainer
> option ... Hmmm... on the other side, all involved people should be
> informed ... added Simon to Cc ... Simon?

In fact, your message wouldn't have hit the list as well.

> patman may create a big cc list, for example when moving config options
> to Kconfig ...
> 
> Makes it sense to add them all into bcc?

One way is to ignore all such people and don't add them at all. Adding
them in bcc will make them at least aware of this :)

> At least the ones the
> maintainer script finds?
> Is this easy to adapt in patman?

No idea.

> Hmm.. a problem is may "git send-mail", as there is no "--bcc-cmd" option ...
> So, all bcc addresses must be added with the "--bcc=address" option ...
> 
> >On 18-05-16, 16:18, Heiko Schocher wrote:
> >>diff --git a/include/configs/spear-common.h b/include/configs/spear-common.h
> >>index c4b6234..5e2e2b1 100644
> >>--- a/include/configs/spear-common.h
> >>+++ b/include/configs/spear-common.h
> >>@@ -106,9 +106,7 @@
> >>   * Default Environment Varible definitions
> >>   */
> >>  #if defined(CONFIG_SPEAR_USBTTY)
> >>-#define CONFIG_BOOTDELAY   -1
> >>  #else
> >>-#define CONFIG_BOOTDELAY   1
> >>  #endif
> >
> >Doesn't this ifdef look strange now ? :)

All I was saying is that we have this now:

  #if defined(CONFIG_SPEAR_USBTTY)
  #else
  #endif

So, you should have removed the ifdef completely.

> Indeed ... I have no such hw ... could you prepare a patch, which moves
> CONFIG_SPEAR_USBTTY to Kconfig, so if this option is selected, it
> set CONFIG_BOOTDELAY to -1 ?

I have left that company 4 years ago and don't have any hardware for
it. Over that I was never involved in uboot coding for the same :)

> So, in the first step I want to remove the lines
> #if defined(CONFIG_SPEAR_USBTTY)
> -#define CONFIG_BOOTDELAY -1
> #else
> -#define CONFIG_BOOTDELAY 1
> #endif
> 
> in include/configs/spear-common.h complete.

Just kill the complete #ifdef/endif.

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


Re: [U-Boot] [PATCH v1 01/12] common: bootdelay: move CONFIG_BOOTDELAY into a Kconfig option

2016-05-18 Thread Heiko Schocher

Hello Viresh,

Am 19.05.2016 um 04:59 schrieb Viresh Kumar:

Sorry, I had to drop the extremely long cc list, otherwise I wasn't
able to reply to this email. Mutt was rejecting it for some reason.

Any anyway, you should have put all those people in bcc rather.


Sorry for that ... I used patman  and forgot the "-m" no maintainer
option ... Hmmm... on the other side, all involved people should be
informed ... added Simon to Cc ... Simon?

patman may create a big cc list, for example when moving config options
to Kconfig ...

Makes it sense to add them all into bcc? At least the ones the
maintainer script finds?
Is this easy to adapt in patman?

Hmm.. a problem is may "git send-mail", as there is no "--bcc-cmd" option ...
So, all bcc addresses must be added with the "--bcc=address" option ...


On 18-05-16, 16:18, Heiko Schocher wrote:

diff --git a/include/configs/spear-common.h b/include/configs/spear-common.h
index c4b6234..5e2e2b1 100644
--- a/include/configs/spear-common.h
+++ b/include/configs/spear-common.h
@@ -106,9 +106,7 @@
   * Default Environment Varible definitions
   */
  #if defined(CONFIG_SPEAR_USBTTY)
-#define CONFIG_BOOTDELAY   -1
  #else
-#define CONFIG_BOOTDELAY   1
  #endif


Doesn't this ifdef look strange now ? :)


Indeed ... I have no such hw ... could you prepare a patch, which moves
CONFIG_SPEAR_USBTTY to Kconfig, so if this option is selected, it
set CONFIG_BOOTDELAY to -1 ?

OK ... looking into the code ...

$ grep -lr CONFIG_SPEAR_USBTTY include/
include/configs/spear-common.h
include/configs/spear6xx_evb.h
include/configs/spear3xx_evb.h
$

In include/configs/spear3xx_evb.h  and include/configs/spear6xx_evb.h:

#if defined(CONFIG_usbtty)
#define CONFIG_SPEAR_USBTTY
#endif

Grrr... ugly style: CONFIG_usbtty

$ grep -lr CONFIG_usbtty .
./include/configs/spear6xx_evb.h
./include/configs/spear3xx_evb.h
$

Hmm... did not find CONFIG_usbtty somewhere defined ... is this is all
dead code?

So, in the first step I want to remove the lines
#if defined(CONFIG_SPEAR_USBTTY)
-#define CONFIG_BOOTDELAY   -1
#else
-#define CONFIG_BOOTDELAY   1
#endif

in include/configs/spear-common.h complete. But there are more
places in this file with a "#if defined(CONFIG_SPEAR_USBTTY)" ...
As it is currently dead code in mainline ... it needs a cleanup.

I remove the above lines in a v2 version of my patch. Done. Waiting
for more comments on this patch, before posting.

Thanks!

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


[U-Boot] [PATCH] imx: mx7: implement reset_misc

2016-05-18 Thread Peng Fan
We need to power down lcdif to make 'reset' can pass stress test.

Signed-off-by: Peng Fan 
Cc: Stefano Babic 
---
 arch/arm/cpu/armv7/mx7/soc.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/cpu/armv7/mx7/soc.c b/arch/arm/cpu/armv7/mx7/soc.c
index 073bbc6..ef46c92 100644
--- a/arch/arm/cpu/armv7/mx7/soc.c
+++ b/arch/arm/cpu/armv7/mx7/soc.c
@@ -441,3 +441,11 @@ void s_init(void)
 
return;
 }
+
+void reset_misc(void)
+{
+#ifdef CONFIG_VIDEO_MXS
+   lcdif_power_down();
+#endif
+}
+
-- 
2.6.2

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


[U-Boot] [PATCH] drivers/ddr/fsl: Fix timing_cfg_2 register

2016-05-18 Thread York Sun
Commit 34e026f9 added one extra bit to wr_lat for timing_cfg_2, but
with wrong bit position. It is bit 13 in big-endian, or left shift
18 from LSB. This error hasn't had any impact because we don't have
fast enough DDR4 using the extra bit so far.

Signed-off-by: York Sun 

---

 drivers/ddr/fsl/ctrl_regs.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ddr/fsl/ctrl_regs.c b/drivers/ddr/fsl/ctrl_regs.c
index 9073917..60fed84 100644
--- a/drivers/ddr/fsl/ctrl_regs.c
+++ b/drivers/ddr/fsl/ctrl_regs.c
@@ -709,7 +709,7 @@ static void set_timing_cfg_2(const unsigned int ctrl_num,
| ((add_lat_mclk & 0xf) << 28)
| ((cpo & 0x1f) << 23)
| ((wr_lat & 0xf) << 19)
-   | ((wr_lat & 0x10) << 14)
+   | ((wr_lat & 0x10) << 18)
| ((rd_to_pre & RD_TO_PRE_MASK) << RD_TO_PRE_SHIFT)
| ((wr_data_delay & WR_DATA_DELAY_MASK) << WR_DATA_DELAY_SHIFT)
| ((cke_pls & 0x7) << 6)
-- 
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 v1 07/12] bootstage: call show_boot_progress also in SPL

2016-05-18 Thread Simon Glass
On 18 May 2016 at 08:18, Heiko Schocher  wrote:
> show_boot_progress() is now called from SPL also.
>
> Signed-off-by: Heiko Schocher 
> ---
>
>  common/init/board_init.c | 5 +
>  common/spl/spl.c | 5 +
>  include/bootstage.h  | 6 +++---
>  3 files changed, 13 insertions(+), 3 deletions(-)

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


Re: [U-Boot] [PATCH 07/20] arm: Avoid error messages in cache_v7

2016-05-18 Thread Simon Glass
Hi Marek,

On 14 May 2016 at 15:41, Marek Vasut  wrote:
> On 05/14/2016 11:22 PM, Simon Glass wrote:
>> Hi Marek,
>
> Hi!
>
>> On 14 May 2016 at 14:23, Marek Vasut  wrote:
>>> On 05/14/2016 10:02 PM, Simon Glass wrote:
 Move these to debug() like the one in check_cache range(), to save SPL 
 space.
>>>
>>> This hides cache problems, which were visibly reported so far.
>>> I am opposed to this patch.
>>
>> Sure, but see check_cache_range(). It uses debug(). In fact I found
>> the at91 cache problem only after trying #define DEBUG in the code
>> there.
>
> Which is the reason we should really be vocal about such cache misuse.
> I had a few of such cache problems bite me too, which is why I would
> like to avoid silencing this warning with debug() by default.
>
> I think check_cache_range() should also be fixed and should use printf()
> by default.
>
>>>
>>> Wouldn't it make more sense to completely disable printf() and co.
>>> in SPL if you're after saving space?
>>
>> Or maybe we need something that prints a message in U-Boot proper, but
>> not SPL? I'll take a look.
>
> But what if you trigger the issue only in SPL ?

Yes, but is that likely? So far I don't think the cache is enabled in SPL...

>
>>>
 Signed-off-by: Simon Glass 
 ---

  arch/arm/cpu/armv7/cache_v7.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

 diff --git a/arch/arm/cpu/armv7/cache_v7.c b/arch/arm/cpu/armv7/cache_v7.c
 index dc309da..68cf62e 100644
 --- a/arch/arm/cpu/armv7/cache_v7.c
 +++ b/arch/arm/cpu/armv7/cache_v7.c
 @@ -66,8 +66,8 @@ static void v7_dcache_inval_range(u32 start, u32 stop, 
 u32 line_len)
* invalidate the first cache-line
*/
   if (start & (line_len - 1)) {
 - printf("ERROR: %s - start address is not aligned - 0x%08x\n",
 - __func__, start);
 + debug("ERROR: %s - start address is not aligned - 0x%08x\n",
 +   __func__, start);
   /* move to next cache line */
   start = (start + line_len - 1) & ~(line_len - 1);
   }
 @@ -77,8 +77,8 @@ static void v7_dcache_inval_range(u32 start, u32 stop, 
 u32 line_len)
* invalidate the last cache-line
*/
   if (stop & (line_len - 1)) {
 - printf("ERROR: %s - stop address is not aligned - 0x%08x\n",
 - __func__, stop);
 + debug("ERROR: %s - stop address is not aligned - 0x%08x\n",
 +   __func__, stop);
   /* align to the beginning of this cache line */
   stop &= ~(line_len - 1);
   }

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


Re: [U-Boot] [PATCH v2 00/18] x86: acpi: Support installation of Ubuntu/Windows and boot Windows

2016-05-18 Thread Simon Glass
Hi Bin,

On 17 May 2016 at 20:14, Bin Meng  wrote:
> Hi Simon,
>
> On Wed, May 11, 2016 at 10:44 PM, Bin Meng  wrote:
>> SeaBIOS can be loaded by U-Boot to aid the installation of Ubuntu
>> and Windows to a SATA drive and boot from there. But till now this
>> is broken. The installation either hangs forever or just crashes.
>>
>> This series fixed a bunch of issues that affect the installation
>> of Ubuntu and Windows, and booting Windows.
>>
>> Testing was performed on MinnowMax by:
>> - Install Ubuntu 14.04 and boot
>> - Install Windows 8.1 and boot
>> - Install Windows 10 and boot
>>
>> This series is available at u-boot-x86/acpi2-working.
>>
>> Changes in v2:
>> - New patch to remove the unnecessary checksum calculation of DSDT
>> - New patch to remove header length check when writing tables
>> - New patch to enable SeaBIOS on all boards
>> - New patch to add GPIO ASL description
>>
>
> Do you want to review and test this series, before I apply?

It looks good, please go ahead. I will test it at some point but not
soon unfortunately. Looks like what I have been waiting for to get the
Ubuntu installer running properly.

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


Re: [U-Boot] [PATCH 1/2] board: amcore: update to use dm serial driver

2016-05-18 Thread Simon Glass
On 15 May 2016 at 15:03, Angelo Dureghello  wrote:
> Update amcore board to use dm serial driver.
>
> Signed-off-by: Angelo Dureghello 
> ---
>  board/sysam/amcore/amcore.c | 15 ++-
>  configs/amcore_defconfig|  4 
>  2 files changed, 18 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass 

Does this platform not use device tree?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5] dm: core: implement dev_map_physmem()

2016-05-18 Thread Simon Glass
On 16 May 2016 at 03:16, Vignesh R  wrote:
> This API helps to map physical register addresss pace of device to
> virtual address space easily. Its just a wrapper around map_physmem()
> with MAP_NOCACHE flag.
>
>
> Signed-off-by: Vignesh R 
> Suggested-by: Simon Glass 
> Reviewed-by: Jagan Teki 
> ---
>
> v5: Fix comments by Simon Glass 
>
>  drivers/core/device.c | 11 +++
>  include/dm/device.h   | 13 +
>  2 files changed, 24 insertions(+)

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


Re: [U-Boot] [PATCH v3 1/3] dm: gpio: Add driver for MPC85XX GPIO controller

2016-05-18 Thread Simon Glass
On 13 May 2016 at 05:15, Mario Six  wrote:
> From: "mario@gdsys.cc" 
>
> This patch adds a driver for the built-in GPIO controller of the MPC85XX
> SoC (probably supporting other PowerQUICC III SoCs as well).
>
> Each GPIO bank is identified by its own entry in the device tree, i.e.
>
> gpio-controller@fc00 {
>   #gpio-cells = <2>;
>   compatible = "fsl,pq3-gpio";
>   reg = <0xfc00 0x100>
> }
>
> By default, each bank is assumed to have 32 GPIOs, but the ngpios
> setting is honored, so the number of GPIOs for each bank in configurable
> to match the actual GPIO count of the SoC (e.g. the 32/32/23 banks of
> the P1022 SoC).
>
> The usual functions of GPIO drivers (setting input/output mode and output
> value setting) are supported.
>
> The driver has been tested on MPC85XX, but it is likely that other
> PowerQUICC III devices will work as well.
>
> Signed-off-by: Mario Six 
> ---
>
> v3:
> - Added shadow for the GPDAT register, as suggested by Joakim Tjernlund
> - Switched to u32 for bit masks
> - Added some comments
>
> v2:
> - Added missing commit message
> - Improved the Kconfig description
> - Fixed and documented the mpc85xx_gpio_data members
> - Introduced GPIO_MASK macro to simplify the code
> - Fixed white space issues in function headers
> - Removed unnecessary empty line
> - Use fdtdec_get_addr_size_auto_noparent to read the register base data
>
> ---
>  arch/powerpc/include/asm/arch-mpc85xx/gpio.h |   2 +
>  arch/powerpc/include/asm/immap_85xx.h|   2 +
>  drivers/gpio/Kconfig |  25 
>  drivers/gpio/Makefile|   1 +
>  drivers/gpio/mpc85xx_gpio.c  | 187 
> +++
>  5 files changed, 217 insertions(+)
>  create mode 100644 drivers/gpio/mpc85xx_gpio.c

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


Re: [U-Boot] [PATCH 2/2] board: amcore: add update scripts

2016-05-18 Thread Simon Glass
On 15 May 2016 at 15:04, Angelo Dureghello  wrote:
> Add some useful update scripts.
>
> Signed-off-by: Angelo Dureghello 
> ---
>  include/configs/amcore.h | 13 -
>  1 file changed, 12 insertions(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH 2/2] ARM: tegra: add p2771-0000 board suport

2016-05-18 Thread Simon Glass
On 12 May 2016 at 13:32, Stephen Warren  wrote:
> From: Stephen Warren 
>
> P2771- is a P3310 CPU board married to a P2597 I/O board. The
> combination contains SoC, DRAM, eMMC, SD card slot, HDMI, USB micro-B
> port, Ethernet, USB3 host port, SATA, PCIe, and two GPIO expansion
> headers.
>
> Currently, due to U-Boot's level of support for Tegra186, the only
> features supported by U-Boot are the console UART and the on-board eMMC.
> Additional features will be added over time.
>
> U-Boot has so far been tested by replacing the kernel image on the device
> with a U-Boot binary. It is anticipated that U-Boot will eventually
> replace the CCPLEX bootloader binary, as on previous chips. This hasn't
> yet been tested.
>
> Signed-off-by: Stephen Warren 
> ---
>  arch/arm/dts/Makefile|  1 +
>  arch/arm/dts/tegra186-p2771-.dts | 25 +
>  arch/arm/mach-tegra/tegra186/Kconfig | 10 ++
>  board/nvidia/p2771-/Kconfig  | 16 
>  board/nvidia/p2771-/MAINTAINERS  |  6 ++
>  board/nvidia/p2771-/Makefile |  5 +
>  board/nvidia/p2771-/p2771-.c |  7 +++
>  configs/p2771-_defconfig | 31 +++
>  include/configs/p2771-.h | 33 +
>  9 files changed, 134 insertions(+)
>  create mode 100644 arch/arm/dts/tegra186-p2771-.dts
>  create mode 100644 board/nvidia/p2771-/Kconfig
>  create mode 100644 board/nvidia/p2771-/MAINTAINERS
>  create mode 100644 board/nvidia/p2771-/Makefile
>  create mode 100644 board/nvidia/p2771-/p2771-.c
>  create mode 100644 configs/p2771-_defconfig
>  create mode 100644 include/configs/p2771-.h

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


Re: [U-Boot] [PATCH 1/2] ARM: tegra: add core Tegra186 support

2016-05-18 Thread Simon Glass
On 12 May 2016 at 13:32, Stephen Warren  wrote:
> From: Stephen Warren 
>
> This adds the bare minimum code to support Tegra186, with UART and eMMC
> working.
>
> The empty gpio.h is required because  includes it. A future
> cleanup round may be able to solve this for all Tegra generations at once.
>
> mach-tegra/Makefile is adjusted not to compile anything for Tegra186, but
> instead to defer everything to mach-tegra/tegra186/Makefile. This allows
> the SoC code to pick-and-choose which of the C files in the "common"
> mach-tegra/ directory to compile in based on the SoC's needs. Most of the
> code is not valid for Tegra186, and this approach removes the need for
> mach-tegra/Makefile to contain many SoC-specific ifdefs. This approach
> may be applied to all other Tegra SoCs in a future cleanup round.
>
> board186.c is introduced to replace board.c and board2.c. These files
> currently contain a slew of SoC- and board-specific code that is not
> valid for Tegra186. This approach avoids adding yet more ifdefs to those
> files. A future cleanup round may refactor most of board*.c into board-/
> SoC-specific functions files thus allowing the top-level functions like
> board_init_early_f to be shared again.
>
> Signed-off-by: Stephen Warren 
> ---
> This patch series depends on the following at compile time:
> * gpio: add Tegra186 GPIO driver
> * mmc: tegra: add basic Tegra186 support
>
> ... and the following only at run time:
> * dm: allow setting driver_data before/during bind
>
>  arch/arm/dts/tegra186.dtsi | 56 +++
>  arch/arm/include/asm/arch-tegra186/gpio.h  | 10 +
>  arch/arm/include/asm/arch-tegra186/tegra.h | 16 +++
>  arch/arm/mach-tegra/Kconfig|  6 +++
>  arch/arm/mach-tegra/Makefile   |  3 ++
>  arch/arm/mach-tegra/board186.c | 55 +++
>  arch/arm/mach-tegra/tegra186/Kconfig   | 15 +++
>  arch/arm/mach-tegra/tegra186/Makefile  |  8 
>  include/configs/tegra186-common.h  | 71 
> ++
>  9 files changed, 240 insertions(+)
>  create mode 100644 arch/arm/dts/tegra186.dtsi
>  create mode 100644 arch/arm/include/asm/arch-tegra186/gpio.h
>  create mode 100644 arch/arm/include/asm/arch-tegra186/tegra.h
>  create mode 100644 arch/arm/mach-tegra/board186.c
>  create mode 100644 arch/arm/mach-tegra/tegra186/Kconfig
>  create mode 100644 arch/arm/mach-tegra/tegra186/Makefile
>  create mode 100644 include/configs/tegra186-common.h

Reviewed-by: Simon Glass 

Strange use of floating point!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mmc: tegra: add basic Tegra186 support

2016-05-18 Thread Simon Glass
Hi Stephen,

On 12 May 2016 at 12:11, Stephen Warren  wrote:
> From: Stephen Warren 
>
> Tegra186's MMC controller needs to be explicitly identified. Add another
> compatible value for it.
>
> Tegra186 will use an entirely different clock/reset control mechanism to
> existing chips, and will use standard clock/reset APIs rather than the
> existing Tegra-specific custom APIs. The driver support for that isn't
> ready yet, so simply disable all clock/reset usage if compiling for
> Tegra186. This must happen at compile time rather than run-time since the
> custom APIs won't even be compiled in on Tegra186. In the long term, the
> plan would be to convert the existing custom APIs to standard APIs and get
> rid of the ifdefs completely.
>
> The system's main eMMC will work without any clock/reset support, since
> the firmware will have already initialized the controller in order to
> load U-Boot. Hence the driver is useful even in this apparently crippled
> state.
>
> Signed-off-by: Stephen Warren 
> ---
> This patch is needed at compile-time for the upcoming Tegra186 core patches
> to compile. As such, it's probably best if it gets applied via the Tegra tree.
>
>  arch/arm/include/asm/arch-tegra/tegra_mmc.h |  2 ++
>  drivers/mmc/tegra_mmc.c | 32 
> -
>  include/fdtdec.h|  1 +
>  lib/fdtdec.c|  1 +
>  4 files changed, 35 insertions(+), 1 deletion(-)

Can you convert this driver to use CONFIG_DM_MMC and CONFIG_BLK?

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


Re: [U-Boot] [PATCH 2/4] ARM: tegra: fix naming in GPIO DT binding header

2016-05-18 Thread Simon Glass
On 12 May 2016 at 12:07, Stephen Warren  wrote:
> From: Stephen Warren 
>
> According to the Tegra TRM, GPIOs are aggregated into /ports/ of 8 GPIOs,
> not into /banks/. Fix  to correctly reflect
> this naming convention. While this seems like silly churn, it will become
> slightly more important once we introduce the GPIO binding for upcoming
> Tegra chips. This mirrors an identical commit in the Linux kernel.
>
> Signed-off-by: Stephen Warren 
> ---
> v2: New patch.
> ---
>  include/dt-bindings/gpio/tegra-gpio.h | 68 
> +--
>  1 file changed, 34 insertions(+), 34 deletions(-)

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


Re: [U-Boot] [PATCH 3/4] ARM: tegra: convert CONFIG_TEGRA_GPIO to Kconfig

2016-05-18 Thread Simon Glass
On 12 May 2016 at 12:07, Stephen Warren  wrote:
> From: Stephen Warren 
>
> Future chips will contain different GPIO HW. This change will enable
> future SoC support to select the appropriate GPIO driver for their HW,
> in a future-looking fashion, using Kconfig.
>
> TEGRA_GPIO is not simply selected by TEGRA_COMMON (even though all
> current Tegra chips used this GPIO HW) to simplify the later addition
> of support for Tegra SoCs that use different GPIO HW.
>
> Signed-off-by: Stephen Warren 
> ---
> v2: New patch.
> ---
>  arch/arm/mach-tegra/Kconfig| 2 ++
>  drivers/gpio/Kconfig   | 7 +++
>  include/configs/tegra-common.h | 1 -
>  3 files changed, 9 insertions(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH v2 18/18] x86: doc: Add porting hints for ACPI with Windows

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:45, Bin Meng  wrote:
> Windows might cache system information and only detect ACPI changes
> if you modify the ACPI table versions.
>
> Signed-off-by: Bin Meng 
>
> ---
>
> Changes in v2: None
>
>  doc/README.x86 | 6 ++
>  1 file changed, 6 insertions(+)

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


Re: [U-Boot] [PATCH v2 15/18] acpi: Quieten IASL output when 'make -s' is used

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:45, Bin Meng  wrote:
> IASL compiler does not provide a command line option to turn off
> its non-warning message. To quieten the output when 'make -s',
> redirect its output to /dev/null.
>
> Signed-off-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  scripts/Makefile.lib | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH v2 17/18] x86: baytrail: Add GPIO ASL description

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:45, Bin Meng  wrote:
> Since BayTrail, Intel starts to use new GPIO IPs in their chipset.
> This adds the GPIO ASL, so that OS can load corresponding drivers
> for it. On Linux, this is BayTrail pinctrl driver.
>
> Signed-off-by: Bin Meng 
>
> ---
>
> Changes in v2:
> - New patch to add GPIO ASL description
>
>  arch/x86/include/asm/arch-baytrail/acpi/gpio.asl   | 95 
> ++
>  .../include/asm/arch-baytrail/acpi/platform.asl|  3 +
>  2 files changed, 98 insertions(+)
>  create mode 100644 arch/x86/include/asm/arch-baytrail/acpi/gpio.asl

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


Re: [U-Boot] [PATCH 1/4] ARM: tegra: use DT bindings for GPIO naming

2016-05-18 Thread Simon Glass
On 12 May 2016 at 12:07, Stephen Warren  wrote:
> From: Stephen Warren 
>
> There are currently many places that define the list of all Tegra GPIOs;
> the DT binding header and custom Tegra-specific header file gpio.h. Fix
> the redundancy by replacing everything with the DT binding header file.
>
> Signed-off-by: Stephen Warren 
> ---
> v2: Extracted from a larger patch series. Simplified. Removed any
> copyright header changes.
> ---
>  arch/arm/include/asm/arch-tegra/gpio.h |   2 +
>  arch/arm/include/asm/arch-tegra124/gpio.h  | 259 
> -
>  arch/arm/include/asm/arch-tegra20/gpio.h   | 227 --
>  arch/arm/include/asm/arch-tegra210/gpio.h  | 259 
> -
>  arch/arm/include/asm/arch-tegra30/gpio.h   | 251 
>  board/avionic-design/common/tamonten-ng.c  |  12 +-
>  board/avionic-design/common/tamonten.c |   4 +-
>  board/nvidia/cardhu/cardhu.c   |   4 +-
>  board/nvidia/e2220-1170/pinmux-config-e2220-1170.h | 120 +-
>  board/nvidia/jetson-tk1/pinmux-config-jetson-tk1.h | 104 -
>  board/nvidia/nyan-big/nyan-big.c   |   5 +-
>  board/nvidia/nyan-big/pinmux-config-nyan-big.h |  96 
>  board/nvidia/p2371-/pinmux-config-p2371-.h | 102 
>  board/nvidia/p2371-2180/pinmux-config-p2371-2180.h | 124 +-
>  board/nvidia/p2571/p2571.c |   4 +-
>  board/nvidia/p2571/pinmux-config-p2571.h   |  52 ++---
>  board/nvidia/seaboard/seaboard.c   |   4 +-
>  board/nvidia/venice2/pinmux-config-venice2.h   | 118 +-
>  board/toradex/colibri_t20/colibri_t20.c|   6 +-
>  board/toradex/colibri_t30/colibri_t30.c|   6 +-
>  20 files changed, 383 insertions(+), 1376 deletions(-)

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


Re: [U-Boot] [PATCH v2 14/18] x86: doc: Mention Ubuntu/Windows installation and boot support

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:45, Bin Meng  wrote:
> As of now, U-Boot can support installing and booting Ubuntu/Windows
> with the help of SeaBIOS. Update the documentation.
>
> Signed-off-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  doc/README.x86 | 12 
>  1 file changed, 8 insertions(+), 4 deletions(-)

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


Re: [U-Boot] [PATCH v2 16/18] x86: baytrail: Add internal UART ASL description

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:45, Bin Meng  wrote:
> BayTrail integrates an internal ns15550 compatible UART (PNP0501).
> Its IRQ is hardwired to IRQ3 in old revision chipset, but in newer
> revision one IRQ4 is being used for ISA compatibility. Handle this
> correctly in the ASL file.
>
> Linux does not need this ASL, but Windows need this to correctly
> discover a COM port existing in the system so that Windows can
> show it in the 'Device Manager' window, and expose this COM port
> to any terminal emulation application.
>
> Signed-off-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  .../include/asm/arch-baytrail/acpi/irqlinks.asl|  4 ++
>  arch/x86/include/asm/arch-baytrail/acpi/lpc.asl| 60 
> ++
>  2 files changed, 64 insertions(+)

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


Re: [U-Boot] [PATCH v2 13/18] x86: baytrail: Enable SeaBIOS on all boards

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:45, Bin Meng  wrote:
> SeaBIOS can be loaded by U-Boot to aid the installation of Ubuntu
> and Windows to a SATA drive and boot from there. Enable it on all
> BayTrail boards.
>
> Signed-off-by: Bin Meng 
>
> ---
>
> Changes in v2:
> - New patch to enable SeaBIOS on all boards
>
>  configs/bayleybay_defconfig   | 1 +
>  configs/conga-qeval20-qa3-e3845_defconfig | 1 +
>  configs/minnowmax_defconfig   | 1 +
>  3 files changed, 3 insertions(+)

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


Re: [U-Boot] [PATCH v2 12/18] x86: doc: Update information about IGD with SeaBIOS

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:45, Bin Meng  wrote:
> Document how to make SeaBIOS load and run the VGA ROM of Intel
> IGD device when loaded by U-Boot.
>
> Signed-off-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  doc/README.x86 | 24 
>  1 file changed, 24 insertions(+)

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


Re: [U-Boot] [PATCH v2 07/18] x86: Reserve configuration tables in high memory

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:45, Bin Meng  wrote:
> When SeaBIOS is on, reserve configuration tables in reserve_arch().
>
> Signed-off-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/cpu.c | 11 ---
>  1 file changed, 8 insertions(+), 3 deletions(-)

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


Re: [U-Boot] [PATCH v2 10/18] x86: acpi: Remove the unnecessary checksum calculation of DSDT

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:45, Bin Meng  wrote:
> The generated AmlCode[] from IASL already has the calculated DSDT
> table checksum in place. No need for us to calculate it again.
>
> Signed-off-by: Bin Meng 
>
> ---
>
> Changes in v2:
> - New patch to remove the unnecessary checksum calculation of DSDT
>
>  arch/x86/lib/acpi_table.c | 6 --
>  1 file changed, 6 deletions(-)

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


Re: [U-Boot] [PATCH v2 09/18] x86: acpi: Switch to ACPI mode by ourselves instead of requested by OSPM

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:45, Bin Meng  wrote:
> Per ACPI spec, during ACPI OS initialization, OSPM can determine
> that the ACPI hardware registers are owned by SMI (by way of the
> SCI_EN bit in the PM1_CNT register), in which case the ACPI OS
> issues the ACPI_ENABLE command to the SMI_CMD port. The SCI_EN bit
> effectively tracks the ownership of the ACPI hardware registers.
>
> However since U-Boot does not support SMI, we report all 3 fields
> in FADT (SMI_CMD, ACPI_ENABLE, ACPI_DISABLE) as zero, by following
> the spec who says: these fields are reserved and must be zero on
> system that does not support System Management mode.
>
> U-Boot seems to behave in a correct way that the ACPI spec allows,
> at least Linux does not complain, but apparently Windows does not
> think so. During Windows bring up debugging, it is observed that
> even these 3 fields are zero, Windows are still trying to issue SMI
> with hardcoded SMI port address and commands, and expecting SCI_EN
> to be changed by the firmware. Eventually Windows gives us a BSOD
> (Blue Screen of Death) saying ACPI_BIOS_ERROR and refuses to start.
>
> To fix this, turn on the SCI_EN bit by ourselves. With this patch,
> now U-Boot can install and boot Windows 8.1/10 successfully with
> the help of SeaBIOS using legacy interface (non-UEFI mode).
>
> Signed-off-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  arch/x86/include/asm/acpi_table.h |  3 +++
>  arch/x86/lib/acpi_table.c | 26 ++
>  2 files changed, 29 insertions(+)

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


Re: [U-Boot] [PATCH v2 11/18] x86: acpi: Remove header length check when writing tables

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:45, Bin Meng  wrote:
> Before moving 'current' pointer during ACPI table writing, we always
> check the table length to see if it is larger than the table header.
> Since our purpose is to generate valid tables, the check logic is
> always true, which can be avoided.
>
> Signed-off-by: Bin Meng 
>
> ---
>
> Changes in v2:
> - New patch to remove header length check when writing tables
>
>  arch/x86/lib/acpi_table.c | 26 ++
>  1 file changed, 10 insertions(+), 16 deletions(-)

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


Re: [U-Boot] [PATCH v2 06/18] x86: Unify reserve_arch() for all x86 boards

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:45, Bin Meng  wrote:
> Instead of asking each platform to provide reserve_arch(),
> supply it in arch/x86/cpu/cpu.c in a unified way.
>
> Signed-off-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/baytrail/valleyview.c |  8 
>  arch/x86/cpu/broadwell/sdram.c |  5 -
>  arch/x86/cpu/cpu.c | 12 
>  arch/x86/cpu/ivybridge/sdram.c |  5 -
>  arch/x86/cpu/quark/quark.c |  9 -
>  5 files changed, 12 insertions(+), 27 deletions(-)

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


Re: [U-Boot] [PATCH v2 05/18] x86: Prepare configuration tables in dedicated high memory region

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:44, Bin Meng  wrote:
> Currently when CONFIG_SEABIOS is on, U-Boot allocates configuration
> tables via normal malloc(). To simplify, use a dedicated memory
> region which is reserved on the stack before relocation for this
> purpose. Add functions for reserve and malloc.
>
> Signed-off-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  arch/x86/Kconfig   | 14 ++
>  arch/x86/include/asm/coreboot_tables.h | 19 +++
>  arch/x86/include/asm/global_data.h |  4 
>  arch/x86/lib/coreboot_table.c  | 31 +++
>  4 files changed, 68 insertions(+)

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


Re: [U-Boot] [PATCH v2 03/18] x86: Fix up PIRQ routing table checksum earlier

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:44, Bin Meng  wrote:
> PIRQ routing table checksum is fixed up in copy_pirq_routing_table(),
> which is fine if we only write the configuration table once. But with
> the SeaBIOS case, when we write the table for the second time, the
> checksum will be fixed up to zero per the checksum algorithm, which
> is caused by the checksum field not being zero before fix up, since
> the checksum has already been calculated in the first run.
>
> To fix this, move the checksum fixup to create_pirq_routing_table(),
> so that copy_pirq_routing_table() only does what its function name
> suggests: copy the table to somewhere else.
>
> Signed-off-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/irq.c  | 4 
>  arch/x86/lib/pirq_routing.c | 4 
>  2 files changed, 4 insertions(+), 4 deletions(-)

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


Re: [U-Boot] [PATCH v2 08/18] x86: Use high_table_malloc() for tables passing to SeaBIOS

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:45, Bin Meng  wrote:
> Now that we already reserved high memory for configuration tables,
> call high_table_malloc() to allocate tables from the region.
>
> Signed-off-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  arch/x86/lib/tables.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

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


Re: [U-Boot] [PATCH v2 01/18] x86: minnowmax: Adjust U-Boot environment address in SPI flash

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:44, Bin Meng  wrote:
> Currently U-Boot environment address is at offset 0x7fe00 of a 8MB
> SPI flash. When creating a partial u-boot.rom image without flash
> descriptor and ME firmware, U-Boot actually occupies the last 1MB
> of the flash, and reprograming U-Boot causes previous environment
> settings get lost which is not convenient during testing.
>
> Adjust the environment address to 0x6ef000 instead (before the MRC
> cache data region in the flash).
>
> Signed-off-by: Bin Meng 
> Reviewed-by: Stefan Roese 
> ---
>
> Changes in v2: None
>
>  doc/README.x86  | 2 +-
>  include/configs/minnowmax.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH v2 02/18] x86: Call board_final_cleanup() in last_stage_init()

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:44, Bin Meng  wrote:
> At present board_final_cleanup() is called before booting a Linux
> kernel. This actually needs to be done before booting anything,
> like SeaBIOS, VxWorks or Windows.
>
> Move the call to last_stage_init() instead.
>
> Signed-off-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/coreboot/coreboot.c | 20 +++-
>  arch/x86/cpu/cpu.c   | 10 ++
>  arch/x86/lib/bootm.c |  9 -
>  3 files changed, 21 insertions(+), 18 deletions(-)

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


Re: [U-Boot] [PATCH v2 04/18] x86: Compile coreboot_table.c only for SeaBIOS

2016-05-18 Thread Simon Glass
On 11 May 2016 at 08:44, Bin Meng  wrote:
> coreboot_table.c only needs to be built when SeaBIOS is used.
>
> Signed-off-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  arch/x86/lib/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH v2 07/11] drivers: usb: musb: add ti musb peripheral driver with driver model support

2016-05-18 Thread Simon Glass
On 11 May 2016 at 23:49, Mugunthan V N  wrote:
> On Tuesday 10 May 2016 06:09 PM, Marek Vasut wrote:
>> On 05/10/2016 01:48 PM, Mugunthan V N wrote:
>>> Add a TI MUSB peripheral driver with driver model support and the
>>> driver will be bound by the MUSB wrapper driver based on the
>>> dr_mode device tree entry.
>>>
>>> Signed-off-by: Mugunthan V N 
>>> ---
>>>  drivers/usb/musb-new/musb_uboot.c |   2 +
>>>  drivers/usb/musb-new/ti-musb.c| 113 
>>> ++
>>>  2 files changed, 115 insertions(+)

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


Re: [U-Boot] [PATCH RESEND 2/2] cmd: fdt: add fdt overlay application subcommand

2016-05-18 Thread Simon Glass
Hi Maxime,

On 10 May 2016 at 05:45, Maxime Ripard  wrote:
> Hi Simon,
>
> I'm finally taking the time to address the reviews that have been made
> here.
>
> On Sat, Apr 09, 2016 at 12:40:14PM -0600, Simon Glass wrote:
>> Hi Maxime,
>>
>> On 4 April 2016 at 12:25, Maxime Ripard
>>  wrote:
>> > The device tree overlays are a good way to deal with user-modifyable
>> > boards or boards with some kind of an expansion mechanism where we can
>> > easily plug new board in (like the BBB or the raspberry pi).
>> >
>> > However, so far, the usual mechanism to deal with it was to have in Linux
>> > some driver detecting the expansion boards plugged in and then request
>> > these overlays using the firmware interface.
>> >
>> > That works in most cases, but in some cases, you might want to have the
>> > overlays applied before the userspace comes in. Either because the new
>> > board requires some kind of an early initialization, or because your root
>> > filesystem is accessed through that expansion board.
>> >
>> > The easiest solution in such a case is to simply have the component before
>> > Linux applying that overlay, removing all these drawbacks.
>> >
>> > Signed-off-by: Maxime Ripard 
>> > ---
>> >  cmd/Makefile  |   2 +-
>> >  cmd/fdt.c |  19 +++
>> >  cmd/fdt_overlay.c | 464 
>> > ++
>> >  include/fdt_support.h |   2 +-
>> >  4 files changed, 485 insertions(+), 2 deletions(-)
>> >  create mode 100644 cmd/fdt_overlay.c
>>
>> I'm happy to take this into the U-Boot tree while you try to get it
>> applied upstream, but please confirm that you will do this and by
>> when. I suggest you sent an email referring to this patch.
>>
>> Also fdt_overlay.c should go in lib/libfdt/. If this functionality is
>> rejected for libfdt (as was fdtgrep) then we'll move it to lib/.
>
> I'm definitely ok to send it to libfdt if that's what you meant by
> upstream. I'll push it at the same time I'm pushing the next version
> of these patches, just to make sure we progress as fast as we can on
> this.

OK great.

>
>> Finally, please take a look at adding a test for this, with some
>> sample files. See test/py.
>
> However, that will be a bit difficult. In order to be used, the DT
> overlays require the overlay support in dtc, which is still not
> included upstream. So the majority of the users of U-Boot won't have
> that support, meaning that these tests will likely fail for them (even
> though the code might be correct), resulting in a lot of false
> negative.
>
> How do you want me to proceed?

Well I suppose you can write the test, but comment it out for now. We
can still try it with the out-of-tree dtc.

>
> Thanks!
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com

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


Re: [U-Boot] [PATCH v2 4/6] drivers: usb: gadget: ether: use net device priv to pass usb ether priv

2016-05-18 Thread Simon Glass
On 10 May 2016 at 05:44, Mugunthan V N  wrote:
> Use net device priv to pass usb ether priv and use it in
> net device ops callback.
>
> Signed-off-by: Mugunthan V N 
> ---
>  drivers/usb/gadget/ether.c | 46 
> +-
>  1 file changed, 21 insertions(+), 25 deletions(-)

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


Re: [U-Boot] [PATCH v2 1/6] drivers: usb: gadget: ether: adopt to usb driver model

2016-05-18 Thread Simon Glass
Hi,

On 10 May 2016 at 05:44, Mugunthan V N  wrote:
> Convert usb ether gadget to adopt usb driver model
>
> Signed-off-by: Mugunthan V N 
> ---
>  drivers/usb/gadget/ether.c | 36 
>  1 file changed, 36 insertions(+)

This seems a little messy but I understand the need to fit within the
existing framework.

Reviewed-by: Simon Glass 

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


Re: [U-Boot] [PATCH v2 3/6] drivers: usb: gadget: ether: consolidate global devices to single struct

2016-05-18 Thread Simon Glass
On 10 May 2016 at 05:44, Mugunthan V N  wrote:
> Consolidate the net device, usb eth device and gadget device
> struct to single struct and a single global variable so that the
> same can be passed as priv of ethernet driver.
>
> Signed-off-by: Mugunthan V N 
> ---
>  drivers/usb/gadget/ether.c | 53 
> +++---
>  1 file changed, 26 insertions(+), 27 deletions(-)

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


Re: [U-Boot] [PATCH] spl: Introduce new function spl_board_prepare_for_boot

2016-05-18 Thread Simon Glass
On 10 May 2016 at 01:52, Michal Simek  wrote:
> Call this function before passing control from SPL.
> For fpga case it is necessary to enable for example level shifters
> when bitstream is programmed.
>
> Signed-off-by: Michal Simek 
> ---
>
>  common/spl/spl.c | 6 ++
>  include/spl.h| 1 +
>  2 files changed, 7 insertions(+)

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


Re: [U-Boot] [PATCH v2 2/6] drivers: usb: gadget: ether: access network_started using local variable

2016-05-18 Thread Simon Glass
On 10 May 2016 at 05:44, Mugunthan V N  wrote:
> network_started of struct eth_dev can be accessed using local
> variable dev and no reason to access it with the global struct.
>
> Signed-off-by: Mugunthan V N 
> ---
>  drivers/usb/gadget/ether.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)

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


Re: [U-Boot] [PATCH] RFC: Secure boot to U-Boot proper from SPL

2016-05-18 Thread Simon Glass
Hi Teddy,

On 8 May 2016 at 19:13, Teddy Reed  wrote:
> On Sun, May 1, 2016 at 11:12 AM, Teddy Reed  wrote:
>> I've been using the following patch for my configurations, please excuse the 
>> top-posting. I think the only difference is enabling the uclass mod_exp 
>> driver to initialize without needing relocation.
>>
>
> If no one has any additional notes / requirements for enablement in
> SPL I can send my tiny bit of configuration changes as a patch.
>
> I've tested the DM flag change for the RSA mod_exp driver class for
> both relocated (u-boot) and non-relocated (SPL) builds and found no
> issues. It would be awesome to get another set of eyes on the Makefile
> feature reorganization as I don't want this to include unneeded code
> into SPLs. :)

Sounds good, a few patches would be useful.

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


Re: [U-Boot] [PATCH v2 3/3] dm: gpio: Implement open drain for MPC85XX GPIO

2016-05-18 Thread Simon Glass
Hi Mario,

On 10 May 2016 at 01:51, Mario Six  wrote:
> This patch implements the open-drain setting feature for the MPC85XX
> GPIO controller.
>
> Signed-off-by: Mario Six 
> ---
>
> v3:
> - Added missing commit message
> - Fixed white space issues in function headers
>
> ---
>  drivers/gpio/Kconfig|  6 +++---
>  drivers/gpio/mpc85xx_gpio.c | 19 +++
>  2 files changed, 22 insertions(+), 3 deletions(-)

Reviewed-by: Simon Glass 

But please see below.

>
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> index 068ee63..b250622 100644
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -162,9 +162,9 @@ config MPC85XX_GPIO
>   configurable to match the actual GPIO count of the SoC (e.g. the
>   32/32/23 banks of the P1022 SoC).
>
> - The standard functions of input/output mode, and output value 
> setting
> - are supported; the open-drain capability of the controller is not
> - supported yet.
> + Aside from the standard functions of input/output mode, and output
> + value setting, the open-drain feature, which can configure 
> individual
> + GPIOs to work as open-drain outputs, is supported.
>
>   The driver has been tested on MPC85XX, but it is likely that other
>   PowerQUICC III devices will work as well.
> diff --git a/drivers/gpio/mpc85xx_gpio.c b/drivers/gpio/mpc85xx_gpio.c
> index acf0414..dc6193c 100644
> --- a/drivers/gpio/mpc85xx_gpio.c
> +++ b/drivers/gpio/mpc85xx_gpio.c
> @@ -73,6 +73,25 @@ static inline void mpc85xx_gpio_set_high(struct ccsr_gpio 
> *base,
> setbits_be32(&base->gpdir, gpios);
>  }
>
> +static inline int mpc85xx_gpio_open_drain_val(struct ccsr_gpio *base,
> + unsigned int mask)
> +{
> +   /* Read the requested values */
> +   return in_be32(&base->gpodr) & mask;
> +}
> +
> +static inline void mpc85xx_gpio_open_drain_on(struct ccsr_gpio *base,
> + unsigned int gpios)
> +{
> +   setbits_be32(&base->gpodr, gpios);

Why gpios? This would normally be 'offset', indicating that it is the
GPIO offset within the bank.

Also the code seems odd - don't you need to convert the value into a mask?

> +}
> +
> +static inline void mpc85xx_gpio_open_drain_off(struct ccsr_gpio *base,
> +  unsigned int gpios)
> +{
> +   clrbits_be32(&base->gpodr, gpios);
> +}
> +
>  static int mpc85xx_gpio_direction_input(struct udevice *dev, unsigned int 
> gpio)
>  {
> struct mpc85xx_gpio_data *data = dev_get_priv(dev);
> --
> 2.7.0.GIT
>

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


Re: [U-Boot] [PATCH v7 2/4] net: designware: fix descriptor layout and warnings on 64-bit archs

2016-05-18 Thread Simon Glass
On 8 May 2016 at 00:30, Beniamino Galvani  wrote:
> All members of the DMA descriptor must be 32-bit, even on 64-bit
> architectures: change the type to u32 to ensure this. Also, fix
> other warnings.
>
> Signed-off-by: Beniamino Galvani 
> Acked-by: Joe Hershberger 
> ---
>  drivers/net/designware.c | 59 
> ++--
>  drivers/net/designware.h |  4 ++--
>  2 files changed, 34 insertions(+), 29 deletions(-)

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


Re: [U-Boot] [PATCH v7 3/4] arm: add initial support for Amlogic Meson and ODROID-C2

2016-05-18 Thread Simon Glass
Hi Benjamino,

On 8 May 2016 at 00:30, Beniamino Galvani  wrote:
> This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
> board definition for ODROID-C2. This initial submission only supports
> UART and Ethernet (through the existing Designware driver). DTS files
> are the ones submitted to Linux arm-soc for 4.7 [1].
>
> [1] https://patchwork.ozlabs.org/patch/603583/
>
> Signed-off-by: Beniamino Galvani 
> Reviewed-by: Simon Glass 
> ---
>  arch/arm/Kconfig   |   9 ++
>  arch/arm/Makefile  |   1 +
>  arch/arm/dts/Makefile  |   2 +
>  arch/arm/dts/meson-gxbb-odroidc2.dts   |  69 +
>  arch/arm/dts/meson-gxbb.dtsi   | 178 
> +
>  arch/arm/include/asm/arch-meson/gxbb.h |  52 ++
>  arch/arm/mach-meson/Kconfig|  31 ++
>  arch/arm/mach-meson/Makefile   |   7 ++
>  arch/arm/mach-meson/board.c|  66 
>  board/hardkernel/odroid-c2/Kconfig |  12 +++
>  board/hardkernel/odroid-c2/MAINTAINERS |   6 ++
>  board/hardkernel/odroid-c2/Makefile|   7 ++
>  board/hardkernel/odroid-c2/README  |  60 +++
>  board/hardkernel/odroid-c2/odroid-c2.c |  51 ++
>  configs/odroid-c2_defconfig|  23 +
>  drivers/serial/Kconfig |  15 +++
>  drivers/serial/Makefile|   1 +
>  drivers/serial/serial_meson.c  | 162 ++
>  include/configs/odroid-c2.h|  51 ++
>  19 files changed, 803 insertions(+)
>  create mode 100644 arch/arm/dts/meson-gxbb-odroidc2.dts
>  create mode 100644 arch/arm/dts/meson-gxbb.dtsi
>  create mode 100644 arch/arm/include/asm/arch-meson/gxbb.h
>  create mode 100644 arch/arm/mach-meson/Kconfig
>  create mode 100644 arch/arm/mach-meson/Makefile
>  create mode 100644 arch/arm/mach-meson/board.c
>  create mode 100644 board/hardkernel/odroid-c2/Kconfig
>  create mode 100644 board/hardkernel/odroid-c2/MAINTAINERS
>  create mode 100644 board/hardkernel/odroid-c2/Makefile
>  create mode 100644 board/hardkernel/odroid-c2/README
>  create mode 100644 board/hardkernel/odroid-c2/odroid-c2.c
>  create mode 100644 configs/odroid-c2_defconfig
>  create mode 100644 drivers/serial/serial_meson.c
>  create mode 100644 include/configs/odroid-c2.h

One point that I may have already asked...can the Ethernet use
CONFIG_DM_ETH (i.e. driver mode), perhaps in a follow-on patch?

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


Re: [U-Boot] [PATCH v2 2/3] dm: gpio: Add methods for open drain setting

2016-05-18 Thread Simon Glass
Hi Mario,

On 10 May 2016 at 01:51, Mario Six  wrote:
> Certain GPIO devices have the capability to switch their GPIOs into
> open-drain mode, that is, instead of actively driving the output
> (Push-pull output), the pin is connected to the collector (for a NPN
> transistor) or the drain (for a MOSFET) of a transistor, respectively.
> The pin then either forms an open circuit or a connection to ground,
> depending on the state of the transistor.
>
> This patch adds functions to the GPIO uclass to switch GPIOs to
> open-drain mode on devices that support it.
>
> Signed-off-by: Mario Six 
> ---
>
> v2:
> - Added missing commit message
> - Fixed error return value of dm_gpio_get_open_drain
> - Fixed return value passing in dm_gpio_set_open_drain and added comment
> - Added description of open-drain mode
>
> ---
>  drivers/gpio/gpio-uclass.c | 32 
>  include/asm-generic/gpio.h | 34 ++
>  2 files changed, 66 insertions(+)

Reviewed-by: Simon Glass 

Can you please do a follow-up patch to update the test/dm/gpio.c file
to call these two methods? You'll need to update
drivers/gpio/sandbox.c a little also.

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


Re: [U-Boot] [PATCH v7 1/4] arm: implement generic PSCI reset call for armv8

2016-05-18 Thread Simon Glass
On 8 May 2016 at 00:30, Beniamino Galvani  wrote:
> Add a psci_system_reset() which calls the SYSTEM_RESET function of
> PSCI 0.2 and can be used by boards that support it to implement
> reset_cpu().
>
> Signed-off-by: Beniamino Galvani 
> ---
>  arch/arm/cpu/armv8/fwcall.c   | 16 
>  arch/arm/include/asm/psci.h   | 17 -
>  arch/arm/include/asm/system.h |  2 ++
>  3 files changed, 34 insertions(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH v5 3/3] spl: Support loading a FIT from FAT FS

2016-05-18 Thread Simon Glass
On 4 May 2016 at 06:04, Lokesh Vutla  wrote:
> Detect a FIT when loading from a FAT File system and handle it using the
> new FIT SPL support.
>
> Signed-off-by: Lokesh Vutla 
> ---
>  common/spl/spl_fat.c | 31 +--
>  1 file changed, 29 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH v5 2/3] spl: Allow to load a FIT containing U-Boot from FS

2016-05-18 Thread Simon Glass
On 4 May 2016 at 06:04, Lokesh Vutla  wrote:
> This provides a way to load a FIT containing U-Boot and a selection of device
> tree files from a File system. Making sure that all the reads and writes
> are aligned to their respective needs.
>
> Signed-off-by: Lokesh Vutla 
> ---
>  common/spl/spl_fit.c | 76 
> +---
>  include/spl.h| 10 +++
>  2 files changed, 71 insertions(+), 15 deletions(-)

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


Re: [U-Boot] [PATCH v5 1/3] spl: fit: Fix the number of bytes read when reading fdt from fit

2016-05-18 Thread Simon Glass
On 4 May 2016 at 06:04, Lokesh Vutla  wrote:
> sectors field is not being updated when reading fdt from fit image. Because of
> this size_of(u-boot.bin) is being read when reading fdt. Fixing it by updating
> the sectors field properly.
>
> Signed-off-by: Lokesh Vutla 
> ---
>  common/spl/spl_fit.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> index 1a5c027..b1cfa97 100644
> --- a/common/spl/spl_fit.c
> +++ b/common/spl/spl_fit.c
> @@ -176,6 +176,7 @@ int spl_load_simple_fit(struct spl_load_info *info, ulong 
> sector, void *fit)
>  */
> dst = load_ptr + data_size;
> fdt_offset += base_offset;
> +   sectors = (fdt_len + info->bl_len - 1) / info->bl_len;
> count = info->read(info, sector + fdt_offset / info->bl_len, sectors,
>dst);
> debug("fit read %x sectors to %x, dst %p, data_offset %x\n",
> --
> 2.7.4
>

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


Re: [U-Boot] [PATCH] mkimage: fit: spl: Add an optional static offset for external data

2016-05-18 Thread Simon Glass
Hi Teddy,

On 2 May 2016 at 02:40, Teddy Reed  wrote:
> Hey Simon!
>
> On Sun, May 1, 2016 at 12:32 PM, Simon Glass  wrote:
>> Hi Teddy,
>>
>> On 1 May 2016 at 11:10, Teddy Reed  wrote:
>>> When building a FIT with external data (-E), an SPL may require absolute
>>> positioning for executing the external firmware. To acheive this use the
>>> (-p) switch which will replace the amended "data-offset" with 
>>> "data-position"
>>> indicating the absolute position of external data.
>>>
>>> It is considered an error if the requested absolute position overlaps with 
>>> the
>>> initial data required for the compact FIT.
>>
>> Can you explain why this is useful? I'd like to understand that
>> clearly for your use case.
>
> Sure! I'm working with a board (not in upstream :/ yet), and trying to
> morph the boot to use a verified-boot from SPL. The *only* thing I
> need the SPL to do is read a FIT, check signatures of hashes, then
> jump without arguments to the U-Boot-- no dtb selection, DRAM
> initialization, or anything fancy is needed. Furthermore, I'd like the
> U-Boot build not to depend on the SPL boot, this makes the transition
> from pure-U-Boot-boot to SPL much easier. At the end of the day,
> U-Boot is essentially booting from memory, built that way too, where
> the TEXT_BASE during build is the location I'm placing it outside of
> the FIT. A static 32kB offset on the media.

OK I see.

>
>>
>> I have considered this as a general feature, but I was thinking of
>> being more explicit, e.g. add a property like:
>>
>> data-source
>> - source of data, valid values are:
>> - "internal" - internal to the FIT, with data-offset providing
>> the offset from the start of the FIT to the data
>> - "device" - a separate device, details in property TBD
>> - "address" - a memory address
>>
>> What do you think?
>>
>
> I like this a lot! In fact, for my board I don't need "data-position",
> since the concurrent SPL/U-Boot build know the configured 32kB offset.
> I added the mutex on "data-offset" and "data-position" for some sanity
> when reading back the generated FIT and hopefully so that others could
> benefit from parse-time discovery of static positional offsets.
>
> Having internal, device, address, (maybe offset too) works for me!
>
>> Also can you please update the docs? See uImage.FIT and the mkimage man page.
>>
>
> If you'd like to continue moving forward in trying to land this patch
> I can make revisions and include docs + stderr help.
>
> Let me know!

Sounds good to me, yes.

Regards,
Simon

>
>>>
>>> Signed-off-by: Teddy Reed 
>>> Cc: Simon Glass 
>>> ---
>>>  tools/fit_image.c | 19 ++-
>>>  tools/imagetool.h |  1 +
>>>  tools/mkimage.c   |  9 -
>>>  3 files changed, 27 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/tools/fit_image.c b/tools/fit_image.c
>>> index ddefa72..98610bf 100644
>>> --- a/tools/fit_image.c
>>> +++ b/tools/fit_image.c
>>> @@ -417,7 +417,13 @@ static int fit_extract_data(struct image_tool_params 
>>> *params, const char *fname)
>>> ret = -EPERM;
>>> goto err_munmap;
>>> }
>>> -   fdt_setprop_u32(fdt, node, "data-offset", buf_ptr);
>>> +   if (params->external_offset > 0) {
>>> +   /* An external offset positions the data 
>>> absolutely. */
>>> +   fdt_setprop_u32(fdt, node, "data-position",
>>> +   params->external_offset + buf_ptr);
>>> +   } else {
>>> +   fdt_setprop_u32(fdt, node, "data-offset", buf_ptr);
>>> +   }
>>> fdt_setprop_u32(fdt, node, "data-size", len);
>>>
>>> buf_ptr += (len + 3) & ~3;
>>> @@ -438,6 +444,17 @@ static int fit_extract_data(struct image_tool_params 
>>> *params, const char *fname)
>>> ret = -EIO;
>>> goto err;
>>> }
>>> +
>>> +   /* Check if an offset for the external data was set. */
>>> +   if (params->external_offset > 0) {
>>> +   if (params->external_offset < new_size) {
>>> +   debug("External offset %x overlaps FIT length %x",
>>> + params->external_offset, new_size);
>>> +   ret = -EINVAL;
>>> +   goto err;
>>> +   }
>>> +   new_size = params->external_offset;
>>> +   }
>>> if (lseek(fd, new_size, SEEK_SET) < 0) {
>>> debug("%s: Failed to seek to end of file: %s\n", __func__,
>>>   strerror(errno));
>>> diff --git a/tools/imagetool.h b/tools/imagetool.h
>>> index 24f8f4b..7862fa3 100644
>>> --- a/tools/imagetool.h
>>> +++ b/tools/imagetool.h
>>> @@ -73,6 +73,7 @@ struct image_tool_params {
>>> struct content_info *content_head;  /* List of files to include 
>>> */
>>> struct content_info *content_tail;
>>> bool

Re: [U-Boot] [PATCH] cmd: replace the cast of the memory access to a fixed bit type in itest

2016-05-18 Thread Simon Glass
On 3 May 2016 at 23:20, Masahiro Yamada  wrote:
> From: Kunihiko Hayashi 
>
> This patch fixes a bug that long word(.l) memory access in 'itest'
> command reads the 8bytes of the actual memory on 64-bit architecture.
> The cast to the memory pointer should use a fixed bit type.
>
> Signed-off-by: Kunihiko Hayashi 
> Signed-off-by: Masahiro Yamada 
> ---
>
>  cmd/itest.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Simon Glass 


>
> diff --git a/cmd/itest.c b/cmd/itest.c
> index fb4d797..60626c7 100644
> --- a/cmd/itest.c
> +++ b/cmd/itest.c
> @@ -65,13 +65,13 @@ static long evalexp(char *s, int w)
> }
> switch (w) {
> case 1:
> -   l = (long)(*(unsigned char *)buf);
> +   l = (long)(*(u8 *)buf);
> break;
> case 2:
> -   l = (long)(*(unsigned short *)buf);
> +   l = (long)(*(u16 *)buf);
> break;
> case 4:
> -   l = (long)(*(unsigned long *)buf);
> +   l = (long)(*(u32 *)buf);
> break;
> }
> unmap_physmem(buf, w);
> --
> 1.9.1
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] spl: fit: Print error message when FDT is not present

2016-05-18 Thread Simon Glass
On 4 May 2016 at 07:08, Michal Simek  wrote:
> When FDT is not present in the image user doesn't get any error what's
> wrong. Print error message if LIBCOMMON_SUPPORT is enabled.
>
> Signed-off-by: Michal Simek 
> Seris-cc: uboot
> ---
>
>  common/spl/spl_fit.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>

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


Re: [U-Boot] u-boot hangs after enabling secured boot : gumstix-overo

2016-05-18 Thread Simon Glass
Hi Arun,

On 3 May 2016 at 19:50, Arun Kuttiyara Varghese  wrote:
> Hi Simon,
>
> Thanks for the help.
>
> There is an update.
>
> I experimented with the two options.
>
> Option 1
> =
>
> Like you mentioned, I tried putting all the RSA boot options to
> configs/omap3_overo_defconfig.
> but surprisingly, the board was not able to boot. it stucks after printing
> one line of junk characters.
>
> So I think, putting definitions in include/configs/omap3_overo.h is also
> fine ?

Not if it is in Kconfig. That sounds like a separate problem. But i"m
not sure what.

>
> Option 2
> 
>
> 1. changed u-boot-dtb.img name to u-boot.img .
> 2. then board is able to boot, but gives the below message when I tried to
> use bootm.
>
> Overo #
> ## Loading kernel from FIT Image at 8200 ...
>Using 'conf@1' configuration
>Verifying Hash Integrity ... sha1,rsa2048:my_keyRSA: Can't find Modular
> Exp implementation
> RSA: Can't find Modular Exp implementation
> - Failed to verify required signature 'key-my_key'
> Bad Data Hash
> ERROR: can't get kernel image!
> Overo #

If you grep for that message you see:

ret = uclass_get_device(UCLASS_MOD_EXP, 0, &mod_exp_dev);
if (ret) {
printf("RSA: Can't find Modular Exp implementation\n");
return -EINVAL;
}

It is trying to find that uclass. Assuming that you have driver model
enabled (CONFIG_DM), I wonder if you have CONFIG_RSA_SOFTWARE_EXP
enabled? Unfortunately it looks like you have to do that manually as
the option is not in Kconfig.

It is a driver for modular exponentiation, used for RSA. Some chips
include hardware acceleration, but there is a software driver as a
fallback.

>
>
> As mentioned in doc/uImage.FIT/beaglebone_vboot.txt, I tried the script -
> tools/fit_check_sign, and its output is normal. Able to verify the
> signature.
>
> So still dont know, what is the exact issue, why I am getting the above
> error message.
> I searched for UCLASS_MOD_EXP, /* RSA Mod Exp device */, but couldn't
> get much info.
>
> What is RSA Mod Exp device and how to make sure that I have that ?
>
> Any input to debugging will be greatly helpful.
>
> Thanks & Regards,
> Arun
>
>

Regards,
Simon

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Sun, May 1, 2016 at 2:55 PM, Simon Glass  wrote:
>>
>> Hi Arun,
>>
>> On 28 April 2016 at 14:48, Arun Kuttiyara Varghese
>>  wrote:
>> > Hi All,
>> >
>> > I was trying to enable the secured boot in u-boot for gumstix overo
>> > storm.
>> >
>> > based on http://www.denx-cs.de/doku/?q=m28verifiedboot
>> >
>> > After I prepared by SD cards, u-boot is not able to boot
>> > and gives the below error message.
>> >
>> >
>> > U-Boot SPL 2015.07 (Apr 28 2016 - 13:53:06)
>> > SPL: Please implement spl_start_uboot() for your board
>>
>> This seems to be implemented for pepper, so to avoid this warning you
>> could add this function for your board.
>> .
>> > SPL: Direct Linux boot not active!
>> > reading u-boot.img
>> > spl_load_image_fat: error reading image u-boot.img, err - -1
>> > SPL: Please implement spl_start_uboot() for your board
>> > SPL: Direct Linux boot not active!
>> > Failed to mount ext2 filesystem...
>> > spl_load_image_ext: ext4fs mount err - 0
>> >
>> > 
>> >
>> > This is the u-boot.dts file that I am using.
>> >
>> >
>> > /dts-v1/;
>> >
>> > / {
>> > model = "Keys";
>> >
>> > signature {
>> > key-dev {
>> > required = "conf";
>> > algo = "sha1,rsa2048";
>> > key-name-hint = "my_key";
>> > };
>> > };
>> > };
>> >
>> > compilation using :
>> > dtc -p 0x1000 /work/u-boot.dts -O dtb -o /work/u-boot.dtb
>> >
>> > And these are the conf that I have added to
>> > include/configs/omap3_overo.h
>> >
>> >  #define CONFIG_OF_CONTROL
>> >  #define CONFIG_OF_SEPARATE
>> >  #define CONFIG_FIT
>> >  #define CONFIG_FIT_SIGNATURE
>> >  #define CONFIG_RSA
>> >  #define CONFIG_FIT_VERBOSE
>>
>> These are in Kconfig now, so you should add them to
>> configs/omap3_overo_defconfig.
>>
>> I'm not sure what is wrong, but those two things might help.
>>
>> >
>> > and I am compiling u-boot by using below line :
>> >
>> > make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- EXT_DTB=/work/u-boot.dtb
>> > all
>> > -j4
>> >
>> > Please let me know if you have any ideas on how to debug this issue.
>> >
>> > Thanks & Regards,
>> > Arun
>> Regards,
>> Simon
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] mkimage: Report information about fpga

2016-05-18 Thread Simon Glass
On 17 May 2016 at 06:59, Michal Simek  wrote:
> Add FIT_FPGA_PROP that user can identify an optional
> entry for fpga.
>
> Signed-off-by: Michal Simek 
> ---
>
>  common/image-fit.c|  4 +++
>  common/image.c|  1 +
>  doc/uImage.FIT/multi-with-fpga.its| 67 
> +++
>  doc/uImage.FIT/source_file_format.txt |  3 ++
>  include/image.h   |  4 ++-
>  5 files changed, 78 insertions(+), 1 deletion(-)
>  create mode 100644 doc/uImage.FIT/multi-with-fpga.its

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


Re: [U-Boot] [PATCH 03/12] board_f: Don't require CONFIG_SYS_MONITOR_BASE

2016-05-18 Thread Simon Glass
Hi Andreas,

On 18 May 2016 at 01:34, Andreas Bießmann  wrote:
> Hi Simon,
>
> On 2016-05-15 02:49, Simon Glass wrote:
>>
>> Allow this to be unset, such that gd->mon_len is invalid. This seems to be
>> what the sh architecture does.
>>
>> Signed-off-by: Simon Glass 
>> ---
>>
>>  common/board_f.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/common/board_f.c b/common/board_f.c
>> index 109025a..d405b5b 100644
>> --- a/common/board_f.c
>> +++ b/common/board_f.c
>> @@ -274,7 +274,7 @@ static int setup_mon_len(void)
>> gd->mon_len = CONFIG_SYS_MONITOR_LEN;
>>  #elif defined(CONFIG_NDS32)
>> gd->mon_len = (ulong)(&__bss_end) - (ulong)(&_start);
>> -#else
>> +#elif defined(CONFIG_SYS_MONITOR_BASE)
>> /* TODO: use (ulong)&__bss_end - (ulong)&__text_start; ? */
>> gd->mon_len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE;
>
>
> before this produced an compile error for undefiend CONFIG_SYS_MONITOR_BASE,
> now it will be silently ignored. Why not leave the else case and use the
> TODO statement instead?

Yes that seems better. I'm a bit tired of the complexity here. Perhaps
I should add #error for the #else case?

> At best we should equalize the linker files and remove the whole ifdiffery
> here.

Yes that needs to be done. More people should contribute to this sort
of clean-up. It's a bit tedious but not super-hard.

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


Re: [U-Boot] [PATCH v1 01/12] common: bootdelay: move CONFIG_BOOTDELAY into a Kconfig option

2016-05-18 Thread Viresh Kumar
Sorry, I had to drop the extremely long cc list, otherwise I wasn't
able to reply to this email. Mutt was rejecting it for some reason.

Any anyway, you should have put all those people in bcc rather.

On 18-05-16, 16:18, Heiko Schocher wrote:
> diff --git a/include/configs/spear-common.h b/include/configs/spear-common.h
> index c4b6234..5e2e2b1 100644
> --- a/include/configs/spear-common.h
> +++ b/include/configs/spear-common.h
> @@ -106,9 +106,7 @@
>   * Default Environment Varible definitions
>   */
>  #if defined(CONFIG_SPEAR_USBTTY)
> -#define CONFIG_BOOTDELAY -1
>  #else
> -#define CONFIG_BOOTDELAY 1
>  #endif

Doesn't this ifdef look strange now ? :)

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


Re: [U-Boot] [PATCH] video: ipu: Fix build with hard-float ARM toolchain

2016-05-18 Thread Peng Fan
Hi Guillaume,

On Wed, May 18, 2016 at 02:19:43PM +0200, Guillaume GARDET wrote:
>Build with hard-float ARM toolchain was broken by commit 3cb4f25c: 
>'video: ipu: avoid overflow issue'.
>To fix it, we use do_div function.
>
>Build tested for mx6qsabrelite_defconfig.
>
>Signed-off-by: Guillaume GARDET 
>Cc: Peng Fan 
>Cc: Sandor Yu 
>Cc: Anatolij Gustschin 
>Cc: Stefano Babic 
>Cc: Fabio Estevam 
>Cc: Tom Rini 
>
>---
> drivers/video/ipu_common.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c
>index 36d4b23..e319c82 100644
>--- a/drivers/video/ipu_common.c
>+++ b/drivers/video/ipu_common.c
>@@ -352,7 +352,8 @@ static int ipu_pixel_clk_set_rate(struct clk *clk, 
>unsigned long rate)
>*/
>   __raw_writel((div / 16) << 16, DI_BS_CLKGEN1(clk->id));
> 
>-  clk->rate = (u64)(clk->parent->rate * 16) / div;
>+  do_div(parent_rate, div);
>+  clk->rate = parent_rate;

This issue was already fixed,.
http://git.denx.de/?p=u-boot/u-boot-imx.git;a=commitdiff;h=c510f2e436008e55a50b063f2180cb1e63984224

Thanks,
Peng.

> 
>   return 0;
> }
>-- 
>1.8.4.5
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] armv8/ls2080ardb: Update DDR timing to support more UDIMMs

2016-05-18 Thread York Sun
On 05/17/2016 09:25 AM, York Sun wrote:
> On 05/05/2016 12:29 PM, York Sun wrote:
>> On 04/06/2016 11:50 PM, Shengzhou Liu wrote:
>>> Optimize DDR timing for good margins to support new Transcend
>>> and Apacer DDR4 UDIMM besides current Micron UDIMM.
>>>
>>> Verified 1333MT/s, 1600MT/s, 1866MT/s, 2133MT/s rate with
>>> following UDIMM on LS2080ARDB.
>>>  - Micron UDIMM: MTA18ASF1G72AZ-2G1A1Z
>>>  - Apacer UDIMM: 78.C1GM4.AF10B
>>>  - Transcend UDIMM: TS1GLH72V1H
>>>
>>> Signed-off-by: Shengzhou Liu 
>>> ---
>>> v2: verified lower rate, for 1333MT/s no changes are necessary. 
>>>
>>>  board/freescale/ls2080ardb/ddr.h | 6 +++---
>>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/board/freescale/ls2080ardb/ddr.h 
>>> b/board/freescale/ls2080ardb/ddr.h
>>> index bda9d4a..b3c6306 100644
>>> --- a/board/freescale/ls2080ardb/ddr.h
>>> +++ b/board/freescale/ls2080ardb/ddr.h
>>> @@ -29,9 +29,9 @@ static const struct board_specific_parameters udimm0[] = {
>>>  * ranks| mhz| GB  |adjst| start |   ctl2|  ctl3
>>>  */
>>> {2,  1350, 0, 4, 6, 0x0708090B, 0x0C0D0E09,},
>>> -   {2,  1666, 0, 4, 8, 0x08090B0D, 0x0E10100C,},
>>> -   {2,  1900, 0, 4, 8, 0x090A0C0E, 0x1012120D,},
>>> -   {2,  2300, 0, 4, 9, 0x0A0B0C10, 0x1114140E,},
>>> +   {2,  1666, 0, 5, 9, 0x090A0B0E, 0x0F0C,},
>>> +   {2,  1900, 0, 6,   0xA, 0x0B0C0E11, 0x1214140F,},
>>> +   {2,  2300, 0, 6,   0xB, 0x0C0D0F12, 0x14161610,},
>>> {}
>>>  };
>>>  
>>>
>>
>> Shengzhou,
>>
>> I see a problem with this patch on one LS2085ARDB board, at 1866MT/s with
>> MT18ASF1G72AZ-2G1A1. Please try it yourself on ls2085rdb-3 (ATX boardfarm). 
>> My
>> order of patches are
>>
>> http://patchwork.ozlabs.org/patch/607290/
>> http://patchwork.ozlabs.org/patch/598135/
>> http://patchwork.ozlabs.org/patch/598136/
>> http://patchwork.ozlabs.org/patch/607274/
>>
>> My test code base is master branch bbca7108db79076d3a9a9c112792d7c4608a665c.
>>
> 
> Shengzhou,
> 
> I rebased the code and repeated the tests on the same board but seeing no 
> issue now.
> 

Shengzhou,

I am still seeing it unstable on ls2085rdb-5 (ATX boardfarm) at 1866MT/s. It can
boot if I change clk_adjust to 5. Please work with hardware team to confirm.

York

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


Re: [U-Boot] [PATCH v2] test/py: Support setting up specific timeout

2016-05-18 Thread Stephen Warren

On 05/18/2016 11:00 AM, Michal Simek wrote:

Large file transfers, flash erasing and more complicated tests
requires more time to finish. Provide a way to setup specific
timeout directly in test.

For example description for 50s test:
timeout = 5
with u_boot_console.temporary_timeout(timeout):
   u_boot_console.run_command(...)



diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py



+class ConsoleSetupTimeout(object):



+def __init__(self, console, timeout):
+self.p = console.p
+self.orig_timeout = self.p.timeout
+self.p.timeout = timeout



+def __exit__(self, extype, value, traceback):
+if not self.p:
+return


That test can't fail, since __init__ already used self.p in a way that 
would have triggered an exception during the constructor, which I 
believe would cause neither __enter__ nor __exit__ to ever be called 
since the object would not exist.


Still, this does no harm, so either way,
Reviewed-by: Stephen Warren 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC] [V2] [PATCH 0/8] a83t: Add initial PSCI / SMP support

2016-05-18 Thread Timothy Pearson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 05/17/2016 09:09 PM, Chen-Yu Tsai wrote:
> Hi,
> 
> On Wed, May 18, 2016 at 3:34 AM,   wrote:
>> Updated to address concerns raised on mailing list.
>>
>> I won't have time to work on this further for a while; please feel free to 
>> use / merge anything from the series that
>> is acceptable.  I'll try to make time again in a month or two to polish the 
>> rest of the patches up if needed.
> 
> I've been reworking the PSCI implementation, rewriting parts of it in C.
> I can pick up your patches and work them into mine.
> 
> For the multicluster bits I might take a more generalized approach though.
> 
> ChenYu

Sounds great, thanks!  Sorry I wasn't able to keep working on the
patches right now; ended up being pulled onto another project.

- -- 
Timothy Pearson
Raptor Engineering
+1 (415) 727-8645 (direct line)
+1 (512) 690-0200 (switchboard)
https://www.raptorengineering.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJXPLE9AAoJEK+E3vEXDOFbEPIH/1gm2VlgbeJYT/Ik5MBpHD8E
3B8GE60AQUamGH1JB8lmKCKGs44Dnvjowt02YY4GEl2p7IFPIyvduWSNzosYRmp8
99IvSV5dvng236EUs1sJN0NFQVzMDJe8ROCuqvjiqohrWAIiMan3hhqhenZEKh8Q
ayQvbsgOoHWInlFc/Gd3//w+CIKz8gP/0417/ahAqL/Hz1ONaEXkbFkbmKZ1L2Hw
gPt3bGVxZ7EMKW5i4R9bZOwg5YNfU3gFjj4G9UU5pJys8iAFpQwQKH/J6tHF9+cv
m3yQxMW1ffwPAXGN0cUwX7PmHBcXD15cPUVphSvZKwxglZbtBm0U9VBiNMcxzHM=
=zv00
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] where is the best place to set the fdt's MAC address?

2016-05-18 Thread Robert P. J. Day

  on current board, the MAC address to be used is stored in a
well-known address in flash, so it's no big deal to read those six
bytes, then set that property in the DTB before handing it off to the
kernel. i'm wondering, though, where the "best" place is to do that.

  first, in "common/image-fdt.c", i see this routine, which gives me a
few options:


int image_setup_libfdt(bootm_headers_t *images, void *blob,
   int of_size, struct lmb *lmb)
{
ulong *initrd_start = &images->initrd_start;
ulong *initrd_end = &images->initrd_end;
int ret = -EPERM;
int fdt_ret;

if (fdt_root(blob) < 0) {
printf("ERROR: root node setup failed\n");
goto err;
}
if (fdt_chosen(blob) < 0) {
printf("ERROR: /chosen node create failed\n");
goto err;
}
if (arch_fixup_fdt(blob) < 0) {
printf("ERROR: arch-specific fdt fixup failed\n");
goto err;
}
if (IMAGE_OF_BOARD_SETUP) {
fdt_ret = ft_board_setup(blob, gd->bd);
if (fdt_ret) {
printf("ERROR: board-specific fdt fixup failed: %s\n",
   fdt_strerror(fdt_ret));
goto err;
}
}
if (IMAGE_OF_SYSTEM_SETUP) {
fdt_ret = ft_system_setup(blob, gd->bd);
if (fdt_ret) {
printf("ERROR: system-specific fdt fixup failed: %s\n",
   fdt_strerror(fdt_ret));
goto err;
}
}
fdt_fixup_ethernet(blob);
... snip ...


  now, since this is a board-specific setting, i'm just guessing i'd
define CONFIG_OF_BOARD_SETUP, then define ft_board_setup() and put it
in there -- the code looks pretty straightforward.

  but then i looked a bit further down and saw the call to
fdt_fixup_ethernet() and thought, hmm, is *that* where i want to
do it?

  i'm pretty sure i can whip together the code that grabs the MAC
address and sets the corresponding property in the DTB, i'm just
curious as to *where* that should be done. thanks muchly.

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday


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


Re: [U-Boot] [PATCH v3 1/7] efi_loader: Add network access support

2016-05-18 Thread Simon Glass
+Tom

Hi Alex,

On 16 May 2016 at 12:06, Alexander Graf  wrote:
>
>
> On 16.05.16 15:24, Simon Glass wrote:
>> Hi Alexander,
>>
>> On 14 May 2016 at 14:34, Alexander Graf  wrote:
>>>
>>>
 Am 14.05.2016 um 21:49 schrieb Simon Glass :

 Hi Alexander,

> On 10 May 2016 at 15:25, Alexander Graf  wrote:
> We can now successfully boot EFI applications from disk, but users
> may want to also run them from a PXE setup.
>
> This patch implements rudimentary network support, allowing a payload
> to send and receive network packets.
>
> With this patch, I was able to successfully run grub2 with network
> access inside of QEMU's -M xlnx-ep108 and on a zcu102 system.
>
> Signed-off-by: Alexander Graf 
>
> ---
>
> v2 -> v3:
>
>  - Align initialization sequence with net code
>  - Set device to initialized after init call
>  - Align tx buffers to DMA alignment (rx gets memcpy'd)
>  - Add comment about eth_rx()
> ---
> cmd/bootefi.c|   7 ++
> include/efi_api.h| 119 ++
> include/efi_loader.h |   7 ++
> include/net.h|   2 +-
> lib/efi_loader/Makefile  |   1 +
> lib/efi_loader/efi_net.c | 314 
> +++
> net/bootp.c  |   2 +
> net/net.c|   4 +-
> net/tftp.c   |   2 +
> 9 files changed, 455 insertions(+), 3 deletions(-)
> create mode 100644 lib/efi_loader/efi_net.c
>
> diff --git a/cmd/bootefi.c b/cmd/bootefi.c
> index 7f552fc..d3a2331 100644
> --- a/cmd/bootefi.c
> +++ b/cmd/bootefi.c
> @@ -197,6 +197,13 @@ static unsigned long do_bootefi_exec(void *efi, void 
> *fdt)
> #ifdef CONFIG_LCD
>efi_gop_register();
> #endif
> +#ifdef CONFIG_NET
> +   void *nethandle = loaded_image_info.device_handle;
> +   efi_net_register(&nethandle);
> +
> +   if (!memcmp(bootefi_device_path[0].str, "N\0e\0t", 6))
> +   loaded_image_info.device_handle = nethandle;
> +#endif
>
>/* Call our payload! */
> #ifdef DEBUG_EFI
> diff --git a/include/efi_api.h b/include/efi_api.h
> index 51d7586..20035d7 100644
> --- a/include/efi_api.h
> +++ b/include/efi_api.h
> @@ -412,4 +412,123 @@ struct efi_gop
>struct efi_gop_mode *mode;
> };
>
> +#define EFI_SIMPLE_NETWORK_GUID \
> +   EFI_GUID(0xa19832b9, 0xac25, 0x11d3, \
> +0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d)
> +
> +struct efi_mac_address {
> +   char mac_addr[32];
> +};
> +
> +struct efi_ip_address {
> +   u8 ip_addr[16];
> +};
> +
> +enum efi_simple_network_state {
> +   EFI_NETWORK_STOPPED,
> +   EFI_NETWORK_STARTED,
> +   EFI_NETWORK_INITIALIZED,
> +};
> +
> +struct efi_simple_network_mode {
> +   enum efi_simple_network_state state;
> +   u32 hwaddr_size;
> +   u32 media_header_size;
> +   u32 max_packet_size;
> +   u32 nvram_size;
> +   u32 nvram_access_size;
> +   u32 receive_filter_mask;
> +   u32 receive_filter_setting;
> +   u32 max_mcast_filter_count;
> +   u32 mcast_filter_count;
> +   struct efi_mac_address mcast_filter[16];
> +   struct efi_mac_address current_address;
> +   struct efi_mac_address broadcast_address;
> +   struct efi_mac_address permanent_address;
> +   u8 if_type;
> +   u8 mac_changeable;
> +   u8 multitx_supported;
> +   u8 media_present_supported;
> +   u8 media_present;
> +};
> +
> +#define EFI_SIMPLE_NETWORK_RECEIVE_UNICAST 0x01,
> +#define EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST 0x02,
> +#define EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST 0x04,
> +#define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS   0x08,
> +#define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST 0x10,
> +
> +struct efi_simple_network
> +{
> +   u64 revision;
> +   efi_status_t (EFIAPI *start)(struct efi_simple_network *this);
> +   efi_status_t (EFIAPI *stop)(struct efi_simple_network *this);
> +   efi_status_t (EFIAPI *initialize)(struct efi_simple_network *this,
> +   ulong extra_rx, ulong extra_tx);
> +   efi_status_t (EFIAPI *reset)(struct efi_simple_network *this,
> +   int extended_verification);
> +   efi_status_t (EFIAPI *shutdown)(struct efi_simple_network *this);
> +   efi_status_t (EFIAPI *receive_filters)(struct efi_simple_network 
> *this,
> +   u32 enable, u32 disable, int reset_mcast_filter,
> +   ulong mcast_filter_count,
> +   struct efi_mac_address *

Re: [U-Boot] Enumerate Buetooth Dongle via xHCI fails set configuration command

2016-05-18 Thread Mohammed Mohisin
Any help is highly appreciated .

On Tue, May 17, 2016 at 11:00 PM, Mohammed Mohisin <
mohammedmohi...@gmail.com> wrote:

> Trying to enumerate a bluetooth dongle.
> The connected bluetooth dongle has 2 interfaces. Pls see the bottom of the
> mail for device and config descriptors.
> We are using interface 0 having 3 end points - Interrupt IN, Bulk OUT and
> Bulk In.
>
> For enumeration we are still using uboot's "usb_new_device()" function.
> As part of "usb_new_device" function, we call "usb_set_configuration()" -->
> "xhci_set_configuration()" --> xhci_configure_endpoints(udev, false);
> and fails here returning error code 17"
>
> Here are the steps to reproduce:
> 1) Program the latest uboot image on any board having usb 3.0
> We are using Marvell's A38X.
> 2) Connect the bluetooth 4.0 dongle for example:  "Air console"
> 3) set usbType 3
> 4) usb start
>
> u will see the below error:
> ---
> set configuration 1
> usb_control_msg: request: 0x9, requesttype: 0x0, value 0x1 index 0x0 length
> 0x0
> EP STATE RUNNING.
> ERROR: Configure Endpoint command returned completion code 17.
> Failed to configure xHC endpoint
> failed to set default configuration len 177, status 8000
> Freeing device node: 1
> hub: disabling port 2
>
> Any help is highly appreciated.
>
> Regards
> ---
> 
>
> Manufacturer:
>
> Version: 136.9.1
>
> Serial Number:
>
> Device Handle: 0x102
>
> USB Version Compliance: 2.9
>
> Class Code: 0xE0
>
> Subclass Code: 0x1
>
> Protocol: 0x1
>
> Vendor ID: 0xA12
>
> Product ID: 0x1
>
> Max. Packet Size of Endpoint Zero: 64
>
> Number of Configurations: 1
>
> Speed: Full
>
> Selected Configuration: 1
>
> Selected Interface: 0
>
>
>
> Configuration:
>
> Number: 1
>
> Number of Interfaces: 2
>
> Description:
>
> Attributes: Self-powered
>
> Max Power: 100 mA
>
>
>
> Interface:
>
> Number: 0
>
> Description:
>
> Class Code: 224
>
> Subclass: 1
>
> Protocol: 1
>
> Number of Endpoints: 3
>
>
>
> Endpoint:
>
> Number: 1
>
> Transfer Type: INTERRUPT
>
> Transfer Direction: Device to Host
>
> Max Packet: 16
>
> Interval: 1
>
>
>
> Endpoint:
>
> Number: 2
>
> Transfer Type: BULK
>
> Transfer Direction: Host to Device
>
> Max Packet: 64
>
> Interval: 1
>
>
>
> Endpoint:
>
> Number: 2
>
> Transfer Type: BULK
>
> Transfer Direction: Device to Host
>
> Max Packet: 64
>
> Interval: 1
>
>
>
> Interface:
>
> Number: 1
>
> Description:
>
> Class Code: 224
>
> Subclass: 1
>
> Protocol: 1
>
> Number of Endpoints: 2
>
>
>
> Endpoint:
>
> Number: 3
>
> Transfer Type: ISOCHRONOUS
>
> Transfer Direction: Host to Device
>
> Max Packet: 0
>
> Interval: 1
>
>
>
> Endpoint:
>
> Number: 3
>
> Transfer Type: ISOCHRONOUS
>
> Transfer Direction: Device to Host
>
> Max Packet: 0
>
> Interval: 1
>
>
>>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] test/py: Support setting up specific timeout

2016-05-18 Thread Michal Simek
On 18.5.2016 18:43, Stephen Warren wrote:
> On 05/18/2016 07:11 AM, Michal Simek wrote:
>> Large file transfers, flash erasing and more complicated tests
>> requires more time to finish. Provide a way to setup specific
>> timeout directly in test.
>>
>> For example description for 50s test:
>> timeout = 5
>> with u_boot_console.temporary_timeout(timeout):
>>u_boot_console.run_command(...)
> 
>> diff --git a/test/py/u_boot_console_base.py
>> b/test/py/u_boot_console_base.py
> 
>>   self.console.eval_bad_patterns()
>>
>> +
> 
> Nit: No need for two blank lines.
> 
>> +class ConsoleSetupTimeout(object):
>> +"""Context manager (for Python's with statement) that temporarily
>> setup
> 
> Nit: s/set/sets up/
> 
>> +timeout for specific comnand. This is useful when execution time
>> is greater
> 
> Nit: s/comnand/command/
> 
>> +then default 30s."""
>> +
>> +def __init__(self, console, timeout):
>> +self.console = console
>> +self.console.orig_timeout = self.console.p.timeout
>> +self.console.p.timeout = timeout
> 
> I'd suggest storing console.p not console. That way, even if console.p
> is replaced because of an issue, you still have a handle to it and don't
> have to make the code in __exit__ conditional:
> 
> self.p = console.p
> self.orig_timeout = self.p.timeout
> self.p.timeout = timeout
> 
>> +
>> +def __enter__(self):
>> +return self
>> +
>> +def __exit__(self, extype, value, traceback):
>> +self.console.p = self.console.get_spawn()
>> +self.console.p.timeout = self.console.orig_timeout
> 
> This then doesn't need the conditionals you mentioned in your response
> to this patch, and can then be:
> 
> self.p.timeout = self.orig_timeout
> 
>> +def temporary_timeout(self, timeout):
>> +"""Temporarily setup different timeout for commands.
> 
> Nit: s/setup/set up/
> 
>> +Args:
>> +timeout: Time in miliseconds.
> 
> Nit: s/miliseconds/milliseconds/
> 

I have fixed all of these comments and send v2.

Thanks,
Michal

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


[U-Boot] [PATCH v2] test/py: Support setting up specific timeout

2016-05-18 Thread Michal Simek
Large file transfers, flash erasing and more complicated tests
requires more time to finish. Provide a way to setup specific
timeout directly in test.

For example description for 50s test:
timeout = 5
with u_boot_console.temporary_timeout(timeout):
  u_boot_console.run_command(...)

Signed-off-by: Michal Simek 
---

Changes in v2:
- save console.p instead of simple console
- Some fixes in comments
- Save orig_timeout directly in class
- Remove get_spawn call
- Test if self.p exists

 test/py/u_boot_console_base.py | 33 +
 1 file changed, 33 insertions(+)

diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py
index f7434363fbcb..dbbdd53b46dc 100644
--- a/test/py/u_boot_console_base.py
+++ b/test/py/u_boot_console_base.py
@@ -56,6 +56,24 @@ class ConsoleDisableCheck(object):
 self.console.disable_check_count[self.check_type] -= 1
 self.console.eval_bad_patterns()
 
+class ConsoleSetupTimeout(object):
+"""Context manager (for Python's with statement) that temporarily sets up
+timeout for specific command. This is useful when execution time is greater
+then default 30s."""
+
+def __init__(self, console, timeout):
+self.p = console.p
+self.orig_timeout = self.p.timeout
+self.p.timeout = timeout
+
+def __enter__(self):
+return self
+
+def __exit__(self, extype, value, traceback):
+if not self.p:
+return
+self.p.timeout = self.orig_timeout
+
 class ConsoleBase(object):
 """The interface through which test functions interact with the U-Boot
 console. This primarily involves executing shell commands, capturing their
@@ -391,3 +409,18 @@ class ConsoleBase(object):
 """
 
 return ConsoleDisableCheck(self, check_type)
+
+def temporary_timeout(self, timeout):
+"""Temporarily set up different timeout for commands.
+
+Create a new context manager (for use with the "with" statement) which
+temporarily change timeout.
+
+Args:
+timeout: Time in milliseconds.
+
+Returns:
+A context manager object.
+"""
+
+return ConsoleSetupTimeout(self, timeout)
-- 
1.9.1

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


Re: [U-Boot] [PATCH 1/2] Add a reset driver framework/uclass

2016-05-18 Thread Stephen Warren

On 05/17/2016 03:56 PM, Simon Glass wrote:

Hi Stephen,

On 17 May 2016 at 10:46, Stephen Warren  wrote:

From: Stephen Warren 

A reset controller is a hardware module that controls reset signals that
affect other hardware modules or chips.

This patch defines a standard API that connects reset clients (i.e. the
drivers for devices affected by reset signals) to drivers for reset
controllers/providers. Initially, DT is the only supported method for
connecting the two.

The DT binding specification (reset.txt) was taken from Linux kernel
v4.5's Documentation/devicetree/bindings/reset/reset.txt.


(trimming the quoted text is useful...)


diff --git a/include/reset_client.h b/include/reset_client.h



+/**
+ * struct reset_ctl - A handle to (allowing control of) a single reset signal.
+ *
+ * Clients provide storage for reset control handles. The content of the
+ * structure is managed solely by the reset API and reset drivers. A reset
+ * control struct is initialized by "get"ing the reset control struct. The
+ * reset control struct is passed to all other reset APIs to identify which
+ * reset signal to operate upon.
+ *
+ * @dev: The device which implements the reset signal.
+ * @id: The reset signal ID within the provider.
+ *
+ * Currently, the reset API assumes that a single integer ID is enough to
+ * identify and configure any reset signal for any reset provider. If this
+ * assumption becomes invalid in the future, the struct could be expanded to
+ * either (a) add more fields to allow reset providers to store additional
+ * information, or (b) replace the id field with an opaque pointer, which the
+ * provider would dynamically allocated during its .of_xlate op, and process
+ * during is .request op. This may require the addition of an extra op to clean
+ * up the allocation.
+ */
+struct reset_ctl {
+   struct udevice *dev;
+   /*
+* Written by of_xlate. We assume a single id is enough for now. In the
+* future, we might add more fields here.
+*/
+   unsigned long id;


This feels like an obfuscation to me. Why not just use an int instead
of this struct? This is what clock does.


DT allows multiple cells for all resource specifiers (GPIOs, mailboxes, 
clocks, resets, interrupts). There are actual real-world cases (at least 
in DTs in the Linux kernel, even if not in U-Boot[1]) of specifiers of 
more than a single cell. It may not be possible to pack those multiple 
cells into a single integer, and semantically doesn't make much sense to 
do so if it didn't make sense to do so in DT. Consequently, we must plan 
for this case by allowing for client resource handles more capable than 
a single integer. The drivers I'm currently working on do use only a 
single integer, so that's all I've put into this struct for now. 
However, I fully expect other driver authors to need to add additional 
fields here, as explained in the comments quoted above.


Note that this scheme is identical to the mailbox driver that you 
already ack'd.


It's also an abstraction not an obfuscation; clients should not need to 
know/care about how drivers-that-provide-resources or DT or any other 
scheme represents/configures resources; clients should simply get a 
single opaque handle that allows them to manipulate the resource through 
standard APIs. Forcing clients to store a separate provider device 
handle and ID integer (and in the future, any additional fields 
required) puts too heavy a burden on the resource consumer, and exposes 
knowledge to them that they do not need.


Re: the clock API: I'm planning on changing that to this style too, for 
the same reasons. Additionally, clk_get_by_index() currently returns 
part of the resource handle (the resource's integer ID) as the return 
value, and part (the provider udevice pointer) as an "out" function 
parameter, which I found extremely confusing and non-obvious when 
reading the function signature. With the scheme in this patch, a single 
value is returned to the caller by the "get" function, which makes life 
much simpler.

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


Re: [U-Boot] [PATCH v2] SPL: FIT: Enable SPL_FIT_LOAD in RAM based boot mode

2016-05-18 Thread Lokesh Vutla



On 5/18/2016 8:52 PM, Michal Simek wrote:

On 18.5.2016 17:12, Lokesh Vutla wrote:



On 5/17/2016 10:30 PM, Michal Simek wrote:

Support loading FIT in SPL for RAM bootmode.
CONFIG_SPL_LOAD_FIT_ADRESS points to address where FIT image is stored
in memory.

Signed-off-by: Michal Simek 
Reviewed-by: Simon Glass 
---

Changes in v2:
- Fix empty line
- Fix addr name and remove SPL_LOAD_FIT macro

   common/spl/spl.c | 45 -
   1 file changed, 36 insertions(+), 9 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 0fc5b058be31..3faa751e4b43 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -136,20 +136,47 @@ __weak void __noreturn
jump_to_image_no_args(struct spl_image_info *spl_image)
   image_entry();
   }

+#ifndef CONFIG_SPL_LOAD_FIT_ADDRESS
+# define CONFIG_SPL_LOAD_FIT_ADDRESS0
+#endif
+


May be a good idea to default this to CONFIG_SYS_TEXT_BASE instead of 0?


The problem is that if u-boot is in FIT that it will be loaded to
TEXT_BASE address.
Maybe easier to just don't define any value which end up in compilation
error.


Yeah, you were right. Initially I was thinking there won't be a problem
overriding the data. You can leave it as is.

Thanks and regards,
Lokesh



Thanks,
Michal


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


Re: [U-Boot] [PATCH] test/py: Support setting up specific timeout

2016-05-18 Thread Stephen Warren

On 05/18/2016 07:11 AM, Michal Simek wrote:

Large file transfers, flash erasing and more complicated tests
requires more time to finish. Provide a way to setup specific
timeout directly in test.

For example description for 50s test:
timeout = 5
with u_boot_console.temporary_timeout(timeout):
   u_boot_console.run_command(...)



diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py



  self.console.eval_bad_patterns()

+


Nit: No need for two blank lines.


+class ConsoleSetupTimeout(object):
+"""Context manager (for Python's with statement) that temporarily setup


Nit: s/set/sets up/


+timeout for specific comnand. This is useful when execution time is greater


Nit: s/comnand/command/


+then default 30s."""
+
+def __init__(self, console, timeout):
+self.console = console
+self.console.orig_timeout = self.console.p.timeout
+self.console.p.timeout = timeout


I'd suggest storing console.p not console. That way, even if console.p 
is replaced because of an issue, you still have a handle to it and don't 
have to make the code in __exit__ conditional:


self.p = console.p
self.orig_timeout = self.p.timeout
self.p.timeout = timeout


+
+def __enter__(self):
+return self
+
+def __exit__(self, extype, value, traceback):
+self.console.p = self.console.get_spawn()
+self.console.p.timeout = self.console.orig_timeout


This then doesn't need the conditionals you mentioned in your response 
to this patch, and can then be:


self.p.timeout = self.orig_timeout


+def temporary_timeout(self, timeout):
+"""Temporarily setup different timeout for commands.


Nit: s/setup/set up/


+Args:
+timeout: Time in miliseconds.


Nit: s/miliseconds/milliseconds/

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


Re: [U-Boot] [PATCH v1 02/12] tests: py: disable main_signon check for printenv cmd

2016-05-18 Thread Stephen Warren

On 05/18/2016 08:18 AM, Heiko Schocher wrote:

if CONFIG_VERSION_VARIABLE is set, the U-Boot environment
contains a "vers" variable with the current U-Boot version
string. If now "printenv" is called, test/py fails as it
detects the main_sign string, which is in this case correct.

So check only the main_sign as an error, if CONFIG_VERSION_VARIABLE
is not set.


Interesting. I wonder if it would be possible to instead adjust the 
regex so it didn't match the printenv output; that way if printenv 
crashed and the system rebooted, the test would still catch it. Still, 
the current patch is probably simpler and the window for issues small 
enough that I think this is fine.



diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py



+if self.u_boot_console.config.buildconfig['config_version_variable'] 
== 'y':


I think that should instead be:


if self.u_boot_console.config.buildconfig.get('config_version_variable', 'n') 
== 'y':


That way, if there's no value for CONFIG_VERSION_VARIABLE at all, the 
code will still work, rather than raising an exception when the lookup 
fails.


With that change,
Acked-by: Stephen Warren 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v1 01/12] common: bootdelay: move CONFIG_BOOTDELAY into a Kconfig option

2016-05-18 Thread Stephen Warren

On 05/18/2016 08:18 AM, Heiko Schocher wrote:

move CONFIG_BOOTDELAY into a Kconfig option. Used for this
purpose the moveconfig.py tool in tools.


Acked-by: Stephen Warren 

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


Re: [U-Boot] [PATCH 1/3] net: xilinx: Handle error value from phy_startup()

2016-05-18 Thread Stephen Warren

On 05/18/2016 05:20 AM, Michal Simek wrote:

Handle error returned by phy_startup() properly.


The series,
Acked-by: Stephen Warren 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   3   >