[U-Boot] Need help with verified u-boot on Tegra TX2

2019-10-19 Thread Rayees Shamsuddin
Simon,

Thanks for all your great and pioneering effort on verified u-boot. I am 
benefiting a lot for your work. I am trying to implement verified u-boot on 
Tegra TX2.

Based on the wonderful documentation that you provided, I was able to 
successfully create a fit image and got the dtb and kernel to boot. But I ran 
into some issues when I incorporated ramdisk into the fit image. Initially, it 
would get stuck on "Starting kernel ...". Then I modified the environment as 
follows
setenv initrd_high 8eff
setenv fdt_high 8eff

Initially it was set to
fdt_high=
initrd_high=

I haven't quite understood why this change caused the kernel to load. Is it 
because initrd_high= overwrites the relocatable u-boot code?

Anyway after this change, I got the kernel to boot, but with one caveat - the 
RAMDISK couldn't be loaded.

   Booting using the fdt blob at 0x920989cc
   Loading Kernel Image ... OK
   reserving fdt memory region: addr=8000 size=1
   Loading Ramdisk to 8eab1000, end 8efffaa2 ... OK
   Loading Device Tree to 8ea5a000, end 8eab0fd2 ... OK

Starting kernel ...

[0.00] Booting Linux on physical CPU 0x100

However, I saw the message
[5.403174] RAMDISK: Couldn't find valid RAM disk image starting at 0.

I would be grateful if you could provide me some guidance on what might be 
causing this issue or how to go about resolving this.

Thanks and Regards
Rayees Shamsuddin
Product Security Engineer
Intuitive Surgical

Tegra.its

/dts-v1/;
/ {
description = "fitImage for Tegra TX2";
#address-cells = <1>;
images {
kernel@1 {
description = "Linux kernel";
data = /incbin/("Image");
arch = "arm64";
os = "linux";
type = "kernel";
compression = "none";
load = <0x8028>;
entry = <0x8028>;
hash@1 {
algo = "sha256";
};
};
fdt@1 {
description = "DTB for Tegra TX2";
data = /incbin/("tegra186-quill-p3310-1000-c03-00-base.dtb");
type = "flat_dt";
arch = "arm64";
compression = "none";
hash@1 {
algo = "sha256";
};
};
ramdisk@1 {
description = "Ramdisk Image for Tegra TX2";
data = /incbin/("initrd");
type = "ramdisk";
arch = "arm64";
os = "linux";
compression = "gzip";
load = <0x82a0>;
entry = <0x82a0>;
hash@1 {
 algo = "sha256";
};
};
};
configurations {
default = "conf@1";
conf@1 {
description = "Boot Linux kernel, FDT blob and ramdisk";
kernel = "kernel@1";
fdt = "fdt@1";
ramdisk = "ramdisk@1";
signature@1 {
algo = "sha256,rsa4096";
key-name-hint = "tx2_key";
sign-images = "fdt", "kernel", "ramdisk";
};
};
};
};


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


Re: [U-Boot] [PATCH] dm: pinctrl: fix for introduce PINCONF_RECURSIVE option

2019-10-19 Thread Anatolij Gustschin
Hi Tom,

On Fri, 18 Oct 2019 20:29:22 +0200
Patrick Delaunay patrick.delau...@st.com wrote:
...
> This correct a regression introduced by
> commit c20851b3d850 ("dm: pinctrl: introduce PINCONF_RECURSIVE
> option")

Could you please apply this patch ASAP? It fixes broken eMMC, Ethernet,
I2C, GPIO, etc. on i.MX8QXP MEK board.

Many other boards are affected, too.

Thanks!

--
Anatolij

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


Re: [U-Boot] [PATCH] dm: pinctrl: fix for introduce PINCONF_RECURSIVE option

2019-10-19 Thread Anatolij Gustschin
On Fri, 18 Oct 2019 20:29:22 +0200
Patrick Delaunay patrick.delau...@st.com wrote:

> Correct the name of the define used in CONFIG_IS_ENABLED():
> it is not align with Kconfig name= CONFIG_$(SPL_)PINCONF_RECURSIVE.
> 
> This correct a regression introduced by
> commit c20851b3d850 ("dm: pinctrl: introduce PINCONF_RECURSIVE
> option")
> 
> Signed-off-by: Patrick Delaunay 

Reviewed-by: Anatolij Gustschin 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] pinctrl: remove duplicated (SPL_)PINCONF_RECURSIVE entries

2019-10-19 Thread Anatolij Gustschin
PINCONF_RECURSIVE and SPL_PINCONF_RECURSIVE are duplicated,
remove them.

Signed-off-by: Anatolij Gustschin 
---
 drivers/pinctrl/Kconfig | 25 -
 1 file changed, 25 deletions(-)

diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index 6b41f66a86..deee92411c 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -75,22 +75,6 @@ config PINCONF_RECURSIVE
  configuration; you can save memory footprint when this feature is
  no needed.
 
-config PINCONF_RECURSIVE
-   bool "Support recursive binding for pin configuration nodes"
-   depends on PINCTRL_FULL
-   default n if ARCH_STM32MP
-   default y
-   help
- In the Linux pinctrl binding, the pin configuration nodes need not be
- direct children of the pin controller device (may be grandchildren for
- example). It is define is each individual pin controller device.
- Say Y here if you want to keep this behavior with the pinconfig
- u-class: all sub are recursivelly bounded.
- If the option is disabled, this behavior is deactivated and only
- the direct children of pin controller will be assumed as pin
- configuration; you can save memory footprint when this feature is
- no needed.
-
 config SPL_PINCTRL
bool "Support pin controllers in SPL"
depends on SPL && SPL_DM
@@ -145,15 +129,6 @@ config SPL_PINCONF_RECURSIVE
  This option is an SPL-variant of the PINCONF_RECURSIVE option.
  See the help of PINCONF_RECURSIVE for details.
 
-config SPL_PINCONF_RECURSIVE
-   bool "Support recursive binding for pin configuration nodes in SPL"
-   depends on SPL_PINCTRL_FULL
-   default n if ARCH_STM32MP
-   default y
-   help
- This option is an SPL-variant of the PINCONF_RECURSIVE option.
- See the help of PINCONF_RECURSIVE for details.
-
 if PINCTRL || SPL_PINCTRL
 
 config PINCTRL_AR933X
-- 
2.17.1

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


Re: [U-Boot] Pull request for UEFI sub-system for efi-2020-01-rc1 (2)

2019-10-19 Thread Tom Rini
On Fri, Oct 18, 2019 at 07:29:23PM +0200, Heinrich Schuchardt wrote:

> The following changes since commit c83b1bb923421e95e499b22b010d2f9f463c1226:
> 
>   Merge tag 'dm-pull-15oct19' of
> https://gitlab.denx.de/u-boot/custodians/u-boot-dm (2019-10-16 18:10:31
> -0400)
> 
> are available in the Git repository at:
> 
>   https://gitlab.denx.de/u-boot/custodians/u-boot-efi.git
> tags/efi-2020-01-rc1-2
> 
> for you to fetch changes up to 5cc349bb09eefaf43e250b2c7a8fc5a61c595715:
> 
>   efi_loader: enable CONFIG_CMD_NVEDIT_EFI on QEMU (2019-10-17 19:19:56
> +0200)
> 
> Gitlab CI shows no problems:
> https://gitlab.denx.de/u-boot/custodians/u-boot-efi/pipelines/1002
> 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] spl: mmc: make eMMC HW boot partition configuration optional

