Pull request: u-boot-rockchip-20200501

2020-05-01 Thread Kever Yang
Hi Tom,

Please pull the rockchip updates/fixes:
- dts clean up to use -u-boot for px30, rk3399 boards
- dts sycn from upstream kernel for rk3328, rk3399
- add rockchip rng driver
- new board support: rk3328-roc-cc, rk3399-roc-pc,Nanopi M4 2GB

Gitlab CI:
https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip/pipelines/3061

Thanks,
- Kever

The following changes since commit d16d37bcd4087b8ea0f66cb76a73edad182d151a:

  Merge tag 'video-for-v2020.07-rc1' of 
https://gitlab.denx.de/u-boot/custodians/u-boot-video (2020-04-27 09:41:51 
-0400)

are available in the Git repository at:

  https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip.git 
tags/u-boot-rockchip-20200501

for you to fetch changes up to d597e613745155d2c48ed90617b3fce81af92fbd:

  rockchip: rk3399: Add Nanopi M4 2GB board support (2020-05-01 18:32:56 +0800)


Chen-Yu Tsai (9):
  rockchip: dts: rk3328-evb: Move vcc5v0-host-xhci-drv to -u-boot.dtsi
  rockchip: dts: rk3328-evb: Move gmac2io related nodes to -u-boot.dtsi
  rockchip: dts: rk3328: Move OTG node's hnp-srp-disable to 
rk3328-u-boot.dtsi
  dt-bindings: clock: rk3328: sync from upstream Linux kernel
  dt-bindings: power: rk3328-power: sync from upstream Linux kernel
  rockchip: rk3328: Disable generic PHY support
  rockchip: dts: rk3328: Sync device tree files from Linux
  rockchip: rk3328: Add support for ROC-RK3328-CC board
  rockchip: dts: rock64: Fix XHCI usage

Deepak Das (1):
  rockchip: rk3399: Add Nanopi M4 2GB board support

Jagan Teki (5):
  arm64: dts: rk3399-puma: Move u-boot properties into -u-boot.dtsi
  arm64: dts: rk3399-evb: Move u-boot properties into -u-boot.dtsi
  clk: rk3399: Set empty for HCLK_SD assigned-clocks
  arm64: dts: rk3399: Sync v5.7-rc1 from Linux
  arm: dts: rk3399: Sync roc-pc-mezzanine from v5.7-rc1

Kever Yang (4):
  rockchip: video: Use ofnode_decode_display_timing() to parse timing
  rockchip: video: Convert to use APIs which support live DT
  rockchip: px30: add -u-boot dtsi for soc
  rockchip: px30-evb: remove redundant include file

Lin Jinhan (5):
  arm: dts: rockchip: rk3399: add and enable rng node
  arm: dts: rockchip: px30: add and enable rng node
  rockchip: rng: Add a driver for random number generator(rng) device
  rockchip: rk3399: Enable CONFIG_RNG_ROCKCHIP
  rockchip: px30: Enable CONFIG_RNG_ROCKCHIP

Suniel Mahesh (3):
  arm: dts: rockchip: rk3399-roc-pc: Enable FE1.1 USB 2.0 HUB on 
roc-rk3399-pc
  rockchip: board: roc-pc-rk3399: Remove support for push button
  rk3399: Add ROC-RK3399-PC Mezzanine board

 arch/arm/dts/Makefile|3 +
 arch/arm/dts/cros-ec-keyboard.dtsi   |   10 +-
 arch/arm/dts/cros-ec-sbs.dtsi|   39 +-
 arch/arm/dts/px30-evb-u-boot.dtsi|   80 +-
 arch/arm/dts/px30-evb.dts|1 -
 arch/arm/dts/px30-firefly-u-boot.dtsi|   82 +-
 arch/arm/dts/px30-u-boot.dtsi|   90 ++
 arch/arm/dts/rk3328-evb-u-boot.dtsi  |   39 +
 arch/arm/dts/rk3328-evb.dts  |  220 ++--
 arch/arm/dts/rk3328-roc-cc-u-boot.dtsi   |   47 +
 arch/arm/dts/rk3328-roc-cc.dts   |  354 ++
 arch/arm/dts/rk3328-rock64-u-boot.dtsi   |   11 +
 arch/arm/dts/rk3328-rock64.dts   |  132 +-
 arch/arm/dts/rk3328-u-boot.dtsi  |4 +
 arch/arm/dts/rk3328.dtsi | 1415 ++
 arch/arm/dts/rk3399-evb-u-boot.dtsi  |   12 +
 arch/arm/dts/rk3399-evb.dts  |  522 +---
 arch/arm/dts/rk3399-ficus.dts|6 +
 arch/arm/dts/rk3399-firefly.dts  |  251 +++-
 arch/arm/dts/rk3399-gru-bob.dts  |   16 +-
 arch/arm/dts/rk3399-gru-chromebook.dtsi  |   40 +-
 arch/arm/dts/rk3399-gru-kevin.dts|   34 +-
 arch/arm/dts/rk3399-gru.dtsi |   89 +-
 arch/arm/dts/rk3399-khadas-edge.dtsi |3 +
 arch/arm/dts/rk3399-leez-p710.dts|   36 +-
 arch/arm/dts/rk3399-nanopc-t4.dts|   47 +-
 arch/arm/dts/rk3399-nanopi-m4-2gb-u-boot.dtsi|8 +
 arch/arm/dts/rk3399-nanopi-m4-2gb.dts|   66 +
 arch/arm/dts/rk3399-nanopi4.dtsi |   66 +-
 arch/arm/dts/rk3399-orangepi.dts |   79 +-
 arch/arm/dts/rk3399-puma-u-boot.dtsi |   31 +-
 arch/arm/dts/rk3399-puma.dtsi|  578 -
 arch/arm/dts/rk3399-roc-pc-mezzanine-u-boot.dtsi |6 +
 arch/arm/dts/rk3399-roc-pc-mezzanine.dts |   93 ++
 arch/arm/dts/rk3399-roc-pc-u-boot.dtsi   |   36 +
 arch/arm/dts/rk3399-roc-pc.dts   |3 +-
 arch/arm/dts/rk3399-roc-pc.dtsi  |   35 +-
 arch/arm/dts/rk3399-rock-pi-4.dts

[PATCH 2/2] patman: Add an option to create patches without binary contents

2020-05-01 Thread Bin Meng
Some mailing lists have size limits and when we add binary contents
to our patches it's easy to exceed the size limits.

Git supports a command line option "--no-binary" to generate patches
without any binary contents. Add an option in patman to handle this.
Note with this option patches cannot be applied properly, but they
are still useful for code review.

Signed-off-by: Bin Meng 
---

 tools/patman/gitutil.py | 4 +++-
 tools/patman/main.py| 5 -
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index 770a051..72fc95d 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -254,7 +254,7 @@ def Fetch(git_dir=None, work_tree=None):
 if result.return_code != 0:
 raise OSError('git fetch: %s' % result.stderr)
 
-def CreatePatches(start, count, series):
+def CreatePatches(start, count, ignore_binary, series):
 """Create a series of patches from the top of the current branch.
 
 The patch files are written to the current directory using
@@ -270,6 +270,8 @@ def CreatePatches(start, count, series):
 if series.get('version'):
 version = '%s ' % series['version']
 cmd = ['git', 'format-patch', '-M', '--signoff']
+if ignore_binary:
+cmd.append('--no-binary')
 if series.get('cover'):
 cmd.append('--cover-letter')
 prefix = series.GetPatchPrefix()
diff --git a/tools/patman/main.py b/tools/patman/main.py
index 72c67b8..2951836 100755
--- a/tools/patman/main.py
+++ b/tools/patman/main.py
@@ -58,6 +58,9 @@ parser.add_option('-T', '--thread', action='store_true', 
dest='thread',
   default=False, help='Create patches as a single thread')
 parser.add_option('--cc-cmd', dest='cc_cmd', type='string', action='store',
default=None, help='Output cc list for patch file (used by git)')
+parser.add_option('--no-binary', action='store_true', dest='ignore_binary',
+  default=False,
+  help="Do not output contents of changes in binary files")
 parser.add_option('--no-check', action='store_false', dest='check_patch',
   default=True,
   help="Don't check for patch compliance")
@@ -144,7 +147,7 @@ else:
 if options.count:
 series = patchstream.GetMetaData(options.start, options.count)
 cover_fname, args = gitutil.CreatePatches(options.start, options.count,
-series)
+options.ignore_binary, series)
 
 # Fix up the patch files to our liking, and insert the cover letter
 patchstream.FixPatches(series, args)
-- 
2.7.4



[PATCH 1/2] patman: Sort the command line options

2020-05-01 Thread Bin Meng
Sort the existing command line options by:

- help comes first
- option starts with '-'
- option starts with '--'

Lower case followed by upper case letters, in alphabetical order.

Signed-off-by: Bin Meng 
---

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

diff --git a/tools/patman/main.py b/tools/patman/main.py
index f3d9c0c..72c67b8 100755
--- a/tools/patman/main.py
+++ b/tools/patman/main.py
@@ -36,11 +36,11 @@ parser.add_option('-c', '--count', dest='count', type='int',
 parser.add_option('-i', '--ignore-errors', action='store_true',
dest='ignore_errors', default=False,
help='Send patches email even if patch errors are found')
+parser.add_option('-l', '--limit-cc', dest='limit', type='int',
+   default=None, help='Limit the cc list to LIMIT entries [default: 
%default]')
 parser.add_option('-m', '--no-maintainers', action='store_false',
dest='add_maintainers', default=True,
help="Don't cc the file maintainers automatically")
-parser.add_option('-l', '--limit-cc', dest='limit', type='int',
-   default=None, help='Limit the cc list to LIMIT entries [default: 
%default]')
 parser.add_option('-n', '--dry-run', action='store_true', dest='dry_run',
default=False, help="Do a dry run (create but don't email patches)")
 parser.add_option('-p', '--project', default=project.DetectProject(),
@@ -52,10 +52,10 @@ parser.add_option('-s', '--start', dest='start', type='int',
default=0, help='Commit to start creating patches from (0 = HEAD)')
 parser.add_option('-t', '--ignore-bad-tags', action='store_true',
   default=False, help='Ignore bad tags / aliases')
-parser.add_option('--test', action='store_true', dest='test',
-  default=False, help='run tests')
 parser.add_option('-v', '--verbose', action='store_true', dest='verbose',
default=False, help='Verbose output of errors and warnings')
+parser.add_option('-T', '--thread', action='store_true', dest='thread',
+  default=False, help='Create patches as a single thread')
 parser.add_option('--cc-cmd', dest='cc_cmd', type='string', action='store',
default=None, help='Output cc list for patch file (used by git)')
 parser.add_option('--no-check', action='store_false', dest='check_patch',
@@ -65,8 +65,8 @@ parser.add_option('--no-tags', action='store_false', 
dest='process_tags',
   default=True, help="Don't process subject tags as aliaes")
 parser.add_option('--smtp-server', type='str',
   help="Specify the SMTP server to 'git send-email'")
-parser.add_option('-T', '--thread', action='store_true', dest='thread',
-  default=False, help='Create patches as a single thread')
+parser.add_option('--test', action='store_true', dest='test',
+  default=False, help='run tests')
 
 parser.usage += """
 
-- 
2.7.4



Re: [PATCH] actions: Fix syntax for enabling SYS_RELOC_GD_ENV_ADDR

2020-05-01 Thread Tom Rini
On Fri, May 01, 2020 at 10:53:29AM -0400, Tom Rini wrote:

> The correct syntax is 'select SYS_...' and not 'select CONFIG_SYS...'
> 
> Fixes: d5c819b885c2 ("actions: Move defconfig options to Kconfig")
> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 1/1] .readthedocs.yml: fix type docs/

2020-05-01 Thread Tom Rini
On Fri, May 01, 2020 at 10:06:17PM +0200, Heinrich Schuchardt wrote:

> Out documentation directory is doc/ and not docs/.
> 
> Signed-off-by: Heinrich Schuchardt 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] rtc: pcf2127: don't add/subtract 1 to tm_mon

2020-05-01 Thread Tom Rini
On Fri, May 01, 2020 at 03:24:50PM +0200, Rasmus Villemoes wrote:

> As noted in rtc_def.h, the tm_mon field in struct rtc_time is 1-12,
> unlike in struct tm where it is 0-11. Currently, running "date" prints
> the wrong
> 
> Date: 2020-04-01 (Friday)Time: 13:05:30
> 
> and setting the RTC via the date command is also broken.
> 
> Signed-off-by: Rasmus Villemoes 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v3] malloc: dlmalloc: add an ability for the malloc to be re-init/init multiple times

2020-05-01 Thread Tom Rini
On Wed, Apr 29, 2020 at 06:23:07PM +0200, marek.bykow...@gmail.com wrote:

> From: Marek Bykowski 
> 
> Malloc gets initialized with a call to mem_malloc_init() with the address
> the allocation starts to and its size. Currently it is not possible to
> move the malloc from one memory area to another as the malloc would eventually
> fail.
> 
> This patch adds in the ability to re-init the malloc with the updated
> start address and the size.
> 
> One of the use cases of this feature is SPL U-Boot running from within
> the static memory and calling to malloc init from within board_init_f():
> 
>   arch/arm/cpu/armv8/start.S:reset vector
>   arch/arm/cpu/armv8/start.S:main()
>   arch/arm/lib/crt0_64.S:board_init_f()
>   board//common/spl.c:board_init_f()
> 
> board//common/spl.c:mem_malloc_init((ulong)CONFIG_SYS_SPL_MALLOC_START,
> CONFIG_SYS_SPL_MALLOC_SIZE);
> 
> Shortly after the DDR (main) memory is init and ready we call to malloc init
> again but this time with the start address in the DDR memory and a much 
> greater
> size for moving the allocation off the static to the DDR memory:
> 
>   
> board//common/spl.c:mem_malloc_init((ulong)CONFIG_SPL_MALLOC_OFFSET,
>   CONFIG_SPL_MALLOC_SIZE);
> 
> Where CONFIG_SYS_SPL_MALLOC_START and CONFIG_SPL_MALLOC_OFFSET are the start
> addresses of the malloc in the static and DDR memories respectively and
> CONFIG_SYS_SPL_MALLOC_SIZE=SZ_16K and CONFIG_SPL_MALLOC_SIZE=SZ_2M are
> the sizes of the mallocs in these memories. Note, now we have a much greater
> memory, enlarging from 16K to 2M, available for allocation.
> 
> There is an alternative approach already existing in U-Boot with the use of
> an early (simplified) malloc and the proper (dlamalloc) malloc however
> necessitating managing the two mallocs whereas this approach proposes using
> a single dlmalloc.
> 
> Signed-off-by: Marek Bykowski 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v3 2/2] rsa: sig: fix config signature check for fit with padding

2020-05-01 Thread Tom Rini
On Wed, Apr 29, 2020 at 03:26:17PM +0200, Philippe Reynes wrote:

> The signature check on config node is broken on fit with padding.
> To compute the signature for config node, U-Boot compute the
> signature on all properties of requested node for this config,
> except for the property "data". But, when padding is used for
> binary in a fit, there isn't a property "data" but two properties:
> "data-offset" and "data-size". So to fix the check of signature,
> we also don't use the properties "data-offset" and "data-size"
> when checking the signature on config node.
> 
> Reviewed-by: Simon Glass 
> Signed-off-by: Philippe Reynes 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 1/1] hush: avoid NULL check before free()

2020-05-01 Thread Tom Rini
On Tue, Apr 28, 2020 at 09:56:10PM +0200, Heinrich Schuchardt wrote:

> free() checks if its argument is NULL. Don't duplicate this in the calling
> code.
> 
> Signed-off-by: Heinrich Schuchardt 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v3 1/2] test/py: vboot: add a test to check fit signature on fit with padding

2020-05-01 Thread Tom Rini
On Wed, Apr 29, 2020 at 03:26:16PM +0200, Philippe Reynes wrote:

> The pytest vboot does all his tests on fit without padding.
> We add the same tests on fit with padding.
> 
> Reviewed-by: Simon Glass 
> Signed-off-by: Philippe Reynes 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 1/1] fs: ext4: avoid NULL check before free()

2020-05-01 Thread Tom Rini
On Tue, Apr 28, 2020 at 09:50:02PM +0200, Heinrich Schuchardt wrote:

> free() checks if its argument is NULL. Don't duplicate this in the calling
> code.
> 
> Signed-off-by: Heinrich Schuchardt 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 1/1] cmd/gpt: avoid NULL check before free()

2020-05-01 Thread Tom Rini
On Tue, Apr 28, 2020 at 09:40:13PM +0200, Heinrich Schuchardt wrote:

> free() checks if its argument is NULL. Do not duplicate this in the calling
> code.
> 
> Signed-off-by: Heinrich Schuchardt 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 2/2] tools/fit-image: print a warning when cmd-line for dtc might be truncated

2020-05-01 Thread Tom Rini
On Mon, Apr 27, 2020 at 02:08:39AM +0200, Sven Roederer wrote:

> Signed-off-by: Sven Roederer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v1 3/3] arm: enable distro boot for bananapi-r2

2020-05-01 Thread Tom Rini
On Sun, Apr 26, 2020 at 01:17:46AM +0200, matthias@kernel.org wrote:

> From: Matthias Brugger 
> 
> This patch enables distro boot for the bananapi-r2, based on
> a MediaTek mt7623n.
> 
> Signed-off-by: Matthias Brugger 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 1/2] tools/mkimage: fix handling long filenames

2020-05-01 Thread Tom Rini
On Mon, Apr 27, 2020 at 02:08:38AM +0200, Sven Roederer wrote:

