Re: [U-Boot] [BUG] efi_driver: crash while reading from iSCSI drive

2019-10-23 Thread Heinrich Schuchardt


On 10/23/19 12:30 PM, AKASHI Takahiro wrote:
> On Tue, Oct 22, 2019 at 10:29:09PM +0200, Heinrich Schuchardt wrote:
>> The patch
>>
>> commit 867400677cda0fac4a411f1549fe3a61bb5ed172
>> efi_loader: disk: install FILE_SYSTEM_PROTOCOL only if available
>>
>> breaks booting my Pine A64 LTS board via iPXE and GRUB. But I assume
>> this is not at the base of the problem.
>>
>> My iSCSI drive is partitioned like this:
>>
>> DeviceBootStart  End  Sectors  Size Id Type
>> pine-a64-lts1  2048   194559   192512   94M ef EFI   vfat
>> pine-a64-lts2 *  194560  2148351  1953792  954M 83 Linux ext2
>> pine-a64-lts3   2148352 25585663 23437312 11.2G 83 Linux ext4
>> pine-a64-lts4  25585664 67106815 41521152 19.8G 83 Linux ext4
>>
>> Looking at the debug output below the following questions arise:
>>
>> Why is ext2 not recognized as a file system?
>> Why is the system crashing when trying to read 1024 blocks from the ext4
>> partition?
>
> Try the workaround attached below.
> It seems that some fields, particularly log2blksz, in blk_dev held by
> ext_fs(of ext_filesystem in fs/ext4/ext4fs.c) are not initialized.
>
> I think that ext4's initialization code should be reworked.

Thanks for looking into this.

The error is in efi_bl_bind() (lib/efi_driver/efi_block_device.c). I
missed to use the block size of the block IO protocol to initialize
desc->blksz and desc->log2blksz.

Our FAT driver takes the sector size from the boot sector in
get_fs_info() (fs/fat/fat.c) and ignores the block descriptor which will
lead to errors if the logical sector size does not match the physical
sector size.

Best regards

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


[U-Boot] [PATCH v2 4/8] linux/types.h: Surround 'struct ustat' with __linux__

2019-10-23 Thread Bin Meng
'struct ustat' uses linux-specific typedefs to declare its memebers:
__kernel_daddr_t and __kernel_ino_t. It is currently not used by any
U-Boot codes, but when we build U-Boot tools for other platform like
Windows, this becomes a problem.

Let's surround it with __linux__.

Signed-off-by: Bin Meng 
---

Changes in v2: None

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

diff --git a/include/linux/types.h b/include/linux/types.h
index cc6f7cb..51cb284 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -151,12 +151,14 @@ typedef __u32 __bitwise __wsum;
 
 typedef unsigned __bitwise__   gfp_t;
 
+#ifdef __linux__
 struct ustat {
__kernel_daddr_tf_tfree;
__kernel_ino_t  f_tinode;
charf_fname[6];
charf_fpack[6];
 };
+#endif
 
 #define DECLARE_BITMAP(name, bits) \
unsigned long name[BITS_TO_LONGS(bits)]
-- 
2.7.4

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


[U-Boot] [PATCH v2 6/8] Add .gitattributes for line endings

2019-10-23 Thread Bin Meng
When building U-Boot host tools for Windows from Microsoft Azure
Pipelines, we see tons of weird warnings and errors emitted from
every Kconfig files:

  Kconfig:6:warning: ignoring unsupported character ''
  Kconfig:6:warning: ignoring unsupported character ''
  Kconfig:8:warning: ignoring unsupported character ''
  Kconfig:9:warning: ignoring unsupported character ''
  Kconfig:10:warning: ignoring unsupported character ''
  Kconfig:10:warning: ignoring unsupported character ''
  Kconfig:13:warning: ignoring unsupported character ''
  arch/Kconfig:1:warning: ignoring unsupported character ''
  arch/Kconfig:2:warning: ignoring unsupported character ''
  arch/Kconfig:2:warning: ignoring unsupported character ''
  arch/Kconfig:4:warning: ignoring unsupported character ''
  ...

After several rounds of experiments, it turns out this is caused
by line endings. Historically, Linux and macOS used linefeed (LF)
characters while Windows used a carriage return plus a linefeed
(CRLF). When Azure Pipelines checks out the U-Boot repo, Git tries
to compensate for the difference by automatically making lines end
in CRLF in the working directory on Windows, which confuses the
Kconfig file parsing logic.

Fortunately Git provides a way for repos to tell Git not to do such
automatical line endings conversion via .gitattributes file below:

* text eol=lf

Signed-off-by: Bin Meng 

---

Changes in v2:
- new patch: Add .gitattributes for line endings

 .gitattributes | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 .gitattributes

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000..8560b79
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+# Declare files that always have LF line endings on checkout
+* text eol=lf
-- 
2.7.4

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


[U-Boot] [PATCH v2 7/8] tools: Avoid creating symbolic links for tools/version.h