2019-10-19 Thread Tom Rini
On Fri, Oct 18, 2019 at 09:38:33PM +0200, Anatolij Gustschin wrote:

> Loading U-Boot on i.MX8QXP MEK board is broken since recent changes
> in spl_mmc:
> 
>   U-Boot SPL 2019.10-00162-gff5bd397e4 (Oct 18 2019 - 15:50:45 +0200)
>   Normal Boot
>   WDT:   Not found!
>   Trying to boot from MMC2_2
>   Load image from MMC/SD 0x46400
>   spl: mmc partition switch failed
>   SPL: failed to boot from all boot devices
>   ### ERROR ### Please RESET the board ###
> 
> The newly added CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION option
> is selected automatically and overrides the EXT_CSC_PART_CONFIG
> configurations with default value, always selecting the eMMC boot
> partition 1. Boards which place U-Boot image in other partitions
> became not bootable.
> 
> Fix this by making the eMMC HW boot partition selection optional.
> 
> Fixes: 17241ea0543a (spl: mmc: Add option to set eMMC HW boot partition)
> Reviewed-by: Lukasz Majewski 
> Signed-off-by: Anatolij Gustschin 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PULL u-boot] Please pull u-boot-amlogic-20191018

2019-10-19 Thread Tom Rini
On Fri, Oct 18, 2019 at 04:58:06PM +0200, Neil Armstrong wrote:

> Hi Tom,
> 
> This PR adds more support for Amlogic G12A and derivatives SoCs based boards, 
> by enabling
> HDMI/CVBS display support and 2 new boards, Khadas VIM3, and the SEI610 
> little brother of
> the already supported SEI510.
> Daniel also pushed a documentation update to explicit the available 
> alternatives to the currently
> used blobs and tools to created a bootable binary.
> 
> The CI job is at 
> https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic/pipelines/1012
> 
> Thanks,
> Neil
> 
> The following changes since commit a2fce50455c9831f36765e5813b0b5e98f55d70b:
> 
>   Merge tag 'for-v2020.01' of 
> https://gitlab.denx.de/u-boot/custodians/u-boot-ubi (2019-10-17 07:26:16 
> -0400)
> 
> are available in the Git repository at:
> 
>   https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic.git 
> tags/u-boot-amlogic-20191018
> 
> for you to fetch changes up to be2ffa1656509cc974910224a87443868d7037d9:
> 
>   configs: sei610: Add config file to fix userdata size (2019-10-18 14:54:37 
> +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2019-10-19 Thread Tom Rini
On Fri, Oct 18, 2019 at 03:00:07PM +0800, ub...@andestech.com wrote:

> Hi Tom,
> 
> Please pull some riscv updates:
> 
> - Support sifive DM based gpio driver for FU540-SoC.
> - Align boot image header with Linux v5.3
> 
> https://travis-ci.org/rickchen36/u-boot-riscv/builds/599424917
> 
> Thanks
> Rick
> 
> 
> The following changes since commit a2fce50455c9831f36765e5813b0b5e98f55d70b:
> 
>   Merge tag 'for-v2020.01' of 
> https://gitlab.denx.de/u-boot/custodians/u-boot-ubi (2019-10-17 07:26:16 
> -0400)
> 
> are available in the Git repository at:
> 
>   g...@gitlab.denx.de:u-boot/custodians/u-boot-riscv.git
> 
> for you to fetch changes up to 70d64a4c7646aa51c0334618ccb9af0132d9d834:
> 
>   RISC-V: Align boot image header with Linux (2019-10-18 09:04:19 +0800)
> 

Applied to u-boot/master, thanks!


-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] problems with building u-boot-fit-dtb.bin