> The cmdline for calling the dtc was cut-off when using long filenames (e.g.
> 245 bytes) for output-file and datafile of "-f" parameter.
> For FIT-images cmd[MKIMAGE_MAX_DTC_CMDLINE_LEN] is declared (hardcoded 512 
> bytes),
> and contains some static values, the path of a tmpfile and a datafile. 
> tmpfile is
> max MKIMAGE_MAX_TMPFILE_LEN (256) and datafile might be also this size. 
> Having two
> very long pathname results in a truncation os the executed shell command, as 
> the
> truncated datafile path will not be found.
> Redefine MKIMAGE_MAX_DTC_CMDLINE_LEN to "2 * MKIMAGE_MAX_TMPFILE_LEN + 35 for 
> the
> parameters.
> This likely applies to the "-d" parameter, too.
> 
> Signed-off-by: Sven Roederer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v1 2/3] watchdog MediaTek add upstream compatible

2020-05-01 Thread Tom Rini
On Sun, Apr 26, 2020 at 01:17:45AM +0200, matthias@kernel.org wrote:

> From: Matthias Brugger 
> 
> The upstream compatible is called mt6589-wdt.
> Add this compatible to the driver.
> 
> Signed-off-by: Matthias Brugger 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 3/3] arm: caches: manage phys_addr_t overflow in mmu_set_region_dcache_behaviour

2020-05-01 Thread Tom Rini
On Fri, Apr 24, 2020 at 08:20:17PM +0200, Patrick Delaunay wrote:

> Solved the overflow on phys_addr_t type for start + size in
> mmu_set_region_dcache_behaviour() function.
> 
> This overflow is avoided by dividing start and end by 2 before addition,
> and we only expecting that start and size are even.
> 
> This patch doesn't change the current function behavior if the
> parameters (start or size) are not aligned on MMU_SECTION_SIZE.
> 
> For example, this overflow occurs on ARM32 with:
> start = 0xC000 and size = 0x4000
> then start + size = 0x1 and end = 0x0.
> 
> For information the function behavior change with risk of regression,
> if we just shift start and size before the addition.
> Example with 2MB section size:
>   MMU_SECTION_SIZE 0x20 and MMU_SECTION_SHIFT = 21
>   with start = 0x100, size = 0x100,
>   - with the proposed patch, start = 0 and end = 0x1 as previously
>   - with the more simple patch:
> end = (start >> MMU_SECTION_SHIFT) + (size >> MMU_SECTION_SHIFT)
> the value of end change:
> start >> 21 = 0, size >> 21 = 0 and end = 0x0 !!!
> 
> Signed-off-by: Patrick Delaunay 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 2/3] arm: caches: add DCACHE_DEFAULT_OPTION

2020-05-01 Thread Tom Rini
On Fri, Apr 24, 2020 at 08:20:16PM +0200, Patrick Delaunay wrote:

> Add the new flags DCACHE_DEFAULT_OPTION to define the default
> option to use according the compilation flags
> CONFIG_SYS_ARM_CACHE_*.
> 
> This new compilation flag allows to simplify dram_bank_mmu_setup()
> and can be used as third parameter (option=dcache option to select)
> of mmu_set_region_dcache_behaviour function.
> 
> Signed-off-by: Patrick Delaunay 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v1 1/3] timer MediaTek use upstream compatible

2020-05-01 Thread Tom Rini
On Sun, Apr 26, 2020 at 01:17:44AM +0200, matthias@kernel.org wrote:

> From: Matthias Brugger 
> 
> The timers compatible string in upstream is called
> mt6577-timer. Add this compatible to the driver.
> 
> Signed-off-by: Matthias Brugger 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] doc: describe the analysis of crash dumps

2020-05-01 Thread Tom Rini
On Fri, Apr 24, 2020 at 11:31:20PM +0200, Heinrich Schuchardt wrote:

> Provide an overview of the analysis of U-Boot crash dumps.
> 
> Signed-off-by: Heinrich Schuchardt 
> Acked-by: Ilias Apalodimas 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 1/3] common/board_r: arm: Merge initr_enable_interrupts into interrupts_init

2020-05-01 Thread Tom Rini
On Mon, Apr 20, 2020 at 10:31:44AM +0300, Ovidiu Panait wrote:

> initr_enable_interrupts() is an ARM-specific wrapper over
> enable_interrupts(), which is run during the common init sequence. It can
> be eliminated by moving the enable_interrupts() call to the end of
> interrupt_init() function, in arch/arm/lib/interrupts*.c.
> 
> Signed-off-by: Ovidiu Panait 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 1/3] arm: caches: protect dram_bank_mmu_setup access to bi_dram

2020-05-01 Thread Tom Rini
On Fri, Apr 24, 2020 at 08:20:15PM +0200, Patrick Delaunay wrote:

> Add protection in dram_bank_mmu_setup() to avoid access to bd->bi_dram
> before relocation.
> 
> This patch allow to use the generic weak function dram_bank_mmu_setup
> to activate the MMU and the data cache in SPL or in U-Boot before
> relocation, when bd->bi_dram is not yet initialized.
> 
> In this cases, the MMU must be initialized explicitly with
> mmu_set_region_dcache_behaviour function.
> 
> Signed-off-by: Patrick Delaunay 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 2/3] cmd/bedbug.c: Make bedbug_init have a return value

2020-05-01 Thread Tom Rini
On Mon, Apr 20, 2020 at 10:31:45AM +0300, Ovidiu Panait wrote:

> Do this as a preparation for removing initr_bedbug wrapper from
> common/board_r.c.
> 
> Signed-off-by: Ovidiu Panait 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 3/3] common/board_r: Drop initr_bedbug wrapper

2020-05-01 Thread Tom Rini
On Mon, Apr 20, 2020 at 10:31:46AM +0300, Ovidiu Panait wrote:

> Drop initr_bedbug wrapper and call bedbug_init directly during the init
> sequence.
> 
> Signed-off-by: Ovidiu Panait 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] tiny-printf: Support %i

2020-05-01 Thread Tom Rini
On Fri, Apr 10, 2020 at 08:54:49PM +0200, Marek Vasut wrote:

> The most basic printf("%i", value) formating string was missing,
> add it for the sake of convenience.
> 
> Signed-off-by: Marek Vasut 
> Cc: Simon Glass 
> Cc: Stefan Roese 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2] configs: migrate CONFIG_SYS_ARM_CACHE_* in Kconfig

2020-05-01 Thread Tom Rini
On Fri, Apr 10, 2020 at 04:02:02PM +0200, Patrick Delaunay wrote:

> Move CONFIG_SYS_ARM_CACHE_WRITETHROUGH and
> CONFIG_SYS_ARM_CACHE_WRITEALLOC into Kconfig done by moveconfig.py.
> 
> Kconfig uses a choice between the 3 values supported in U-Boot,
> including the new configuration CONFIG_SYS_ARM_CACHE_WRITEBACK
> (the default configuration).
> 
> The patch also avoids to select simultaneously 2 configurations.
> 
> Signed-off-by: Patrick Delaunay 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v3] cmd: mvebu: bubt: fix quoted string split across lines

2020-05-01 Thread Joel Johnson
Ping for review feedback on this patch, it'd be good to have the fix 
included in the same release as the merge was included.


Joel

On 2020-04-25 20:54, Joel Johnson wrote:

Update quoted string alignment to address checkpatch.pl warning
originally introduced in
commit f60a66ef5d7d ("cmd: mvebu: bubt: show image boot device").

Signed-off-by: Joel Johnson 

---


I am sort of inferring that this is the desired fix, preferring line
length infractions over split quoted strings. As such, I've combined 
the
static part of the string for grepping and left the dynamic parts on 
the

next line.

v2 change:
  - syntax fix
v3 change:
  - actually add syntax fix...

---
 cmd/mvebu/bubt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c
index dc0ce01c35..ef53153c46 100644
--- a/cmd/mvebu/bubt.c
+++ b/cmd/mvebu/bubt.c
@@ -730,8 +730,8 @@ static int bubt_check_boot_mode(const struct 
bubt_dev *dst)