2019-10-23 Thread Bin Meng
When building U-Boot host tools for Windows from Microsoft Azure
Pipelines, the following errors were seen:

  HOSTCC  tools/mkenvimage.o
  In file included from tools/mkenvimage.c:25:
  ./tools/version.h:1:1: error: expected identifier or ‘(’ before ‘.’ token
 1 | ../include/version.h
   | ^
  tools/mkenvimage.c: In function ‘main’:
  tools/mkenvimage.c:117:4: warning: implicit declaration of function ‘usage’ 
[-Wimplicit-function-declaration]
   117 |usage(prg);
   |^
  tools/mkenvimage.c:120:35: error: ‘PLAIN_VERSION’ undeclared (first use in 
this function)
   120 |printf("%s version %s\n", prg, PLAIN_VERSION);
   |   ^
  tools/mkenvimage.c:120:35: note: each undeclared identifier is reported only 
once for each function it appears in
  make[2]: *** [scripts/Makefile.host:114: tools/mkenvimage.o] Error 1

It turns out tools/version.h is a symbolic link and with Windows
default settings it is unsupported hence the actual content of
tools/version.h is not what file include/version.h has, but the
the linked file path, which breaks the build.

To fix this, remove the symbolic links for tools/version.h. Instead
we perform a copy from include/version.h during the build.

Signed-off-by: Bin Meng 

---

Changes in v2:
- new patch: tools: Avoid creating symbolic links for tools/version.h

 Makefile | 9 ++---
 tools/.gitignore | 1 +
 tools/version.h  | 1 -
 3 files changed, 7 insertions(+), 4 deletions(-)
 delete mode 12 tools/version.h

diff --git a/Makefile b/Makefile
index cbacf1c..e78b317 100644
--- a/Makefile
+++ b/Makefile
@@ -1837,11 +1837,14 @@ checkarmreloc: u-boot
false; \
fi
 
-envtools: scripts_basic $(version_h) $(timestamp_h)
+tools/version.h: include/version.h
+   $(call if_changed,copy)
+
+envtools: scripts_basic $(version_h) $(timestamp_h) tools/version.h
$(Q)$(MAKE) $(build)=tools/env
 
 tools-only: export TOOLS_ONLY=y
-tools-only: scripts_basic $(version_h) $(timestamp_h)
+tools-only: scripts_basic $(version_h) $(timestamp_h) tools/version.h
$(Q)$(MAKE) $(build)=tools
 
 tools-all: export HOST_TOOLS_ALL=y
@@ -1869,7 +1872,7 @@ CLEAN_DIRS  += $(MODVERDIR) \
   $(foreach d, spl tpl, $(patsubst %,$d/%, \
$(filter-out include, $(shell ls -1 $d 2>/dev/null
 
-CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \
+CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h tools/version.h \
   boot* u-boot* MLO* SPL System.map fit-dtb.blob*
 
 # Directories & files removed with 'make mrproper'
diff --git a/tools/.gitignore b/tools/.gitignore
index bd03d32..d0176a7 100644
--- a/tools/.gitignore
+++ b/tools/.gitignore
@@ -31,4 +31,5 @@
 /spl_size_limit
 /sunxi-spl-image-builder
 /ubsha1
+/version.h
 /xway-swap-bytes
diff --git a/tools/version.h b/tools/version.h
deleted file mode 12
index bb57607..000
--- a/tools/version.h
+++ /dev/null
@@ -1 +0,0 @@
-../include/version.h
\ No newline at end of file
-- 
2.7.4

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


[U-Boot] [PATCH v2 8/8] Add Micirosoft Azure pipelines configuration

2019-10-23 Thread Bin Meng
Microsoft Azure Pipelines provides unlimited CI/CD minutes and 10
parallel jobs to every open source project for free [1].

This adds a configuration file for Azure Pipelines to utilize the
free Windows VM hosted by Microsoft to ensure no build broken in
building U-Boot host tools for Windows.

[1] 
https://azure.microsoft.com/en-us/blog/announcing-azure-pipelines-with-unlimited-ci-cd-minutes-for-open-source/

Signed-off-by: Bin Meng 

---
See the build result at:
https://dev.azure.com/bmeng/GitHub/_build/results?buildId=53

Changes in v2:
- new patch: Add Micirosoft Azure pipelines configuration

 azure-pipelines.yml | 35 +++
 1 file changed, 35 insertions(+)
 create mode 100644 azure-pipelines.yml

diff --git a/azure-pipelines.yml b/azure-pipelines.yml
new file mode 100644
index 000..cc0514b
--- /dev/null
+++ b/azure-pipelines.yml
@@ -0,0 +1,35 @@
+jobs:
+  - job: tools_only_windows
+displayName: 'Ensure host tools build for Windows'
+pool:
+  vmImage: vs2015-win2012r2
+strategy:
+  matrix:
+i686:
+  MSYS_DIR: msys32
+  BASE_REPO: msys2-ci-base-i686
+x86_64:
+  MSYS_DIR: msys64
+  BASE_REPO: msys2-ci-base
+steps:
+  - script: |
+  git clone https://github.com/msys2/$(BASE_REPO).git 
%CD:~0,2%\$(MSYS_DIR)
+displayName: 'Install MSYS2'
+  - script: |
+  set 
PATH=%CD:~0,2%\$(MSYS_DIR)\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
+  %CD:~0,2%\$(MSYS_DIR)\usr\bin\pacman --noconfirm -Syyuu
+displayName: 'Update MSYS2'
+  - script: |
+  set 
PATH=%CD:~0,2%\$(MSYS_DIR)\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
+  %CD:~0,2%\$(MSYS_DIR)\usr\bin\pacman --noconfirm --needed -S make 
gcc bison diffutils openssl-devel
+displayName: 'Install Toolchain'
+  - script: |
+  set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
+  echo make tools-only_defconfig tools-only NO_SDL=1 > build-tools.sh
+  %CD:~0,2%\$(MSYS_DIR)\usr\bin\bash -lc "bash build-tools.sh"
+displayName: 'Build Host Tools'
+env:
+  # Tell MSYS2 we need a POSIX emulation layer
+  MSYSTEM: MSYS
+  # Tell MSYS2 not to ‘cd’ our startup directory to HOME
+  CHERE_INVOKING: yes
-- 
2.7.4

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


[U-Boot] [PATCH v2 2/8] tools: mtk_image.h: Use portable uintXX_t instead of linux-specific __leXX

2019-10-23 Thread Bin Meng
__leXX has Linux kernel specific __attribute__((bitwise)) which is
not portable. Use corresponding uintXX_t instead.

Signed-off-by: Bin Meng 
---

Changes in v2: None

 tools/mtk_image.h | 86 +++
 1 file changed, 43 insertions(+), 43 deletions(-)

diff --git a/tools/mtk_image.h b/tools/mtk_image.h
index 0a9eab3..4e78b3d 100644
--- a/tools/mtk_image.h
+++ b/tools/mtk_image.h
@@ -9,14 +9,14 @@
 #ifndef _MTK_IMAGE_H
 #define _MTK_IMAGE_H
 
-/* Device header definitions */
+/* Device header definitions, all fields are little-endian */
 
 /* Header for NOR/SD/eMMC */
 union gen_boot_header {
struct {
char name[12];
-   __le32 version;
-   __le32 size;
+   uint32_t version;
+   uint32_t size;
};
 
uint8_t pad[0x200];
@@ -32,14 +32,14 @@ union nand_boot_header {
char name[12];
char version[4];
char id[8];
-   __le16 ioif;
-   __le16 pagesize;
-   __le16 addrcycles;
-   __le16 oobsize;
-   __le16 pages_of_block;
-   __le16 numblocks;
-   __le16 writesize_shift;
-   __le16 erasesize_shift;
+   uint16_t ioif;
+   uint16_t pagesize;
+   uint16_t addrcycles;
+   uint16_t oobsize;
+   uint16_t pages_of_block;
+   uint16_t numblocks;
+   uint16_t writesize_shift;
+   uint16_t erasesize_shift;
uint8_t dummy[60];
uint8_t ecc_parity[28];
};
@@ -54,14 +54,14 @@ union nand_boot_header {
 /* BootROM layout header */
 struct brom_layout_header {
char name[8];
-   __le32 version;
-   __le32 header_size;
-   __le32 total_size;
-   __le32 magic;
-   __le32 type;
-   __le32 header_size_2;
-   __le32 total_size_2;
-   __le32 unused;
+   uint32_t version;
+   uint32_t header_size;
+   uint32_t total_size;
+   uint32_t magic;
+   uint32_t type;
+   uint32_t header_size_2;
+   uint32_t total_size_2;
+   uint32_t unused;
 };
 
 #define BRLYT_NAME "BRLYT"
@@ -90,8 +90,8 @@ struct gen_device_header {
 struct gfh_common_header {
uint8_t magic[3];
uint8_t version;
-   __le16 size;
-   __le16 type;
+   uint16_t size;
+   uint16_t type;
 };
 
 #define GFH_HEADER_MAGIC   "MMM"
@@ -106,17 +106,17 @@ struct gfh_common_header {
 struct gfh_file_info {
struct gfh_common_header gfh;
char name[12];
-   __le32 unused;
-   __le16 file_type;
+   uint32_t unused;
+   uint16_t file_type;
uint8_t flash_type;
uint8_t sig_type;
-   __le32 load_addr;
-   __le32 total_size;
-   __le32 max_size;
-   __le32 hdr_size;
-   __le32 sig_size;
-   __le32 jump_offset;
-   __le32 processed;
+   uint32_t load_addr;
+   uint32_t total_size;
+   uint32_t max_size;
+   uint32_t hdr_size;
+   uint32_t sig_size;
+   uint32_t jump_offset;
+   uint32_t processed;
 };
 
 #define GFH_FILE_INFO_NAME "FILE_INFO"
@@ -129,16 +129,16 @@ struct gfh_file_info {
 
 struct gfh_bl_info {
struct gfh_common_header gfh;
-   __le32 attr;
+   uint32_t attr;
 };
 
 struct gfh_brom_cfg {
struct gfh_common_header gfh;
-   __le32 cfg_bits;
-   __le32 usbdl_by_auto_detect_timeout_ms;
+   uint32_t cfg_bits;
+   uint32_t usbdl_by_auto_detect_timeout_ms;
uint8_t unused[0x48];
-   __le32 usbdl_by_kcol0_timeout_ms;
-   __le32 usbdl_by_flag_timeout_ms;
+   uint32_t usbdl_by_kcol0_timeout_ms;
+   uint32_t usbdl_by_flag_timeout_ms;
uint32_t pad;
 };
 
@@ -157,15 +157,15 @@ struct gfh_anti_clone {
uint8_t ac_b2k;
uint8_t ac_b2c;
uint16_t pad;
-   __le32 ac_offset;
-   __le32 ac_len;
+   uint32_t ac_offset;
+   uint32_t ac_len;
 };
 
 struct gfh_brom_sec_cfg {
struct gfh_common_header gfh;
-   __le32 cfg_bits;
+   uint32_t cfg_bits;
char customer_name[0x20];
-   __le32 pad;
+   uint32_t pad;
 };
 
 #define BROM_SEC_CFG_JTAG_EN   1
@@ -184,11 +184,11 @@ struct gfh_header {
 
 union lk_hdr {
struct {
-   __le32 magic;
-   __le32 size;
+   uint32_t magic;
+   uint32_t size;
char name[32];
-   __le32 loadaddr;
-   __le32 mode;
+   uint32_t loadaddr;
+   uint32_t mode;
};
 
uint8_t data[512];
-- 
2.7.4

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


[U-Boot] [PATCH v2 5/8] doc: Add documentation for how to build U-Boot host tools

2019-10-23 Thread Bin Meng
This adds a reST document for how to build U-Boot host tools,
including information for both Linux and Windows.

Signed-off-by: Bin Meng 

---

Changes in v2: None

 doc/build/index.rst |  9 +
 doc/build/tools.rst | 47 +++
 doc/index.rst   | 11 +++
 3 files changed, 67 insertions(+)
 create mode 100644 doc/build/index.rst
 create mode 100644 doc/build/tools.rst

diff --git a/doc/build/index.rst b/doc/build/index.rst
new file mode 100644
index 000..e4e3411
--- /dev/null
+++ b/doc/build/index.rst
@@ -0,0 +1,9 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Build U-Boot
+
+
+.. toctree::
+   :maxdepth: 2
+
+   tools
diff --git a/doc/build/tools.rst b/doc/build/tools.rst
new file mode 100644
index 000..c06f915
--- /dev/null
+++ b/doc/build/tools.rst
@@ -0,0 +1,47 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. sectionauthor:: Bin Meng 
+
+Host tools
+==
+
+Building tools for Linux
+
+
+To allow distributions to distribute all possible tools in a generic way,
+avoiding the need of specific tools building for each machine, a tools only
+defconfig file is provided.
+
+Using this, we can build the tools by doing::
+
+   $ make tools-only_defconfig
+   $ make tools-only
+
+Building tools for Windows
+--
+If you wish to generate Windows versions of the utilities in the tools 
directory
+you can use MSYS2, a software distro and building platform for Windows.
+
+Download the MSYS2 installer from https://www.msys2.org. Make sure you have
+installed all required packages below in order to build these host tools::
+
+   * gcc (9.1.0)
+   * make (4.2.1)
+   * bison (3.4.2)
+   * diffutils (3.7)
+   * openssl-devel (1.1.1.d)
+
+Note the version numbers in these parentheses above are the package versions
+at the time being when writing this document. The MSYS2 installer tested is
+http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20190524.exe.
+
+There are 3 MSYS subsystems installed: MSYS2, MinGW32 and MinGW64. Each
+subsystem provides an environment to build Windows applications. The MSYS2
+environment is for building POSIX compliant software on Windows using an
+emulation layer. The MinGW32/64 subsystems are for building native Windows
+applications using a linux toolchain (gcc, bash, etc), targeting respectively
+32 and 64 bit Windows.
+
+Launch the MSYS2 shell of the MSYS2 environment, and do the following::
+
+   $ make tools-only_defconfig
+   $ make tools-only NO_SDL=1
diff --git a/doc/index.rst b/doc/index.rst
index 458f0d2..206a045 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -15,6 +15,17 @@ if you want to help out.
 .. toctree::
:maxdepth: 2
 
+User-oriented documentation
+---
+
+The following manuals are written for *users* of the U-Boot - those who are
+trying to get it to work optimally on a given system.
+
+.. toctree::
+   :maxdepth: 2
+
+   build/index
+
 Unified Extensible Firmware (UEFI)
 --
 
-- 
2.7.4

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


[U-Boot] [PATCH v2 3/8] tools: zynqmpbif: Use compiler builtin instead of linux-specific __swab32

2019-10-23 Thread Bin Meng
__swab32() is a Linux specific macro defined in linux/swab.h. Let's
use the compiler equivalent builtin function __builtin_bswap32() for
better portability.

Signed-off-by: Bin Meng 
---

Changes in v2: None

 tools/zynqmpbif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/zynqmpbif.c b/tools/zynqmpbif.c
index 8c47107..82ce0ac 100644
--- a/tools/zynqmpbif.c
+++ b/tools/zynqmpbif.c
@@ -517,7 +517,7 @@ static int bif_add_bit(struct bif_entry *bf)
debug("Bitstream Length: 0x%x\n", bitlen);
for (i = 0; i < bitlen; i += sizeof(uint32_t)) {
uint32_t *bitbin32 = (uint32_t *)[i];
-   *bitbin32 = __swab32(*bitbin32);
+   *bitbin32 = __builtin_bswap32(*bitbin32);
}
 
if (!bf->dest_dev)
-- 
2.7.4

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


[U-Boot] [PATCH v2 1/8] tools: image.h: Use portable uint32_t instead of linux-specific __be32

2019-10-23 Thread Bin Meng
__be32 has Linux kernel specific __attribute__((bitwise)) which is
not portable. Use uint32_t instead.

Signed-off-by: Bin Meng 
---

Changes in v2: None

 include/image.h | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/image.h b/include/image.h
index c1065c0..f4d2aaf 100644
--- a/include/image.h
+++ b/include/image.h
@@ -319,13 +319,13 @@ enum {
  * all data in network byte order (aka natural aka bigendian).
  */
 typedef struct image_header {
-   __be32  ih_magic;   /* Image Header Magic Number*/
-   __be32  ih_hcrc;/* Image Header CRC Checksum*/
-   __be32  ih_time;/* Image Creation Timestamp */
-   __be32  ih_size;/* Image Data Size  */
-   __be32  ih_load;/* Data  Load  Address  */
-   __be32  ih_ep;  /* Entry Point Address  */
-   __be32  ih_dcrc;/* Image Data CRC Checksum  */
+   uint32_tih_magic;   /* Image Header Magic Number*/
+   uint32_tih_hcrc;/* Image Header CRC Checksum*/
+   uint32_tih_time;/* Image Creation Timestamp */
+   uint32_tih_size;/* Image Data Size  */
+   uint32_tih_load;/* Data  Load  Address  */
+   uint32_tih_ep;  /* Entry Point Address  */
+   uint32_tih_dcrc;/* Image Data CRC Checksum  */
uint8_t ih_os;  /* Operating System */
uint8_t ih_arch;/* CPU architecture */
uint8_t ih_type;/* Image Type   */
-- 
2.7.4

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


[U-Boot] [PATCH v2 0/8] tools: Support building U-Boot host tools for Windows via MSYS2

2019-10-23 Thread Bin Meng
Per current U-Boot README, building Windows versions of the utilities
in the tools directory is done via the MinGW toolchain. But testing
shows that it is broken and actually it must have been broken for
quite a long time.

Fixing MinGW build seems quite amount of work as developers of
U-Boot normally work on Linux boxes hence codes written are mainly
for Linux or POSIX OSes. We must investigate another way of building
host tools for Windows, and now we have MSYS2, a software distro and
building platform for Windows, to build POSIX compliant software on
Windows using an emulation layer.

This small series fixes several issues in current U-Boot tools codes,
that only assume a Linux host is used. Cases are using standard C
typedefs whenever possbile, or using compiler builtin functions to
improve portability, etc.

A reST document for how to build U-Boot host tools for both platforms
is added.

A new CI pipeline configuration for Microsoft Azure Pipelines is added
for U-Boot. We rely on it to ensure future host tools for Windows build
does not break. I've also investigated putting what we have for now on
GitLab-CI and Travis-CI to Azure Pipelines, but buildman hangs forever
and the root cause is not figured out yet.

Changes in v2:
- new patch: Add .gitattributes for line endings
- new patch: tools: Avoid creating symbolic links for tools/version.h
- new patch: Add Micirosoft Azure pipelines configuration

Bin Meng (8):
  tools: image.h: Use portable uint32_t instead of linux-specific __be32
  tools: mtk_image.h: Use portable uintXX_t instead of linux-specific
__leXX
  tools: zynqmpbif: Use compiler builtin instead of linux-specific
__swab32
  linux/types.h: Surround 'struct ustat' with __linux__
  doc: Add documentation for how to build U-Boot host tools
  Add .gitattributes for line endings
  tools: Avoid creating symbolic links for tools/version.h
  Add Micirosoft Azure pipelines configuration

 .gitattributes|  2 ++
 Makefile  |  9 --
 azure-pipelines.yml   | 35 +
 doc/build/index.rst   |  9 ++
 doc/build/tools.rst   | 47 
 doc/index.rst | 11 +++
 include/image.h   | 14 -
 include/linux/types.h |  2 ++
 tools/.gitignore  |  1 +
 tools/mtk_image.h | 86 +--
 tools/version.h   |  1 -
 tools/zynqmpbif.c |  2 +-
 12 files changed, 164 insertions(+), 55 deletions(-)
 create mode 100644 .gitattributes
 create mode 100644 azure-pipelines.yml
 create mode 100644 doc/build/index.rst
 create mode 100644 doc/build/tools.rst
 delete mode 12 tools/version.h

-- 
2.7.4

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


Re: [U-Boot] [PATCH] ddr: socfpga: gen5: constify altera_gen5_sdram_ops

2019-10-23 Thread Ley Foon Tan
On Wed, 2019-10-23 at 22:19 +0200, Simon Goldschmidt wrote:
> Make the function pointer struct const, as it does not need to be
> writable. This doesn't really change anything other than moving this
> variable to a different section. No functional change.
> 
> Signed-off-by: Simon Goldschmidt 
Reviewed-by: Ley Foon Tan 
> ---
> 
>  drivers/ddr/altera/sdram_gen5.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ddr/altera/sdram_gen5.c
> b/drivers/ddr/altera/sdram_gen5.c
> index fcd89b619d..8c8ea19eb9 100644
> --- a/drivers/ddr/altera/sdram_gen5.c
> +++ b/drivers/ddr/altera/sdram_gen5.c
> @@ -626,7 +626,7 @@ static int altera_gen5_sdram_get_info(struct
> udevice *dev,
>   return 0;
>  }
>  
> -static struct ram_ops altera_gen5_sdram_ops = {
> +static const struct ram_ops altera_gen5_sdram_ops = {
>   .get_info = altera_gen5_sdram_get_info,
>  };
>  
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] spi: cadence_qspi: support DM_CLK

2019-10-23 Thread Ley Foon Tan
On Wed, 2019-10-23 at 22:27 +0200, Simon Goldschmidt wrote:
> Support loading clk speed via DM instead of requiring ad-hoc code.
> 
> Signed-off-by: Simon Goldschmidt 
> ---
> 
>  drivers/spi/cadence_qspi.c | 20 ++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
> index e2e54cd277..0b89115885 100644
> --- a/drivers/spi/cadence_qspi.c
> +++ b/drivers/spi/cadence_qspi.c
> @@ -5,6 +5,7 @@
>   */
>  
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -22,12 +23,27 @@ static int cadence_spi_write_speed(struct udevice
> *bus, uint hz)
>  {
>   struct cadence_spi_platdata *plat = bus->platdata;
>   struct cadence_spi_priv *priv = dev_get_priv(bus);
> + unsigned int ref_clk_hz;
> + struct clk clk;
> + int ret;
> +
> + ret = clk_get_by_index(bus, 0, );
> + if (ret) {
> +#ifdef CONFIG_CQSPI_REF_CLK
> + ref_clk_hz = CONFIG_CQSPI_REF_CLK;
> +#else
> + return ret;
> +#endif
> + } else {
> + ref_clk_hz = clk_get_rate();
clk_get_rate() might return negative error code if failed to get clock
rate. 
> + clk_free();
> + }
>  
>   cadence_qspi_apb_config_baudrate_div(priv->regbase,
> -  CONFIG_CQSPI_REF_CLK,
> hz);
> +  ref_clk_hz, hz);
>  
>   /* Reconfigure delay timing if speed is changed. */
> - cadence_qspi_apb_delay(priv->regbase, CONFIG_CQSPI_REF_CLK,
> hz,
> + cadence_qspi_apb_delay(priv->regbase, ref_clk_hz, hz,
>      plat->tshsl_ns, plat->tsd2d_ns,
>      plat->tchsh_ns, plat->tslch_ns);
>  
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] socfpga: fix include guard in misc.h (arch vs. global)

2019-10-23 Thread Ley Foon Tan
On Wed, 2019-10-23 at 22:32 +0200, Simon Goldschmidt wrote:
> The file arch/arm/mach-socfpga/include/mach/misc.h used the same
> include
> guard as the global include/misc.h.
> 
> Fix this by giving the arch file an arch prefix.
> 
> Signed-off-by: Simon Goldschmidt 
Reviewed-by: Ley Foon Tan 

> ---
> 
>  arch/arm/mach-socfpga/include/mach/misc.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-socfpga/include/mach/misc.h
> b/arch/arm/mach-socfpga/include/mach/misc.h
> index 27d0b6a370..f11f907e1c 100644
> --- a/arch/arm/mach-socfpga/include/mach/misc.h
> +++ b/arch/arm/mach-socfpga/include/mach/misc.h
> @@ -3,8 +3,8 @@
>   * Copyright (C) 2016-2017 Intel Corporation
>   */
>  
> -#ifndef _MISC_H_
> -#define _MISC_H_
> +#ifndef _SOCFPGA_MISC_H_
> +#define _SOCFPGA_MISC_H_
>  
>  #include 
>  
> @@ -42,4 +42,4 @@ void socfpga_sdram_remap_zero(void);
>  void do_bridge_reset(int enable, unsigned int mask);
>  void socfpga_pl310_clear(void);
>  
> -#endif /* _MISC_H_ */
> +#endif /* _SOCFPGA_MISC_H_ */
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 08/10] rkmux: Convert to Python 3

2019-10-23 Thread Simon Glass
Convert this tool to Python 3 and make it use that, to meet the 2020
deadline.

Signed-off-by: Simon Glass 
---

 tools/rkmux.py | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/rkmux.py b/tools/rkmux.py
index 11c192a0737..1226ee201c3 100755
--- a/tools/rkmux.py
+++ b/tools/rkmux.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 
 # Script to create enums from datasheet register tables
 #
@@ -43,8 +43,8 @@ class RegField:
 self.desc.append(desc)
 
 def Show(self):
-print self
-print
+print(self)
+print()
 self.__init__()
 
 def __str__(self):
@@ -65,11 +65,11 @@ class Printer:
 self.output_footer()
 
 def output_header(self):
-print '/* %s */' % self.name
-print 'enum {'
+print('/* %s */' % self.name)
+print('enum {')
 
 def output_footer(self):
-print '};';
+print('};');
 
 def output_regfield(self, regfield):
 lines = regfield.desc
@@ -97,7 +97,7 @@ class Printer:
 self.first = False
 self.output_header()
 else:
-print
+print()
 out_enum(field, 'shift', bit_low)
 out_enum(field, 'mask', mask)
 next_val = -1
@@ -175,7 +175,7 @@ def out_enum(field, suffix, value, skip_val=False):
 val_str = '%d' % value
 
 str += '%s= %s' % ('\t' * tabs, val_str)
-print '\t%s,' % str
+print('\t%s,' % str)
 
 # Process a CSV file, e.g. from tabula
 def process_csv(name, fd):
-- 
2.24.0.rc0.303.g954a862665-goog

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


[U-Boot] [PATCH 10/10] pylibfdt: Convert to Python 3

2019-10-23 Thread Simon Glass
Build this swig module with Python 3.

Signed-off-by: Simon Glass 
---

 scripts/dtc/pylibfdt/Makefile |  2 +-
 scripts/dtc/pylibfdt/libfdt.i_shipped |  2 +-
 scripts/dtc/pylibfdt/setup.py |  2 +-
 tools/binman/entry.py | 16 ++--
 tools/binman/entry_test.py| 15 ---
 tools/binman/etype/intel_fit.py   |  2 +-
 6 files changed, 6 insertions(+), 33 deletions(-)

diff --git a/scripts/dtc/pylibfdt/Makefile b/scripts/dtc/pylibfdt/Makefile
index 15e66ad44d7..42342c75bb1 100644
--- a/scripts/dtc/pylibfdt/Makefile
+++ b/scripts/dtc/pylibfdt/Makefile
@@ -21,7 +21,7 @@ quiet_cmd_pymod = PYMOD   $@
CPPFLAGS="$(HOSTCFLAGS) -I$(LIBFDT_srcdir)" OBJDIR=$(obj) \
SOURCES="$(PYLIBFDT_srcs)" \
SWIG_OPTS="-I$(LIBFDT_srcdir) -I$(LIBFDT_srcdir)/.." \
-   $(PYTHON2) $< --quiet build_ext --inplace
+   $(PYTHON3) $< --quiet build_ext --inplace
 
 $(obj)/_libfdt.so: $(src)/setup.py $(PYLIBFDT_srcs) FORCE
$(call if_changed,pymod)
diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped 
b/scripts/dtc/pylibfdt/libfdt.i_shipped
index 76e61e98bdf..53b70f8f5e7 100644
--- a/scripts/dtc/pylibfdt/libfdt.i_shipped
+++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
@@ -624,7 +624,7 @@ class Fdt(FdtRo):
 Raises:
 FdtException if no parent found or other error occurs
 """
-val = val.encode('utf-8') + '\0'
+val = val.encode('utf-8') + b'\0'
 return check_err(fdt_setprop(self._fdt, nodeoffset, prop_name,
  val, len(val)), quiet)
 
diff --git a/scripts/dtc/pylibfdt/setup.py b/scripts/dtc/pylibfdt/setup.py
index 4f7cf042bfe..992cdec30f5 100755
--- a/scripts/dtc/pylibfdt/setup.py
+++ b/scripts/dtc/pylibfdt/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 
 """
 setup.py file for SWIG libfdt
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index 409c0dca934..5bf5be4794b 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -7,16 +7,7 @@
 from __future__ import print_function
 
 from collections import namedtuple
-
-# importlib was introduced in Python 2.7 but there was a report of it not
-# working in 2.7.12, so we work around this:
-# http://lists.denx.de/pipermail/u-boot/2016-October/269729.html
-try:
-import importlib
-have_importlib = True
-except:
-have_importlib = False
-
+import importlib
 import os
 import sys
 
@@ -119,10 +110,7 @@ class Entry(object):
 old_path = sys.path
 sys.path.insert(0, os.path.join(our_path, 'etype'))
 try:
-if have_importlib:
-module = importlib.import_module(module_name)
-else:
-module = __import__(module_name)
+module = importlib.import_module(module_name)
 except ImportError as e:
 raise ValueError("Unknown entry type '%s' in node '%s' 
(expected etype/%s.py, error '%s'" %
  (etype, node_path, module_name, e))
diff --git a/tools/binman/entry_test.py b/tools/binman/entry_test.py
index 13f58645168..277e10b5859 100644
--- a/tools/binman/entry_test.py
+++ b/tools/binman/entry_test.py
@@ -39,21 +39,6 @@ class TestEntry(unittest.TestCase):
 else:
 import entry
 
-def test1EntryNoImportLib(self):
-"""Test that we can import Entry subclassess successfully"""
-sys.modules['importlib'] = None
-global entry
-self._ReloadEntry()
-entry.Entry.Create(None, self.GetNode(), 'u-boot')
-self.assertFalse(entry.have_importlib)
-
-def test2EntryImportLib(self):
-del sys.modules['importlib']
-global entry
-self._ReloadEntry()
-entry.Entry.Create(None, self.GetNode(), 'u-boot-spl')
-self.assertTrue(entry.have_importlib)
-
 def testEntryContents(self):
 """Test the Entry bass class"""
 import entry
diff --git a/tools/binman/etype/intel_fit.py b/tools/binman/etype/intel_fit.py
index 23606d27d04..2a34a05f955 100644
--- a/tools/binman/etype/intel_fit.py
+++ b/tools/binman/etype/intel_fit.py
@@ -27,6 +27,6 @@ class Entry_intel_fit(Entry_blob):
 self.align = 16
 
 def ObtainContents(self):
-data = struct.pack('<8sIHBB', '_FIT_   ', 1, 0x100, 0x80, 0x7d)
+data = struct.pack('<8sIHBB', b'_FIT_   ', 1, 0x100, 0x80, 0x7d)
 self.SetContents(data)
 return True
-- 
2.24.0.rc0.303.g954a862665-goog

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


[U-Boot] [PATCH 09/10] RFC: binman: Move to use Python 3

2019-10-23 Thread Simon Glass
Update this tool to use Python 3 to meet the 2020 deadline.

Unfortunately this introduces a test failure due to a problem in pylibfdt
on Python 3. I will investigate.

Signed-off-by: Simon Glass 
---

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

diff --git a/tools/binman/binman.py b/tools/binman/binman.py
index 8bd5868df26..9e6fd721175 100755
--- a/tools/binman/binman.py
+++ b/tools/binman/binman.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 
 # Copyright (c) 2016 Google, Inc
-- 
2.24.0.rc0.303.g954a862665-goog

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


[U-Boot] [PATCH 07/10] move_config: Convert to Python 3

2019-10-23 Thread Simon Glass
Convert this tool to Python 3 and make it use that, to meet the 2020
deadline.

Signed-off-by: Simon Glass 
---

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

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index b99417e9d63..e2ff4cfc88b 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Author: Masahiro Yamada 
@@ -304,7 +304,7 @@ import glob
 import multiprocessing
 import optparse
 import os
-import Queue
+import queue
 import re
 import shutil
 import subprocess
@@ -450,8 +450,8 @@ def get_matched_defconfigs(defconfigs_file):
 line = line.split(' ')[0]  # handle 'git log' input
 matched = get_matched_defconfig(line)
 if not matched:
-print >> sys.stderr, "warning: %s:%d: no defconfig matched '%s'" % 
\
- (defconfigs_file, i + 1, line)
+print("warning: %s:%d: no defconfig matched '%s'" % \
+ (defconfigs_file, i + 1, 
line), file=sys.stderr)
 
 defconfigs += matched
 
@@ -494,11 +494,11 @@ def show_diff(a, b, file_path, color_enabled):
 
 for line in diff:
 if line[0] == '-' and line[1] != '-':
-print color_text(color_enabled, COLOR_RED, line),
+print(color_text(color_enabled, COLOR_RED, line), end=' ')
 elif line[0] == '+' and line[1] != '+':
-print color_text(color_enabled, COLOR_GREEN, line),
+print(color_text(color_enabled, COLOR_GREEN, line), end=' ')
 else:
-print line,
+print(line, end=' ')
 
 def extend_matched_lines(lines, matched, pre_patterns, post_patterns, 
extend_pre,
  extend_post):
@@ -554,9 +554,9 @@ def extend_matched_lines(lines, matched, pre_patterns, 
post_patterns, extend_pre
 def confirm(options, prompt):
 if not options.yes:
 while True:
-choice = raw_input('{} [y/n]: '.format(prompt))
+choice = input('{} [y/n]: '.format(prompt))
 choice = choice.lower()
-print choice
+print(choice)
 if choice == 'y' or choice == 'n':
 break
 
@@ -809,10 +809,10 @@ def try_expand(line):
 val= val.strip('\"')
 if re.search("[*+-/]|<<|SZ_+|\(([^\)]+)\)", val):
 newval = hex(eval(val, SIZES))
-print "\tExpanded expression %s to %s" % (val, newval)
+print("\tExpanded expression %s to %s" % (val, newval))
 return cfg+'='+newval
 except:
-print "\tFailed to expand expression in %s" % line
+print("\tFailed to expand expression in %s" % line)
 
 return line
 
@@ -838,7 +838,7 @@ class Progress:
 
 def show(self):
 """Display the progress."""
-print ' %d defconfigs out of %d\r' % (self.current, self.total),
+print(' %d defconfigs out of %d\r' % (self.current, self.total), end=' 
')
 sys.stdout.flush()
 
 
@@ -1236,7 +1236,7 @@ class Slot:
 "Tool chain for '%s' is missing.  Do nothing.\n" % arch)
 self.finish(False)
 return
-   env = toolchain.MakeEnvironment(False)
+env = toolchain.MakeEnvironment(False)
 
 cmd = list(self.make_cmd)
 cmd.append('KCONFIG_IGNORE_DUPLICATES=1')
@@ -1312,7 +1312,7 @@ class Slot:
 log += '\n'.join([ '' + s for s in self.log.split('\n') ])
 # Some threads are running in parallel.
 # Print log atomically to not mix up logs from different threads.
-print >> (sys.stdout if success else sys.stderr), log
+print(log, file=(sys.stdout if success else sys.stderr))
 
 if not success:
 if self.options.exit_on_error:
@@ -1411,8 +1411,8 @@ class Slots:
 msg = "The following boards were not processed due to error:\n"
 msg += boards
 msg += "(the list has been saved in %s)\n" % output_file
-print >> sys.stderr, color_text(self.options.color, 
COLOR_LIGHT_RED,
-msg)
+print(color_text(self.options.color, COLOR_LIGHT_RED,
+msg), file=sys.stderr)
 
 with open(output_file, 'w') as f:
 f.write(boards)
@@ -1431,8 +1431,8 @@ class Slots:
 msg += "It is highly recommended to check them manually:\n"
 msg += boards
 msg += "(the list has been saved in %s)\n" % output_file
-print >> sys.stderr, color_text(self.options.color, COLOR_YELLOW,
-msg)
+print(color_text(self.options.color, COLOR_YELLOW,
+msg), file=sys.stderr)
 
 with open(output_file, 'w') 

[U-Boot] [PATCH 04/10] test_fdt: Move to use Python 3

2019-10-23 Thread Simon Glass
Update this test to use Python 3 to meet the 2020 deadline.

Signed-off-by: Simon Glass 
---

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

diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py
index 028c8cbaa80..3316757e61e 100755
--- a/tools/dtoc/test_fdt.py
+++ b/tools/dtoc/test_fdt.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2018 Google, Inc
 # Written by Simon Glass 
-- 
2.24.0.rc0.303.g954a862665-goog

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


[U-Boot] [PATCH 03/10] buildman: Convert to Python 3

2019-10-23 Thread Simon Glass
Convert buildman to Python 3 and make it use that, to meet the 2020
deadline.

Signed-off-by: Simon Glass 
---

 tools/buildman/board.py |  7 +--
 tools/buildman/bsettings.py | 20 +++
 tools/buildman/builder.py   | 45 
 tools/buildman/builderthread.py | 24 -
 tools/buildman/buildman.py  | 10 ++--
 tools/buildman/control.py   | 40 +++---
 tools/buildman/func_test.py | 16 +++---
 tools/buildman/test.py  | 22 
 tools/buildman/toolchain.py | 93 +
 9 files changed, 139 insertions(+), 138 deletions(-)

diff --git a/tools/buildman/board.py b/tools/buildman/board.py
index 2a1d021574c..0060ac36cc3 100644
--- a/tools/buildman/board.py
+++ b/tools/buildman/board.py
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2012 The Chromium OS Authors.
 
+from collections import OrderedDict
 import re
 
 class Expr:
@@ -155,7 +156,7 @@ class Boards:
 key is board.target
 value is board
 """
-board_dict = {}
+board_dict = OrderedDict()
 for board in self._boards:
 board_dict[board.target] = board
 return board_dict
@@ -166,7 +167,7 @@ class Boards:
 Returns:
 List of Board objects that are marked selected
 """
-board_dict = {}
+board_dict = OrderedDict()
 for board in self._boards:
 if board.build_it:
 board_dict[board.target] = board
@@ -259,7 +260,7 @@ class Boards:
 due to each argument, arranged by argument.
 List of errors found
 """
-result = {}
+result = OrderedDict()
 warnings = []
 terms = self._BuildTerms(args)
 
diff --git a/tools/buildman/bsettings.py b/tools/buildman/bsettings.py
index 03d7439aa54..0b7208da373 100644
--- a/tools/buildman/bsettings.py
+++ b/tools/buildman/bsettings.py
@@ -1,9 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2012 The Chromium OS Authors.
 
-import ConfigParser
+import configparser
 import os
-import StringIO
+import io
 
 
 def Setup(fname=''):
@@ -15,20 +15,20 @@ def Setup(fname=''):
 global settings
 global config_fname
 
-settings = ConfigParser.SafeConfigParser()
+settings = configparser.SafeConfigParser()
 if fname is not None:
 config_fname = fname
 if config_fname == '':
 config_fname = '%s/.buildman' % os.getenv('HOME')
 if not os.path.exists(config_fname):
-print 'No config file found ~/.buildman\nCreating one...\n'
+print('No config file found ~/.buildman\nCreating one...\n')
 CreateBuildmanConfigFile(config_fname)
-print 'To install tool chains, please use the --fetch-arch option'
+print('To install tool chains, please use the --fetch-arch option')
 if config_fname:
 settings.read(config_fname)
 
 def AddFile(data):
-settings.readfp(StringIO.StringIO(data))
+settings.readfp(io.StringIO(data))
 
 def GetItems(section):
 """Get the items from a section of the config.
@@ -41,7 +41,7 @@ def GetItems(section):
 """
 try:
 return settings.items(section)
-except ConfigParser.NoSectionError as e:
+except configparser.NoSectionError as e:
 return []
 except:
 raise
@@ -68,10 +68,10 @@ def CreateBuildmanConfigFile(config_fname):
 try:
 f = open(config_fname, 'w')
 except IOError:
-print "Couldn't create buildman config file '%s'\n" % config_fname
+print("Couldn't create buildman config file '%s'\n" % config_fname)
 raise
 
-print >>f, '''[toolchain]
+print('''[toolchain]
 # name = path
 # e.g. x86 = /opt/gcc-4.6.3-nolibc/x86_64-linux
 
@@ -93,5 +93,5 @@ openrisc = or1k
 # snapper-boards=ENABLE_AT91_TEST=1
 # snapper9260=${snapper-boards} BUILD_TAG=442
 # snapper9g45=${snapper-boards} BUILD_TAG=443
-'''
+''', file=f)
 f.close();
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index fbb236676c7..3018867c39a 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -9,7 +9,7 @@ from datetime import datetime, timedelta
 import glob
 import os
 import re
-import Queue
+import queue
 import shutil
 import signal
 import string
@@ -92,11 +92,10 @@ u-boot/ source directory
 """
 
 # Possible build outcomes
-OUTCOME_OK, OUTCOME_WARNING, OUTCOME_ERROR, OUTCOME_UNKNOWN = range(4)
+OUTCOME_OK, OUTCOME_WARNING, OUTCOME_ERROR, OUTCOME_UNKNOWN = list(range(4))
 
 # Translate a commit subject into a valid filename (and handle unicode)
-trans_valid_chars = string.maketrans('/: ', '---')
-trans_valid_chars = trans_valid_chars.decode('latin-1')
+trans_valid_chars = str.maketrans('/: ', '---')
 
 BASE_CONFIG_FILENAMES = [
 'u-boot.cfg', 'u-boot-spl.cfg', 'u-boot-tpl.cfg'
@@ -122,8 +121,8 @@ class Config:
 def __hash__(self):
 

[U-Boot] [PATCH 02/10] patman: Move to use Python 3

2019-10-23 Thread Simon Glass
Update this tool to use Python 3 to meet the 2020 deadline.

Signed-off-by: Simon Glass 
---

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

diff --git a/tools/patman/patman.py b/tools/patman/patman.py
index 9605a36eff2..fe82f24c673 100755
--- a/tools/patman/patman.py
+++ b/tools/patman/patman.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Copyright (c) 2011 The Chromium OS Authors.
-- 
2.24.0.rc0.303.g954a862665-goog

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


[U-Boot] [PATCH 06/10] microcode_tool: Convert to Python 3

2019-10-23 Thread Simon Glass
Convert this tool to Python 3 and make it use that, to meet the 2020
deadline.

Signed-off-by: Simon Glass 
---

 tools/microcode-tool.py | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/tools/microcode-tool.py b/tools/microcode-tool.py
index 249a33b8cac..24c02c4fca1 100755
--- a/tools/microcode-tool.py
+++ b/tools/microcode-tool.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Copyright (c) 2014 Google, Inc
@@ -126,15 +126,15 @@ def List(date, microcodes, model):
 microcodes: Dict of Microcode objects indexed by name
 model:  Model string to search for, or None
 """
-print 'Date: %s' % date
+print('Date: %s' % date)
 if model:
 mcode_list, tried = FindMicrocode(microcodes, model.lower())
-print 'Matching models %s:' % (', '.join(tried))
+print('Matching models %s:' % (', '.join(tried)))
 else:
-print 'All models:'
-mcode_list = [microcodes[m] for m in microcodes.keys()]
+print('All models:')
+mcode_list = [microcodes[m] for m in list(microcodes.keys())]
 for mcode in mcode_list:
-print '%-20s: model %s' % (mcode.name, mcode.model)
+print('%-20s: model %s' % (mcode.name, mcode.model))
 
 def FindMicrocode(microcodes, model):
 """Find all the microcode chunks which match the given model.
@@ -164,7 +164,7 @@ def FindMicrocode(microcodes, model):
 for i in range(3):
 abbrev = model[:-i] if i else model
 tried.append(abbrev)
-for mcode in microcodes.values():
+for mcode in list(microcodes.values()):
 if mcode.model.startswith(abbrev):
 found.append(mcode)
 if found:
@@ -229,17 +229,17 @@ data = <%s
 args += [mcode.words[i] for i in range(7)]
 args.append(words)
 if outfile == '-':
-print out % tuple(args)
+print(out % tuple(args))
 else:
 if not outfile:
 if not os.path.exists(MICROCODE_DIR):
-print >> sys.stderr, "Creating directory '%s'" % MICROCODE_DIR
+print("Creating directory '%s'" % MICROCODE_DIR, 
file=sys.stderr)
 os.makedirs(MICROCODE_DIR)
 outfile = os.path.join(MICROCODE_DIR, mcode.name + '.dtsi')
-print >> sys.stderr, "Writing microcode for '%s' to '%s'" % (
-', '.join([mcode.name for mcode in mcodes]), outfile)
+print("Writing microcode for '%s' to '%s'" % (
+', '.join([mcode.name for mcode in mcodes]), outfile), 
file=sys.stderr)
 with open(outfile, 'w') as fd:
-print >> fd, out % tuple(args)
+print(out % tuple(args), file=fd)
 
 def MicrocodeTool():
 """Run the microcode tool"""
@@ -289,14 +289,14 @@ def MicrocodeTool():
 if cmd == 'list':
 List(date, microcodes, options.model)
 elif cmd == 'license':
-print '\n'.join(license_text)
+print('\n'.join(license_text))
 elif cmd == 'create':
 if not options.model:
 parser.error('You must specify a model to create')
 model = options.model.lower()
 if options.model == 'all':
 options.multiple = True
-mcode_list = microcodes.values()
+mcode_list = list(microcodes.values())
 tried = []
 else:
 mcode_list, tried = FindMicrocode(microcodes, model)
-- 
2.24.0.rc0.303.g954a862665-goog

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


[U-Boot] [PATCH 05/10] test_dtoc: Move to use Python 3

2019-10-23 Thread Simon Glass
Update this test to use Python 3 to meet the 2020 deadline.

Also make it executable while we are here.

Signed-off-by: Simon Glass 
---

 tools/dtoc/dtoc.py  | 2 +-
 tools/dtoc/test_dtoc.py | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 tools/dtoc/test_dtoc.py

diff --git a/tools/dtoc/dtoc.py b/tools/dtoc/dtoc.py
index 514e0dd4a34..b3596a5918f 100755
--- a/tools/dtoc/dtoc.py
+++ b/tools/dtoc/dtoc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Copyright (C) 2016 Google, Inc
diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py
old mode 100644
new mode 100755
index b915b278560..d733b706558
--- a/tools/dtoc/test_dtoc.py
+++ b/tools/dtoc/test_dtoc.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2012 The Chromium OS Authors.
 #
-- 
2.24.0.rc0.303.g954a862665-goog

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


[U-Boot] [PATCH 01/10] patman: Adjust 'command' to return strings instead of bytes

2019-10-23 Thread Simon Glass
At present all the 'command' methods return bytes. Most of the time we
actually want strings, so change this. We still need to keep the internal
representation as bytes since otherwise unicode strings might break over
a read() boundary (e.g. 4KB), causing errors. But we can convert the end
result to strings.

Add a 'binary' parameter to cover the few cases where bytes are needed.

Signed-off-by: Simon Glass 
---

 tools/binman/cbfs_util_test.py |  2 +-
 tools/binman/ftest.py  |  2 +-
 tools/patman/command.py| 31 +++
 tools/patman/tools.py  | 29 +
 4 files changed, 46 insertions(+), 18 deletions(-)

diff --git a/tools/binman/cbfs_util_test.py b/tools/binman/cbfs_util_test.py
index 772c794eceb..ddc2e09e358 100755
--- a/tools/binman/cbfs_util_test.py
+++ b/tools/binman/cbfs_util_test.py
@@ -56,7 +56,7 @@ class TestCbfs(unittest.TestCase):
 cls.have_lz4 = True
 try:
 tools.Run('lz4', '--no-frame-crc', '-c',
-  tools.GetInputFilename('u-boot.bin'))
+  tools.GetInputFilename('u-boot.bin'), binary=True)
 except:
 cls.have_lz4 = False
 
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 7000de9d420..88daaf20a87 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -170,7 +170,7 @@ class TestFunctional(unittest.TestCase):
 cls.have_lz4 = True
 try:
 tools.Run('lz4', '--no-frame-crc', '-c',
-  os.path.join(cls._indir, 'u-boot.bin'))
+  os.path.join(cls._indir, 'u-boot.bin'), binary=True)
 except:
 cls.have_lz4 = False
 
diff --git a/tools/patman/command.py b/tools/patman/command.py
index 16299f3f5be..5fbd2c4a3e9 100644
--- a/tools/patman/command.py
+++ b/tools/patman/command.py
@@ -4,6 +4,7 @@
 
 import os
 import cros_subprocess
+import tools
 
 """Shell command ease-ups for Python."""
 
@@ -31,6 +32,13 @@ class CommandResult:
 self.return_code = return_code
 self.exception = exception
 
+def ToOutput(self, binary):
+if not binary:
+self.stdout = tools.ToString(self.stdout)
+self.stderr = tools.ToString(self.stderr)
+self.combined = tools.ToString(self.combined)
+return self
+
 
 # This permits interception of RunPipe for test purposes. If it is set to
 # a function, then that function is called with the pipe list being
@@ -41,7 +49,7 @@ test_result = None
 
 def RunPipe(pipe_list, infile=None, outfile=None,
 capture=False, capture_stderr=False, oneline=False,
-raise_on_error=True, cwd=None, **kwargs):
+raise_on_error=True, cwd=None, binary=False, **kwargs):
 """
 Perform a command pipeline, with optional input/output filenames.
 
@@ -67,7 +75,7 @@ def RunPipe(pipe_list, infile=None, outfile=None,
 else:
 return test_result
 # No result: fall through to normal processing
-result = CommandResult()
+result = CommandResult(b'', b'', b'')
 last_pipe = None
 pipeline = list(pipe_list)
 user_pipestr =  '|'.join([' '.join(pipe) for pipe in pipe_list])
@@ -93,29 +101,36 @@ def RunPipe(pipe_list, infile=None, outfile=None,
 if raise_on_error:
 raise Exception("Error running '%s': %s" % (user_pipestr, str))
 result.return_code = 255
-return result
+return result.ToOutput(binary)
 
 if capture:
 result.stdout, result.stderr, result.combined = (
 last_pipe.CommunicateFilter(None))
 if result.stdout and oneline:
-result.output = result.stdout.rstrip('\r\n')
+result.output = result.stdout.rstrip(b'\r\n')
 result.return_code = last_pipe.wait()
 else:
 result.return_code = os.waitpid(last_pipe.pid, 0)[1]
 if raise_on_error and result.return_code:
 raise Exception("Error running '%s'" % user_pipestr)
-return result
+return result.ToOutput(binary)
 
 def Output(*cmd, **kwargs):
 kwargs['raise_on_error'] = kwargs.get('raise_on_error', True)
 return RunPipe([cmd], capture=True, **kwargs).stdout
 
 def OutputOneLine(*cmd, **kwargs):
+"""Run a command and output it as a single-line string
+
+The command us expected to produce a single line of output
+
+Returns:
+String containing output of command
+"""
 raise_on_error = kwargs.pop('raise_on_error', True)
-return (RunPipe([cmd], capture=True, oneline=True,
-raise_on_error=raise_on_error,
-**kwargs).stdout.strip())
+result = RunPipe([cmd], capture=True, oneline=True,
+ raise_on_error=raise_on_error, **kwargs).stdout.strip()
+return result
 
 def Run(*cmd, **kwargs):
 return RunPipe([cmd], **kwargs).stdout
diff --git a/tools/patman/tools.py b/tools/patman/tools.py
index 4a7fcdad214..3feddb292fc 

[U-Boot] [PATCH 00/10] scripts: Convert to Python 3

2019-10-23 Thread Simon Glass
This converts some of the scripts that I've been involved in to use
Python 3.

There is still one problem in that fdt_property_stub() doesn't work
correctly in pylibfdt:

ftest.TestFunctional.testExtractAllEntries Traceback (most recent call last):
TypeError: in method 'fdt_property_stub', argument 3 of type 'char const *'


Simon Glass (10):
  patman: Adjust 'command' to return strings instead of bytes
  patman: Move to use Python 3
  buildman: Convert to Python 3
  test_fdt: Move to use Python 3
  test_dtoc: Move to use Python 3
  microcode_tool: Convert to Python 3
  move_config: Convert to Python 3
  rkmux: Convert to Python 3
  RFC: binman: Move to use Python 3
  pylibfdt: Convert to Python 3

 scripts/dtc/pylibfdt/Makefile |  2 +-
 scripts/dtc/pylibfdt/libfdt.i_shipped |  2 +-
 scripts/dtc/pylibfdt/setup.py |  2 +-
 tools/binman/binman.py|  2 +-
 tools/binman/cbfs_util_test.py|  2 +-
 tools/binman/entry.py | 16 +
 tools/binman/entry_test.py| 15 -
 tools/binman/etype/intel_fit.py   |  2 +-
 tools/binman/ftest.py |  2 +-
 tools/buildman/board.py   |  7 +-
 tools/buildman/bsettings.py   | 20 +++---
 tools/buildman/builder.py | 45 +++--
 tools/buildman/builderthread.py   | 24 ---
 tools/buildman/buildman.py| 10 +--
 tools/buildman/control.py | 40 ++--
 tools/buildman/func_test.py   | 16 ++---
 tools/buildman/test.py| 22 +++
 tools/buildman/toolchain.py   | 93 ++-
 tools/dtoc/dtoc.py|  2 +-
 tools/dtoc/test_dtoc.py   |  1 +
 tools/dtoc/test_fdt.py|  2 +-
 tools/microcode-tool.py   | 28 
 tools/moveconfig.py   | 82 +++
 tools/patman/command.py   | 31 ++---
 tools/patman/patman.py|  2 +-
 tools/patman/tools.py | 29 ++---
 tools/rkmux.py| 16 ++---
 27 files changed, 259 insertions(+), 256 deletions(-)
 mode change 100644 => 100755 tools/dtoc/test_dtoc.py

-- 
2.24.0.rc0.303.g954a862665-goog

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


Re: [U-Boot] [PATCH] clk: imx: imx8mm: Fix the first root clock in imx8mm_ahb_sels[]

2019-10-23 Thread Peng Fan
> Subject: Re: [PATCH] clk: imx: imx8mm: Fix the first root clock in
> imx8mm_ahb_sels[]
> 
> Hi Frieder,
> 
> On Wed, Oct 23, 2019 at 1:36 PM Schrempf Frieder
>  wrote:
> >
> > From: Frieder Schrempf 
> >
> > The 24MHz oscillator clock is referenced by "clock-osc-24m" and not
> > "osc_24m".
> 
> Is the kernel clock driver also wrong then?

No, kernel is right. It is U-Boot CCF specific.

Regards,
Peng.

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


Re: [U-Boot] [PATCH 3/3] mx7ulp: Move SoC base address to a common file

2019-10-23 Thread Peng Fan
> Subject: [PATCH 3/3] mx7ulp: Move SoC base address to a common file
> 
> SoC base addresses should better go into a common SoC file instead of
> repeating the definition in each board file.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  arch/arm/include/asm/arch-mx7ulp/imx-regs.h | 4 
>  include/configs/mx7ulp_evk.h| 4 
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-mx7ulp/imx-regs.h
> b/arch/arm/include/asm/arch-mx7ulp/imx-regs.h
> index 3c82e9921e..9a420dc30b 100644
> --- a/arch/arm/include/asm/arch-mx7ulp/imx-regs.h
> +++ b/arch/arm/include/asm/arch-mx7ulp/imx-regs.h
> @@ -946,6 +946,10 @@
>  #define SNVS_LPCR_DPEN   (0x20)
>  #define SNVS_LPCR_SRTC_ENV   (0x1)
> 
> +#define SRC_BASE_ADDRCMC1_RBASE
> +#define IRAM_BASE_ADDR   OCRAM_0_BASE
> +#define IOMUXC_BASE_ADDR IOMUXC1_RBASE
> +
>  #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
> 
>  #include 
> diff --git a/include/configs/mx7ulp_evk.h b/include/configs/mx7ulp_evk.h
> index 141036310b..6d70fb45ae 100644
> --- a/include/configs/mx7ulp_evk.h
> +++ b/include/configs/mx7ulp_evk.h
> @@ -14,10 +14,6 @@
>  #define CONFIG_BOARD_POSTCLK_INIT
>  #define CONFIG_SYS_BOOTM_LEN 0x100
> 
> -#define SRC_BASE_ADDRCMC1_RBASE
> -#define IRAM_BASE_ADDR   OCRAM_0_BASE
> -#define IOMUXC_BASE_ADDR IOMUXC1_RBASE
> -
>  #define CONFIG_SYS_MMC_ENV_DEV  0/* USDHC1 */
>  #define CONFIG_SYS_MMC_ENV_PART 0/* user area */
>  #define CONFIG_MMCROOT  "/dev/mmcblk0p2"  /*
> USDHC1 */

Reviewed-by: Peng Fan 

> --
> 2.17.1

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


Re: [U-Boot] [PATCH] clk: imx: imx8mm: Fix the first root clock in imx8mm_ahb_sels[]

2019-10-23 Thread Peng Fan
> Subject: [PATCH] clk: imx: imx8mm: Fix the first root clock in
> imx8mm_ahb_sels[]
> 
> From: Frieder Schrempf 
> 
> The 24MHz oscillator clock is referenced by "clock-osc-24m" and not
> "osc_24m".
> 
> Signed-off-by: Frieder Schrempf 
> ---
>  drivers/clk/imx/clk-imx8mm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c
> index 091b092bbb..a05dac7c7a 100644
> --- a/drivers/clk/imx/clk-imx8mm.c
> +++ b/drivers/clk/imx/clk-imx8mm.c
> @@ -74,7 +74,7 @@ static const char *sys_pll3_bypass_sels[] = {"sys_pll3",
> "sys_pll3_ref_sel", };  static const char *imx8mm_a53_sels[] =
> {"clock-osc-24m", "arm_pll_out", "sys_pll2_500m", "sys_pll2_1000m",
>   "sys_pll1_800m", "sys_pll1_400m", 
> "audio_pll1_out",
> "sys_pll3_out", };
> 
> -static const char *imx8mm_ahb_sels[] = {"osc_24m", "sys_pll1_133m",
> "sys_pll1_800m", "sys_pll1_400m",
> +static const char *imx8mm_ahb_sels[] = {"clock-osc-24m",
> +"sys_pll1_133m", "sys_pll1_800m", "sys_pll1_400m",
>   "sys_pll2_125m", "sys_pll3_out", 
> "audio_pll1_out",
> "video_pll1_out", };
> 
>  static const char *imx8mm_enet_axi_sels[] = {"clock-osc-24m",
> "sys_pll1_266m", "sys_pll1_800m", "sys_pll2_250m",

Reviewed-by: Peng Fan 

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


Re: [U-Boot] [PATCH 2/3] mx7ulp_evk: Remove unneeded SDHC definitions

2019-10-23 Thread Peng Fan
> Subject: [PATCH 2/3] mx7ulp_evk: Remove unneeded SDHC definitions
> 
> As we use the driver model for ESDHC there is no need for defining
> CONFIG_SYS_FSL_USDHC_NUM and CONFIG_SYS_FSL_ESDHC_ADDR, so
> simply remove them.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  include/configs/mx7ulp_evk.h | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/include/configs/mx7ulp_evk.h b/include/configs/mx7ulp_evk.h
> index 3b02362498..141036310b 100644
> --- a/include/configs/mx7ulp_evk.h
> +++ b/include/configs/mx7ulp_evk.h
> @@ -18,9 +18,6 @@
>  #define IRAM_BASE_ADDR   OCRAM_0_BASE
>  #define IOMUXC_BASE_ADDR IOMUXC1_RBASE
> 
> -#define CONFIG_SYS_FSL_USDHC_NUM1
> -
> -#define CONFIG_SYS_FSL_ESDHC_ADDR   0
>  #define CONFIG_SYS_MMC_ENV_DEV  0/* USDHC1 */
>  #define CONFIG_SYS_MMC_ENV_PART 0/* user area */
>  #define CONFIG_MMCROOT  "/dev/mmcblk0p2"  /*
> USDHC1 */

Reviewed-by: Peng Fan 

> --
> 2.17.1

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


Re: [U-Boot] [PATCH 1/3] mx7ulp_evk: Disable CONFIG_NET

2019-10-23 Thread Peng Fan
> Subject: [PATCH 1/3] mx7ulp_evk: Disable CONFIG_NET
> 
> Currently the following build warning is seen:
> 
> = WARNING == This board
> does not use CONFIG_DM_ETH (Driver Model for Ethernet drivers). Please
> update the board to use CONFIG_DM_ETH before the v2020.07 release.
> Failure to update by the deadline may result in board removal.
> See doc/driver-model/migration.rst for more info.
> ===
> 
> Since the mx7ulp-evk board does not have networking support, explicitly
> disable networking.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  configs/mx7ulp_evk_defconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/configs/mx7ulp_evk_defconfig b/configs/mx7ulp_evk_defconfig
> index ffd217d515..d79c39d621 100644
> --- a/configs/mx7ulp_evk_defconfig
> +++ b/configs/mx7ulp_evk_defconfig
> @@ -17,6 +17,7 @@ CONFIG_CMD_FAT=y
>  CONFIG_OF_CONTROL=y
>  CONFIG_DEFAULT_DEVICE_TREE="imx7ulp-evk"
>  CONFIG_ENV_IS_IN_MMC=y
> +# CONFIG_NET is not set
>  CONFIG_DM=y
>  CONFIG_DM_GPIO=y
>  CONFIG_IMX_RGPIO2P=y

Reviewed-by: Peng Fan 

> --
> 2.17.1

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


Re: [U-Boot] [PATCH V1 5/6] net: fec_mxc: support i.MX8M with CLK_CCF

2019-10-23 Thread Peng Fan
> Subject: Re: [U-Boot] [PATCH V1 5/6] net: fec_mxc: support i.MX8M with
> CLK_CCF
> 
> On 22.10.19 05:30, Peng Fan wrote:
> > Add more clks for fec_mxc according to Linux Kernel 5.4.0-rc1
> > drivers/net/ethernet/freescale/fec_main.c.
> >
> > Since i.MX8MQ not support CLK_CCF, so add a check to restrict the code
> > only effect when CONFIG_IMX8M and CONFIG_CLK_CCF both defined.
> >
> > Signed-off-by: Peng Fan 
> > ---
> >   drivers/net/fec_mxc.c | 74
> ---
> >   drivers/net/fec_mxc.h |  4 +++
> >   2 files changed, 63 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index
> > 080dbcf7db..9362aa0d05 100644
> > --- a/drivers/net/fec_mxc.c
> > +++ b/drivers/net/fec_mxc.c
> > @@ -125,28 +125,29 @@ static int fec_mdio_read(struct ethernet_regs
> > *eth, uint8_t phyaddr,
> >
> >   static int fec_get_clk_rate(void *udev, int idx)
> >   {
> > -#if IS_ENABLED(CONFIG_IMX8)
> > struct fec_priv *fec;
> > struct udevice *dev;
> > int ret;
> >
> > -   dev = udev;
> > -   if (!dev) {
> > -   ret = uclass_get_device(UCLASS_ETH, idx, );
> > -   if (ret < 0) {
> > -   debug("Can't get FEC udev: %d\n", ret);
> > -   return ret;
> > +   if (IS_ENABLED(CONFIG_IMX8) ||
> > +   (IS_ENABLED(CONFIG_IMX8M) &&
> IS_ENABLED(CONFIG_CLK_CCF))) {
> 
> Can't we just drop the IS_ENABLED(CONFIG_IMX8M)? Otherwise we always
> need to touch this code when other SoCs will start using CCF.

ok. 

> 
> Also can you use CONFIG_IS_ENABLED(CLK_CCF) instead of
> IS_ENABLED(CONFIG_CLK_CCF), so we can detect the config options for SPL
> and non-SPL separately?

FEC will not be used in SPL stage, so I not use CONFIG_IS_ENABLED.
But it does not hurt using IS_ENABLED, change in v2.

Regards,
Peng.

> 
> > +   dev = udev;
> > +   if (!dev) {
> > +   ret = uclass_get_device(UCLASS_ETH, idx, );
> > +   if (ret < 0) {
> > +   debug("Can't get FEC udev: %d\n", ret);
> > +   return ret;
> > +   }
> > }
> > -   }
> >
> > -   fec = dev_get_priv(dev);
> > -   if (fec)
> > -   return fec->clk_rate;
> > +   fec = dev_get_priv(dev);
> > +   if (fec)
> > +   return fec->clk_rate;
> >
> > -   return -EINVAL;
> > -#else
> > -   return imx_get_fecclk();
> > -#endif
> > +   return -EINVAL;
> > +   } else {
> > +   return imx_get_fecclk();
> > +   }
> >   }
> >
> >   static void fec_mii_setspeed(struct ethernet_regs *eth) @@ -1335,6
> > +1336,49 @@ static int fecmxc_probe(struct udevice *dev)
> > return ret;
> > }
> >
> > +   priv->clk_rate = clk_get_rate(>ipg_clk);
> > +   } else if (IS_ENABLED(CONFIG_IMX8M) &&
> IS_ENABLED(CONFIG_CLK_CCF)) {
> 
> Same questions here as above.
> 
> > +   ret = clk_get_by_name(dev, "ipg", >ipg_clk);
> > +   if (ret < 0) {
> > +   debug("Can't get FEC ipg clk: %d\n", ret);
> > +   return ret;
> > +   } else {
> 
> You can drop the else branches here and below as the code returns before it
> will be evaluated.
> 
> > +   ret = clk_enable(>ipg_clk);
> > +   if(ret)
> > +   return ret;
> > +   }
> > +
> > +   ret = clk_get_by_name(dev, "ipg", >ahb_clk);
> 
> This should be "ahb", not "ipg".
> 
> > +   if (ret < 0) {
> > +   debug("Can't get FEC ahb clk: %d\n", ret);
> > +   return ret;
> > +   } else {
> > +   ret = clk_enable(>ahb_clk);
> > +   if (ret)
> > +   return ret;
> > +   }
> > +
> > +   ret = clk_get_by_name(dev, "enet_out", >clk_enet_out);
> > +   if (!ret) {
> > +   ret = clk_enable(>clk_enet_out);
> > +   if (ret)
> > +   return ret;
> > +   }
> > +
> > +   ret = clk_get_by_name(dev, "enet_clk_ref", >clk_ref);
> > +   if (!ret) {
> > +   ret = clk_enable(>clk_ref);
> > +   if (ret)
> > +   return ret;
> > +   }
> > +
> > +   ret = clk_get_by_name(dev, "ptp", >clk_ptp);
> > +   if (!ret) {
> > +   ret = clk_enable(>clk_ptp);
> > +   if (ret)
> > +   return ret;
> > +   }
> > +
> > priv->clk_rate = clk_get_rate(>ipg_clk);
> > }
> >
> > diff --git a/drivers/net/fec_mxc.h b/drivers/net/fec_mxc.h index
> > e5f2dd75c5..723b06a651 100644
> > --- a/drivers/net/fec_mxc.h
> > +++ b/drivers/net/fec_mxc.h
> > @@ -264,6 +264,10 @@ struct fec_priv {
> > u32 interface;
> >   #endif
> > struct clk ipg_clk;
> > +   struct clk ahb_clk;
> > +   struct clk clk_enet_out;
> > +   

Re: [U-Boot] [PATCHv2 08/13] test/py: test_efi_selftest.py: Updates for python 3 support

2019-10-23 Thread Simon Glass
On Tue, 22 Oct 2019 at 21:20, Tom Rini  wrote:
>
> - In python 3 you must use raw strings for regex as other forms are
>   deprecated and would require further changes to the pattern here.
>   In one case this lets us have a simpler match pattern.
> - As strings are now Unicode our complex tests (Euro symbol,
>   SHIFT+ALT+FN 5) we need to declare that as a bytes string and then
>   decode it for use.
>
> Cc: Heinrich Schuchardt 
> Signed-off-by: Tom Rini 
> ---
> Changes in v2:
> - New patch
> ---
>  test/py/tests/test_efi_selftest.py | 36 +++---
>  1 file changed, 18 insertions(+), 18 deletions(-)

Reviewed-by: Simon Glass 
Tested on sandbox:
Tested-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCHv2 06/13] test/py: Manual python3 fixes

2019-10-23 Thread Simon Glass
On Tue, 22 Oct 2019 at 21:20, 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 use the
>   default encoding/decoding of utf-8 but in some places tell Python to
>   replace problematic conversions rather than throw a fatal error.
> - Fix a typo noticed while doing the above ("tot he" -> "to the").
> - As suggested by Stephen, re-alphabetize the import list
> - Per Heinrich, replace how we write contents in test_fit.py
>
> Signed-off-by: Tom Rini 
> ---
>  test/py/conftest.py| 9 -
>  test/py/multiplexed_log.py | 9 +
>  test/py/pytest.ini | 3 +++
>  test/py/tests/test_fit.py  | 4 ++--
>  test/py/u_boot_spawn.py| 4 ++--
>  5 files changed, 16 insertions(+), 13 deletions(-)

Reviewed-by: Simon Glass 
Tested on sandbox:
Tested-by: Simon Glass 

(I agree about supporting the older Python 3, BTW)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCHv2 13/13] test/py: Use raw strings more to avoid deprecation warnings

2019-10-23 Thread Simon Glass
On Tue, 22 Oct 2019 at 21:20, Tom Rini  wrote:
>
> We have two further uses of raw string usage in the test/py codebase
> that are used under CI.  The first of which is under the bind test and
> is a direct update.  The second of which is to strip VT100 codes from
> the match buffer.  While switching this to a raw string is also a direct
> update, the comment it notes that problems were encountered on Ubuntu
> 14.04 (and whatever Python 2 version that was) that required slight
> tweaks to the regex.  Replace that now that we're saying Python 3.5 is
> the minimum.
>
> Cc: Stephen Warren 
> Signed-off-by: Tom Rini 
> ---
> Changes in v2:
> - New patch
> ---
>  test/py/tests/test_bind.py | 4 ++--
>  test/py/u_boot_spawn.py| 5 +
>  2 files changed, 3 insertions(+), 6 deletions(-)

Reviewed-by: Simon Glass 
Tested on sandbox:
Tested-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCHv2 11/13] test/py: Update docs, add requirements.txt for pip

2019-10-23 Thread Simon Glass
On Tue, 22 Oct 2019 at 21:20, Tom Rini  wrote:
>
> To be more closely aligned with Python community best practices, we need
> to better document our usage of pip and make use of a requirements.txt
> file that shows the versions of the tools that we are using.  This will
> aide in ensuring reproducibility of our tests as well.
>
> Signed-off-by: Tom Rini 
> ---
>  test/py/README.md| 45 +---
>  test/py/requirements.txt | 22 
>  2 files changed, 46 insertions(+), 21 deletions(-)
>  create mode 100644 test/py/requirements.txt

Reviewed-by: Simon Glass 
Tested on sandbox:
Tested-by: Simon Glass 

I don't like / use pip unless I can help it, but this seems to be correct.


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


Re: [U-Boot] [PATCHv2 07/13] test/py: test_ut.py: Ensure we use bytes

2019-10-23 Thread Simon Glass
On Tue, 22 Oct 2019 at 21:20, Tom Rini  wrote:
>
> In the case of some unit tests we are working with providing a fake
> flash device that we have written some text strings in to.  In this case
> we want to tell Python to encode things to bytes for us.
>
> Reviewed-by: Stephen Warren 
> Signed-off-by: Tom Rini 
> ---
>  test/py/tests/test_ut.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Simon Glass 
Tested on sandbox:
Tested-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCHv2 10/13] test/py: Rework test.py to be a different kind of wrapper

2019-10-23 Thread Simon Glass
On Tue, 22 Oct 2019 at 21:20, Tom Rini  wrote:
>
> Now that we have moved to being based on pytest for python3 we need to
> make our test.py wrapper more robust in terms of only calling python3
> rather than possibly finding and using python2.  To do this, change from
> execvp()'ing pytest to invoking the package itself via python.  In the
> event that pytest is unavailable we still get a user-friendly error:
>
> pkg_resources.DistributionNotFound: The 'pytest' distribution was not found 
> and is required by the application
>
> Cc: Stephen Warren 
> Signed-off-by: Tom Rini 
> ---
> Changes in v2:
> - New patch
> ---
>  test/py/test.py | 20 
>  1 file changed, 4 insertions(+), 16 deletions(-)

Reviewed-by: Simon Glass 
Tested on sandbox:
Tested-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCHv2 12/13] gitlab/travis: Rework how and when we use virtualenv in order to use python3

2019-10-23 Thread Simon Glass
On Tue, 22 Oct 2019 at 21:20, Tom Rini  wrote:
>
> As things stand today, we have tools that CI requires where "python"
> must be "python2".  We need to use a virtualenv and pip in order to
> ensure that our pytest tests can be run.  Rework things slightly so
> that:
> - On Travis-CI, we install python-pyelftools for the platforms that
>   require pyelftools to be installed.
> - On GitLab-CI, we move to a newer base image that includes python3-pip
>   and continue to use a virtualenv per job that needs it, for the
>   correct set of packages.
>
> Signed-off-by: Tom Rini 
> ---
> Changes in v2:
> - Add Travis-CI support here, and stop calling it a work-around.  This
>   is just the path forward until we have everything using python3 and at
>   that point evaluate what the right changes, if any, are.
> ---
>  .gitlab-ci.yml | 10 --
>  .travis.yml| 30 +++---
>  2 files changed, 19 insertions(+), 21 deletions(-)

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


Re: [U-Boot] [PATCHv2 03/13] test/py: Split mark to multiple lines

2019-10-23 Thread Simon Glass
On Tue, 22 Oct 2019 at 21:20, Tom Rini  wrote:
>
> We inconsistently note multiple dependencies today in our tests,
> sometimes with a single line that declares multiple and sometimes
> multiple single lines.  Current pytest seems to fail on the single line
> format so change to multiple declarations.
>
> Reviewed-by: Stephen Warren 
> Signed-off-by: Tom Rini 
> ---
>  test/py/tests/test_android/test_avb.py | 9 ++---
>  test/py/tests/test_mmc_wr.py   | 4 +++-
>  2 files changed, 9 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass 
Tested on sandbox:
Tested-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCHv2 09/13] test/py: Update test_fs to decode check_output calls

2019-10-23 Thread Simon Glass
On Tue, 22 Oct 2019 at 21:20, Tom Rini  wrote:
>
> The check_output function from the subprocess Python module by default
> returns data as encoded bytes and leaves decoding to the application.
> Given our uses of the call, it makes the most sense to immediately
> decode the results.
>
> Signed-off-by: Tom Rini 
> ---
> Changes in v2:
> - New patch
> ---
>  test/py/tests/test_fs/conftest.py | 24 
>  1 file changed, 12 insertions(+), 12 deletions(-)

Reviewed-by: Simon Glass 
Tested on sandbox:
Tested-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCHv2 04/13] test/py: Fix pytest4 deprecation warnings

2019-10-23 Thread Simon Glass
On Tue, 22 Oct 2019 at 21:20, Tom Rini  wrote:
>
> From: Marek Vasut 
>
> Fix the following spit from pytest:
>
> u-boot/test/py/conftest.py:438: RemovedInPytest4Warning: MarkInfo objects are 
> deprecated as they contain merged marks which are hard to deal with correctly.
>   Please use node.get_closest_marker(name) or node.iter_markers(name).
>   Docs: https://docs.pytest.org/en/latest/mark.html#updating-code
> for board in mark.args:
>
> In both cases, the later suggestion is applicable.
>
> Reviewed-by: Stephen Warren 
> Signed-off-by: Marek Vasut 
> Cc: Igor Opaniuk 
> Cc: Tom Rini 
> Cc: Simon Glass 
> [trini: Update for current file with a few more cases, un-pin pytest in CI]
> Signed-off-by: Tom Rini 
> ---
>  .gitlab-ci.yml  |  2 +-
>  .travis.yml |  2 +-
>  test/py/conftest.py | 30 --
>  3 files changed, 14 insertions(+), 20 deletions(-)

Reviewed-by: Simon Glass 
Tested on sandbox:
Tested-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCHv2 05/13] test/py: Automated conversion to Python 3

2019-10-23 Thread Simon Glass
On Tue, 22 Oct 2019 at 21:20, 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.
>
> Reviewed-by: Stephen Warren 
> Signed-off-by: Tom Rini 
> ---
>  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(-)

Reviewed-by: Simon Glass 
Tested on sandbox:
Tested-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2019-10-23 Thread Rayees Shamsuddin
Hi Simon,

I got the ramdisk loading problem sorted out by modifying values of initrd_high 
and fdt_high
setenv initrd_high 82F4EFFF; setenv fdt_high 824F

This resulted in:
   ramdisk load start = 0x82a0, ramdisk load end = 0x82f4eaa2
## device tree at 920989cc ... 920ec99e (len=356307 [0x56FD3])
   Loading Device Tree to 824a9000, end 824fffd2 ... OK

Thanks for all your guidance and pointers.

- Rayees

-Original Message-
From: Rayees Shamsuddin 
Sent: Tuesday, October 22, 2019 9:29 PM
To: Simon Glass 
Cc: u-boot@lists.denx.de
Subject: RE: [EXTERNAL] Re: Need help with verified u-boot on Tegra TX2

Hi Simon,

I got some more information by instrumenting the u-boot functions that you 
suggested and made appropriate modifications, but still the kernel logs show 
RAMDISK error.
"RAMDISK: Couldn't find valid RAM disk image starting at 0."

This is with the normal u-boot from Tegra
INFO_RAYEES: *initrd_start is 82a0, initrd_end is 82f4eaa2

I got this with the fit image (setenv initrd_high 8eff; setenv fdt_high 
8eff)
INFO_RAYEES: *initrd_start is 8eab1000, initrd_end is 8efffaa2

Then I adjusted the initrd_high and fdt_high to be 82F4EFFF which yielded:
INFO_RAYEES: *initrd_start is 82a0, initrd_end is 82f4eaa2

This is similar to the normal u-boot, yet has the same RAMDISK error. I am 
surprised that I had to change the initrd_high and fdt_high to achieve this 
load address.
I had specified the load address for ramdisk, wondering why it didn’t take 
effect?

The other difference I can see is in the FDT address:

Normal u-boot
## Flattened Device Tree blob at 8000
   Booting using the fdt blob at 0x8000
   reserving fdt memory region: addr=8000 size=1
   Using Device Tree in place at 8000, end 80058f8e

With FIT image
   Loading Device Tree to 8ea5a000, end 8eab0fd2 ... OK

Can I specify the load address for FDT blob as well in the fit image? Does it 
matter?

- Rayees

-Original Message-
From: Simon Glass 
Sent: Monday, October 21, 2019 3:54 PM
To: Rayees Shamsuddin 
Cc: u-boot@lists.denx.de
Subject: Re: [EXTERNAL] Re: Need help with verified u-boot on Tegra TX2

Hi Rayees,

On Mon, 21 Oct 2019 at 15:55, Rayees Shamsuddin 
 wrote:
>
> Hi Simon,
>
> In the normal u-boot, they used extlinux to specify the ramdisk. I was using 
> bootm to load the ramdisk.
>
> This is the normal boot up terminal logs.
>
> "MMC: no card present
> switch to partitions #0, OK
> mmc0(part 0) is current device
> Scanning mmc 0:1...
> Found /boot/extlinux/extlinux.conf
> Retrieving file: /boot/extlinux/extlinux.conf
> 727 bytes read in 105 ms (5.9 KiB/s)
> L4T boot options
> 1:  primary kernel
> Enter choice: 1:primary kernel
> Retrieving file: /boot/initrd
> 5565090 bytes read in 213 ms (24.9 MiB/s) Retrieving file: /boot/Image
> 34179080 bytes read in 857 ms (38 MiB/s)
> append: root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4
> console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 video=tegrafb 
> no_console_suspend=1 earlycon=uart8250,mmio32,0x310 
> nvdumper_reserved=0x2772e gpt usbcore.old_scheme_first=1 
> tegraid=18.1.2.0.0 maxcpus=6 boot.slot_suffix= boot.ratchetvalues=0.2031647.1 
> bl_prof_dataptr=0x1@0x27584 sdhci_tegra.en_boot_part_access=1 ## 
> Flattened Device Tree blob at 8000
>Booting using the fdt blob at 0x8000
>reserving fdt memory region: addr=8000 size=1
>Using Device Tree in place at 8000, end 
> 80058f8e
>
> Starting kernel ..."
>
> My sequence with vboot was to set the bootargs first,then the initrd_high and 
> fdt_high and then load to e-mmc and then call bootm. In the u-boot env, the 
> following values were there. I am attaching the output of printenv here, if 
> that could give some clues on what I am doing differently.
>
> kernel_addr_r=8028
> kernel_addr_r_aliases=loadaddr
> loadaddr=8028
> ramdisk_addr_r=82a0
>
> "U-Boot 2016.07-dirty (Oct 16 2019 - 16:12:24 -0700)
>
> TEGRA186
> Model: NVIDIA P2771--500
> DRAM:  7.8 GiB
> MC:   Tegra SD/MMC: 0, Tegra SD/MMC: 1
> *** Warning - bad CRC, using default environment
>
> In:serial
> Out:   serial
> Err:   serial
> Net:   eth0: ethernet@249
> Hit any key to stop autoboot:  0
> Tegra186 (P2771--500) # setenv bootargs root=/dev/mmcblk0p1 rw 
> rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0
> fbcon=map:0 net.ifnames=0 video=tegrafb no_console_suspend=1
> earlycon=uart8250,mmio32,0x310 nvdumper_reserved=0x2772e gpt
> usbcore.old_scheme_first=1 tegraid=18.1.2.0.0 maxcpus=6 
> boot.slot_suffix= boot.ratchetvalues=0.2031647.1
> bl_prof_dataptr=0x1@0x27584 sdhci_tegra.en_boot_part_access=1
> Tegra186 (P2771--500) # setenv initrd_high 8eff
> Tegra186 (P2771--500) # setenv fdt_high 8eff
> Tegra186 (P2771--500) # ext2load mmc 0 0x9000 /boot/tegra.fit
> 40090346 bytes read in 1051 ms 

Re: [U-Boot] [PATCHv2 10/13] test/py: Rework test.py to be a different kind of wrapper

2019-10-23 Thread Tom Rini
On Wed, Oct 23, 2019 at 03:11:57PM -0600, Stephen Warren wrote:
> On 10/23/19 12:17 PM, Tom Rini wrote:
> > On Wed, Oct 23, 2019 at 12:04:30PM -0600, Stephen Warren wrote:
> > > On 10/23/19 11:29 AM, Stephen Warren wrote:
> > > > On 10/23/19 11:12 AM, Tom Rini wrote:
> > > > > On Wed, Oct 23, 2019 at 11:03:38AM -0600, Stephen Warren wrote:
> > > > > > On 10/23/19 10:58 AM, Tom Rini wrote:
> > > > > > > On Wed, Oct 23, 2019 at 10:55:57AM -0600, Stephen Warren wrote:
> > > > > > > > On 10/22/19 9:20 PM, Tom Rini wrote:
> > > > > > > > > Now that we have moved to being based on pytest for
> > > > > > > > > python3 we need to
> > > > > > > > > make our test.py wrapper more robust in terms of only calling 
> > > > > > > > > python3
> > > > > > > > > rather than possibly finding and using python2.  To
> > > > > > > > > do this, change from
> > > > > > > > > execvp()'ing pytest to invoking the package itself
> > > > > > > > > via python.  In the
> > > > > > > > > event that pytest is unavailable we still get a user-friendly 
> > > > > > > > > error:
> > > > > > > > 
> > > > > > > > I guess if this works, it's fine. But I think it'd work
> > > > > > > > just as well to
> > > > > > > > simply s/py.test/py.test-3/ in the existing code?
> > > > > > > 
> > > > > > > We can't because pip only provides "py.test" / "pytest" binaries.
> > > > > > 
> > > > > > Hmm. It sucks that virtualenv does things differently to Ubuntu
> > > > > > packaging
> > > > > > then. That means this series will probably break my test system, 
> > > > > > which
> > > > > > doesn't use virtualenv. I guess I'll apply it and see.
> > > > > 
> > > > > This should be what works everywhere tho.  Instead of hoping that
> > > > > "py.test" will be the right python version we tell python3 to use the
> > > > > pytest module it has.  So if you have system python3-pytest, that 
> > > > > works,
> > > > > if you (python3) pip install pytest locally, that works and if you
> > > > > virtualenv + python3 + pip install pytest, that works.
> > > > 
> > > > On Ubuntu 16.04, with everything installed from Ubuntu packages rather
> > > > than using virtualenv, I get this:
> > > > 
> > > > > + ./src/u-boot/test/py/test.py --bd sandbox --build-dir 
> > > > > /var/lib/jenkins/workspace/u-boot-github_swarren_u-boot-tegra_dev-test-py/U_BOOT_BOARD/sandbox/build/u-boot/sandbox
> > > > > -k 'not sleep'
> > > > > Traceback (most recent call last):
> > > > >    File "./src/u-boot/test/py/test.py", line 20, in 
> > > > >      sys.exit(load_entry_point('pytest', 'console_scripts',
> > > > > 'pytest')(args))
> > > > >    File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
> > > > > line 542, in load_entry_point
> > > > >      return get_distribution(dist).load_entry_point(group, name)
> > > > >    File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
> > > > > line 2568, in load_entry_point
> > > > >      raise ImportError("Entry point %r not found" % ((group, name),))
> > > > > ImportError: Entry point ('console_scripts', 'pytest') not found
> > > > 
> > > > > [swarren@swarren-lx1 u-boot]$ dpkg -l|grep py|grep test
> > > > > ii  python-pytest    2.8.7-4
> > > > > ii  python3-pytest   2.8.7-4
> > > > 
> > > > I guess that's much older than the pytest in requirements.txt (5.2.1!!).
> > > > While I think we can require a newish version of Python (3.5) since
> > > > that's widely available on supported OSs, I don't think we want to force
> > > > people to have a very new version of all the packages (which supported
> > > > distros don't package yet), or change they way they run pytest (by
> > > > requiring use of a virtualenv and requirements.txt) since that mechanism
> > > > isn't supported on old branches of U-Boot, which will then require all
> > > > kinds of special cases in scripts that invoke the U-Boot test system.
> > > 
> > > Ah. The issue is the name of the entry point; the last parameter to
> > > load_entry_point(). "py.test" is supported everywhere, but only newer
> > > versions of pytesst have a "pytest" entry point. Changing that parameter 
> > > to
> > > "py.test" makes the wrapper script work. Now every other test fails; I 
> > > will
> > > see if there's an easy fix for that or not.
> > 
> > We're going to have to make a cut-off point somewhere it looks like.
> > pytest 2.8.7 (which we had pinned to) is incompatible with pytest 4.x
> > and throws a lot of warnings I believe on pytest 3.x..
> > 
> > What I really want to avoid is the problem we have today where we've
> > actively pinned ourselves to a now quite out of date version and have a
> > lot of problems showing up.
> > 
> > So we aren't going to have one environment that works for history and
> > future but I am hoping / trying to plan such that if we have
> > requirements.txt we can say from here until the next new best practices
> > (which today would be using pipenv, but that starts out with pip install
> > pipenv, sigh...) we can say to use requirements.txt and for history,
> > 

Re: [U-Boot] [PATCHv2 10/13] test/py: Rework test.py to be a different kind of wrapper

2019-10-23 Thread Stephen Warren

On 10/23/19 12:17 PM, Tom Rini wrote:

On Wed, Oct 23, 2019 at 12:04:30PM -0600, Stephen Warren wrote:

On 10/23/19 11:29 AM, Stephen Warren wrote:

On 10/23/19 11:12 AM, Tom Rini wrote:

On Wed, Oct 23, 2019 at 11:03:38AM -0600, Stephen Warren wrote:

On 10/23/19 10:58 AM, Tom Rini wrote:

On Wed, Oct 23, 2019 at 10:55:57AM -0600, Stephen Warren wrote:

On 10/22/19 9:20 PM, Tom Rini wrote:

Now that we have moved to being based on pytest for
python3 we need to
make our test.py wrapper more robust in terms of only calling python3
rather than possibly finding and using python2.  To
do this, change from
execvp()'ing pytest to invoking the package itself
via python.  In the
event that pytest is unavailable we still get a user-friendly error:


I guess if this works, it's fine. But I think it'd work
just as well to
simply s/py.test/py.test-3/ in the existing code?


We can't because pip only provides "py.test" / "pytest" binaries.


Hmm. It sucks that virtualenv does things differently to Ubuntu
packaging
then. That means this series will probably break my test system, which
doesn't use virtualenv. I guess I'll apply it and see.


This should be what works everywhere tho.  Instead of hoping that
"py.test" will be the right python version we tell python3 to use the
pytest module it has.  So if you have system python3-pytest, that works,
if you (python3) pip install pytest locally, that works and if you
virtualenv + python3 + pip install pytest, that works.


On Ubuntu 16.04, with everything installed from Ubuntu packages rather
than using virtualenv, I get this:


+ ./src/u-boot/test/py/test.py --bd sandbox --build-dir 
/var/lib/jenkins/workspace/u-boot-github_swarren_u-boot-tegra_dev-test-py/U_BOOT_BOARD/sandbox/build/u-boot/sandbox
-k 'not sleep'
Traceback (most recent call last):
   File "./src/u-boot/test/py/test.py", line 20, in 
     sys.exit(load_entry_point('pytest', 'console_scripts',
'pytest')(args))
   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
line 542, in load_entry_point
     return get_distribution(dist).load_entry_point(group, name)
   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
line 2568, in load_entry_point
     raise ImportError("Entry point %r not found" % ((group, name),))
ImportError: Entry point ('console_scripts', 'pytest') not found



[swarren@swarren-lx1 u-boot]$ dpkg -l|grep py|grep test
ii  python-pytest    2.8.7-4
ii  python3-pytest   2.8.7-4


I guess that's much older than the pytest in requirements.txt (5.2.1!!).
While I think we can require a newish version of Python (3.5) since
that's widely available on supported OSs, I don't think we want to force
people to have a very new version of all the packages (which supported
distros don't package yet), or change they way they run pytest (by
requiring use of a virtualenv and requirements.txt) since that mechanism
isn't supported on old branches of U-Boot, which will then require all
kinds of special cases in scripts that invoke the U-Boot test system.


Ah. The issue is the name of the entry point; the last parameter to
load_entry_point(). "py.test" is supported everywhere, but only newer
versions of pytesst have a "pytest" entry point. Changing that parameter to
"py.test" makes the wrapper script work. Now every other test fails; I will
see if there's an easy fix for that or not.


We're going to have to make a cut-off point somewhere it looks like.
pytest 2.8.7 (which we had pinned to) is incompatible with pytest 4.x
and throws a lot of warnings I believe on pytest 3.x..

What I really want to avoid is the problem we have today where we've
actively pinned ourselves to a now quite out of date version and have a
lot of problems showing up.

So we aren't going to have one environment that works for history and
future but I am hoping / trying to plan such that if we have
requirements.txt we can say from here until the next new best practices
(which today would be using pipenv, but that starts out with pip install
pipenv, sigh...) we can say to use requirements.txt and for history,
python2 + pytest 2.8.7 and local setups could even dump that in to a
requirements.txt file if that makes scripting easier.


Indeed the pytest 4 changes were a lot of the problem, but there was 
plenty more. It turned out to be too painful to fix it all.


After a lot of pain, I've switched my system over to using a virtualenv 
when there's a test/py/requirements.txt file in the source. Using a 
virtualenv broke some of the HW remote control scripts, which were 
written for Python2 but just said "#!/usr/bin/env python". Fixing that 
to request Python 2 explicitly fixed that issue. Another pain was that 
the ftdi1 module (used by the HW remote control scripts) isn't available 
from pip so can't be installed in a virtualenv. Luckily explicitly using 
python2 for those scripts makes this irrelevant, since system libraries 
are used, since the python2 interpreter doesn't come from the virtualenv 
in that case. However, 

Re: [U-Boot] [RFC PATCH v2 00/18] arm: socfpga: gen5: move to DM

2019-10-23 Thread Simon Goldschmidt

Am 15.10.2019 um 22:10 schrieb Simon Goldschmidt:

This is an RFC series with the target to move SPL code from arch to
DM drivers.


I've sent a few patches of this series now as non-RFC, as I don't know 
if I will make it this merge window: I still have trouble getting the 
existing defconfigs into the 64 KB of SRAM for SPL :-(


Might need some work regarding size of DM in SPL...

Regards,
Simon



It is not finished, but I send this here for discussion mainly about
the devicetree format with the goal of keeping the various sub-
architectures (cyclone5, arria10, etc.) in the same style.

Patch 8 adds a C tool to convert existing gen5 qts handoff files to a
handoff dtsi. As an example, the last patch contains the handoff dtsi
for socfpga_socrates.

I have sent v1 some time ago, but this one has heavily changed and is
not finished, thus v2 but RFC. This series also is not edited to fix
patman warnings, yet.

Changes in v2:
- add dts based reset handling (messed up in v1)
- split this patch from v1 5/6
- split this patch from v1 5/6

Simon Goldschmidt (18):
   ddr: socfpga: gen5: constify altera_gen5_sdram_ops
   dts: arm: socfpga: add label for clkmgr
   arm: socfpga: gen5: increase SPL_SYS_MALLOC_F_LEN
   timer: dw-apb: add reset handling
   arm: socfpga: gen5: move initial reset handling to reset driver
   arm: dts: socfpga: add settings for gen5 clk driver
   arm: dts: socfpga: make clock nodes available in SPL
   socfpga: gen5: add new tool to create handoff dtsi files
   sdram: socfpga: gen5: make config structs dts compatible
   ddr: socfpga: gen5: fetch handoff information from 'of_to_platdata'
   ddr: socfpga: gen5: read handoff information from devicetree
   arm: socfpga: gen5: add readonly clk driver
   arm: socfpga: gen5: enable DM CLK
   arm: socfpga: gen5: move clock initialization to CLK driver
   arm: socfpga: gen5: load CLK config from devicetree
   spi: cadence_qspi: support DM_CLK
   arm: socfpga: gen5: parse qspi clock from devictree
   socfpga: gen5: move CLK and SDRAM to DM

  MAINTAINERS   |   1 +
  arch/arm/dts/socfpga-common-u-boot.dtsi   |  71 ++
  arch/arm/dts/socfpga.dtsi |   7 +-
  .../dts/socfpga_cyclone5_socrates-u-boot.dtsi |   1 +
  .../socfpga_cyclone5_socrates_handoff.dtsi| 290 +++
  arch/arm/mach-socfpga/Kconfig |   4 +-
  arch/arm/mach-socfpga/Makefile|   5 -
  arch/arm/mach-socfpga/clock_manager.c |  31 +-
  arch/arm/mach-socfpga/clock_manager_gen5.c| 528 -
  arch/arm/mach-socfpga/create_handoff_gen5.c   | 660 
  arch/arm/mach-socfpga/freeze_controller.c |  10 +-
  .../mach-socfpga/include/mach/clock_manager.h |   2 +
  .../include/mach/clock_manager_gen5.h |  14 -
  .../mach-socfpga/include/mach/sdram_gen5.h|  16 +-
  arch/arm/mach-socfpga/qts-to-handoff.sh   |  83 +++
  arch/arm/mach-socfpga/reset_manager_gen5.c|  13 -
  arch/arm/mach-socfpga/spl_gen5.c  |  29 +-
  arch/arm/mach-socfpga/wrap_pll_config.c   | 146 
  arch/arm/mach-socfpga/wrap_sdram_config.c | 318 
  drivers/clk/altera/Makefile   |   1 +
  drivers/clk/altera/clk-gen5.c | 705 ++
  drivers/ddr/altera/sdram_gen5.c   |  92 ++-
  drivers/ddr/altera/sequencer.c|  74 +-
  drivers/ddr/altera/sequencer.h|   9 +-
  drivers/reset/reset-socfpga.c |  37 +-
  drivers/spi/cadence_qspi.c|  20 +-
  drivers/timer/dw-apb-timer.c  |  18 +-
  include/configs/socfpga_common.h  |   5 -
  28 files changed, 2072 insertions(+), 1118 deletions(-)
  create mode 100644 arch/arm/dts/socfpga_cyclone5_socrates_handoff.dtsi
  delete mode 100644 arch/arm/mach-socfpga/clock_manager_gen5.c
  create mode 100644 arch/arm/mach-socfpga/create_handoff_gen5.c
  create mode 100755 arch/arm/mach-socfpga/qts-to-handoff.sh
  delete mode 100644 arch/arm/mach-socfpga/wrap_pll_config.c
  delete mode 100644 arch/arm/mach-socfpga/wrap_sdram_config.c
  create mode 100644 drivers/clk/altera/clk-gen5.c



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


Re: [U-Boot] [PATCH v2 07/41] board: ge: bx50v3: use imx wdt

2019-10-23 Thread Fabio Estevam
On Wed, Oct 23, 2019 at 3:22 PM Robert Beckett
 wrote:
>
> Enable DM imx WDT
> Enable SYSRESET_WATCHDOG to maintain WDT based reset ability
>
> Signed-off-by: Robert Beckett 
> ---
>  arch/arm/dts/imx6q-bx50v3.dts | 4 
>  configs/ge_bx50v3_defconfig   | 3 +++
>  2 files changed, 7 insertions(+)
>
> diff --git a/arch/arm/dts/imx6q-bx50v3.dts b/arch/arm/dts/imx6q-bx50v3.dts
> index 28a35394f0..2e2e3bbc24 100644
> --- a/arch/arm/dts/imx6q-bx50v3.dts
> +++ b/arch/arm/dts/imx6q-bx50v3.dts
> @@ -18,6 +18,10 @@
> ethernet0 = 
> };
>
> +   wdt-reboot {
> +   compatible = "wdt-reboot";
> +   wdt = <>;
> +   };
>  };

Looking at  arch/arm/boot/dts/imx6q-bx50v3.dtsi from Linux, which
includes arch/arm/boot/dts/imx6q-bx50v3.dtsi, the wdog definition is
present:

 {
pinctrl-names = "default";
pinctrl-0 = <_wdog>;
fsl,ext-reset-output;
};

So it would be better just use the same bindings in U-Boot without the
need of deviating the device tree.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] socfpga: fix include guard in misc.h (arch vs. global)

2019-10-23 Thread Simon Goldschmidt
The file arch/arm/mach-socfpga/include/mach/misc.h used the same include
guard as the global include/misc.h.

Fix this by giving the arch file an arch prefix.

Signed-off-by: Simon Goldschmidt 
---

 arch/arm/mach-socfpga/include/mach/misc.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-socfpga/include/mach/misc.h 
b/arch/arm/mach-socfpga/include/mach/misc.h
index 27d0b6a370..f11f907e1c 100644
--- a/arch/arm/mach-socfpga/include/mach/misc.h
+++ b/arch/arm/mach-socfpga/include/mach/misc.h
@@ -3,8 +3,8 @@
  * Copyright (C) 2016-2017 Intel Corporation
  */
 
-#ifndef _MISC_H_
-#define _MISC_H_
+#ifndef _SOCFPGA_MISC_H_
+#define _SOCFPGA_MISC_H_
 
 #include 
 
@@ -42,4 +42,4 @@ void socfpga_sdram_remap_zero(void);
 void do_bridge_reset(int enable, unsigned int mask);
 void socfpga_pl310_clear(void);
 
-#endif /* _MISC_H_ */
+#endif /* _SOCFPGA_MISC_H_ */
-- 
2.20.1

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


Re: [U-Boot] [PATCH v2 00/41] convert GE boards to DM

2019-10-23 Thread Fabio Estevam
Hi Robert,

On Wed, Oct 23, 2019 at 3:23 PM Robert Beckett
 wrote:
>
> This patch series converts GE boards to use DM features.
> Most of the patches are GE board specific to modify the board code to
> use the DM drivers, or modify the device tree.


I think this series could be simplified if you send an initial patch
syncing the imx53-ppd and imx6q-bx50v3.dts from U-Boot and Linux.
>
> There are a few new features:
>
> patch 11 & 12: Add i2c_eeprom partitioning via device tree
>
> patch 16: Adds an i2c chip addr offset overflow mask to allow offsets to
> effectively steal chip addresses. This handles a common i2c addressing
> mode used on various devices.
>
> patch 17: Improves i2c testing by giving test direct visibility of chip
> address and offset, and fixing a couple of issues.
>
> patch 18: Adds an i2c test for the new addressing mode from patch 16.
>
> patch 19: Updates i2c eeprom to use the new addressing mode added in
> patch 16.
>
> patch 20: Add i2c eeprom bootcount driver
>
> patch 38-40: Add Martin Fuzzey's DA9063 PMIC driver with modifications
> to use the new i2c addressing mode from patch 16 and a bit of a cleanup.
>
>
> v1->v2:
> - Integrate Martin's PMIC driver in place of the one from v1.
> - Handle feedback from v1 w.r.t i2c addressing mode (improve documentation,
>   improve i2c testing, add new i2c tests)
>
> Denis Zalevskiy (2):
>   configs: ppd: DM for USB and regulators PPD
>   board: ge: bx50v3: Enable DM for PCI and ethernet
>
> Ian Ray (8):
>   configs: bx50v3: Fix boot hang with video
>   board: ge: bx50v3: Fix run-time warning
>   board: ge: bx50v3: Fix message output to video console
>   board: ge: pass rtc_status via device tree
>   board: ge: mx53ppd: move uart initialisation to own function
>   board: ge: mx53ppd: enable DM_VIDEO
>   rtc: s35392a: encode command correctly
>   board: ge: mx53ppd: fix RTC compatible definition
>
> Martin Fuzzey (3):
>   pmic: allow dump command for non contiguous register maps
>   power: pmic: add driver for Dialog DA9063 PMIC
>   power: regulator: add driver for Dialog DA9063 PMIC
>
> Robert Beckett (28):
>   board: ge: bx50v3: use imx wdt
>   board: ge: mx53ppd: use imx wdt
>   board: ge: bx50v3: Add i2c bus description
>   board: ge: mx53ppd: Add i2c bus descritpion
>   misc: i2c_eeprom: add fixed partitions support
>   misc: i2c_eeprom: add size query
>   board: ge: bx50v3: use DM I2C
>   board: ge: mx53ppd: use DM I2C
>   board: ge: convert vpd to use i2c eeprom
>   i2c: add support for offset overflow in to address
>   dm: i2c: EEPROM simulator allow tests visibility of addr and offset
>   dm: i2c: EEPROM simulator add tests for addr offset mask
>   misc: i2c_eeprom: set offset len and chip addr offset mask
>   bootcount: add a DM i2c eeprom backing store for bootcount
>   board: ge: bx50v3: add i2c eeprom bootcount storage
>   board: ge: mx53ppd: add i2c eeprom bootcount storage
>   rtc: rx8010sj: fix DM initialization
>   board: ge: bx50v3, mx53ppd: use DM rtc
>   board: ge: bx50v3: use DM i2c for PMIC initialization
>   board: ge: mx53ppd: remove redundant power config
>   board: ge: bx50v3, mx53ppd: disable I2C compatibility API
>   board: ge: bx50v3: Enable DM PWM for backlight
>   board: ge: mx53ppd: clean up DM PWM video and backlight
>   board: ge: mx53ppd: Use DM for ethernet
>   board: ge: bx50v3: use DM for uart
>   serial: mxc: add imx53 and imx21 compatible string
>   board: ge: mx53ppd: use DM for uart
>   board: ge: bx50v3: use DM PMIC driver
>
>  arch/arm/dts/imx53-ppd.dts   | 317 ++
>  arch/arm/dts/imx6q-bx50v3.dts| 529 +++
>  arch/sandbox/include/asm/test.h  |   7 +
>  board/ge/bx50v3/Kconfig  |   2 -
>  board/ge/bx50v3/bx50v3.c | 291 -
>  board/ge/common/Kconfig  |  14 -
>  board/ge/common/ge_common.c  |  33 +-
>  board/ge/common/vpd_reader.c |  37 ++-
>  board/ge/mx53ppd/Kconfig |   2 -
>  board/ge/mx53ppd/Makefile|   2 +-
>  board/ge/mx53ppd/mx53ppd.c   |  75 +
>  board/ge/mx53ppd/mx53ppd_video.c | 125 +++-
>  board/ge/mx53ppd/ppd_gpio.h  |   8 -
>  cmd/pmic.c   |  12 +-
>  configs/ge_bx50v3_defconfig  |  40 ++-
>  configs/mx53ppd_defconfig|  35 +-
>  drivers/bootcount/Kconfig|  10 +
>  drivers/bootcount/Makefile   |   1 +
>  drivers/bootcount/i2c-eeprom.c   |  95 ++
>  drivers/i2c/i2c-uclass.c |  34 +-
>  drivers/misc/i2c_eeprom.c| 278 ++--
>  drivers/misc/i2c_eeprom_emul.c   |  80 +++--
>  drivers/power/pmic/Kconfig   |   7 +
>  drivers/power/pmic/Makefile  |   1 +
>  drivers/power/pmic/da9063.c  | 130 
>  drivers/power/regulator/Kconfig  |  10 +
>  drivers/power/regulator/Makefile |   1 +
>  drivers/power/regulator/da9063.c | 388 +++
>  drivers/rtc/rx8010sj.c   |   2 +-
>  drivers/rtc/s35392a.c|  27 +-
>  drivers/serial/serial_mxc.c  |   2 +
>  

[U-Boot] [PATCH] spi: cadence_qspi: support DM_CLK

2019-10-23 Thread Simon Goldschmidt
Support loading clk speed via DM instead of requiring ad-hoc code.

Signed-off-by: Simon Goldschmidt 
---

 drivers/spi/cadence_qspi.c | 20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
index e2e54cd277..0b89115885 100644
--- a/drivers/spi/cadence_qspi.c
+++ b/drivers/spi/cadence_qspi.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -22,12 +23,27 @@ static int cadence_spi_write_speed(struct udevice *bus, 
uint hz)
 {
struct cadence_spi_platdata *plat = bus->platdata;
struct cadence_spi_priv *priv = dev_get_priv(bus);
+   unsigned int ref_clk_hz;
+   struct clk clk;
+   int ret;
+
+   ret = clk_get_by_index(bus, 0, );
+   if (ret) {
+#ifdef CONFIG_CQSPI_REF_CLK
+   ref_clk_hz = CONFIG_CQSPI_REF_CLK;
+#else
+   return ret;
+#endif
+   } else {
+   ref_clk_hz = clk_get_rate();
+   clk_free();
+   }
 
cadence_qspi_apb_config_baudrate_div(priv->regbase,
-CONFIG_CQSPI_REF_CLK, hz);
+ref_clk_hz, hz);
 
/* Reconfigure delay timing if speed is changed. */
-   cadence_qspi_apb_delay(priv->regbase, CONFIG_CQSPI_REF_CLK, hz,
+   cadence_qspi_apb_delay(priv->regbase, ref_clk_hz, hz,
   plat->tshsl_ns, plat->tsd2d_ns,
   plat->tchsh_ns, plat->tslch_ns);
 
-- 
2.20.1

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


[U-Boot] [PATCH] timer: dw-apb: add reset handling

2019-10-23 Thread Simon Goldschmidt
To use this DM timer on socfpga as system tick, it needs to take itself
out of reset.

Signed-off-by: Simon Goldschmidt 
---

 drivers/timer/dw-apb-timer.c | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/timer/dw-apb-timer.c b/drivers/timer/dw-apb-timer.c
index 86312b8dc7..fad22be8c9 100644
--- a/drivers/timer/dw-apb-timer.c
+++ b/drivers/timer/dw-apb-timer.c
@@ -8,6 +8,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -18,7 +19,8 @@
 #define DW_APB_CTRL0x8
 
 struct dw_apb_timer_priv {
-   fdt_addr_t  regs;
+   fdt_addr_t regs;
+   struct reset_ctl_bulk resets;
 };
 
 static int dw_apb_timer_get_count(struct udevice *dev, u64 *count)
@@ -42,6 +44,12 @@ static int dw_apb_timer_probe(struct udevice *dev)
struct clk clk;
int ret;
 
+   ret = reset_get_bulk(dev, >resets);
+   if (ret)
+   dev_warn(dev, "Can't get reset: %d\n", ret);
+   else
+   reset_deassert_bulk(>resets);
+
ret = clk_get_by_index(dev, 0, );
if (ret)
return ret;
@@ -67,6 +75,13 @@ static int dw_apb_timer_ofdata_to_platdata(struct udevice 
*dev)
return 0;
 }
 
+static int dw_apb_timer_remove(struct udevice *dev)
+{
+   struct dw_apb_timer_priv *priv = dev_get_priv(dev);
+
+   return reset_release_bulk(>resets);
+}
+
 static const struct timer_ops dw_apb_timer_ops = {
.get_count  = dw_apb_timer_get_count,
 };
@@ -83,5 +98,6 @@ U_BOOT_DRIVER(dw_apb_timer) = {
.probe  = dw_apb_timer_probe,
.of_match   = dw_apb_timer_ids,
.ofdata_to_platdata = dw_apb_timer_ofdata_to_platdata,
+   .remove = dw_apb_timer_remove,
.priv_auto_alloc_size = sizeof(struct dw_apb_timer_priv),
 };
-- 
2.20.1

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


[U-Boot] [PATCH] ddr: socfpga: gen5: constify altera_gen5_sdram_ops

2019-10-23 Thread Simon Goldschmidt
Make the function pointer struct const, as it does not need to be
writable. This doesn't really change anything other than moving this
variable to a different section. No functional change.

Signed-off-by: Simon Goldschmidt 
---

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

diff --git a/drivers/ddr/altera/sdram_gen5.c b/drivers/ddr/altera/sdram_gen5.c
index fcd89b619d..8c8ea19eb9 100644
--- a/drivers/ddr/altera/sdram_gen5.c
+++ b/drivers/ddr/altera/sdram_gen5.c
@@ -626,7 +626,7 @@ static int altera_gen5_sdram_get_info(struct udevice *dev,
return 0;
 }
 
-static struct ram_ops altera_gen5_sdram_ops = {
+static const struct ram_ops altera_gen5_sdram_ops = {
.get_info = altera_gen5_sdram_get_info,
 };
 
-- 
2.20.1

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


Re: [U-Boot] [PATCH] Makefile: Fix printing problem in size_check on overflow

2019-10-23 Thread Simon Goldschmidt

Am 23.10.2019 um 21:39 schrieb Tom Rini:

When we have an excess size growth, fix the "limit" printf call to pass
in just the limit variable rather than the string bytes to the format
character.

Signed-off-by: Tom Rini 


Reviewed-by: Simon Goldschmidt 


---
  Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index cbacf1cfe2c9..f09023a3977f 100644
--- a/Makefile
+++ b/Makefile
@@ -346,7 +346,7 @@ define size_check
limit=$$( printf "%d" $2 ); \
if test $$actual -gt $$limit; then \
echo "$1 exceeds file size limit:" >&2; \
-   echo "  limit:  $$(printf %#x bytes $$limit) bytes" >&2; \
+   echo "  limit:  $$(printf %#x $$limit) bytes" >&2; \
echo "  actual: $$(printf %#x $$actual) bytes" >&2; \
echo "  excess: $$(printf %#x $$((actual - limit))) bytes" >&2;\
exit 1; \



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


[U-Boot] [PATCH v4 4/7] Makefile: rockchip: Use u-boot preferred spl name

2019-10-23 Thread Jagan Teki
Most of the platforms uses the platform type and particular
boot stage on their image naming conventions in makefile
like,

u-boot-sunxi-with-spl.bin - Allwinner U-Boot with SPL
u-boot-spl-mtk.bin - Mediatek SPL bin

This would help to understand the users to what that
particular image belongs to? and less confused.

On that note, use u-boot-spl-rockchip.bin instead of
idbloader.img. idbloader.img is still a proper naming
for rockchip external documentation but u-boot preferred
spl name would always good choice in upstream tree.

Also, bin is more conventional way to include it on tools
like binman, pad_cat etc in future patches.

Note: usage of platform type, boot stage doesn't follow
consistent oder as of now.

Signed-off-by: Jagan Teki 
---
 Makefile | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index b58107d6ef..a4278170d4 100644
--- a/Makefile
+++ b/Makefile
@@ -887,7 +887,7 @@ ALL-y += u-boot-with-dtb.bin
 endif
 
 ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy)
-ALL-y += idbloader.img
+ALL-y += u-boot-spl-rockchip.bin
 endif
 
 LDFLAGS_u-boot += $(LDFLAGS_FINAL)
@@ -1347,11 +1347,11 @@ ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
 MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T 
$(ROCKCHIP_IMG_TYPE)
 tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
$(call if_changed,mkimage)
-idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
+u-boot-spl-rockchip.bin: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
$(call if_changed,cat)
 else
-MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
-idbloader.img: spl/u-boot-spl.bin FORCE
+MKIMAGEFLAGS_u-boot-spl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T 
$(ROCKCHIP_IMG_TYPE)
+u-boot-spl-rockchip.bin: spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
 endif
 
-- 
2.18.0.321.gffc6fa0e3

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


[U-Boot] [PATCH v4 6/7] rockchip: Add Single boot image (with binman, pad_cat)

2019-10-23 Thread Jagan Teki
All rockchip platforms support TPL or SPL-based bootloader
in mainline with U-Boot proper as final stage. For each
stage we need to burn the image on to flash with respective
offsets.

This patch creates a single boot image component using
- binman, for arm32 rockchip platforms
- pad_cat, for arm64 rockchip platforms.

This would help users to get rid of burning different
boot stage images.

The new image called 'u-boot-rockchip.bin'
which can burn into flash like:

₹ sudo dd if=u-boot-rockchip.bin of=/dev/sda seek=64

This would support all rockchip platforms, except rk3128
since it doesn't support for SPL yet.

Cc: Kever Yang 
Cc: Matwey V. Kornilov 
Signed-off-by: Jagan Teki 
---
 Makefile  | 18 ++
 arch/arm/Kconfig  |  1 +
 arch/arm/dts/rk3036-u-boot.dtsi   |  2 ++
 arch/arm/dts/rk3288-u-boot.dtsi   |  2 ++
 arch/arm/dts/rockchip-u-boot.dtsi | 21 +
 include/configs/rockchip-common.h |  2 ++
 6 files changed, 42 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/dts/rockchip-u-boot.dtsi

diff --git a/Makefile b/Makefile
index a4278170d4..6c70106c6e 100644
--- a/Makefile
+++ b/Makefile
@@ -887,7 +887,7 @@ ALL-y += u-boot-with-dtb.bin
 endif
 
 ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy)
-ALL-y += u-boot-spl-rockchip.bin
+ALL-y += u-boot-rockchip.bin
 endif
 
 LDFLAGS_u-boot += $(LDFLAGS_FINAL)
@@ -1347,15 +1347,25 @@ ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
 MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T 
$(ROCKCHIP_IMG_TYPE)
 tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
$(call if_changed,mkimage)
-u-boot-spl-rockchip.bin: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
+spl/u-boot-spl-rockchip.bin: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin 
FORCE
$(call if_changed,cat)
 else
 MKIMAGEFLAGS_u-boot-spl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T 
$(ROCKCHIP_IMG_TYPE)
-u-boot-spl-rockchip.bin: spl/u-boot-spl.bin FORCE
+spl/u-boot-spl-rockchip.bin: spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
 endif
 
-endif
+ifeq ($(CONFIG_ARM64),)
+u-boot-rockchip.bin: spl/u-boot-spl-rockchip.bin u-boot.img FORCE
+   $(call if_changed,binman)
+else
+OBJCOPYFLAGS_u-boot-rockchip.bin = -I binary -O binary \
+   --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
+u-boot-rockchip.bin: spl/u-boot-spl-rockchip.bin u-boot.itb FORCE
+   $(call if_changed,pad_cat)
+endif # CONFIG_ARM64
+
+endif # CONFIG_ARCH_ROCKCHIP
 
 ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
 MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1df2aba3c2..8107414626 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1594,6 +1594,7 @@ config ARCH_STM32MP
 config ARCH_ROCKCHIP
bool "Support Rockchip SoCs"
select BLK
+   select BINMAN if !ARM64
select DM
select DM_GPIO
select DM_I2C
diff --git a/arch/arm/dts/rk3036-u-boot.dtsi b/arch/arm/dts/rk3036-u-boot.dtsi
index 1e7d079315..41ac054b81 100644
--- a/arch/arm/dts/rk3036-u-boot.dtsi
+++ b/arch/arm/dts/rk3036-u-boot.dtsi
@@ -2,3 +2,5 @@
 /*
  * Copyright (C) 2019 Jagan Teki 
  */
+
+#include "rockchip-u-boot.dtsi"
diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
index 3f00a3b6d3..6d31735362 100644
--- a/arch/arm/dts/rk3288-u-boot.dtsi
+++ b/arch/arm/dts/rk3288-u-boot.dtsi
@@ -3,6 +3,8 @@
  * Copyright (C) 2019 Rockchip Electronics Co., Ltd
  */
 
+#include "rockchip-u-boot.dtsi"
+
 / {
chosen {
u-boot,spl-boot-order = \
diff --git a/arch/arm/dts/rockchip-u-boot.dtsi 
b/arch/arm/dts/rockchip-u-boot.dtsi
new file mode 100644
index 00..bc0b1412a2
--- /dev/null
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki 
+ */
+
+#include 
+
+/ {
+   binman {
+   filename = "u-boot-rockchip.bin";
+   pad-byte = <0xff>;
+
+   blob {
+   filename = "spl/u-boot-spl-rockchip.bin";
+   };
+
+   u-boot-img {
+   offset = ;
+   };
+   };
+};
diff --git a/include/configs/rockchip-common.h 
b/include/configs/rockchip-common.h
index 68e1105a4b..d7f5ca9fa4 100644
--- a/include/configs/rockchip-common.h
+++ b/include/configs/rockchip-common.h
@@ -9,6 +9,8 @@
 
 #define CONFIG_SYS_NS16550_MEM32
 
+#define CONFIG_SPL_PAD_TO  8355840
+
 #ifndef CONFIG_SPL_BUILD
 
 /* First try to boot from SD (index 0), then eMMC (index 1) */
-- 
2.18.0.321.gffc6fa0e3

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


[U-Boot] [PATCH v4 5/7] arm: dts: rk3036: Add rk3036-u-boot.dtsi

2019-10-23 Thread Jagan Teki
Add U-Boot specific dtsi file for rk3036 SoC. This
would help to add U-Boot specific dts nodes, properties
which are common across rk3036.

Right now, the file is empty, will add required changes
in future patches.

Signed-off-by: Jagan Teki 
---
 arch/arm/dts/rk3036-sdk-u-boot.dtsi | 2 ++
 arch/arm/dts/rk3036-u-boot.dtsi | 4 
 2 files changed, 6 insertions(+)
 create mode 100644 arch/arm/dts/rk3036-u-boot.dtsi

diff --git a/arch/arm/dts/rk3036-sdk-u-boot.dtsi 
b/arch/arm/dts/rk3036-sdk-u-boot.dtsi
index 6f15f4a8ec..754800c6e6 100644
--- a/arch/arm/dts/rk3036-sdk-u-boot.dtsi
+++ b/arch/arm/dts/rk3036-sdk-u-boot.dtsi
@@ -1,3 +1,5 @@
+#include "rk3036-u-boot.dtsi"
+
  {
u-boot,dm-pre-reloc;
 };
diff --git a/arch/arm/dts/rk3036-u-boot.dtsi b/arch/arm/dts/rk3036-u-boot.dtsi
new file mode 100644
index 00..1e7d079315
--- /dev/null
+++ b/arch/arm/dts/rk3036-u-boot.dtsi
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki 
+ */
-- 
2.18.0.321.gffc6fa0e3

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


[U-Boot] [PATCH v4 7/7] doc: boards: Add rockchip documentation

2019-10-23 Thread Jagan Teki
Rockchip has documentation file, doc/README.rockchip but
which is not so readable to add or understand the existing
contents. Even the format that support is legacy readme
in U-Boot.

Add rockchip specific documentation file using new rst
format, which describes the information about Rockchip
supported boards and it's usage steps.

Added minimal information about rk3288, rk3328, rk3368
and rk3399 boards and usage. This would indeed updated
further based on the requirements and updates.

Cc: Kever Yang 
Cc: Matwey V. Kornilov 
Signed-off-by: Jagan Teki 
---
 doc/board/rockchip/index.rst|  10 +++
 doc/board/rockchip/rockchip.rst | 128 
 2 files changed, 138 insertions(+)
 create mode 100644 doc/board/rockchip/index.rst
 create mode 100644 doc/board/rockchip/rockchip.rst

diff --git a/doc/board/rockchip/index.rst b/doc/board/rockchip/index.rst
new file mode 100644
index 00..0c377e9bbb
--- /dev/null
+++ b/doc/board/rockchip/index.rst
@@ -0,0 +1,10 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. Copyright (C) 2019 Jagan Teki 
+
+Rockchip
+
+
+.. toctree::
+   :maxdepth: 2
+
+   rockchip
diff --git a/doc/board/rockchip/rockchip.rst b/doc/board/rockchip/rockchip.rst
new file mode 100644
index 00..625155e432
--- /dev/null
+++ b/doc/board/rockchip/rockchip.rst
@@ -0,0 +1,128 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. Copyright (C) 2019 Jagan Teki 
+
+ROCKCHIP
+
+
+About this
+--
+
+This document describes the information about Rockchip supported boards
+and it's usage steps.
+
+Rockchip boards
+---
+
+Rockchip is SoC solutions provider for tablets & PCs, streaming media
+TV boxes, AI audio & vision, IoT hardware.
+
+A wide range of Rockchip SoCs with associated boardsare supported in
+mainline U-Boot.
+
+List of mainline supported rockchip boards:
+
+* rk3288
+ - Evb-RK3288
+ - Firefly-RK3288
+ - mqmaker MiQi
+ - Phytec RK3288 PCM-947
+ - PopMetal-RK3288
+ - Radxa Rock 2 Square
+ - Tinker-RK3288
+ - Google Jerry
+ - Google Mickey
+ - Google Minnie
+ - Google Speedy
+ - Amarula Vyasa-RK3288
+* rk3328
+ - Rockchip RK3328 EVB
+ - Pine64 Rock64
+* rk3368
+ - GeekBox
+ - PX5 EVB
+ - Rockchip sheep board
+ - Theobroma Systems RK3368-uQ7 SoM
+* rk3399
+ - 96boards RK3399 Ficus
+ - 96boards Rock960
+ - Firefly-RK3399 Board
+ - Firefly ROC-RK3399-PC Board
+ - FriendlyElec NanoPC-T4
+ - FriendlyElec NanoPi M4
+ - FriendlyARM NanoPi NEO4
+ - Google Bob
+ - Khadas Edge
+ - Khadas Edge-Captain
+ - Khadas Edge-V
+ - Orange Pi RK3399 Board
+ - Pine64 RockPro64
+ - Radxa ROCK Pi 4
+ - Rockchip RK3399 Evaluation Board
+ - Theobroma Systems RK3399-Q7 SoM
+
+Building
+
+
+TF-A
+
+
+TF-A would require to build for ARM64 Rockchip SoCs platforms.
+
+To build TF-A::
+
+git clone https://github.com/ARM-software/arm-trusted-firmware.git
+cd arm-trusted-firmware
+make realclean
+make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399
+
+Specify the PLAT= with desired rockchip platform to build TF-A for.
+
+U-Boot
+^^
+
+To build rk3328 boards::
+
+export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
+make evb-rk3328_defconfig
+make
+
+To build rk3288 boards::
+
+make evb-rk3288_defconfig
+make
+
+To build rk3368 boards::
+
+export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
+make evb-px5_defconfig
+make
+
+To build rk3399 boards::
+
+export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
+make evb-rk3399_defconfig
+make
+
+Flashing
+
+
+SD Card
+^^^
+
+All rockchip platforms, except rk3128 (which doesn't use SPL) are now
+supporting single boot image using binman and pad_cat.
+
+To write an image that boots from an SD card (assumed to be /dev/sda)::
+
+sudo dd if=u-boot-rockchip.bin of=/dev/sda seek=64
+sync
+
+TODO
+
+
+- Add rockchip idbloader image building
+- Describe steps for eMMC flashing
+- Add missing SoC's with it boards list
+
+.. Jagan Teki 
+.. Thu Oct 17 22:36:14 IST 2019
-- 
2.18.0.321.gffc6fa0e3

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


[U-Boot] [PATCH v4 3/7] Makefile: rockchip: Support SPL-alone mkimage

2019-10-23 Thread Jagan Teki
Add SPL-alone mkimage tooling support via Makefile for
few platforms or boards used in rockchip family.

With this users would get rid of explicitly creating
mkimage tool for rockchip rksd or rkspi boot modes.

Signed-off-by: Jagan Teki 
---
 Makefile | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 40cbf68fef..b58107d6ef 100644
--- a/Makefile
+++ b/Makefile
@@ -886,7 +886,7 @@ ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy)
 ALL-y += u-boot-with-dtb.bin
 endif
 
-ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL)$(CONFIG_TPL),yyy)
+ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy)
 ALL-y += idbloader.img
 endif
 
@@ -1342,11 +1342,19 @@ else
 ROCKCHIP_IMG_TYPE := rksd
 endif
 
+# TPL + SPL
+ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
 MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T 
$(ROCKCHIP_IMG_TYPE)
 tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
$(call if_changed,mkimage)
 idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
$(call if_changed,cat)
+else
+MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
+idbloader.img: spl/u-boot-spl.bin FORCE
+   $(call if_changed,mkimage)
+endif
+
 endif
 
 ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
-- 
2.18.0.321.gffc6fa0e3

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


[U-Boot] [PATCH v4 2/7] Makefile: rockchip: Suffix platform type with tpl name

2019-10-23 Thread Jagan Teki
Most of the platforms uses the platform type on their boot
stage image naming conventions in makefile like,

u-boot-x86-start16-tpl.bin - x86 start16 TPL bin
u-boot-spl-mtk.bin - Mediatek SPL bin

This would help to understand the users to what that
particular image belongs to? and less confused.

On that note, suffix platform type rockchip for existing
u-boot-tpl.img so now it become u-boot-tpl-rockchip.bin

Also, bin is more conventional way to include it on tools
like binman, pad_cat etc in future patches.

Note: usage of platform type doesn't follow consistent order
as of now.

Signed-off-by: Jagan Teki 
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 3e05d3fcfe..40cbf68fef 100644
--- a/Makefile
+++ b/Makefile
@@ -1342,10 +1342,10 @@ else
 ROCKCHIP_IMG_TYPE := rksd
 endif
 
-MKIMAGEFLAGS_u-boot-tpl.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
-tpl/u-boot-tpl.img: tpl/u-boot-tpl.bin FORCE
+MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T 
$(ROCKCHIP_IMG_TYPE)
+tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
$(call if_changed,mkimage)
-idbloader.img: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE
+idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
$(call if_changed,cat)
 endif
 
-- 
2.18.0.321.gffc6fa0e3

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


[U-Boot] [PATCH v4 1/7] Makefile: Add rockchip image type

2019-10-23 Thread Jagan Teki
Add rockchip image type support. right now the image
type marked with rksd, So create image type variable
with required image type like rksd or rkspi.

Cc: Kever Yang 
Cc: Matwey V. Kornilov 
Signed-off-by: Jagan Teki 
---
 Makefile | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 6fda3268e7..3e05d3fcfe 100644
--- a/Makefile
+++ b/Makefile
@@ -1334,7 +1334,15 @@ u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
$(call if_changed,pad_cat)
 
 ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
-MKIMAGEFLAGS_u-boot-tpl.img = -n $(CONFIG_SYS_SOC) -T rksd
+
+# rockchip image type
+ifeq ($(CONFIG_SPI_FLASH_SUPPORT),y)
+ROCKCHIP_IMG_TYPE := rkspi
+else
+ROCKCHIP_IMG_TYPE := rksd
+endif
+
+MKIMAGEFLAGS_u-boot-tpl.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
 tpl/u-boot-tpl.img: tpl/u-boot-tpl.bin FORCE
$(call if_changed,mkimage)
 idbloader.img: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE
-- 
2.18.0.321.gffc6fa0e3

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


[U-Boot] [PATCH v4 0/7] rockchip: Add Binman support

2019-10-23 Thread Jagan Teki
This is v4 set for Binman support in rockchip, [1] here is
previous patchset.

This series add single boot image with binman for arm32 and
pad_cat for arm64 rockchip platforms both TPL + SPL and SPL-alone
targets.

Changes for v4:
- support all rockchip platforms
- add new patches for dtsi changes
- update documentation
- format proper commit message
- rebase on master
Changes for v3:
- rebase on master
- add binman for rk3288, rk3328, rk3368, rk3399
- added rst documentation for rockchip
Changes for v2:
- Add few clean target patches
- update bl31.elf env handling code, with logging
- support puma itb, via BL31 and PMUM0 env
- enable BUILD_TARGET for ROCKCHIP_RK3399
- add patch to build rockchip dtbs based on SoC types

[1] https://patchwork.ozlabs.org/cover/1178957/

Jagan Teki (7):
  Makefile: Add rockchip image type
  Makefile: rockchip: Suffix platform type with tpl name
  Makefile: rockchip: Support SPL-alone mkimage
  Makefile: rockchip: Use u-boot preferred spl name
  arm: dts: rk3036: Add rk3036-u-boot.dtsi
  rockchip: Add Single boot image (with binman, pad_cat)
  doc: boards: Add rockchip documentation

 Makefile|  36 ++--
 arch/arm/Kconfig|   1 +
 arch/arm/dts/rk3036-sdk-u-boot.dtsi |   2 +
 arch/arm/dts/rk3036-u-boot.dtsi |   6 ++
 arch/arm/dts/rk3288-u-boot.dtsi |   2 +
 arch/arm/dts/rockchip-u-boot.dtsi   |  21 +
 doc/board/rockchip/index.rst|  10 +++
 doc/board/rockchip/rockchip.rst | 128 
 include/configs/rockchip-common.h   |   2 +
 9 files changed, 203 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/dts/rk3036-u-boot.dtsi
 create mode 100644 arch/arm/dts/rockchip-u-boot.dtsi
 create mode 100644 doc/board/rockchip/index.rst
 create mode 100644 doc/board/rockchip/rockchip.rst

-- 
2.18.0.321.gffc6fa0e3

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


Re: [U-Boot] [PATCH] spl: fix SPI config dependencies

2019-10-23 Thread Jagan Teki
On Wed, Oct 23, 2019 at 1:35 AM Simon Goldschmidt
 wrote:
>
> As SPL_SPI_FLASH_SUPPORT cannot work without SPL_SPI_SUPPORT, fix
> dependencies to prevent enabling SPI flash support without basic SPI
> support.
>
> Also SYS_SPI_U_BOOT_OFFS does not make sense without
> SPL_SPI_FLASH_SUPPORT enabled, so move it into its 'if' section.
>
> Signed-off-by: Simon Goldschmidt 
> ---

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


Re: [U-Boot] [PATCH] configs: spi: Miss the SPI_FLASH_BAR for ESPI

2019-10-23 Thread Jagan Teki
On Tue, Oct 22, 2019 at 3:21 PM Xiaowei Bao  wrote:
>
>
>
> > -Original Message-
> > From: Priyanka Jain 
> > Sent: 2019年10月22日 17:45
> > To: Xiaowei Bao ; Jagdish Gediya
> > ; ja...@amarulasolutions.com;
> > u-boot@lists.denx.de
> > Cc: Xiaowei Bao 
> > Subject: RE: [U-Boot] [PATCH] configs: spi: Miss the SPI_FLASH_BAR for ESPI
> >
> >
> >
> > >-Original Message-
> > >From: U-Boot  On Behalf Of Xiaowei Bao
> > >Sent: Monday, October 21, 2019 2:32 PM
> > >To: Jagdish Gediya ;
> > >ja...@amarulasolutions.com; u-boot@lists.denx.de
> > >Cc: Xiaowei Bao 
> > >Subject: [U-Boot] [PATCH] configs: spi: Miss the SPI_FLASH_BAR for ESPI
> > configs: spi:  -> spi: Kconfig
> >
> > I understand you are adding config, because you have missed it earlier.
> > But better would be something like Miss->Add
>
> Thanks for your comments, this CONFIG option is missed by Jagan Teki, so I 
> add it
> in Kconfig file, otherwise, the ESPI will not work in some PPC board.

Did I miss while moving around? please mark the commit where it missed
it would help to track where the issue comes from.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] Makefile: Fix printing problem in size_check on overflow

2019-10-23 Thread Tom Rini
When we have an excess size growth, fix the "limit" printf call to pass
in just the limit variable rather than the string bytes to the format
character.

Signed-off-by: Tom Rini 
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index cbacf1cfe2c9..f09023a3977f 100644
--- a/Makefile
+++ b/Makefile
@@ -346,7 +346,7 @@ define size_check
limit=$$( printf "%d" $2 ); \
if test $$actual -gt $$limit; then \
echo "$1 exceeds file size limit:" >&2; \
-   echo "  limit:  $$(printf %#x bytes $$limit) bytes" >&2; \
+   echo "  limit:  $$(printf %#x $$limit) bytes" >&2; \
echo "  actual: $$(printf %#x $$actual) bytes" >&2; \
echo "  excess: $$(printf %#x $$((actual - limit))) bytes" >&2;\
exit 1; \
-- 
2.17.1

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


Re: [U-Boot] [PATCH] spi-nor-ids: Add support for Adesto AT25SL321

2019-10-23 Thread Jagan Teki
On Mon, Oct 21, 2019 at 7:21 PM Fabio Estevam  wrote:
>
> From: Fabio Estevam 
>
> Add an entry for the Adesto AT25SL321 SPI NOR chip.
>
> This SPI NOR chip is found in the Embedded Artist i.MX7ULP COM board.
>
> Signed-off-by: Fabio Estevam 
> ---
>  drivers/mtd/spi/spi-nor-ids.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c
> index 6996c0a286..cf194770d7 100644
> --- a/drivers/mtd/spi/spi-nor-ids.c
> +++ b/drivers/mtd/spi/spi-nor-ids.c
> @@ -76,6 +76,7 @@ const struct flash_info spi_nor_ids[] = {
> { INFO("at45db321d",0x1f2700, 0, 64 * 1024,  64, SECT_4K) },
> { INFO("at45db641d",0x1f2800, 0, 64 * 1024, 128, SECT_4K) },
> { INFO("at26df081a",0x1f4501, 0, 64 * 1024,  16, SECT_4K) },
> +   { INFO("at25sl321", 0x1f4216, 0, 64 * 1024,  64, SECT_4K) },

Change the order and

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


Re: [U-Boot] [PATCH 0/7] am57xx: Implement Android 10 boot flow

2019-10-23 Thread Sam Protsenko
Hi Eugeniu,

On Thu, Sep 19, 2019 at 9:23 PM Eugeniu Rosca  wrote:
>
> Hi Sam,
>
> On Thu, Sep 19, 2019 at 08:28:15PM +0300, Sam Protsenko wrote:
> > Android 10 brings a lot of new requirements for bootloaders: [1]. This
> > patch series attempts to implement such a boot process on BeagleBoard
> > X15 platform. Some common code is added too, which can be reused later
> > for other platforms.
> >
> > [1] https://source.android.com/devices/bootloader
>
> First, many thanks and true appreciation for making the bring-up of the
> same features easier on other platforms. Big thumbs up.
>
> Since I wanted to include some backtraces, I've posted my review
> findings (1st round) in https://paste.ubuntu.com/p/jNwYP99kp8/.
>

Thanks for your input. All issues you mentioned should be fixed in v2
I sent recently. Can you please check it out too?

> --
> Best Regards,
> Eugeniu
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2019-10-23 Thread Marek Vasut
On 10/23/19 9:26 PM, Tom Rini wrote:
> On Sun, Oct 20, 2019 at 05:08:37PM +0200, Marek Vasut wrote:
> 
>> The following changes since commit 6891152a4596d38ac25d2fe1238e3b6a938554b8:
>>
>>   Merge branch 'master' of git://git.denx.de/u-boot-socfpga (2019-10-14
>> 21:00:10 -0400)
>>
>> are available in the Git repository at:
>>
>>   git://git.denx.de/u-boot-usb.git master
>>
>> for you to fetch changes up to 79b03816cb7d17ce717cbeb2d1c69836a0adef1e:
>>
>>   dm: test: usb: rework keyboard test (2019-10-15 13:12:09 +0200)
>>
> 
> Two problems.  First (and I was going to fix this myself, it's not too
> hard) is that the DWC3 series is once again out of date with new
> platforms added since posting, this time khadas-vim3 and sei610.

Lovely, CCing Jean again ...

> But the second and bigger problem is that (I assume) the mx6 patch makes
> tbs2910 now exceed the binary size limit and fail to link.

And Igor ...

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


Re: [U-Boot] [PATCH] clk: imx: imx8mm: Fix the first root clock in imx8mm_ahb_sels[]

2019-10-23 Thread Fabio Estevam
Hi Frieder,

On Wed, Oct 23, 2019 at 1:36 PM Schrempf Frieder
 wrote:
>
> From: Frieder Schrempf 
>
> The 24MHz oscillator clock is referenced by "clock-osc-24m" and not
> "osc_24m".

Is the kernel clock driver also wrong then?
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCHv2 06/13] test/py: Manual python3 fixes

2019-10-23 Thread Stephen Warren

On 10/23/19 1:01 PM, Tom Rini wrote:

On Wed, Oct 23, 2019 at 12:50:12PM -0600, Stephen Warren wrote:

On 10/22/19 9:20 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 use the
default encoding/decoding of utf-8 but in some places tell Python to
replace problematic conversions rather than throw a fatal error.
- Fix a typo noticed while doing the above ("tot he" -> "to the").
- As suggested by Stephen, re-alphabetize the import list
- Per Heinrich, replace how we write contents in test_fit.py



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



@@ -133,7 +134,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",


The encoding parameter was added in Python 3.6, so this change causes
test.py to crash for me (with Python 3.5.2). The following will fix that:


Right, Ubuntu 16.04 has Python 3.5.x and later has 3.6 or higher.  It's
reasonable to ask what the minimum host version is going to be and how
much overhead things get the lower we go.  Given:


 p = subprocess.Popen(cmd, cwd=cwd,
 stdin=None, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
 (stdout, stderr) = p.communicate()
 if stdout is not None:
 stdout = stdout.decode('utf-8')
 if stderr is not None:
 stderr = stderr.decode('utf-8')


That's not too bad, so we can go with that.  Can you please chime in on
the "Minimum Python 3 version?" thread with what I assume is your
use-case of needing to use older-than-latest-LTS distributions?


A very quick survey of distros that I can quickly find package lists for:

RHEL 6 - 2 only
RHEL 7 - 3.6
Ubuntu 16.04 - 3.5
Ubuntu 18.04 - 3.6
Debian oldtsable - 3.5
Debian stable and all later - 3.7

So, Ubuntu 16.04 is perhaps the only distro that still contains Python 
3.5. That said, 16.04 is still fully supported for 18 more months, so it 
feels quite reasonable to support it. I have no choice but to use it for 
now.

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


Re: [U-Boot] [PULL] Pull request: u-boot-stm32 u-boot-stm32-2019-10-23

2019-10-23 Thread Tom Rini
On Wed, Oct 23, 2019 at 09:45:24AM +, Patrick DELAUNAY wrote:

> Hi Tom
> 
> Please pull the STM32 related patches for u-boot-stm32-2019-10-23
> 
> With the following changes:
> - Disable CONFIG_NET flag for MCU STM32
> - Fix ramdisk_addr_r for stm32f746-disco
> - Fix USB product id for stm32mp1
> 
> Travis CI status:
>  https://travis-ci.org/patrickdelaunay/u-boot/builds/601209719
> 
> Thanks,
> Patrick
> 
> 
> The following changes since commit 44510daea4d07fee736dd90411c4b503340b449e:
> 
>   dm: pinctrl: fix for introduce PINCONF_RECURSIVE option (2019-10-21 
> 09:40:54 -0400)
> 
> are available in the Git repository at:
> 
>   https://gitlab.denx.de/u-boot/custodians/u-boot-stm.git 
> tags/u-boot-stm32-2019-10-23
> 
> for you to fetch changes up to fb90fcf82628f0328649e55c7bf0c41f79872505:
> 
>   board: stm32mp1: fixup the usb product id for USB download gadget 
> (2019-10-22 11:00:07 +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] [PATCH v3] mtd: spi: Clean up usage of CONFIG_SPI_FLASH_MTD

2019-10-23 Thread Jagan Teki
On Wed, Oct 23, 2019 at 1:11 PM Schrempf Frieder
 wrote:
>
> From: Frieder Schrempf 
>
> Most boards currently use SPI_FLASH_MTD only in U-Boot proper, not in
> SPL. They often rely on hacks in the board header files to include
> this option conditionally. To be able to fix this, we previously
> introduced a separate option SPL_SPI_FLASH_MTD.
>
> Therefore we can now adjust the Makefile and change the code in
> sf_probe.c and sf_internal.h to use CONFIG_IS_ENABLED(SPI_FLASH_MTD).
>
> We also need to move all occurences of CONFIG_SPI_FLASH_MTD from the
> header files to the according defconfigs. The affected boards are
> socfpga, aristainetos, cm_fx6, display5, ventana, rcar-gen2, dh_imx6
> and da850evm.
>
> We do this all in one patch to guarantee bisectibility.
>
> This change was tested with buildman to make sure it does not
> introduce any regressions by comparing the resulting binary sizes.
>
> Signed-off-by: Frieder Schrempf 
> Reviewed-by: Stefan Roese 
> Reviewed-by: Simon Goldschmidt 
> Acked-by: Lukasz Majewski 
> Reviewed-by: Heiko Schocher 
> ---

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


Re: [U-Boot] pull request u-boot-fsl-qoriq

2019-10-23 Thread Tom Rini
On Tue, Oct 22, 2019 at 04:28:11AM +, Priyanka Jain wrote:

> Dear Tom,
> 
> 
> 
> Please find my pull-request for u-boot-fsl-qoriq/master
> https://travis-ci.org/p-priyanka-jain/u-boot/builds/600659013
> 
> Summary
> Add LS1027A, LS1018A, LS1017A support
> Few updates related to usb, ls1012a, lx2160a
> 
> priyankajain
> 

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 3/3] mtd: spi: Clean up usage of CONFIG_SPI_FLASH_MTD

2019-10-23 Thread Jagan Teki
On Wed, Oct 23, 2019 at 12:57 PM Stefan Roese  wrote:
>
> On 23.10.19 09:09, Jagan Teki wrote:
> > On Wed, Oct 23, 2019 at 12:35 PM Schrempf Frieder
> >  wrote:
> >>
> >> Hi Jagan,
> >>
> >> On 22.10.19 20:16, Jagan Teki wrote:
> >>> On Sat, Sep 14, 2019 at 4:14 AM Schrempf Frieder
> >>>  wrote:
> 
>  From: Frieder Schrempf 
> 
>  Most boards currently use SPI_FLASH_MTD only in U-Boot proper, not in
>  SPL. They often rely on hacks in the board header files to include
>  this option conditionally. To be able to fix this, we previously
>  introduced a separate option SPL_SPI_FLASH_MTD.
> 
>  Therefore we can now adjust the Makefile and change the code in
>  sf_probe.c and sf_internal.h to use CONFIG_IS_ENABLED(SPI_FLASH_MTD).
> 
>  We also need to move all occurences of CONFIG_SPI_FLASH_MTD from the
>  header files to the according defconfigs. The affected boards are
>  socfpga, aristainetos, cm_fx6, display5, ventana, rcar-gen2, dh_imx6
>  and da850evm.
> 
>  We do this all in one patch to guarantee bisectibility.
> 
>  This change was tested with buildman to make sure it does not
>  introduce any regressions by comparing the resulting binary sizes.
> 
>  Signed-off-by: Frieder Schrempf 
>  ---
> configs/aristainetos2_defconfig|  1 +
> configs/aristainetos2b_defconfig   |  1 +
> configs/aristainetos_defconfig |  1 +
> configs/cm_fx6_defconfig   |  1 +
> configs/display5_defconfig |  1 +
> configs/display5_factory_defconfig |  1 +
> configs/socfpga_arria5_defconfig   |  1 +
> configs/socfpga_cyclone5_defconfig |  1 +
> configs/socfpga_dbm_soc1_defconfig |  1 +
> configs/socfpga_de0_nano_soc_defconfig |  1 +
> configs/socfpga_de10_nano_defconfig|  1 +
> configs/socfpga_is1_defconfig  |  1 +
> configs/socfpga_mcvevk_defconfig   |  1 +
> configs/socfpga_sockit_defconfig   |  1 +
> configs/socfpga_socrates_defconfig |  1 +
> configs/socfpga_sr1500_defconfig   |  1 +
> configs/socfpga_vining_fpga_defconfig  |  1 +
> drivers/mtd/spi/Makefile   |  2 +-
> drivers/mtd/spi/sf_internal.h  |  2 +-
> drivers/mtd/spi/sf_probe.c |  6 +++---
> include/configs/aristainetos-common.h  |  1 -
> include/configs/cm_fx6.h   |  7 ---
> include/configs/da850evm.h |  7 +--
> include/configs/dh_imx6.h  |  1 -
> include/configs/display5.h |  4 
> include/configs/gw_ventana.h   | 10 +-
> include/configs/rcar-gen2-common.h |  4 +---
> include/configs/socfpga_common.h   |  4 
> 28 files changed, 25 insertions(+), 40 deletions(-)
> 
>  diff --git a/configs/aristainetos2_defconfig 
>  b/configs/aristainetos2_defconfig
>  index 18ef5d2dce..0bfc117762 100644
>  --- a/configs/aristainetos2_defconfig
>  +++ b/configs/aristainetos2_defconfig
>  @@ -44,6 +44,7 @@ CONFIG_SF_DEFAULT_CS=1
> CONFIG_SF_DEFAULT_MODE=0
> CONFIG_SF_DEFAULT_SPEED=2000
> CONFIG_SPI_FLASH_STMICRO=y
>  +CONFIG_SPI_FLASH_MTD=y
> CONFIG_MTD_UBI_FASTMAP=y
> CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
> CONFIG_PHYLIB=y
>  diff --git a/configs/aristainetos2b_defconfig 
>  b/configs/aristainetos2b_defconfig
>  index 1054c05d8c..e2da747a8f 100644
>  --- a/configs/aristainetos2b_defconfig
>  +++ b/configs/aristainetos2b_defconfig
>  @@ -42,6 +42,7 @@ CONFIG_SPI_FLASH=y
> CONFIG_SF_DEFAULT_MODE=0
> CONFIG_SF_DEFAULT_SPEED=2000
> CONFIG_SPI_FLASH_STMICRO=y
>  +CONFIG_SPI_FLASH_MTD=y
> CONFIG_MTD_UBI_FASTMAP=y
> CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
> CONFIG_PHYLIB=y
>  diff --git a/configs/aristainetos_defconfig 
>  b/configs/aristainetos_defconfig
>  index 4080a7b310..5caf95c22f 100644
>  --- a/configs/aristainetos_defconfig
>  +++ b/configs/aristainetos_defconfig
>  @@ -43,6 +43,7 @@ CONFIG_SF_DEFAULT_BUS=3
> CONFIG_SF_DEFAULT_MODE=0
> CONFIG_SF_DEFAULT_SPEED=2000
> CONFIG_SPI_FLASH_STMICRO=y
>  +CONFIG_SPI_FLASH_MTD=y
> CONFIG_MTD_UBI_FASTMAP=y
> CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
> CONFIG_PHYLIB=y
>  diff --git a/configs/cm_fx6_defconfig b/configs/cm_fx6_defconfig
>  index fd0db4db5c..15be7db027 100644
>  --- a/configs/cm_fx6_defconfig
>  +++ b/configs/cm_fx6_defconfig
>  @@ -72,6 +72,7 @@ CONFIG_SPI_FLASH_SPANSION=y
> CONFIG_SPI_FLASH_STMICRO=y
> CONFIG_SPI_FLASH_SST=y
> CONFIG_SPI_FLASH_WINBOND=y
>  +CONFIG_SPI_FLASH_MTD=y
> CONFIG_PHYLIB=y
> CONFIG_MII=y
> 

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

2019-10-23 Thread Tom Rini
On Sun, Oct 20, 2019 at 05:08:37PM +0200, Marek Vasut wrote:

> The following changes since commit 6891152a4596d38ac25d2fe1238e3b6a938554b8:
> 
>   Merge branch 'master' of git://git.denx.de/u-boot-socfpga (2019-10-14
> 21:00:10 -0400)
> 
> are available in the Git repository at:
> 
>   git://git.denx.de/u-boot-usb.git master
> 
> for you to fetch changes up to 79b03816cb7d17ce717cbeb2d1c69836a0adef1e:
> 
>   dm: test: usb: rework keyboard test (2019-10-15 13:12:09 +0200)
> 

Two problems.  First (and I was going to fix this myself, it's not too
hard) is that the DWC3 series is once again out of date with new
platforms added since posting, this time khadas-vim3 and sei610.

But the second and bigger problem is that (I assume) the mx6 patch makes
tbs2910 now exceed the binary size limit and fail to link.

-- 
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 3/3] mtd: spi: Clean up usage of CONFIG_SPI_FLASH_MTD

2019-10-23 Thread Jagan Teki
On Wed, Oct 23, 2019 at 12:56 PM Schrempf Frieder
 wrote:
>
> On 23.10.19 09:09, Jagan Teki wrote:
> > On Wed, Oct 23, 2019 at 12:35 PM Schrempf Frieder
> >  wrote:
> >>
> >> Hi Jagan,
> >>
> >> On 22.10.19 20:16, Jagan Teki wrote:
> >>> On Sat, Sep 14, 2019 at 4:14 AM Schrempf Frieder
> >>>  wrote:
> 
>  From: Frieder Schrempf 
> 
>  Most boards currently use SPI_FLASH_MTD only in U-Boot proper, not in
>  SPL. They often rely on hacks in the board header files to include
>  this option conditionally. To be able to fix this, we previously
>  introduced a separate option SPL_SPI_FLASH_MTD.
> 
>  Therefore we can now adjust the Makefile and change the code in
>  sf_probe.c and sf_internal.h to use CONFIG_IS_ENABLED(SPI_FLASH_MTD).
> 
>  We also need to move all occurences of CONFIG_SPI_FLASH_MTD from the
>  header files to the according defconfigs. The affected boards are
>  socfpga, aristainetos, cm_fx6, display5, ventana, rcar-gen2, dh_imx6
>  and da850evm.
> 
>  We do this all in one patch to guarantee bisectibility.
> 
>  This change was tested with buildman to make sure it does not
>  introduce any regressions by comparing the resulting binary sizes.
> 
>  Signed-off-by: Frieder Schrempf 
>  ---
> configs/aristainetos2_defconfig|  1 +
> configs/aristainetos2b_defconfig   |  1 +
> configs/aristainetos_defconfig |  1 +
> configs/cm_fx6_defconfig   |  1 +
> configs/display5_defconfig |  1 +
> configs/display5_factory_defconfig |  1 +
> configs/socfpga_arria5_defconfig   |  1 +
> configs/socfpga_cyclone5_defconfig |  1 +
> configs/socfpga_dbm_soc1_defconfig |  1 +
> configs/socfpga_de0_nano_soc_defconfig |  1 +
> configs/socfpga_de10_nano_defconfig|  1 +
> configs/socfpga_is1_defconfig  |  1 +
> configs/socfpga_mcvevk_defconfig   |  1 +
> configs/socfpga_sockit_defconfig   |  1 +
> configs/socfpga_socrates_defconfig |  1 +
> configs/socfpga_sr1500_defconfig   |  1 +
> configs/socfpga_vining_fpga_defconfig  |  1 +
> drivers/mtd/spi/Makefile   |  2 +-
> drivers/mtd/spi/sf_internal.h  |  2 +-
> drivers/mtd/spi/sf_probe.c |  6 +++---
> include/configs/aristainetos-common.h  |  1 -
> include/configs/cm_fx6.h   |  7 ---
> include/configs/da850evm.h |  7 +--
> include/configs/dh_imx6.h  |  1 -
> include/configs/display5.h |  4 
> include/configs/gw_ventana.h   | 10 +-
> include/configs/rcar-gen2-common.h |  4 +---
> include/configs/socfpga_common.h   |  4 
> 28 files changed, 25 insertions(+), 40 deletions(-)
> 
>  diff --git a/configs/aristainetos2_defconfig 
>  b/configs/aristainetos2_defconfig
>  index 18ef5d2dce..0bfc117762 100644
>  --- a/configs/aristainetos2_defconfig
>  +++ b/configs/aristainetos2_defconfig
>  @@ -44,6 +44,7 @@ CONFIG_SF_DEFAULT_CS=1
> CONFIG_SF_DEFAULT_MODE=0
> CONFIG_SF_DEFAULT_SPEED=2000
> CONFIG_SPI_FLASH_STMICRO=y
>  +CONFIG_SPI_FLASH_MTD=y
> CONFIG_MTD_UBI_FASTMAP=y
> CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
> CONFIG_PHYLIB=y
>  diff --git a/configs/aristainetos2b_defconfig 
>  b/configs/aristainetos2b_defconfig
>  index 1054c05d8c..e2da747a8f 100644
>  --- a/configs/aristainetos2b_defconfig
>  +++ b/configs/aristainetos2b_defconfig
>  @@ -42,6 +42,7 @@ CONFIG_SPI_FLASH=y
> CONFIG_SF_DEFAULT_MODE=0
> CONFIG_SF_DEFAULT_SPEED=2000
> CONFIG_SPI_FLASH_STMICRO=y
>  +CONFIG_SPI_FLASH_MTD=y
> CONFIG_MTD_UBI_FASTMAP=y
> CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
> CONFIG_PHYLIB=y
>  diff --git a/configs/aristainetos_defconfig 
>  b/configs/aristainetos_defconfig
>  index 4080a7b310..5caf95c22f 100644
>  --- a/configs/aristainetos_defconfig
>  +++ b/configs/aristainetos_defconfig
>  @@ -43,6 +43,7 @@ CONFIG_SF_DEFAULT_BUS=3
> CONFIG_SF_DEFAULT_MODE=0
> CONFIG_SF_DEFAULT_SPEED=2000
> CONFIG_SPI_FLASH_STMICRO=y
>  +CONFIG_SPI_FLASH_MTD=y
> CONFIG_MTD_UBI_FASTMAP=y
> CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
> CONFIG_PHYLIB=y
>  diff --git a/configs/cm_fx6_defconfig b/configs/cm_fx6_defconfig
>  index fd0db4db5c..15be7db027 100644
>  --- a/configs/cm_fx6_defconfig
>  +++ b/configs/cm_fx6_defconfig
>  @@ -72,6 +72,7 @@ CONFIG_SPI_FLASH_SPANSION=y
> CONFIG_SPI_FLASH_STMICRO=y
> CONFIG_SPI_FLASH_SST=y
> CONFIG_SPI_FLASH_WINBOND=y
>  +CONFIG_SPI_FLASH_MTD=y
> CONFIG_PHYLIB=y
> CONFIG_MII=y

Re: [U-Boot] [RFC PATCH v2 08/18] socfpga: gen5: add new tool to create handoff dtsi files

2019-10-23 Thread Simon Goldschmidt

Am 23.10.2019 um 18:03 schrieb Dalon L Westergreen:



On Tue, 2019-10-22 at 19:13 +0200, Simon Goldschmidt wrote:



Dalon L Westergreen > schrieb am Di., 22. Okt. 
2019, 19:10:
I mentioned this before, it would be great to not rely on the 
generated files

and do this based purely on the handoff data generated during a quartus
build. Did you look at the python source i pointed you to?


No, not yet. But I don't think that will be a problem. I sent this 
series mainly to discuss the dts format (boardspecific handoff dtsi vs 
genetic dtsi plus boardspecific header file).


The board specific dtsi does look cleaner, but i do like the simplicity 
of generating the header in arria10.


I could easily replicate what you do, generate the header, and use it to 
create the dtsi.


I'm not too fond myself of that tool I created, as it requires you to 
have a compiler. I just was too lazy write a script for that.


However, I would prefer having a script that does it. And if the sources 
are quartus output files instead of existing qts files, my tool doesn't 
work any more, anway.


So I think we should come up with a script (e.g. sh or py) that parses 
quartus output and creates a handoff dtsi (without a header). We'll only 
need something different for converting existing qts files then...


Regards,
Simon



--dalon



I still favor boardspecific handoff dtsi, but I would like to use the 
same style for all socfpga flavours.


Plus this tool is required to convert existing boards where we don't 
have the quartus project files at hand.


Regards,
Simon



--dalon

On Tue, 2019-10-15 at 22:10 +0200, Simon Goldschmidt wrote:

This new tool converts handoff information from quartus to "*_handoff.dtsi"
devicetree files. This is in preparation to move from ad-hoc code in arch
that parses the 'qts' header files to drivers parsing the same information
from devicetree.

Converting existing U-Boot 'qts' files is also supported.

Signed-off-by: Simon Goldschmidt <
simon.k.r.goldschm...@gmail.com
 
>
---

Changes in v2: None

  arch/arm/mach-socfpga/create_handoff_gen5.c | 660 
  arch/arm/mach-socfpga/qts-to-handoff.sh |  83 +++
  2 files changed, 743 insertions(+)
  create mode 100644 arch/arm/mach-socfpga/create_handoff_gen5.c
  create mode 100755 arch/arm/mach-socfpga/qts-to-handoff.sh

diff --git a/arch/arm/mach-socfpga/create_handoff_gen5.c 
b/arch/arm/mach-socfpga/create_handoff_gen5.c
new file mode 100644
index 00..6ec436719d
--- /dev/null
+++ b/arch/arm/mach-socfpga/create_handoff_gen5.c
@@ -0,0 +1,660 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * This is a host-tool that needs to be compiled per board and prints the
+ * handoff.dtsi to stdout.
+ */
+
+#include 
+#include 
+
+/* Define kernel types */
+typedef uint8_t u8;
+typedef uint32_t u32;
+
+#ifdef USE_QUARTUS_OUTPUT
+#ifdef ARRIA5
+#include "iocsr_config_arria5.c"
+#include "pinmux_config_arria5.c"
+#else
+#include "iocsr_config_cyclone5.c"
+#include "pinmux_config_cyclone5.c"
+#endif
+#include "pll_config.h"
+#include "sdram/sdram_config.h"
+#include "sequencer_auto.h"
+#include "sequencer_defines.h"
+#include "sequencer_auto_ac_init.c"
+#include "sequencer_auto_inst_init.c"
+#define RW_MGR(x) __RW_MGR_##x
+#else
+#define RW_MGR(x) RW_MGR_##x
+#include 
+#include 
+#include 
+#include 
+#endif
+
+#include "include/mach/clock_manager_gen5.h"
+#include "include/mach/sdram_gen5.h"
+
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
+#endif
+
+const char handoff_dtsi_hdr[] =
+   "// SPDX-License-Identifier: GPL-2.0\n"
+   "/*\n"
+   " *\n"
+   " *This code was generated by a tool based on\n"
+   " *handoffs from both Qsys and Quartus.\n"
+   " *\n"
+   " *Changes to this file may be lost if\n"
+   " *the code is regenerated.\n"
+   " *\n"
+   " */\n";
+
+/* Wrap PLL config */
+
+#define MAIN_VCO_BASE (\
+   (CONFIG_HPS_MAINPLLGRP_VCO_DENOM <<   \
+   CLKMGR_MAINPLLGRP_VCO_DENOM_OFFSET) |   \
+   (CONFIG_HPS_MAINPLLGRP_VCO_NUMER <<   \
+   CLKMGR_MAINPLLGRP_VCO_NUMER_OFFSET) \
+   )
+
+#define PERI_VCO_BASE (\
+   (CONFIG_HPS_PERPLLGRP_VCO_PSRC << \
+   CLKMGR_PERPLLGRP_VCO_PSRC_OFFSET) | \
+   (CONFIG_HPS_PERPLLGRP_VCO_DENOM <<\
+   CLKMGR_PERPLLGRP_VCO_DENOM_OFFSET) |\
+   (CONFIG_HPS_PERPLLGRP_VCO_NUMER <<\
+   CLKMGR_PERPLLGRP_VCO_NUMER_OFFSET)  \
+   )
+
+#define SDR_VCO_BASE ( \
+   (CONFIG_HPS_SDRPLLGRP_VCO_SSRC << \
+   CLKMGR_SDRPLLGRP_VCO_SSRC_OFFSET) | \
+   (CONFIG_HPS_SDRPLLGRP_VCO_DENOM <<\
+   

Re: [U-Boot] [PATCH v3 0/3] spi-nor: spi-nor-ids: Fix 4 Byte addressing for n25q*

2019-10-23 Thread Jagan Teki
On Fri, Oct 11, 2019 at 1:28 PM Vignesh Raghavendra  wrote:
>
> n25q variants do not support stateless 4 byte addressing opcodes by default,
> therefore first patch disables this flag for those parts. Second patch
> adds entries for mt25q variants which are similar to n25q but supports
> stateless 4 byte opcodes. Third patch adds USE_FSR flag for mt25q* and
> n25q* variants where missing
>
> Changes since v2:
> Add USE_FSR flags to all flash variants where missing
> Collect T-bys and R-bys
> Reword commit msgs as necessary
>
> Changes since v1:
> Rename newer variants as mt25*
> Add a patch to enable flag register parsing for mt25qu512a
>
> Vignesh Raghavendra (3):
>   spi-nor: spi-nor-ids: Disable SPI_NOR_4B_OPCODES for n25q512* and
> n25q256*
>   spi-nor: spi-nor-ids: Add entries for mt25q variants
>   spi-nor: spi-nor-ids: Add USE_FSR flag for mt25q* and n25q* entry

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


Re: [U-Boot] [PATCH v3 3/3] spi-nor: spi-nor-ids: Add USE_FSR flag for mt25q* and n25q* entry

2019-10-23 Thread Jagan Teki
On Wed, Oct 23, 2019 at 10:49 AM Vignesh Raghavendra  wrote:
>
> Hi Jagan,
>
> On 23/10/19 12:00 AM, Jagan Teki wrote:
> > Hi Vignesh,
> >
> > On Fri, Oct 11, 2019 at 1:28 PM Vignesh Raghavendra  wrote:
> >>
> >> n25q* and mt25q* (both 256Mb and 512Mb) flashes support Flag status
> >> register that indicates various errors that may be encountered during
> >> erase/write operations. Therefore add USE_FSR flag wherever missing.
> >
> > Does 256Mb require FSR? I remember Micron die is created after 512Mb
> > where it creates die between two 256Mb on 512Mb flash. Indeed die
> > switching would require FSR.
> >
>
> Flag Status Register(FSR) is not for switching die but for looking up and
> printing out reason for write/erase failure. And yes 256Mb part does
> support FSR. See datasheet at:
> https://www.micron.com/-/media/client/global/documents/products/data-sheet/nor-flash/serial-nor/n25q/n25q_256mb_1_8v.pdf
> Table 17: Flag Status Register Bit Definition
>
> https://www.mouser.com/datasheet/2/671/MT25Q_QLJS_U_256_ABA_0-1387271.pdf
> Table 5: Flag Status Register

Yes, I have seen these. I remember it wasn't require FSR when I did a
test on zynq qspi last time. may be it can't consistent between all
IP's
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v5 00/26]MTD defconfigs/Kconfigs/Makefiles heavy cleanup

2019-10-23 Thread Jagan Teki
On Wed, Oct 23, 2019 at 5:28 PM Tom Rini  wrote:
>
> On Mon, Oct 21, 2019 at 01:42:08PM +0530, Jagan Teki wrote:
> > Hi Miquel,
> >
> > On Mon, Oct 21, 2019 at 1:38 PM Miquel Raynal  
> > wrote:
> > >
> > > Hi Jagan,
> > >
> > > Gentle ping.
> > >
> > > As discussed half a year ago, please do not trash this series :)
> >
> > Please give us sometime, will update accordingly.
>
> Would you object to me taking this and doing the size-check build and
> pushing if it's no-change?  Thanks!

Please wait till end of this weekend.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCHv2 06/13] test/py: Manual python3 fixes

2019-10-23 Thread Tom Rini
On Wed, Oct 23, 2019 at 12:50:12PM -0600, Stephen Warren wrote:
> On 10/22/19 9:20 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 use the
> >default encoding/decoding of utf-8 but in some places tell Python to
> >replace problematic conversions rather than throw a fatal error.
> > - Fix a typo noticed while doing the above ("tot he" -> "to the").
> > - As suggested by Stephen, re-alphabetize the import list
> > - Per Heinrich, replace how we write contents in test_fit.py
> 
> > diff --git a/test/py/multiplexed_log.py b/test/py/multiplexed_log.py
> 
> > @@ -133,7 +134,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",
> 
> The encoding parameter was added in Python 3.6, so this change causes
> test.py to crash for me (with Python 3.5.2). The following will fix that:

Right, Ubuntu 16.04 has Python 3.5.x and later has 3.6 or higher.  It's
reasonable to ask what the minimum host version is going to be and how
much overhead things get the lower we go.  Given:

> > p = subprocess.Popen(cmd, cwd=cwd,
> > stdin=None, stdout=subprocess.PIPE, 
> > stderr=subprocess.STDOUT)
> > (stdout, stderr) = p.communicate()
> > if stdout is not None:
> > stdout = stdout.decode('utf-8')
> > if stderr is not None:
> > stderr = stderr.decode('utf-8')

That's not too bad, so we can go with that.  Can you please chime in on
the "Minimum Python 3 version?" thread with what I assume is your
use-case of needing to use older-than-latest-LTS distributions?

> I also noticed that a variety of strings in these patches use "" not '' in
> at least this patch. When I first wrote test/py, Simon made me go through
> everything and replace "" with '', so we should probably make new code
> follow the convention of using ''.

OK, I'll get on top of that, 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] [PATCHv2 06/13] test/py: Manual python3 fixes

2019-10-23 Thread Stephen Warren

On 10/22/19 9:20 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 use the
   default encoding/decoding of utf-8 but in some places tell Python to
   replace problematic conversions rather than throw a fatal error.
- Fix a typo noticed while doing the above ("tot he" -> "to the").
- As suggested by Stephen, re-alphabetize the import list
- Per Heinrich, replace how we write contents in test_fit.py



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



@@ -133,7 +134,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",


The encoding parameter was added in Python 3.6, so this change causes 
test.py to crash for me (with Python 3.5.2). The following will fix that:



p = subprocess.Popen(cmd, cwd=cwd,
stdin=None, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
(stdout, stderr) = p.communicate()
if stdout is not None:
stdout = stdout.decode('utf-8')
if stderr is not None:
stderr = stderr.decode('utf-8')


I also noticed that a variety of strings in these patches use "" not '' 
in at least this patch. When I first wrote test/py, Simon made me go 
through everything and replace "" with '', so we should probably make 
new code follow the convention of using ''.

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


Re: [U-Boot] [PATCHv2 11/13] test/py: Update docs, add requirements.txt for pip

2019-10-23 Thread Tom Rini
On Wed, Oct 23, 2019 at 12:30:52PM -0600, Stephen Warren wrote:
> On 10/22/19 9:20 PM, Tom Rini wrote:
> > To be more closely aligned with Python community best practices, we need
> > to better document our usage of pip and make use of a requirements.txt
> > file that shows the versions of the tools that we are using.  This will
> > aide in ensuring reproducibility of our tests as well.
> 
> > +In order to execute certain tests on their supported platforms other tools
> > +will be required.  The following is an incomplete list:
> > +
> > +| Package|
> > +| -- |
> > +| gdisk  |
> > +| dfu-util   |
> > +| dtc|
> 
> This looks like my bug from before, but may as well fix it: That package
> doesn't exist, at least on Ubuntu 16.04. There is device-tree-compiler
> though.

I wonder how best to list that.  Upstream is "dtc" and I forget what
it's called package-wise on Fedora systems and similar.  But since I
want to avoid making a distribution specific list maybe I need to add a
few words to be clear it's a tool list and not a package list.  Doing
"apt-cache search dtc" shows device-tree-compiler for example and I bet
the dnf equivalent does too.

> > +| openssl|
> > +| sudo OR guestmount |

Note that for example guestmount comes from libguestfs-tools on
Debian/similar systems.

> > +| e2fsprogs  |
> > +| dosfstools |
> > +| openssl|
> 
> openssl is listed twice.

Thanks, fixed.

-- 
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 v2 36/41] serial: mxc: add imx53 and imx21 compatible string

2019-10-23 Thread Fabio Estevam
On Wed, Oct 23, 2019 at 3:36 PM Robert Beckett
 wrote:
>
> Add compatible string for imx53 and imx21.
>
> Signed-off-by: Robert Beckett 
> ---
>  drivers/serial/serial_mxc.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c
> index 42abb96a26..8e19a89151 100644
> --- a/drivers/serial/serial_mxc.c
> +++ b/drivers/serial/serial_mxc.c
> @@ -348,6 +348,8 @@ static const struct udevice_id mxc_serial_ids[] = {
> { .compatible = "fsl,imx6ul-uart" },
> { .compatible = "fsl,imx7d-uart" },
> { .compatible = "fsl,imx6q-uart" },
> +   { .compatible = "fsl,imx53-uart" },
> +   { .compatible = "fsl,imx21-uart" },

Looks like you are using an old codebase.

U-Boot mainline already contains such compatible entries.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 4/5] imx: nandbcb: refactor update function

2019-10-23 Thread Max Krummenacher
On Mon, 2019-10-21 at 16:38 +0300, Igor Opaniuk wrote:
> From: Igor Opaniuk 
> 
> Move code for writing FCB/DBBT pages to a separate function
> 
> Signed-off-by: Igor Opaniuk 

Tested-by: Max Krummenacher 

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


[U-Boot] [PATCH v2 38/41] pmic: allow dump command for non contiguous register maps

2019-10-23 Thread Robert Beckett
From: Martin Fuzzey 

Some PMICs (such as the DA9063) have non-contiguous register maps.
Attempting to read the non implemented registers returns an error
rather than a dummy value which causes 'pmic dump' to terminate
prematurely.

Fix this by allowing the PMIC driver to return -ENODATA for such
registers, which will then be displayed as '--' by pmic dump.

Use a single error code rather than any error code so that
we can distinguish between a hardware failure reading the PMIC
and a non implemented register known to the driver.

Signed-off-by: Martin Fuzzey 
Signed-off-by: Robert Beckett 
---
 cmd/pmic.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/cmd/pmic.c b/cmd/pmic.c
index e46d813a70..2400bfb601 100644
--- a/cmd/pmic.c
+++ b/cmd/pmic.c
@@ -95,7 +95,7 @@ static int do_dump(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
 
for (reg = 0; reg < pmic_reg_count(dev); reg++) {
ret = pmic_reg_read(dev, reg);
-   if (ret < 0) {
+   if (ret < 0 && ret != -ENODATA) {
printf("Can't read register: %d\n", reg);
return failure(ret);
}
@@ -103,7 +103,15 @@ static int do_dump(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
if (!(reg % 16))
printf("\n0x%02x: ", reg);
 
-   printf(fmt, ret);
+   if (ret == -ENODATA) {
+   int i;
+
+   for (i = 0; i < priv->trans_len; i++)
+   puts("--");
+   puts(" ");
+   } else {
+   printf(fmt, ret);
+   }
}
printf("\n");
 
-- 
2.20.1

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


[U-Boot] [PATCH v2 23/41] rtc: rx8010sj: fix DM initialization

2019-10-23 Thread Robert Beckett
pass the udevice by reference instead of double ref

Signed-off-by: Robert Beckett 
---
 drivers/rtc/rx8010sj.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rx8010sj.c b/drivers/rtc/rx8010sj.c
index 81560e16ce..2876692a37 100644
--- a/drivers/rtc/rx8010sj.c
+++ b/drivers/rtc/rx8010sj.c
@@ -349,7 +349,7 @@ void rtc_init(void)
 
 static int rx8010sj_probe(struct udevice *dev)
 {
-   rx8010sj_rtc_init();
+   rx8010sj_rtc_init(dev);
 
return 0;
 }
-- 
2.20.1

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


Re: [U-Boot] [PATCHv2 11/13] test/py: Update docs, add requirements.txt for pip

2019-10-23 Thread Stephen Warren

On 10/22/19 9:20 PM, Tom Rini wrote:

To be more closely aligned with Python community best practices, we need
to better document our usage of pip and make use of a requirements.txt
file that shows the versions of the tools that we are using.  This will
aide in ensuring reproducibility of our tests as well.



+In order to execute certain tests on their supported platforms other tools
+will be required.  The following is an incomplete list:
+
+| Package|
+| -- |
+| gdisk  |
+| dfu-util   |
+| dtc|


This looks like my bug from before, but may as well fix it: That package 
doesn't exist, at least on Ubuntu 16.04. There is device-tree-compiler 
though.



+| openssl|
+| sudo OR guestmount |
+| e2fsprogs  |
+| dosfstools |
+| openssl|


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


[U-Boot] [PATCH v2 15/41] board: ge: convert vpd to use i2c eeprom

2019-10-23 Thread Robert Beckett
convert vpd reader to use DM i2c eeprom driver.
remove old VPD definitions.

Signed-off-by: Robert Beckett 
---
 board/ge/bx50v3/Kconfig  |  2 --
 board/ge/common/Kconfig  | 14 --
 board/ge/common/vpd_reader.c | 37 ++--
 board/ge/mx53ppd/Kconfig |  2 --
 configs/ge_bx50v3_defconfig  |  5 ++---
 configs/mx53ppd_defconfig|  3 ---
 6 files changed, 25 insertions(+), 38 deletions(-)
 delete mode 100644 board/ge/common/Kconfig

diff --git a/board/ge/bx50v3/Kconfig b/board/ge/bx50v3/Kconfig
index 05938560ab..993b055930 100644
--- a/board/ge/bx50v3/Kconfig
+++ b/board/ge/bx50v3/Kconfig
@@ -15,6 +15,4 @@ config SYS_SOC
 config SYS_CONFIG_NAME
default "ge_bx50v3"
 
-source "board/ge/common/Kconfig"
-
 endif
diff --git a/board/ge/common/Kconfig b/board/ge/common/Kconfig
deleted file mode 100644
index 637b264954..00
--- a/board/ge/common/Kconfig
+++ /dev/null
@@ -1,14 +0,0 @@
-config SYS_VPD_EEPROM_I2C_ADDR
-   hex "I2C address of the EEPROM device used for VPD"
-   help
- VPD = Vital Product Data
-
-config SYS_VPD_EEPROM_I2C_BUS
-   int "I2C bus of the EEPROM device used for VPD."
-
-config SYS_VPD_EEPROM_SIZE
-   int "Size in bytes of the EEPROM device used for VPD"
-
-config SYS_VPD_EEPROM_I2C_ADDR_LEN
-   int "Number of bytes to use for VPD EEPROM address"
-   default 1
diff --git a/board/ge/common/vpd_reader.c b/board/ge/common/vpd_reader.c
index 12410d9b71..4df411cf10 100644
--- a/board/ge/common/vpd_reader.c
+++ b/board/ge/common/vpd_reader.c
@@ -8,6 +8,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 /* BCH configuration */
 
@@ -200,28 +203,34 @@ int read_vpd(struct vpd_cache *cache,
 int (*process_block)(struct vpd_cache *, u8 id, u8 version,
  u8 type, size_t size, u8 const *data))
 {
-   static const size_t size = CONFIG_SYS_VPD_EEPROM_SIZE;
-
-   int res;
+   struct udevice *dev;
+   int ret;
u8 *data;
-   unsigned int current_i2c_bus = i2c_get_bus_num();
+   int size;
+
+   ret = uclass_get_device_by_name(UCLASS_I2C_EEPROM, "vpd", );
+   if (ret)
+   return ret;
 
-   res = i2c_set_bus_num(CONFIG_SYS_VPD_EEPROM_I2C_BUS);
-   if (res < 0)
-   return res;
+   size = i2c_eeprom_size(dev);
+   if (size < 0) {
+   printf("Unable to get size of eeprom: %d\n", ret);
+   return ret;
+   }
 
data = malloc(size);
if (!data)
return -ENOMEM;
 
-   res = i2c_read(CONFIG_SYS_VPD_EEPROM_I2C_ADDR, 0,
-  CONFIG_SYS_VPD_EEPROM_I2C_ADDR_LEN,
-  data, size);
-   if (res == 0)
-   res = vpd_reader(size, data, cache, process_block);
+   ret = i2c_eeprom_read(dev, 0, data, size);
+   if (ret) {
+   free(data);
+   return ret;
+   }
+
+   ret = vpd_reader(size, data, cache, process_block);
 
free(data);
 
-   i2c_set_bus_num(current_i2c_bus);
-   return res;
+   return ret;
 }
diff --git a/board/ge/mx53ppd/Kconfig b/board/ge/mx53ppd/Kconfig
index bebb2fab01..6dc3818cb7 100644
--- a/board/ge/mx53ppd/Kconfig
+++ b/board/ge/mx53ppd/Kconfig
@@ -13,6 +13,4 @@ config SYS_SOC
 config SYS_CONFIG_NAME
default "mx53ppd"
 
-source "board/ge/common/Kconfig"
-
 endif
diff --git a/configs/ge_bx50v3_defconfig b/configs/ge_bx50v3_defconfig
index ff16b2c4f0..937b6af9fa 100644
--- a/configs/ge_bx50v3_defconfig
+++ b/configs/ge_bx50v3_defconfig
@@ -1,9 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x1780
-CONFIG_SYS_VPD_EEPROM_I2C_ADDR=0x50
-CONFIG_SYS_VPD_EEPROM_I2C_BUS=4
-CONFIG_SYS_VPD_EEPROM_SIZE=1024
 CONFIG_TARGET_GE_BX50V3=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SYS_BOOTCOUNT_ADDR=0x7000A000
@@ -46,6 +43,8 @@ CONFIG_DM_I2C_COMPAT=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_I2C_MUX=y
 CONFIG_I2C_MUX_PCA954x=y
+CONFIG_MISC=y
+CONFIG_I2C_EEPROM=y
 CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig
index b8cb599491..1de43b7126 100644
--- a/configs/mx53ppd_defconfig
+++ b/configs/mx53ppd_defconfig
@@ -2,9 +2,6 @@ CONFIG_ARM=y
 CONFIG_ARCH_MX5=y
 CONFIG_SYS_TEXT_BASE=0x7780
 CONFIG_TARGET_MX53PPD=y
-CONFIG_SYS_VPD_EEPROM_I2C_ADDR=0x50
-CONFIG_SYS_VPD_EEPROM_I2C_BUS=2
-CONFIG_SYS_VPD_EEPROM_SIZE=1024
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SYS_BOOTCOUNT_ADDR=0x7000A000
 CONFIG_FIT=y
-- 
2.20.1

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


[U-Boot] [PATCH v2 37/41] board: ge: mx53ppd: use DM for uart

2019-10-23 Thread Robert Beckett
Set chose stdout-path in DT
Add uart1 and associated pinctrl definitions in DT
Remove legacy uart pad and iomux code
Enable DM serial and mxc uart

Signed-off-by: Robert Beckett 
---
 arch/arm/dts/imx53-ppd.dts | 17 +
 board/ge/mx53ppd/mx53ppd.c | 14 --
 configs/mx53ppd_defconfig  |  3 +++
 include/configs/mx53ppd.h  |  9 +
 4 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/arch/arm/dts/imx53-ppd.dts b/arch/arm/dts/imx53-ppd.dts
index d308abc09c..681bc89331 100644
--- a/arch/arm/dts/imx53-ppd.dts
+++ b/arch/arm/dts/imx53-ppd.dts
@@ -13,6 +13,10 @@
model = "General Electric CS ONE";
compatible = "ge,imx53-cpuvo", "fsl,imx53";
 
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+
wdt-reboot {
compatible = "wdt-reboot";
wdt = <>;
@@ -167,6 +171,13 @@
MX53_PAD_FEC_TXD0__FEC_TDATA_0  0x0
>;
};
+
+   pinctrl_uart1: uart1grp {
+   fsl,pins = <
+   MX53_PAD_PATA_DIOW__UART1_TXD_MUX   0x1e4
+   MX53_PAD_PATA_DMACK__UART1_RXD_MUX  0x1e4
+   >;
+   };
 };
 
 /* eMMC */
@@ -341,3 +352,9 @@
phy-reset-gpios = < 16 GPIO_ACTIVE_LOW>;
status = "okay";
 };
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_uart1>;
+   status = "okay";
+};
diff --git a/board/ge/mx53ppd/mx53ppd.c b/board/ge/mx53ppd/mx53ppd.c
index 486ef6d374..a8d4bf363e 100644
--- a/board/ge/mx53ppd/mx53ppd.c
+++ b/board/ge/mx53ppd/mx53ppd.c
@@ -79,24 +79,11 @@ int dram_init_banksize(void)
return 0;
 }
 
-static void setup_iomux_uart(void)
-{
-   static const iomux_v3_cfg_t uart_pads[] = {
-   MX53_PAD_PATA_DMACK__UART1_RXD_MUX,
-   MX53_PAD_PATA_DIOW__UART1_TXD_MUX,
-   };
-
-   imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-}
-
 u32 get_board_rev(void)
 {
return get_cpu_rev() & ~(0xF << 8);
 }
 
-#define UART_PAD_CTRL  (PAD_CTL_HYS | PAD_CTL_DSE_HIGH | \
-PAD_CTL_PUS_100K_UP | PAD_CTL_ODE)
-
 #ifdef CONFIG_USB_EHCI_MX5
 int board_ehci_hcd_init(int port)
 {
@@ -144,7 +131,6 @@ void ppd_gpio_init(void)
 
 int board_early_init_f(void)
 {
-   setup_iomux_uart();
ppd_gpio_init();
 
return 0;
diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig
index 1fa9715850..ac1b701e69 100644
--- a/configs/mx53ppd_defconfig
+++ b/configs/mx53ppd_defconfig
@@ -54,6 +54,9 @@ CONFIG_PINCTRL_IMX5=y
 CONFIG_PWM_IMX=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_S35392A=y
+# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
+CONFIG_DM_SERIAL=y
+CONFIG_MXC_UART=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_MX5=y
 CONFIG_VIDEO_IPUV3=y
diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h
index 5b1c467554..7bbb0f8dfd 100644
--- a/include/configs/mx53ppd.h
+++ b/include/configs/mx53ppd.h
@@ -11,8 +11,6 @@
 
 #include 
 
-#define CONSOLE_DEV"ttymxc0"
-
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
@@ -25,9 +23,6 @@
 #define CONFIG_BOARD_LATE_INIT
 #define CONFIG_REVISION_TAG
 
-#define CONFIG_MXC_UART
-#define CONFIG_MXC_UART_BASE   UART1_BASE
-
 /* USB Configs */
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_ASIX
@@ -70,11 +65,9 @@
"devnum=2\0" \
"rootdev=mmcblk0p\0" \
"quiet=quiet loglevel=0\0" \
-   "console=" CONSOLE_DEV "\0" \
"lvds=ldb\0" \
"setargs=setenv bootargs ${lvds} jtag=on mem=2G " \
-   "vt.global_cursor_default=0 bootcause=${bootcause} ${quiet} " \
-   "console=${console}\0" \
+   "vt.global_cursor_default=0 bootcause=${bootcause} ${quiet}\0" \
"bootargs_emmc=setenv bootargs root=/dev/${rootdev}${partnum} ro " \
"rootwait ${bootargs}\0" \
"doquiet=if ext2load ${dev} ${devnum}:5 0x7000A000 /boot/console; " \
-- 
2.20.1

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


[U-Boot] [PATCH v2 35/41] board: ge: bx50v3: use DM for uart

2019-10-23 Thread Robert Beckett
Set chosen stdout-path in DT
Add uart3 and associated pinctrl definitions in DT
Remove legacy uart pad and iomux code
Enable DM serial and mxc uart

Signed-off-by: Robert Beckett 
---
 arch/arm/dts/imx6q-bx50v3.dts | 20 
 board/ge/bx50v3/bx50v3.c  | 24 
 configs/ge_bx50v3_defconfig   |  3 +++
 include/configs/ge_bx50v3.h   | 10 ++
 4 files changed, 25 insertions(+), 32 deletions(-)

diff --git a/arch/arm/dts/imx6q-bx50v3.dts b/arch/arm/dts/imx6q-bx50v3.dts
index e9aaca4a78..7b5fe3b5de 100644
--- a/arch/arm/dts/imx6q-bx50v3.dts
+++ b/arch/arm/dts/imx6q-bx50v3.dts
@@ -14,6 +14,10 @@
model = "General Electric Bx50v3";
compatible = "ge,imx6q-bx50v3", "advantech,imx6q-ba16", "fsl,imx6q";
 
+   chosen {
+   stdout-path = 
+   };
+
aliases {
ethernet0 = 
};
@@ -236,6 +240,15 @@
MX6QDL_PAD_SD1_DAT3__PWM1_OUT   0x1b0b1
>;
};
+
+   pinctrl_uart3: uart3grp {
+   fsl,pins = <
+   MX6QDL_PAD_EIM_D25__UART3_RX_DATA 0x1b0b1
+   MX6QDL_PAD_EIM_D24__UART3_TX_DATA 0x1b0b1
+   MX6QDL_PAD_EIM_D23__UART3_CTS_B   0x1b0b1
+   MX6QDL_PAD_EIM_D31__UART3_RTS_B   0x1b0b1
+   >;
+   };
 };
 
  {
@@ -596,3 +609,10 @@
interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
};
 };
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_uart3>;
+   uart-has-rtscts;
+   status = "okay";
+};
diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c
index 2e11697af0..aa4a3598c6 100644
--- a/board/ge/bx50v3/bx50v3.c
+++ b/board/ge/bx50v3/bx50v3.c
@@ -46,10 +46,6 @@ static struct vpd_cache vpd;
PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \
PAD_CTL_HYS)
 
-#define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP |  \
-   PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \
-   PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
-
 #define ENET_PAD_CTRL  (PAD_CTL_PUS_100K_UP | PAD_CTL_PUE |\
PAD_CTL_SPEED_HIGH | PAD_CTL_DSE_48ohm | PAD_CTL_SRE_FAST)
 
@@ -72,24 +68,6 @@ int dram_init(void)
return 0;
 }
 
-static iomux_v3_cfg_t const uart3_pads[] = {
-   MX6_PAD_EIM_D31__UART3_RTS_B | MUX_PAD_CTRL(UART_PAD_CTRL),
-   MX6_PAD_EIM_D23__UART3_CTS_B | MUX_PAD_CTRL(UART_PAD_CTRL),
-   MX6_PAD_EIM_D24__UART3_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
-   MX6_PAD_EIM_D25__UART3_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
-static iomux_v3_cfg_t const uart4_pads[] = {
-   MX6_PAD_KEY_COL0__UART4_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
-   MX6_PAD_KEY_ROW0__UART4_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
-static void setup_iomux_uart(void)
-{
-   imx_iomux_v3_setup_multiple_pads(uart3_pads, ARRAY_SIZE(uart3_pads));
-   imx_iomux_v3_setup_multiple_pads(uart4_pads, ARRAY_SIZE(uart4_pads));
-}
-
 static int mx6_rgmii_rework(struct phy_device *phydev)
 {
/* Configure AR8033 to ouput a 125MHz clk from CLK_25M */
@@ -423,8 +401,6 @@ int board_early_init_f(void)
imx_iomux_v3_setup_multiple_pads(misc_pads,
 ARRAY_SIZE(misc_pads));
 
-   setup_iomux_uart();
-
 #if defined(CONFIG_VIDEO_IPUV3)
/* Set LDB clock to Video PLL */
select_ldb_di_clock_source(MXC_PLL5_CLK);
diff --git a/configs/ge_bx50v3_defconfig b/configs/ge_bx50v3_defconfig
index 977aac41f6..8acb41c046 100644
--- a/configs/ge_bx50v3_defconfig
+++ b/configs/ge_bx50v3_defconfig
@@ -65,6 +65,9 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_RX8010SJ=y
+# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
+CONFIG_DM_SERIAL=y
+CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_MXC_SPI=y
diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h
index 6ca43c3cf7..d59a965792 100644
--- a/include/configs/ge_bx50v3.h
+++ b/include/configs/ge_bx50v3.h
@@ -16,9 +16,6 @@
 
 #define CONFIG_BOARD_NAME  "General Electric Bx50v3"
 
-#define CONFIG_MXC_UART_BASE   UART3_BASE
-#define CONSOLE_DEV"ttymxc2"
-
 #include "mx6_common.h"
 #include 
 
@@ -28,8 +25,6 @@
 #define CONFIG_REVISION_TAG
 #define CONFIG_SYS_MALLOC_LEN  (10 * SZ_1M)
 
-#define CONFIG_MXC_UART
-
 /* SATA Configs */
 #ifdef CONFIG_CMD_SATA
 #define CONFIG_SYS_SATA_MAX_DEVICE 1
@@ -64,7 +59,7 @@
 "setenv netmask 255.255.255.0; setenv ethaddr 
ca:fe:de:ca:f0:11; " \
 "setenv bootargs root=/dev/nfs 
nfsroot=${nfsserver}:/srv/nfs/,v3,tcp rw rootwait" \
 "setenv bootargs $bootargs 
ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}::eth0:off " \
-"setenv bootargs $bootargs cma=128M bootcause=POR 
console=${console} ${videoargs} " \
+"setenv bootargs $bootargs cma=128M bootcause=POR ${videoargs} 
" \
 "setenv bootargs $bootargs 

[U-Boot] [PATCH v2 22/41] board: ge: mx53ppd: add i2c eeprom bootcount storage

2019-10-23 Thread Robert Beckett
Add bootcount node, linking to i2c eeprom "bootcount" partitions for
storage.
Enable i2c eeprom bootcount backend storage.
Enable bootcount command and use it for failbootcmd.

Signed-off-by: Robert Beckett 
---
 arch/arm/dts/imx53-ppd.dts | 5 +
 configs/mx53ppd_defconfig  | 8 +---
 include/configs/mx53ppd.h  | 4 +---
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/arch/arm/dts/imx53-ppd.dts b/arch/arm/dts/imx53-ppd.dts
index 18022796e7..3a3192d5e8 100644
--- a/arch/arm/dts/imx53-ppd.dts
+++ b/arch/arm/dts/imx53-ppd.dts
@@ -16,6 +16,11 @@
compatible = "wdt-reboot";
wdt = <>;
};
+
+   bootcount {
+   compatible = "u-boot,bootcount-i2c-eeprom";
+   i2c-eeprom = <_eeprom>;
+   };
 };
 
  {
diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig
index 1de43b7126..db00481266 100644
--- a/configs/mx53ppd_defconfig
+++ b/configs/mx53ppd_defconfig
@@ -3,7 +3,6 @@ CONFIG_ARCH_MX5=y
 CONFIG_SYS_TEXT_BASE=0x7780
 CONFIG_TARGET_MX53PPD=y
 CONFIG_NR_DRAM_BANKS=2
-CONFIG_SYS_BOOTCOUNT_ADDR=0x7000A000
 CONFIG_FIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/ge/mx53ppd/imximage.cfg"
@@ -20,6 +19,7 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
+CONFIG_CMD_BOOTCOUNT=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
@@ -32,15 +32,17 @@ CONFIG_DEFAULT_DEVICE_TREE="imx53-ppd"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
 CONFIG_BOOTCOUNT_LIMIT=y
-CONFIG_BOOTCOUNT_EXT=y
+CONFIG_DM_BOOTCOUNT=y
+CONFIG_DM_BOOTCOUNT_I2C_EEPROM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=10
-CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="0:5"
 CONFIG_DM_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_DM_I2C_COMPAT=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_I2C_MUX=y
 CONFIG_I2C_MUX_PCA954x=y
+CONFIG_MISC=y
+CONFIG_I2C_EEPROM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC_IMX=y
 CONFIG_MII=y
diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h
index be4336e3a9..b21235dd57 100644
--- a/include/configs/mx53ppd.h
+++ b/include/configs/mx53ppd.h
@@ -110,9 +110,7 @@
"setenv stdout vga; " \
"echo \"\n\n\n\n\" $msg; " \
"setenv stdout serial; " \
-   "mw.b 0x7000A000 0xbc; " \
-   "mw.b 0x7000A001 0x00; " \
-   "ext4write ${dev} ${devnum}:5 0x7000A000 /boot/failures 2\0" \
+   "bootcount reset; \0" \
"altbootcmd=" \
"run doquiet; " \
"setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
-- 
2.20.1

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


Re: [U-Boot] [PATCH v2 5/5] imx: nandbcb: add support for writing BCB only

2019-10-23 Thread Max Krummenacher
On Mon, 2019-10-21 at 16:38 +0300, Igor Opaniuk wrote:
> From: Igor Opaniuk 
> 
> Add subcommand for add writing BCB only, where we provide appropriate
> offsets for firmware1 and firmware2 and size.
> 
> Example of usage:
> - nandbcb bcbonly 0x0018 0x0008 0x0020
> Writing 1024 bytes to 0x0: randomizing
> OK
> Writing 1024 bytes to 0x2: randomizing
> OK
> 
> Signed-off-by: Igor Opaniuk 

Tested-by: Max Krummenacher 

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


[U-Boot] [PATCH v2 10/41] board: ge: mx53ppd: Add i2c bus descritpion

2019-10-23 Thread Robert Beckett
Add i2c bus devicetree description

Signed-off-by: Robert Beckett 
---
 arch/arm/dts/imx53-ppd.dts | 176 +
 1 file changed, 176 insertions(+)

diff --git a/arch/arm/dts/imx53-ppd.dts b/arch/arm/dts/imx53-ppd.dts
index 909a76731b..84b20cdc55 100644
--- a/arch/arm/dts/imx53-ppd.dts
+++ b/arch/arm/dts/imx53-ppd.dts
@@ -35,6 +35,48 @@
MX53_PAD_PATA_IORDY__ESDHC3_CLK 0x1d5
>;
};
+
+   pinctrl_i2c1: i2c1grp {
+   fsl,pins = <
+   MX53_PAD_EIM_D21__I2C1_SCL  0x41e4
+   MX53_PAD_EIM_D28__I2C1_SDA  0x41e4
+   >;
+   };
+
+   pinctrl_i2c1_gpio: i2c1gpiogrp {
+   fsl,pins = <
+   MX53_PAD_EIM_D28__GPIO3_28  0x1e4
+   MX53_PAD_EIM_D21__GPIO3_21  0x1e4
+   >;
+   };
+
+   pinctrl_i2c2: i2c2grp {
+   fsl,pins = <
+   MX53_PAD_EIM_EB2__I2C2_SCL  0x41e4
+   MX53_PAD_EIM_D16__I2C2_SDA  0x41e4
+   >;
+   };
+
+   pinctrl_i2c2_gpio: i2c2gpiogrp {
+   fsl,pins = <
+   MX53_PAD_EIM_D16__GPIO3_16  0x1e4
+   MX53_PAD_EIM_EB2__GPIO2_30  0x1e4
+   >;
+   };
+
+   pinctrl_i2c3: i2c3grp {
+   fsl,pins = <
+   MX53_PAD_EIM_D17__I2C3_SCL  0x41e4
+   MX53_PAD_EIM_D18__I2C3_SDA  0x41e4
+   >;
+   };
+
+   pinctrl_i2c3_gpio: i2c3gpiogrp {
+   fsl,pins = <
+   MX53_PAD_EIM_D18__GPIO3_18  0x1e4
+   MX53_PAD_EIM_D17__GPIO3_17  0x1e4
+   >;
+   };
 };
 
 /* eMMC */
@@ -46,3 +88,137 @@
non-removable;
status = "okay";
 };
+
+/* I2C */
+ {
+   pinctrl-names = "default", "gpio";
+   pinctrl-0 = <_i2c1>;
+   pinctrl-1 = <_i2c1_gpio>;
+   sda-gpios = < 28 GPIO_ACTIVE_HIGH>;
+   scl-gpios = < 21 GPIO_ACTIVE_HIGH>;
+   status = "okay";
+
+   i2c-switch@70 {
+   compatible = "nxp,pca9547";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <0x70>;
+   reset-gpios = < 18 GPIO_ACTIVE_LOW>;
+
+   i2c4: i2c@0 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <0>;
+   };
+
+   i2c5: i2c@1 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <1>;
+
+   rtc@30 {
+  compatible = "sii,s35390a";
+  reg = <0x30>;
+   };
+
+   temp@48 {
+   compatible = "ti,tmp112";
+   reg = <0x48>;
+   };
+
+   mma8453q: accelerometer@1c {
+   compatible = "fsl,mma8453";
+   reg = <0x1c>;
+   interrupt-parent = <>;
+   interrupts = <6 IRQ_TYPE_NONE>;
+   interrupt-names = "INT1";
+   };
+
+   mpl3115: pressure-sensor@60 {
+   compatible = "fsl,mpl3115";
+   reg = <0x60>;
+   };
+
+   eeprom: eeprom@50 {
+   compatible = "atmel,24c08";
+   reg = <0x50>;
+
+   partitions {
+   compatible = "fixed-partitions";
+
+   vpd {
+   offset = <0>;
+   size = <1022>;
+   };
+
+   bootcount_eeprom: bootcount {
+   offset = <1022>;
+   size = <2>;
+   };
+   };
+   };
+   };
+
+   i2c6: i2c@2 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <2>;
+   };
+
+   i2c7: i2c@3 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <3>;
+   };
+
+   i2c8: i2c@4 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   

[U-Boot] [PATCH v2 17/41] dm: i2c: EEPROM simulator allow tests visibility of addr and offset

2019-10-23 Thread Robert Beckett
Improve i2c EEPROM simulator testing by providing access functions to
check the previous chip addr and offset.

Given that we can now directly test the offsets, also simplified the
offset mapping and allow for wrapping acceses.

Signed-off-by: Robert Beckett 
---
 arch/sandbox/include/asm/test.h |  4 +++
 drivers/misc/i2c_eeprom_emul.c  | 61 +
 test/dm/i2c.c   | 50 +++
 3 files changed, 86 insertions(+), 29 deletions(-)

diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h
index cd2b9e3155..73cb451e7f 100644
--- a/arch/sandbox/include/asm/test.h
+++ b/arch/sandbox/include/asm/test.h
@@ -72,6 +72,10 @@ void sandbox_i2c_eeprom_set_test_mode(struct udevice *dev,
 
 void sandbox_i2c_eeprom_set_offset_len(struct udevice *dev, int offset_len);
 
+uint sanbox_i2c_eeprom_get_prev_addr(struct udevice *dev);
+
+uint sanbox_i2c_eeprom_get_prev_offset(struct udevice *dev);
+
 /**
  * sandbox_i2c_rtc_set_offset() - set the time offset from system/base time
  *
diff --git a/drivers/misc/i2c_eeprom_emul.c b/drivers/misc/i2c_eeprom_emul.c
index 29ed45923f..284267f2ea 100644
--- a/drivers/misc/i2c_eeprom_emul.c
+++ b/drivers/misc/i2c_eeprom_emul.c
@@ -27,6 +27,8 @@ struct sandbox_i2c_flash_plat_data {
 
 struct sandbox_i2c_flash {
uint8_t *data;
+   uint prev_addr; /* slave address of previous access */
+   uint prev_offset;   /* offset of previous access */
 };
 
 void sandbox_i2c_eeprom_set_test_mode(struct udevice *dev,
@@ -44,6 +46,20 @@ void sandbox_i2c_eeprom_set_offset_len(struct udevice *dev, 
int offset_len)
plat->offset_len = offset_len;
 }
 
+uint sanbox_i2c_eeprom_get_prev_addr(struct udevice *dev)
+{
+   struct sandbox_i2c_flash *priv = dev_get_priv(dev);
+
+   return priv->prev_addr;
+}
+
+uint sanbox_i2c_eeprom_get_prev_offset(struct udevice *dev)
+{
+   struct sandbox_i2c_flash *priv = dev_get_priv(dev);
+
+   return priv->prev_offset;
+}
+
 static int sandbox_i2c_eeprom_xfer(struct udevice *emul, struct i2c_msg *msg,
  int nmsgs)
 {
@@ -52,6 +68,10 @@ static int sandbox_i2c_eeprom_xfer(struct udevice *emul, 
struct i2c_msg *msg,
 
debug("\n%s\n", __func__);
debug_buffer(0, priv->data, 1, 16, 0);
+
+   /* store addr for testing visibity */
+   priv->prev_addr = msg->addr;
+
for (; nmsgs > 0; nmsgs--, msg++) {
struct sandbox_i2c_flash_plat_data *plat =
dev_get_platdata(emul);
@@ -60,11 +80,6 @@ static int sandbox_i2c_eeprom_xfer(struct udevice *emul, 
struct i2c_msg *msg,
 
if (!plat->size)
return -ENODEV;
-   if (msg->addr + msg->len > plat->size) {
-   debug("%s: Address %x, len %x is outside range 0..%x\n",
- __func__, msg->addr, msg->len, plat->size);
-   return -EINVAL;
-   }
len = msg->len;
debug("   %s: msg->len=%d",
  msg->flags & I2C_M_RD ? "read" : "write",
@@ -73,7 +88,16 @@ static int sandbox_i2c_eeprom_xfer(struct udevice *emul, 
struct i2c_msg *msg,
if (plat->test_mode == SIE_TEST_MODE_SINGLE_BYTE)
len = 1;
debug(", offset %x, len %x: ", offset, len);
-   memcpy(msg->buf, priv->data + offset, len);
+   if (offset + len > plat->size) {
+   int overflow = offset + len - plat->size;
+   int initial = len - overflow;
+
+   memcpy(msg->buf, priv->data + offset, initial);
+   memcpy(msg->buf + initial, priv->data,
+  overflow);
+   } else {
+   memcpy(msg->buf, priv->data + offset, len);
+   }
memset(msg->buf + len, '\xff', msg->len - len);
debug_buffer(0, msg->buf, 1, msg->len, 0);
} else if (len >= plat->offset_len) {
@@ -87,15 +111,24 @@ static int sandbox_i2c_eeprom_xfer(struct udevice *emul, 
struct i2c_msg *msg,
if (plat->test_mode == SIE_TEST_MODE_SINGLE_BYTE)
len = min(len, 1);
 
-   /* For testing, map offsets into our limited buffer */
-   for (i = 24; i > 0; i -= 8) {
-   if (offset > (1 << i)) {
-   offset = (offset >> i) |
-   (offset & ((1 << i) - 1));
-   offset += i;
-   }
+   /* store offset for testing visibility */
+   priv->prev_offset = offset;
+

[U-Boot] [PATCH v2 26/41] board: ge: mx53ppd: remove redundant power config

2019-10-23 Thread Robert Beckett
Remove unused power configuration.
The code never calls pmic_init, so this was not being used, and stops
the build if left enabled when CONFIG_DM_I2C_COMPAT is diabled.

Signed-off-by: Robert Beckett 
---
 include/configs/mx53ppd.h | 9 -
 1 file changed, 9 deletions(-)

diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h
index 65b8a56f7a..941b8c00cc 100644
--- a/include/configs/mx53ppd.h
+++ b/include/configs/mx53ppd.h
@@ -43,15 +43,6 @@
 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS   0
 
-/* PMIC Controller */
-#define CONFIG_POWER
-#define CONFIG_POWER_I2C
-#define CONFIG_DIALOG_POWER
-#define CONFIG_POWER_FSL
-#define CONFIG_POWER_FSL_MC13892
-#define CONFIG_SYS_DIALOG_PMIC_I2C_ADDR0x48
-#define CONFIG_SYS_FSL_PMIC_I2C_ADDR   0x8
-
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_BAUDRATE115200
-- 
2.20.1

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


[U-Boot] [PATCH v2 19/41] misc: i2c_eeprom: set offset len and chip addr offset mask

2019-10-23 Thread Robert Beckett
Set the correct offset length and chip address offset mask for each
device to allow correct access to total capacity of the devices.

Signed-off-by: Robert Beckett 
---
 drivers/misc/i2c_eeprom.c | 35 +++
 1 file changed, 35 insertions(+)

diff --git a/drivers/misc/i2c_eeprom.c b/drivers/misc/i2c_eeprom.c
index c948ed937a..9ce4757b30 100644
--- a/drivers/misc/i2c_eeprom.c
+++ b/drivers/misc/i2c_eeprom.c
@@ -14,6 +14,8 @@
 struct i2c_eeprom_drv_data {
u32 size; /* size in bytes */
u32 pagewidth; /* pagesize = 2^pagewidth */
+   u32 addr_offset_mask; /* bits in addr used for offset overflow */
+   u32 offset_len; /* size in bytes of offset */
 };
 
 int i2c_eeprom_read(struct udevice *dev, int offset, uint8_t *buf, int size)
@@ -139,6 +141,11 @@ static int i2c_eeprom_std_probe(struct udevice *dev)
 {
u8 test_byte;
int ret;
+   struct i2c_eeprom_drv_data *data =
+   (struct i2c_eeprom_drv_data *)dev_get_driver_data(dev);
+
+   i2c_set_chip_offset_len(dev, data->offset_len);
+   i2c_set_chip_addr_offset_mask(dev, data->addr_offset_mask);
 
/* Verify that the chip is functional */
ret = i2c_eeprom_read(dev, 0, _byte, 1);
@@ -151,71 +158,99 @@ static int i2c_eeprom_std_probe(struct udevice *dev)
 static const struct i2c_eeprom_drv_data eeprom_data = {
.size = 0,
.pagewidth = 0,
+   .addr_offset_mask = 0,
+   .offset_len = 1,
 };
 
 static const struct i2c_eeprom_drv_data mc24aa02e48_data = {
.size = 256,
.pagewidth = 3,
+   .addr_offset_mask = 0,
+   .offset_len = 1,
 };
 
 static const struct i2c_eeprom_drv_data atmel24c01a_data = {
.size = 128,
.pagewidth = 3,
+   .addr_offset_mask = 0,
+   .offset_len = 1,
 };
 
 static const struct i2c_eeprom_drv_data atmel24c02_data = {
.size = 256,
.pagewidth = 3,
+   .addr_offset_mask = 0,
+   .offset_len = 1,
 };
 
 static const struct i2c_eeprom_drv_data atmel24c04_data = {
.size = 512,
.pagewidth = 4,
+   .addr_offset_mask = 0x1,
+   .offset_len = 1,
 };
 
 static const struct i2c_eeprom_drv_data atmel24c08_data = {
.size = 1024,
.pagewidth = 4,
+   .addr_offset_mask = 0x3,
+   .offset_len = 1,
 };
 
 static const struct i2c_eeprom_drv_data atmel24c08a_data = {
.size = 1024,
.pagewidth = 4,
+   .addr_offset_mask = 0x3,
+   .offset_len = 1,
 };
 
 static const struct i2c_eeprom_drv_data atmel24c16a_data = {
.size = 2048,
.pagewidth = 4,
+   .addr_offset_mask = 0x7,
+   .offset_len = 1,
 };
 
 static const struct i2c_eeprom_drv_data atmel24mac402_data = {
.size = 256,
.pagewidth = 4,
+   .addr_offset_mask = 0,
+   .offset_len = 1,
 };
 
 static const struct i2c_eeprom_drv_data atmel24c32_data = {
.size = 4096,
.pagewidth = 5,
+   .addr_offset_mask = 0,
+   .offset_len = 2,
 };
 
 static const struct i2c_eeprom_drv_data atmel24c64_data = {
.size = 8192,
.pagewidth = 5,
+   .addr_offset_mask = 0,
+   .offset_len = 2,
 };
 
 static const struct i2c_eeprom_drv_data atmel24c128_data = {
.size = 16384,
.pagewidth = 6,
+   .addr_offset_mask = 0,
+   .offset_len = 2,
 };
 
 static const struct i2c_eeprom_drv_data atmel24c256_data = {
.size = 32768,
.pagewidth = 6,
+   .addr_offset_mask = 0,
+   .offset_len = 2,
 };
 
 static const struct i2c_eeprom_drv_data atmel24c512_data = {
.size = 65536,
.pagewidth = 6,
+   .addr_offset_mask = 0,
+   .offset_len = 2,
 };
 
 static const struct udevice_id i2c_eeprom_std_ids[] = {
-- 
2.20.1

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


[U-Boot] [PATCH v2 34/41] board: ge: mx53ppd: Use DM for ethernet

2019-10-23 Thread Robert Beckett
Add fec ethernet and pinctrl DT config.
Remove legacy iomux setup for fec.
Enable phylib and DM fec.
Use Kconfig for enabling fec.

Signed-off-by: Robert Beckett 
---
 arch/arm/dts/imx53-ppd.dts | 24 
 board/ge/mx53ppd/mx53ppd.c | 26 --
 configs/mx53ppd_defconfig  |  3 +++
 include/configs/mx53ppd.h  |  8 
 4 files changed, 27 insertions(+), 34 deletions(-)

diff --git a/arch/arm/dts/imx53-ppd.dts b/arch/arm/dts/imx53-ppd.dts
index 484447af10..d308abc09c 100644
--- a/arch/arm/dts/imx53-ppd.dts
+++ b/arch/arm/dts/imx53-ppd.dts
@@ -152,6 +152,21 @@
MX53_PAD_EIM_D17__GPIO3_17  0x1e4
>;
};
+
+   pinctrl_fec: fecgrp {
+   fsl,pins = <
+   MX53_PAD_FEC_MDC__FEC_MDC   0x0
+   MX53_PAD_FEC_MDIO__FEC_MDIO 0x0
+   MX53_PAD_FEC_REF_CLK__FEC_TX_CLK0x0
+   MX53_PAD_FEC_RX_ER__FEC_RX_ER   0x0
+   MX53_PAD_FEC_CRS_DV__FEC_RX_DV  0x0
+   MX53_PAD_FEC_RXD1__FEC_RDATA_1  0x0
+   MX53_PAD_FEC_RXD0__FEC_RDATA_0  0x0
+   MX53_PAD_FEC_TX_EN__FEC_TX_EN   0x0
+   MX53_PAD_FEC_TXD1__FEC_TDATA_1  0x0
+   MX53_PAD_FEC_TXD0__FEC_TDATA_0  0x0
+   >;
+   };
 };
 
 /* eMMC */
@@ -317,3 +332,12 @@
  {
u-boot,dm-pre-reloc;
 };
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_fec>;
+   phy-supply = <_3v3>;
+   phy-mode = "rmii";
+   phy-reset-gpios = < 16 GPIO_ACTIVE_LOW>;
+   status = "okay";
+};
diff --git a/board/ge/mx53ppd/mx53ppd.c b/board/ge/mx53ppd/mx53ppd.c
index 57bf03f659..486ef6d374 100644
--- a/board/ge/mx53ppd/mx53ppd.c
+++ b/board/ge/mx53ppd/mx53ppd.c
@@ -107,31 +107,6 @@ int board_ehci_hcd_init(int port)
 }
 #endif
 
-static void setup_iomux_fec(void)
-{
-   static const iomux_v3_cfg_t fec_pads[] = {
-   NEW_PAD_CTRL(MX53_PAD_FEC_MDIO__FEC_MDIO, PAD_CTL_HYS |
-PAD_CTL_DSE_HIGH | PAD_CTL_PUS_22K_UP |
-PAD_CTL_ODE),
-   NEW_PAD_CTRL(MX53_PAD_FEC_MDC__FEC_MDC, PAD_CTL_DSE_HIGH),
-   NEW_PAD_CTRL(MX53_PAD_FEC_RXD1__FEC_RDATA_1,
-PAD_CTL_HYS | PAD_CTL_PKE),
-   NEW_PAD_CTRL(MX53_PAD_FEC_RXD0__FEC_RDATA_0,
-PAD_CTL_HYS | PAD_CTL_PKE),
-   NEW_PAD_CTRL(MX53_PAD_FEC_TXD1__FEC_TDATA_1, PAD_CTL_DSE_HIGH),
-   NEW_PAD_CTRL(MX53_PAD_FEC_TXD0__FEC_TDATA_0, PAD_CTL_DSE_HIGH),
-   NEW_PAD_CTRL(MX53_PAD_FEC_TX_EN__FEC_TX_EN, PAD_CTL_DSE_HIGH),
-   NEW_PAD_CTRL(MX53_PAD_FEC_REF_CLK__FEC_TX_CLK,
-PAD_CTL_HYS | PAD_CTL_PKE),
-   NEW_PAD_CTRL(MX53_PAD_FEC_RX_ER__FEC_RX_ER,
-PAD_CTL_HYS | PAD_CTL_PKE),
-   NEW_PAD_CTRL(MX53_PAD_FEC_CRS_DV__FEC_RX_DV,
-PAD_CTL_HYS | PAD_CTL_PKE),
-   };
-
-   imx_iomux_v3_setup_multiple_pads(fec_pads, ARRAY_SIZE(fec_pads));
-}
-
 static int clock_1GHz(void)
 {
int ret;
@@ -170,7 +145,6 @@ void ppd_gpio_init(void)
 int board_early_init_f(void)
 {
setup_iomux_uart();
-   setup_iomux_fec();
ppd_gpio_init();
 
return 0;
diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig
index 2094e74c7d..1fa9715850 100644
--- a/configs/mx53ppd_defconfig
+++ b/configs/mx53ppd_defconfig
@@ -45,6 +45,9 @@ CONFIG_MISC=y
 CONFIG_I2C_EEPROM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC_IMX=y
+CONFIG_PHYLIB=y
+CONFIG_DM_ETH=y
+CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX5=y
diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h
index 3b1615338c..5b1c467554 100644
--- a/include/configs/mx53ppd.h
+++ b/include/configs/mx53ppd.h
@@ -28,12 +28,6 @@
 #define CONFIG_MXC_UART
 #define CONFIG_MXC_UART_BASE   UART1_BASE
 
-/* Eth Configs */
-
-#define CONFIG_FEC_MXC
-#define IMX_FEC_BASE   FEC_BASE_ADDR
-#define CONFIG_FEC_MXC_PHYADDR 0x1F
-
 /* USB Configs */
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_ASIX
@@ -49,8 +43,6 @@
 
 /* Command definition */
 
-#define CONFIG_ETHPRIME"FEC0"
-
 #define CONFIG_LOADADDR0x7200  /* loadaddr env var */
 
 #define PPD_CONFIG_NFS \
-- 
2.20.1

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


[U-Boot] [PATCH v2 16/41] i2c: add support for offset overflow in to address

2019-10-23 Thread Robert Beckett
Some devices (2 wire eeproms for example) use some bits from the chip
address to represent the high bits of the offset instead of or as well
as using multiple bytes for the offset, effectively stealing chip
addresses on the bus.

Add a chip offset mask that can be set for any i2c chip which gets
filled with the offset overflow during offset setup.

Signed-off-by: Robert Beckett 
Signed-off-by: Ian Ray 
---
 drivers/i2c/i2c-uclass.c | 34 +++---
 include/i2c.h| 33 +
 2 files changed, 60 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c
index e47abf1833..44aace3a36 100644
--- a/drivers/i2c/i2c-uclass.c
+++ b/drivers/i2c/i2c-uclass.c
@@ -52,16 +52,19 @@ void i2c_dump_msgs(struct i2c_msg *msg, int nmsgs)
 static int i2c_setup_offset(struct dm_i2c_chip *chip, uint offset,
uint8_t offset_buf[], struct i2c_msg *msg)
 {
-   int offset_len;
+   int offset_len = chip->offset_len;
 
msg->addr = chip->chip_addr;
+   if (chip->chip_addr_offset_mask)
+   msg->addr |= (offset >> (8 * offset_len)) &
+   chip->chip_addr_offset_mask;
msg->flags = chip->flags & DM_I2C_CHIP_10BIT ? I2C_M_TEN : 0;
msg->len = chip->offset_len;
msg->buf = offset_buf;
-   if (!chip->offset_len)
+   if (!offset_len)
return -EADDRNOTAVAIL;
-   assert(chip->offset_len <= I2C_MAX_OFFSET_LEN);
-   offset_len = chip->offset_len;
+   assert(offset_len <= I2C_MAX_OFFSET_LEN);
+
while (offset_len--)
*offset_buf++ = offset >> (8 * offset_len);
 
@@ -83,7 +86,7 @@ static int i2c_read_bytewise(struct udevice *dev, uint offset,
if (i2c_setup_offset(chip, offset + i, offset_buf, msg))
return -EINVAL;
ptr = msg + 1;
-   ptr->addr = chip->chip_addr;
+   ptr->addr = msg->addr;
ptr->flags = msg->flags | I2C_M_RD;
ptr->len = 1;
ptr->buf = [i];
@@ -139,7 +142,7 @@ int dm_i2c_read(struct udevice *dev, uint offset, uint8_t 
*buffer, int len)
ptr++;
 
if (len) {
-   ptr->addr = chip->chip_addr;
+   ptr->addr = msg->addr;
ptr->flags = chip->flags & DM_I2C_CHIP_10BIT ? I2C_M_TEN : 0;
ptr->flags |= I2C_M_RD;
ptr->len = len;
@@ -323,7 +326,8 @@ int i2c_get_chip(struct udevice *bus, uint chip_addr, uint 
offset_len,
struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
int ret;
 
-   if (chip->chip_addr == chip_addr) {
+   if (chip->chip_addr == (chip_addr &
+   ~chip->chip_addr_offset_mask)) {
ret = device_probe(dev);
debug("found, ret=%d\n", ret);
if (ret)
@@ -465,6 +469,22 @@ int i2c_get_chip_offset_len(struct udevice *dev)
return chip->offset_len;
 }
 
+int i2c_set_chip_addr_offset_mask(struct udevice *dev, uint mask)
+{
+   struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+
+   chip->chip_addr_offset_mask = mask;
+
+   return 0;
+}
+
+uint i2c_get_chip_addr_offset_mask(struct udevice *dev)
+{
+   struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+
+   return chip->chip_addr_offset_mask;
+}
+
 #ifdef CONFIG_DM_GPIO
 static void i2c_gpio_set_pin(struct gpio_desc *pin, int bit)
 {
diff --git a/include/i2c.h b/include/i2c.h
index 33570f5404..72e2e8e426 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -45,12 +45,26 @@ struct udevice;
  * represent up to 256 bytes. A value larger than 1 may be
  * needed for larger devices.
  * @flags: Flags for this chip (dm_i2c_chip_flags)
+ * @chip_addr_offset_mask: Mask of offset bits within chip_addr. Used for
+ *devices which steal addresses as part of offset.
+ *If offset_len is zero, then the offset is encoded
+ *completely within the chip address itself.
+ *e.g. a devce with chip address of 0x2c with 512
+ *registers might use the bottom bit of the address
+ *to indicate which half of the address space is being
+ *accessed while still only using 1 byte offset.
+ *This means it will respond to  chip address 0x2c and
+ *0x2d.
+ *A real world example is the Atmel AT24C04. It's
+ *datasheet explains it's usage of this addressing
+ *mode.
  * @emul: Emulator for this chip address (only used for emulation)
  */
 struct dm_i2c_chip {
uint chip_addr;
uint offset_len;
uint flags;
+   uint 

[U-Boot] [PATCH v2 09/41] board: ge: bx50v3: Add i2c bus description

2019-10-23 Thread Robert Beckett
Add i2c bus devicetree description

Signed-off-by: Robert Beckett 
---
 arch/arm/dts/imx6q-bx50v3.dts | 351 ++
 1 file changed, 351 insertions(+)

diff --git a/arch/arm/dts/imx6q-bx50v3.dts b/arch/arm/dts/imx6q-bx50v3.dts
index 2e2e3bbc24..4dd2ce3038 100644
--- a/arch/arm/dts/imx6q-bx50v3.dts
+++ b/arch/arm/dts/imx6q-bx50v3.dts
@@ -81,6 +81,61 @@
MX6QDL_PAD_GPIO_19__GPIO4_IO050x1b0b0
>;
};
+
+   pinctrl_i2c1: i2c1grp {
+   fsl,pins = <
+   MX6QDL_PAD_CSI0_DAT8__I2C1_SDA  0x4001b8b1
+   MX6QDL_PAD_CSI0_DAT9__I2C1_SCL  0x4001b8b1
+   >;
+   };
+
+   pinctrl_i2c2: i2c2grp {
+   fsl,pins = <
+   MX6QDL_PAD_KEY_COL3__I2C2_SCL   0x4001b8b1
+   MX6QDL_PAD_KEY_ROW3__I2C2_SDA   0x4001b8b1
+   >;
+   };
+
+   pinctrl_i2c3: i2c3grp {
+   fsl,pins = <
+   MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1
+   MX6QDL_PAD_GPIO_6__I2C3_SDA 0x4001b8b1
+   >;
+   };
+   pinctrl_i2c1_gpio: i2c1gpiogrp {
+   fsl,pins = <
+   MX6QDL_PAD_CSI0_DAT8__GPIO5_IO260x1b0b0
+   MX6QDL_PAD_CSI0_DAT9__GPIO5_IO270x1b0b0
+   >;
+   };
+
+   pinctrl_i2c2_gpio: i2c2gpiogrp {
+   fsl,pins = <
+   MX6QDL_PAD_KEY_COL3__GPIO4_IO12 0x1b0b0
+   MX6QDL_PAD_KEY_ROW3__GPIO4_IO13 0x1b0b0
+   >;
+   };
+
+   pinctrl_i2c3_gpio: i2c3gpiogrp {
+   fsl,pins = <
+   MX6QDL_PAD_GPIO_3__GPIO1_IO03   0x1b0b0
+   MX6QDL_PAD_GPIO_6__GPIO1_IO06   0x1b0b0
+   >;
+   };
+
+   pinctrl_pmic: pmicgrp {
+   fsl,pins = <
+   /* PMIC Interrupt */
+   MX6QDL_PAD_GPIO_18__GPIO7_IO13  0x1b0b0
+   >;
+   };
+
+   pinctrl_rtc: rtcgrp {
+   fsl,pins = <
+   /* RTC_INT */
+   MX6QDL_PAD_KEY_COL2__GPIO4_IO10 0x1b0b0
+   >;
+   };
 };
 
  {
@@ -145,3 +200,299 @@
  {
status = "okay";
 };
+
+/* I2C */
+ {
+   clock-frequency = <10>;
+   pinctrl-names = "default", "gpio";
+   pinctrl-0 = <_i2c1>;
+   pinctrl-1 = <_i2c1_gpio>;
+   sda-gpios = < 26 GPIO_ACTIVE_HIGH>;
+   scl-gpios = < 27 GPIO_ACTIVE_HIGH>;
+   status = "okay";
+
+   pca9547: mux@70 {
+   compatible = "nxp,pca9547";
+   reg = <0x70>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   mux1_i2c1: i2c@0 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <0x0>;
+
+   ads7830: ads7830@48 {
+   compatible = "ti,ads7830";
+   reg = <0x48>;
+   };
+
+   mma8453: mma8453@1c {
+   compatible = "fsl,mma8453";
+   reg = <0x1c>;
+   };
+   };
+
+   mux1_i2c2: i2c@1 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <0x1>;
+
+   eeprom: eeprom@50 {
+   compatible = "atmel,24c08";
+   reg = <0x50>;
+
+   partitions {
+   compatible = "fixed-partitions";
+
+   vpd {
+   offset = <0>;
+   size = <1022>;
+   };
+
+   bootcount {
+   offset = <1022>;
+   size = <2>;
+   };
+   };
+   };
+
+   mpl3115: mpl3115@60 {
+   compatible = "fsl,mpl3115";
+   reg = <0x60>;
+   };
+   };
+
+   mux1_i2c3: i2c@2 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <0x2>;
+   };
+
+   mux1_i2c4: i2c@3 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <0x3>;
+
+   };
+
+   mux1_i2c5: i2c@4 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <0x4>;
+
+

[U-Boot] [PATCH v2 40/41] power: regulator: add driver for Dialog DA9063 PMIC

2019-10-23 Thread Robert Beckett
From: Martin Fuzzey 

Add a driver for the regulators in the the DA9063 PMIC.

Robert Beckett: move regulator modes to header so board code can set
modes. Correct mode mask used in ldo_set_mode.

Signed-off-by: Martin Fuzzey 
Signed-off-by: Robert Beckett 
---
 drivers/power/regulator/Kconfig  |  10 +
 drivers/power/regulator/Makefile |   1 +
 drivers/power/regulator/da9063.c | 388 +++
 include/power/da9063_pmic.h  |  12 +
 4 files changed, 411 insertions(+)
 create mode 100644 drivers/power/regulator/da9063.c

diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig
index 9aa00fad42..ab58e2eb56 100644
--- a/drivers/power/regulator/Kconfig
+++ b/drivers/power/regulator/Kconfig
@@ -60,6 +60,16 @@ config SPL_DM_REGULATOR_BD71837
This config enables implementation of driver-model regulator uclass
features for regulators on ROHM BD71837 and BD71847 in SPL.
 
+config DM_REGULATOR_DA9063
+   bool "Enable Driver Model for REGULATOR DA9063"
+   depends on DM_REGULATOR && DM_PMIC_DA9063
+   help
+ This config enables implementation of driver-model regulator uclass
+ features for REGULATOR DA9063.
+ The driver implements get/set api for value, enable and mode for all
+ regulators. It also implements the get/set api for current for the
+ buck regulators.
+
 config DM_REGULATOR_PFUZE100
bool "Enable Driver Model for REGULATOR PFUZE100"
depends on DM_REGULATOR && DM_PMIC_PFUZE100
diff --git a/drivers/power/regulator/Makefile b/drivers/power/regulator/Makefile
index 6a3d4bbee4..b05a71562c 100644
--- a/drivers/power/regulator/Makefile
+++ b/drivers/power/regulator/Makefile
@@ -7,6 +7,7 @@
 obj-$(CONFIG_$(SPL_)DM_REGULATOR) += regulator-uclass.o
 obj-$(CONFIG_REGULATOR_ACT8846) += act8846.o
 obj-$(CONFIG_REGULATOR_AS3722) += as3722_regulator.o
+obj-$(CONFIG_DM_REGULATOR_DA9063) += da9063.o
 obj-$(CONFIG_DM_REGULATOR_MAX77686) += max77686.o
 obj-$(CONFIG_$(SPL_)DM_PMIC_PFUZE100) += pfuze100.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_BD71837) += bd71837.o
diff --git a/drivers/power/regulator/da9063.c b/drivers/power/regulator/da9063.c
new file mode 100644
index 00..8990be113e
--- /dev/null
+++ b/drivers/power/regulator/da9063.c
@@ -0,0 +1,388 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ *  Copyright (C) 2018 Flowbird
+ *  Martin Fuzzey  
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#defineDA9063_BUCK_EN  0x01
+#defineDA9063_LDO_EN   0x01
+#define DA9063_VBUCK_MASK  0x7F
+#define DA9063_BUCK_SL 0x80
+#define DA9063_LDO_SL  0x80
+
+#define DA9063_VLDO1_MASK  0x3F
+#define DA9063_VLDO2_MASK  0x3F
+#define DA9063_VLDO3_MASK  0x7F
+#define DA9063_VLDO4_MASK  0x7F
+#define DA9063_VLDO5_MASK  0x3F
+#define DA9063_VLDO6_MASK  0x3F
+#define DA9063_VLDO7_MASK  0x3F
+#define DA9063_VLDO8_MASK  0x3F
+#define DA9063_VLDO9_MASK  0x3F
+#define DA9063_VLDO10_MASK 0x3F
+#define DA9063_VLDO11_MASK 0x3F
+
+#define DA9063_BUCK_MODE_MASK  0xC0
+#defineDA9063_BUCK_MODE_MANUAL 0x00
+#defineDA9063_BUCK_MODE_SLEEP  0x40
+#defineDA9063_BUCK_MODE_SYNC   0x80
+#defineDA9063_BUCK_MODE_AUTO   0xC0
+
+#define DA9063_BIO_ILIM_MASK   0x0F
+#define DA9063_BMEM_ILIM_MASK  0xF0
+#define DA9063_BPRO_ILIM_MASK  0x0F
+#define DA9063_BPERI_ILIM_MASK 0xF0
+#define DA9063_BCORE1_ILIM_MASK0x0F
+#define DA9063_BCORE2_ILIM_MASK0xF0
+
+struct da9063_reg_info {
+   uint min_uV;
+   uint step_uV;
+   uint max_uV;
+   uint min_uA;
+   uint step_uA;
+   uint max_uA;
+   uint en_reg;
+   uint vsel_reg;
+   uint mode_reg;
+   uint ilim_reg;
+   u8 en_mask;
+   u8 vsel_mask;
+   u8 ilim_mask;
+   const char *dt_node_name;
+   const int *current_limits;
+};
+
+struct da9063_priv {
+   const struct da9063_reg_info *reg_info;
+};
+
+static struct dm_regulator_mode da9063_ldo_modes[] = {
+   { .id = DA9063_LDOMODE_SLEEP,
+   .register_value = DA9063_LDO_SL, .name = "SLEEP" },
+   { .id = DA9063_LDOMODE_NORMAL,
+   .register_value = 0, .name = "NORMAL" },
+};
+
+#define DA9063_LDO(regl_name, min_mV, step_mV, max_mV) \
+   .min_uV = (min_mV) * 1000, \
+   .step_uV = (step_mV) * 1000, \
+   .max_uV = (max_mV) * 1000, \
+   .en_reg = DA9063_REG_##regl_name##_CONT, \
+   .en_mask = DA9063_LDO_EN, \
+   .vsel_reg = DA9063_REG_V##regl_name##_A, \
+   .vsel_mask = DA9063_V##regl_name##_MASK, \
+   .mode_reg = DA9063_REG_V##regl_name##_A \
+
+/* This array is directly indexed so must stay in numerical order */
+static const struct da9063_reg_info da9063_ldo_info[] = {
+   { DA9063_LDO(LDO1, 600, 20, 1860) },
+   { DA9063_LDO(LDO2, 600, 20, 1860) },
+   { DA9063_LDO(LDO3, 900, 20, 3440) },
+   { DA9063_LDO(LDO4, 900, 20, 3440) },
+   { 

[U-Boot] [PATCH v2 24/41] board: ge: bx50v3, mx53ppd: use DM rtc

2019-10-23 Thread Robert Beckett
Convert common code to use DM rtc.
Remove old (pre-DM) rtc defines and config.
Add uboot specific devicetree binding name for bx50v3 rtc

Signed-off-by: Robert Beckett 
---
 arch/arm/dts/imx6q-bx50v3.dts |  2 +-
 board/ge/common/ge_common.c   | 17 ++---
 configs/ge_bx50v3_defconfig   |  2 ++
 configs/mx53ppd_defconfig |  1 +
 include/configs/ge_bx50v3.h   |  4 
 include/configs/mx53ppd.h |  3 ---
 6 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/arch/arm/dts/imx6q-bx50v3.dts b/arch/arm/dts/imx6q-bx50v3.dts
index 4d40980254..0f27c32db6 100644
--- a/arch/arm/dts/imx6q-bx50v3.dts
+++ b/arch/arm/dts/imx6q-bx50v3.dts
@@ -493,7 +493,7 @@
};
 
rtc@32 {
-   compatible = "epson,rx8010";
+   compatible = "epson,rx8010sj-rtc", "epson,rx8010";
pinctrl-names = "default";
pinctrl-0 = <_rtc>;
reg = <0x32>;
diff --git a/board/ge/common/ge_common.c b/board/ge/common/ge_common.c
index d7e21deca7..48c3778046 100644
--- a/board/ge/common/ge_common.c
+++ b/board/ge/common/ge_common.c
@@ -5,27 +5,24 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 void check_time(void)
 {
+   struct udevice *dev;
int ret, i;
struct rtc_time tm;
u8 retry = 3;
 
-   unsigned int current_i2c_bus = i2c_get_bus_num();
-
-   ret = i2c_set_bus_num(CONFIG_SYS_RTC_BUS_NUM);
-   if (ret < 0) {
+   ret = uclass_get_device(UCLASS_RTC, 0, );
+   if (ret) {
env_set("rtc_status", "FAIL");
return;
}
 
-   rtc_init();
-
for (i = 0; i < retry; i++) {
-   ret = rtc_get();
+   ret = dm_rtc_get(dev, );
if (!ret || ret == -EINVAL)
break;
}
@@ -40,7 +37,7 @@ void check_time(void)
tm.tm_year = 2036;
 
for (i = 0; i < retry; i++) {
-   ret = rtc_set();
+   ret = dm_rtc_set(dev, );
if (!ret)
break;
}
@@ -55,7 +52,5 @@ void check_time(void)
env_set("rtc_status", "2038");
else
env_set("rtc_status", "OK");
-
-   i2c_set_bus_num(current_i2c_bus);
 }
 
diff --git a/configs/ge_bx50v3_defconfig b/configs/ge_bx50v3_defconfig
index 519b3e1bb1..5768757573 100644
--- a/configs/ge_bx50v3_defconfig
+++ b/configs/ge_bx50v3_defconfig
@@ -60,6 +60,8 @@ CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
 CONFIG_PWM_IMX=y
+CONFIG_DM_RTC=y
+CONFIG_RTC_RX8010SJ=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_MXC_SPI=y
diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig
index db00481266..9fd6280825 100644
--- a/configs/mx53ppd_defconfig
+++ b/configs/mx53ppd_defconfig
@@ -49,6 +49,7 @@ CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX5=y
 CONFIG_PWM_IMX=y
+CONFIG_DM_RTC=y
 CONFIG_RTC_S35392A=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_MX5=y
diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h
index b2c114409d..fd23cbe507 100644
--- a/include/configs/ge_bx50v3.h
+++ b/include/configs/ge_bx50v3.h
@@ -190,10 +190,6 @@
 #define CONFIG_PCIE_IMX_PERST_GPIO IMX_GPIO_NR(7, 12)
 #define CONFIG_PCIE_IMX_POWER_GPIO IMX_GPIO_NR(1, 5)
 
-#define CONFIG_RTC_RX8010SJ
-#define CONFIG_SYS_RTC_BUS_NUM 2
-#define CONFIG_SYS_I2C_RTC_ADDR0x32
-
 #define CONFIG_BCH
 
 #endif /* __GE_BX50V3_CONFIG_H */
diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h
index b21235dd57..65b8a56f7a 100644
--- a/include/configs/mx53ppd.h
+++ b/include/configs/mx53ppd.h
@@ -43,9 +43,6 @@
 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS   0
 
-#define CONFIG_SYS_RTC_BUS_NUM 2
-#define CONFIG_SYS_I2C_RTC_ADDR0x30
-
 /* PMIC Controller */
 #define CONFIG_POWER
 #define CONFIG_POWER_I2C
-- 
2.20.1

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


  1   2   3   >