2019-10-19 Thread Tom Rini
On Sat, Oct 19, 2019 at 10:21:14AM +0200, Heiko Schocher wrote:
> Hello Tom,
> 
> Am 18.10.2019 um 13:29 schrieb Tom Rini:
> > On Fri, Oct 18, 2019 at 07:40:13AM +0200, Heiko Schocher wrote:
> > > Hello Tom,
> > > 
> > > Am 16.10.2019 um 10:45 schrieb Heiko Schocher:
> > > > Hello Tom,
> > > > 
> > > > Am 16.10.2019 um 06:56 schrieb Heiko Schocher:
> > > > > Hello Tom,
> > > > > 
> > > > > I planned to send my patches which convert the imx6 based aristainetos
> > > > > boards to support DM ... building U-Boot works fine on 2 different 
> > > > > build
> > > > > machines at home, also on 2 build machines in munich @ denx ...
> > > > > 
> > > > > So I startet as usual a travi build and I get:
> > > > > 
> > > > > https://travis-ci.org/hsdenx/u-boot-test/jobs/596917922
> > > > > 
> > > > > 
> > > > > arm:  +   aristainetos2b
> > > > > +make[2]: *** No rule to make target 'u-boot-fit-dtb.bin', needed by 
> > > > > 'u-boot-dtb.imx'.  Stop.
> > > > > +make[1]: *** [u-boot-dtb.imx] Error 2
> > > > > +make: *** [sub-make] Error 2
> > > > > 
> > > > > (for all aristainetos boards)
> > > > > 
> > > > > :-(
> > > > > 
> > > > > Unfortunately I cannot reproduce this on my machines...
> > > > > (builds with "-j 64" or "-j 1" working fine)
> > > > > 
> > > > > I think it is a timing/sync issue, but how to debug ?
> > > > > 
> > > > > Checked make versions:
> > > > > 
> > > > > make on one of my build machines:
> > > > > 
> > > > > pollux:~ hs $ make --version
> > > > > GNU Make 4.2.1
> > > > > Gebaut für x86_64-redhat-linux-gnu
> > > > > Copyright (C) 1988-2016 Free Software Foundation, Inc.
> > > > > Lizenz GPLv3+: GNU GPL Version 3 oder später 
> > > > > 
> > > > > Dies ist freie Software: Sie können sie nach Belieben ändern und 
> > > > > weiter verteilen.
> > > > > Soweit es die Gesetze erlauben gibt es KEINE GARANTIE.
> > > > > pollux:~ hs $ cd abb/mainlining/u-boot
> > > > > pollux:u-boot
> > > > > 
> > > > > make on travis:
> > > > > 
> > > > > Tool chain test:  OK, arch='aarch64', priority 5
> > > > > GNU Make 4.1
> > > > > Built for x86_64-pc-linux-gnu
> > > > > Copyright (C) 1988-2014 Free Software Foundation, Inc.
> > > > > License GPLv3+: GNU GPL version 3 or later 
> > > > > 
> > > > > This is free software: you are free to change and redistribute it.
> > > > > There is NO WARRANTY, to the extent permitted by law.
> > > > > 
> > > > > Ok, for faster "debugging travis" I removed all other jobs from the
> > > > > travis file and started build again:
> > > > > 
> > > > > https://travis-ci.org/hsdenx/u-boot-test/builds/597504777
> > > > > 
> > > > > The error for the aristainetos boards are gone  ?!?!?
> > > > > (Ok, there are others, but not related to my changes)
> > > > > 
> > > > > I think it has to do with the config options:
> > > > > 
> > > > > CONFIG_OF_CONTROL=y
> > > > > CONFIG_DEFAULT_DEVICE_TREE="imx6dl-aristainetos2_4"
> > > > > CONFIG_OF_LIST="imx6dl-aristainetos2_4 imx6dl-aristainetos2_7"
> > > > > CONFIG_DTB_RESELECT=y
> > > > > CONFIG_MULTI_DTB_FIT=y
> > > > > 
> > > > > and I can only find mips boards, which has this settings. Difference
> > > > > for imx boards to mips Makefile is, imx has make target in 2 
> > > > > Makefiles:
> > > > > 
> > > > > Makefile
> > > > > arch/arm/mach-imx/Makefile
> > > > > 
> > > > > So the "u-boot-fit-dtb.bin" target is definitely there ...
> > > > 
> > > > Ok, I made a mistake in the travis.yml file, corrected it, and
> > > > started a new travis build now:
> > > > 
> > > > https://travis-ci.org/hsdenx/u-boot-test/builds/598489923
> > > > 
> > > > This job worked ...
> > > 
> > > build with all travis jobs fails:
> > > 
> > > https://travis-ci.org/hsdenx/u-boot-test/jobs/599459825
> > > 
> > > Any ideas?
> > 
> > Does it happen in the travis docker container?  I posted how to do that
> > the other day.
> 
> Hmm... you mean:
> 
> https://lists.denx.de/pipermail/u-boot/2019-October/386483.html
> 
> ?

Yes.

> I try to find time to try this out, but I fear, this is dependent
> on the machine it runs, because it builds fine on 4 different
> build machines, also if I only build the aristainetos boards
> on travis, it builds fine ... so some timing / sync problem?

Well, this is how to rule out environment issues.

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 04/10] test/py: Automated conversion to Python 3

2019-10-19 Thread Tom Rini
On Sat, Oct 19, 2019 at 07:25:37AM +0200, Heinrich Schuchardt wrote:
> On 10/18/19 10:53 PM, Tom Rini wrote:
> > Use the 2to3 tool to perform numerous automatic conversions from Python
> > 2 syntax to Python 3.  Also fix whitespace problems that Python 3
> > catches that Python 2 did not.
> > 
> > Signed-off-by: Tom Rini 
> 
> This patch breaks
> 
> ./test/py/test.py --bd=qemu-arm64 --build-dir=. -k=test_efi_
> 
> For remediation see below.
> 
> > ---
> >   test/py/conftest.py   |  9 ++--
> >   test/py/multiplexed_log.py|  4 +-
> >   test/py/test.py   |  4 +-
> >   test/py/tests/test_fit.py |  2 -
> >   test/py/tests/test_fpga.py| 46 +--
> >   test/py/tests/test_fs/conftest.py |  4 +-
> >   test/py/tests/test_log.py |  8 ++--
> >   test/py/tests/test_mmc_wr.py  | 74 +++
> >   8 files changed, 71 insertions(+), 80 deletions(-)
> > 
> > diff --git a/test/py/conftest.py b/test/py/conftest.py
> > index 30c898b40a0d..5c19af1d5034 100644
> > --- a/test/py/conftest.py
> > +++ b/test/py/conftest.py
> > @@ -19,13 +19,10 @@ import os.path
> >   import pytest
> >   from _pytest.runner import runtestprotocol
> >   import re
> > -import StringIO
> > +import io
> >   import sys
> > 
> > -try:
> > -import configparser
> > -except:
> > -import ConfigParser as configparser
> > +import configparser
> > 
> >   # Globals: The HTML log file, and the connection to the U-Boot console.
> >   log = None
> > @@ -169,7 +166,7 @@ def pytest_configure(config):
> > 
> >   with open(dot_config, 'rt') as f:
> >   ini_str = '[root]\n' + f.read()
> > -ini_sio = StringIO.StringIO(ini_str)
> > +ini_sio = io.StringIO(ini_str)
> 
> This results in an error
> 
> INTERNALERROR>   File "/home/user/u-boot/test/py/conftest.py", line 169,
> in pytest_configure
> INTERNALERROR> ini_sio = io.StringIO(ini_str)
> INTERNALERROR> TypeError: initial_value must be unicode or None, not str
> 
> -ini_sio = io.StringIO(ini_str)
> +ini_sio = io.StringIO(ini_str.decode())