for (int i = 0; i < ARRAY_SIZE(a38x_boot_modes); i++) {
if (a38x_boot_modes[i].id == hdr->blockid) {
-   printf("Error: A38x image meant to be "
-  "booted from \"%s\", not \"%s\"!\n",
+   printf("Error: A38x image meant to be booted from 
"
+  "\"%s\", not \"%s\"!\n",
   a38x_boot_modes[i].name, dst->name);
return -ENOEXEC;
}


[PATCH] imx8mq_phanbell: Run SPL with caches enabled

2020-05-01 Thread Fabio Estevam
It is safe to run SPL with caches enabled on i.MX8M, so
remove such restriction.

Signed-off-by: Fabio Estevam 
---
 configs/imx8mq_phanbell_defconfig | 2 --
 1 file changed, 2 deletions(-)

diff --git a/configs/imx8mq_phanbell_defconfig 
b/configs/imx8mq_phanbell_defconfig
index 5be02a3382..d6a4414ad6 100644
--- a/configs/imx8mq_phanbell_defconfig
+++ b/configs/imx8mq_phanbell_defconfig
@@ -1,6 +1,4 @@
 CONFIG_ARM=y
-CONFIG_SPL_SYS_ICACHE_OFF=y
-CONFIG_SPL_SYS_DCACHE_OFF=y
 CONFIG_ARCH_IMX8M=y
 CONFIG_SYS_TEXT_BASE=0x4020
 CONFIG_ENV_SIZE=0x1000
-- 
2.17.1



[PATCH 1/1] .readthedocs.yml: fix type docs/

2020-05-01 Thread Heinrich Schuchardt
Out documentation directory is doc/ and not docs/.

Signed-off-by: Heinrich Schuchardt 
---
 .readthedocs.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.readthedocs.yml b/.readthedocs.yml
index f3fb5ed51b..44949ea239 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -7,7 +7,7 @@ version: 2

 # Build documentation in the docs/ directory with Sphinx
 sphinx:
-  configuration: docs/conf.py
+  configuration: doc/conf.py

 # Optionally build your docs in additional formats such as PDF and ePub
 formats: []
--
2.26.2



RE: [PATCH 1/8] x86: Add a new X86_RUN_64BIT_ONLY to Kconfig

2020-05-01 Thread Park, Aiden
Hi Bin,

> -Original Message-
> From: Bin Meng 
> Sent: Thursday, April 30, 2020 2:14 AM
> To: Park, Aiden 
> Cc: Simon Glass ; U-Boot Mailing List  b...@lists.denx.de>
> Subject: Re: [PATCH 1/8] x86: Add a new X86_RUN_64BIT_ONLY to Kconfig
> 
> Hi Aiden,
> 
> On Wed, Apr 29, 2020 at 1:44 PM Park, Aiden  wrote:
> >
> > Hi Simon,
> >
> > > -Original Message-
> > > From: Simon Glass 
> > > Sent: Sunday, April 26, 2020 1:16 PM
> > > To: Park, Aiden 
> > > Cc: Bin Meng ; U-Boot Mailing List  > > b...@lists.denx.de>
> > > Subject: Re: [PATCH 1/8] x86: Add a new X86_RUN_64BIT_ONLY to
> > > Kconfig
> > >
> > > Hi Aiden,
> > >
> > > On Tue, 21 Apr 2020 at 18:45,  wrote:
> > > >
> > > > From: Aiden Park 
> > > >
> > > > This will build U-Boot as a pure 64-bit binary with no SPL.
> > > > It can be used with a pre-stage boot firmware which has already
> > > > done 16-bit, 32-bit and 64-bit init.
> > > >
> > > > Signed-off-by: Aiden Park 
> > > > ---
> > > >  arch/x86/Kconfig | 8 
> > > >  1 file changed, 8 insertions(+)
> > > >
> > > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index
> > > > c8eae24c07..89add17e69 100644
> > > > --- a/arch/x86/Kconfig
> > > > +++ b/arch/x86/Kconfig
> > > > @@ -40,6 +40,14 @@ config X86_RUN_64BIT
> > > >   runs through the 16-bit and 32-bit init, then switches to 
> > > > 64-bit
> > > >   mode and jumps to U-Boot proper.
> > > >
> > > > +config X86_RUN_64BIT_ONLY
> > >
> > > Perhaps X86_RUN_64BIT_NO_SPL? Bin might hav a better idea.
> > >
> > I considered X64_RUN_64BIT_NO_SPL, X64_RUN_64BIT_PURE and
> X64_RUN_64BIT_NATIVE.
> > Hi Bin, can you recommend better naming?
> 
> Cannot figure out a better name :) Let's use it.
Thanks Bin. Let me use X86_RUN_64BIT_ONLY for now.

Hi Simon, is this naming okay for you?
> 
> Reviewed-by: Bin Meng 
> 
> Regards,
> Bin

Best Regards,
Aiden


RE: [PATCH 4/8] x86: slimbootloader: Support 64-bit operation

2020-05-01 Thread Park, Aiden
Hi Simon,

> -Original Message-
> From: Simon Glass 
> Sent: Wednesday, April 29, 2020 11:04 AM
> To: Park, Aiden 
> Cc: Bin Meng ; U-Boot Mailing List  b...@lists.denx.de>
> Subject: Re: [PATCH 4/8] x86: slimbootloader: Support 64-bit operation
> 
> Hi Aiden,
> 
> On Wed, 29 Apr 2020 at 00:01, Park, Aiden  wrote:
> >
> > Hi Simon,
> >
> > > -Original Message-
> > > From: Simon Glass 
> > > Sent: Sunday, April 26, 2020 1:16 PM
> > > To: Park, Aiden 
> > > Cc: Bin Meng ; U-Boot Mailing List  > > b...@lists.denx.de>
> > > Subject: Re: [PATCH 4/8] x86: slimbootloader: Support 64-bit
> > > operation
> > >
> > > Hi Aiden,
> > >
> > > On Tue, 21 Apr 2020 at 18:45,  wrote:
> > > >
> > > > From: Aiden Park 
> > > >
> > > > This supports 64-bit U-Boot as a Slim Bootloader payload.
> > > >
> > > > Signed-off-by: Aiden Park 
> > > > ---
> > > >  arch/x86/cpu/slimbootloader/Makefile |  9 +++--
> > > >  arch/x86/cpu/slimbootloader/entry64.S| 14 ++
> > > >  arch/x86/cpu/slimbootloader/slimbootloader.c | 17
> > > > +++--
> > > >  3 files changed, 36 insertions(+), 4 deletions(-)  create mode
> > > > 100644 arch/x86/cpu/slimbootloader/entry64.S
> > > >
> > > > diff --git a/arch/x86/cpu/slimbootloader/Makefile
> > > > b/arch/x86/cpu/slimbootloader/Makefile
> > > > index aac9fa3db8..79fa699501 100644
> > > > --- a/arch/x86/cpu/slimbootloader/Makefile
> > > > +++ b/arch/x86/cpu/slimbootloader/Makefile
> > > > @@ -1,5 +1,10 @@
> > > >  # SPDX-License-Identifier: GPL-2.0+  # -# Copyright (C) 2019
> > > > Intel Corporation 
> > > > +# Copyright (C) 2019-2020 Intel Corporation 
> > > >
> > > > -obj-y += car.o slimbootloader.o sdram.o serial.o
> > > > +ifeq ($(CONFIG_X86_64),y)
> > > > +obj-y += entry64.o
> > > > +else
> > > > +obj-y += car.o
> > > > +endif
> > > > +obj-y += slimbootloader.o sdram.o serial.o
> > > > diff --git a/arch/x86/cpu/slimbootloader/entry64.S
> > > > b/arch/x86/cpu/slimbootloader/entry64.S
> > > > new file mode 100644
> > > > index 00..5e101e18a9
> > > > --- /dev/null
> > > > +++ b/arch/x86/cpu/slimbootloader/entry64.S
> > > > @@ -0,0 +1,14 @@
> > > > +/* SPDX-License-Identifier: GPL-2.0+ */
> > > > +/*
> > > > + * Copyright (C) 2020 Intel Corporation   */
> > > > +
> > > > +#include 
> > > > +
> > > > +.section .text
> > > > +
> > > > +.globl init_64bit_entry
> > > > +init_64bit_entry:
> > > > +   /* Save hob pointer parameter */
> > > > +   mov %rcx, %r10
> > > > +   jmp init_64bit_entry_ret
> > > > diff --git a/arch/x86/cpu/slimbootloader/slimbootloader.c
> > > > b/arch/x86/cpu/slimbootloader/slimbootloader.c
> > > > index 21dcfb2142..7857e4cd8b 100644
> > > > --- a/arch/x86/cpu/slimbootloader/slimbootloader.c
> > > > +++ b/arch/x86/cpu/slimbootloader/slimbootloader.c
> > > > @@ -1,6 +1,6 @@
> > > >  // SPDX-License-Identifier: GPL-2.0+
> > > >  /*
> > > > - * Copyright (C) 2019 Intel Corporation 
> > > > + * Copyright (C) 2019-2020 Intel Corporation 
> > > >   */
> > > >
> > > >  #include 
> > > > @@ -43,11 +43,23 @@ static void tsc_init(void)
> > > >
> > > >  int arch_cpu_init(void)
> > > >  {
> > > > +   int ret = 0;
> > > > +
> > > > tsc_init();
> > > >
> > > > -   return x86_cpu_init_f();
> > > > +#if !CONFIG_IS_ENABLED(X86_64)
> > >
> > > Can you use if() instead of #if ?
> > I will do it.
> >
> > >
> > > > +   ret = x86_cpu_init_f();
> > > > +#endif
> > > > +   return ret;
> > > >  }
> > > >
> > > > +#if CONFIG_IS_ENABLED(X86_64)
> > >
> > > It should be safe to define both of these functions so I don't think
> > > you need the #ifdef
> > These are defined in arch/x86/cpu/x86_64/cpu.c already.
> > Is it okay to make them weak reference or can I keep this as it is?
> 
> Oh I see. I am not a fan of weak functions so perhaps we should keep them as 
> is.
I agree with you about the weak functions. Let me keep this as is. Thanks.

> 
> 
> >
> > >
> > > > +int set_hob_list(void *hob_list)
> > > > +{
> > > > +   gd->arch.hob_list = hob_list;
> > > > +   return 0;
> > > > +}
> > > > +#else
> > > >  int checkcpu(void)
> > > >  {
> > > > return 0;
> > > > @@ -57,3 +69,4 @@ int print_cpuinfo(void)  {
> > > > return default_print_cpuinfo();  }
> > > > +#endif
> > > > --
> > > > 2.20.1
> > > >
> Regards,
> Simon

Best Regards,
Aiden


Re: Commits missing sign-off from Maintainer/Custodian

2020-05-01 Thread Tom Rini
On Fri, May 01, 2020 at 09:23:18AM +1200, Chris Packham wrote:

> Hi All,
> 
> I noticed some recent(ish) commits in u-boot.git are missing a
> sign-off from the maintainer. Is this an omission or an intentional
> change in process?
> 
> I don't have a problem either way but if it was an omission I thought
> I'd point it out. If it's intentional then this message can go to
> /dev/null.

One way we differ from the Linux kernel is that it is not common to add
your own S-o-B when applying patches, only when you have to make changes
to them as part of applying.

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v5 1/4] omap: mmc: Avoid using libfdt with of-platdata

2020-05-01 Thread Tom Rini
On Thu, Apr 30, 2020 at 01:43:30PM +0200, Bartosz Golaszewski wrote:
> wt., 28 kwi 2020 o 09:01 Faiz Abbas  napisaƂ(a):
> >
> > +Bartosz
> >
> > On 28/04/20 9:47 am, Lokesh Vutla wrote:
> > > +Faiz,
> > >
> > > On 28/04/20 12:29 AM, Tom Rini wrote:
> > >> On Mon, Apr 27, 2020 at 05:33:41AM +, Peng Fan wrote:
> >  Subject: [PATCH v5 1/4] omap: mmc: Avoid using libfdt with of-platdata
> > 
> >  At present this driver is enabled in SPL on omapl138_lcdk, which uses
> >  of-platdata. The driver needs to be ported to use of-platdata properly.
> >  For now, avoid a build error by returning an error.
> > 
> >  Signed-off-by: Simon Glass 
> > >
> > > Does this break the boot on omap l138?
> > >
> >
> > I don't have a board at hand to test this out. Bartosz can you help test 
> > this with
> > omapl138?
> >
> > Thanks,
> > Faiz
> 
> Hi Faiz,
> 
> I can confirm - this *does* break the mmc boot on da850-lcdk.

So who is going to fix the driver to unblock Simon's series?

-- 
Tom


signature.asc
Description: PGP signature


Re: Aw: Re: Re: Re: Re: [ANN] U-Boot v2020.07-rc1 released

2020-05-01 Thread Marek Vasut
On 5/1/20 8:12 PM, Frank Wunderlich wrote:
>> Gesendet: Freitag, 01. Mai 2020 um 20:08 Uhr
>> Von: "Marek Vasut" 
>> It's a build failure, build it for versal_virt and see if the error is
>> gone. Is it ?
> 
> right, i reproduced it by these commands:
> 
> ARCH=arm64 make xilinx_versal_virt_defconfig
> CROSS_COMPILE=aarch64-linux-gnu- make
> 
> and this build-error is gone in my tree

Cool, then send V5 of the series, thanks.


[PATCH] clk: Fix clk func names in comments

2020-05-01 Thread Jagan Teki
clk function names in comments should be prefix with
clk instead of clock.

Fix it.

Cc: Simon Glass 
Cc: Tom Rini 
Signed-off-by: Jagan Teki 
---
 include/clk.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/clk.h b/include/clk.h
index 60c4b7d075..c6a2713f62 100644
--- a/include/clk.h
+++ b/include/clk.h
@@ -93,7 +93,7 @@ int clk_get_by_index_platdata(struct udevice *dev, int index,
  struct phandle_1_arg *cells, struct clk *clk);
 
 /**
- * clock_get_by_index - Get/request a clock by integer index.
+ * clk_get_by_index - Get/request a clock by integer index.
  *
  * This looks up and requests a clock. The index is relative to the client
  * device; each device is assumed to have n clocks associated with it somehow,
@@ -110,7 +110,7 @@ int clk_get_by_index_platdata(struct udevice *dev, int 
index,
 int clk_get_by_index(struct udevice *dev, int index, struct clk *clk);
 
 /**
- * clock_get_by_index_nodev - Get/request a clock by integer index
+ * clk_get_by_index_nodev - Get/request a clock by integer index
  * without a device.
  *
  * This is a version of clk_get_by_index() that does not use a device.
@@ -124,7 +124,7 @@ int clk_get_by_index(struct udevice *dev, int index, struct 
clk *clk);
 int clk_get_by_index_nodev(ofnode node, int index, struct clk *clk);
 
 /**
- * clock_get_bulk - Get/request all clocks of a device.
+ * clk_get_bulk - Get/request all clocks of a device.
  *
  * This looks up and requests all clocks of the client device; each device is
  * assumed to have n clocks associated with it somehow, and this function finds
@@ -139,7 +139,7 @@ int clk_get_by_index_nodev(ofnode node, int index, struct 
clk *clk);
 int clk_get_bulk(struct udevice *dev, struct clk_bulk *bulk);
 
 /**
- * clock_get_by_name - Get/request a clock by name.
+ * clk_get_by_name - Get/request a clock by name.
  *
  * This looks up and requests a clock. The name is relative to the client
  * device; each device is assumed to have n clocks associated with it somehow,
@@ -169,7 +169,7 @@ int clk_get_by_name(struct udevice *dev, const char *name, 
struct clk *clk);
 int clk_get_by_name_nodev(ofnode node, const char *name, struct clk *clk);
 
 /**
- * clock_get_optional_nodev - Get/request an optinonal clock by name
+ * clk_get_optional_nodev - Get/request an optinonal clock by name
  * without a device.
  * @node:  The client ofnode.
  * @name:  The name of the clock to request.
@@ -331,7 +331,7 @@ static inline int clk_release_bulk(struct clk_bulk *bulk)
 int clk_request(struct udevice *dev, struct clk *clk);
 
 /**
- * clock_free - Free a previously requested clock.
+ * clk_free - Free a previously requested clock.
  *
  * @clock: A clock struct that was previously successfully requested by
  * clk_request/get_by_*().
-- 
2.17.1



[PATCH 2/2] phy: Use _nodev naming convention if non-device clients

2020-05-01 Thread Jagan Teki
Clients that are requesting some of uclass API's
without a device (with ofnode) usually have _nodev
naming convention.

- clk_get_by_index_nodev
- clk_get_by_name_nodev
- reset_get_by_index_nodev
- gpio_request_by_name_nodev

So, update the same naming convention PHY framework.

This doesn't change the existing functionality.

Cc: Neil Armstrong 
Cc: Tom Rini 
Signed-off-by: Jagan Teki 
---
 arch/arm/mach-meson/board-gx.c | 3 ++-
 drivers/phy/phy-uclass.c   | 4 ++--
 include/generic-phy.h  | 7 +--
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-meson/board-gx.c b/arch/arm/mach-meson/board-gx.c
index 3da99017a5..b591c924ea 100644
--- a/arch/arm/mach-meson/board-gx.c
+++ b/arch/arm/mach-meson/board-gx.c
@@ -183,7 +183,8 @@ int board_usb_init(int index, enum usb_init_type init)
 
/* get the PHYs */
for (i = 0; i < 2; i++) {
-   ret = generic_phy_get_by_node(dwc2_node, i, _phys[i]);
+   ret = generic_phy_get_by_index_nodev(dwc2_node, i,
+_phys[i]);
if (ret && ret != -ENOENT) {
pr_err("Failed to get USB PHY%d for %s\n",
   i, ofnode_get_name(dwc2_node));
diff --git a/drivers/phy/phy-uclass.c b/drivers/phy/phy-uclass.c
index e463b0b400..8091fc0969 100644
--- a/drivers/phy/phy-uclass.c
+++ b/drivers/phy/phy-uclass.c
@@ -31,7 +31,7 @@ static int generic_phy_xlate_offs_flags(struct phy *phy,
return 0;
 }
 
-int generic_phy_get_by_node(ofnode node, int index, struct phy *phy)
+int generic_phy_get_by_index_nodev(ofnode node, int index, struct phy *phy)
 {
struct ofnode_phandle_args args;
struct phy_ops *ops;
@@ -93,7 +93,7 @@ err:
 int generic_phy_get_by_index(struct udevice *dev, int index,
 struct phy *phy)
 {
-   return generic_phy_get_by_node(dev_ofnode(dev), index, phy);
+   return generic_phy_get_by_index_nodev(dev_ofnode(dev), index, phy);
 }
 
 int generic_phy_get_by_name(struct udevice *dev, const char *phy_name,
diff --git a/include/generic-phy.h b/include/generic-phy.h
index e30440d35e..07e4c6f7a0 100644
--- a/include/generic-phy.h
+++ b/include/generic-phy.h
@@ -196,12 +196,15 @@ int generic_phy_get_by_index(struct udevice *user, int 
index,
 struct phy *phy);
 
 /**
- * generic_phy_get_by_node() - Get a PHY device by integer index on ofnode
+ * generic_phy_get_by_index_nodev() - Get a PHY device by integer index
+ * without a device
  *
  * @node:  The client ofnode.
  * @index: The index in the list of available PHYs
  * @phy:   A pointer to the PHY port
  *
+ * This is a version of generic_phy_get_by_index() that does not use a device.
+ *
  * This looks up a PHY device for a client device based on its ofnode and on
  * its position in the list of the possible PHYs.
  *
@@ -220,7 +223,7 @@ int generic_phy_get_by_index(struct udevice *user, int 
index,
  *
  * @return 0 if OK, or a negative error code
  */
-int generic_phy_get_by_node(ofnode node, int index, struct phy *phy);
+int generic_phy_get_by_index_nodev(ofnode node, int index, struct phy *phy);
 
 /**
  * generic_phy_get_by_name() - Get a PHY device by its name.
-- 
2.17.1



[PATCH 1/2] phy: Fix node description of phy_get_by_node

2020-05-01 Thread Jagan Teki
node is most of device related API's are termed as device
node and without device related API's are termed as ofnode.

generic_phy_get_by_node API is without device API, so fixed
the node description as ofnode.

Cc: Neil Armstrong 
Cc: Tom Rini 
Signed-off-by: Jagan Teki 
---
 include/generic-phy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/generic-phy.h b/include/generic-phy.h
index 73537025c2..e30440d35e 100644
--- a/include/generic-phy.h
+++ b/include/generic-phy.h
@@ -198,7 +198,7 @@ int generic_phy_get_by_index(struct udevice *user, int 
index,
 /**
  * generic_phy_get_by_node() - Get a PHY device by integer index on ofnode
  *
- * @node:  the device node
+ * @node:  The client ofnode.
  * @index: The index in the list of available PHYs
  * @phy:   A pointer to the PHY port
  *
-- 
2.17.1



Aw: Re: Re: Re: Re: [ANN] U-Boot v2020.07-rc1 released

2020-05-01 Thread Frank Wunderlich
> Gesendet: Freitag, 01. Mai 2020 um 20:08 Uhr
> Von: "Marek Vasut" 
> It's a build failure, build it for versal_virt and see if the error is
> gone. Is it ?

right, i reproduced it by these commands:

ARCH=arm64 make xilinx_versal_virt_defconfig
CROSS_COMPILE=aarch64-linux-gnu- make

and this build-error is gone in my tree


Re: Aw: Re: Re: Re: [ANN] U-Boot v2020.07-rc1 released

2020-05-01 Thread Marek Vasut
On 5/1/20 7:48 PM, Frank Wunderlich wrote:
 Gesendet: Freitag, 01. Mai 2020 um 17:39 Uhr
 Von: "Marek Vasut" 
 Build failed, please fix:
 https://gitlab.denx.de/u-boot/custodians/u-boot-usb/pipelines/3054
> 
> could you try if all tests passing after this Patch?
> 
> regards Frank
> 
> commit 9c4a3633e92dbcd51aa60ff14693adc900e3c816
> Author: Frank Wunderlich 
> Date:   Fri May 1 19:32:12 2020 +0200
> 
> fix build-error for xilinx-board caused by xhci-Patches
> 
> Fixes: "usb: dwc3: use the phy bulk API to get phys"
> 
> diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c
> index 9fcfa39d4b..563db1a426 100644
> --- a/drivers/usb/host/xhci-dwc3.c
> +++ b/drivers/usb/host/xhci-dwc3.c
> @@ -19,8 +19,7 @@
>  #include 
> 
>  struct xhci_dwc3_platdata {
> -   struct phy *usb_phys;
> -   int num_phys;
> +   struct phy_bulk *usb_phys;
>  };
> 
>  void dwc3_set_mode(struct dwc3 *dwc3_reg, u32 mode)
> @@ -125,7 +124,7 @@ static int xhci_dwc3_probe(struct udevice *dev)
> hcor = (struct xhci_hcor *)((uintptr_t)hccr +
> HC_LENGTH(xhci_readl(&(hccr)->cr_capbase)));
> 
> -   ret = dwc3_setup_phy(dev, >usb_phys, >num_phys);
> +   ret = dwc3_setup_phy(dev, plat->usb_phys);
> if (ret && (ret != -ENOTSUPP))
> return ret;
> 
> @@ -168,7 +167,7 @@ static int xhci_dwc3_remove(struct udevice *dev)
>  {
> struct xhci_dwc3_platdata *plat = dev_get_platdata(dev);
> 
> -   dwc3_shutdown_phy(dev, plat->usb_phys, plat->num_phys);
> +   dwc3_shutdown_phy(dev, plat->usb_phys);
> 
> return xhci_deregister(dev);
>  }

It's a build failure, build it for versal_virt and see if the error is
gone. Is it ?


Aw: Re: Re: Re: [ANN] U-Boot v2020.07-rc1 released

2020-05-01 Thread Frank Wunderlich
> >> Gesendet: Freitag, 01. Mai 2020 um 17:39 Uhr
> >> Von: "Marek Vasut" 
> >> Build failed, please fix:
> >> https://gitlab.denx.de/u-boot/custodians/u-boot-usb/pipelines/3054

could you try if all tests passing after this Patch?

regards Frank

commit 9c4a3633e92dbcd51aa60ff14693adc900e3c816
Author: Frank Wunderlich 
Date:   Fri May 1 19:32:12 2020 +0200

fix build-error for xilinx-board caused by xhci-Patches

Fixes: "usb: dwc3: use the phy bulk API to get phys"

diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c
index 9fcfa39d4b..563db1a426 100644
--- a/drivers/usb/host/xhci-dwc3.c
+++ b/drivers/usb/host/xhci-dwc3.c
@@ -19,8 +19,7 @@
 #include 

 struct xhci_dwc3_platdata {
-   struct phy *usb_phys;
-   int num_phys;
+   struct phy_bulk *usb_phys;
 };

 void dwc3_set_mode(struct dwc3 *dwc3_reg, u32 mode)
@@ -125,7 +124,7 @@ static int xhci_dwc3_probe(struct udevice *dev)
hcor = (struct xhci_hcor *)((uintptr_t)hccr +
HC_LENGTH(xhci_readl(&(hccr)->cr_capbase)));

-   ret = dwc3_setup_phy(dev, >usb_phys, >num_phys);
+   ret = dwc3_setup_phy(dev, plat->usb_phys);
if (ret && (ret != -ENOTSUPP))
return ret;

@@ -168,7 +167,7 @@ static int xhci_dwc3_remove(struct udevice *dev)
 {
struct xhci_dwc3_platdata *plat = dev_get_platdata(dev);

-   dwc3_shutdown_phy(dev, plat->usb_phys, plat->num_phys);
+   dwc3_shutdown_phy(dev, plat->usb_phys);

return xhci_deregister(dev);
 }



Re: [PATCH v7 10/14] xhci: mediatek: Add support for MTK xHCI host controller

2020-05-01 Thread Jagan Teki
On Wed, Apr 29, 2020 at 11:46 AM Chunfeng Yun  wrote:
>
> This patch is used to support the on-chip xHCI controller on
> MediaTek SoCs, currently control/bulk/interrupt transfers are
> supported.
>
> Signed-off-by: Chunfeng Yun 
> Reviewed-by: Weijie Gao 
> ---
> v7: use new API of phy bulk
>
> v6: add Reviewed-by Weijie
>
> v5:
> 1. print error number suggested by Marek
> 2. support interrupt transfer
>
> v4:
> 1. use phy_bulk API
>
> v3:
> 1. use macro approach to access registers suggested by Marek
>
> v2:
> 1. use clk_bulk to get clocks suggested by Marek
> 2. use clrsetbits_le32() etc suggeseted by Marek
> ---
>  drivers/usb/host/Kconfig|   6 +
>  drivers/usb/host/Makefile   |   1 +
>  drivers/usb/host/xhci-mtk.c | 303 
>  drivers/usb/host/xhci.c |  10 ++
>  include/usb/xhci.h  |   3 +
>  5 files changed, 323 insertions(+)
>  create mode 100644 drivers/usb/host/xhci-mtk.c
>
> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> index 94ac969058..2f381dc958 100644
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -30,6 +30,12 @@ config USB_XHCI_DWC3_OF_SIMPLE
>   Support USB2/3 functionality in simple SoC integrations with
>   USB controller based on the DesignWare USB3 IP Core.
>
> +config USB_XHCI_MTK
> +   bool "Support for MediaTek on-chip xHCI USB controller"
> +   depends on ARCH_MEDIATEK
> +   help
> + Enables support for the on-chip xHCI controller on MediaTek SoCs.
> +
>  config USB_XHCI_MVEBU
> bool "MVEBU USB 3.0 support"
> default y
> diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
> index b62f346094..e8e3b17e42 100644
> --- a/drivers/usb/host/Makefile
> +++ b/drivers/usb/host/Makefile
> @@ -51,6 +51,7 @@ obj-$(CONFIG_USB_XHCI_DWC3_OF_SIMPLE) += dwc3-of-simple.o
>  obj-$(CONFIG_USB_XHCI_ROCKCHIP) += xhci-rockchip.o
>  obj-$(CONFIG_USB_XHCI_EXYNOS) += xhci-exynos5.o
>  obj-$(CONFIG_USB_XHCI_FSL) += xhci-fsl.o
> +obj-$(CONFIG_USB_XHCI_MTK) += xhci-mtk.o
>  obj-$(CONFIG_USB_XHCI_MVEBU) += xhci-mvebu.o
>  obj-$(CONFIG_USB_XHCI_OMAP) += xhci-omap.o
>  obj-$(CONFIG_USB_XHCI_PCI) += xhci-pci.o
> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> new file mode 100644
> index 00..7c71fe728d
> --- /dev/null
> +++ b/drivers/usb/host/xhci-mtk.c
> @@ -0,0 +1,303 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (c) 2019 MediaTek, Inc.
> + * Authors: Chunfeng Yun 
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/* IPPC (IP Port Control) registers */
> +#define IPPC_IP_PW_CTRL0   0x00
> +#define CTRL0_IP_SW_RSTBIT(0)
> +
> +#define IPPC_IP_PW_CTRL1   0x04
> +#define CTRL1_IP_HOST_PDN  BIT(0)
> +
> +#define IPPC_IP_PW_STS10x10
> +#define STS1_IP_SLEEP_STS  BIT(30)
> +#define STS1_U3_MAC_RSTBIT(16)
> +#define STS1_XHCI_RST  BIT(11)
> +#define STS1_SYS125_RSTBIT(10)
> +#define STS1_REF_RST   BIT(8)
> +#define STS1_SYSPLL_STABLE BIT(0)
> +
> +#define IPPC_IP_XHCI_CAP   0x24
> +#define CAP_U3_PORT_NUM(p) ((p) & 0xff)
> +#define CAP_U2_PORT_NUM(p) (((p) >> 8) & 0xff)
> +
> +#define IPPC_U3_CTRL_0P0x30
> +#define CTRL_U3_PORT_HOST_SEL  BIT(2)
> +#define CTRL_U3_PORT_PDN   BIT(1)
> +#define CTRL_U3_PORT_DIS   BIT(0)
> +
> +#define IPPC_U2_CTRL_0P0x50
> +#define CTRL_U2_PORT_HOST_SEL  BIT(2)
> +#define CTRL_U2_PORT_PDN   BIT(1)
> +#define CTRL_U2_PORT_DIS   BIT(0)
> +
> +#define IPPC_U3_CTRL(p)(IPPC_U3_CTRL_0P + ((p) * 0x08))
> +#define IPPC_U2_CTRL(p)(IPPC_U2_CTRL_0P + ((p) * 0x08))
> +
> +struct mtk_xhci {
> +   struct xhci_ctrl ctrl;  /* Needs to come first in this struct! */
> +   struct xhci_hccr *hcd;
> +   void __iomem *ippc;
> +   struct udevice *dev;
> +   struct udevice *vusb33_supply;
> +   struct udevice *vbus_supply;
> +   struct clk_bulk clks;
> +   struct phy_bulk phys;
> +   int num_u2ports;
> +   int num_u3ports;
> +};
> +
> +static int xhci_mtk_host_enable(struct mtk_xhci *mtk)
> +{
> +   u32 value;
> +   u32 check_val;
> +   int ret;
> +   int i;
> +
> +   /* power on host ip */
> +   clrbits_le32(mtk->ippc + IPPC_IP_PW_CTRL1, CTRL1_IP_HOST_PDN);
> +
> +   /* power on and enable all u3 ports */
> +   for (i = 0; i < mtk->num_u3ports; i++) {
> +   clrsetbits_le32(mtk->ippc + IPPC_U3_CTRL(i),
> +   CTRL_U3_PORT_PDN | CTRL_U3_PORT_DIS,
> +   CTRL_U3_PORT_HOST_SEL);
> + 

Re: reset on mpc83xx

2020-05-01 Thread Christophe Leroy




Le 30/04/2020 à 21:06, Rasmus Villemoes a écrit :

On 30/04/2020 17.03, Christophe Leroy wrote:



Le 30/04/2020 à 16:44, Rasmus Villemoes a écrit :

Hi,

I'm wondering why the sysreset_mpc83xx driver (as well as the similar
code in arch/powerpc/cpu/mpc83xx/cpu.c) removes the MSR_IR and MSR_DR
bits from MSR.


[snip]


But since the arch/powerpc/cpu/mpc83xx/cpu.c code in U-Boot has been
there forever, I assume I'm missing something fundamental.


On my mpc8321 it works.

However I agree it looks odd.

I think it works by chance because we have a 1:1 MMU mapping, but if you
have a difference mapping I can't see how you can disable Instruction
MMU without going through a write into SRR0/SRR1 and an rfi.


OK, thanks. Can you test if it still works if you change the code to not
clear the MSR_IR and MSR_DR bits? (I expect it will, since I assume
you'd have noticed if reboot from linux didn't work).


Due to the COVID-19 lockdown I'm working from home and don't have access 
to HW tools to recover by boards in case I flash a bad Uboot, so I won't 
do that for now.


However I confirm reboot works properly in Linux.



I'm actually wondering what the core does after the MSR_IR bit gets
cleared. If address translation is disabled, what instruction does it
then do immediately after the mtmsr? I mean, the pc has some value, but
how does that get interpreted without MSR_IR set?


After the mtmsr it probably continues with a few instructions that are 
already in the pipeline, until the isync. Then after the isync it will 
try to fetch from the physical address having the value of the pc.

If it doesn't have an existing address, you'll get a machine check.



And yes, the (unused, it seems) disable_addr_trans routine in start.S
does seem to be somewhat more complicated than a simple RMW of MSR,
suggesting that if disabling address translation was really needed
before reset, it should be done using that rather than by just clearing
the bits directly.


Yes disable_addr_trans() is exactly what has to be done for disabling 
instruction address translation.


For disabling only data address translation can be done with an RMW of 
MSR + isync.


Christophe


Re: [PATCH] sunxi: A20-OLinuXino-Lime2: enable PHY config to fix broken ethernet

2020-05-01 Thread Anatolij Gustschin
On Fri, 1 May 2020 22:16:16 +0530
Jagan Teki ja...@amarulasolutions.com wrote:
...
> Please rebase on master and send. fyi, I don't have board
> accessibility right now to test this.

This patch should be dropped. Tom already fixed this issue,
please see commit 69a229c6d4b4.

--
Anatolij


Re: [PATCH 1/4] mach-sunxi: Refactor sunxi SPI-SPL

2020-05-01 Thread Jagan Teki
On Tue, Apr 28, 2020 at 7:53 PM Benedikt-Alexander Mokroß
 wrote:
>
> This patch splits the sunxi SPI-SPL in its two components:
>   - SUNXI-SPI-Handling (spl_spi_sunxi.c)
>   - SPI-NOR with SPI-NOR-SPL-Logic (spl_spi_sunxi_nor.c)
>
> For this, the spl got moved in its own subdirectory.
> This prepares the SPL to support more then just SPI-NOR.
>
> Signed-off-by: Benedikt-Alexander Mokroß 
> ---

Please add a cover-letter to explain why these changes require? and
also I'm still thinking it can be possible to support both SPI
NOR/NAND in the same driver. Let me comment on the next version
changes.

Jagan.


Re: [PATCH] sunxi: add support for Banana Pi P2 Zero board

2020-05-01 Thread Jagan Teki
On Thu, Apr 30, 2020 at 3:25 AM Mizan R  wrote:
>
> Banana Pi P2 Zero is almost identic with Banana Pi M2 Zero with
> additional eMMC and PoE functionality
> This patch allows uboot to detect ethernet, usb, and eMMC during boot
>
> Bootlog:
>
> U-Boot SPL 2020.04 (Apr 30 2020 - 03:41:48 +0700)
> DRAM: 512 MiB
> Trying to boot from MMC1
>
>
> U-Boot 2020.04 (Apr 30 2020 - 03:41:48 +0700) Allwinner Technology
>
> CPU:   Allwinner H3 (SUN8I 1680)
> Model: Banana Pi BPI-P2-Zero
> DRAM:  512 MiB
> MMC:   Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c1'
> mmc@1c0f000: 0, mmc@1c1: 2, mmc@1c11000: 1
> Loading Environment from FAT... Unable to use mmc 1:1... In:serial
> Out:   serial
> Err:   serial
> Net:   phy interface0
> eth0: ethernet@1c3
> starting USB...
> Bus usb@1c1a000: USB EHCI 1.00
> scanning bus usb@1c1a000 for devices...
> U-Boot SPL 2020.04 (Apr 30 2020 - 03:41:48 +0700)
> DRAM: 512 MiB
> Trying to boot from MMC1
>
>
> U-Boot 2020.04 (Apr 30 2020 - 03:41:48 +0700) Allwinner Technology
>
> CPU:   Allwinner H3 (SUN8I 1680)
> Model: Banana Pi BPI-P2-Zero
> DRAM:  512 MiB
> MMC:   Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c1'
> mmc@1c0f000: 0, mmc@1c1: 2, mmc@1c11000: 1
> Loading Environment from FAT... Unable to use mmc 1:1... In:serial
> Out:   serial
> Err:   serial
> Net:   phy interface0
> eth0: ethernet@1c3
> starting USB...
> Bus usb@1c1a000: USB EHCI 1.00
> scanning bus usb@1c1a000 for devices... 1 USB Device(s) found
>scanning usb for storage devices... 0 Storage Device(s) found
> switch to partitions #0, OK
> mmc0 is current device
> Scanning mmc 0:1...
> Found U-Boot script /boot.scr
> 515 bytes read in 2 ms (251 KiB/s)
> ## Executing script at 4310
> 21901 bytes read in 3 ms (7 MiB/s)
> 3966976 bytes read in 182 ms (20.8 MiB/s)
> ## Flattened Device Tree blob at 4100
>Booting using the fdt blob at 0x4100
> EHCI failed to shut down host controller.
>Loading Device Tree to 49ff7000, end 49fff58c ... OK
>
> Starting kernel ...

Drop this boot log, please.

>
>
> Signed-off-by: Mizan R 
> ---
> SHA1SUM for sun8i-h2-plus-bananapi-p2-zero.dts:
> c682e1d9faba9d8c959ac526eef0962fc9ebd628  
> arch/arm/dts/sun8i-h2-plus-bananapi-p2-zero.dts

You need to add this details into commit message.

commit  ("text")

>
>  arch/arm/dts/Makefile |   1 +
>  .../dts/sun8i-h2-plus-bananapi-p2-zero.dts| 181 ++
>  board/sunxi/MAINTAINERS   |   5 +
>  configs/bananapi_p2_zero_defconfig|  20 ++
>  4 files changed, 207 insertions(+)
>  create mode 100644 arch/arm/dts/sun8i-h2-plus-bananapi-p2-zero.dts
>  create mode 100644 configs/bananapi_p2_zero_defconfig
>
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 820ee973..443d36f9 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -516,6 +516,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \
> sun8i-a83t-tbs-a711.dtb
>  dtb-$(CONFIG_MACH_SUN8I_H3) += \
> sun8i-h2-plus-bananapi-m2-zero.dtb \
> +   sun8i-h2-plus-bananapi-p2-zero.dtb \
> sun8i-h2-plus-libretech-all-h3-cc.dtb \
> sun8i-h2-plus-orangepi-r1.dtb \
> sun8i-h2-plus-orangepi-zero.dtb \
> diff --git a/arch/arm/dts/sun8i-h2-plus-bananapi-p2-zero.dts 
> b/arch/arm/dts/sun8i-h2-plus-bananapi-p2-zero.dts
> new file mode 100644
> index ..b253e6e4
> --- /dev/null
> +++ b/arch/arm/dts/sun8i-h2-plus-bananapi-p2-zero.dts
> @@ -0,0 +1,181 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * Copyright (C) 2020 Mizan R 
> + *
> + * Based on sun8i-h2-plus-bananapi-m2-zero.dts, which is:
> + *   Copyright (C) 2017 Icenowy Zheng 
> + */
> +
> +/dts-v1/;
> +#include "sun8i-h3.dtsi"
> +#include "sunxi-common-regulators.dtsi"
> +
> +#include 
> +#include 
> +
> +/ {
> +   model = "Banana Pi BPI-P2-Zero";
> +   compatible = "sinovoip,bpi-p2-zero", "allwinner,sun8i-h2-plus";
> +
> +   aliases {
> +   serial0 = 
> +   serial1 = 
> +   ethernet0 = 
> +   };
> +
> +   chosen {
> +   stdout-path = "serial0:115200n8";
> +   };
> +
> +   connector {
> +   compatible = "hdmi-connector";
> +   type = "a";
> +
> +   port {
> +   hdmi_con_in: endpoint {
> +   remote-endpoint = <_out_con>;
> +   };
> +   };
> +   };
> +
> +   leds {
> +   compatible = "gpio-leds";
> +   pinctrl-names = "default";
> +
> +   pwr_led {
> +   label = "bananapi-p2-zero:red:pwr";
> +   linux,default-trigger = "heartbeat";
> +   gpios = <_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
> +   default-state = "on";
> +   };
> +   };
> +
> +   gpio_keys {
> +   compatible = "gpio-keys";
> + 

Re: [PATCH 1/2] spi: Zap sh_spi driver

2020-05-01 Thread Jagan Teki
On Fri, May 1, 2020 at 10:15 PM Marek Vasut  wrote:
>
> On 5/1/20 6:34 PM, Jagan Teki wrote:
> > sh_spi driver is deprecated, no active updates and
> > no board user, hence dropped the same.
> >
> > Cc: Marek Vasut 
> > Cc: Tom Rini 
> > Signed-off-by: Jagan Teki 
>
> I'll check whether someone still cares about this driver and get back to
> you. Give it a week or so.

Sounds good, thanks!


Re: [PATCH] sunxi: A20-OLinuXino-Lime2: enable PHY config to fix broken ethernet

2020-05-01 Thread Jagan Teki
On Fri, Apr 24, 2020 at 5:24 PM Anatolij Gustschin  wrote:
>
> Realtek PHY is disabled in defconfig and Gigabit Ethernet support
> doesn't work. Re-enable PHY options to fix this.
>
> Signed-off-by: Anatolij Gustschin 
> Reported-by: Dario 
> Fixes: af2cbfd6b982 ("drivers: net: Provide Kconfig menu for PHYLIB")
> Fixes: 8728c97eff5b ("configs: Re-sync")
> ---

Please rebase on master and send. fyi, I don't have board
accessibility right now to test this.

Jagan.


Re: [PATCH 1/2] spi: Zap sh_spi driver

2020-05-01 Thread Marek Vasut
On 5/1/20 6:34 PM, Jagan Teki wrote:
> sh_spi driver is deprecated, no active updates and
> no board user, hence dropped the same.
> 
> Cc: Marek Vasut 
> Cc: Tom Rini 
> Signed-off-by: Jagan Teki 

I'll check whether someone still cares about this driver and get back to
you. Give it a week or so.


Re: [PATCH] board: sunxi: enable status LED in SPL

2020-05-01 Thread Jagan Teki
On Wed, Apr 22, 2020 at 4:07 PM Arnaud Ferraris
 wrote:
>
> For some systems, such as the PinePhone, there is no way for the end
> user to make sure the system is indeed booting before the boot script is
> executed, which takes several seconds. Therefore, it can be useful to
> provide early visual feedback as soon as possible.

Don't you have a splash screen on this device, so that users have a
visibility? generally consumer devices do have.

Jagan.


Re: [PATCH] image: Add support for ZSTD decompression

2020-05-01 Thread Tom Rini
On Fri, May 01, 2020 at 05:15:41PM +0200, Robert Marko wrote:
> On Fri, May 1, 2020 at 4:56 PM Tom Rini  wrote:
> >
> > On Sat, Apr 25, 2020 at 07:37:21PM +0200, Robert Marko wrote:
> >
> > > This patch adds support for ZSTD decompression of FIT images.
> > >
> > > Signed-off-by: Robert Marko 
> > > Cc: Luka Perkov 
> > > ---
> > >  common/image.c  | 52 +
> > >  include/image.h |  1 +
> > >  2 files changed, 53 insertions(+)
> > >
> > > diff --git a/common/image.c b/common/image.c
> > > index 94873cb6ed..70ba0f4328 100644
> > > --- a/common/image.c
> > > +++ b/common/image.c
> > > @@ -42,6 +42,7 @@
> > >  #include 
> > >  #include 
> > >  #include 
> > > +#include 
> > >
> > >  #ifdef CONFIG_CMD_BDI
> > >  extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
> > > argv[]);
> > > @@ -193,6 +194,7 @@ static const table_entry_t uimage_comp[] = {
> > >   {   IH_COMP_LZMA,   "lzma", "lzma compressed",  },
> > >   {   IH_COMP_LZO,"lzo",  "lzo compressed",   },
> > >   {   IH_COMP_LZ4,"lz4",  "lz4 compressed",   },
> > > + {   IH_COMP_ZSTD,   "zstd", "zstd compressed",  },
> > >   {   -1, "", "", },
> > >  };
> > >
> > > @@ -480,6 +482,56 @@ int image_decomp(int comp, ulong load, ulong 
> > > image_start, int type,
> > >   break;
> > >   }
> > >  #endif /* CONFIG_LZ4 */
> > > +#ifdef CONFIG_ZSTD
> >
> > We need to add SPL_ZSTD as a symbol to lib/Kconfig and then use
> > CONFIG_IS_ENABLED() tests here to avoid growth in SPL.  Thanks!
> Hi,
> is that something that I need to do or?

Yes.  You need to add the symbol, and then the code you're adding needs
to make use of '#if CONFIG_IS_ENABLED(ZSTD)' rather than '#ifdef
CONFIG_ZSTD'.  Sorry for not being clear enough.

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 2/2] sunxi: defconfig for FriendlyArm nanopi-duo2

2020-05-01 Thread Jagan Teki
On Mon, Apr 6, 2020 at 9:21 PM Karl Palsson  wrote:
>
> Nothing standout, but provide a defconfig that matches the dts available
> for this board. Effectively identical to the nanopi_neo_air.
>
> Signed-off-by: Karl Palsson 
> ---

Applied to u-boot-sunx/master


[PATCH 1/2] spi: Zap sh_spi driver

2020-05-01 Thread Jagan Teki
sh_spi driver is deprecated, no active updates and
no board user, hence dropped the same.

Cc: Marek Vasut 
Cc: Tom Rini 
Signed-off-by: Jagan Teki 
---
 drivers/spi/Kconfig  |   7 --
 drivers/spi/Makefile |   1 -
 drivers/spi/sh_spi.c | 249 ---
 drivers/spi/sh_spi.h |  67 
 4 files changed, 324 deletions(-)
 delete mode 100644 drivers/spi/sh_spi.c
 delete mode 100644 drivers/spi/sh_spi.h

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 4166c6104e..0ab661bf05 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -412,13 +412,6 @@ config DAVINCI_SPI
help
  Enable the Davinci SPI driver
 
-config SH_SPI
-   bool "SuperH SPI driver"
-   depends on DEPRECATED
-   help
- Enable the SuperH SPI controller driver. This driver can be used
- on various SuperH SoCs, such as SH7757.
-
 config SH_QSPI
bool "Renesas Quad SPI driver"
help
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index 52462e19a3..e12e1bca98 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -53,7 +53,6 @@ obj-$(CONFIG_ROCKCHIP_SPI) += rk_spi.o
 obj-$(CONFIG_SANDBOX_SPI) += sandbox_spi.o
 obj-$(CONFIG_SPI_SIFIVE) += spi-sifive.o
 obj-$(CONFIG_SPI_SUNXI) += spi-sunxi.o
-obj-$(CONFIG_SH_SPI) += sh_spi.o
 obj-$(CONFIG_SH_QSPI) += sh_qspi.o
 obj-$(CONFIG_STM32_QSPI) += stm32_qspi.o
 obj-$(CONFIG_STM32_SPI) += stm32_spi.o
diff --git a/drivers/spi/sh_spi.c b/drivers/spi/sh_spi.c
deleted file mode 100644
index c58fd0ebc4..00
--- a/drivers/spi/sh_spi.c
+++ /dev/null
@@ -1,249 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * SH SPI driver
- *
- * Copyright (C) 2011-2012 Renesas Solutions Corp.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include "sh_spi.h"
-
-static void sh_spi_write(unsigned long data, unsigned long *reg)
-{
-   writel(data, reg);
-}
-
-static unsigned long sh_spi_read(unsigned long *reg)
-{
-   return readl(reg);
-}
-
-static void sh_spi_set_bit(unsigned long val, unsigned long *reg)
-{
-   unsigned long tmp;
-
-   tmp = sh_spi_read(reg);
-   tmp |= val;
-   sh_spi_write(tmp, reg);
-}
-
-static void sh_spi_clear_bit(unsigned long val, unsigned long *reg)
-{
-   unsigned long tmp;
-
-   tmp = sh_spi_read(reg);
-   tmp &= ~val;
-   sh_spi_write(tmp, reg);
-}
-
-static void clear_fifo(struct sh_spi *ss)
-{
-   sh_spi_set_bit(SH_SPI_RSTF, >regs->cr2);
-   sh_spi_clear_bit(SH_SPI_RSTF, >regs->cr2);
-}
-
-static int recvbuf_wait(struct sh_spi *ss)
-{
-   while (sh_spi_read(>regs->cr1) & SH_SPI_RBE) {
-   if (ctrlc())
-   return 1;
-   udelay(10);
-   }
-   return 0;
-}
-
-static int write_fifo_empty_wait(struct sh_spi *ss)
-{
-   while (!(sh_spi_read(>regs->cr1) & SH_SPI_TBE)) {
-   if (ctrlc())
-   return 1;
-   udelay(10);
-   }
-   return 0;
-}
-
-static void sh_spi_set_cs(struct sh_spi *ss, unsigned int cs)
-{
-   unsigned long val = 0;
-
-   if (cs & 0x01)
-   val |= SH_SPI_SSS0;
-   if (cs & 0x02)
-   val |= SH_SPI_SSS1;
-
-   sh_spi_clear_bit(SH_SPI_SSS0 | SH_SPI_SSS1, >regs->cr4);
-   sh_spi_set_bit(val, >regs->cr4);
-}
-
-struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
-   unsigned int max_hz, unsigned int mode)
-{
-   struct sh_spi *ss;
-
-   if (!spi_cs_is_valid(bus, cs))
-   return NULL;
-
-   ss = spi_alloc_slave(struct sh_spi, bus, cs);
-   if (!ss)
-   return NULL;
-
-   ss->regs = (struct sh_spi_regs *)CONFIG_SH_SPI_BASE;
-
-   /* SPI sycle stop */
-   sh_spi_write(0xfe, >regs->cr1);
-   /* CR1 init */
-   sh_spi_write(0x00, >regs->cr1);
-   /* CR3 init */
-   sh_spi_write(0x00, >regs->cr3);
-   sh_spi_set_cs(ss, cs);
-
-   clear_fifo(ss);
-
-   /* 1/8 clock */
-   sh_spi_write(sh_spi_read(>regs->cr2) | 0x07, >regs->cr2);
-   udelay(10);
-
-   return >slave;
-}
-
-void spi_free_slave(struct spi_slave *slave)
-{
-   struct sh_spi *spi = to_sh_spi(slave);
-
-   free(spi);
-}
-
-int spi_claim_bus(struct spi_slave *slave)
-{
-   return 0;
-}
-
-void spi_release_bus(struct spi_slave *slave)
-{
-   struct sh_spi *ss = to_sh_spi(slave);
-
-   sh_spi_write(sh_spi_read(>regs->cr1) &
-   ~(SH_SPI_SSA | SH_SPI_SSDB | SH_SPI_SSD), >regs->cr1);
-}
-
-static int sh_spi_send(struct sh_spi *ss, const unsigned char *tx_data,
-   unsigned int len, unsigned long flags)
-{
-   int i, cur_len, ret = 0;
-   int remain = (int)len;
-
-   if (len >= SH_SPI_FIFO_SIZE)
-   sh_spi_set_bit(SH_SPI_SSA, >regs->cr1);
-
-   while (remain > 0) {
-   cur_len = (remain < SH_SPI_FIFO_SIZE) ?
-   remain : SH_SPI_FIFO_SIZE;
-   for 

[PATCH 2/2] spi: Zap lpc32xx_ssp driver-related code

2020-05-01 Thread Jagan Teki
lpc32xx_ssp driver is deprecated, no active updates
and no board user, hence dropped the same.

Cc: Vladimir Zapolskiy 
Cc: Albert ARIBAUD 
Cc: Tom Rini 
Signed-off-by: Jagan Teki 
---
 drivers/spi/Kconfig  |   6 --
 drivers/spi/Makefile |   1 -
 drivers/spi/lpc32xx_ssp.c| 134 ---
 include/configs/devkit3250.h |   5 --
 include/configs/work_92105.h |   5 --
 scripts/config_whitelist.txt |   1 -
 6 files changed, 152 deletions(-)
 delete mode 100644 drivers/spi/lpc32xx_ssp.c

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 0ab661bf05..fc759e71e2 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -424,12 +424,6 @@ config KIRKWOOD_SPI
  Enable support for SPI on various Marvell SoCs, such as
  Kirkwood and Armada 375.
 
-config LPC32XX_SSP
-   bool "LPC32XX SPI Driver"
-   depends on DEPRECATED
-   help
- Enable support for SPI on LPC32xx
-
 config MXC_SPI
bool "MXC SPI Driver"
help
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index e12e1bca98..342776404a 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -33,7 +33,6 @@ obj-$(CONFIG_FSL_ESPI) += fsl_espi.o
 obj-$(CONFIG_FSL_QSPI) += fsl_qspi.o
 obj-$(CONFIG_ICH_SPI) +=  ich.o
 obj-$(CONFIG_KIRKWOOD_SPI) += kirkwood_spi.o
-obj-$(CONFIG_LPC32XX_SSP) += lpc32xx_ssp.o
 obj-$(CONFIG_MESON_SPIFC) += meson_spifc.o
 obj-$(CONFIG_MPC8XX_SPI) += mpc8xx_spi.o
 obj-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
diff --git a/drivers/spi/lpc32xx_ssp.c b/drivers/spi/lpc32xx_ssp.c
deleted file mode 100644
index 4b09366317..00
--- a/drivers/spi/lpc32xx_ssp.c
+++ /dev/null
@@ -1,134 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * LPC32xx SSP interface (SPI mode)
- *
- * (C) Copyright 2014  DENX Software Engineering GmbH
- * Written-by: Albert ARIBAUD 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-/* SSP chip registers */
-struct ssp_regs {
-   u32 cr0;
-   u32 cr1;
-   u32 data;
-   u32 sr;
-   u32 cpsr;
-   u32 imsc;
-   u32 ris;
-   u32 mis;
-   u32 icr;
-   u32 dmacr;
-};
-
-/* CR1 register defines  */
-#define SSP_CR1_SSP_ENABLE 0x0002
-
-/* SR register defines  */
-#define SSP_SR_TNF 0x0002
-/* SSP status RX FIFO not empty bit */
-#define SSP_SR_RNE 0x0004
-
-/* lpc32xx spi slave */
-struct lpc32xx_spi_slave {
-   struct spi_slave slave;
-   struct ssp_regs *regs;
-};
-
-static inline struct lpc32xx_spi_slave *to_lpc32xx_spi_slave(
-   struct spi_slave *slave)
-{
-   return container_of(slave, struct lpc32xx_spi_slave, slave);
-}
-
-/* the following is called in sequence by do_spi_xfer() */
-
-struct spi_slave *spi_setup_slave(uint bus, uint cs, uint max_hz, uint mode)
-{
-   struct lpc32xx_spi_slave *lslave;
-
-   /* we only set up SSP0 for now, so ignore bus */
-
-   if (mode & SPI_3WIRE) {
-   pr_err("3-wire mode not supported");
-   return NULL;
-   }
-
-   if (mode & SPI_SLAVE) {
-   pr_err("slave mode not supported\n");
-   return NULL;
-   }
-
-   if (mode & SPI_PREAMBLE) {
-   pr_err("preamble byte skipping not supported\n");
-   return NULL;
-   }
-
-   lslave = spi_alloc_slave(struct lpc32xx_spi_slave, bus, cs);
-   if (!lslave) {
-   printf("SPI_error: Fail to allocate lpc32xx_spi_slave\n");
-   return NULL;
-   }
-
-   lslave->regs = (struct ssp_regs *)SSP0_BASE;
-
-   /*
-* 8 bit frame, SPI fmt, 500kbps -> clock divider is 26.
-* Set SCR to 0 and CPSDVSR to 26.
-*/
-
-   writel(0x7, >regs->cr0); /* 8-bit chunks, SPI, 1 clk/bit */
-   writel(26, >regs->cpsr); /* SSP clock = HCLK/26 = 500kbps */
-   writel(0, >regs->imsc); /* do not raise any interrupts */
-   writel(0, >regs->icr); /* clear any pending interrupt */
-   writel(0, >regs->dmacr); /* do not do DMAs */
-   writel(SSP_CR1_SSP_ENABLE, >regs->cr1); /* enable SSP0 */
-   return >slave;
-}
-
-void spi_free_slave(struct spi_slave *slave)
-{
-   struct lpc32xx_spi_slave *lslave = to_lpc32xx_spi_slave(slave);
-
-   debug("(lpc32xx) spi_free_slave: 0x%08x\n", (u32)lslave);
-   free(lslave);
-}
-
-int spi_claim_bus(struct spi_slave *slave)
-{
-   /* only one bus and slave so far, always available */
-   return 0;
-}
-
-int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
-   const void *dout, void *din, unsigned long flags)
-{
-   struct lpc32xx_spi_slave *lslave = to_lpc32xx_spi_slave(slave);
-   int bytelen = bitlen >> 3;
-   int idx_out = 0;
-   int idx_in = 0;
-   int start_time;
-
-   start_time = get_timer(0);
-   while ((idx_out < bytelen) || (idx_in < bytelen)) {
-   int status = readl(>regs->sr);
-   if ((idx_out < bytelen) && (status & SSP_SR_TNF))
-   

[PATCH v2 2/5] net: phy: micrel: Add basic support for KSZ9131

2020-05-01 Thread sbabic
> This adds basic support for the new Micrel KSZ9131 phy.
> Signed-off-by: Philippe Schenker 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 5/5] board: apalis_imx6: Add KSZ9131 phy skew settings

2020-05-01 Thread sbabic
> This patch adds skew register settings for KSZ9131. It checks first
> which phy is on the board and then applies the correct skew settings.
> Skew settings calculation for the KSZ9131:
> The i.MX6 SoC has an output skew tolerance of -100ps to 900ps. All
> PCB traces where routed exactly the same length so we can calculate
> the skew settings without taking the length into consideration. The
> traces are all length matched.
> RXC skew (PHY to MAC):
> - We use the 2ns DLL controlled delay on the PHY
> - We do not use the skew registers
> This results in the following values:
>   RXC
> PHY fixed Delay   2000ps
> PHY Added Delay   0ps
> T_setup_R min 2.00ns
> T_setup_R typ 2.00ns
> T_setup_R max 2.00ns
> T_hold_R min  1.60ns
> T_hold_R typ  2.00ns
> T_hold_R max  2.40ns
> That means we are well within RGMII specs.
> TXC skew (MAC to PHY):
> - We use the 2ns DLL controlled delay on the PHY
> - We then subtract ~0.6ns with TXD[0:3] and TXC clock pad skew
>   register in a resulting ~1.4ns delay.
> This results in the following values under consideration of the
> tolerances:
>   TXC min TXC typ TXC max
> MAC min   -100ps  -100ps  -100ps
> MAC max   900ps   900ps   900ps
> PHY fixed Delay   2000ps  2000ps  2000ps
> PHY added Delay   -340ps  -600ps  -859ps
> T_setup_T min 1.56ns  1.30ns  1.04ns
> T_setup_T typ 2.06ns  1.80ns  1.54ns
> T_setup_T max 2.56ns  2.30ns  2.04ns
> T_hold_T min  1.04ns  1.30ns  1.56ns
> T_hold_T typ  1.94ns  2.20ns  2.46ns
> T_hold_T max  2.84ns  3.10ns  3.36ns
> This shows that T_hold_T min and T_setup_T min times are out of spec
> for RGMII timing. However the KSZ9131 has a minimal value for this time
> of 0.8ns which is met under all circumstances.
> Signed-off-by: Philippe Schenker 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 4/5] board: verdin-imx8mm: Add KSZ9131 phy skew settings

2020-05-01 Thread sbabic
> This patch determines which phy is placed on the board with the PHY ID
> then it sets the same settings for KSZ9031 as before but for KSZ9131
> it enables both RXC and TXC delay lines in the PHY.
> This will compensate the missing delay from the MAC. Other skew
> settings are not needed as the traces on board are routed exactly the
> same length
> Signed-off-by: Philippe Schenker 
> Tested-by: Igor Opaniuk 
> Acked-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 1/5] net: phy: micrel: Use defines for PHY_IDs and MASK

2020-05-01 Thread sbabic
> Signed-off-by: Philippe Schenker 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 2/3] imx: imx8m*: Remove do_reset from board files

2020-05-01 Thread sbabic
> From: Claudius Heine 
> Use the `do_reset` implementation of `arch/arm/lib/reset.c` in SPL
> instead.  It is very close to what is done here, anyway, and plays
> more nicely with the rest of U-Boot than adding a custom `do_reset`
> implementation into board files.
> `do_reset` from `arch/arm/lib/reset.c` calls `reset_cpu` with 0 as the
> addr parameter while the boards are passing WDOG1_BASE_ADDR.  This is
> ok because the `reset_cpu` implementation uses WDOG1_BASE_ADDR by
> default if 0 is passed in.
> Co-Authored-by: Harald Seiler 
> Signed-off-by: Claudius Heine 
> Signed-off-by: Harald Seiler 
> Reviewed-by: Marek Vasut 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 2/8] ARM: imx8m: Fix indentation of reset_cpu() function

2020-05-01 Thread sbabic
> Use proper code-style, tabs instead of spaces for indentation.
> Signed-off-by: Harald Seiler 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH] arm: imx: Add support for Google's Coral Dev Board

2020-05-01 Thread sbabic
> Add initial support for Google's Coral Dev Board based on i.MX8MQ.
> https://coral.ai/products/dev-board
> The Phanbell naming has been used here to match the naming convention
> used in Google's U-Boot source tree:
> https://coral.googlesource.com/uboot-imx/
> Co-developed-by: Fabio Estevam 
> Signed-off-by: Alifer Moraes 
> Tested-by: marco...@gmail.com
> Tested-by: Marco Franchi 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 1/8] ARM: imx8m: Do not define do_reset() if sysreset is enabled

2020-05-01 Thread sbabic
> From: Marek Vasut 
> The SPL can also be compiled with sysreset drivers just fine, so
> update the condition to cater for that option.
> Signed-off-by: Marek Vasut 
> Cc: Fabio Estevam 
> Cc: Flavio Suligoi 
> Cc: Harald Seiler 
> Cc: Igor Opaniuk 
> Cc: Marcel Ziswiler 
> Cc: Oleksandr Suvorov 
> Cc: Peng Fan 
> Cc: Stefano Babic 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH] imx8qxp_mek: Run with caches enabled

2020-05-01 Thread sbabic
> There is no need to run with caches disabled.
> Signed-off-by: Fabio Estevam 
> Reviewed-by: Peng Fan 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 4/8] ARM: imx8m: Fix reset in SPL on NXP iMX8MM EVK

2020-05-01 Thread sbabic
> From: Marek Vasut 
> Board files should not re-implement do_reset() to work around this
> function not being defined in for specific configurations. Rather,
> the fix is to compile in drivers which implement this properly.
> This patch enables sysreset and watchdog drivers in SPL and ties
> them together to implement the same as the do_reset() hack in the
> board file, except correctly in the DM/DT framework.
> Signed-off-by: Marek Vasut 
> Cc: Fabio Estevam 
> Cc: Flavio Suligoi 
> Cc: Harald Seiler 
> Cc: Igor Opaniuk 
> Cc: Marcel Ziswiler 
> Cc: Oleksandr Suvorov 
> Cc: Peng Fan 
> Cc: Stefano Babic 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 1/2] imx8mp_evk: Remove unrelated comment

2020-05-01 Thread sbabic
> The comment does not relate to the setup_i2c() function, so just
> remove it.
> Signed-off-by: Fabio Estevam 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH] imx8: Run SPL with caches enabled

2020-05-01 Thread sbabic
> It is safe to run SPL with caches enabled on i.MX8, so
> remove such restriction.
> Signed-off-by: Fabio Estevam 
> Acked-by: Peng Fan 
> Acked-by: Oliver Graute 
> Acked-by: Anatolij Gustschin 
> Tested-by: Igor Opaniuk 
> Acked-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 3/3] imx: imx8m: Don't use the addr parameter of reset_cpu