With the whole series applied:
INTERNALERROR> AttributeError: 'str' object has no attribute 'decode'

> >   parser = configparser.RawConfigParser()
> >   parser.readfp(ini_sio)
> >   ubconfig.buildconfig.update(parser.items('root'))
> > diff --git a/test/py/multiplexed_log.py b/test/py/multiplexed_log.py
> > index 637a3bd257ba..de0aacc659b8 100644
> > --- a/test/py/multiplexed_log.py
> > +++ b/test/py/multiplexed_log.py
> > @@ -5,8 +5,8 @@
> >   # Generate an HTML-formatted log file containing multiple streams of data,
> >   # each represented in a well-delineated/-structured fashion.
> > 
> > -import cgi
> >   import datetime
> > +import html
> >   import os.path
> >   import shutil
> >   import subprocess
> > @@ -334,7 +334,7 @@ $(document).ready(function () {
> >   data = data.replace(chr(13), '')
> >   data = ''.join((ord(c) in self._nonprint) and ('%%%02x' % ord(c)) 
> > or
> >  c for c in data)
> > -data = cgi.escape(data)
> > +data = html.escape(data)
> >   return data
> > 
> >   def _terminate_stream(self):
> > diff --git a/test/py/test.py b/test/py/test.py
> > index a5140945d4b9..0ce1838833f6 100755
> > --- a/test/py/test.py
> > +++ b/test/py/test.py
> > @@ -1,4 +1,4 @@
> > -#!/usr/bin/env python2
> > +#!/usr/bin/env python3
> >   # SPDX-License-Identifier: GPL-2.0
> > 
> >   # Copyright (c) 2015 Stephen Warren
> > @@ -7,8 +7,6 @@
> >   # Wrapper script to invoke pytest with the directory name that contains 
> > the
> >   # U-Boot tests.
> > 
> > -from __future__ import print_function
> > -
> >   import os
> >   import os.path
> >   import sys
> > diff --git a/test/py/tests/test_fit.py b/test/py/tests/test_fit.py
> > index e3210ed43fa4..4922b9dcc664 100755
> > --- a/test/py/tests/test_fit.py
> > +++ b/test/py/tests/test_fit.py
> 
> Please, replace all occurrences of
> 
> -print(base_fdt, file=fd)
> +fd.write(base_fdt)
> 
> in this file.
> 
> Together with the correction in test/py/conftest.py I now can run
> 
> ./test/py/test.py --bd=qemu-arm64 --build-dir=. -k=test_efi_
> 
> using origin/master + patches 1-4.

Wait, sorry.  You need to have everything applied.  A partial conversion
to python3 doesn't work, there's other changes needed and then show the
EFI problem I hit.

That said, if you re-work what I do in my patch #7 to get our input
generally encoded to fix the "doing str stuff on byte object" problems
and EFI is still happy in the end and we only have the pytest warnings
to fix, I'm fine with that.  I'm not a python expert and am happy to
take the fixes in another direction.  Thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RFC v2 4/10] test/py: Automated conversion to Python 3

2019-10-19 Thread Tom Rini
On Sat, Oct 19, 2019 at 08:13:18AM +0200, Heinrich Schuchardt wrote:
> From: Tom Rini 
> 
> Use the 2to3 tool to perform numerous automatic conversions from Python
> 2 syntax to Python 3.  Also fix whitespace problems that Python 3
> catches that Python 2 did not.
> 
> Signed-off-by: Tom Rini 
> 
> Add missing Python 3 conversion.
> 
> Signed-off-by: Heinrich Schuchardt 

Thanks!  I'll slightly reword the commit message and pick this part up.

> ---
>  test/py/conftest.py   |  9 ++--
>  test/py/multiplexed_log.py|  4 +-
>  test/py/test.py   |  4 +-
>  test/py/tests/test_fit.py | 12 +++--
>  test/py/tests/test_fpga.py| 46 +--
>  test/py/tests/test_fs/conftest.py |  4 +-
>  test/py/tests/test_log.py |  8 ++--
>  test/py/tests/test_mmc_wr.py  | 74 +++
>  8 files changed, 76 insertions(+), 85 deletions(-)
> 
> diff --git a/test/py/conftest.py b/test/py/conftest.py
> index 30c898b40a..7da4b77bce 100644
> --- a/test/py/conftest.py
> +++ b/test/py/conftest.py
> @@ -19,13 +19,10 @@ import os.path
>  import pytest
>  from _pytest.runner import runtestprotocol
>  import re
> -import StringIO
> +import io
>  import sys
> 
> -try:
> -import configparser
> -except:
> -import ConfigParser as configparser
> +import configparser
> 
>  # Globals: The HTML log file, and the connection to the U-Boot console.
>  log = None
> @@ -169,7 +166,7 @@ def pytest_configure(config):
> 
>  with open(dot_config, 'rt') as f:
>  ini_str = '[root]\n' + f.read()
> -ini_sio = StringIO.StringIO(ini_str)
> +ini_sio = io.StringIO(ini_str.decode())
>  parser = configparser.RawConfigParser()
>  parser.readfp(ini_sio)
>  ubconfig.buildconfig.update(parser.items('root'))
> diff --git a/test/py/multiplexed_log.py b/test/py/multiplexed_log.py
> index 637a3bd257..de0aacc659 100644
> --- a/test/py/multiplexed_log.py
> +++ b/test/py/multiplexed_log.py
> @@ -5,8 +5,8 @@
>  # Generate an HTML-formatted log file containing multiple streams of data,
>  # each represented in a well-delineated/-structured fashion.
> 
> -import cgi
>  import datetime
> +import html
>  import os.path
>  import shutil
>  import subprocess
> @@ -334,7 +334,7 @@ $(document).ready(function () {
>  data = data.replace(chr(13), '')
>  data = ''.join((ord(c) in self._nonprint) and ('%%%02x' % ord(c)) or
> c for c in data)
> -data = cgi.escape(data)
> +data = html.escape(data)
>  return data
> 
>  def _terminate_stream(self):
> diff --git a/test/py/test.py b/test/py/test.py
> index a5140945d4..0ce1838833 100755
> --- a/test/py/test.py
> +++ b/test/py/test.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python2
> +#!/usr/bin/env python3
>  # SPDX-License-Identifier: GPL-2.0
> 
>  # Copyright (c) 2015 Stephen Warren
> @@ -7,8 +7,6 @@
>  # Wrapper script to invoke pytest with the directory name that contains the
>  # U-Boot tests.
> 
> -from __future__ import print_function
> -
>  import os
>  import os.path
>  import sys
> diff --git a/test/py/tests/test_fit.py b/test/py/tests/test_fit.py
> index e3210ed43f..ea9286a553 100755
> --- a/test/py/tests/test_fit.py
> +++ b/test/py/tests/test_fit.py
> @@ -3,8 +3,6 @@
>  #
>  # Sanity check of the FIT handling in U-Boot
> 
> -from __future__ import print_function
> -
>  import os
>  import pytest
>  import struct
> @@ -155,7 +153,7 @@ def test_fit(u_boot_console):
>  src = make_fname('u-boot.dts')
>  dtb = make_fname('u-boot.dtb')
>  with open(src, 'w') as fd:
> -print(base_fdt, file=fd)
> +fd.write(base_fdt)
>  util.run_and_log(cons, ['dtc', src, '-O', 'dtb', '-o', dtb])
>  return dtb
> 
> @@ -169,7 +167,7 @@ def test_fit(u_boot_console):
>  """
>  its = make_fname('test.its')
>  with open(its, 'w') as fd:
> -print(base_its % params, file=fd)
> +fd.write(base_its % params)
>  return its
> 
>  def make_fit(mkimage, params):
> @@ -188,7 +186,7 @@ def test_fit(u_boot_console):
>  its = make_its(params)
>  util.run_and_log(cons, [mkimage, '-f', its, fit])
>  with open(make_fname('u-boot.dts'), 'w') as fd:
> -print(base_fdt, file=fd)
> +fd.write(base_fdt)
>  return fit
> 
>  def make_kernel(filename, text):
> @@ -204,7 +202,7 @@ def test_fit(u_boot_console):
>  for i in range(100):
>  data += 'this %s %d is unlikely to boot\n' % (text, i)
>  with open(fname, 'w') as fd:
> -print(data, file=fd)
> +fd.write(data)
>  return fname
> 
>  def make_ramdisk(filename, text):
> @@ -218,7 +216,7 @@ def test_fit(u_boot_console):
>  for i in range(100):
>  data += '%s %d was seldom used in the middle ages\n' % (text, i)
>  with open(fname, 

Re: [U-Boot] [PATCH v2] arm: dts: sync dts for Allwinner H6

2019-10-19 Thread Clément Péron
Hi Jagan

On Mon, 30 Sep 2019 at 17:48, Jagan Teki  wrote:
>
> On Sat, Sep 28, 2019 at 2:54 AM Maxime Ripard  
> wrote:
> >
> > Hi,
> >
> > On Fri, Sep 06, 2019 at 09:53:33AM +0200, Clément Péron wrote:
> > > Hi,
> > >
> > > On Sun, 25 Aug 2019 at 18:04, Clément Péron  wrote:
> > > >
> > > > Sync Kernel DTS for Allwinner H6 boards.
> > >
> > > This sync avoid the random mac on the beelink GS1.
> > >
> > > Could you check if it's ok for you ?
> >
> > Acked-by: Maxime Ripard 
> >
> > Jagan, could we merge this?
>
> Since it is sync change, I would like to merge in coming MW. let me
> know if it urgent or required for the release?

No change in Allwinner H6 device-tree since stable 5.3.

Regards,
Clement

>
> Jagan.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] problems with building u-boot-fit-dtb.bin

2019-10-19 Thread Heiko Schocher

Hello Tom,

Am 18.10.2019 um 13:29 schrieb Tom Rini:

On Fri, Oct 18, 2019 at 07:40:13AM +0200, Heiko Schocher wrote:

Hello Tom,

Am 16.10.2019 um 10:45 schrieb Heiko Schocher:

Hello Tom,

Am 16.10.2019 um 06:56 schrieb Heiko Schocher:

Hello Tom,

I planned to send my patches which convert the imx6 based aristainetos
boards to support DM ... building U-Boot works fine on 2 different build
machines at home, also on 2 build machines in munich @ denx ...

So I startet as usual a travi build and I get:

https://travis-ci.org/hsdenx/u-boot-test/jobs/596917922


arm:  +   aristainetos2b
+make[2]: *** No rule to make target 'u-boot-fit-dtb.bin', needed by 
'u-boot-dtb.imx'.  Stop.
+make[1]: *** [u-boot-dtb.imx] Error 2
+make: *** [sub-make] Error 2

(for all aristainetos boards)

:-(

Unfortunately I cannot reproduce this on my machines...
(builds with "-j 64" or "-j 1" working fine)

I think it is a timing/sync issue, but how to debug ?

Checked make versions:

make on one of my build machines:

pollux:~ hs $ make --version
GNU Make 4.2.1
Gebaut für x86_64-redhat-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
Lizenz GPLv3+: GNU GPL Version 3 oder später 
Dies ist freie Software: Sie können sie nach Belieben ändern und weiter 
verteilen.
Soweit es die Gesetze erlauben gibt es KEINE GARANTIE.
pollux:~ hs $ cd abb/mainlining/u-boot
pollux:u-boot

make on travis:

Tool chain test:  OK, arch='aarch64', priority 5
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Ok, for faster "debugging travis" I removed all other jobs from the
travis file and started build again:

https://travis-ci.org/hsdenx/u-boot-test/builds/597504777

The error for the aristainetos boards are gone  ?!?!?
(Ok, there are others, but not related to my changes)

I think it has to do with the config options:

CONFIG_OF_CONTROL=y
CONFIG_DEFAULT_DEVICE_TREE="imx6dl-aristainetos2_4"
CONFIG_OF_LIST="imx6dl-aristainetos2_4 imx6dl-aristainetos2_7"
CONFIG_DTB_RESELECT=y
CONFIG_MULTI_DTB_FIT=y

and I can only find mips boards, which has this settings. Difference
for imx boards to mips Makefile is, imx has make target in 2 Makefiles:

Makefile
arch/arm/mach-imx/Makefile

So the "u-boot-fit-dtb.bin" target is definitely there ...


Ok, I made a mistake in the travis.yml file, corrected it, and
started a new travis build now:

https://travis-ci.org/hsdenx/u-boot-test/builds/598489923

This job worked ...


build with all travis jobs fails:

https://travis-ci.org/hsdenx/u-boot-test/jobs/599459825

Any ideas?


Does it happen in the travis docker container?  I posted how to do that
the other day.


Hmm... you mean:

https://lists.denx.de/pipermail/u-boot/2019-October/386483.html

?

I try to find time to try this out, but I fear, this is dependent
on the machine it runs, because it builds fine on 4 different
build machines, also if I only build the aristainetos boards
on travis, it builds fine ... so some timing / sync problem?

bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: h...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/1] imx: include files should be chmod 644

2019-10-19 Thread Heinrich Schuchardt
Correct include files which are chmod 755.

Fixes: d08a194871fd ("imx: add support for i.MX8MQ power domain controller")
Signed-off-by: Heinrich Schuchardt 
---
 include/dt-bindings/power/imx8mq-power.h | 0
 include/dt-bindings/reset/imx8mq-reset.h | 0
 2 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100755 => 100644 include/dt-bindings/power/imx8mq-power.h
 mode change 100755 => 100644 include/dt-bindings/reset/imx8mq-reset.h

diff --git a/include/dt-bindings/power/imx8mq-power.h 
b/include/dt-bindings/power/imx8mq-power.h
old mode 100755
new mode 100644
diff --git a/include/dt-bindings/reset/imx8mq-reset.h 
b/include/dt-bindings/reset/imx8mq-reset.h
old mode 100755
new mode 100644
--
2.23.0

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


[U-Boot] [PATCH 1/1] checkpatch.pl: update from Linux kernel v5.4-rc3

2019-10-19 Thread Heinrich Schuchardt
Update from upstream.

Just minor changes like checking that the author has also done a sign-off.

Signed-off-by: Heinrich Schuchardt 
---
 scripts/checkpatch.pl | 446 +++---
 1 file changed, 333 insertions(+), 113 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 373094e59e..6fcc66afb0 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1,9 +1,11 @@
 #!/usr/bin/env perl
+# SPDX-License-Identifier: GPL-2.0
+#
 # (c) 2001, Dave Jones. (the file handling bit)
 # (c) 2005, Joel Schopp  (the ugly bit)
 # (c) 2007,2008, Andy Whitcroft  (new conditions, test suite)
 # (c) 2008-2010 Andy Whitcroft 
-# Licensed under the terms of the GNU GPL License version 2
+# (c) 2010-2018 Joe Perches 

 use strict;
 use warnings;
@@ -11,6 +13,7 @@ use POSIX;
 use File::Basename;
 use Cwd 'abs_path';
 use Term::ANSIColor qw(:constants);
+use Encode qw(decode encode);

 my $P = $0;
 my $D = dirname(abs_path($P));
@@ -58,7 +61,9 @@ my $codespellfile = "/usr/share/codespell/dictionary.txt";
 my $conststructsfile = "$D/const_structs.checkpatch";
 my $typedefsfile = "";
 my $color = "auto";
-my $allow_c99_comments = 1;
+my $allow_c99_comments = 1; # Can be overridden by --ignore 
C99_COMMENT_TOLERANCE
+# git output parsing needs US English output, so first set backtick child 
process LANGUAGE
+my $git_command ='export LANGUAGE=en_US.UTF-8; git';

 sub help {
my ($exitcode) = @_;
@@ -238,11 +243,11 @@ $check_orig = $check;

 my $exit = 0;

+my $perl_version_ok = 1;
 if ($^V && $^V lt $minimum_perl_version) {
+   $perl_version_ok = 0;
printf "$P: requires at least perl version %vd\n", 
$minimum_perl_version;
-   if (!$ignore_perl_version) {
-   exit(1);
-   }
+   exit(1) if (!$ignore_perl_version);
 }

 #if no filenames are given, push '-' to read patch from stdin
@@ -344,9 +349,10 @@ our $Sparse= qr{
__force|
__iomem|
__must_check|
-   __init_refok|
__kprobes|
__ref|
+   __refconst|
+   __refdata|
__rcu|
__private
}x;
@@ -376,6 +382,7 @@ our $Attribute  = qr{
__noclone|
__deprecated|
__read_mostly|
+   __ro_after_init|
__kprobes|
$InitAttribute|
cacheline_aligned|
@@ -461,8 +468,19 @@ our $logFunctions = qr{(?x:
seq_vprintf|seq_printf|seq_puts
 )};

+our $allocFunctions = qr{(?x:
+   (?:(?:devm_)?
+   (?:kv|k|v)[czm]alloc(?:_node|_array)? |
+   kstrdup(?:_const)? |
+   kmemdup(?:_nul)?) |
+   (?:\w+)?alloc_skb(?:ip_align)? |
+   # dev_alloc_skb/netdev_alloc_skb, et al
+   dma_alloc_coherent
+)};
+
 our $signature_tags = qr{(?xi:
Signed-off-by:|
+   Co-developed-by:|
Acked-by:|
Tested-by:|
Reviewed-by:|
@@ -568,6 +586,27 @@ foreach my $entry (@mode_permission_funcs) {
 }
 $mode_perms_search = "(?:${mode_perms_search})";

+our %deprecated_apis = (
+   "synchronize_rcu_bh"=> "synchronize_rcu",
+   "synchronize_rcu_bh_expedited"  => "synchronize_rcu_expedited",
+   "call_rcu_bh"   => "call_rcu",
+   "rcu_barrier_bh"=> "rcu_barrier",
+   "synchronize_sched" => "synchronize_rcu",
+   "synchronize_sched_expedited"   => "synchronize_rcu_expedited",
+   "call_rcu_sched"=> "call_rcu",
+   "rcu_barrier_sched" => "rcu_barrier",
+   "get_state_synchronize_sched"   => "get_state_synchronize_rcu",
+   "cond_synchronize_sched"=> "cond_synchronize_rcu",
+);
+
+#Create a search pattern for all these strings to speed up a loop below
+our $deprecated_apis_search = "";
+foreach my $entry (keys %deprecated_apis) {
+   $deprecated_apis_search .= '|' if ($deprecated_apis_search ne "");
+   $deprecated_apis_search .= $entry;
+}
+$deprecated_apis_search = "(?:${deprecated_apis_search})";
+
 our $mode_perms_world_writable = qr{
S_IWUGO |
S_IWOTH |
@@ -845,6 +884,17 @@ sub is_maintained_obsolete {
return $status =~ /obsolete/i;
 }

+sub is_SPDX_License_valid {
+   my ($license) = @_;
+
+   return 1 if (!$tree || which("python") eq "" || !(-e 
"$root/scripts/spdxcheck.py") || !(-e "$root/.git"));
+
+   my $root_path = abs_path($root);
+   my $status = `cd "$root_path"; echo "$license" | python 
scripts/spdxcheck.py -`;
+   return 0 if ($status ne "");
+   return 1;
+}
+
 my $camelcase_seeded = 0;
 sub seed_camelcase_includes {
 

Re: [U-Boot] [PATCH 07/10] test/py: Manual python3 fixes

2019-10-19 Thread Heinrich Schuchardt

On 10/18/19 10:53 PM, Tom Rini wrote:

- Modern pytest is more visible in telling us about parameters that we
   had not described, so describe a few more.
- ConfigParser.readfp(...) is now configparser.read_file(...)
- As part of the "strings vs bytes" conversions in Python 3, we need to
   encode / decode our pipes in a few areas, use utf-8 for this.
- Fix a typo noticed while doing the above ("tot he" -> "to the").

Signed-off-by: Tom Rini 


This patch breaks

./test/py/test.py --bd=qemu-arm64 --build-dir=.

INTERNALERROR>   File "test/py/conftest.py", line 201, in pytest_configure
INTERNALERROR> console =
u_boot_console_exec_attach.ConsoleExecAttach(log, ubconfig)
INTERNALERROR>   File "test/py/u_boot_console_exec_attach.py", line 41,
in __init__
INTERNALERROR> runner.run(cmd)
INTERNALERROR>   File "test/py/multiplexed_log.py", line 174, in run
INTERNALERROR> raise exception
INTERNALERROR> TypeError: __init__() got an unexpected keyword argument
'encoding'

Best regards

Heinrich


---
  test/py/conftest.py| 2 +-
  test/py/multiplexed_log.py | 4 ++--
  test/py/pytest.ini | 3 +++
  test/py/u_boot_spawn.py| 4 ++--
  4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/test/py/conftest.py b/test/py/conftest.py
index 5c19af1d5034..02b61655dcee 100644
--- a/test/py/conftest.py
+++ b/test/py/conftest.py
@@ -168,7 +168,7 @@ def pytest_configure(config):
  ini_str = '[root]\n' + f.read()
  ini_sio = io.StringIO(ini_str)
  parser = configparser.RawConfigParser()
-parser.readfp(ini_sio)
+parser.read_file(ini_sio)
  ubconfig.buildconfig.update(parser.items('root'))

  ubconfig.test_py_dir = test_py_dir
diff --git a/test/py/multiplexed_log.py b/test/py/multiplexed_log.py
index de0aacc659b8..35d95fbe0fe8 100644
--- a/test/py/multiplexed_log.py
+++ b/test/py/multiplexed_log.py
@@ -51,7 +51,7 @@ class LogfileStream(object):
  """Write data to the log stream.

  Args:
-data: The data to write tot he file.
+data: The data to write to the file.
  implicit: Boolean indicating whether data actually appeared in the
  stream, or was implicitly generated. A valid use-case is to
  repeat a shell prompt at the start of each separate log
@@ -133,7 +133,7 @@ class RunAndLog(object):
  self.logfile.write(self, msg)

  try:
-p = subprocess.Popen(cmd, cwd=cwd,
+p = subprocess.Popen(cmd, cwd=cwd, encoding="utf-8",
  stdin=None, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  (stdout, stderr) = p.communicate()
  output = ''
diff --git a/test/py/pytest.ini b/test/py/pytest.ini
index 7e400682bf25..e93d010f1fa2 100644
--- a/test/py/pytest.ini
+++ b/test/py/pytest.ini
@@ -8,3 +8,6 @@
  markers =
  boardspec: U-Boot: Describes the set of boards a test can/can't run on.
  buildconfigspec: U-Boot: Describes Kconfig/config-header constraints.
+notbuildconfigspec: U-Boot: Describes required disabled Kconfig options.
+requiredtool: U-Boot: Required host tools for a test.
+slow: U-Boot: Specific test will run slowly.
diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py
index b011a3e3da25..63119229f420 100644
--- a/test/py/u_boot_spawn.py
+++ b/test/py/u_boot_spawn.py
@@ -113,7 +113,7 @@ class Spawn(object):
  Nothing.
  """

-os.write(self.fd, data)
+os.write(self.fd, data.encode("utf-8"))

  def expect(self, patterns):
  """Wait for the sub-process to emit specific data.
@@ -171,7 +171,7 @@ class Spawn(object):
  events = self.poll.poll(poll_maxwait)
  if not events:
  raise Timeout()
-c = os.read(self.fd, 1024)
+c = os.read(self.fd, 1024).decode("utf-8")
  if not c:
  raise EOFError()
  if self.logfile_read:



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


[U-Boot] [RFC v2 4/10] test/py: Automated conversion to Python 3

2019-10-19 Thread Heinrich Schuchardt
From: Tom Rini 

Use the 2to3 tool to perform numerous automatic conversions from Python
2 syntax to Python 3.  Also fix whitespace problems that Python 3
catches that Python 2 did not.

Signed-off-by: Tom Rini 

Add missing Python 3 conversion.

Signed-off-by: Heinrich Schuchardt 
---
 test/py/conftest.py   |  9 ++--
 test/py/multiplexed_log.py|  4 +-
 test/py/test.py   |  4 +-
 test/py/tests/test_fit.py | 12 +++--
 test/py/tests/test_fpga.py| 46 +--
 test/py/tests/test_fs/conftest.py |  4 +-
 test/py/tests/test_log.py |  8 ++--
 test/py/tests/test_mmc_wr.py  | 74 +++
 8 files changed, 76 insertions(+), 85 deletions(-)

diff --git a/test/py/conftest.py b/test/py/conftest.py
index 30c898b40a..7da4b77bce 100644
--- a/test/py/conftest.py
+++ b/test/py/conftest.py
@@ -19,13 +19,10 @@ import os.path
 import pytest
 from _pytest.runner import runtestprotocol
 import re
-import StringIO
+import io
 import sys

-try:
-import configparser
-except:
-import ConfigParser as configparser
+import configparser

 # Globals: The HTML log file, and the connection to the U-Boot console.
 log = None
@@ -169,7 +166,7 @@ def pytest_configure(config):

 with open(dot_config, 'rt') as f:
 ini_str = '[root]\n' + f.read()
-ini_sio = StringIO.StringIO(ini_str)
+ini_sio = io.StringIO(ini_str.decode())
 parser = configparser.RawConfigParser()
 parser.readfp(ini_sio)
 ubconfig.buildconfig.update(parser.items('root'))
diff --git a/test/py/multiplexed_log.py b/test/py/multiplexed_log.py
index 637a3bd257..de0aacc659 100644
--- a/test/py/multiplexed_log.py
+++ b/test/py/multiplexed_log.py
@@ -5,8 +5,8 @@
 # Generate an HTML-formatted log file containing multiple streams of data,
 # each represented in a well-delineated/-structured fashion.

-import cgi
 import datetime
+import html
 import os.path
 import shutil
 import subprocess
@@ -334,7 +334,7 @@ $(document).ready(function () {
 data = data.replace(chr(13), '')
 data = ''.join((ord(c) in self._nonprint) and ('%%%02x' % ord(c)) or
c for c in data)
-data = cgi.escape(data)
+data = html.escape(data)
 return data

 def _terminate_stream(self):
diff --git a/test/py/test.py b/test/py/test.py
index a5140945d4..0ce1838833 100755
--- a/test/py/test.py
+++ b/test/py/test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0

 # Copyright (c) 2015 Stephen Warren
@@ -7,8 +7,6 @@
 # Wrapper script to invoke pytest with the directory name that contains the
 # U-Boot tests.

-from __future__ import print_function
-
 import os
 import os.path
 import sys
diff --git a/test/py/tests/test_fit.py b/test/py/tests/test_fit.py
index e3210ed43f..ea9286a553 100755
--- a/test/py/tests/test_fit.py
+++ b/test/py/tests/test_fit.py
@@ -3,8 +3,6 @@
 #
 # Sanity check of the FIT handling in U-Boot

-from __future__ import print_function
-
 import os
 import pytest
 import struct
@@ -155,7 +153,7 @@ def test_fit(u_boot_console):
 src = make_fname('u-boot.dts')
 dtb = make_fname('u-boot.dtb')
 with open(src, 'w') as fd:
-print(base_fdt, file=fd)
+fd.write(base_fdt)
 util.run_and_log(cons, ['dtc', src, '-O', 'dtb', '-o', dtb])
 return dtb

@@ -169,7 +167,7 @@ def test_fit(u_boot_console):
 """
 its = make_fname('test.its')
 with open(its, 'w') as fd:
-print(base_its % params, file=fd)
+fd.write(base_its % params)
 return its

 def make_fit(mkimage, params):
@@ -188,7 +186,7 @@ def test_fit(u_boot_console):
 its = make_its(params)
 util.run_and_log(cons, [mkimage, '-f', its, fit])
 with open(make_fname('u-boot.dts'), 'w') as fd:
-print(base_fdt, file=fd)
+fd.write(base_fdt)
 return fit

 def make_kernel(filename, text):
@@ -204,7 +202,7 @@ def test_fit(u_boot_console):
 for i in range(100):
 data += 'this %s %d is unlikely to boot\n' % (text, i)
 with open(fname, 'w') as fd:
-print(data, file=fd)
+fd.write(data)
 return fname

 def make_ramdisk(filename, text):
@@ -218,7 +216,7 @@ def test_fit(u_boot_console):
 for i in range(100):
 data += '%s %d was seldom used in the middle ages\n' % (text, i)
 with open(fname, 'w') as fd:
-print(data, file=fd)
+fd.write(data)
 return fname

 def make_compressed(filename):
diff --git a/test/py/tests/test_fpga.py b/test/py/tests/test_fpga.py
index e3bb7b41c7..ca7ef8ea40 100644
--- a/test/py/tests/test_fpga.py
+++ b/test/py/tests/test_fpga.py
@@ -175,29 +175,29 @@ def test_fpga_load_fail(u_boot_console):
 f, dev, addr, bit, bit_size =