2020-05-01 Thread sbabic
> From: Claudius Heine 
> imx8m has the only implementation of `reset_cpu` which does not ignore
> the addr parameter and instead gives it some meaning as the base address
> of watchdog registers.  This breaks convention with the rest of U-Boot
> where the parameter is ignored and callers are passing in 0.
> Fixes: d2041725e84b ("imx8m: restrict reset_cpu")
> Co-Authored-by: Harald Seiler 
> Signed-off-by: Claudius Heine 
> Signed-off-by: Harald Seiler 
> Reviewed-by: Marek Vasut 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 2/2] mx8mq_evk: Remove unrelated comment

2020-05-01 Thread sbabic
> The comment does not relate to the setup_i2c() function, so just
> remove it.
> Signed-off-by: Fabio Estevam 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 5/8] ARM: imx8m: Fix reset in SPL on NXP iMX8MN EVK

2020-05-01 Thread sbabic
> From: Marek Vasut 
> Board files should not re-implement do_reset() to work around this
> function not being defined in for specific configurations. Rather,
> the fix is to compile in drivers which implement this properly.
> This patch enables sysreset and watchdog drivers in SPL and ties
> them together to implement the same as the do_reset() hack in the
> board file, except correctly in the DM/DT framework.
> Signed-off-by: Marek Vasut 
> Cc: Fabio Estevam 
> Cc: Flavio Suligoi 
> Cc: Harald Seiler 
> Cc: Igor Opaniuk 
> Cc: Marcel Ziswiler 
> Cc: Oleksandr Suvorov 
> Cc: Peng Fan 
> Cc: Stefano Babic 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH] arm: dts: imx8mm: sync dts from Linux Kernel 5.6.7

2020-05-01 Thread sbabic
> This patch synchronizes the device tree with that from 5.6.7.
> This also adds nodes for crypto and ddrc, which makes keeping
> the device tree files from individual boards in sync with the
> Linux kernel.  This is helpful when boads reference those nodes.
> Signed-off-by: Adam Ford 
> diff --git a/arch/arm/dts/imx8mm.dtsi b/arch/arm/dts/imx8mm.dtsi
> index 8aafad2449..1e5e11592f 100644
> --- a/arch/arm/dts/imx8mm.dtsi
> +++ b/arch/arm/dts/imx8mm.dtsi
> @@ -12,7 +12,6 @@
>  #include "imx8mm-pinfunc.h"
>  
>  / {
> - compatible = "fsl,imx8mm";
>   interrupt-parent = <>;
>   #address-cells = <2>;
>   #size-cells = <2>;
> @@ -141,11 +140,6 @@
>   };
>   };
>  
> - memory@4000 {
> - device_type = "memory";
> - reg = <0x0 0x4000 0 0x8000>;
> - };
> -
>   osc_32k: clock-osc-32k {
>   compatible = "fixed-clock";
>   #clock-cells = <0>;
> @@ -233,7 +227,7 @@
>   ranges = <0x0 0x0 0x0 0x3e00>;
>  
>   aips1: bus@3000 {
> - compatible = "fsl,aips-bus", "simple-bus";
> + compatible = "simple-bus";
>   #address-cells = <1>;
>   #size-cells = <1>;
>   ranges = <0x3000 0x3000 0x40>;
> @@ -394,7 +388,7 @@
>   };
>  
>   sdma2: dma-controller@302c {
> - compatible = "fsl,imx8mm-sdma", 
> "fsl,imx7d-sdma";
> + compatible = "fsl,imx8mm-sdma", 
> "fsl,imx8mq-sdma";
>   reg = <0x302c 0x1>;
>   interrupts = ;
>   clocks = < IMX8MM_CLK_SDMA2_ROOT>,
> @@ -405,7 +399,7 @@
>   };
>  
>   sdma3: dma-controller@302b {
> - compatible = "fsl,imx8mm-sdma", 
> "fsl,imx7d-sdma";
> + compatible = "fsl,imx8mm-sdma", 
> "fsl,imx8mq-sdma";
>   reg = <0x302b 0x1>;
>   interrupts = ;
>   clocks = < IMX8MM_CLK_SDMA3_ROOT>,
> @@ -439,7 +433,7 @@
>   };
>  
>   anatop: anatop@3036 {
> - compatible = "fsl,imx8mm-anatop", "syscon", 
> "simple-bus";
> + compatible = "fsl,imx8mm-anatop", "syscon";
>   reg = <0x3036 0x1>;
>   };
>  
> @@ -479,14 +473,18 @@
>   < IMX8MM_CLK_AUDIO_AHB>,
>   < 
> IMX8MM_CLK_IPG_AUDIO_ROOT>,
>   < IMX8MM_SYS_PLL3>,
> - < IMX8MM_VIDEO_PLL1>;
> + < IMX8MM_VIDEO_PLL1>,
> + < IMX8MM_AUDIO_PLL1>,
> + < IMX8MM_AUDIO_PLL2>;
>   assigned-clock-parents = < 
> IMX8MM_SYS_PLL3_OUT>,
>< 
> IMX8MM_SYS_PLL1_800M>;
>   assigned-clock-rates = <0>,
>   <4>,
>   <4>,
>   <75000>,
> - <59400>;
> + <59400>,
> + <393216000>,
> + <361267200>;
>   };
>  
>   src: reset-controller@3039 {
> @@ -498,7 +496,7 @@
>   };
>  
>   aips2: bus@3040 {
> - compatible = "fsl,aips-bus", "simple-bus";
> + compatible = "simple-bus";
>   #address-cells = <1>;
>   #size-cells = <1>;
>   ranges = <0x3040 0x3040 0x40>;
> @@ -557,7 +555,7 @@
>   };
>  
>   aips3: bus@3080 {
> - compatible = "fsl,aips-bus", "simple-bus";
> + compatible = "simple-bus";
>   #address-cells = <1>;
>   #size-cells = <1>;
>   ranges = <0x3080 0x3080 0x40>;
> @@ -638,6 +636,36 @@
>   status = "disabled";
>   };
>  
> + crypto: crypto@3090 {
> + compatible = "fsl,sec-v4.0";
> + #address-cells = <1>;
> + #size-cells = <1>;
> +

[PATCH v3 2/2] config: apalis-imx8: Enable FEC TXC delay

2020-05-01 Thread sbabic
> define FEC_ENET_ENABLE_TXC_DELAY to enable the delay on TXC line on
> the MAC. This has to be done in order to meet RGMII specs.
> According to RGMII specs the clock should get delayed so the edges of
> the clock are preferrably in the middle of the edges of data-lines so
> they can be sampled properly.
> Our PHY expects the MAC to delay TXC line, as it is also written
> in the spec. This patch makes sure the TXC delay on the FEC is enabled
> Signed-off-by: Philippe Schenker 
> Reviewed-by: Oleksandr Suvorov 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 6/8] ARM: imx8m: Fix reset in SPL on NXP iMX8MP EVK

2020-05-01 Thread sbabic
> From: Marek Vasut 
> Board files should not re-implement do_reset() to work around this
> function not being defined in for specific configurations. Rather,
> the fix is to compile in drivers which implement this properly.
> This patch enables sysreset and watchdog drivers in SPL and ties
> them together to implement the same as the do_reset() hack in the
> board file, except correctly in the DM/DT framework.
> Signed-off-by: Marek Vasut 
> Cc: Fabio Estevam 
> Cc: Flavio Suligoi 
> Cc: Harald Seiler 
> Cc: Igor Opaniuk 
> Cc: Marcel Ziswiler 
> Cc: Oleksandr Suvorov 
> Cc: Peng Fan 
> Cc: Stefano Babic 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[Patch v5 3/7] treewide: Remove unused FSL QSPI config options for IMX platforms

2020-05-01 Thread sbabic
> Some of these options are not used by the driver anymore and some of them
> are obsolete as the information is gathered from the dt.
> So, remove the unused config options now.
> Signed-off-by: Frieder Schrempf 
> Signed-off-by: Ashish Kumar 
> Signed-off-by: Kuldeep Singh 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 1/2] net: fec: Add possibility to enable TXC delay

2020-05-01 Thread sbabic
> This patch enables the possibility to set FEC_ENET_ENABLE_TXC_DELAY or
> FEC_ENET_ENABLE_RXC_DELAY so one can via a define enable the RXC or TXC
> delay in the MAC.
> Signed-off-by: Philippe Schenker 
> Reviewed-by: Oleksandr Suvorov 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 3/8] ARM: imx8m: Don't use the addr parameter of reset_cpu()

2020-05-01 Thread sbabic
> From: Claudius Heine 
> imx8m has the only implementation of reset_cpu() which does not ignore
> the addr parameter and instead gives it some meaning as the base address
> of watchdog registers.  This breaks convention with the rest of U-Boot
> where the parameter is ignored and callers are passing in 0.
> Fixes: d2041725e84b ("imx8m: restrict reset_cpu")
> Co-developed-by: Harald Seiler 
> Signed-off-by: Harald Seiler 
> Signed-off-by: Claudius Heine 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 1/3] ARM: reset: use do_reset in SPL/TPL if SYSRESET was not enabled for them

2020-05-01 Thread sbabic
> From: Claudius Heine 
> In case CONFIG_SYSRESET is set, do_reset from reset.c will not be available
> anywere, even if SYSRESET is disabled for SPL/TPL.
> 'do_reset' is called from SPL for instance from the panic handler and
> PANIC_HANG is not set
> Signed-off-by: Claudius Heine 
> Reviewed-by: Marek Vasut 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH] ARM: imx: imx8m: Do not warn about cpu-idle-states if missing

2020-05-01 Thread sbabic
> If the cpu-idle-states is missing from the DT in the first place, do
> not fail on removing in. Just move on and do not even print an error,
> since not being able to remove something which is not there in the
> first place is not an error and surely does not justify failing to
> boot.
> Turn the surrounding prints into debugs to reduce the useless noise.
> Signed-off-by: Marek Vasut 
> Cc: Frieder Schrempf 
> Cc: Fabio Estevam 
> Cc: Peng Fan 
> Cc: Stefano Babic 
> Reviewed-by: Fabio Estevam 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH 7/8] ARM: imx8m: Fix reset in SPL on Toradex iMX8MM Verdin

2020-05-01 Thread sbabic
> From: Marek Vasut 
> Board files should not re-implement do_reset() to work around this
> function not being defined in for specific configurations. Rather,
> the fix is to compile in drivers which implement this properly.
> This patch enables sysreset and watchdog drivers in SPL and ties
> them together to implement the same as the do_reset() hack in the
> board file, except correctly in the DM/DT framework.
> Signed-off-by: Marek Vasut 
> Cc: Fabio Estevam 
> Cc: Flavio Suligoi 
> Cc: Harald Seiler 
> Cc: Igor Opaniuk 
> Cc: Marcel Ziswiler 
> Cc: Oleksandr Suvorov 
> Cc: Peng Fan 
> Cc: Stefano Babic 
> Reviewed-by: Oleksandr Suvorov 
> Acked-by: Igor Opaniuk 
> Acked-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH] dt-bindings: pinctrl: imxrt1020: remove useless comment

2020-05-01 Thread sbabic
> A comment note has been left after completing pinctrl listing, so let's
> remove it since it's useless.
> Signed-off-by: Giulio Benetti 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 3/5] verdin-imx8mm: Change board phy skew values for our ksz9031

2020-05-01 Thread sbabic
> This patches uses the existing functions for interacting with the
> KSZ9031 and uses the values appropriate for our board.
> Signed-off-by: Philippe Schenker 
> Tested-by: Igor Opaniuk 
> Acked-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH] imx8qxp_mek: Remove SPL watchdog option

2020-05-01 Thread sbabic
> Currently the following watchdog error is seen in SPL:
> U-Boot SPL 2020.04-00407-g8d5d3bcf3c (Apr 20 2020 - 09:48:09 -0300)
> Normal Boot
> WDT:   Not found!
> ...
> There is no watchdog driver for i.MX8 at the moment, nor code for
> configuring the watchdog in SPL, so remove the CONFIG_SPL_WATCHDOG_SUPPORT
> option for now.
> Signed-off-by: Fabio Estevam 
> Reviewed-by: Stefano Babic 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


Re: [ANN] U-Boot v2020.07-rc1 released

2020-05-01 Thread Marek Vasut
On 5/1/20 5:53 PM, Anatolij Gustschin wrote:
> Hi Marek,
> 
> On Fri, 1 May 2020 17:39:27 +0200
> Marek Vasut ma...@denx.de wrote:
> ... 
>>
>> Build failed, please fix:
>> https://gitlab.denx.de/u-boot/custodians/u-boot-usb/pipelines/3054
> 
> This link is not accessible for public, could you please check the
> CI/CD permission settings? Should be under gitlab project settings,
> CI/CD > General pipelines > Public pipelines checkbox. Thanks!

Fixed, thanks.


Re: Aw: Re: Re: [ANN] U-Boot v2020.07-rc1 released

2020-05-01 Thread Marek Vasut
On 5/1/20 5:46 PM, Frank Wunderlich wrote:
> this should go to author of Patch ;)
> 
> regards Frank
> 
>> Gesendet: Freitag, 01. Mai 2020 um 17:39 Uhr
>> Von: "Marek Vasut" 
>> Build failed, please fix:
>> https://gitlab.denx.de/u-boot/custodians/u-boot-usb/pipelines/3054

Thanks for CCing the author.

Again, please stop top-posting.


[PULL] u-boot-sh/next network cleanup part 1

2020-05-01 Thread Marek Vasut
This is part 1 of big network cleanup / DM conversion.
The dc2114x/rtl8139/pcnet/tulip PCI adapter drivers received checkpatch
cleanups in preparation for DM conversion. The smc911x is converted to
DM completely. The dwc_eth_qos cache fixes are applied.

I hope this is a one-off thing where I am picking my own network patches
(sigh :-( ) and Joe comes back soon.

The following changes since commit 78021b63373de32335bd204471d6cb7c7e18bc52:

  Merge tag 'efi-2020-07-rc2' of
https://gitlab.denx.de/u-boot/custodians/u-boot-efi (2020-04-30 15:11:06
-0400)

are available in the Git repository at:

  git://git.denx.de/u-boot-sh.git next

for you to fetch changes up to 8148693b988fb36463dbc12cef4b7947acae9846:

  net: smc911x: Add DM support (2020-05-01 15:37:48 +0200)


Marek Vasut (48):
  net: Fix warning when including netdev.h on DM systems
  net: pcnet: Remove CONFIG_PCNET_79C97x
  net: tulip: Remove CONFIG_TULIP_*
  net: pcnet: Replace mips-specific accessors
  net: pcnet: Switch to PCI memory access
  net: dc2114x: Clean up init code
  net: dc2114x: Clean up dc21x4x_send()
  net: dc2114x: Clean up dc21x4x_recv()
  net: dc2114x: Clean up dc21x4x_halt()
  net: dc2114x: Clean up send_setup_frame()
  net: dc2114x: Clean up SROM operations
  net: dc2114x: Clean up remaining driver code
  net: dc2114x: Clean up DE4X5 macros
  net: dc2114x: Clean up INL/OUTL functions
  net: dc2114x: Reorganize driver
  net: dc2114x: Switch DEBUG_SROM{,2} to debug_cond()
  net: dwc_eth_qos: Fully rewrite RX descriptor field 3
  net: dwc_eth_qos: Correctly wrap around TX descriptor tail pointer
  net: dwc_eth_qos: Flush the RX descriptors on init
  net: dwc_eth_qos: Invalidate RX descriptor before reading
  net: dwc_eth_qos: Invalidate RX packet DMA buffer
  net: dwc_eth_qos: Prevent DMA from writing updated RX DMA descriptor
  net: rtl8139: Register macro cleanup
  net: rtl8139: Rework eeprom_delay() macro
  net: rtl8139: Minor cleanup of read_eeprom()
  net: rtl8139: Consistently use rtl8139_rx_config
  net: rtl8139: Minor cleanup of set_rx_mode()
  net: rtl8139: Minor cleanup of rtl_reset()
  net: rtl8139: Minor cleanup of rtl_transmit()
  net: rtl8139: Minor cleanup of rtl_poll()
  net: rtl8139: Minor cleanup of rtl_disable()
  net: rtl8139: Factor out hardware reset
  net: rtl8139: Finish cleanup
  net: rtl8139: Move functions around
  net: rtl8139: Fill in SPDX tag
  net: smc911x: Remove pkt_data_{push,pull}
  net: smc911x: Replace malloc()+memset() with calloc()
  net: smc911x: Rename smc911x_rx() to smc911x_recv()
  net: smc911x: Invert the logic in smc911x_miiphy_{read,write}()
  net: smc911x: Fix potential memleak() in init fail path
  net: smc911x: Pull MII registration into separate function
  net: smc911x: Inline all functions from header file
  net: smc911x: Drop weak alias from 32bit accessors
  net: smc911x: Convert IO accessors to {read,write}{w,l}()
  net: smc911x: Pass around driver private data
  net: smc911x: Clean up the status handling in smc911x_recv()
  net: smc911x: Split non-DM specific bits from common code
  net: smc911x: Add DM support

 README   |   2 -
 drivers/net/Kconfig  |   2 +
 drivers/net/dc2114x.c| 965
+++-
 drivers/net/dwc_eth_qos.c|  18 +-
 drivers/net/pcnet.c  |  18 +-
 drivers/net/rtl8139.c| 742
+++---
 drivers/net/smc911x.c| 560

 drivers/net/smc911x.h| 157 
 examples/standalone/Makefile |   5 +-
 examples/standalone/smc911x_eeprom.c | 150 +++
 include/configs/malta.h  |   1 -
 include/netdev.h |   1 +
 scripts/config_whitelist.txt |   5 -
 13 files changed, 1447 insertions(+), 1179 deletions(-)


Re: [ANN] U-Boot v2020.07-rc1 released

2020-05-01 Thread Anatolij Gustschin
Hi Marek,

On Fri, 1 May 2020 17:39:27 +0200
Marek Vasut ma...@denx.de wrote:
... 
> 
> Build failed, please fix:
> https://gitlab.denx.de/u-boot/custodians/u-boot-usb/pipelines/3054

This link is not accessible for public, could you please check the
CI/CD permission settings? Should be under gitlab project settings,
CI/CD > General pipelines > Public pipelines checkbox. Thanks!

--
Anatolij


Aw: Re: Re: [ANN] U-Boot v2020.07-rc1 released

2020-05-01 Thread Frank Wunderlich
this should go to author of Patch ;)

regards Frank

> Gesendet: Freitag, 01. Mai 2020 um 17:39 Uhr
> Von: "Marek Vasut" 
> Build failed, please fix:
> https://gitlab.denx.de/u-boot/custodians/u-boot-usb/pipelines/3054



Re: [PATCH V4 13/13] net: smc911x: Add DM support

2020-05-01 Thread Marek Vasut
On 3/25/20 5:46 PM, Marek Vasut wrote:
> Add support for U-Boot DM and DT probing. Furthermore, build the
> SMC911x standalone EEPROM example only for the non-DM case, as it
> is not converted yet.
> 
> Signed-off-by: Marek Vasut 
> Cc: Joe Hershberger 
> Cc: Masahiro Yamada 
> ---
> V2: Drop the board-specific bits
> Hide SMC911X_BASE from Kconfig if DM_ETH
> V3: No change
> V4: No change
> ---
>  drivers/net/Kconfig  |   2 +
>  drivers/net/smc911x.c| 114 +++
>  examples/standalone/Makefile |   5 +-
>  3 files changed, 120 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index 4d1013c984..095395813a 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -388,11 +388,13 @@ config SMC911X
>  
>  if SMC911X
>  
> +if !DM_ETH
>  config SMC911X_BASE
>   hex "SMC911X Base Address"
>   help
> Define this to hold the physical address
> of the device (I/O space)
> +endif #DM_ETH
>  
>  choice
>   prompt "SMC911X bus width"
> diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
> index 95f955f6d8..89be192d5f 100644
> --- a/drivers/net/smc911x.c
> +++ b/drivers/net/smc911x.c
> @@ -21,7 +21,9 @@ struct chip_id {
>  };
>  
>  struct smc911x_priv {
> +#ifndef CONFIG_DM_ETH
>   struct eth_device   dev;
> +#endif
>   phys_addr_t iobase;
>   const struct chip_id*chipid;
>   unsigned char   enetaddr[6];
> @@ -370,6 +372,8 @@ static int smc911x_recv_common(struct smc911x_priv *priv, 
> u32 *data)
>   return pktlen;
>  }
>  
> +#ifndef CONFIG_DM_ETH
> +
>  #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
>  /* wrapper for smc911x_eth_phy_read */
>  static int smc911x_miiphy_read(struct mii_dev *bus, int phy, int devad,
> @@ -516,3 +520,113 @@ err_detect:
>   free(priv);
>   return ret;
>  }
> +
> +#else/* ifdef CONFIG_DM_ETH */
> +
> +static int smc911x_start(struct udevice *dev)
> +{
> + struct eth_pdata *plat = dev_get_platdata(dev);
> + struct smc911x_priv *priv = dev_get_priv(dev);
> +
> + memcpy(priv->enetaddr, plat->enetaddr, sizeof(plat->enetaddr));
> +
> + return smc911x_init_common(priv);
> +}
> +
> +static void smc911x_stop(struct udevice *dev)
> +{
> + struct smc911x_priv *priv = dev_get_priv(dev);
> +
> + smc911x_halt_common(priv);
> +}
> +
> +static int smc911x_send(struct udevice *dev, void *packet, int length)
> +{
> + struct smc911x_priv *priv = dev_get_priv(dev);
> + int ret;
> +
> + ret = smc911x_send_common(priv, packet, length);
> +
> + return ret ? 0 : -ETIMEDOUT;
> +}
> +
> +static int smc911x_recv(struct udevice *dev, int flags, uchar **packetp)
> +{
> + struct smc911x_priv *priv = dev_get_priv(dev);
> + u32 *data = (u32 *)net_rx_packets[0];
> + int ret;
> +
> + ret = smc911x_recv_common(priv, data);
> + if (ret)
> + *packetp = (void *)data;
> +
> + return ret ? ret : -EAGAIN;
> +}
> +
> +static int smc911x_bind(struct udevice *dev)
> +{
> + return device_set_name(dev, dev->name);
> +}
> +
> +static int smc911x_probe(struct udevice *dev)
> +{
> + struct smc911x_priv *priv = dev_get_priv(dev);
> + unsigned long addrh, addrl;
> + int ret;
> +
> + /* Try to detect chip. Will fail if not present. */
> + ret = smc911x_detect_chip(priv);
> + if (ret)
> + return ret;
> +
> + addrh = smc911x_get_mac_csr(priv, ADDRH);
> + addrl = smc911x_get_mac_csr(priv, ADDRL);
> + if (!(addrl == 0x && addrh == 0x)) {
> + /* address is obtained from optional eeprom */
> + priv->enetaddr[0] = addrl;
> + priv->enetaddr[1] = addrl >>  8;
> + priv->enetaddr[2] = addrl >> 16;
> + priv->enetaddr[3] = addrl >> 24;
> + priv->enetaddr[4] = addrh;
> + priv->enetaddr[5] = addrh >> 8;
> + }
> +
> + return 0;
> +}
> +
> +static int smc911x_ofdata_to_platdata(struct udevice *dev)
> +{
> + struct smc911x_priv *priv = dev_get_priv(dev);
> + struct eth_pdata *pdata = dev_get_platdata(dev);
> +
> + pdata->iobase = devfdt_get_addr(dev);
> + priv->iobase = pdata->iobase;
> +
> + return 0;
> +}
> +
> +static const struct eth_ops smc911x_ops = {
> + .start  = smc911x_start,
> + .send   = smc911x_send,
> + .recv   = smc911x_recv,
> + .stop   = smc911x_stop,
> +};
> +
> +static const struct udevice_id smc911x_ids[] = {
> + { .compatible = "smsc,lan9115" },
> + { }
> +};
> +
> +U_BOOT_DRIVER(smc911x) = {
> + .name   = "eth_smc911x",
> + .id = UCLASS_ETH,
> + .of_match   = smc911x_ids,
> + .bind   = smc911x_bind,
> + .ofdata_to_platdata = smc911x_ofdata_to_platdata,
> + .probe  = smc911x_probe,
> + .ops= _ops,
> + .priv_auto_alloc_size = sizeof(struct smc911x_priv),
> + 

[PATCH V2] mkimage: fit: Do not tail-pad fitImage with external data

2020-05-01 Thread Marek Vasut
There is no reason to tail-pad fitImage with external data to 4-bytes,
while fitImage without external data does not have any such padding and
is often unaligned. DT spec also does not mandate any such padding.

Moreover, the tail-pad fills the last few bytes with uninitialized data,
which could lead to a potential information leak.

$ echo -n xy > /tmp/data ; \
./tools/mkimage -E -f auto -d /tmp/data /tmp/fitImage ; \
hexdump -vC /tmp/fitImage | tail -n 3

before:
0260  61 2d 6f 66 66 73 65 74  00 64 61 74 61 2d 73 69  |a-offset.data-si|
0270  7a 65 00 00 78 79 64 64   |ze..xydd|
   ^^   ^^ ^^
after:
0260  61 2d 6f 66 66 73 65 74  00 64 61 74 61 2d 73 69  |a-offset.data-si|
0270  7a 65 00 78 79|ze.xy|

Signed-off-by: Marek Vasut 
Cc: Heinrich Schuchardt 
Cc: Simon Glass 
Cc: Tom Rini 
---
V2: Rebase on u-boot/master, update commit message
---
 tools/fit_image.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/fit_image.c b/tools/fit_image.c
index 4aeabbcfe9..b859e7c0c0 100644
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -434,7 +434,7 @@ static int fit_extract_data(struct image_tool_params 
*params, const char *fname)
int image_number;
int align_size;
 
-   align_size = params->bl_len ? params->bl_len : 4;
+   align_size = params->bl_len ? params->bl_len : 1;
fd = mmap_fdt(params->cmdname, fname, 0, , , false, false);
if (fd < 0)
return -EIO;
@@ -492,7 +492,6 @@ static int fit_extract_data(struct image_tool_params 
*params, const char *fname)
fdt_pack(fdt);
 
new_size = fdt_totalsize(fdt);
-   new_size = ALIGN(new_size, align_size);
fdt_set_totalsize(fdt, new_size);
debug("Size reduced from %x to %x\n", fit_size, fdt_totalsize(fdt));
debug("External data size %x\n", buf_ptr);
-- 
2.25.1



Re: Aw: Re: [ANN] U-Boot v2020.07-rc1 released

2020-05-01 Thread Marek Vasut
On 5/1/20 5:14 PM, Marek Vasut wrote:
> On 5/1/20 3:49 PM, Frank Wunderlich wrote:
>> imho last discussion this (v7 part 3): 
>> https://patchwork.ozlabs.org/project/uboot/patch/1588140330-9910-4-git-send-email-chunfeng@mediatek.com/
>>  that looks resolved for me
> 
> Please stop top-posting.
> 
>> regards Frank
>>
>>
>>> Gesendet: Freitag, 01. Mai 2020 um 11:18 Uhr
>>> Von: "Marek Vasut" 
>>> An: "Tom Rini" , "Frank Wunderlich" 
>>> 
>>> Cc: u-boot@lists.denx.de
>>> Betreff: Re: [ANN] U-Boot v2020.07-rc1 released
>>>
>>> On 5/1/20 12:18 AM, Tom Rini wrote:
 On Wed, Apr 29, 2020 at 03:24:28PM +0200, Frank Wunderlich wrote:
> Hi,
>
> I hope the mtk xhci series can be merged because further xhci-development 
> for mt7622/23 depends on this.

 If Marek is happy with the code, I won't object.
>>>
>>> There is still some ongoing discussion in v7, isn't there ?
>>>
> 
> Applied.

Build failed, please fix:
https://gitlab.denx.de/u-boot/custodians/u-boot-usb/pipelines/3054


Re: [PATCH] image: Add support for ZSTD decompression

2020-05-01 Thread Robert Marko
On Fri, May 1, 2020 at 4:56 PM Tom Rini  wrote:
>
> On Sat, Apr 25, 2020 at 07:37:21PM +0200, Robert Marko wrote:
>
> > This patch adds support for ZSTD decompression of FIT images.
> >
> > Signed-off-by: Robert Marko 
> > Cc: Luka Perkov 
> > ---
> >  common/image.c  | 52 +
> >  include/image.h |  1 +
> >  2 files changed, 53 insertions(+)
> >
> > diff --git a/common/image.c b/common/image.c
> > index 94873cb6ed..70ba0f4328 100644
> > --- a/common/image.c
> > +++ b/common/image.c
> > @@ -42,6 +42,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >
> >  #ifdef CONFIG_CMD_BDI
> >  extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
> > argv[]);
> > @@ -193,6 +194,7 @@ static const table_entry_t uimage_comp[] = {
> >   {   IH_COMP_LZMA,   "lzma", "lzma compressed",  },
> >   {   IH_COMP_LZO,"lzo",  "lzo compressed",   },
> >   {   IH_COMP_LZ4,"lz4",  "lz4 compressed",   },
> > + {   IH_COMP_ZSTD,   "zstd", "zstd compressed",  },
> >   {   -1, "", "", },
> >  };
> >
> > @@ -480,6 +482,56 @@ int image_decomp(int comp, ulong load, ulong 
> > image_start, int type,
> >   break;
> >   }
> >  #endif /* CONFIG_LZ4 */
> > +#ifdef CONFIG_ZSTD
>
> We need to add SPL_ZSTD as a symbol to lib/Kconfig and then use
> CONFIG_IS_ENABLED() tests here to avoid growth in SPL.  Thanks!
Hi,
is that something that I need to do or?

Thanks
>
> --
> Tom


Re: Aw: Re: [ANN] U-Boot v2020.07-rc1 released

2020-05-01 Thread Marek Vasut
On 5/1/20 3:49 PM, Frank Wunderlich wrote:
> imho last discussion this (v7 part 3): 
> https://patchwork.ozlabs.org/project/uboot/patch/1588140330-9910-4-git-send-email-chunfeng@mediatek.com/
>  that looks resolved for me

Please stop top-posting.

> regards Frank
> 
> 
>> Gesendet: Freitag, 01. Mai 2020 um 11:18 Uhr
>> Von: "Marek Vasut" 
>> An: "Tom Rini" , "Frank Wunderlich" 
>> 
>> Cc: u-boot@lists.denx.de
>> Betreff: Re: [ANN] U-Boot v2020.07-rc1 released
>>
>> On 5/1/20 12:18 AM, Tom Rini wrote:
>>> On Wed, Apr 29, 2020 at 03:24:28PM +0200, Frank Wunderlich wrote:
 Hi,

 I hope the mtk xhci series can be merged because further xhci-development 
 for mt7622/23 depends on this.
>>>
>>> If Marek is happy with the code, I won't object.
>>
>> There is still some ongoing discussion in v7, isn't there ?
>>

Applied.


Re: [RFC][PATCH] mkimage: fit: Do not tail-pad fitImage with external data

2020-05-01 Thread Tom Rini
On Fri, Apr 24, 2020 at 12:19:00PM +0200, Marek Vasut wrote:

> There is no reason to tail-pad fitImage with external data to 4-bytes,
> while fitImage without external data does not have any such padding and
> is often unaligned. DT spec also does not mandate any such padding.
> 
> Moreover, the tail-pad fills the last few bytes with uninitialized data,
> which could lead to a potential information leak.
> 
> Test:
> echo -n x > /tmp/data ; ./tools/mkimage -f auto -d /tmp/data /tmp/fitImage ; 
> hexdump -vC /tmp/fitImage
> echo -n x > /tmp/data ; ./tools/mkimage -E -f auto -d /tmp/data /tmp/fitImage 
> ; hexdump -vC /tmp/fitImage
> 
> Signed-off-by: Marek Vasut 
> Cc: Heinrich Schuchardt 
> Cc: Simon Glass 
> Cc: Tom Rini 
> Reviewed-by: Simon Glass 
> ---
>  tools/fit_image.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/tools/fit_image.c b/tools/fit_image.c
> index dd61a816c9..2fc4c3630d 100644
> --- a/tools/fit_image.c
> +++ b/tools/fit_image.c
> @@ -488,7 +488,6 @@ static int fit_extract_data(struct image_tool_params 
> *params, const char *fname)
>   debug("Size reduced from %x to %x\n", fit_size, fdt_totalsize(fdt));
>   debug("External data size %x\n", buf_ptr);
>   new_size = fdt_totalsize(fdt);
> - new_size = (new_size + 3) & ~3;
>   munmap(fdt, sbuf.st_size);
>  
>   if (ftruncate(fd, new_size)) {

As of:
commit ebfe611be91e0075c040588a30a9996519d30aa6
Author: Kever Yang 
Date:   Mon Mar 30 11:56:24 2020 +0800

mkimage: fit_image: Add option to make fit header align

this doesn't apply and the area in question has changed.  Can you please
see if your use-case is supported correctly now?  Or v2 this, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] image: Add support for ZSTD decompression

2020-05-01 Thread Tom Rini
On Sat, Apr 25, 2020 at 07:37:21PM +0200, Robert Marko wrote:

> This patch adds support for ZSTD decompression of FIT images.
> 
> Signed-off-by: Robert Marko 
> Cc: Luka Perkov 
> ---
>  common/image.c  | 52 +
>  include/image.h |  1 +
>  2 files changed, 53 insertions(+)
> 
> diff --git a/common/image.c b/common/image.c
> index 94873cb6ed..70ba0f4328 100644
> --- a/common/image.c
> +++ b/common/image.c
> @@ -42,6 +42,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #ifdef CONFIG_CMD_BDI
>  extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
> argv[]);
> @@ -193,6 +194,7 @@ static const table_entry_t uimage_comp[] = {
>   {   IH_COMP_LZMA,   "lzma", "lzma compressed",  },
>   {   IH_COMP_LZO,"lzo",  "lzo compressed",   },
>   {   IH_COMP_LZ4,"lz4",  "lz4 compressed",   },
> + {   IH_COMP_ZSTD,   "zstd", "zstd compressed",  },
>   {   -1, "", "", },
>  };
>  
> @@ -480,6 +482,56 @@ int image_decomp(int comp, ulong load, ulong 
> image_start, int type,
>   break;
>   }
>  #endif /* CONFIG_LZ4 */
> +#ifdef CONFIG_ZSTD

We need to add SPL_ZSTD as a symbol to lib/Kconfig and then use
CONFIG_IS_ENABLED() tests here to avoid growth in SPL.  Thanks!

-- 
Tom


signature.asc
Description: PGP signature


[PATCH 3/5] sysreset: mpc83xx: fix CONFIG_IS_ENABLED logic

2020-05-01 Thread Rasmus Villemoes
Unlike IS_ENABLED, one should not include the CONFIG_ part in the
argument to CONFIG_IS_ENABLED - currently, the first of these tests
for whether CONFIG_CONFIG_AER_FULL or CONFIG_SPL_CONFIG_AER_FULL are
defined (depending on SPL or not), similarly for the other one.

Signed-off-by: Rasmus Villemoes 
---
 drivers/sysreset/sysreset_mpc83xx.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/sysreset/sysreset_mpc83xx.c 
b/drivers/sysreset/sysreset_mpc83xx.c
index 3447b8e75c..631ae6a5dc 100644
--- a/drivers/sysreset/sysreset_mpc83xx.c
+++ b/drivers/sysreset/sysreset_mpc83xx.c
@@ -103,7 +103,7 @@ static int print_83xx_arb_event(bool force, char *buf, int 
size)
if (!force && !gd->arch.arbiter_event_address)
return 0;
 
-   if (CONFIG_IS_ENABLED(CONFIG_DISPLAY_AER_FULL)) {
+   if (CONFIG_IS_ENABLED(DISPLAY_AER_FULL)) {
res = scnprintf(buf, size,
"Arbiter Event Status:\n"
"%s: 0x%08lX\n"
@@ -116,7 +116,7 @@ static int print_83xx_arb_event(bool force, char *buf, int 
size)
"Master ID", mstr_id, master[mstr_id],
"Transfer Size", tsize_val, tsize_bytes,
"Transfer Type", ttype, transfer[ttype]);
-   } else if (CONFIG_IS_ENABLED(CONFIG_DISPLAY_AER_BRIEF)) {
+   } else if (CONFIG_IS_ENABLED(DISPLAY_AER_BRIEF)) {
res = scnprintf(buf, size,
"Arbiter Event Status: AEATR=0x%08lX, 
AEADR=0x%08lX\n",
gd->arch.arbiter_event_attributes,
@@ -172,8 +172,8 @@ static int mpc83xx_sysreset_get_status(struct udevice *dev, 
char *buf, int size)
 * TODO(mario@gdsys.cc): Move this into a dedicated
 *   arbiter driver
 */
-   if (CONFIG_IS_ENABLED(CONFIG_DISPLAY_AER_FULL) ||
-   CONFIG_IS_ENABLED(CONFIG_DISPLAY_AER_BRIEF)) {
+   if (CONFIG_IS_ENABLED(DISPLAY_AER_FULL) ||
+   CONFIG_IS_ENABLED(DISPLAY_AER_BRIEF)) {
/*
 * If there was a bus monitor reset event, we force the arbiter
 * event to be printed
-- 
2.23.0



[PATCH 5/5] sysreset: move print_resetinfo() to sysreset-uclass.c

2020-05-01 Thread Rasmus Villemoes
Moving this out of board_f.c allows board-specific SPL code to call
this rather than duplicating its implementation.

Signed-off-by: Rasmus Villemoes 
---
 common/board_f.c   | 24 
 drivers/sysreset/sysreset-uclass.c | 22 ++
 include/sysreset.h |  5 +
 3 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index 82a164752a..252ad1c520 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -152,30 +152,6 @@ static int display_text_info(void)
return 0;
 }
 
-#ifdef CONFIG_SYSRESET
-static int print_resetinfo(void)
-{
-   struct udevice *dev;
-   char status[256];
-   int ret;
-
-   ret = uclass_first_device_err(UCLASS_SYSRESET, );
-   if (ret) {
-   debug("%s: No sysreset device found (error: %d)\n",
- __func__, ret);
-   /* Not all boards have sysreset drivers available during early
-* boot, so don't fail if one can't be found.
-*/
-   return 0;
-   }
-
-   if (!sysreset_get_status(dev, status, sizeof(status)))
-   printf("%s", status);
-
-   return 0;
-}
-#endif
-
 #if defined(CONFIG_DISPLAY_CPUINFO) && CONFIG_IS_ENABLED(CPU)
 static int print_cpuinfo(void)
 {
diff --git a/drivers/sysreset/sysreset-uclass.c 
b/drivers/sysreset/sysreset-uclass.c
index 51fdb1055e..739e4526ff 100644
--- a/drivers/sysreset/sysreset-uclass.c
+++ b/drivers/sysreset/sysreset-uclass.c
@@ -18,6 +18,28 @@
 #include 
 #include 
 
+int print_resetinfo(void)
+{
+   struct udevice *dev;
+   char status[256];
+   int ret;
+
+   ret = uclass_first_device_err(UCLASS_SYSRESET, );
+   if (ret) {
+   debug("%s: No sysreset device found (error: %d)\n",
+ __func__, ret);
+   /* Not all boards have sysreset drivers available during early
+* boot, so don't fail if one can't be found.
+*/
+   return 0;
+   }
+
+   if (!sysreset_get_status(dev, status, sizeof(status)))
+   printf("%s", status);
+
+   return 0;
+}
+
 int sysreset_request(struct udevice *dev, enum sysreset_t type)
 {
struct sysreset_ops *ops = sysreset_get_ops(dev);
diff --git a/include/sysreset.h b/include/sysreset.h
index 61295e3fcb..5f402b9d04 100644
--- a/include/sysreset.h
+++ b/include/sysreset.h
@@ -116,4 +116,9 @@ void sysreset_walk_halt(enum sysreset_t type);
  */
 void reset_cpu(ulong addr);
 
+/**
+ * print_resetinfo() - print reset information to console
+ */
+int print_resetinfo(void);
+
 #endif
-- 
2.23.0



[PATCH 4/5] sysreset: mpc83xx: add output in case of cold boot

2020-05-01 Thread Rasmus Villemoes
For a powercycle/cold boot, none of the RSR_* bits in the reset status
register are set, so one gets an empty

  Reset Status:

line. Print an indication that this was likely a cold boot.

Signed-off-by: Rasmus Villemoes 
---
 drivers/sysreset/sysreset_mpc83xx.c | 26 +-
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/sysreset/sysreset_mpc83xx.c 
b/drivers/sysreset/sysreset_mpc83xx.c
index 631ae6a5dc..6457d73418 100644
--- a/drivers/sysreset/sysreset_mpc83xx.c
+++ b/drivers/sysreset/sysreset_mpc83xx.c
@@ -149,20 +149,28 @@ static int mpc83xx_sysreset_get_status(struct udevice 
*dev, char *buf, int size)
ulong rsr = gd->arch.reset_status;
int i;
char *sep;
+   ulong known_bits = RSR_SWSR | RSR_SWHR | RSR_JSRS | RSR_CSHR |
+   RSR_SWRS | RSR_BMRS | RSR_SRS | RSR_HRS;
 
res = scnprintf(buf, size, "Reset Status:");
buf += res;
size -= res;
 
-   sep = " ";
-   for (i = 0; i < ARRAY_SIZE(bits); i++)
-   /* Print description of set bits */
-   if (rsr & bits[i].mask) {
-   res = scnprintf(buf, size, "%s%s", sep, bits[i].desc);
-   buf += res;
-   size -= res;
-   sep = ", ";
-   }
+   if (rsr & known_bits) {
+   sep = " ";
+   for (i = 0; i < ARRAY_SIZE(bits); i++)
+   /* Print description of set bits */
+   if (rsr & bits[i].mask) {
+   res = scnprintf(buf, size, "%s%s", sep, 
bits[i].desc);
+   buf += res;
+   size -= res;
+   sep = ", ";
+   }
+   } else {
+   res = scnprintf(buf, size, " Unknown/Cold boot");
+   buf += res;
+   size -= res;
+   }
 
res = scnprintf(buf, size, "\n");
buf += res;
-- 
2.23.0



[PATCH 1/5] sysreset: mpc83xx: use scnprintf instead of snprintf

2020-05-01 Thread Rasmus Villemoes
Neither snprintf or scnprintf ever return a negative value, so the
error checking is pointless. The correct idiom for printing piecemeal
to a buffer of a given size is to use scnprintf(), since that will
ensure buf will never point past the actual given buffer, and the
remaining size will never become negative (since scnprintf(), when
given a non-zero size, has the property that the return value is
strictly less than the given size).

Signed-off-by: Rasmus Villemoes 
---
 drivers/sysreset/sysreset_mpc83xx.c | 54 ++---
 1 file changed, 19 insertions(+), 35 deletions(-)

diff --git a/drivers/sysreset/sysreset_mpc83xx.c 
b/drivers/sysreset/sysreset_mpc83xx.c
index 9092764e0b..7148464d8b 100644
--- a/drivers/sysreset/sysreset_mpc83xx.c
+++ b/drivers/sysreset/sysreset_mpc83xx.c
@@ -104,23 +104,23 @@ static int print_83xx_arb_event(bool force, char *buf, 
int size)
return 0;
 
if (CONFIG_IS_ENABLED(CONFIG_DISPLAY_AER_FULL)) {
-   res = snprintf(buf, size,
-  "Arbiter Event Status:\n"
-  "%s: 0x%08lX\n"
-  "%s:0x%1x  = %s\n"
-  "%s: 0x%02x = %s\n"
-  "%s: 0x%1x  = %d bytes\n"
-  "%s: 0x%02x = %s\n",
-  "Event Address", gd->arch.arbiter_event_address,
-  "Event Type", etype, event[etype],
-  "Master ID", mstr_id, master[mstr_id],
-  "Transfer Size", tsize_val, tsize_bytes,
-  "Transfer Type", ttype, transfer[ttype]);
+   res = scnprintf(buf, size,
+   "Arbiter Event Status:\n"
+   "%s: 0x%08lX\n"
+   "%s:0x%1x  = %s\n"
+   "%s: 0x%02x = %s\n"
+   "%s: 0x%1x  = %d bytes\n"
+   "%s: 0x%02x = %s\n",
+   "Event Address", gd->arch.arbiter_event_address,
+   "Event Type", etype, event[etype],
+   "Master ID", mstr_id, master[mstr_id],
+   "Transfer Size", tsize_val, tsize_bytes,
+   "Transfer Type", ttype, transfer[ttype]);
} else if (CONFIG_IS_ENABLED(CONFIG_DISPLAY_AER_BRIEF)) {
-   res = snprintf(buf, size,
-  "Arbiter Event Status: AEATR=0x%08lX, 
AEADR=0x%08lX\n",
-  gd->arch.arbiter_event_attributes,
-  gd->arch.arbiter_event_address);
+   res = scnprintf(buf, size,
+   "Arbiter Event Status: AEATR=0x%08lX, 
AEADR=0x%08lX\n",
+   gd->arch.arbiter_event_attributes,
+   gd->arch.arbiter_event_address);
}
 
return res;
@@ -150,13 +150,7 @@ static int mpc83xx_sysreset_get_status(struct udevice 
*dev, char *buf, int size)
int i;
char *sep;
 
-   res = snprintf(buf, size, "Reset Status:");
-   if (res < 0) {
-   debug("%s: Could not write reset status message (err = %d)\n",
- dev->name, res);
-   return -EIO;
-   }
-
+   res = scnprintf(buf, size, "Reset Status:");
buf += res;
size -= res;
 
@@ -164,13 +158,8 @@ static int mpc83xx_sysreset_get_status(struct udevice 
*dev, char *buf, int size)
for (i = 0; i < ARRAY_SIZE(bits); i++)
/* Print description of set bits */
if (rsr & bits[i].mask) {
-   res = snprintf(buf, size, "%s%s%s", sep, bits[i].desc,
+   res = scnprintf(buf, size, "%s%s%s", sep, bits[i].desc,
   (i == ARRAY_SIZE(bits) - 1) ? "\n" : "");
-   if (res < 0) {
-   debug("%s: Could not write reset status message 
(err = %d)\n",
- dev->name, res);
-   return -EIO;
-   }
buf += res;
size -= res;
sep = ", ";
@@ -187,15 +176,10 @@ static int mpc83xx_sysreset_get_status(struct udevice 
*dev, char *buf, int size)
 * event to be printed
 */
res = print_83xx_arb_event(rsr & RSR_BMRS, buf, size);
-   if (res < 0) {
-   debug("%s: Could not write arbiter event message (err = 
%d)\n",
- dev->name, res);
-   return -EIO;
-   }
buf += res;
size -= res;
}
-   snprintf(buf, size, "\n");
+   

[PATCH 2/5] sysreset: mpc83xx: shuffle newline logic in mpc83xx_sysreset_get_status

2020-05-01 Thread Rasmus Villemoes
mpc83xx_sysreset_get_status() adds a newline to the buffer at the end
of the function. There's no point adding a newline in case the reset
status word happens to contain the RSR_HRS bit.

On the other hand, if one of the CONFIG_DISPLAY_AER_* options is
enabled, and the RSR_HSR bit wasn't set, we'd miss a newline before
the print_83xx_arb_event() output. That latter always includes a
newline in its output, so just pull up the scnprintf("\n") a bit.

Signed-off-by: Rasmus Villemoes 
---
 drivers/sysreset/sysreset_mpc83xx.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/sysreset/sysreset_mpc83xx.c 
b/drivers/sysreset/sysreset_mpc83xx.c
index 7148464d8b..3447b8e75c 100644
--- a/drivers/sysreset/sysreset_mpc83xx.c
+++ b/drivers/sysreset/sysreset_mpc83xx.c
@@ -158,13 +158,16 @@ static int mpc83xx_sysreset_get_status(struct udevice 
*dev, char *buf, int size)
for (i = 0; i < ARRAY_SIZE(bits); i++)
/* Print description of set bits */
if (rsr & bits[i].mask) {
-   res = scnprintf(buf, size, "%s%s%s", sep, bits[i].desc,
-  (i == ARRAY_SIZE(bits) - 1) ? "\n" : "");
+   res = scnprintf(buf, size, "%s%s", sep, bits[i].desc);
buf += res;
size -= res;
sep = ", ";
}
 
+   res = scnprintf(buf, size, "\n");
+   buf += res;
+   size -= res;
+
/*
 * TODO(mario@gdsys.cc): Move this into a dedicated
 *   arbiter driver
@@ -179,7 +182,6 @@ static int mpc83xx_sysreset_get_status(struct udevice *dev, 
char *buf, int size)
buf += res;
size -= res;
}
-   scnprintf(buf, size, "\n");
 
return 0;
 }
-- 
2.23.0



[PATCH 0/5] some sysreset patches (mostly for mpc83xx)

2020-05-01 Thread Rasmus Villemoes
The first four of these are some minor improvements to the
sysreset_mpc83xx driver.

Patch 5 is independent of the others, but included because I need to
print the reset info in SPL - since, on the mpc8309, the reset status
register gets cleared after reading, only SPL gets to know the actual
reset cause; in U-Boot proper, gd->arch.reset_status is always clear.

Rasmus Villemoes (5):
  sysreset: mpc83xx: use scnprintf instead of snprintf
  sysreset: mpc83xx: shuffle newline logic in
mpc83xx_sysreset_get_status
  sysreset: mpc83xx: fix CONFIG_IS_ENABLED logic
  sysreset: mpc83xx: add output in case of cold boot
  sysreset: move print_resetinfo() to sysreset-uclass.c

 common/board_f.c| 24 
 drivers/sysreset/sysreset-uclass.c  | 22 
 drivers/sysreset/sysreset_mpc83xx.c | 88 ++---
 include/sysreset.h  |  5 ++
 4 files changed, 68 insertions(+), 71 deletions(-)

-- 
2.23.0



[PATCH] actions: Fix syntax for enabling SYS_RELOC_GD_ENV_ADDR

2020-05-01 Thread Tom Rini
The correct syntax is 'select SYS_...' and not 'select CONFIG_SYS...'

Fixes: d5c819b885c2 ("actions: Move defconfig options to Kconfig")
Signed-off-by: Tom Rini 
---
 arch/arm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 8e67e1c58733..3383b05e480b 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -881,7 +881,7 @@ config ARCH_OWL
select CLK
select CLK_OWL
select OF_CONTROL
-   select CONFIG_SYS_RELOC_GD_ENV_ADDR
+   select SYS_RELOC_GD_ENV_ADDR
imply CMD_DM
 
 config ARCH_QEMU
-- 
2.17.1



Re: [PATCH v2 1/8] iopoll: Add dealy to read poll

2020-05-01 Thread Jagan Teki
On Fri, May 1, 2020 at 3:36 AM Tom Rini  wrote:
>
> On Fri, May 01, 2020 at 02:33:17AM +0530, Jagan Teki wrote:
> > On Thu, Apr 30, 2020 at 8:16 PM Tom Rini  wrote:
> > >
> > > On Thu, Apr 30, 2020 at 12:34:05PM +0530, Jagan Teki wrote:
> > >
> > > > Some drivers and other bsp code not only poll the
> > > > register with timeout but also required to delay
> > > > on each transaction.
> > > >
> > > > This patch add that requirement by adding sleep_us
> > > > variable so-that read_poll_timeout now support
> > > > delay as well.
> > > >
> > > > Cc: Tom Rini 
> > > > Signed-off-by: Jagan Teki 
> > >
> > > This (and 2/8) need to say what kernel commit you're taking this from,
> > > thanks.
> >
> > Linux supports sleep_us at the beginning where read_poll_timeout
> > supports, i.e. the reason I didn't add the sha1. If that works, I will
> > add the same sha1 and apply via my tree (since it has some SPI changes
> > dependency patch)?
>
> Yes, I think that sounds right, thanks!

Applied 1/8 and 2/8 to u-boot-spi/master


  1   2   >