AM335X Bootp of u-boot-spl.bin followed by tftp of u-boot.img. Is it possible?

2020-07-27 Thread Richard Lourette
I am working with a board with the AM3352 that only has ethernet and a
serial port (UART0). I am able to use the bootstrap of the AM3352 to
network boot the u-boot-spl.bin file. I can't get the second stage
u-boot.img to network load via TFTP. My spl image says there are no
etjermet devices found.

1) My first question, is TFTP booting u-boot.img possible with the AM3352?

2) If it is, any thoughts on how I get u-boot-spl.bin to use ethernet for
loading the second image?

Thanks

With some debugging enabled (I deleted all the memory allocation print
statements):

Trying to boot from eth device
env_driver_lookup: No environment driver for location 2
Using default environment
Initial value for argc=3
Final value for argc=3
No ethernet found.
No Ethernet devices found
SPL: failed to boot from all boot devices


[ANN] U-Boot v2020.10-rc1 released

2020-07-27 Thread Tom Rini
Hey all,

It's the day after release day, and here is v2020.10-rc1.  There's a few
more PRs I expect to see soon and a few more changes to bring in from my
own queue.

In terms of a changelog, 
git log --merges v2020.07..v2020.10-rc1
contains what I've pulled but as always, better PR messages and tags
will provide better results here.

I'm planning on doing the standard every other Monday -rc releases from
here on out and with a release on October 5th.  Thanks all!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PULL u-boot] Please pull u-boot-amlogic-20200727

2020-07-27 Thread Tom Rini
On Mon, Jul 27, 2020 at 06:24:05PM +0200, Neil Armstrong wrote:

> Hi Tom,
> 
> This PR fixes a bug when the Amlogic UART detects error on the console line
> and enables HDMI, USB Keyboard & ADC for the Odroid-C2.
> 
> The CI job is at 
> https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic/pipelines/4208
> 
> Thanks,
> Neil
> 
> The following changes since commit 3773028fced4795d52f02b387496395ec387f3bb:
> 
>   Merge branch '2020-07-27-misc-env-improvements' (2020-07-27 09:25:53 -0400)
> 
> are available in the Git repository at:
> 
>   https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic.git 
> tags/u-boot-amlogic-20200727
> 
> for you to fetch changes up to 95ca2df3fd8f7b2cc995bccb2b46cd5650c4a9a7:
> 
>   configs: odroid-c2: update for HDMI output, ADC & USB keyboard (2020-07-27 
> 16:35:56 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: pull request of u-boot-fsl-qoriq for v2020.10

2020-07-27 Thread Tom Rini
On Mon, Jul 27, 2020 at 02:35:15PM +, Priyanka Jain wrote:

> Dear Tom,
> 
> Please find my pull-request for u-boot-fsl-qoriq/master
> https://travis-ci.org/github/p-priyanka-jain/u-boot/builds/712122749
> 
> Summary
> Bug fixes and updates on ls2088a,ls1028a, ls1046a, ls1043a, ls1012a
> lx2-watchdog support
> layerscape:pci-endpoint support, spin table relocation fixes and cleanups
> fsl-crypto: RNG support and bug fixes
> 
> Thanks
> Priyanka

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


[PATCH v2] fit_image: Use calloc() to fix reproducibility issue

2020-07-27 Thread Fabio Estevam
Vagrant Cascadian reported that mx6cuboxi target no longer builds
reproducibility on Debian.

One example of builds mismatches:

00096680: 696e 6700 736f 756e 642d 6461 6900 6465  ing.sound-dai.de
-00096690: 7465 6374 2d67 7069 6f73 tect-gpios..
+00096690: 7465 6374 2d67 7069 6f73 0061tect-gpios.a

This problem happens because all the buffers in fit_image.c are
allocated via malloc(), which does not zero out the allocated buffer.

Using calloc() fixes this unpredictable behaviour as it guarantees
that the allocated buffer are zero initialized.

Reported-by: Vagrant Cascadian 
Suggested-by: Tom Rini 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Improve the commit log description by stating why calloc() helps.

 tools/fit_image.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/fit_image.c b/tools/fit_image.c
index a082d9386d..0c6185d892 100644
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -388,7 +388,7 @@ static int fit_build(struct image_tool_params *params, 
const char *fname)
size = fit_calc_size(params);
if (size < 0)
return -1;
-   buf = malloc(size);
+   buf = calloc(1, size);
if (!buf) {
fprintf(stderr, "%s: Out of memory (%d bytes)\n",
params->cmdname, size);
@@ -467,7 +467,7 @@ static int fit_extract_data(struct image_tool_params 
*params, const char *fname)
 * Allocate space to hold the image data we will extract,
 * extral space allocate for image alignment to prevent overflow.
 */
-   buf = malloc(fit_size + (align_size * image_number));
+   buf = calloc(1, fit_size + (align_size * image_number));
if (!buf) {
ret = -ENOMEM;
goto err_munmap;
@@ -572,7 +572,7 @@ static int fit_import_data(struct image_tool_params 
*params, const char *fname)
 
/* Allocate space to hold the new FIT */
size = sbuf.st_size + 16384;
-   fdt = malloc(size);
+   fdt = calloc(1, size);
if (!fdt) {
fprintf(stderr, "%s: Failed to allocate memory (%d bytes)\n",
__func__, size);
@@ -673,7 +673,7 @@ static int copyfile(const char *src, const char *dst)
goto out;
}
 
-   buf = malloc(512);
+   buf = calloc(1, 512);
if (!buf) {
printf("Can't allocate buffer to copy file\n");
goto out;
-- 
2.17.1



Re: [PATCH 1/3] mkimage: fit: only process one cipher node

2020-07-27 Thread Simon Glass
Hi Patrick,

On Fri, 17 Jul 2020 at 05:30,  wrote:
>
> From: Patrick Oppenlander 
>
> Previously mkimage would process any node matching the regex cipher.*
> and apply the ciphers to the image data in the order they appeared in
> the FDT. This meant that data could be inadvertently ciphered multiple
> times.
>
> Switch to processing a single cipher node which exactly matches
> FIT_CIPHER_NODENAME.
>
> Signed-off-by: Patrick Oppenlander 
> ---
>  tools/image-host.c | 56 +-
>  1 file changed, 21 insertions(+), 35 deletions(-)

+Philippe Reynes for a review on these three patches too.

>
> diff --git a/tools/image-host.c b/tools/image-host.c
> index 9a83b7f675..8fa1b9aba7 100644
> --- a/tools/image-host.c
> +++ b/tools/image-host.c
> @@ -323,15 +323,15 @@ err:
>  static int fit_image_setup_cipher(struct image_cipher_info *info,
>   const char *keydir, void *fit,
>   const char *image_name, int image_noffset,
> - const char *node_name, int noffset)
> + int noffset)
>  {
> char *algo_name;
> char filename[128];
> int ret = -1;
>
> if (fit_image_cipher_get_algo(fit, noffset, &algo_name)) {
> -   printf("Can't get algo name for cipher '%s' in image '%s'\n",
> -  node_name, image_name);
> +   printf("Can't get algo name for cipher in image '%s'\n",
> +  image_name);
> goto out;
> }
>
> @@ -340,16 +340,16 @@ static int fit_image_setup_cipher(struct 
> image_cipher_info *info,
> /* Read the key name */
> info->keyname = fdt_getprop(fit, noffset, FIT_KEY_HINT, NULL);
> if (!info->keyname) {
> -   printf("Can't get key name for cipher '%s' in image '%s'\n",
> -  node_name, image_name);
> +   printf("Can't get key name for cipher in image '%s'\n",
> +  image_name);
> goto out;
> }
>
> /* Read the IV name */
> info->ivname = fdt_getprop(fit, noffset, "iv-name-hint", NULL);
> if (!info->ivname) {
> -   printf("Can't get iv name for cipher '%s' in image '%s'\n",
> -  node_name, image_name);
> +   printf("Can't get iv name for cipher in image '%s'\n",
> +  image_name);
> goto out;
> }
>
> @@ -428,8 +428,7 @@ int fit_image_write_cipher(void *fit, int image_noffset, 
> int noffset,
>  static int
>  fit_image_process_cipher(const char *keydir, void *keydest, void *fit,
>  const char *image_name, int image_noffset,
> -const char *node_name, int node_noffset,
> -const void *data, size_t size,
> +int node_noffset, const void *data, size_t size,
>  const char *cmdname)
>  {
> struct image_cipher_info info;
> @@ -440,7 +439,7 @@ fit_image_process_cipher(const char *keydir, void 
> *keydest, void *fit,
> memset(&info, 0, sizeof(info));
>
> ret = fit_image_setup_cipher(&info, keydir, fit, image_name,
> -image_noffset, node_name, node_noffset);
> +image_noffset, node_noffset);
> if (ret)
> goto out;
>
> @@ -482,7 +481,7 @@ int fit_image_cipher_data(const char *keydir, void 
> *keydest,
> const char *image_name;
> const void *data;
> size_t size;
> -   int node_noffset;
> +   int cipher_node_offset;
>
> /* Get image name */
> image_name = fit_get_name(fit, image_noffset, NULL);
> @@ -497,32 +496,19 @@ int fit_image_cipher_data(const char *keydir, void 
> *keydest,
> return -1;
> }
>
> -   /* Process all hash subnodes of the component image node */
> -   for (node_noffset = fdt_first_subnode(fit, image_noffset);
> -node_noffset >= 0;
> -node_noffset = fdt_next_subnode(fit, node_noffset)) {
> -   const char *node_name;
> -   int ret = 0;
> -
> -   node_name = fit_get_name(fit, node_noffset, NULL);
> -   if (!node_name) {
> -   printf("Can't get node name\n");
> -   return -1;
> -   }
>
> -   if (IMAGE_ENABLE_ENCRYPT && keydir &&
> -   !strncmp(node_name, FIT_CIPHER_NODENAME,
> -strlen(FIT_CIPHER_NODENAME)))
> -   ret = fit_image_process_cipher(keydir, keydest,
> -  fit, image_name,
> -  image_noffset,
> -  node_name, 
> node_noffset,
> -   

Re: [PATCH] dtoc: add coverage test for unicode error

2020-07-27 Thread Simon Glass
Hi Walter,

On Mon, 20 Jul 2020 at 12:29, Walter Lozano  wrote:
>
> Add an additional test to dtoc in order improve the coverage,
> specifically to take into account the case of unicode error when
> scanning drivers.
>
> Signed-off-by: Walter Lozano 
> ---
>
>  tools/dtoc/dtb_platdata.py | 14 +++---
>  tools/dtoc/test_dtoc.py| 18 ++
>  2 files changed, 29 insertions(+), 3 deletions(-)

This seems to be missing a .cxx file, so gives a build error.

Regards,
Simo


Re: [PATCH] CONFIG_NR_DRAM_BANKS: Remove unreferenced code as its always defined

2020-07-27 Thread Simon Glass
On Fri, 24 Jul 2020 at 08:54, Stefan Roese  wrote:
>
> Since commit 86cf1c82850f ("configs: Migrate CONFIG_NR_DRAM_BANKS") &
> commit 999a772d9f24 ("Kconfig: Migrate CONFIG_NR_DRAM_BANKS"),
> CONFIG_NR_DRAM_BANKS is always defined with a value (4 is default).
> It makes no sense to still carry code that is guarded with
> "#ifndef CONFIG_NR_DRAM_BANKS" (and similar). This patch removes
> all these unreferenced code paths.
>
> Signed-off-by: Stefan Roese 
> Cc: Tom Rini 
> Cc: Ramon Fried 
> Cc: Simon Glass 
> Cc: Michal Simek 
> ---
>  arch/x86/cpu/broadwell/cpu_from_spl.c |  2 --
>  board/xilinx/zynqmp/zynqmp.c  |  2 --
>  cmd/bdinfo.c  |  2 --
>  common/board_f.c  |  6 +-
>  common/image.c|  3 +--
>  common/init/handoff.c |  4 
>  drivers/pci/pci-uclass.c  | 17 +
>  include/asm-generic/u-boot.h  |  2 --
>  include/handoff.h |  2 --
>  lib/fdtdec.c  |  5 -
>  lib/lmb.c |  7 ---
>  11 files changed, 3 insertions(+), 49 deletions(-)

Reviewed-by: Simon Glass 


Re: [PATCH] log: Allow LOG_DEBUG to always enable log output

2020-07-27 Thread Simon Glass
Hi Heinrich,

On Mon, 27 Jul 2020 at 00:15, Heinrich Schuchardt  wrote:
>
> On 7/27/20 4:27 AM, Simon Glass wrote:
> > At present if CONFIG_LOG enabled, putting LOG_DEBUG at the top of a file
> > (before log.h inclusion) causes _log() to be executed for every log()
> > call, regardless of the build- or run-time logging level.
> >
> > However there is no guarantee that the log record will actually be
> > displayed. If the current log level is lower than LOGL_DEBUG then it will
> > not be.
> >
> > Add a way to signal that the log record should always be displayed and
> > update log_passes_filters() to handle this.
> >
> > Signed-off-by: Simon Glass 
>
> Hello Simon,
>
> we have different debug levels:
>
> LOGL_DEBUG
> LOGL_DEBUG_CONTENT
> LOGL_DEBUG_IO
>
> If I understand you right, with your patch putting #define LOG_DEBUG at
> the top of the file enables all of these. This may be more than I want.
>
> Wouldn't it be more flexible if we could put something like:
>
> #define LOG_DEBUG LOGL_DEBUG
>
> at the top of the file if we want logging up to level 7 in this file.

Actually the way I implemented it, it only enables update LOGL_DEBUG.

Certainly your idea is more flexible. I wonder if we could make the
level optional, so:

#define LOG_DEBUG

means

#define LOG_DEBUG LOGL_DEBUG

Regards,
Simon


Re: [PATCH 1/1] sandbox: support CTRL-C processing in U-Boot

2020-07-27 Thread Simon Glass
Hi Heinrich,

On Sat, 25 Jul 2020 at 09:05, Heinrich Schuchardt  wrote:
>
> Currently if SIGINT is received, it terminates U-Boot. This does not allow
> testing the handling of CTRL-C in U-Boot and in UEFI applications.
>
> Let the serial console driver provide character 0x03 if SIGINT occurs. We
> can still exit U-Boot using the poweroff command.
>
> Adjust the sandbox test_ctrl_c() Python test accordingly.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
>  arch/sandbox/cpu/os.c  | 15 ---
>  drivers/serial/sandbox.c   | 11 ---
>  include/os.h   | 14 ++
>  test/py/tests/test_sandbox_exit.py |  9 -
>  4 files changed, 42 insertions(+), 7 deletions(-)

I do want Ctrl-C to work. It is just too annoying otherwise.

It looks to me like you may want to add a fourth terminal mode? Or
perhaps make it changeable at run-time so you can select a particular
mode for running a test?

Regards,
SImon


Re: [PATCH 1/1] dm: fix ofnode_read_addr/size_cells()

2020-07-27 Thread Simon Glass
Hi Heinrich,

On Sat, 25 Jul 2020 at 13:39, Heinrich Schuchardt  wrote:
>
> In the case of the live tree ofnode_read_addr_cells() and
> ofnode_read_size_cells() return the #address-cells and #size-cells defined
> in the parent node. With the patch the same is done for a non-live tree.
>
> The only consumer of these functions is currently the CFI flash driver.
>
> This patch fixes the incorrect parsing of the device tree leading to
> 'saveenv' failing on qemu_arm64_defconfig.
>
> For testing qemu-system-aarch64 has to be called with
>
> -drive if=pflash,format=raw,index=1,file=envstore.img
>
> to provide the flash memory. envstore.img must be 64 MiB large.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
>  drivers/core/ofnode.c | 20 ++--
>  include/dm/read.h | 10 ++
>  2 files changed, 20 insertions(+), 10 deletions(-)
>

Please can we have a test for this in test/dm/ofnode.c ?

Regards,
Simon


Re: Improvements to FIT ciphering

2020-07-27 Thread Patrick Oppenlander
On Fri, Jul 24, 2020 at 12:06 PM Patrick Oppenlander
 wrote:
>
> Hi,
>
> I recently posted some patches to the list [1], [2], [3] to address
> some issues with the cipher support in mkimage. Hopefully someone gets
> a chance to review these patches as I think mkimage is a bit broken
> without them.
>
> While considering using U-Boot cipher support in a product I work on,
> I have convinced myself that the handling of the encryption IV could
> be better, especially given that mkimage is using AES-CBC mode.
> Please, correct me if I have missed something.
>
> Issue #1
> 
>
> Currently, mkimage treats the IV in the same manner as the encryption
> key. There is an iv-name-hint property which mkimage uses to read the
> IV from a file in the keys directory. This can then be written to
> u-boot.dtb along with the encryption key.
>
> The problem with that is that u-boot.dtb is baked in at production
> time and is generally not field upgradable. That means that the IV is
> also baked in which is considered bad practice especially when using
> CBC mode (see CBC IV attack). In general it is my understanding that
> you should never use a key+IV twice regardless of cipher or mode.
>
> In my opinion a better solution would have been to write the IV into
> the FIT image instead of iv-name-hint (it's only 16 bytes!), and
> regenerate it (/dev/random?) each and every time the data is ciphered.
>
> An even better solution is to use AES-GCM (or something similar) as
> this includes the IV with the ciphertext, simplifying the above, and
> also provides authentication addressing another issue (see below).
>
> Issue #2
> ===
>
> The current implementation uses encrypt-then-sign. I like this
> approach as it means that the FIT image can be verified outside of
> U-Boot without requiring encryption keys. It is also considered best
> practise.
>
> However, for this to be secure, the details of the cipher need to be
> included in the signature, otherwise an attacker can change the cipher
> or key/iv properties.
>
> I do not believe that properties in the cipher node are currently
> included when signing a FIT configuration including an encrypted
> image. That should be a simple fix. Fixing it for image signatures
> might be a bit more tricky.
>
> Issue #3
> ===
>
> Due to the nature of encrypt-then-sign U-Boot can verify that the
> ciphertext is unmodified, but it has no way of making sure that the
> key used to encrypt the image matches the key in u-boot.fit used for
> decryption. This can result in an attempt to boot gibberish and I
> think it can open up certain attack vectors.
>
> The best way I know of to fix this is to use an authenticated
> encryption mode such as AES-GCM or something similar.
>
>
> Kind regards,
>
> Patrick
>
> [1] https://lists.denx.de/pipermail/u-boot/2020-July/420399.html
> [2] https://lists.denx.de/pipermail/u-boot/2020-July/420400.html
> [3] https://lists.denx.de/pipermail/u-boot/2020-July/420401.html

Hi Simon,

I posted this writeup to the u-boot list and forgot to CC you. Sorry about that.

Patrick


Re: [PATCH] imx: Add MYiR Tech MYS-6ULX support

2020-07-27 Thread Parthiban
Dear Fabio,

On 7/26/20 4:53 PM, Fabio Estevam wrote:
> Hi Parthiban,
> 
> Your patch looks great. Only some minor observations:

Thanks, fixed in v2.

> 
> On Sun, Jul 5, 2020 at 12:48 PM Parthiban Nallathambi
>  wrote:
> 
>> +#ifdef CONFIG_FEC_MXC
>> +
>> +#define ENET_CLK_PAD_CTRL (PAD_CTL_DSE_40ohm   | PAD_CTL_SRE_FAST)
>> +#define ENET_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_PUE   | \
>> +  PAD_CTL_SPEED_HIGH  | PAD_CTL_DSE_48ohm | \
>> +  PAD_CTL_SRE_FAST)
>> +#define MDIO_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_PUE  | \
>> +  PAD_CTL_DSE_48ohm   | PAD_CTL_SRE_FAST | \
>> +  PAD_CTL_ODE)
>> +
>> +static iomux_v3_cfg_t const fec1_pads[] = {
>> +   MX6_PAD_GPIO1_IO06__ENET1_MDIO | MUX_PAD_CTRL(MDIO_PAD_CTRL),
>> +   MX6_PAD_GPIO1_IO07__ENET1_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL),
>> +   MX6_PAD_ENET1_TX_DATA0__ENET1_TDATA00 | MUX_PAD_CTRL(ENET_PAD_CTRL),
>> +   MX6_PAD_ENET1_TX_DATA1__ENET1_TDATA01 | MUX_PAD_CTRL(ENET_PAD_CTRL),
>> +   MX6_PAD_ENET1_TX_EN__ENET1_TX_EN | MUX_PAD_CTRL(ENET_PAD_CTRL),
>> +   MX6_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 | 
>> MUX_PAD_CTRL(ENET_CLK_PAD_CTRL),
>> +   MX6_PAD_ENET1_RX_DATA0__ENET1_RDATA00 | MUX_PAD_CTRL(ENET_PAD_CTRL),
>> +   MX6_PAD_ENET1_RX_DATA1__ENET1_RDATA01 | MUX_PAD_CTRL(ENET_PAD_CTRL),
>> +   MX6_PAD_ENET1_RX_ER__ENET1_RX_ER | MUX_PAD_CTRL(ENET_PAD_CTRL),
>> +   MX6_PAD_ENET1_RX_EN__ENET1_RX_EN | MUX_PAD_CTRL(ENET_PAD_CTRL),
>> +};
>> +
>> +static void setup_iomux_fec(void)
>> +{
>> +   imx_iomux_v3_setup_multiple_pads(fec1_pads, ARRAY_SIZE(fec1_pads));
>> +}
> 
> The FEC IOMUX configuration can be retrieved from the device tree
> since you use DM_ETH, so the FEC IOMUX board code can be dropeed.
> 
>> +/* Miscellaneous configurable options */
>> +#define CONFIG_SYS_MEMTEST_START   0x8000
>> +#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 
>> 0x1000)
> 
> These options have been moved to Kconfig since:
> 
> commit 702de89cc6a34c1c23dd3d987b0472b2cecdb63c
> Author: Ashok Reddy Soma 
> Date:   Mon May 4 15:26:21 2020 +0200
> 
> treewide: mem: Move mtest related defines to Kconfig
> 
> Move below defines which are used by mtest utility to Kconfig.
> CONFIG_SYS_MEMTEST_START
> CONFIG_SYS_MEMTEST_END
> 
> Signed-off-by: Ashok Reddy Soma 
> Signed-off-by: Michal Simek 
> [trini: Fix kmcoge5ne board, re-run migration as well]
> Signed-off-by: Tom Rini 
> 
> Thanks
> 

-- 
Thanks,
Parthiban N


[PATCH v2] imx: Add MYiR Tech MYS-6ULX support

2020-07-27 Thread Parthiban Nallathambi
MYS-6ULX is single board computer (SBC) comes with eMMC or NAND based
on imx6ULL SoC from NXP and provision for expansion board. This
commit adds support only for SBC with NAND.

CPU:   Freescale i.MX6ULL rev1.1 528 MHz (running at 396 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 45C
Reset cause: WDOG
Model: MYiR i.MX6ULL MYS-6ULX Single Board Computer with NAND
Board: MYiR MYS-6ULX 6ULL Single Board Computer
DRAM:  256 MiB
NAND:  256 MiB
MMC:   FSL_SDHC: 0
In:serial@202
Out:   serial@202
Err:   serial@202
Net:   FEC0

Working:
 - Eth0
 - MMC/SD
 - NAND
 - UART 1
 - USB host

Signed-off-by: Parthiban Nallathambi 
---

Notes:
Changelog v2:
- remove iomux for FEC in favout of dts
- move SYS_MEMSET_* to defconfig
- sync devicetree with Linux Kernel accepted version
- rebased to master

 arch/arm/Kconfig|   1 +
 arch/arm/dts/Makefile   |   1 +
 arch/arm/dts/imx6ull-myir-mys-6ulx-eval.dts |  19 ++
 arch/arm/dts/imx6ull-myir-mys-6ulx.dtsi | 238 
 arch/arm/dts/imx6ull-mys-6ulx-u-boot.dtsi   |  24 ++
 arch/arm/mach-imx/mx6/Kconfig   |  12 +
 board/myir/mys_6ulx/Kconfig |  12 +
 board/myir/mys_6ulx/MAINTAINERS |   9 +
 board/myir/mys_6ulx/Makefile|   4 +
 board/myir/mys_6ulx/README  |  52 +
 board/myir/mys_6ulx/mys_6ulx.c  | 117 ++
 board/myir/mys_6ulx/spl.c   | 206 +
 configs/myir_mys_6ulx_defconfig |  69 ++
 include/configs/mys_6ulx.h  |  76 +++
 14 files changed, 840 insertions(+)
 create mode 100644 arch/arm/dts/imx6ull-myir-mys-6ulx-eval.dts
 create mode 100644 arch/arm/dts/imx6ull-myir-mys-6ulx.dtsi
 create mode 100644 arch/arm/dts/imx6ull-mys-6ulx-u-boot.dtsi
 create mode 100644 board/myir/mys_6ulx/Kconfig
 create mode 100644 board/myir/mys_6ulx/MAINTAINERS
 create mode 100644 board/myir/mys_6ulx/Makefile
 create mode 100644 board/myir/mys_6ulx/README
 create mode 100644 board/myir/mys_6ulx/mys_6ulx.c
 create mode 100644 board/myir/mys_6ulx/spl.c
 create mode 100644 configs/myir_mys_6ulx_defconfig
 create mode 100644 include/configs/mys_6ulx.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e16fe03887..cd5fb0d353 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1925,6 +1925,7 @@ source "board/hisilicon/hikey/Kconfig"
 source "board/hisilicon/hikey960/Kconfig"
 source "board/hisilicon/poplar/Kconfig"
 source "board/isee/igep003x/Kconfig"
+source "board/myir/mys_6ulx/Kconfig"
 source "board/spear/spear300/Kconfig"
 source "board/spear/spear310/Kconfig"
 source "board/spear/spear320/Kconfig"
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 5726156a2d..93a848eac5 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -718,6 +718,7 @@ dtb-$(CONFIG_MX6UL) += \
 dtb-$(CONFIG_MX6ULL) += \
imx6ull-14x14-evk.dtb \
imx6ull-colibri.dtb \
+   imx6ull-myir-mys-6ulx-eval.dtb \
imx6ull-phytec-segin-ff-rdk-emmc.dtb \
imx6ull-dart-6ul.dtb \
imx6ull-somlabs-visionsom.dtb \
diff --git a/arch/arm/dts/imx6ull-myir-mys-6ulx-eval.dts 
b/arch/arm/dts/imx6ull-myir-mys-6ulx-eval.dts
new file mode 100644
index 00..2fd69da028
--- /dev/null
+++ b/arch/arm/dts/imx6ull-myir-mys-6ulx-eval.dts
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2020 Linumiz
+ * Author: Parthiban Nallathambi 
+ */
+
+/dts-v1/;
+#include "imx6ull.dtsi"
+#include "imx6ull-myir-mys-6ulx.dtsi"
+#include "imx6ull-mys-6ulx-u-boot.dtsi"
+
+/ {
+   model = "MYiR i.MX6ULL MYS-6ULX Single Board Computer with NAND";
+   compatible = "myir,imx6ull-mys-6ulx-eval", "fsl,imx6ull";
+};
+
+&gpmi {
+   status = "okay";
+};
diff --git a/arch/arm/dts/imx6ull-myir-mys-6ulx.dtsi 
b/arch/arm/dts/imx6ull-myir-mys-6ulx.dtsi
new file mode 100644
index 00..d03694feaf
--- /dev/null
+++ b/arch/arm/dts/imx6ull-myir-mys-6ulx.dtsi
@@ -0,0 +1,238 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2020 Linumiz
+ * Author: Parthiban Nallathambi 
+ */
+
+#include 
+#include 
+#include 
+
+/ {
+   model = "MYiR MYS-6ULX Single Board Computer";
+   compatible = "fsl,imx6ull";
+
+   chosen {
+   stdout-path = &uart1;
+   };
+
+   reg_vdd_5v: regulator-vdd-5v {
+   compatible = "regulator-fixed";
+   regulator-name = "VDD_5V";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   regulator-always-on;
+   regulator-boot-on;
+   };
+
+   reg_vdd_3v3: regulator-vdd-3v3 {
+   compatible = "regulator-fixed";
+   regulator-name = "VDD_3V3";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-always-on;
+   vin-supply = <®_vd

Re: [PATCH 8/8] Initial Pine64 Pinephone support

2020-07-27 Thread Tom Rini
On Mon, Jul 27, 2020 at 09:08:40PM +0100, André Przywara wrote:
> On 27/07/2020 14:49, Peter Robinson wrote:
> 
> Hi,
> 
> thanks for piecing this together. As Maxime mentioned, many options are
> not necessary (see below).
> 
> Some options are now set by ARCH_SUNXI, since 48313fe51008.
> 
> >> On Wed, Jul 22, 2020 at 03:18:40PM +0100, Peter Robinson wrote:
> >>> The Pine64 Pinephone is a smartphone based on the AllWinner A64 SoC.
> >>> It has the following features:
> >>> * 2GB LPDDR3 SDRAM
> >>> * 5.95 inch 1440x720 HD IPS capacitive touchscreen
> >>> * 16GB eMMC, mSD slot
> >>> * Quectel EG25 LTE Modem
> >>> * Realtek RTL8723CS WiFi/BT
> >>> * Front and read cameras
> >>> * Accelerometer, gyro, proximity, ambient light, compass sensors
> >>> * A USB Type-C, USB Host, DisplayPort alt mode output, 15W 5V 3A Quick 
> >>> Charge, follows USB PD specification
> >>>
> >>> Signed-off-by: Peter Robinson 
> >>> ---
> >>>  arch/arm/Kconfig|  2 +-
> >>>  configs/pinephone_defconfig | 38 +
> >>>  2 files changed, 39 insertions(+), 1 deletion(-)
> >>>  create mode 100644 configs/pinephone_defconfig
> >>>
> >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >>> index e16fe03887..636ba26938 100644
> >>> --- a/arch/arm/Kconfig
> >>> +++ b/arch/arm/Kconfig
> >>> @@ -1004,7 +1004,7 @@ config ARCH_SUNXI
> >>>   bool "Support sunxi (Allwinner) SoCs"
> >>>   select BINMAN
> >>>   select CMD_GPIO
> >>> - select CMD_MMC if MMC
> >>> +select CMD_MMC if MMC
> >>
> >> That looks like a typo?
> > 
> > Yes, it is.
> > 
> >>>   select CMD_USB if DISTRO_DEFAULTS
> >>>   select CLK
> >>>   select DM
> >>> diff --git a/configs/pinephone_defconfig b/configs/pinephone_defconfig
> >>> new file mode 100644
> >>> index 00..d5750aa954
> >>> --- /dev/null
> >>> +++ b/configs/pinephone_defconfig
> >>> @@ -0,0 +1,38 @@
> >>> +CONFIG_ARM=y
> >>> +CONFIG_ARCH_SUNXI=y
> >>> +CONFIG_SPL=y
> >>> +CONFIG_MACH_SUN50I=y
> >>> +CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
> >>> +CONFIG_DRAM_CLK=552
> >>> +CONFIG_DRAM_ZQ=3881949
> >>> +CONFIG_NR_DRAM_BANKS=1
> 
> defaults to 1 now for ARCH_SUNXI

So really, one needs to run `make savedefconfig`, copy defconfig to
configs/foo_defconfig and then see if there's some changes / settings
there that are unexpected.  Because if you put a change in there, and
then run `make foo_defconfig` and don't see what you want in the new
.config file, there's a missing dependency or similar.  Thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 8/8] Initial Pine64 Pinephone support

2020-07-27 Thread André Przywara
On 27/07/2020 14:49, Peter Robinson wrote:

Hi,

thanks for piecing this together. As Maxime mentioned, many options are
not necessary (see below).

Some options are now set by ARCH_SUNXI, since 48313fe51008.

>> On Wed, Jul 22, 2020 at 03:18:40PM +0100, Peter Robinson wrote:
>>> The Pine64 Pinephone is a smartphone based on the AllWinner A64 SoC.
>>> It has the following features:
>>> * 2GB LPDDR3 SDRAM
>>> * 5.95 inch 1440x720 HD IPS capacitive touchscreen
>>> * 16GB eMMC, mSD slot
>>> * Quectel EG25 LTE Modem
>>> * Realtek RTL8723CS WiFi/BT
>>> * Front and read cameras
>>> * Accelerometer, gyro, proximity, ambient light, compass sensors
>>> * A USB Type-C, USB Host, DisplayPort alt mode output, 15W 5V 3A Quick 
>>> Charge, follows USB PD specification
>>>
>>> Signed-off-by: Peter Robinson 
>>> ---
>>>  arch/arm/Kconfig|  2 +-
>>>  configs/pinephone_defconfig | 38 +
>>>  2 files changed, 39 insertions(+), 1 deletion(-)
>>>  create mode 100644 configs/pinephone_defconfig
>>>
>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>>> index e16fe03887..636ba26938 100644
>>> --- a/arch/arm/Kconfig
>>> +++ b/arch/arm/Kconfig
>>> @@ -1004,7 +1004,7 @@ config ARCH_SUNXI
>>>   bool "Support sunxi (Allwinner) SoCs"
>>>   select BINMAN
>>>   select CMD_GPIO
>>> - select CMD_MMC if MMC
>>> +select CMD_MMC if MMC
>>
>> That looks like a typo?
> 
> Yes, it is.
> 
>>>   select CMD_USB if DISTRO_DEFAULTS
>>>   select CLK
>>>   select DM
>>> diff --git a/configs/pinephone_defconfig b/configs/pinephone_defconfig
>>> new file mode 100644
>>> index 00..d5750aa954
>>> --- /dev/null
>>> +++ b/configs/pinephone_defconfig
>>> @@ -0,0 +1,38 @@
>>> +CONFIG_ARM=y
>>> +CONFIG_ARCH_SUNXI=y
>>> +CONFIG_SPL=y
>>> +CONFIG_MACH_SUN50I=y
>>> +CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
>>> +CONFIG_DRAM_CLK=552
>>> +CONFIG_DRAM_ZQ=3881949
>>> +CONFIG_NR_DRAM_BANKS=1

defaults to 1 now for ARCH_SUNXI

>>> +CONFIG_MMC_SUNXI_SLOT_EXTRA=2
>>> +CONFIG_R_I2C_ENABLE=y
>>> +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
>>> +# CONFIG_SPL_SPI_SUNXI is not set

defaults to n

>>> +# CONFIG_SPL_DOS_PARTITION is not set
>>> +# CONFIG_SPL_EFI_PARTITION is not set

those two default to "n" now for ARCH_SUNXI

>>> +CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pinephone-1.1"
>>> +CONFIG_OF_LIST="sun50i-a64-pinephone-1.1 sun50i-a64-pinephone-1.0"
>>> +CONFIG_SYS_RELOC_GD_ENV_ADDR=y

defaults to y now for ARCH_SUNXI

>>> +CONFIG_DM_REGULATOR=y
>>> +CONFIG_DM_REGULATOR_FIXED=y
>>> +CONFIG_DM_PWM=y
>>> +CONFIG_PWM_SUNXI=y
>>> +CONFIG_CMD_GPIO=y
>>> +CONFIG_CMD_GPT=y

those two are already y be default

>>> +CONFIG_CMD_I2C=y
>>> +CONFIG_CMD_MMC=y

already y by default

>>> +# CONFIG_CMD_MII is not set
>>> +# CONFIG_CMD_NFS is not set
>>> +# CONFIG_DM_ETH is not set
>>> +# CONFIG_PHY is not set
>>> +# CONFIG_PHY_GIGE is not set
>>> +# CONFIG_SUN8I_EMAC is not set
>>> +# CONFIG_PHY_REALTEK is not set
>>> +# CONFIG_CMD_SF is not set
>>> +# CONFIG_SPI is not set
>>> +# CONFIG_DM_SPI is not set

Those two sounds like a good idea, but don't do anything, because
ARCH_SUNXI selects them. Sounds weird, and looks like not the right
thing, tbh.

>>> +# CONFIG_SPI_FLASH is not set
>>> +# CONFIG_SPI_MEM is not set
>>> +# CONFIG_DM_SPI_FLASH is not set
>>
>> I'm not entirely sure why we need to deviate from the default that much
>> here. Some options should definitely be disabled (like SUN8I_EMAC), but
>> I'm not really sure why it's enabled in the first place, and why we need
> 
> Because it's selected by default for the SoC,

Mmmh, really? I don't see that in Kconfig, and in fact removing that
"#CONFIG_SUN8I_EMAC is not set" line results in the exact same .config
created.

> I suspect that's because
> it was assumed that everything would be a dev board and have a wired
> ethernet port but there's more and more devices that don't so it
> probably makes sense to review that but I didn't want to do that as
> part of enabling a device.

Explicitly un-setting just CONFIG_NET should disable all network related
options. This disables even more commands and features than your
version, which is fine, unless we want USB Ethernet support. Doesn't
seem to be enabled with your config, and I don't know what's the USB
story on the Pinephone in general, and in U-Boot in particular.
What are the expectations in this regard?

Cheers,
Andre

>> to disable the other network related options (PHY, PHY_GIGE,
>> PHY_REALTEK). They shouldn't even be enabled in the first place.
> 
> That would be my guess but I suspect it's the same as the SUN8I_EMAC above.
> 
>> Similarly, CMD_GPIO, CMD_GPT should be enabled by default.
>>
>> (and I'm not sure why PWM_SUNXI is here in the first place?)
> 
> It's used by the backlight, it shouldn't have made it into this patch,
> as the DT bits aren't upstream yet and as I mentioned in my overview
> the screen side of things is still a WiP, I must have missed it as I
> sliced up my patch set between 

Re: Please pull u-boot-dm (take 2)

2020-07-27 Thread Tom Rini
On Sun, Jul 26, 2020 at 08:30:45PM -0600, Simon Glass wrote:

> Hi Tom,
> 
> I think I figured out what was wrong with the test. It seems to depend
> on the number of CPUs used to run them. I got a passing run here:
> 
> https://travis-ci.org/github/sjg20/u-boot/builds/711807208
> 
> 
> The following changes since commit ada61f1ee2a4eaa1b29d699b5ba940483171df8a:
> 
>   Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
> (2020-07-24 08:43:08 -0400)
> 
> are available in the Git repository at:
> 
>   git://git.denx.de/u-boot-dm.git tags/dm-pull-20jul20-take2a
> 
> for you to fetch changes up to 347e0f00e850028b4595287d5158c5a8f36ba910:
> 
>   binman: Re-enable concurrent tests (2020-07-26 19:59:57 -0600)
> 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [v2] travis: Install pyelftools via pip

2020-07-27 Thread Tom Rini
On Mon, Jul 27, 2020 at 02:42:59PM -0400, Tom Rini wrote:

> With the migration to python3 for all of our tests, we need to install
> pyelftools via pip now rather than the system tools as they will
> otherwise not be present in our virtualenv.
> 
> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


[PATCH v2 09/14] ARM: dts: imx6ull-colibri: move u-boot specific node

2020-07-27 Thread sbabic
> From: Igor Opaniuk 
> 1. Move aliases and legacy lcdif node to the u-boot specific dts include.
> 2. Provide proper display timings, as in the downstream Toradex kernel
> [1].
> [1]: 
> https://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi?h=toradex_4.9-2.3.x-imx#n183
> Signed-off-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH v2 14/14] colibri-imx7: fix splash logo drawing

2020-07-27 Thread sbabic
> From: Igor Opaniuk 
> 1. Configure white on black for video console.
> 2. Enable printing bmp logo during late board init stage.
> 3. Use iomux configuration from device tree.
> Signed-off-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH v2 03/14] toradex: tdx-cfg-block: add carrier boards and display adapters

2020-07-27 Thread sbabic
> From: Igor Opaniuk 
> Add defines for supported carrier boards and display adapters.
> Signed-off-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH v2 01/14] imx: mx7: fix DDRC size in A7-M4 mapping table

2020-07-27 Thread sbabic
> From: Igor Opaniuk 
> According to i.MX 7Solo Applications Processor Reference Manual,
> 2.1.3 Cortex-M4 Memory Map, M4 can address only 1536MB of DDRC
> (Start Address: 0x8000_; End Address: 0xDFFF_).
> Correct DDRC size to 0x6000.
> Fixes: c0f037f6("mach-imx: bootaux: elf firmware support")
> Signed-off-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH v2 06/14] toradex: tdx-cfg-block: add carrier board info printing

2020-07-27 Thread sbabic
> From: Igor Opaniuk 
> Add carrier board info printing during boot time:
> U-Boot 2020.07-rc4-02435-g1756e05 (Jun 22 2020 - 22:43:59 +0300)
> CPU:   Freescale i.MX8MMQ rev1.0 at 1200 MHz
> 
> Carrier: Toradex Verdin Development Board V1.0A, Serial# 10622780
> Verdin iMX8MM #
> Signed-off-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH v2 05/14] toradex: tdx-cfg-clock: add migration routine from PID8

2020-07-27 Thread sbabic
> From: Igor Opaniuk 
> Add migration routine from PID8 pre-stored values on EEPROM
> (including sane value checks).
> Signed-off-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH v2 13/14] colibri-imx6ull: fix splash screen logo drawing

2020-07-27 Thread sbabic
> From: Igor Opaniuk 
> Configure white on black for video console.
> Signed-off-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH 1/2] imx8m: ddrphy_utils: Improve coding style

2020-07-27 Thread sbabic
> Currently checkpatch is not happy about this file:
> total: 14 errors, 2 warnings, 7 checks, 359 lines checked
> Improve the coding style so that it can now report:
> total: 0 errors, 0 warnings, 6 checks, 360 lines checked
> Reported-by: Tom Rini 
> Signed-off-by: Fabio Estevam 
> Reviewed-by: Tom Rini 
> Reviewed-by: Peng Fan 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH v2 08/14] verdin-imx8mm: add EEPROM support for carrier board

2020-07-27 Thread sbabic
> From: Igor Opaniuk 
> Enable these Kconfig symbols:
> TDX_CFG_BLOCK_EXTRA=y
> TDX_HAVE_EEPROM_EXTRA=y
> Signed-off-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH 2/2] imx8m: soc: Remove unneeded space

2020-07-27 Thread sbabic
> Checkpatch reports the following issue:
> ERROR: space prohibited before that ',' (ctx:WxW)
> #936: FILE: arch/arm/mach-imx/imx8m/soc.c:936:
> +   0, 0 , 0, 0, 0, 0, &res);
> Remove the unneeded space.
>  ^
> Reported-by: Tom Rini 
> Signed-off-by: Fabio Estevam 
> Reviewed-by: Tom Rini 
> Reviewed-by: Peng Fan 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH v2 04/14] toradex: tdx-cfg-block: add support for EEPROM

2020-07-27 Thread sbabic
> From: Igor Opaniuk 
> This introduces support for EEPROM as a storage for the main Toradex
> config block and additional config blocks on extra EEPROM chips (on
> carrier board or video adapters).
> To enable EEPROM as a storage for the main config block:
> TDX_HAVE_EEPROM=y.
> For additional EEPROMs please enable this Kconfig symbol:
> TDX_CFG_BLOCK_EXTRA=y.
> Information about existing EEPROM chips is provided via Device Tree
> using aliases.
> You can also write configuration for the carrier board using
> create_carrier subcommand for cfgblock. Example:
> Verdin iMX8MM # cfgblock create_carrier
> Supported carrier boards:
> UNKNOWN CARRIER = [0]
> Verdin Carrier Board= [1]
> Choose your carrier board (provide ID): 1
> Enter carrier board version (e.g. V1.1B): V1.0A
> Enter carrier board serial number: 10622780
> Also with barcode:
> Verdin iMX8MM # cfgblock create carrier -y 0156100010622780
> Signed-off-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH v2 12/14] colibri-imx6ull: show boot logo

2020-07-27 Thread sbabic
> From: Igor Opaniuk 
> 1. Show boot logo embed in U-Boot blob.
> 2. Drop iomux configration for LCD, and use the one provided in device
> tree.
> Signed-off-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH v2 11/14] ARM: dts: imx7-colibri: multiple node updates

2020-07-27 Thread sbabic
> From: Igor Opaniuk 
> 1. Move u-boot specific nodes to u-boot dts include: legacy lcdif
> node and aliases.
> 2. Add iomux configuration for LCD.
> 3. Drop un-needed u-boot,dm-pre-reloc for alias node.
> 4. Fix display-timings, use the one from Toradex downstream kernel [1]
> [1]: 
> https://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi?h=toradex_4.9-2.3.x-imx#n206
> Signed-off-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH v2 10/14] toradex: common: show boot logo

2020-07-27 Thread sbabic
> From: Igor Opaniuk 
> Add function for showing boot logo, embed into u-boot blob.
> Signed-off-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH v2 02/14] toradex: tdx-cfg-block: add EEPROM read/store wrappers

2020-07-27 Thread sbabic
> From: Igor Opaniuk 
> These functions wrap functionality for storing config blocks in EEPROM.
> Signed-off-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


[PATCH v2 07/14] ARM: dts: imx8mm-verdin: eeprom nodes adjustments

2020-07-27 Thread sbabic
> From: Igor Opaniuk 
> Rename EEPROM nodes.
> Create aliases for EEPROM to unify their order:
> eeprom0 - on-module EEPROM
> eeprom1 - carrier-board EEPROM
> eeprom2 - MIPI-DSI to HDMI adapter EEPROM
> Signed-off-by: Igor Opaniuk 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


Re: [PATCH] board: Add support for iMX8QXP AI_ML board

2020-07-27 Thread Stefano Babic

Hi Mani,

On 10.07.20 15:59, Manivannan Sadhasivam wrote:

Hi,

On Tue, Nov 05, 2019 at 09:02:28PM +0530, Manivannan Sadhasivam wrote:

This commit adds initial board support for iMX8QXP AI_ML board from
Einfochips. This board is one of the 96Boards Consumer Edition and AI
boards of the 96Boards family based on i.MX8QXP SoC from NXP/Freescale.

This initial supports contains following peripherals which are tested and
known to work:

1. Debug serial via UART2
2. SD card
3. Ethernet

More information about this board can be found in arrow website:
https://www.arrow.com/en/products/imx8-ai-ml/arrow-development-tools

Signed-off-by: Manivannan Sadhasivam 
Reviewed-by: Peng Fan 


Looks like this patch has fallen through the cracks! Let me know if I have
to resend it (again).



Your board cannot be built clean - can you rebase and repost ? Thanks !

You can check the reason here:

https://travis-ci.org/github/sbabic/u-boot-imx/jobs/712217118

Best regards,
Stefano



Thanks,
Mani


---
  arch/arm/mach-imx/imx8/Kconfig|  6 ++
  board/einfochips/imx8qxp_ai_ml/Kconfig| 21 
  board/einfochips/imx8qxp_ai_ml/MAINTAINERS|  6 ++
  board/einfochips/imx8qxp_ai_ml/Makefile   |  8 ++
  board/einfochips/imx8qxp_ai_ml/README | 49 ++
  .../einfochips/imx8qxp_ai_ml/imx8qxp_ai_ml.c  | 78 +++
  board/einfochips/imx8qxp_ai_ml/imximage.cfg   | 24 +
  board/einfochips/imx8qxp_ai_ml/spl.c  | 39 
  configs/imx8qxp_ai_ml_defconfig   | 83 
  include/configs/imx8qxp_ai_ml.h   | 95 +++
  10 files changed, 409 insertions(+)
  create mode 100644 board/einfochips/imx8qxp_ai_ml/Kconfig
  create mode 100644 board/einfochips/imx8qxp_ai_ml/MAINTAINERS
  create mode 100644 board/einfochips/imx8qxp_ai_ml/Makefile
  create mode 100644 board/einfochips/imx8qxp_ai_ml/README
  create mode 100644 board/einfochips/imx8qxp_ai_ml/imx8qxp_ai_ml.c
  create mode 100644 board/einfochips/imx8qxp_ai_ml/imximage.cfg
  create mode 100644 board/einfochips/imx8qxp_ai_ml/spl.c
  create mode 100644 configs/imx8qxp_ai_ml_defconfig
  create mode 100644 include/configs/imx8qxp_ai_ml.h

diff --git a/arch/arm/mach-imx/imx8/Kconfig b/arch/arm/mach-imx/imx8/Kconfig
index cdb78afacf..25fe4e2be0 100644
--- a/arch/arm/mach-imx/imx8/Kconfig
+++ b/arch/arm/mach-imx/imx8/Kconfig
@@ -55,6 +55,11 @@ config TARGET_COLIBRI_IMX8X
select BOARD_LATE_INIT
select IMX8QXP
  
+config TARGET_IMX8QXP_AI_ML

+   bool "Support i.MX8QXP AI_ML board"
+   select BOARD_EARLY_INIT_F
+   select IMX8QXP
+
  config TARGET_IMX8QM_MEK
bool "Support i.MX8QM MEK board"
select BOARD_LATE_INIT
@@ -73,6 +78,7 @@ config TARGET_IMX8QXP_MEK
  
  endchoice
  
+source "board/einfochips/imx8qxp_ai_ml/Kconfig"

  source "board/freescale/imx8qm_mek/Kconfig"
  source "board/freescale/imx8qxp_mek/Kconfig"
  source "board/advantech/imx8qm_rom7720_a1/Kconfig"
diff --git a/board/einfochips/imx8qxp_ai_ml/Kconfig 
b/board/einfochips/imx8qxp_ai_ml/Kconfig
new file mode 100644
index 00..b6806b8859
--- /dev/null
+++ b/board/einfochips/imx8qxp_ai_ml/Kconfig
@@ -0,0 +1,21 @@
+if TARGET_IMX8QXP_AI_ML
+
+config SYS_BOARD
+   default "imx8qxp_ai_ml"
+
+config SYS_VENDOR
+   default "einfochips"
+
+config SYS_CONFIG_NAME
+   default "imx8qxp_ai_ml"
+
+config SYS_MALLOC_LEN
+   default 0x240
+
+config ENV_SIZE
+   default 0x1000
+
+config ENV_OFFSET
+   default 0x40
+
+endif
diff --git a/board/einfochips/imx8qxp_ai_ml/MAINTAINERS 
b/board/einfochips/imx8qxp_ai_ml/MAINTAINERS
new file mode 100644
index 00..add0bd9431
--- /dev/null
+++ b/board/einfochips/imx8qxp_ai_ml/MAINTAINERS
@@ -0,0 +1,6 @@
+i.MX8QXP AI_ML BOARD
+M: Manivannan Sadhasivam 
+S: Maintained
+F: board/einfochips/imx8qxp_ai_ml/
+F: include/configs/imx8qxp_ai_ml.h
+F: configs/imx8qxp_ai_ml_defconfig
diff --git a/board/einfochips/imx8qxp_ai_ml/Makefile 
b/board/einfochips/imx8qxp_ai_ml/Makefile
new file mode 100644
index 00..e08774dc6e
--- /dev/null
+++ b/board/einfochips/imx8qxp_ai_ml/Makefile
@@ -0,0 +1,8 @@
+#
+# Copyright 2019 Linaro Ltd.
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y += imx8qxp_ai_ml.o
+obj-$(CONFIG_SPL_BUILD) += spl.o
diff --git a/board/einfochips/imx8qxp_ai_ml/README 
b/board/einfochips/imx8qxp_ai_ml/README
new file mode 100644
index 00..488920580f
--- /dev/null
+++ b/board/einfochips/imx8qxp_ai_ml/README
@@ -0,0 +1,49 @@
+U-Boot for the Einfochips i.MX8QXP AI_ML board
+
+Quick Start
+===
+
+- Get and Build the ARM Trusted firmware
+- Get scfw_tcm.bin and ahab-container.img
+- Build U-Boot
+- Flash the binary into the SD card
+- Boot
+
+Get and Build the ARM Trusted firmware
+==
+
+$ git clone https://source.codeaurora.org/external/imx/imx-atf
+$ cd imx-atf/
+$ git checkout origin/imx_4.9.88_imx8qxp_beta2 -b imx_4.9.88_imx8qxp_bet

[v2] travis: Install pyelftools via pip

2020-07-27 Thread Tom Rini
With the migration to python3 for all of our tests, we need to install
pyelftools via pip now rather than the system tools as they will
otherwise not be present in our virtualenv.

Signed-off-by: Tom Rini 
---
Changes in v2: Switch to pip
---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 73daf273c55b..66ccf5b2ee6a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,7 +23,6 @@ addons:
 - build-essential
 - libsdl2-dev
 - python
-- python-pyelftools
 - python3-sphinx
 - python3-virtualenv
 - python3-pip
@@ -256,6 +255,7 @@ script:
  if [[ -n "${TEST_PY_TOOLS}" ]]; then
export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
+   pip install pyelftools &&
./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test &&
./tools/patman/patman test &&
./tools/buildman/buildman -t &&
-- 
2.17.1



Re: [PULL] u-boot-sh/net

2020-07-27 Thread Tom Rini
On Mon, Jul 27, 2020 at 12:57:33PM -0500, Joe Hershberger wrote:
> On Mon, Jul 27, 2020 at 5:40 AM Marek Vasut  wrote:
> >
> > More networking DM conversion (this is the last driver).
> > Any news on Joe ?
> 
> Sorry, guys, I'm back home in Texas now and have had a lot going on
> keeping me swamped.

Good to know you made it back home.

> I aim to get caught up soon.
> 
> Any idea how accurate my patchwork queue is?

Somewhat?  Marek has picked some of the DM migrations he did and I've
picked some other stuff, both networking and environment.

> Also, I'd like to get some assistance getting a gitlab validation
> workflow going. Travis was not helping me be very efficient in testing
> changes.

It should be fairly straight-forward to get runs happen automatically.
To get emails on passes you do have to check one of the preference
boxes.  And GitLab also has the occasional "runner made a mistake, job
failed for no good reason", but less often than Travis and there's a
re-run all jobs button.

Azure for CI is also good in general, but right now the windows host
tools jobs are both failing for reasons out of our control and I've
asked Bin to look at fixing that (it's a documented thing I just didn't
quite see the best way to do).

-- 
Tom


signature.asc
Description: PGP signature


Re: [PULL] u-boot-sh/net

2020-07-27 Thread Joe Hershberger
On Mon, Jul 27, 2020 at 5:40 AM Marek Vasut  wrote:
>
> More networking DM conversion (this is the last driver).
> Any news on Joe ?

Sorry, guys, I'm back home in Texas now and have had a lot going on
keeping me swamped.

I aim to get caught up soon.

Any idea how accurate my patchwork queue is?

Also, I'd like to get some assistance getting a gitlab validation
workflow going. Travis was not helping me be very efficient in testing
changes.

Thanks,
-Joe


> The following changes since commit ada61f1ee2a4eaa1b29d699b5ba940483171df8a:
>
>   Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
> (2020-07-24 08:43:08 -0400)
>
> are available in the Git repository at:
>
>   git://git.denx.de/u-boot-sh.git net
>
> for you to fetch changes up to f23a785cfb451f3fcb457ed1f9141907dce7dd77:
>
>   net: dc2114x: Add DM support (2020-07-25 14:20:56 +0200)
>
> 
> Marek Vasut (12):
>   net: dc2114x: Use PCI_DEVICE() to define PCI device compat list
>   net: dc2114x: Support all DC2114x
>   net: dc2114x: Add Kconfig entries
>   net: dc2114x: Drop update_srom()
>   net: dc2114x: Use standard I/O accessors
>   net: dc2114x: Introduce private data
>   net: dc2114x: Pass private data around
>   net: dc2114x: Pass PCI BDF into phys_to_bus()
>   net: dc2114x: Add RX/TX rings into the private data
>   net: dc2114x: Split RX path
>   net: dc2114x: Split common parts of non-DM functions out
>   net: dc2114x: Add DM support
>
>  README  |   3 -
>  configs/integratorap_cm720t_defconfig   |   1 +
>  configs/integratorap_cm920t_defconfig   |   1 +
>  configs/integratorap_cm926ejs_defconfig |   1 +
>  configs/integratorap_cm946es_defconfig  |   1 +
>  drivers/net/Kconfig |   6 +
>  drivers/net/dc2114x.c   | 611
> ++---
>  include/configs/MPC8349EMDS.h   |   1 -
>  include/configs/MPC8349EMDS_SDRAM.h |   1 -
>  include/configs/MPC8540ADS.h|   1 -
>  include/configs/MPC8541CDS.h|   1 -
>  include/configs/MPC8544DS.h |   1 -
>  include/configs/MPC8548CDS.h|   1 -
>  include/configs/MPC8555CDS.h|   1 -
>  include/configs/MPC8560ADS.h|   1 -
>  include/configs/MPC8568MDS.h|   1 -
>  include/configs/MPC8569MDS.h|   1 -
>  include/configs/MPC8572DS.h |   1 -
>  include/configs/MPC8641HPCN.h   |   1 -
>  include/configs/TQM834x.h   |   1 -
>  include/configs/caddy2.h|   1 -
>  include/configs/integratorap.h  |   1 -
>  include/configs/sbc8349.h   |   1 -
>  include/configs/sbc8548.h   |   1 -
>  include/configs/sbc8641d.h  |   1 -
>  include/configs/vme8349.h   |   1 -
>  scripts/config_whitelist.txt|   1 -
>  27 files changed, 366 insertions(+), 278 deletions(-)


Re: [PATCH v2 13/18] board: ti: j7200: Add board detection support for j7200

2020-07-27 Thread Suman Anna

On 7/27/20 4:45 AM, Lokesh Vutla wrote:

Add board detection support for j7200 common processor board.

Signed-off-by: Lokesh Vutla 
Signed-off-by: Dave Gerlach 


Reviewed-by: Suman Anna 


---
  board/ti/j721e/evm.c | 4 
  1 file changed, 4 insertions(+)

diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index 86e7cd4051..87cdbf9798 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -28,6 +28,8 @@
  #define board_is_j721e_som()  (board_ti_k3_is("J721EX-PM1-SOM") || \
 board_ti_k3_is("J721EX-PM2-SOM"))
  
+#define board_is_j7200_som()	board_ti_k3_is("J7200X-PM1-SOM")

+
  /* Max number of MAC addresses that are parsed/processed per daughter card */
  #define DAUGHTER_CARD_NO_OF_MAC_ADDR  8
  
@@ -139,6 +141,8 @@ static void setup_board_eeprom_env(void)
  
  	if (board_is_j721e_som())

name = "j721e";
+   else if (board_is_j7200_som())
+   name = "j7200";
else
printf("Unidentified board claims %s in eeprom header\n",
   board_ti_get_name());





Re: [PATCH v2 11/18] arm: mach-k3: j7200: Detect if ROM has already loaded sysfw

2020-07-27 Thread Suman Anna

On 7/27/20 4:45 AM, Lokesh Vutla wrote:

Detect if sysfw is already loaded by ROM and pass this information to
sysfw loader. Based on this information sysfw loader either loads the
sysfw image from boot media or just received the boot notification


%s/received/receives/

Pending the discussion on the argument list on k3_sysfw_loader(),

Reviewed-by: Suman Anna 

regards
Suman


message form sysfw.

Signed-off-by: Lokesh Vutla 
---
  arch/arm/mach-k3/common.c | 8 
  arch/arm/mach-k3/common.h | 2 ++
  arch/arm/mach-k3/j721e_init.c | 3 ++-
  3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index d065bdbc83..7b0369ffb0 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -71,6 +71,14 @@ void mmr_unlock(phys_addr_t base, u32 partition)
writel(CTRLMMR_LOCK_KICK1_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK1);
  }
  
+bool is_rom_loaded_sysfw(struct rom_extended_boot_data *data)

+{
+   if (strncmp(data->header, K3_ROM_BOOT_HEADER_MAGIC, 7))
+   return false;
+
+   return data->num_components > 1;
+}
+
  DECLARE_GLOBAL_DATA_PTR;
  
  #ifdef CONFIG_K3_EARLY_CONS

diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h
index 8f5a5f323a..15a98fb653 100644
--- a/arch/arm/mach-k3/common.h
+++ b/arch/arm/mach-k3/common.h
@@ -7,6 +7,7 @@
   */
  
  #include 

+#include 
  
  #define AM65X	0xbb5a

  #define J721E 0xbb64
@@ -30,3 +31,4 @@ int load_firmware(char *name_fw, char *name_loadaddr, u32 
*loadaddr);
  void k3_sysfw_print_ver(void);
  void spl_enable_dcache(void);
  void mmr_unlock(phys_addr_t base, u32 partition);
+bool is_rom_loaded_sysfw(struct rom_extended_boot_data *data);
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 6246de3a26..a36e4ed603 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -177,7 +177,8 @@ void board_init_f(ulong dummy)
 * callback hook, effectively switching on (or over) the console
 * output.
 */
-   k3_sysfw_loader(false, k3_mmc_stop_clock, k3_mmc_restart_clock);
+   k3_sysfw_loader(is_rom_loaded_sysfw(&bootdata),
+   k3_mmc_stop_clock, k3_mmc_restart_clock);
  
  	/* Prepare console output */

preloader_console_init();





Re: [PATCH v2 10/18] arm: mach-k3: j7200: Add support for storing extended boot info from ROM

2020-07-27 Thread Suman Anna

On 7/27/20 4:45 AM, Lokesh Vutla wrote:

Starting J7200 SoC, ROM supports for loading sysfw directly from boot
image. ROM passes this information on number of images that are loaded
to bootloader at  certain location. Add support for storing this


Extra whitespace before certain. Otherwise,

Reviewed-by: Suman Anna 



information before it gets corrupted.

Signed-off-by: Lokesh Vutla 
---
  arch/arm/mach-k3/include/mach/hardware.h   | 7 +++
  arch/arm/mach-k3/include/mach/j721e_hardware.h | 3 +++
  arch/arm/mach-k3/j721e_init.c  | 7 +--
  3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-k3/include/mach/hardware.h 
b/arch/arm/mach-k3/include/mach/hardware.h
index 0ad761418b..02b3df0e1b 100644
--- a/arch/arm/mach-k3/include/mach/hardware.h
+++ b/arch/arm/mach-k3/include/mach/hardware.h
@@ -21,4 +21,11 @@
  #define JTAG_ID_PARTNO_SHIFT  12
  #define JTAG_ID_PARTNO_MASK   (0x << 12)
  
+#define K3_ROM_BOOT_HEADER_MAGIC	"EXTBOOT"

+
+struct rom_extended_boot_data {
+   char header[8];
+   u32 num_components;
+};
+
  #endif /* _ASM_ARCH_HARDWARE_H_ */
diff --git a/arch/arm/mach-k3/include/mach/j721e_hardware.h 
b/arch/arm/mach-k3/include/mach/j721e_hardware.h
index 19873d6e28..b98f0a82f1 100644
--- a/arch/arm/mach-k3/include/mach/j721e_hardware.h
+++ b/arch/arm/mach-k3/include/mach/j721e_hardware.h
@@ -51,6 +51,9 @@
  #define CTRLMMR_LOCK_KICK10x0100c
  #define CTRLMMR_LOCK_KICK1_UNLOCK_VAL 0xd172bc5a
  
+/* ROM HANDOFF Structure location */

+#define ROM_ENTENDED_BOOT_DATA_INFO0x41cffb00
+
  /* MCU SCRATCHPAD usage */
  #define TI_SRAM_SCRATCH_BOARD_EEPROM_START
CONFIG_SYS_K3_MCU_SCRATCHPAD_BASE
  
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c

index 63a31c18ce..6246de3a26 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -126,10 +126,13 @@ void k3_mmc_restart_clock(void)
   * it to the .data section.
   */
  u32 bootindex __attribute__((section(".data")));
+static struct rom_extended_boot_data bootdata __section(.data);
  
-static void store_boot_index_from_rom(void)

+static void store_boot_info_from_rom(void)
  {
bootindex = *(u32 *)(CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX);
+   memcpy(&bootdata, (uintptr_t *)ROM_ENTENDED_BOOT_DATA_INFO,
+  sizeof(struct rom_extended_boot_data));
  }
  
  void board_init_f(ulong dummy)

@@ -142,7 +145,7 @@ void board_init_f(ulong dummy)
 * Cannot delay this further as there is a chance that
 * K3_BOOT_PARAM_TABLE_INDEX can be over written by SPL MALLOC section.
 */
-   store_boot_index_from_rom();
+   store_boot_info_from_rom();
  
  	/* Make all control module registers accessible */

ctrl_mmr_unlock();





Re: [PATCH v2 08/18] arm: mach-k3: j721e: Fix unlocking control module registers

2020-07-27 Thread Suman Anna

On 7/27/20 4:45 AM, Lokesh Vutla wrote:

In main control mmr there is no partition 4 and partition 6 is available
only on J721e. Fix the same in ctrl_mmr_unlock function

Signed-off-by: Lokesh Vutla 


Reviewed-by: Suman Anna 


---
  arch/arm/mach-k3/j721e_init.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 3b15da2d7c..63a31c18ce 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -87,9 +87,9 @@ static void ctrl_mmr_unlock(void)
mmr_unlock(CTRL_MMR0_BASE, 1);
mmr_unlock(CTRL_MMR0_BASE, 2);
mmr_unlock(CTRL_MMR0_BASE, 3);
-   mmr_unlock(CTRL_MMR0_BASE, 4);
mmr_unlock(CTRL_MMR0_BASE, 5);
-   mmr_unlock(CTRL_MMR0_BASE, 6);
+   if (soc_is_j721e())
+   mmr_unlock(CTRL_MMR0_BASE, 6);
mmr_unlock(CTRL_MMR0_BASE, 7);
  }
  





Re: [PATCH v2 06/18] arm: mach-k3: sysfw-loader: Add support for rom loading sysfw image

2020-07-27 Thread Suman Anna

Hi Lokesh,

On 7/27/20 4:45 AM, Lokesh Vutla wrote:

Starting J7200 SoC, ROM supports for loading sysfw directly from boot
image. In such cases, SPL need not load sysfw from boot media, but need
to receive boot notification message from sysfw. So separate out
remoteproc calls for system controller from sysfw loader and just
receive the boot notification if sysfw is already loaded.

Signed-off-by: Lokesh Vutla 
---
  arch/arm/mach-k3/am6_init.c  |  2 +-
  arch/arm/mach-k3/include/mach/sysfw-loader.h |  4 +-
  arch/arm/mach-k3/j721e_init.c|  2 +-
  arch/arm/mach-k3/sysfw-loader.c  | 56 +---
  4 files changed, 43 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-k3/am6_init.c b/arch/arm/mach-k3/am6_init.c
index abdec76d73..4250ac355b 100644
--- a/arch/arm/mach-k3/am6_init.c
+++ b/arch/arm/mach-k3/am6_init.c
@@ -155,7 +155,7 @@ void board_init_f(ulong dummy)
 * Load, start up, and configure system controller firmware while
 * also populating the SYSFW post-PM configuration callback hook.
 */
-   k3_sysfw_loader(k3_mmc_stop_clock, k3_mmc_restart_clock);
+   k3_sysfw_loader(false, k3_mmc_stop_clock, k3_mmc_restart_clock);
  
  	/* Prepare console output */

preloader_console_init();
diff --git a/arch/arm/mach-k3/include/mach/sysfw-loader.h 
b/arch/arm/mach-k3/include/mach/sysfw-loader.h
index 6f5612b4fd..b23a9e821e 100644
--- a/arch/arm/mach-k3/include/mach/sysfw-loader.h
+++ b/arch/arm/mach-k3/include/mach/sysfw-loader.h
@@ -7,6 +7,8 @@
  #ifndef _SYSFW_LOADER_H_
  #define _SYSFW_LOADER_H_
  
-void k3_sysfw_loader(void (*config_pm_pre_callback)(void), void (*config_pm_done_callback)(void));

+void k3_sysfw_loader(bool rom_loaded_sysfw,
+void (*config_pm_pre_callback)(void),
+void (*config_pm_done_callback)(void));
  
  #endif

diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 2010cab1d1..461a9d7f8f 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -174,7 +174,7 @@ void board_init_f(ulong dummy)
 * callback hook, effectively switching on (or over) the console
 * output.
 */
-   k3_sysfw_loader(k3_mmc_stop_clock, k3_mmc_restart_clock);
+   k3_sysfw_loader(false, k3_mmc_stop_clock, k3_mmc_restart_clock);


Any reason why you want to add the new argument at the front, rather 
than the end which is typical?


  
  	/* Prepare console output */

preloader_console_init();
diff --git a/arch/arm/mach-k3/sysfw-loader.c b/arch/arm/mach-k3/sysfw-loader.c
index 513be09c68..f62bfa995c 100644
--- a/arch/arm/mach-k3/sysfw-loader.c
+++ b/arch/arm/mach-k3/sysfw-loader.c
@@ -32,6 +32,12 @@ DECLARE_GLOBAL_DATA_PTR;
  #define SYSFW_CFG_RM  "rm-cfg.bin"
  #define SYSFW_CFG_SEC "sec-cfg.bin"
  
+/*

+ * It is assumed that remoteproc device 0 is the corresponding
+ * system-controller that runs SYSFW. Make sure DT reflects the same.
+ */
+#define K3_SYSTEM_CONTROLLER_RPROC_ID  0
+
  static bool sysfw_loaded;
  static void *sysfw_load_address;
  
@@ -71,6 +77,26 @@ static int fit_get_data_by_name(const void *fit, int images, const char *name,

return fit_image_get_data(fit, node_offset, addr, size);
  }
  
+static void k3_start_system_controller(int rproc_id, bool rproc_loaded,

+  ulong addr, ulong size)


Are you expecting the SYSTEM_CONTROLLER_RPROC_ID to be a different value 
from 0? Do you really need the rproc_id argument, rather than directly 
using it in code?


regards
Suman


+{
+   int ret;
+
+   ret = rproc_dev_init(rproc_id);
+   if (ret)
+   panic("rproc failed to be initialized (%d)\n", ret);
+
+   if (!rproc_loaded) {
+   ret = rproc_load(rproc_id, addr, size);
+   if (ret)
+   panic("Firmware failed to start on rproc (%d)\n", ret);
+   }
+
+   ret = rproc_start(0);
+   if (ret)
+   panic("Firmware init failed on rproc (%d)\n", ret);
+}
+
  static void k3_sysfw_load_using_fit(void *fit)
  {
int images;
@@ -90,23 +116,9 @@ static void k3_sysfw_load_using_fit(void *fit)
panic("Error accessing %s node in FIT (%d)\n", SYSFW_FIRMWARE,
  ret);
  
-	/*

-* Start up system controller firmware
-*
-* It is assumed that remoteproc device 0 is the corresponding
-* system-controller that runs SYSFW. Make sure DT reflects the same.
-*/
-   ret = rproc_dev_init(0);
-   if (ret)
-   panic("rproc failed to be initialized (%d)\n", ret);
-
-   ret = rproc_load(0, (ulong)sysfw_addr, (ulong)sysfw_size);
-   if (ret)
-   panic("Firmware failed to start on rproc (%d)\n", ret);
-
-   ret = rproc_start(0);
-   if (ret)
-   panic("Firmware init failed on rproc (%d)\n", ret);
+   /* S

Re: [PATCH v2 05/18] arm: mach-k3: Move mmr_unlock to a common location

2020-07-27 Thread Suman Anna

On 7/27/20 4:45 AM, Lokesh Vutla wrote:

mmr_unlock api is common for all k3 devices. Move it to a common
location.

Signed-off-by: Lokesh Vutla 


Reviewed-by: Suman Anna 


---
  arch/arm/mach-k3/am6_init.c   | 10 --
  arch/arm/mach-k3/common.c | 10 ++
  arch/arm/mach-k3/common.h |  1 +
  arch/arm/mach-k3/j721e_init.c | 10 --
  4 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-k3/am6_init.c b/arch/arm/mach-k3/am6_init.c
index 516a02e8a8..abdec76d73 100644
--- a/arch/arm/mach-k3/am6_init.c
+++ b/arch/arm/mach-k3/am6_init.c
@@ -41,16 +41,6 @@ struct fwl_data main_cbass_fwls[] = {
  #endif
  #endif
  
-static void mmr_unlock(u32 base, u32 partition)

-{
-   /* Translate the base address */
-   phys_addr_t part_base = base + partition * CTRL_MMR0_PARTITION_SIZE;
-
-   /* Unlock the requested partition if locked using two-step sequence */
-   writel(CTRLMMR_LOCK_KICK0_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK0);
-   writel(CTRLMMR_LOCK_KICK1_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK1);
-}
-
  static void ctrl_mmr_unlock(void)
  {
/* Unlock all WKUP_CTRL_MMR0 module registers */
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index 63bf060616..eb72451d06 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -61,6 +61,16 @@ void k3_sysfw_print_ver(void)
   ti_sci->version.firmware_revision, fw_desc);
  }
  
+void mmr_unlock(phys_addr_t base, u32 partition)

+{
+   /* Translate the base address */
+   phys_addr_t part_base = base + partition * CTRL_MMR0_PARTITION_SIZE;
+
+   /* Unlock the requested partition if locked using two-step sequence */
+   writel(CTRLMMR_LOCK_KICK0_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK0);
+   writel(CTRLMMR_LOCK_KICK1_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK1);
+}
+
  DECLARE_GLOBAL_DATA_PTR;
  
  #ifdef CONFIG_K3_EARLY_CONS

diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h
index 94cdcb56ad..e8cc3daac1 100644
--- a/arch/arm/mach-k3/common.h
+++ b/arch/arm/mach-k3/common.h
@@ -28,3 +28,4 @@ void start_non_linux_remote_cores(void);
  int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr);
  void k3_sysfw_print_ver(void);
  void spl_enable_dcache(void);
+void mmr_unlock(phys_addr_t base, u32 partition);
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 5ec62a92f8..2010cab1d1 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -64,16 +64,6 @@ struct fwl_data cbass_hc_cfg0_fwls[] = {
  #endif
  #endif
  
-static void mmr_unlock(u32 base, u32 partition)

-{
-   /* Translate the base address */
-   phys_addr_t part_base = base + partition * CTRL_MMR0_PARTITION_SIZE;
-
-   /* Unlock the requested partition if locked using two-step sequence */
-   writel(CTRLMMR_LOCK_KICK0_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK0);
-   writel(CTRLMMR_LOCK_KICK1_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK1);
-}
-
  static void ctrl_mmr_unlock(void)
  {
/* Unlock all WKUP_CTRL_MMR0 module registers */





[PATCH 1/1] doc: qemu-mips build instructions

2020-07-27 Thread Heinrich Schuchardt
Correct the make commands for the defconfigs.

Signed-off-by: Heinrich Schuchardt 
---
 doc/board/emulation/qemu-mips.rst | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/board/emulation/qemu-mips.rst 
b/doc/board/emulation/qemu-mips.rst
index f206039f54..d35925126a 100644
--- a/doc/board/emulation/qemu-mips.rst
+++ b/doc/board/emulation/qemu-mips.rst
@@ -29,28 +29,28 @@ Using u-boot.bin as ROM (replaces Qemu monitor):

 .. code-block:: bash

-   make qemu_mips
+   make qemu_mips_defconfig
qemu-system-mips -M mips -bios u-boot.bin -nographic

 32 bit, little endian

 .. code-block:: bash

-   make qemu_mipsel
+   make qemu_mipsel_defconfig
qemu-system-mipsel -M mips -bios u-boot.bin -nographic

 64 bit, big endian

 .. code-block:: bash

-   make qemu_mips64
+   make qemu_mips64_defconfig
qemu-system-mips64 -cpu MIPS64R2-generic -M mips -bios u-boot.bin -nographic

 64 bit, little endian

 .. code-block:: bash

-   make qemu_mips64el
+   make qemu_mips64el_defconfig
qemu-system-mips64el -cpu MIPS64R2-generic -M mips -bios u-boot.bin 
-nographic

 or using u-boot.bin from emulated flash:
--
2.20.1



Re: [PATCH v2] imx: Add MYiR Tech MYS-6ULX support

2020-07-27 Thread Fabio Estevam
Hi Parthiban,

On Mon, Jul 27, 2020 at 11:48 AM Parthiban Nallathambi
 wrote:
>
> MYS-6ULX is single board computer (SBC) comes with eMMC or NAND based
> on imx6ULL SoC from NXP and provision for expansion board. This
> commit adds support only for SBC with NAND.
>
> CPU:   Freescale i.MX6ULL rev1.1 528 MHz (running at 396 MHz)
> CPU:   Commercial temperature grade (0C to 95C) at 45C
> Reset cause: WDOG
> Model: MYiR i.MX6ULL MYS-6ULX Single Board Computer with NAND
> Board: MYiR MYS-6ULX 6ULL Single Board Computer
> DRAM:  256 MiB
> NAND:  256 MiB
> MMC:   FSL_SDHC: 0
> In:serial@202
> Out:   serial@202
> Err:   serial@202
> Net:   FEC0
>
> Working:
>  - Eth0
>  - MMC/SD
>  - NAND
>  - UART 1
>  - USB host
>
> Signed-off-by: Parthiban Nallathambi 

Reviewed-by: Fabio Estevam 


[PULL u-boot] Please pull u-boot-amlogic-20200727

2020-07-27 Thread Neil Armstrong
Hi Tom,

This PR fixes a bug when the Amlogic UART detects error on the console line
and enables HDMI, USB Keyboard & ADC for the Odroid-C2.

The CI job is at 
https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic/pipelines/4208

Thanks,
Neil

The following changes since commit 3773028fced4795d52f02b387496395ec387f3bb:

  Merge branch '2020-07-27-misc-env-improvements' (2020-07-27 09:25:53 -0400)

are available in the Git repository at:

  https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic.git 
tags/u-boot-amlogic-20200727

for you to fetch changes up to 95ca2df3fd8f7b2cc995bccb2b46cd5650c4a9a7:

  configs: odroid-c2: update for HDMI output, ADC & USB keyboard (2020-07-27 
16:35:56 +0200)


- Handle errors in Meson serial driver
- Enable HDMI, keyboard and ADC for Odroid-C2


Anand Moon (1):
  configs: odroid-c2: update for HDMI output, ADC & USB keyboard

Neil Armstrong (1):
  serial: meson: handle RX errors

 configs/odroid-c2_defconfig   | 11 +++
 drivers/serial/serial_meson.c | 43 +++
 2 files changed, 50 insertions(+), 4 deletions(-)


RE: [PATCH v4 0/5] add DM based reset driver for SiFive SoC's

2020-07-27 Thread Sagar Kadam
Hi Rick,
> -Original Message-
> From: Sagar Kadam 
> Sent: Friday, July 24, 2020 2:17 PM
> To: u-boot@lists.denx.de
> Cc: r...@andestech.com; Paul Walmsley ( Sifive)
> ; pal...@dabbelt.com; anup.pa...@wdc.com;
> atish.pa...@wdc.com; lu...@denx.de; Pragnesh Patel
> ; bin.m...@windriver.com;
> ja...@amarulasolutions.com; s...@chromium.org; twoer...@gmail.com;
> patr...@blueri.se; mbrug...@suse.com; eugeniy.palt...@synopsys.com;
> weijie@mediatek.com; nsaenzjulie...@suse.de; feste...@gmail.com;
> sean...@gmail.com; Sagar Kadam 
> Subject: [PATCH v4 0/5] add DM based reset driver for SiFive SoC's
> 
> The FU540-C000 support in U-Boot is missing DM based reset driver, and is
> handling reset's to sub-system within the prci driver itself.
> The series here adds a generic DM reset driver for SiFive SoC's so as to
> leverage the U-Boot's reset framework and binds the reset driver with prci
> driver.
> The PRCI driver takes care of triggering the consumers reset signals
> appropriately.
> 
> Patch 1: Add necessary dt indexes for device reset register.
> Patch 2: Update macro's to use common dt indexes from binding header.
> Patch 3: Add reset producer and consumer entries within the device tree.
> Patch 4: Add reset dm driver and bind it within prci module.
> Patch 5: Add Kconfig, Makefile entries and enable the driver
> 
> This series is re-based on mainline U-Boot commit 5d3a21df6694 ("Merge tag
> 'dm-pull-20jul20' of git://git.denx.de/u-boot-dm") and depends on [1]
> 
> [1] https://patchwork.ozlabs.org/project/uboot/list/?series=190862
> 

I have rebased this series on u-boot/master.
Can you please pull it and let me know if any issues are there.

Thanks & BR,
Sagar

> History:
> ==
> V4:
> -Rebased the series to u-boot/master.
> 
> V3:
> -Add reset indexes in separate dt binding header instead of  updating the
> clock dt binding header which is synced from Linux
> 
> V2:
> -Removed extra character in commit log of 2nd patch
> 
> V1:
> -Base version.
> 
> Sagar Shrikant Kadam (5):
>   dt-bindings: prci: add indexes for reset signals available in prci
>   fu540: prci: use common reset indexes defined in binding header
>   fu540: dtsi: add reset producer and consumer entries
>   sifive: reset: add DM based reset driver for SiFive SoC's
>   configs: reset: fu540: enable dm reset framework for SiFive
> 
>  arch/riscv/dts/fu540-c000-u-boot.dtsi |  12 +++
>  arch/riscv/include/asm/arch-fu540/reset.h |  13 +++
>  configs/sifive_fu540_defconfig|   2 +
>  drivers/clk/sifive/fu540-prci.c   |  90 ++--
>  drivers/reset/Kconfig |   9 ++
>  drivers/reset/Makefile|   1 +
>  drivers/reset/reset-sifive.c  | 118 
> ++
>  include/dt-bindings/reset/sifive-fu540-prci.h |  19 +
>  8 files changed, 239 insertions(+), 25 deletions(-)  create mode 100644
> arch/riscv/include/asm/arch-fu540/reset.h
>  create mode 100644 drivers/reset/reset-sifive.c  create mode 100644
> include/dt-bindings/reset/sifive-fu540-prci.h
> 
> --
> 2.7.4



Re: [PULL] u-boot-sh/master

2020-07-27 Thread Tom Rini
On Mon, Jul 27, 2020 at 12:33:07PM +0200, Marek Vasut wrote:

> The following changes since commit ada61f1ee2a4eaa1b29d699b5ba940483171df8a:
> 
>   Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
> (2020-07-24 08:43:08 -0400)
> 
> are available in the Git repository at:
> 
>   git://git.denx.de/u-boot-sh.git master
> 
> for you to fetch changes up to 59028798ab5a1242cc9d578fa5c50a9f057630b2:
> 
>   ARM: rmobile: Add Beacon EmbeddedWorks RZG2M Dev Kit (2020-07-25
> 14:19:26 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PULL] u-boot-sh/net

2020-07-27 Thread Tom Rini
On Mon, Jul 27, 2020 at 12:34:40PM +0200, Marek Vasut wrote:

> More networking DM conversion (this is the last driver).
> Any news on Joe ?
> 
> The following changes since commit ada61f1ee2a4eaa1b29d699b5ba940483171df8a:
> 
>   Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
> (2020-07-24 08:43:08 -0400)
> 
> are available in the Git repository at:
> 
>   git://git.denx.de/u-boot-sh.git net
> 
> for you to fetch changes up to f23a785cfb451f3fcb457ed1f9141907dce7dd77:
> 
>   net: dc2114x: Add DM support (2020-07-25 14:20:56 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


[PATCH] travis: Update to python3-pyelftools

2020-07-27 Thread Tom Rini
With the migration to python3 for all of our tests, we need
python3-pyelftools and not python2-pyelftools to be installed.

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

diff --git a/.travis.yml b/.travis.yml
index 96fd55fe1ef1..0bb5aeaeb192 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,7 +23,7 @@ addons:
 - build-essential
 - libsdl2-dev
 - python
-- python-pyelftools
+- python3-pyelftools
 - python3-sphinx
 - python3-virtualenv
 - python3-pip
-- 
2.17.1



RE: [PATCHv3 01/36] dm: spi: Convert Freescale ESPI driver to driver model

2020-07-27 Thread Priyanka Jain (OSS)
>-Original Message-
>From: U-Boot  On Behalf Of Zhiqiang Hou
>Sent: Thursday, June 4, 2020 8:47 PM
>To: u-boot@lists.denx.de; Priyanka Jain ; Shengzhou
>Liu ; ja...@amarulasolutions.com;
>s...@chromium.org; Biwen Li ; bmeng...@gmail.com
>Cc: Jiafei Pan ; Chuanhua Han
>; Xiaowei Bao ; Z.q. Hou
>
>Subject: [PATCHv3 01/36] dm: spi: Convert Freescale ESPI driver to driver
>model
>
>From: Chuanhua Han 
>
>Modify the Freescale ESPI driver to support the driver model.
>Also resolved the following problems:
>
>= WARNING == This board
>does not use CONFIG_DM_SPI. Please update the board before v2019.04 for
>no dm conversion and v2019.07 for partially dm converted drivers.
>Failure to update can lead to driver/board removal See doc/driver-
>model/MIGRATION.txt for more info.
>
>= WARNING == This board
>does not use CONFIG_DM_SPI_FLASH. Please update the board to use
>CONFIG_SPI_FLASH before the v2019.07 release.
>Failure to update by the deadline may result in board removal.
>See doc/driver-model/MIGRATION.txt for more info.
>
>
>Signed-off-by: Chuanhua Han 
>Signed-off-by: Xiaowei Bao 
>Signed-off-by: Hou Zhiqiang 
>---


Some PowerPC platforms are now removed. Kindly rebase the series on top of
master branch of git://git.denx.de/u-boot.git

Regards
Priyanka


Re: Please pull u-boot-dm

2020-07-27 Thread Tom Rini
On Mon, Jul 27, 2020 at 08:54:01AM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Fri, 24 Jul 2020 at 06:41, Tom Rini  wrote:
> >
> > On Thu, Jul 23, 2020 at 09:09:33PM -0400, Tom Rini wrote:
> > > On Mon, Jul 20, 2020 at 02:19:02PM -0600, Simon Glass wrote:
> > >
> > > > Hi Tom,
> > > >
> > > > https://gitlab.denx.de/u-boot/custodians/u-boot-dm/pipelines/4139
> > > >
> > > > The following changes since commit 
> > > > 7303ba10a4a39852b9ba356fae5656b43122eec6:
> > > >
> > > >   Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
> > > > (2020-07-20 09:25:32 -0400)
> > > >
> > > > are available in the Git repository at:
> > > >
> > > >   git://git.denx.de/u-boot-dm.git tags/dm-pull-20jul20
> > > >
> > > > for you to fetch changes up to 60e7fa8b3b8538aae1e644dac61d5e4076901edb:
> > > >
> > > >   treewide: convert devfdt_get_addr() to dev_read_addr() (2020-07-20
> > > > 11:37:47 -0600)
> > > >
> > >
> > > Applied to u-boot/master, thanks!
> >
> > I spoke too soon.  This is reliably causing:
> > https://travis-ci.org/github/trini/u-boot/jobs/711313649
> > and I don't see why it's different from:
> > https://gitlab.denx.de/u-boot/u-boot/-/jobs/129107
> >
> > But, I also don't see why in both cases we say that pyelftools isn't
> > installed when it very much is.
> >
> > So I've reverted this for now, sorry.
> 
> That's a strange one, but I may have a handle on it (hopefully).

OK.

> Re pyelftools, where are you seeing that message?

OK, this is a red herring, sorry.  I thought I saw it everywhere, but I
only see it on Travis and I see we're not installing pyelftools for
python3, which would do it.

-- 
Tom


signature.asc
Description: PGP signature


Re: Please pull u-boot-dm

2020-07-27 Thread Michal Simek



On 27. 07. 20 16:54, Simon Glass wrote:
> Hi Tom,
> 
> On Fri, 24 Jul 2020 at 06:41, Tom Rini  wrote:
>>
>> On Thu, Jul 23, 2020 at 09:09:33PM -0400, Tom Rini wrote:
>>> On Mon, Jul 20, 2020 at 02:19:02PM -0600, Simon Glass wrote:
>>>
 Hi Tom,

 https://gitlab.denx.de/u-boot/custodians/u-boot-dm/pipelines/4139

 The following changes since commit 
 7303ba10a4a39852b9ba356fae5656b43122eec6:

   Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
 (2020-07-20 09:25:32 -0400)

 are available in the Git repository at:

   git://git.denx.de/u-boot-dm.git tags/dm-pull-20jul20

 for you to fetch changes up to 60e7fa8b3b8538aae1e644dac61d5e4076901edb:

   treewide: convert devfdt_get_addr() to dev_read_addr() (2020-07-20
 11:37:47 -0600)

>>>
>>> Applied to u-boot/master, thanks!
>>
>> I spoke too soon.  This is reliably causing:
>> https://travis-ci.org/github/trini/u-boot/jobs/711313649
>> and I don't see why it's different from:
>> https://gitlab.denx.de/u-boot/u-boot/-/jobs/129107
>>
>> But, I also don't see why in both cases we say that pyelftools isn't
>> installed when it very much is.
>>
>> So I've reverted this for now, sorry.
> 
> That's a strange one, but I may have a handle on it (hopefully).
> 
> Re pyelftools, where are you seeing that message?

I expect it is this.
https://travis-ci.org/github/michalsimek/u-boot/jobs/711439127

Thanks,
Michal


Re: Please pull u-boot-dm

2020-07-27 Thread Simon Glass
Hi Tom,

On Fri, 24 Jul 2020 at 06:41, Tom Rini  wrote:
>
> On Thu, Jul 23, 2020 at 09:09:33PM -0400, Tom Rini wrote:
> > On Mon, Jul 20, 2020 at 02:19:02PM -0600, Simon Glass wrote:
> >
> > > Hi Tom,
> > >
> > > https://gitlab.denx.de/u-boot/custodians/u-boot-dm/pipelines/4139
> > >
> > > The following changes since commit 
> > > 7303ba10a4a39852b9ba356fae5656b43122eec6:
> > >
> > >   Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
> > > (2020-07-20 09:25:32 -0400)
> > >
> > > are available in the Git repository at:
> > >
> > >   git://git.denx.de/u-boot-dm.git tags/dm-pull-20jul20
> > >
> > > for you to fetch changes up to 60e7fa8b3b8538aae1e644dac61d5e4076901edb:
> > >
> > >   treewide: convert devfdt_get_addr() to dev_read_addr() (2020-07-20
> > > 11:37:47 -0600)
> > >
> >
> > Applied to u-boot/master, thanks!
>
> I spoke too soon.  This is reliably causing:
> https://travis-ci.org/github/trini/u-boot/jobs/711313649
> and I don't see why it's different from:
> https://gitlab.denx.de/u-boot/u-boot/-/jobs/129107
>
> But, I also don't see why in both cases we say that pyelftools isn't
> installed when it very much is.
>
> So I've reverted this for now, sorry.

That's a strange one, but I may have a handle on it (hopefully).

Re pyelftools, where are you seeing that message?

Regards,
Simon


Re: [PATCH v4 1/5] cmd: bind: allow to bind driver with driver data

2020-07-27 Thread Patrice CHOTARD
don't take care of my previous email, i did a mistake 

Patrice

On 7/27/20 4:25 PM, Patrice CHOTARD wrote:
> Hi Tom
>
> Sorry for the delay, i was on vacation.
>
> I launched dm unit tests on current master 
> (ada61f1ee2a4eaa1b29d699b5ba940483171df8a)
>
> and everything seems ok, perhaps i don't execute them correctly, see my log 
> below :
>
> ./test/py/test.py --bd sandbox --build -k ut_dm -v
>
> +make O=/local/home/nxp11987/projects/community/u-boot.denx/build-sandbox -s 
> sandbox_defconfig
> +make O=/local/home/nxp11987/projects/community/u-boot.denx/build-sandbox -s 
> -j8
> ===
>  test session starts 
> ===
> platform linux -- Python 3.6.9, pytest-5.2.1, py-1.8.0, pluggy-0.13.0 -- 
> /usr/bin/python3
> cachedir: .pytest_cache
> rootdir: /local/home/nxp11987/projects/community/u-boot.denx/test/py, 
> inifile: pytest.ini
> collected 672 items / 370 deselected / 302 selected   
>   
>  
>
> test/py/tests/test_ut.py::test_ut_dm_init PASSED  
>   
>     [  0%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_basic] PASSED
>   
>     [  0%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_cmd_dump] PASSED 
>   
>     [  0%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_cmd_items] PASSED
>   
>     [  1%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_cmd_list] PASSED 
>   
>     [  1%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_create_dmar] PASSED  
>   
>     [  1%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_device] PASSED   
>   
>     [  2%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_device_path] PASSED  
>   
>     [  2%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_device_status] PASSED
>   
>     [  2%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_array] PASSED 
>   
>     [  3%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_child] PASSED 
>   
>     [  3%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_copy] PASSED  
>   
>     [  3%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_gpio] PASSED  
>   
>     [  4%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_int] PASSED   
>   
>     [  4%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_int16] PASSED 
>   
>     [  4%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_int64] PASSED 
>   
>     [  5%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_int8] PASSED  
>   
>     [  5%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_multiple] PASSED  
>   
>     [  5%]
> test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_new_table] PASSED 
>   

Re: [PATCH v4 1/5] cmd: bind: allow to bind driver with driver data

2020-07-27 Thread Tom Rini
On Mon, Jul 27, 2020 at 02:25:06PM +, Patrice CHOTARD wrote:

> Hi Tom
> 
> Sorry for the delay, i was on vacation.
> 
> I launched dm unit tests on current master 
> (ada61f1ee2a4eaa1b29d699b5ba940483171df8a)
> 
> and everything seems ok, perhaps i don't execute them correctly, see my log 
> below :
> 
> ./test/py/test.py --bd sandbox --build -k ut_dm -v
> 

Hunh, alright.  The series isn't applying cleanly for me either, so can
you please rebase and repost?  It seems I must have messed something up
in the rebase.  Thanks!

-- 
Tom


signature.asc
Description: PGP signature


pull request of u-boot-fsl-qoriq for v2020.10

2020-07-27 Thread Priyanka Jain
Dear Tom,

Please find my pull-request for u-boot-fsl-qoriq/master
https://travis-ci.org/github/p-priyanka-jain/u-boot/builds/712122749

Summary
Bug fixes and updates on ls2088a,ls1028a, ls1046a, ls1043a, ls1012a
lx2-watchdog support
layerscape:pci-endpoint support, spin table relocation fixes and cleanups
fsl-crypto: RNG support and bug fixes

Thanks
Priyanka
---
The following changes since commit ada61f1ee2a4eaa1b29d699b5ba940483171df8a:

Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv (2020-07-24 
08:43:08 -0400)

are available in the Git repository at:

  https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq.git HEAD

for you to fetch changes up to 636999f21cdd901f1d78323456447ce956410776:

  configs: ls2088a: Restore CONFIG_ENV_ADDR to IFC-NOR (2020-07-27 14:24:15 
+0530)


Biwen Li (6):
  I2C: ls1043a, ls1046a: enable SYS_I2C_MXC
  i2c: mxc: move i2c_early_init_f to common function
  freescale: ls1046aqds: enable secure system counter
  freescale: ls1046aqds: drop ifdef CONFIG_SYS_I2C
  freescale: ls1043aqds: enable secure system counter
  freescale: ls1043aqds: drop ifdef CONFIG_SYS_I2C

Chaitanya Sakinam (1):
  armv8: ls1012a: RGMII ports require internal delay

Era Tiwari (1):
  configs: ls1088ardb: Add support for usb boot target

Heinrich Schuchardt (2):
  crypto/fsl: correct printf() statement.
  crypto/fsl: unused value in caam_hash_update()

Hou Zhiqiang (2):
  arm64: ls1043a: Remove the workaround of erratum A-009929
  pci: layerscape: Add specific config entry for RC and EP mode driver

Kuldeep Singh (3):
  net: pfe_eth: Use spi_flash_read API to access flash memory
  configs: ls1012a: Increase CONFIG_SYS_MALLOC_LEN value
  configs: ls2088a: Restore CONFIG_ENV_ADDR to IFC-NOR

Manish Tomar (1):
  configs:ls1046afrwy: Add tfa secure boot defconfig

Michael Walle (21):
  armv8: ls1028a: move FSL_LAYERSCAPE to kconfig
  armv8: layerscape: fix spin-table support
  armv8: layerscape: pretty print info about SMP cores
  armv8: layerscape: properly use CPU_RELEASE_ADDR
  armv8: layerscape: move spin table into own module
  armv8: layerscape: load function pointer using ADR
  armv8: layerscape: fix alignment for spin table
  armv8: layerscape: remove determine_mp_bootpg()
  armv8: layerscape: simplify get_spin_tbl_addr() calls
  armv8: layerscape: make wake_secondary_core_n() static
  armv8: layerscape: drop first .ltorg directive in spintable.S
  armv8: layerscape: clean exported symbols in spintable.S
  armv8: layerscape: relocate spin table if EFI_LOADER is enabled
  armv8: layerscape: rework spin table
  crypto/fsl: fix unaligned access
  crypto/fsl: make SEC%u status line consistent
  crypto/fsl: export caam_get_era()
  crypto/fsl: support newer SEC modules
  crypto/fsl: don't regenerate secure keys
  crypto/fsl: instantiate the RNG with prediciton resistance
  crypto/fsl: add RNG support

Udit Agarwal (1):
  include/configs: ls1012a: Remove fdt_high env variable

Vladimir Oltean (1):
  fsl_dspi: Introduce DT bindings for CS-SCK and SCK-CS delays

Wasim Khan (1):
  arm: dts: lx2160a: Increase configuration window size

Xiaowei Bao (9):
  pci: layerscape: Split the EP and RC driver
  pci_ep: Add the init function
  armv8: dts: ls1046a: Add the PCIe EP node
  pcie_ep: layerscape: Add the multiple function support
  pci_ep: layerscape: Add the workaround for errata A-009460
  pci_ep: layerscape: Add Support for ls2085a and ls2080a EP mode
  pci_ep: layerscape: Add the SRIOV VFs of PF support
  pci: layerscape: Modify the ls_pcie_dump_atu function
  pci_ep: layerscape: Add the PCIe EP mode support for lx2160a-v2

Yangbo Lu (4):
  Drop global data sdhc_adapter for powerpc
  Move eSDHC adapter card identification to board files
  board: fsl: lx2160aqds: identify SDHC adapter during board init
  configs: lx2160aqds: enable CONFIG_BOARD_EARLY_INIT_R

Yuantian Tang (1):
  armv8: ls1028ardb: add xspi parameter to qixis command

Zhao Qiang (6):
  armv8: dts: fsl-lx2160a: add flash node under dspi to qds dts
  config: lx2160/2a: enable dspi
  Watchdog: introduce ARM SBSA watchdog driver
  arm64: lx2160a: dts: Add watchdog node
  configs: lx2160a: Enable Watchdog support
  arm: dts: ls1028a: Add dspi flash device node to qds

hui.song (2):
  armv8: gpio: add gpio feature
  dm: armv8: gpio: include  for fsl-layerscape

MAINTAINERS|   1 +
arch/arm/cpu/armv8/fsl-layerscape/Kconfig  |   9 +-
arch/arm/cpu/armv8/fsl-layerscape/Makefile |   2 +-
arch/arm/cpu/armv8/fsl-layerscape/fdt.c|   9 +-
arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S   | 165 +--
arch/arm/cpu/armv8/fsl-layerscape/mp.c | 

Re: [PATCH v4 1/5] cmd: bind: allow to bind driver with driver data

2020-07-27 Thread Patrice CHOTARD
Hi Tom

Sorry for the delay, i was on vacation.

I launched dm unit tests on current master 
(ada61f1ee2a4eaa1b29d699b5ba940483171df8a)

and everything seems ok, perhaps i don't execute them correctly, see my log 
below :

./test/py/test.py --bd sandbox --build -k ut_dm -v

+make O=/local/home/nxp11987/projects/community/u-boot.denx/build-sandbox -s 
sandbox_defconfig
+make O=/local/home/nxp11987/projects/community/u-boot.denx/build-sandbox -s -j8
===
 test session starts 
===
platform linux -- Python 3.6.9, pytest-5.2.1, py-1.8.0, pluggy-0.13.0 -- 
/usr/bin/python3
cachedir: .pytest_cache
rootdir: /local/home/nxp11987/projects/community/u-boot.denx/test/py, inifile: 
pytest.ini
collected 672 items / 370 deselected / 302 selected 

 

test/py/tests/test_ut.py::test_ut_dm_init PASSED

    [  0%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_basic] PASSED  

    [  0%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_cmd_dump] PASSED   

    [  0%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_cmd_items] PASSED  

    [  1%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_cmd_list] PASSED   

    [  1%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_create_dmar] PASSED

    [  1%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_device] PASSED 

    [  2%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_device_path] PASSED

    [  2%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_device_status] PASSED  

    [  2%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_array] PASSED   

    [  3%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_child] PASSED   

    [  3%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_copy] PASSED

    [  3%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_gpio] PASSED

    [  4%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_int] PASSED 

    [  4%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_int16] PASSED   

    [  4%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_int64] PASSED   

    [  5%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_int8] PASSED

    [  5%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_multiple] PASSED

    [  5%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_dp_new_table] PASSED   

    [  6%]
test/py/tests/test_ut.py::test_ut[ut_dm_acpi_emit_simple] PASSED

    [  6%]
test/p

Re: [PATCH v2 02/14] toradex: tdx-cfg-block: add EEPROM read/store wrappers

2020-07-27 Thread Stefano Babic
On 27.07.20 15:35, Tom Rini wrote:
> On Mon, Jul 27, 2020 at 02:49:30PM +0200, Stefano Babic wrote:
>> Hi Igor,
>>
>> On 15.07.20 12:30, Igor Opaniuk wrote:
>>> From: Igor Opaniuk 
>>>
>>> These functions wrap functionality for storing config blocks in EEPROM.
>>>
>>> Signed-off-by: Igor Opaniuk 
>>> ---
>>>
>>
>> This breaks one of your (obsolete ?) board, colibri_pxa270
>>
>> Reason is a side-effect in dm/read.h:
>>
>>arm:  +   colibri_pxa270
>> +In file included from include/dm.h:12,
>> + from board/toradex/common/tdx-eeprom.c:6:
>> +include/dm/read.h: In function 'dev_read_alias_seq':
>> +include/dm/read.h:932:10: error: 'ENOTSUPP' undeclared (first use in
>> this function)
>> +  932 |  return -ENOTSUPP;
>> +  |  ^~~~
>> +include/dm/read.h:932:10: note: each undeclared identifier is reported
>> only once for each function it appears in
>> +make[2]: *** [scripts/Makefile.build:266:
>> board/toradex/common/tdx-eeprom.o] Error 1
>> +make[1]: *** [Makefile:1793: board/toradex/common] Error 2
>> +make: *** [Makefile:167: sub-make] Error 2
>>
>>
>> Adding the include to dm/read.h, issue is solved:
>>
>> diff --git a/include/dm/read.h b/include/dm/read.h
>> index f02ec95954..cc4ab22f65 100644
>> --- a/include/dm/read.h
>> +++ b/include/dm/read.h
>> @@ -12,6 +12,7 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>>
>>  struct resource;
>>
>>
>> I could add it myself if there is a general agreement, but the usual way
>> is to repost it.
> 
> This is also fixed by:
> http://patchwork.ozlabs.org/project/uboot/patch/20200723120138.10625-1-dmur...@ti.com/
> as Dan also ran in to this problem.  I assigned it to Simon but if you
> want to take it as part of being able to pick up Igor's series now I'm
> sure that's fine.  Thanks!

Fine, thanks ! I pick up Dan's.

Stefano

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


Re: [PATCH 8/8] Initial Pine64 Pinephone support

2020-07-27 Thread Peter Robinson
> On Wed, Jul 22, 2020 at 03:18:40PM +0100, Peter Robinson wrote:
> > The Pine64 Pinephone is a smartphone based on the AllWinner A64 SoC.
> > It has the following features:
> > * 2GB LPDDR3 SDRAM
> > * 5.95 inch 1440x720 HD IPS capacitive touchscreen
> > * 16GB eMMC, mSD slot
> > * Quectel EG25 LTE Modem
> > * Realtek RTL8723CS WiFi/BT
> > * Front and read cameras
> > * Accelerometer, gyro, proximity, ambient light, compass sensors
> > * A USB Type-C, USB Host, DisplayPort alt mode output, 15W 5V 3A Quick 
> > Charge, follows USB PD specification
> >
> > Signed-off-by: Peter Robinson 
> > ---
> >  arch/arm/Kconfig|  2 +-
> >  configs/pinephone_defconfig | 38 +
> >  2 files changed, 39 insertions(+), 1 deletion(-)
> >  create mode 100644 configs/pinephone_defconfig
> >
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > index e16fe03887..636ba26938 100644
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -1004,7 +1004,7 @@ config ARCH_SUNXI
> >   bool "Support sunxi (Allwinner) SoCs"
> >   select BINMAN
> >   select CMD_GPIO
> > - select CMD_MMC if MMC
> > +select CMD_MMC if MMC
>
> That looks like a typo?

Yes, it is.

> >   select CMD_USB if DISTRO_DEFAULTS
> >   select CLK
> >   select DM
> > diff --git a/configs/pinephone_defconfig b/configs/pinephone_defconfig
> > new file mode 100644
> > index 00..d5750aa954
> > --- /dev/null
> > +++ b/configs/pinephone_defconfig
> > @@ -0,0 +1,38 @@
> > +CONFIG_ARM=y
> > +CONFIG_ARCH_SUNXI=y
> > +CONFIG_SPL=y
> > +CONFIG_MACH_SUN50I=y
> > +CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
> > +CONFIG_DRAM_CLK=552
> > +CONFIG_DRAM_ZQ=3881949
> > +CONFIG_NR_DRAM_BANKS=1
> > +CONFIG_MMC_SUNXI_SLOT_EXTRA=2
> > +CONFIG_R_I2C_ENABLE=y
> > +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> > +# CONFIG_SPL_SPI_SUNXI is not set
> > +# CONFIG_SPL_DOS_PARTITION is not set
> > +# CONFIG_SPL_EFI_PARTITION is not set
> > +CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pinephone-1.1"
> > +CONFIG_OF_LIST="sun50i-a64-pinephone-1.1 sun50i-a64-pinephone-1.0"
> > +CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> > +CONFIG_DM_REGULATOR=y
> > +CONFIG_DM_REGULATOR_FIXED=y
> > +CONFIG_DM_PWM=y
> > +CONFIG_PWM_SUNXI=y
> > +CONFIG_CMD_GPIO=y
> > +CONFIG_CMD_GPT=y
> > +CONFIG_CMD_I2C=y
> > +CONFIG_CMD_MMC=y
> > +# CONFIG_CMD_MII is not set
> > +# CONFIG_CMD_NFS is not set
> > +# CONFIG_DM_ETH is not set
> > +# CONFIG_PHY is not set
> > +# CONFIG_PHY_GIGE is not set
> > +# CONFIG_SUN8I_EMAC is not set
> > +# CONFIG_PHY_REALTEK is not set
> > +# CONFIG_CMD_SF is not set
> > +# CONFIG_SPI is not set
> > +# CONFIG_DM_SPI is not set
> > +# CONFIG_SPI_FLASH is not set
> > +# CONFIG_SPI_MEM is not set
> > +# CONFIG_DM_SPI_FLASH is not set
>
> I'm not entirely sure why we need to deviate from the default that much
> here. Some options should definitely be disabled (like SUN8I_EMAC), but
> I'm not really sure why it's enabled in the first place, and why we need

Because it's selected by default for the SoC, I suspect that's because
it was assumed that everything would be a dev board and have a wired
ethernet port but there's more and more devices that don't so it
probably makes sense to review that but I didn't want to do that as
part of enabling a device.

> to disable the other network related options (PHY, PHY_GIGE,
> PHY_REALTEK). They shouldn't even be enabled in the first place.

That would be my guess but I suspect it's the same as the SUN8I_EMAC above.

> Similarly, CMD_GPIO, CMD_GPT should be enabled by default.
>
> (and I'm not sure why PWM_SUNXI is here in the first place?)

It's used by the backlight, it shouldn't have made it into this patch,
as the DT bits aren't upstream yet and as I mentioned in my overview
the screen side of things is still a WiP, I must have missed it as I
sliced up my patch set between bits that worked with upstream and bits
that still need some work before they go upstream.

Peter


Re: [RESEND PATCH v5 4/4] test: env: add test for env info sub-command

2020-07-27 Thread Tom Rini
On Fri, Jun 19, 2020 at 02:03:37PM +0200, Patrick Delaunay wrote:

> Add a pytest for testing the env info sub-command:
> 
> test_env_info: test command with several option that
> can be executed on real hardware device without assumption
> 
> test_env_info_sandbox: test the result on sandbox
> with a known ENV configuration: ready & default & persistent
> 
> The quiet option '-q' is used for support in shell test;
> for example:
>   if env info -p -d -q; then env save; fi
> 
> Signed-off-by: Patrick Delaunay 
> Acked-by: Stephen Warren 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 02/14] toradex: tdx-cfg-block: add EEPROM read/store wrappers

2020-07-27 Thread Tom Rini
On Mon, Jul 27, 2020 at 02:49:30PM +0200, Stefano Babic wrote:
> Hi Igor,
> 
> On 15.07.20 12:30, Igor Opaniuk wrote:
> > From: Igor Opaniuk 
> > 
> > These functions wrap functionality for storing config blocks in EEPROM.
> > 
> > Signed-off-by: Igor Opaniuk 
> > ---
> > 
> 
> This breaks one of your (obsolete ?) board, colibri_pxa270
> 
> Reason is a side-effect in dm/read.h:
> 
>arm:  +   colibri_pxa270
> +In file included from include/dm.h:12,
> + from board/toradex/common/tdx-eeprom.c:6:
> +include/dm/read.h: In function 'dev_read_alias_seq':
> +include/dm/read.h:932:10: error: 'ENOTSUPP' undeclared (first use in
> this function)
> +  932 |  return -ENOTSUPP;
> +  |  ^~~~
> +include/dm/read.h:932:10: note: each undeclared identifier is reported
> only once for each function it appears in
> +make[2]: *** [scripts/Makefile.build:266:
> board/toradex/common/tdx-eeprom.o] Error 1
> +make[1]: *** [Makefile:1793: board/toradex/common] Error 2
> +make: *** [Makefile:167: sub-make] Error 2
> 
> 
> Adding the include to dm/read.h, issue is solved:
> 
> diff --git a/include/dm/read.h b/include/dm/read.h
> index f02ec95954..cc4ab22f65 100644
> --- a/include/dm/read.h
> +++ b/include/dm/read.h
> @@ -12,6 +12,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
> 
>  struct resource;
> 
> 
> I could add it myself if there is a general agreement, but the usual way
> is to repost it.

This is also fixed by:
http://patchwork.ozlabs.org/project/uboot/patch/20200723120138.10625-1-dmur...@ti.com/
as Dan also ran in to this problem.  I assigned it to Simon but if you
want to take it as part of being able to pick up Igor's series now I'm
sure that's fine.  Thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [RESEND PATCH v5 3/4] configs: sandbox: Enable sub command 'env info'

2020-07-27 Thread Tom Rini
On Fri, Jun 19, 2020 at 02:03:36PM +0200, Patrick Delaunay wrote:

> Enable support for sub command 'env info' in sandbox
> with CONFIG_CMD_NVEDIT_INFO. This is aimed primarily
> at adding unit test.
> 
> Signed-off-by: Patrick Delaunay 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [RESEND PATCH v5 1/4] cmd: env: add option for quiet output on env info

2020-07-27 Thread Tom Rini
On Fri, Jun 19, 2020 at 02:03:34PM +0200, Patrick Delaunay wrote:

> The "env info" can be use for test with -d and -p parameter,
> in scripting case the output of the command is not needed.
> 
> This patch allows to deactivate this output with a new option "-q".
> 
> For example, we can save the environment if default
> environment is used and persistent storage is managed with:
>   if env info -p -d -q; then env save; fi
> 
> Without the quiet option, I have the unnecessary traces
> First boot:
>   Default environment is used
>   Environment can be persisted
>   Saving Environment to EXT4... File System is consistent
> 
> Next boot:
>   Environment was loaded from persistent storage
>   Environment can be persisted
> 
> Signed-off-by: Patrick Delaunay 
> Reviewed-by: Simon Glass 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [RESEND PATCH v5 2/4] cmd: env: check real location for env info command

2020-07-27 Thread Tom Rini
On Fri, Jun 19, 2020 at 02:03:35PM +0200, Patrick Delaunay wrote:

> Check the current ENV location, dynamically provided by the weak
> function env_get_location to be sure that the environment can be
> persistent.
> 
> The compilation flag ENV_IS_IN_DEVICE is not enough when the board
> dynamically select the available storage location (according boot
> device for example).
> 
> This patch solves issue for stm32mp1 platform, when the boot device
> is USB.
> 
> Signed-off-by: Patrick Delaunay 
> Reviewed-by: Simon Glass 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [RESEND PATCH 3/3] env: mmc: add redundancy support in mmc_offset_try_partition

2020-07-27 Thread Tom Rini
On Mon, Jun 15, 2020 at 10:38:57AM +0200, Patrick Delaunay wrote:

> Manage 2 copy at the end of the partition selected by config
> "u-boot,mmc-env-partition" to save the U-Boot environment,
> with CONFIG_ENV_SIZE and 2*CONFIG_ENV_SIZE offset.
> 
> This patch allows to support redundancy (CONFIG_ENV_OFFSET_REDUND).
> 
> Signed-off-by: Patrick Delaunay 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [RESEND PATCH 2/3] env: mmc: correct the offset returned by mmc_offset_try_partition

2020-07-27 Thread Tom Rini
On Mon, Jun 15, 2020 at 10:38:56AM +0200, Patrick Delaunay wrote:

> The output of the function mmc_offset_try_partition must be a
> byte offset in mmc and not a multiple of blksz.
> 
> This function is used in mmc_offset(), called by mmc_get_env_addr()
> and the offset is used in write_env(), erase_env() and read_env().
> 
> In these function, blk_start = offset / mmc->read_bl_len
> or /write_bl_len so this offset is not a multiple of blksz.
> 
> Signed-off-by: Patrick Delaunay 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] env: add failing trace in env_save

2020-07-27 Thread Tom Rini
On Wed, Jun 24, 2020 at 10:17:50AM +0200, Patrick Delaunay wrote:

> Add trace in env save to indicate any errors to end user and avoid
> silent output when the command 'env save' is not executed.
> 
> Signed-off-by: Patrick Delaunay 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [RESEND PATCH 1/3] env: mmc: allow support of mmc_get_env_dev with OF_CONTROL

2020-07-27 Thread Tom Rini
On Mon, Jun 15, 2020 at 10:38:55AM +0200, Patrick Delaunay wrote:

> Use the weak function mmc_get_env_dev in mmc_offset_try_partition
> function to allow dynamic selection of mmc device to use
> and no more use directly the define CONFIG_SYS_MMC_ENV_DEV.
> 
> Signed-off-by: Patrick Delaunay 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] env: correct overflow check of env_has_init size

2020-07-27 Thread Tom Rini
On Wed, Jun 24, 2020 at 09:27:25AM +0200, Patrick Delaunay wrote:

> Correct the overflow check of the bit-field env_has_init with
> the max value of env_location= ENVL_COUNT and no more with the
> size of env_locations.
> 
> This bit-field is indexed by this enumerate and not by the position in
> the env_locations (only used in env_get_location) and the
> 2 values are different, depending of thea ctivated CONFIG_ENV_IS_ options.
> 
> Signed-off-by: Patrick Delaunay 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] env/fat.c: allow loading from a FAT partition on the MMC boot device

2020-07-27 Thread Tom Rini
On Fri, Jun 19, 2020 at 11:07:17PM +0100, David Woodhouse wrote:

> I don't want to have to specify the device; only the partition.
> 
> This allows me to use the same image on internal eMMC or SD card for
> Banana Pi R2, and it finds its own environment either way.
> 
> Signed-off-by: David Woodhouse 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 1/1] test: do not rely on => being the prompt

2020-07-27 Thread Tom Rini
On Fri, Jul 24, 2020 at 08:55:37PM +0200, Heinrich Schuchardt wrote:

> In our tests we should use the customized prompt for testing.
> 
> Reported-by: Tom Rini 
> Signed-off-by: Heinrich Schuchardt 

Tested-by: Tom Rini 

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 8/8] Initial Pine64 Pinephone support

2020-07-27 Thread Maxime Ripard
Hi,

On Wed, Jul 22, 2020 at 03:18:40PM +0100, Peter Robinson wrote:
> The Pine64 Pinephone is a smartphone based on the AllWinner A64 SoC.
> It has the following features:
> * 2GB LPDDR3 SDRAM
> * 5.95 inch 1440x720 HD IPS capacitive touchscreen
> * 16GB eMMC, mSD slot
> * Quectel EG25 LTE Modem
> * Realtek RTL8723CS WiFi/BT
> * Front and read cameras
> * Accelerometer, gyro, proximity, ambient light, compass sensors
> * A USB Type-C, USB Host, DisplayPort alt mode output, 15W 5V 3A Quick 
> Charge, follows USB PD specification
> 
> Signed-off-by: Peter Robinson 
> ---
>  arch/arm/Kconfig|  2 +-
>  configs/pinephone_defconfig | 38 +
>  2 files changed, 39 insertions(+), 1 deletion(-)
>  create mode 100644 configs/pinephone_defconfig
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index e16fe03887..636ba26938 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1004,7 +1004,7 @@ config ARCH_SUNXI
>   bool "Support sunxi (Allwinner) SoCs"
>   select BINMAN
>   select CMD_GPIO
> - select CMD_MMC if MMC
> +select CMD_MMC if MMC

That looks like a typo?

>   select CMD_USB if DISTRO_DEFAULTS
>   select CLK
>   select DM
> diff --git a/configs/pinephone_defconfig b/configs/pinephone_defconfig
> new file mode 100644
> index 00..d5750aa954
> --- /dev/null
> +++ b/configs/pinephone_defconfig
> @@ -0,0 +1,38 @@
> +CONFIG_ARM=y
> +CONFIG_ARCH_SUNXI=y
> +CONFIG_SPL=y
> +CONFIG_MACH_SUN50I=y
> +CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
> +CONFIG_DRAM_CLK=552
> +CONFIG_DRAM_ZQ=3881949
> +CONFIG_NR_DRAM_BANKS=1
> +CONFIG_MMC_SUNXI_SLOT_EXTRA=2
> +CONFIG_R_I2C_ENABLE=y
> +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +# CONFIG_SPL_SPI_SUNXI is not set
> +# CONFIG_SPL_DOS_PARTITION is not set
> +# CONFIG_SPL_EFI_PARTITION is not set
> +CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pinephone-1.1"
> +CONFIG_OF_LIST="sun50i-a64-pinephone-1.1 sun50i-a64-pinephone-1.0"
> +CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> +CONFIG_DM_REGULATOR=y
> +CONFIG_DM_REGULATOR_FIXED=y
> +CONFIG_DM_PWM=y
> +CONFIG_PWM_SUNXI=y
> +CONFIG_CMD_GPIO=y
> +CONFIG_CMD_GPT=y
> +CONFIG_CMD_I2C=y
> +CONFIG_CMD_MMC=y
> +# CONFIG_CMD_MII is not set
> +# CONFIG_CMD_NFS is not set
> +# CONFIG_DM_ETH is not set
> +# CONFIG_PHY is not set
> +# CONFIG_PHY_GIGE is not set
> +# CONFIG_SUN8I_EMAC is not set
> +# CONFIG_PHY_REALTEK is not set
> +# CONFIG_CMD_SF is not set
> +# CONFIG_SPI is not set
> +# CONFIG_DM_SPI is not set
> +# CONFIG_SPI_FLASH is not set
> +# CONFIG_SPI_MEM is not set
> +# CONFIG_DM_SPI_FLASH is not set

I'm not entirely sure why we need to deviate from the default that much
here. Some options should definitely be disabled (like SUN8I_EMAC), but
I'm not really sure why it's enabled in the first place, and why we need
to disable the other network related options (PHY, PHY_GIGE,
PHY_REALTEK). They shouldn't even be enabled in the first place.

Similarly, CMD_GPIO, CMD_GPT should be enabled by default.

(and I'm not sure why PWM_SUNXI is here in the first place?)

Maxime


signature.asc
Description: PGP signature


Re: [PATCH 6/8] arm: dts: Sync the sun50i-a64.dtsi from Linux 5.8-rc1

2020-07-27 Thread Heinrich Schuchardt
On 26.07.20 12:17, Peter Robinson wrote:
> On Thu, Jul 23, 2020 at 12:15 AM André Przywara  
> wrote:
>>
>> On 22/07/2020 15:18, Peter Robinson wrote:
>>> Sync the Allwinner A64 sun50i-a64.dtsi from Linux.
>>
>> Hi Peter,
>>
>> thanks for your series!
>>
>> While this looks mostly straight-forward, the problem is that this patch
>> here affects all Allwinner boards. And for them it breaks older kernels,
>> which cannot cope with some of the changed bindings or nodes.
>> Your patches up until here are fine, since they only add nodes and
>> properties, but this update changes nodes, some in a non-compatible way.
>>
>> Examples are dropping the "syscon" compatible (which requires 4.18 to
>> know about the new compatible string) and the dropping of
>> internal-osc-clk and the connected RTC change. This breaks any kernels
>> that don't know about the third RTC clock (<&rtc 2>) or the new
>> compatible string (introduced in 4.20). Similar effects show up in other
>> OSes.
>
> The 4.18 kernel is over 2 years old. How many users are going to
> actively upgrade U-Boot to the latest and not the kernel all while
> using the U-Boot provided DT and not just loading the matching kernel
> DT supplied by what ever ancient kernel they happen to choose to use?
> I feel this use case is quite a corner case and in those cases they're
> probably not using a vanilla upstream U-Boot anyway.

Sure people using an old Linux distribution not providing an U-Boot
image may do so.

But here we are talking about the U-Boot device tree. As Linux device
trees are release specific you should not try to boot Linux using a
devicetree not provided by the exact same Linux version.

So incompatiblities between old Linux releases and U-Boot's device tree
should be irrelevant.

Best regards

Heinrich

>
>> I was experimenting with some small changes (compared to mainline) to
>> overcome those issues, mostly by *adding* compatible strings instead of
>> *replacing* them.
>
> Shouldn't they be added to a -u-boot.dtsi?
>
>> So I would like to ask for a few days so that I can do more testing with
>> various kernels. I would then post those changes, so that we can discuss
>> them.
>>
>> Cheers,
>> Andre
>>
>>>
>>> Signed-off-by: Peter Robinson 
>>> ---
>>>  arch/arm/dts/sun50i-a64.dtsi | 532 ---
>>>  1 file changed, 434 insertions(+), 98 deletions(-)
>>>
>>> diff --git a/arch/arm/dts/sun50i-a64.dtsi b/arch/arm/dts/sun50i-a64.dtsi
>>> index ff41abc96a..8dfbcd1440 100644
>>> --- a/arch/arm/dts/sun50i-a64.dtsi
>>> +++ b/arch/arm/dts/sun50i-a64.dtsi
>>> @@ -1,46 +1,7 @@
>>> -/*
>>> - * Copyright (C) 2016 ARM Ltd.
>>> - * based on the Allwinner H3 dtsi:
>>> - *Copyright (C) 2015 Jens Kuske 
>>> - *
>>> - * This file is dual-licensed: you can use it either under the terms
>>> - * of the GPL or the X11 license, at your option. Note that this dual
>>> - * licensing only applies to this file, and not this project as a
>>> - * whole.
>>> - *
>>> - *  a) This file is free software; you can redistribute it and/or
>>> - * modify it under the terms of the GNU General Public License as
>>> - * published by the Free Software Foundation; either version 2 of the
>>> - * License, or (at your option) any later version.
>>> - *
>>> - * This file is distributed in the hope that it will be useful,
>>> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
>>> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>> - * GNU General Public License for more details.
>>> - *
>>> - * Or, alternatively,
>>> - *
>>> - *  b) Permission is hereby granted, free of charge, to any person
>>> - * obtaining a copy of this software and associated documentation
>>> - * files (the "Software"), to deal in the Software without
>>> - * restriction, including without limitation the rights to use,
>>> - * copy, modify, merge, publish, distribute, sublicense, and/or
>>> - * sell copies of the Software, and to permit persons to whom the
>>> - * Software is furnished to do so, subject to the following
>>> - * conditions:
>>> - *
>>> - * The above copyright notice and this permission notice shall be
>>> - * included in all copies or substantial portions of the Software.
>>> - *
>>> - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>>> - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
>>> - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
>>> - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
>>> - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
>>> - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>>> - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
>>> - * OTHER DEALINGS IN THE SOFTWARE.
>>> - */
>>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>>> +// Copyright (C) 2016 ARM Ltd.
>>> +// based on the Allwinner H3 dtsi:
>>> +//Copyrigh

Re: [PATCH v2 02/14] toradex: tdx-cfg-block: add EEPROM read/store wrappers

2020-07-27 Thread Stefano Babic
Hi Igor,

On 15.07.20 12:30, Igor Opaniuk wrote:
> From: Igor Opaniuk 
> 
> These functions wrap functionality for storing config blocks in EEPROM.
> 
> Signed-off-by: Igor Opaniuk 
> ---
> 

This breaks one of your (obsolete ?) board, colibri_pxa270

Reason is a side-effect in dm/read.h:

   arm:  +   colibri_pxa270
+In file included from include/dm.h:12,
+ from board/toradex/common/tdx-eeprom.c:6:
+include/dm/read.h: In function 'dev_read_alias_seq':
+include/dm/read.h:932:10: error: 'ENOTSUPP' undeclared (first use in
this function)
+  932 |  return -ENOTSUPP;
+  |  ^~~~
+include/dm/read.h:932:10: note: each undeclared identifier is reported
only once for each function it appears in
+make[2]: *** [scripts/Makefile.build:266:
board/toradex/common/tdx-eeprom.o] Error 1
+make[1]: *** [Makefile:1793: board/toradex/common] Error 2
+make: *** [Makefile:167: sub-make] Error 2


Adding the include to dm/read.h, issue is solved:

diff --git a/include/dm/read.h b/include/dm/read.h
index f02ec95954..cc4ab22f65 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 

 struct resource;


I could add it myself if there is a general agreement, but the usual way
is to repost it.

Best regards,
Stefano

> (no changes since v1)
> 
>  board/toradex/common/Makefile |  1 +
>  board/toradex/common/tdx-eeprom.c | 90 +++
>  board/toradex/common/tdx-eeprom.h | 14 +
>  3 files changed, 105 insertions(+)
>  create mode 100644 board/toradex/common/tdx-eeprom.c
>  create mode 100644 board/toradex/common/tdx-eeprom.h
> 
> diff --git a/board/toradex/common/Makefile b/board/toradex/common/Makefile
> index 6b9fccb6b9..7b19b6e4c8 100644
> --- a/board/toradex/common/Makefile
> +++ b/board/toradex/common/Makefile
> @@ -8,4 +8,5 @@ obj- := __dummy__.o
>  else
>  obj-$(CONFIG_TDX_CFG_BLOCK) += tdx-cfg-block.o
>  obj-y += tdx-common.o
> +obj-y += tdx-eeprom.o
>  endif
> diff --git a/board/toradex/common/tdx-eeprom.c 
> b/board/toradex/common/tdx-eeprom.c
> new file mode 100644
> index 00..fbc267dab6
> --- /dev/null
> +++ b/board/toradex/common/tdx-eeprom.c
> @@ -0,0 +1,90 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (c) 2020 Toradex
> + */
> +
> +#include 
> +#include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +static int get_tdx_eeprom(u32 eeprom_id, struct udevice **devp)
> +{
> + int ret = 0;
> + int node;
> + ofnode eeprom;
> + char eeprom_str[16];
> + const char *path;
> +
> + if (!gd->fdt_blob) {
> + printf("%s: don't have a valid gd->fdt_blob!\n", __func__);
> + return -EFAULT;
> + }
> +
> + node = fdt_path_offset(gd->fdt_blob, "/aliases");
> + if (node < 0)
> + return -ENODEV;
> +
> + sprintf(eeprom_str, "eeprom%d", eeprom_id);
> +
> + path = fdt_getprop(gd->fdt_blob, node, eeprom_str, NULL);
> + if (!path) {
> + printf("%s: no alias for %s\n", __func__, eeprom_str);
> + return -ENODEV;
> + }
> +
> + eeprom = ofnode_path(path);
> + if (!ofnode_valid(eeprom)) {
> + printf("%s: invalid hardware path to EEPROM\n", __func__);
> + return -ENODEV;
> + }
> +
> + ret = uclass_get_device_by_ofnode(UCLASS_I2C_EEPROM, eeprom, devp);
> + if (ret) {
> + printf("%s: cannot find EEPROM by node\n", __func__);
> + return ret;
> + }
> +
> + return ret;
> +}
> +
> +int read_tdx_eeprom_data(u32 eeprom_id, int offset, u8 *buf,
> +  int size)
> +{
> + struct udevice *dev;
> + int ret;
> +
> + ret = get_tdx_eeprom(eeprom_id, &dev);
> + if (ret)
> + return ret;
> +
> + ret = i2c_eeprom_read(dev, 0x0, buf, size);
> + if (ret) {
> + printf("%s: error reading data from EEPROM id: %d!, ret = %d\n",
> +__func__, eeprom_id, ret);
> + return ret;
> + }
> +
> + return ret;
> +}
> +
> +int write_tdx_eeprom_data(u32 eeprom_id, int offset, u8 *buf,
> +   int size)
> +{
> + struct udevice *dev;
> + int ret;
> +
> + ret = get_tdx_eeprom(eeprom_id, &dev);
> + if (ret)
> + return ret;
> +
> + ret = i2c_eeprom_write(dev, 0x0, buf, size);
> + if (ret) {
> + printf("%s: error writing data to EEPROM id: %d, ret = %d\n",
> +__func__, eeprom_id, ret);
> + return ret;
> + }
> +
> + return ret;
> +}
> diff --git a/board/toradex/common/tdx-eeprom.h 
> b/board/toradex/common/tdx-eeprom.h
> new file mode 100644
> index 00..a6772d2f3f
> --- /dev/null
> +++ b/board/toradex/common/tdx-eeprom.h
> @@ -0,0 +1,14 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/*
> + * Copyright (c) 2020 Toradex
> + */
> +
> +#ifndef _TDX_EEPROM_H
> +#define _TDX_EEPROM_H
> +
> +#include 
> +
> +int read_tdx_eeprom_data(u32 eeprom_id,

[PATCH] [dh stm32mp1] remove env location override

2020-07-27 Thread Jakob Riepler

Overriding the environment location is not necessary as the defconfig
for the relevant boards only enable SPI flash and nowhere sources which
are in the same order per default but having this explicit override
prevents using eMMC or SD card (or EXT4) as environment source.

Signed-off-by: Jakob Riepler 
---

 board/dhelectronics/dh_stm32mp1/board.c | 12 
 1 file changed, 12 deletions(-)

diff --git a/board/dhelectronics/dh_stm32mp1/board.c 
b/board/dhelectronics/dh_stm32mp1/board.c

index ae8d581d1c..17dbf20d76 100644
--- a/board/dhelectronics/dh_stm32mp1/board.c
+++ b/board/dhelectronics/dh_stm32mp1/board.c
@@ -653,18 +653,6 @@ int board_interface_eth_init(struct udevice *dev,
 return 0;
 }

-enum env_location env_get_location(enum env_operation op, int prio)
-{
-    if (prio)
-        return ENVL_UNKNOWN;
-
-#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
-    return ENVL_SPI_FLASH;
-#else
-    return ENVL_NOWHERE;
-#endif
-}
-
 #if defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
--
2.27.0



Re: [PATCH v2 3/6] gpio: mxc_gpio: add OF_PLATDATA support

2020-07-27 Thread Stefano Babic
Hi Walter,

On 22.07.20 15:14, Walter Lozano wrote:
> Continuing with the OF_PLATADATA support for iMX6 to reduce SPL
> footprint, add it to mxc_gpio. Thanks to this, it will be possible to
> enable card detection on MMC driver.
> 
> Signed-off-by: Walter Lozano 
> ---
> 

This conflicts with commit 6103e570cdd0d0e854b071ee17b14589356a82bd
Author: Ye Li 
Date:   Tue Jun 9 20:29:51 2020 -0700

gpio: mxc_gpio: Improve to use ofdata_to_platdata

already mainlined. Can you take a look ? Thanks !

Best regards,
Stefano

> (no changes since v1)
> 
>  drivers/gpio/mxc_gpio.c | 18 +-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
> index 316dcc757b..fc49b5b577 100644
> --- a/drivers/gpio/mxc_gpio.c
> +++ b/drivers/gpio/mxc_gpio.c
> @@ -13,6 +13,8 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
>  
>  enum mxc_gpio_direction {
>   MXC_GPIO_DIRECTION_IN,
> @@ -22,6 +24,10 @@ enum mxc_gpio_direction {
>  #define GPIO_PER_BANK32
>  
>  struct mxc_gpio_plat {
> +#if CONFIG_IS_ENABLED(OF_PLATDATA)
> + /* Put this first since driver model will copy the data here */
> + struct dtd_gpio_mxc dtplat;
> +#endif
>   int bank_index;
>   struct gpio_regs *regs;
>  };
> @@ -306,8 +312,16 @@ static int mxc_gpio_bind(struct udevice *dev)
>* is statically initialized in U_BOOT_DEVICES.Here
>* will return.
>*/
> - if (plat)
> +
> + if (plat) {
> +#if CONFIG_IS_ENABLED(OF_PLATDATA)
> + struct dtd_gpio_mxc *dtplat = &plat->dtplat;
> +
> + plat->regs = map_sysmem(dtplat->reg[0], dtplat->reg[1]);
> + plat->bank_index = dev->req_seq;
> +#endif
>   return 0;
> + }
>  
>   addr = devfdt_get_addr(dev);
>   if (addr == FDT_ADDR_T_NONE)
> @@ -350,6 +364,8 @@ U_BOOT_DRIVER(gpio_mxc) = {
>   .bind   = mxc_gpio_bind,
>  };
>  
> +U_BOOT_DRIVER_ALIAS(gpio_mxc, fsl_imx6q_gpio)
> +
>  #if !CONFIG_IS_ENABLED(OF_CONTROL)
>  static const struct mxc_gpio_plat mxc_plat[] = {
>   { 0, (struct gpio_regs *)GPIO1_BASE_ADDR },
> 


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


[PULL] u-boot-sh/master

2020-07-27 Thread Marek Vasut
The following changes since commit ada61f1ee2a4eaa1b29d699b5ba940483171df8a:

  Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
(2020-07-24 08:43:08 -0400)

are available in the Git repository at:

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

for you to fetch changes up to 59028798ab5a1242cc9d578fa5c50a9f057630b2:

  ARM: rmobile: Add Beacon EmbeddedWorks RZG2M Dev Kit (2020-07-25
14:19:26 +0200)


Adam Ford (6):
  ARM: renesas: Add basic R8A774A1 Support
  ARM: dts: r8a774a1: Import DTS from Linux 5.8-rc1
  clk: renesas: Add R8A774A1 clock tables
  pinctrl: renesas: Enable R8A774A1 PFC tables
  mmc: renesas-sdhi: Enable support for R8A774A1
  ARM: rmobile: Add Beacon EmbeddedWorks RZG2M Dev Kit

 arch/arm/dts/Makefile  |1 +
 arch/arm/dts/beacon-renesom-baseboard.dtsi |  597
++
 arch/arm/dts/beacon-renesom-som.dtsi   |  312 +
 arch/arm/dts/r8a774a1-beacon-rzg2m-kit-u-boot.dtsi |   34 +
 arch/arm/dts/r8a774a1-beacon-rzg2m-kit.dts |   15 +
 arch/arm/dts/r8a774a1.dtsi | 2787
+
 arch/arm/mach-rmobile/Kconfig.64   |9 +
 board/beacon/beacon-rzg2m/Kconfig  |   15 +
 board/beacon/beacon-rzg2m/MAINTAINERS  |6 +
 board/beacon/beacon-rzg2m/Makefile |9 +
 board/beacon/beacon-rzg2m/beacon-rzg2m.c   |   52 ++
 configs/r8a774a1_beacon_defconfig  |   64 ++
 drivers/clk/renesas/Kconfig|7 +
 drivers/clk/renesas/Makefile   |1 +
 drivers/clk/renesas/r8a774a1-cpg-mssr.c|  339 ++
 drivers/clk/renesas/rcar-gen3-cpg.h|2 +
 drivers/mmc/renesas-sdhi.c |2 +-
 drivers/pinctrl/renesas/Kconfig|   10 +
 drivers/pinctrl/renesas/Makefile   |1 +
 drivers/pinctrl/renesas/pfc.c  |   11 +
 drivers/pinctrl/renesas/sh_pfc.h   |1 +
 include/configs/beacon-rzg2m.h |   89 +++
 include/dt-bindings/clock/r8a774a1-cpg-mssr.h  |   65 ++
 include/dt-bindings/power/r8a774a1-sysc.h  |   33 +
 24 files changed, 4461 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/beacon-renesom-baseboard.dtsi
 create mode 100644 arch/arm/dts/beacon-renesom-som.dtsi
 create mode 100644 arch/arm/dts/r8a774a1-beacon-rzg2m-kit-u-boot.dtsi
 create mode 100644 arch/arm/dts/r8a774a1-beacon-rzg2m-kit.dts
 create mode 100644 arch/arm/dts/r8a774a1.dtsi
 create mode 100644 board/beacon/beacon-rzg2m/Kconfig
 create mode 100644 board/beacon/beacon-rzg2m/MAINTAINERS
 create mode 100644 board/beacon/beacon-rzg2m/Makefile
 create mode 100644 board/beacon/beacon-rzg2m/beacon-rzg2m.c
 create mode 100644 configs/r8a774a1_beacon_defconfig
 create mode 100644 drivers/clk/renesas/r8a774a1-cpg-mssr.c
 create mode 100644 include/configs/beacon-rzg2m.h
 create mode 100644 include/dt-bindings/clock/r8a774a1-cpg-mssr.h
 create mode 100644 include/dt-bindings/power/r8a774a1-sysc.h


[PULL] u-boot-sh/net

2020-07-27 Thread Marek Vasut
More networking DM conversion (this is the last driver).
Any news on Joe ?

The following changes since commit ada61f1ee2a4eaa1b29d699b5ba940483171df8a:

  Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
(2020-07-24 08:43:08 -0400)

are available in the Git repository at:

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

for you to fetch changes up to f23a785cfb451f3fcb457ed1f9141907dce7dd77:

  net: dc2114x: Add DM support (2020-07-25 14:20:56 +0200)


Marek Vasut (12):
  net: dc2114x: Use PCI_DEVICE() to define PCI device compat list
  net: dc2114x: Support all DC2114x
  net: dc2114x: Add Kconfig entries
  net: dc2114x: Drop update_srom()
  net: dc2114x: Use standard I/O accessors
  net: dc2114x: Introduce private data
  net: dc2114x: Pass private data around
  net: dc2114x: Pass PCI BDF into phys_to_bus()
  net: dc2114x: Add RX/TX rings into the private data
  net: dc2114x: Split RX path
  net: dc2114x: Split common parts of non-DM functions out
  net: dc2114x: Add DM support

 README  |   3 -
 configs/integratorap_cm720t_defconfig   |   1 +
 configs/integratorap_cm920t_defconfig   |   1 +
 configs/integratorap_cm926ejs_defconfig |   1 +
 configs/integratorap_cm946es_defconfig  |   1 +
 drivers/net/Kconfig |   6 +
 drivers/net/dc2114x.c   | 611
++---
 include/configs/MPC8349EMDS.h   |   1 -
 include/configs/MPC8349EMDS_SDRAM.h |   1 -
 include/configs/MPC8540ADS.h|   1 -
 include/configs/MPC8541CDS.h|   1 -
 include/configs/MPC8544DS.h |   1 -
 include/configs/MPC8548CDS.h|   1 -
 include/configs/MPC8555CDS.h|   1 -
 include/configs/MPC8560ADS.h|   1 -
 include/configs/MPC8568MDS.h|   1 -
 include/configs/MPC8569MDS.h|   1 -
 include/configs/MPC8572DS.h |   1 -
 include/configs/MPC8641HPCN.h   |   1 -
 include/configs/TQM834x.h   |   1 -
 include/configs/caddy2.h|   1 -
 include/configs/integratorap.h  |   1 -
 include/configs/sbc8349.h   |   1 -
 include/configs/sbc8548.h   |   1 -
 include/configs/sbc8641d.h  |   1 -
 include/configs/vme8349.h   |   1 -
 scripts/config_whitelist.txt|   1 -
 27 files changed, 366 insertions(+), 278 deletions(-)


[PATCH v2 18/18] configs: j7200_evm_a72: Add Initial support

2020-07-27 Thread Lokesh Vutla
Add initial A72 defconfig support.

Signed-off-by: Lokesh Vutla 
---
 configs/j7200_evm_a72_defconfig | 172 
 1 file changed, 172 insertions(+)
 create mode 100644 configs/j7200_evm_a72_defconfig

diff --git a/configs/j7200_evm_a72_defconfig b/configs/j7200_evm_a72_defconfig
new file mode 100644
index 00..14c30a8f28
--- /dev/null
+++ b/configs/j7200_evm_a72_defconfig
@@ -0,0 +1,172 @@
+CONFIG_ARM=y
+CONFIG_ARCH_K3=y
+CONFIG_SPL_GPIO_SUPPORT=y
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x8000
+CONFIG_SOC_K3_J721E=y
+CONFIG_TARGET_J7200_A72_EVM=y
+CONFIG_ENV_SIZE=0x2
+CONFIG_ENV_OFFSET=0x68
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x28
+CONFIG_DM_GPIO=y
+CONFIG_SPL_DM_SPI=y
+CONFIG_SPL_TEXT_BASE=0x8008
+CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_SPL_STACK_R_ADDR=0x8200
+CONFIG_NR_DRAM_BANKS=2
+CONFIG_ENV_OFFSET_REDUND=0x6A
+CONFIG_SPL_FS_FAT=y
+CONFIG_SPL_LIBDISK_SUPPORT=y
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI_SUPPORT=y
+# CONFIG_PSCI_RESET is not set
+CONFIG_DEFAULT_DEVICE_TREE="k3-j7200-common-proc-board"
+CONFIG_DISTRO_DEFAULTS=y
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run 
get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern"
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_SPL_BOARD_INIT=y
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1400
+CONFIG_SPL_DMA=y
+CONFIG_SPL_ENV_SUPPORT=y
+CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_DM_MAILBOX=y
+CONFIG_SPL_DM_SPI_FLASH=y
+CONFIG_SPL_DM_RESET=y
+CONFIG_SPL_POWER_SUPPORT=y
+CONFIG_SPL_POWER_DOMAIN=y
+CONFIG_SPL_RAM_SUPPORT=y
+CONFIG_SPL_RAM_DEVICE=y
+# CONFIG_SPL_SPI_FLASH_TINY is not set
+CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SPL_USB_GADGET=y
+CONFIG_SPL_DFU=y
+CONFIG_SPL_YMODEM_SUPPORT=y
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_DFU=y
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_MTD=y
+CONFIG_CMD_REMOTEPROC=y
+CONFIG_CMD_UFS=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_TIME=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_MTDIDS_DEFAULT="nor0=4704.spi.0,nor0=47034000.hyperbus"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=4704.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),128k(ospi.env),128k(ospi.env.backup),1m(ospi.sysfw),-@8m(ospi.rootfs);47034000.hyperbus:512k(hbmc.tiboot3),2m(hbmc.tispl),4m(hbmc.u-boot),256k(hbmc.env),1m(hbmc.sysfw),-@8m(hbmc.rootfs)"
+CONFIG_CMD_UBI=y
+# CONFIG_ISO_PARTITION is not set
+# CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_SPL_MULTI_DTB_FIT=y
+CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_REGMAP=y
+CONFIG_SPL_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_SPL_OF_TRANSLATE=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_TI_SCI=y
+CONFIG_DFU_MMC=y
+CONFIG_DFU_RAM=y
+CONFIG_DFU_SF=y
+CONFIG_DMA_CHANNELS=y
+CONFIG_TI_K3_NAVSS_UDMA=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x8200
+CONFIG_FASTBOOT_BUF_SIZE=0x2F00
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=0
+CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
+CONFIG_TI_SCI_PROTOCOL=y
+CONFIG_DA8XX_GPIO=y
+CONFIG_DM_PCA953X=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_OMAP24XX=y
+CONFIG_DM_MAILBOX=y
+CONFIG_K3_SEC_PROXY=y
+CONFIG_DM_MMC=y
+CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_ADMA=y
+CONFIG_SPL_MMC_SDHCI_ADMA=y
+CONFIG_MMC_SDHCI_AM654=y
+CONFIG_MTD=y
+CONFIG_DM_MTD=y
+CONFIG_MTD_NOR_FLASH=y
+CONFIG_FLASH_CFI_DRIVER=y
+CONFIG_CFI_FLASH=y
+CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
+CONFIG_FLASH_CFI_MTD=y
+CONFIG_SYS_FLASH_CFI=y
+CONFIG_HBMC_AM654=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH_STMICRO=y
+# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
+CONFIG_SPI_FLASH_MTD=y
+CONFIG_PHY_FIXED=y
+CONFIG_DM_ETH=y
+CONFIG_TI_AM65_CPSW_NUSS=y
+CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_GENERIC is not set
+CONFIG_SPL_PINCTRL=y
+# CONFIG_SPL_PINCTRL_GENERIC is not set
+CONFIG_PINCTRL_SINGLE=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_TI_SCI_POWER_DOMAIN=y
+CONFIG_RAM=y
+CONFIG_SPL_RAM=y
+CONFIG_REMOTEPROC_TI_K3_DSP=y
+CONFIG_REMOTEPROC_TI_K3_R5F=y
+CONFIG_DM_RESET=y
+CONFIG_RESET_TI_SCI=y
+CONFIG_SCSI=y
+CONFIG_DM_SCSI=y
+CONFIG_DM_SERIAL=y
+CONFIG_SOC_TI=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_CADENCE_QSPI=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_TI_SCI=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_DM_USB_GADGET=y
+CONFIG_SPL_DM_USB_GADGET=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_CDNS3=y
+CONFIG_USB_CDNS3_GADGET=y
+CONFIG

[PATCH v2 16/18] arm: dts: k3-j7200: Add R5 specific dts support

2020-07-27 Thread Lokesh Vutla
From: Dave Gerlach 

Add the basic a72 basic dts for j7200. Following nodes were supported:
- UART
- MMC SD
- I2C
- TISCI communication
- LPDDR with 1600MTs configuration.

Signed-off-by: Andrew F. Davis 
Signed-off-by: Lokesh Vutla 
Signed-off-by: Dave Gerlach 
---
 arch/arm/dts/Makefile |3 +-
 arch/arm/dts/k3-j7200-ddr-evm-lp4-1600.dtsi   | 2195 +
 .../arm/dts/k3-j7200-r5-common-proc-board.dts |  199 ++
 3 files changed, 2396 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/k3-j7200-ddr-evm-lp4-1600.dtsi
 create mode 100644 arch/arm/dts/k3-j7200-r5-common-proc-board.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 08717ea197..cdca20206f 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -939,7 +939,8 @@ dtb-$(CONFIG_STM32MP15x) += \
 dtb-$(CONFIG_SOC_K3_AM6) += k3-am654-base-board.dtb k3-am654-r5-base-board.dtb
 dtb-$(CONFIG_SOC_K3_J721E) += k3-j721e-common-proc-board.dtb \
  k3-j721e-r5-common-proc-board.dtb \
- k3-j7200-common-proc-board.dtb
+ k3-j7200-common-proc-board.dtb \
+ k3-j7200-r5-common-proc-board.dtb
 
 dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7622-rfb.dtb \
diff --git a/arch/arm/dts/k3-j7200-ddr-evm-lp4-1600.dtsi 
b/arch/arm/dts/k3-j7200-ddr-evm-lp4-1600.dtsi
new file mode 100644
index 00..12ffd913d1
--- /dev/null
+++ b/arch/arm/dts/k3-j7200-ddr-evm-lp4-1600.dtsi
@@ -0,0 +1,2195 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * This file was generated by the AM752x_DRA82x_TDA4x_DDRSS_RegConfigTool, 
Revision: 0.3.0
+ * This file was generated on 06/08/2020
+ * Includes hand edits
+ */
+
+#define DDRSS_PLL_FHS_CNT 10
+#define DDRSS_PLL_FREQUENCY_1 4
+#define DDRSS_PLL_FREQUENCY_2 4
+
+#define DDRSS_CTL_00_DATA 0x0B00
+#define DDRSS_CTL_01_DATA 0x
+#define DDRSS_CTL_02_DATA 0x
+#define DDRSS_CTL_03_DATA 0x
+#define DDRSS_CTL_04_DATA 0x
+#define DDRSS_CTL_05_DATA 0x
+#define DDRSS_CTL_06_DATA 0x
+#define DDRSS_CTL_07_DATA 0x2710
+#define DDRSS_CTL_08_DATA 0x000186A0
+#define DDRSS_CTL_09_DATA 0x0005
+#define DDRSS_CTL_10_DATA 0x0064
+#define DDRSS_CTL_11_DATA 0x00027100
+#define DDRSS_CTL_12_DATA 0x00186A00
+#define DDRSS_CTL_13_DATA 0x0005
+#define DDRSS_CTL_14_DATA 0x0640
+#define DDRSS_CTL_15_DATA 0x00027100
+#define DDRSS_CTL_16_DATA 0x00186A00
+#define DDRSS_CTL_17_DATA 0x0005
+#define DDRSS_CTL_18_DATA 0x0640
+#define DDRSS_CTL_19_DATA 0x0101
+#define DDRSS_CTL_20_DATA 0x02011001
+#define DDRSS_CTL_21_DATA 0x0201
+#define DDRSS_CTL_22_DATA 0x00020100
+#define DDRSS_CTL_23_DATA 0x000A
+#define DDRSS_CTL_24_DATA 0x0019
+#define DDRSS_CTL_25_DATA 0x
+#define DDRSS_CTL_26_DATA 0x
+#define DDRSS_CTL_27_DATA 0x02020200
+#define DDRSS_CTL_28_DATA 0x2020
+#define DDRSS_CTL_29_DATA 0x0010
+#define DDRSS_CTL_30_DATA 0x
+#define DDRSS_CTL_31_DATA 0x
+#define DDRSS_CTL_32_DATA 0x
+#define DDRSS_CTL_33_DATA 0x
+#define DDRSS_CTL_34_DATA 0x040C
+#define DDRSS_CTL_35_DATA 0x081C081C
+#define DDRSS_CTL_36_DATA 0x00050804
+#define DDRSS_CTL_37_DATA 0x09040008
+#define DDRSS_CTL_38_DATA 0x08000204
+#define DDRSS_CTL_39_DATA 0x0B240034
+#define DDRSS_CTL_40_DATA 0x08001910
+#define DDRSS_CTL_41_DATA 0x0B240034
+#define DDRSS_CTL_42_DATA 0x20001910
+#define DDRSS_CTL_43_DATA 0x000A0A09
+#define DDRSS_CTL_44_DATA 0x040006DB
+#define DDRSS_CTL_45_DATA 0x0C0A0904
+#define DDRSS_CTL_46_DATA 0x06006DB0
+#define DDRSS_CTL_47_DATA 0x0C0A0906
+#define DDRSS_CTL_48_DATA 0x06006DB0
+#define DDRSS_CTL_49_DATA 0x02030406
+#define DDRSS_CTL_50_DATA 0x11040500
+#define DDRSS_CTL_51_DATA 0x08121112
+#define DDRSS_CTL_52_DATA 0x14000D0A
+#define DDRSS_CTL_53_DATA 0x02010A0A
+#define DDRSS_CTL_54_DATA 0x01010002
+#define DDRSS_CTL_55_DATA 0x0408
+#define DDRSS_CTL_56_DATA 0x04131304
+#define DDRSS_CTL_57_DATA 0x1313
+#define DDRSS_CTL_58_DATA 0x00010100
+#define DDRSS_CTL_59_DATA 0x0301
+#define DDRSS_CTL_60_DATA 0x0E08
+#define DDRSS_CTL_61_DATA 0x00BB
+#define DDRSS_CTL_62_DATA 0x00E0
+#define DDRSS_CTL_63_DATA 0x0C28
+#define DDRSS_CTL_64_DATA 0x00E0
+#define DDRSS_CTL_65_DATA 0x0C28
+#define DDRSS_CTL_66_DATA 0x0005
+#define DDRSS_CTL_67_DATA 0x0003
+#define DDRSS_CTL_68_DATA 0x00380010
+#define DDRSS_CTL_69_DATA 0x0038017E
+#define DDRSS_CTL_70_DATA 0x0040017E
+#define DDRSS_CTL_71_DATA 0x00120103
+#define DDRSS_CTL_72_DATA 0x00060005
+#define DDRSS_CTL_73_DATA 0x14080006
+#define DDRSS_CTL_74_DATA 0x05050114
+#define DDRSS_CTL_75_DATA 0x0201030A
+#define DDRSS_CTL_76_DATA 0x030C0605
+#define DDRSS_CTL_77_DATA 0x06050201
+#define DDRSS_CTL_78_DATA 0x0001030C
+#define DDRSS_CTL_79_DATA 0x000F000F
+#define DDRSS_CTL_80_DATA 0x00E600E6
+#define DDRSS_CTL_81_DATA 0x00E600E6
+#define DDRSS_CTL_82_DATA 

[PATCH v2 17/18] configs: j7200_evm_r5: Add initial support

2020-07-27 Thread Lokesh Vutla
Add initial R5 defconfig support

Signed-off-by: Lokesh Vutla 
---
 configs/j7200_evm_r5_defconfig | 126 +
 1 file changed, 126 insertions(+)
 create mode 100644 configs/j7200_evm_r5_defconfig

diff --git a/configs/j7200_evm_r5_defconfig b/configs/j7200_evm_r5_defconfig
new file mode 100644
index 00..c387cb7ccb
--- /dev/null
+++ b/configs/j7200_evm_r5_defconfig
@@ -0,0 +1,126 @@
+CONFIG_ARM=y
+CONFIG_ARCH_K3=y
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x7
+CONFIG_SOC_K3_J721E=y
+CONFIG_K3_EARLY_CONS=y
+CONFIG_TARGET_J7200_R5_EVM=y
+CONFIG_ENV_SIZE=0x2
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x8
+CONFIG_DM_GPIO=y
+CONFIG_SPL_DM_SPI=y
+CONFIG_SPL_TEXT_BASE=0x41c0
+CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_SPL_STACK_R_ADDR=0x8200
+CONFIG_SPL_FS_FAT=y
+CONFIG_SPL_LIBDISK_SUPPORT=y
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="k3-j7200-r5-common-proc-board"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_USE_BOOTCOMMAND=y
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_SPL_BOARD_INIT=y
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_EARLY_BSS=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x400
+CONFIG_SPL_DMA=y
+CONFIG_SPL_ENV_SUPPORT=y
+CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_DM_MAILBOX=y
+CONFIG_SPL_DM_SPI_FLASH=y
+CONFIG_SPL_DM_RESET=y
+CONFIG_SPL_POWER_SUPPORT=y
+CONFIG_SPL_POWER_DOMAIN=y
+CONFIG_SPL_RAM_SUPPORT=y
+CONFIG_SPL_RAM_DEVICE=y
+CONFIG_SPL_REMOTEPROC=y
+# CONFIG_SPL_SPI_FLASH_TINY is not set
+CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SPL_USB_GADGET=y
+CONFIG_SPL_DFU=y
+CONFIG_SPL_YMODEM_SUPPORT=y
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_DFU=y
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_REMOTEPROC=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_TIME=y
+CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_REGMAP=y
+CONFIG_SPL_REGMAP=y
+CONFIG_SPL_OF_TRANSLATE=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_TI_SCI=y
+CONFIG_DMA_CHANNELS=y
+CONFIG_TI_K3_NAVSS_UDMA=y
+CONFIG_TI_SCI_PROTOCOL=y
+CONFIG_DA8XX_GPIO=y
+CONFIG_DM_PCA953X=y
+CONFIG_DM_I2C=y
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
+CONFIG_SYS_I2C_OMAP24XX=y
+CONFIG_DM_MAILBOX=y
+CONFIG_K3_SEC_PROXY=y
+CONFIG_DM_MMC=y
+CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_SPL_MMC_HS400_SUPPORT=y
+CONFIG_MMC_SDHCI=y
+CONFIG_SPL_MMC_SDHCI_ADMA=y
+CONFIG_MMC_SDHCI_AM654=y
+CONFIG_MTD=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_GENERIC is not set
+CONFIG_SPL_PINCTRL=y
+# CONFIG_SPL_PINCTRL_GENERIC is not set
+CONFIG_PINCTRL_SINGLE=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_TI_SCI_POWER_DOMAIN=y
+CONFIG_K3_SYSTEM_CONTROLLER=y
+CONFIG_REMOTEPROC_TI_K3_ARM64=y
+CONFIG_DM_RESET=y
+CONFIG_RESET_TI_SCI=y
+CONFIG_DM_SERIAL=y
+CONFIG_SOC_TI=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_CADENCE_QSPI=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_TI_SCI=y
+CONFIG_TIMER=y
+CONFIG_SPL_TIMER=y
+CONFIG_OMAP_TIMER=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_DM_USB_GADGET=y
+CONFIG_SPL_DM_USB_GADGET=y
+CONFIG_USB_CDNS3=y
+CONFIG_USB_CDNS3_GADGET=y
+CONFIG_SPL_USB_CDNS3_GADGET=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0x6163
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_FS_EXT4=y
+CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
-- 
2.27.0



[PATCH v2 13/18] board: ti: j7200: Add board detection support for j7200

2020-07-27 Thread Lokesh Vutla
Add board detection support for j7200 common processor board.

Signed-off-by: Lokesh Vutla 
Signed-off-by: Dave Gerlach 
---
 board/ti/j721e/evm.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index 86e7cd4051..87cdbf9798 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -28,6 +28,8 @@
 #define board_is_j721e_som()   (board_ti_k3_is("J721EX-PM1-SOM") || \
 board_ti_k3_is("J721EX-PM2-SOM"))
 
+#define board_is_j7200_som()   board_ti_k3_is("J7200X-PM1-SOM")
+
 /* Max number of MAC addresses that are parsed/processed per daughter card */
 #define DAUGHTER_CARD_NO_OF_MAC_ADDR   8
 
@@ -139,6 +141,8 @@ static void setup_board_eeprom_env(void)
 
if (board_is_j721e_som())
name = "j721e";
+   else if (board_is_j7200_som())
+   name = "j7200";
else
printf("Unidentified board claims %s in eeprom header\n",
   board_ti_get_name());
-- 
2.27.0



[PATCH v2 11/18] arm: mach-k3: j7200: Detect if ROM has already loaded sysfw

2020-07-27 Thread Lokesh Vutla
Detect if sysfw is already loaded by ROM and pass this information to
sysfw loader. Based on this information sysfw loader either loads the
sysfw image from boot media or just received the boot notification
message form sysfw.

Signed-off-by: Lokesh Vutla 
---
 arch/arm/mach-k3/common.c | 8 
 arch/arm/mach-k3/common.h | 2 ++
 arch/arm/mach-k3/j721e_init.c | 3 ++-
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index d065bdbc83..7b0369ffb0 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -71,6 +71,14 @@ void mmr_unlock(phys_addr_t base, u32 partition)
writel(CTRLMMR_LOCK_KICK1_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK1);
 }
 
+bool is_rom_loaded_sysfw(struct rom_extended_boot_data *data)
+{
+   if (strncmp(data->header, K3_ROM_BOOT_HEADER_MAGIC, 7))
+   return false;
+
+   return data->num_components > 1;
+}
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_K3_EARLY_CONS
diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h
index 8f5a5f323a..15a98fb653 100644
--- a/arch/arm/mach-k3/common.h
+++ b/arch/arm/mach-k3/common.h
@@ -7,6 +7,7 @@
  */
 
 #include 
+#include 
 
 #define AM65X  0xbb5a
 #define J721E  0xbb64
@@ -30,3 +31,4 @@ int load_firmware(char *name_fw, char *name_loadaddr, u32 
*loadaddr);
 void k3_sysfw_print_ver(void);
 void spl_enable_dcache(void);
 void mmr_unlock(phys_addr_t base, u32 partition);
+bool is_rom_loaded_sysfw(struct rom_extended_boot_data *data);
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 6246de3a26..a36e4ed603 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -177,7 +177,8 @@ void board_init_f(ulong dummy)
 * callback hook, effectively switching on (or over) the console
 * output.
 */
-   k3_sysfw_loader(false, k3_mmc_stop_clock, k3_mmc_restart_clock);
+   k3_sysfw_loader(is_rom_loaded_sysfw(&bootdata),
+   k3_mmc_stop_clock, k3_mmc_restart_clock);
 
/* Prepare console output */
preloader_console_init();
-- 
2.27.0



[PATCH v2 12/18] board: ti: j7200: Introduce support for j7200 build targets

2020-07-27 Thread Lokesh Vutla
j7200-evm has minor differences with j721e-evm based on the IPs
available in the SoC. Introduce separate build targets for j7200-evm
to incorporate the differences.

Signed-off-by: Lokesh Vutla 
---
 board/ti/j721e/Kconfig | 53 ++
 1 file changed, 53 insertions(+)

diff --git a/board/ti/j721e/Kconfig b/board/ti/j721e/Kconfig
index e56dc53bfa..2cbe2b2481 100644
--- a/board/ti/j721e/Kconfig
+++ b/board/ti/j721e/Kconfig
@@ -27,6 +27,26 @@ config TARGET_J721E_R5_EVM
imply SYS_K3_SPL_ATF
imply TI_I2C_BOARD_DETECT
 
+config TARGET_J7200_A72_EVM
+   bool "TI K3 based J7200 EVM running on A72"
+   select ARM64
+   select SOC_K3_J721E
+   select BOARD_LATE_INIT
+   imply TI_I2C_BOARD_DETECT
+   select SYS_DISABLE_DCACHE_OPS
+
+config TARGET_J7200_R5_EVM
+   bool "TI K3 based J7200 EVM running on R5"
+   select CPU_V7R
+   select SYS_THUMB_BUILD
+   select SOC_K3_J721E
+   select K3_LOAD_SYSFW
+   select RAM
+   select SPL_RAM
+   select K3_J721E_DDRSS
+   imply SYS_K3_SPL_ATF
+   imply TI_I2C_BOARD_DETECT
+
 endchoice
 
 if TARGET_J721E_A72_EVM
@@ -61,3 +81,36 @@ config SPL_LDSCRIPT
 source "board/ti/common/Kconfig"
 
 endif
+
+if TARGET_J7200_A72_EVM
+
+config SYS_BOARD
+   default "j721e"
+
+config SYS_VENDOR
+   default "ti"
+
+config SYS_CONFIG_NAME
+   default "j721e_evm"
+
+source "board/ti/common/Kconfig"
+
+endif
+
+if TARGET_J7200_R5_EVM
+
+config SYS_BOARD
+   default "j721e"
+
+config SYS_VENDOR
+   default "ti"
+
+config SYS_CONFIG_NAME
+   default "j721e_evm"
+
+config SPL_LDSCRIPT
+   default "arch/arm/mach-omap2/u-boot-spl.lds"
+
+source "board/ti/common/Kconfig"
+
+endif
-- 
2.27.0



[PATCH v2 14/18] ram: k3-j721e: Relax version checks for memory controller

2020-07-27 Thread Lokesh Vutla
k3-j721e ddr driver sanity checks for product id and version number.
Version number gets changed for every minor update in the IP. So discard
the version check and just sanity check for product id.

Signed-off-by: Lokesh Vutla 
---
 drivers/ram/k3-j721e/lpddr4.c | 16 +---
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/drivers/ram/k3-j721e/lpddr4.c b/drivers/ram/k3-j721e/lpddr4.c
index 2c3892d8d7..fc80fb1e2c 100644
--- a/drivers/ram/k3-j721e/lpddr4.c
+++ b/drivers/ram/k3-j721e/lpddr4.c
@@ -199,7 +199,6 @@ uint32_t lpddr4_init(lpddr4_privatedata * pd, const 
lpddr4_config * cfg)
 {
uint32_t result = 0U;
uint16_t productid = 0U;
-   uint32_t version[2] = { 0, 0 };
 
result = lpddr4_initsf(pd, cfg);
if (result == (uint32_t) CDN_EOK) {
@@ -209,20 +208,7 @@ uint32_t lpddr4_init(lpddr4_privatedata * pd, const 
lpddr4_config * cfg)
 CPS_REG_READ(&
  (ctlregbase->
   
LPDDR4__CONTROLLER_ID__REG;
-   version[0] =
-   (uint32_t) (CPS_FLD_READ
-   (LPDDR4__CONTROLLER_VERSION_0__FLD,
-CPS_REG_READ(&
- (ctlregbase->
-  
LPDDR4__CONTROLLER_VERSION_0__REG;
-   version[1] =
-   (uint32_t) (CPS_FLD_READ
-   (LPDDR4__CONTROLLER_VERSION_1__FLD,
-CPS_REG_READ(&
- (ctlregbase->
-  
LPDDR4__CONTROLLER_VERSION_1__REG;
-   if ((productid == PRODUCT_ID) && (version[0] == VERSION_0)
-   && (version[1] == VERSION_1)) {
+   if (productid == PRODUCT_ID) {
/* Populating configuration data to pD */
pd->ctlbase = ctlregbase;
pd->infohandler =
-- 
2.27.0



[PATCH v2 15/18] arm: dts: k3-j7200: Add dts support

2020-07-27 Thread Lokesh Vutla
Add the basic a72 dts for j7200. Following nodes were supported:
- UART
- MMC SD
- I2C
- TISCI communication

Signed-off-by: Lokesh Vutla 
Signed-off-by: Vignesh Raghavendra 
Signed-off-by: Vishal Mahaveer 
Signed-off-by: Faiz Abbas 
---
 arch/arm/dts/Makefile |   3 +-
 .../k3-j7200-common-proc-board-u-boot.dtsi|  92 +
 arch/arm/dts/k3-j7200-common-proc-board.dts   |  94 ++
 arch/arm/dts/k3-j7200-main.dtsi   | 313 ++
 arch/arm/dts/k3-j7200-mcu-wakeup.dtsi | 117 +++
 arch/arm/dts/k3-j7200-som-p0.dtsi |  29 ++
 arch/arm/dts/k3-j7200.dtsi| 175 ++
 7 files changed, 822 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi
 create mode 100644 arch/arm/dts/k3-j7200-common-proc-board.dts
 create mode 100644 arch/arm/dts/k3-j7200-main.dtsi
 create mode 100644 arch/arm/dts/k3-j7200-mcu-wakeup.dtsi
 create mode 100644 arch/arm/dts/k3-j7200-som-p0.dtsi
 create mode 100644 arch/arm/dts/k3-j7200.dtsi

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index cee10f533f..08717ea197 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -938,7 +938,8 @@ dtb-$(CONFIG_STM32MP15x) += \
 
 dtb-$(CONFIG_SOC_K3_AM6) += k3-am654-base-board.dtb k3-am654-r5-base-board.dtb
 dtb-$(CONFIG_SOC_K3_J721E) += k3-j721e-common-proc-board.dtb \
- k3-j721e-r5-common-proc-board.dtb
+ k3-j721e-r5-common-proc-board.dtb \
+ k3-j7200-common-proc-board.dtb
 
 dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7622-rfb.dtb \
diff --git a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi 
b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi
new file mode 100644
index 00..593417565e
--- /dev/null
+++ b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi
@@ -0,0 +1,92 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2020 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+/ {
+   chosen {
+   stdout-path = "serial2:115200n8";
+   tick-timer = &timer1;
+   };
+
+};
+
+&chipid {
+   u-boot,dm-spl;
+};
+
+&cbass_main {
+   u-boot,dm-spl;
+};
+
+&main_navss {
+   u-boot,dm-spl;
+};
+
+&cbass_mcu_wakeup {
+   u-boot,dm-spl;
+
+   timer1: timer@4040 {
+   compatible = "ti,omap5430-timer";
+   reg = <0x0 0x4040 0x0 0x80>;
+   ti,timer-alwon;
+   clock-frequency = <2500>;
+   u-boot,dm-spl;
+   };
+};
+
+&secure_proxy_main {
+   u-boot,dm-spl;
+};
+
+&dmsc {
+   u-boot,dm-spl;
+   k3_sysreset: sysreset-controller {
+   compatible = "ti,sci-sysreset";
+   u-boot,dm-spl;
+   };
+};
+
+&k3_pds {
+   u-boot,dm-spl;
+};
+
+&k3_clks {
+   u-boot,dm-spl;
+};
+
+&k3_reset {
+   u-boot,dm-spl;
+};
+
+&wkup_pmx0 {
+   u-boot,dm-spl;
+};
+
+&main_pmx0 {
+   u-boot,dm-spl;
+};
+
+&main_uart0 {
+   u-boot,dm-spl;
+};
+
+&mcu_uart0 {
+   u-boot,dm-spl;
+};
+
+&main_sdhci0 {
+   u-boot,dm-spl;
+};
+
+&main_sdhci1 {
+   u-boot,dm-spl;
+};
+
+&wkup_i2c0_pins_default {
+   u-boot,dm-spl;
+};
+
+&wkup_i2c0 {
+   u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/k3-j7200-common-proc-board.dts 
b/arch/arm/dts/k3-j7200-common-proc-board.dts
new file mode 100644
index 00..3f33fb5650
--- /dev/null
+++ b/arch/arm/dts/k3-j7200-common-proc-board.dts
@@ -0,0 +1,94 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2020 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+/dts-v1/;
+
+#include "k3-j7200-som-p0.dtsi"
+
+/ {
+   chosen {
+   stdout-path = "serial2:115200n8";
+   bootargs = "console=ttyS2,115200n8 
earlycon=ns16550a,mmio32,0x0280";
+   };
+};
+
+&wkup_pmx0 {
+   wkup_i2c0_pins_default: wkup-i2c0-pins-default {
+   pinctrl-single,pins = <
+   J721E_WKUP_IOPAD(0x100, PIN_INPUT_PULLUP, 0) /* (F20) 
WKUP_I2C0_SCL */
+   J721E_WKUP_IOPAD(0x104, PIN_INPUT_PULLUP, 0) /* (H21) 
WKUP_I2C0_SDA */
+   >;
+   };
+};
+
+&wkup_uart0 {
+   /* Wakeup UART is used by System firmware */
+   status = "disabled";
+};
+
+&main_uart0 {
+   power-domains = <&k3_pds 146 TI_SCI_PD_SHARED>;
+};
+
+&main_uart2 {
+   /* MAIN UART 2 is used by R5F firmware */
+   status = "disabled";
+};
+
+&main_uart3 {
+   /* UART not brought out */
+   status = "disabled";
+};
+
+&main_uart4 {
+   /* UART not brought out */
+   status = "disabled";
+};
+
+&main_uart5 {
+   /* UART not brought out */
+   status = "disabled";
+};
+
+&main_uart6 {
+   /* UART not brought out */
+   status = "disabled";
+};
+
+&main_uart7 {
+   /* UART not brought out */
+   status = "disabled";
+};
+
+&main_uart8 {
+   /* UART not brought out */
+ 

[PATCH v2 10/18] arm: mach-k3: j7200: Add support for storing extended boot info from ROM

2020-07-27 Thread Lokesh Vutla
Starting J7200 SoC, ROM supports for loading sysfw directly from boot
image. ROM passes this information on number of images that are loaded
to bootloader at  certain location. Add support for storing this
information before it gets corrupted.

Signed-off-by: Lokesh Vutla 
---
 arch/arm/mach-k3/include/mach/hardware.h   | 7 +++
 arch/arm/mach-k3/include/mach/j721e_hardware.h | 3 +++
 arch/arm/mach-k3/j721e_init.c  | 7 +--
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-k3/include/mach/hardware.h 
b/arch/arm/mach-k3/include/mach/hardware.h
index 0ad761418b..02b3df0e1b 100644
--- a/arch/arm/mach-k3/include/mach/hardware.h
+++ b/arch/arm/mach-k3/include/mach/hardware.h
@@ -21,4 +21,11 @@
 #define JTAG_ID_PARTNO_SHIFT   12
 #define JTAG_ID_PARTNO_MASK(0x << 12)
 
+#define K3_ROM_BOOT_HEADER_MAGIC   "EXTBOOT"
+
+struct rom_extended_boot_data {
+   char header[8];
+   u32 num_components;
+};
+
 #endif /* _ASM_ARCH_HARDWARE_H_ */
diff --git a/arch/arm/mach-k3/include/mach/j721e_hardware.h 
b/arch/arm/mach-k3/include/mach/j721e_hardware.h
index 19873d6e28..b98f0a82f1 100644
--- a/arch/arm/mach-k3/include/mach/j721e_hardware.h
+++ b/arch/arm/mach-k3/include/mach/j721e_hardware.h
@@ -51,6 +51,9 @@
 #define CTRLMMR_LOCK_KICK1 0x0100c
 #define CTRLMMR_LOCK_KICK1_UNLOCK_VAL  0xd172bc5a
 
+/* ROM HANDOFF Structure location */
+#define ROM_ENTENDED_BOOT_DATA_INFO0x41cffb00
+
 /* MCU SCRATCHPAD usage */
 #define TI_SRAM_SCRATCH_BOARD_EEPROM_START 
CONFIG_SYS_K3_MCU_SCRATCHPAD_BASE
 
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 63a31c18ce..6246de3a26 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -126,10 +126,13 @@ void k3_mmc_restart_clock(void)
  * it to the .data section.
  */
 u32 bootindex __attribute__((section(".data")));
+static struct rom_extended_boot_data bootdata __section(.data);
 
-static void store_boot_index_from_rom(void)
+static void store_boot_info_from_rom(void)
 {
bootindex = *(u32 *)(CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX);
+   memcpy(&bootdata, (uintptr_t *)ROM_ENTENDED_BOOT_DATA_INFO,
+  sizeof(struct rom_extended_boot_data));
 }
 
 void board_init_f(ulong dummy)
@@ -142,7 +145,7 @@ void board_init_f(ulong dummy)
 * Cannot delay this further as there is a chance that
 * K3_BOOT_PARAM_TABLE_INDEX can be over written by SPL MALLOC section.
 */
-   store_boot_index_from_rom();
+   store_boot_info_from_rom();
 
/* Make all control module registers accessible */
ctrl_mmr_unlock();
-- 
2.27.0



[PATCH v2 08/18] arm: mach-k3: j721e: Fix unlocking control module registers

2020-07-27 Thread Lokesh Vutla
In main control mmr there is no partition 4 and partition 6 is available
only on J721e. Fix the same in ctrl_mmr_unlock function

Signed-off-by: Lokesh Vutla 
---
 arch/arm/mach-k3/j721e_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 3b15da2d7c..63a31c18ce 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -87,9 +87,9 @@ static void ctrl_mmr_unlock(void)
mmr_unlock(CTRL_MMR0_BASE, 1);
mmr_unlock(CTRL_MMR0_BASE, 2);
mmr_unlock(CTRL_MMR0_BASE, 3);
-   mmr_unlock(CTRL_MMR0_BASE, 4);
mmr_unlock(CTRL_MMR0_BASE, 5);
-   mmr_unlock(CTRL_MMR0_BASE, 6);
+   if (soc_is_j721e())
+   mmr_unlock(CTRL_MMR0_BASE, 6);
mmr_unlock(CTRL_MMR0_BASE, 7);
 }
 
-- 
2.27.0



[PATCH v2 09/18] arm: mach-k3: j7200: Add support for SOC detection

2020-07-27 Thread Lokesh Vutla
The J7200 SoC is a part of the K3 Multicore SoC architecture platform.
It is targeted for automotive gateway, vehicle compute systems,
Vehicle-to-Vehicle (V2V) and Vehicle-to-Everything (V2X) applications.
The SoC aims to meet the complex processing needs of modern embedded
products.

Some highlights of this SoC are:
* Dual Cortex-A72s in a single cluster, two clusters of lockstep
  capable dual Cortex-R5F MCUs and a Centralized Device Management and
  Security Controller (DMSC).
* Configurable L3 Cache and IO-coherent architecture with high data
  throughput capable distributed DMA architecture under NAVSS.
* Integrated Ethernet switch supporting up to a total of 4 external ports
  in addition to legacy Ethernet switch of up to 2 ports.
* Upto 1 PCIe-GEN3 controller, 1 USB3.0 Dual-role device subsystems,
  20 MCANs, 3 McASP, eMMC and SD, OSPI/HyperBus memory controller, I3C and
  I2C, eCAP/eQEP, eHRPWM among other peripherals.
* One hardware accelerator block containing AES/DES/SHA/MD5 called SA2UL
  management.

See J7200 Technical Reference Manual (SPRUIU1, June 2020)
for further details: https://www.ti.com/lit/pdf/spruiu1

Add support for detection J7200 SoC

Signed-off-by: Lokesh Vutla 
Signed-off-by: Suman Anna 
---
 arch/arm/mach-k3/common.c | 10 ++
 arch/arm/mach-k3/common.h |  1 +
 arch/arm/mach-k3/include/mach/sys_proto.h |  1 +
 3 files changed, 12 insertions(+)

diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index aec6c600b9..d065bdbc83 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -365,6 +365,16 @@ bool soc_is_j721e(void)
return soc == J721E;
 }
 
+bool soc_is_j7200(void)
+{
+   u32 soc;
+
+   soc = (readl(CTRLMMR_WKUP_JTAG_ID) &
+   JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT;
+
+   return soc == J7200;
+}
+
 #ifdef CONFIG_ARM64
 void board_prep_linux(bootm_headers_t *images)
 {
diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h
index e8cc3daac1..8f5a5f323a 100644
--- a/arch/arm/mach-k3/common.h
+++ b/arch/arm/mach-k3/common.h
@@ -10,6 +10,7 @@
 
 #define AM65X  0xbb5a
 #define J721E  0xbb64
+#define J7200  0xbb6d
 
 #define REV_PG1_0  0
 #define REV_PG2_0  1
diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h 
b/arch/arm/mach-k3/include/mach/sys_proto.h
index 48b11178c3..60287b261c 100644
--- a/arch/arm/mach-k3/include/mach/sys_proto.h
+++ b/arch/arm/mach-k3/include/mach/sys_proto.h
@@ -17,5 +17,6 @@ void release_resources_for_core_shutdown(void);
 int fdt_disable_node(void *blob, char *node_path);
 
 bool soc_is_j721e(void);
+bool soc_is_j7200(void);
 
 #endif
-- 
2.27.0



[PATCH v2 05/18] arm: mach-k3: Move mmr_unlock to a common location

2020-07-27 Thread Lokesh Vutla
mmr_unlock api is common for all k3 devices. Move it to a common
location.

Signed-off-by: Lokesh Vutla 
---
 arch/arm/mach-k3/am6_init.c   | 10 --
 arch/arm/mach-k3/common.c | 10 ++
 arch/arm/mach-k3/common.h |  1 +
 arch/arm/mach-k3/j721e_init.c | 10 --
 4 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-k3/am6_init.c b/arch/arm/mach-k3/am6_init.c
index 516a02e8a8..abdec76d73 100644
--- a/arch/arm/mach-k3/am6_init.c
+++ b/arch/arm/mach-k3/am6_init.c
@@ -41,16 +41,6 @@ struct fwl_data main_cbass_fwls[] = {
 #endif
 #endif
 
-static void mmr_unlock(u32 base, u32 partition)
-{
-   /* Translate the base address */
-   phys_addr_t part_base = base + partition * CTRL_MMR0_PARTITION_SIZE;
-
-   /* Unlock the requested partition if locked using two-step sequence */
-   writel(CTRLMMR_LOCK_KICK0_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK0);
-   writel(CTRLMMR_LOCK_KICK1_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK1);
-}
-
 static void ctrl_mmr_unlock(void)
 {
/* Unlock all WKUP_CTRL_MMR0 module registers */
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index 63bf060616..eb72451d06 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -61,6 +61,16 @@ void k3_sysfw_print_ver(void)
   ti_sci->version.firmware_revision, fw_desc);
 }
 
+void mmr_unlock(phys_addr_t base, u32 partition)
+{
+   /* Translate the base address */
+   phys_addr_t part_base = base + partition * CTRL_MMR0_PARTITION_SIZE;
+
+   /* Unlock the requested partition if locked using two-step sequence */
+   writel(CTRLMMR_LOCK_KICK0_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK0);
+   writel(CTRLMMR_LOCK_KICK1_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK1);
+}
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_K3_EARLY_CONS
diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h
index 94cdcb56ad..e8cc3daac1 100644
--- a/arch/arm/mach-k3/common.h
+++ b/arch/arm/mach-k3/common.h
@@ -28,3 +28,4 @@ void start_non_linux_remote_cores(void);
 int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr);
 void k3_sysfw_print_ver(void);
 void spl_enable_dcache(void);
+void mmr_unlock(phys_addr_t base, u32 partition);
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 5ec62a92f8..2010cab1d1 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -64,16 +64,6 @@ struct fwl_data cbass_hc_cfg0_fwls[] = {
 #endif
 #endif
 
-static void mmr_unlock(u32 base, u32 partition)
-{
-   /* Translate the base address */
-   phys_addr_t part_base = base + partition * CTRL_MMR0_PARTITION_SIZE;
-
-   /* Unlock the requested partition if locked using two-step sequence */
-   writel(CTRLMMR_LOCK_KICK0_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK0);
-   writel(CTRLMMR_LOCK_KICK1_UNLOCK_VAL, part_base + CTRLMMR_LOCK_KICK1);
-}
-
 static void ctrl_mmr_unlock(void)
 {
/* Unlock all WKUP_CTRL_MMR0 module registers */
-- 
2.27.0



[PATCH v2 06/18] arm: mach-k3: sysfw-loader: Add support for rom loading sysfw image

2020-07-27 Thread Lokesh Vutla
Starting J7200 SoC, ROM supports for loading sysfw directly from boot
image. In such cases, SPL need not load sysfw from boot media, but need
to receive boot notification message from sysfw. So separate out
remoteproc calls for system controller from sysfw loader and just
receive the boot notification if sysfw is already loaded.

Signed-off-by: Lokesh Vutla 
---
 arch/arm/mach-k3/am6_init.c  |  2 +-
 arch/arm/mach-k3/include/mach/sysfw-loader.h |  4 +-
 arch/arm/mach-k3/j721e_init.c|  2 +-
 arch/arm/mach-k3/sysfw-loader.c  | 56 +---
 4 files changed, 43 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-k3/am6_init.c b/arch/arm/mach-k3/am6_init.c
index abdec76d73..4250ac355b 100644
--- a/arch/arm/mach-k3/am6_init.c
+++ b/arch/arm/mach-k3/am6_init.c
@@ -155,7 +155,7 @@ void board_init_f(ulong dummy)
 * Load, start up, and configure system controller firmware while
 * also populating the SYSFW post-PM configuration callback hook.
 */
-   k3_sysfw_loader(k3_mmc_stop_clock, k3_mmc_restart_clock);
+   k3_sysfw_loader(false, k3_mmc_stop_clock, k3_mmc_restart_clock);
 
/* Prepare console output */
preloader_console_init();
diff --git a/arch/arm/mach-k3/include/mach/sysfw-loader.h 
b/arch/arm/mach-k3/include/mach/sysfw-loader.h
index 6f5612b4fd..b23a9e821e 100644
--- a/arch/arm/mach-k3/include/mach/sysfw-loader.h
+++ b/arch/arm/mach-k3/include/mach/sysfw-loader.h
@@ -7,6 +7,8 @@
 #ifndef _SYSFW_LOADER_H_
 #define _SYSFW_LOADER_H_
 
-void k3_sysfw_loader(void (*config_pm_pre_callback)(void), void 
(*config_pm_done_callback)(void));
+void k3_sysfw_loader(bool rom_loaded_sysfw,
+void (*config_pm_pre_callback)(void),
+void (*config_pm_done_callback)(void));
 
 #endif
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 2010cab1d1..461a9d7f8f 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -174,7 +174,7 @@ void board_init_f(ulong dummy)
 * callback hook, effectively switching on (or over) the console
 * output.
 */
-   k3_sysfw_loader(k3_mmc_stop_clock, k3_mmc_restart_clock);
+   k3_sysfw_loader(false, k3_mmc_stop_clock, k3_mmc_restart_clock);
 
/* Prepare console output */
preloader_console_init();
diff --git a/arch/arm/mach-k3/sysfw-loader.c b/arch/arm/mach-k3/sysfw-loader.c
index 513be09c68..f62bfa995c 100644
--- a/arch/arm/mach-k3/sysfw-loader.c
+++ b/arch/arm/mach-k3/sysfw-loader.c
@@ -32,6 +32,12 @@ DECLARE_GLOBAL_DATA_PTR;
 #define SYSFW_CFG_RM   "rm-cfg.bin"
 #define SYSFW_CFG_SEC  "sec-cfg.bin"
 
+/*
+ * It is assumed that remoteproc device 0 is the corresponding
+ * system-controller that runs SYSFW. Make sure DT reflects the same.
+ */
+#define K3_SYSTEM_CONTROLLER_RPROC_ID  0
+
 static bool sysfw_loaded;
 static void *sysfw_load_address;
 
@@ -71,6 +77,26 @@ static int fit_get_data_by_name(const void *fit, int images, 
const char *name,
return fit_image_get_data(fit, node_offset, addr, size);
 }
 
+static void k3_start_system_controller(int rproc_id, bool rproc_loaded,
+  ulong addr, ulong size)
+{
+   int ret;
+
+   ret = rproc_dev_init(rproc_id);
+   if (ret)
+   panic("rproc failed to be initialized (%d)\n", ret);
+
+   if (!rproc_loaded) {
+   ret = rproc_load(rproc_id, addr, size);
+   if (ret)
+   panic("Firmware failed to start on rproc (%d)\n", ret);
+   }
+
+   ret = rproc_start(0);
+   if (ret)
+   panic("Firmware init failed on rproc (%d)\n", ret);
+}
+
 static void k3_sysfw_load_using_fit(void *fit)
 {
int images;
@@ -90,23 +116,9 @@ static void k3_sysfw_load_using_fit(void *fit)
panic("Error accessing %s node in FIT (%d)\n", SYSFW_FIRMWARE,
  ret);
 
-   /*
-* Start up system controller firmware
-*
-* It is assumed that remoteproc device 0 is the corresponding
-* system-controller that runs SYSFW. Make sure DT reflects the same.
-*/
-   ret = rproc_dev_init(0);
-   if (ret)
-   panic("rproc failed to be initialized (%d)\n", ret);
-
-   ret = rproc_load(0, (ulong)sysfw_addr, (ulong)sysfw_size);
-   if (ret)
-   panic("Firmware failed to start on rproc (%d)\n", ret);
-
-   ret = rproc_start(0);
-   if (ret)
-   panic("Firmware init failed on rproc (%d)\n", ret);
+   /* Start up system controller firmware */
+   k3_start_system_controller(K3_SYSTEM_CONTROLLER_RPROC_ID, false,
+  (ulong)sysfw_addr, (ulong)sysfw_size);
 }
 
 static void k3_sysfw_configure_using_fit(void *fit,
@@ -222,7 +234,8 @@ static void *k3_sysfw_get_spi_addr(void)
 }
 #endif
 
-void k3_sysfw_loader(void (*config_p

[PATCH v2 02/18] board: ti: j721e: Probe eeprom only when CONFIG_TI_I2C_BOARD_DETECT is defined

2020-07-27 Thread Lokesh Vutla
Guard all eeprom probe with TI_I2C_BOARD_DETECT to avoid reading eeprom
when eeprom is not available

Reviewed-by: Suman Anna 
Signed-off-by: Lokesh Vutla 
Signed-off-by: Jean-Jacques Hiblot 
---
 arch/arm/mach-k3/j721e_init.c |  3 ++-
 board/ti/j721e/evm.c  | 16 +++-
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index f9454e3273..5ec62a92f8 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -208,7 +208,8 @@ void board_init_f(ulong dummy)
k3_sysfw_print_ver();
 
/* Perform EEPROM-based board detection */
-   do_board_detect();
+   if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT))
+   do_board_detect();
 
 #if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0)
ret = uclass_get_device_by_driver(UCLASS_MISC, DM_GET_DRIVER(k3_avs),
diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index a1e8fe59c4..7199d11e95 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -100,6 +100,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 }
 #endif
 
+#ifdef CONFIG_TI_I2C_BOARD_DETECT
 int do_board_detect(void)
 {
int ret;
@@ -336,14 +337,17 @@ static int probe_daughtercards(void)
 
return 0;
 }
+#endif
 
 int board_late_init(void)
 {
-   setup_board_eeprom_env();
-   setup_serial();
+   if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) {
+   setup_board_eeprom_env();
+   setup_serial();
 
-   /* Check for and probe any plugged-in daughtercards */
-   probe_daughtercards();
+   /* Check for and probe any plugged-in daughtercards */
+   probe_daughtercards();
+   }
 
return 0;
 }
@@ -355,7 +359,9 @@ void spl_board_init(void)
int ret;
 #endif
 
-   probe_daughtercards();
+   if (IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM) &&
+   IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT))
+   probe_daughtercards();
 
 #ifdef CONFIG_ESM_K3
if (board_ti_k3_is("J721EX-PM2-SOM")) {
-- 
2.27.0



[PATCH v2 01/18] board: ti: board_detect: Add stub functions for EEPROM detection apis

2020-07-27 Thread Lokesh Vutla
Current usage of eeprom apis produce a build failure when
CONFIG_TI_I2C_BOARD_DETECT is not defined. Add stub function for these
apis to avoid build failures.

Reviewed-by: Suman Anna 
Signed-off-by: Lokesh Vutla 
---
 board/ti/common/board_detect.h | 13 +
 1 file changed, 13 insertions(+)

diff --git a/board/ti/common/board_detect.h b/board/ti/common/board_detect.h
index 9f75b5c004..de7cb52dfc 100644
--- a/board/ti/common/board_detect.h
+++ b/board/ti/common/board_detect.h
@@ -311,6 +311,7 @@ int __maybe_unused ti_i2c_eeprom_am6_get(int bus_addr, int 
dev_addr,
  */
 int __maybe_unused ti_i2c_eeprom_am6_get_base(int bus_addr, int dev_addr);
 
+#ifdef CONFIG_TI_I2C_BOARD_DETECT
 /**
  * board_ti_is() - Board detection logic for TI EVMs
  * @name_tag:  Tag used in eeprom for the board
@@ -454,5 +455,17 @@ bool board_ti_was_eeprom_read(void);
  * Return: 0 if all went fine, else return error.
  */
 int ti_i2c_eeprom_am_set(const char *name, const char *rev);
+#else
+static inline bool board_ti_is(char *name_tag) { return false; };
+static inline bool board_ti_k3_is(char *name_tag) { return false; };
+static inline bool board_ti_rev_is(char *rev_tag, int cmp_len)
+{ return false; };
+static inline char *board_ti_get_rev(void) { return NULL; };
+static inline char *board_ti_get_config(void) { return NULL; };
+static inline char *board_ti_get_name(void) { return NULL; };
+static inline bool board_ti_was_eeprom_read(void) { return false; };
+static inline int ti_i2c_eeprom_am_set(const char *name, const char *rev)
+{ return -EINVAL; };
+#endif
 
 #endif /* __BOARD_DETECT_H */
-- 
2.27.0



[PATCH v2 04/18] arm: mach-k3: Fix platform hang when SPL_MULTI_DTB_FIT is not enabled

2020-07-27 Thread Lokesh Vutla
From: Jean-Jacques Hiblot 

If SPL_MULTI_DTB_FIT is not enabled, then CONFIG_SPL_OF_LIST is not defined
And in turn tispl.bin ends up not embedding any DTB.
Fixing it by using CONFIG_DEFAULT_DEVICE_TREE if SPL_OF_LIST is empty.

Signed-off-by: Jean-Jacques Hiblot 
Signed-off-by: Lokesh Vutla 
---
 arch/arm/mach-k3/config.mk | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-k3/config.mk b/arch/arm/mach-k3/config.mk
index f7afef610c..d20aceb3c8 100644
--- a/arch/arm/mach-k3/config.mk
+++ b/arch/arm/mach-k3/config.mk
@@ -58,10 +58,16 @@ SPL_ITS := u-boot-spl-k3.its
 ALL-y  += tispl.bin
 endif
 
+ifeq ($(CONFIG_SPL_OF_LIST),)
+LIST_OF_DTB := $(CONFIG_DEFAULT_DEVICE_TREE)
+else
+LIST_OF_DTB := $(CONFIG_SPL_OF_LIST)
+endif
+
 quiet_cmd_k3_mkits = MKITS   $@
 cmd_k3_mkits = \
$(srctree)/tools/k3_fit_atf.sh \
-   $(patsubst %,$(obj)/dts/%.dtb,$(subst ",,$(CONFIG_SPL_OF_LIST))) > $@
+   $(patsubst %,$(obj)/dts/%.dtb,$(subst ",,$(LIST_OF_DTB))) > $@
 
 $(SPL_ITS): FORCE
$(call cmd,k3_mkits)
-- 
2.27.0



[PATCH v2 07/18] arm: mach-k3: j721e: Add detection for j721e

2020-07-27 Thread Lokesh Vutla
Add an api soc_is_j721e(), and use it to enable certain functionality
that is available only on j721e.

Signed-off-by: Lokesh Vutla 
Signed-off-by: Suman Anna 
---
 arch/arm/mach-k3/common.c | 10 ++
 arch/arm/mach-k3/include/mach/sys_proto.h |  2 ++
 arch/arm/mach-k3/j721e_init.c |  3 +++
 3 files changed, 15 insertions(+)

diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index eb72451d06..aec6c600b9 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -355,6 +355,16 @@ int print_cpuinfo(void)
 }
 #endif
 
+bool soc_is_j721e(void)
+{
+   u32 soc;
+
+   soc = (readl(CTRLMMR_WKUP_JTAG_ID) &
+   JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT;
+
+   return soc == J721E;
+}
+
 #ifdef CONFIG_ARM64
 void board_prep_linux(bootm_headers_t *images)
 {
diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h 
b/arch/arm/mach-k3/include/mach/sys_proto.h
index 3c825aa3d1..48b11178c3 100644
--- a/arch/arm/mach-k3/include/mach/sys_proto.h
+++ b/arch/arm/mach-k3/include/mach/sys_proto.h
@@ -16,4 +16,6 @@ int do_board_detect(void);
 void release_resources_for_core_shutdown(void);
 int fdt_disable_node(void *blob, char *node_path);
 
+bool soc_is_j721e(void);
+
 #endif
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 461a9d7f8f..3b15da2d7c 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -361,6 +361,9 @@ void start_non_linux_remote_cores(void)
int size = 0, ret;
u32 loadaddr = 0;
 
+   if (!soc_is_j721e())
+   return;
+
size = load_firmware("name_mainr5f0_0fw", "addr_mainr5f0_0load",
 &loadaddr);
if (size <= 0)
-- 
2.27.0



[PATCH v2 03/18] board: ti: j721e: Update fdt fixup logic for interconnect nodes

2020-07-27 Thread Lokesh Vutla
From: Suman Anna 

The DT nodes on J721E SoCs currently use a node name "interconnect" for
the various interconnects. This name is not following the DT schema, and
should simply be "bus". Update the fdt fixup logic to use both the current
and the expected corrected path names so that this logic won't be broken
with newer kernels.

Signed-off-by: Suman Anna 
---
 board/ti/j721e/evm.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index 7199d11e95..86e7cd4051 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -92,7 +92,10 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 {
int ret;
 
-   ret = fdt_fixup_msmc_ram(blob, "/interconnect@10", "sram@7000");
+   ret = fdt_fixup_msmc_ram(blob, "/bus@10", "sram@7000");
+   if (ret < 0)
+   ret = fdt_fixup_msmc_ram(blob, "/interconnect@10",
+"sram@7000");
if (ret)
printf("%s: fixing up msmc ram failed %d\n", __func__, ret);
 
-- 
2.27.0



[PATCH v2 00/18] arm: mach-k3: Initial support for Texas Instrument's J7200 Platform

2020-07-27 Thread Lokesh Vutla
This series adds initial support for latest new SoC, J7200, from Texas 
Instruments.

The J7200 SoC is a part of the K3 Multicore SoC architecture platform.
It is targeted for for automotive gateway, vehicle compute systems,
Vehicle-to-Vehicle (V2V) and Vehicle-to-Everything (V2X) applications.
The SoC aims to meet the complex processing needs of modern embedded products.

See J7200 Technical Reference Manual (SPRUIU1, June 2020)
for further details: https://www.ti.com/lit/pdf/spruiu1

Changes since v1:
- Updated compatible for sdhci
- Enabled CONFIG_OF_BOARD_SETUP for fixuping up msmc dt node.
- Split R5 dts and A72 dts

Dave Gerlach (1):
  arm: dts: k3-j7200: Add R5 specific dts support

Jean-Jacques Hiblot (1):
  arm: mach-k3: Fix platform hang when SPL_MULTI_DTB_FIT is not enabled

Lokesh Vutla (15):
  board: ti: board_detect: Add stub functions for EEPROM detection apis
  board: ti: j721e: Probe eeprom only when CONFIG_TI_I2C_BOARD_DETECT is
defined
  arm: mach-k3: Move mmr_unlock to a common location
  arm: mach-k3: sysfw-loader: Add support for rom loading sysfw image
  arm: mach-k3: j721e: Add detection for j721e
  arm: mach-k3: j721e: Fix unlocking control module registers
  arm: mach-k3: j7200: Add support for SOC detection
  arm: mach-k3: j7200: Add support for storing extended boot info from
ROM
  arm: mach-k3: j7200: Detect if ROM has already loaded sysfw
  board: ti: j7200: Introduce support for j7200 build targets
  board: ti: j7200: Add board detection support for j7200
  ram: k3-j721e: Relax version checks for memory controller
  arm: dts: k3-j7200: Add dts support
  configs: j7200_evm_r5: Add initial support
  configs: j7200_evm_a72: Add Initial support

Suman Anna (1):
  board: ti: j721e: Update fdt fixup logic for interconnect nodes

 arch/arm/dts/Makefile |4 +-
 .../k3-j7200-common-proc-board-u-boot.dtsi|   92 +
 arch/arm/dts/k3-j7200-common-proc-board.dts   |   94 +
 arch/arm/dts/k3-j7200-ddr-evm-lp4-1600.dtsi   | 2195 +
 arch/arm/dts/k3-j7200-main.dtsi   |  313 +++
 arch/arm/dts/k3-j7200-mcu-wakeup.dtsi |  117 +
 .../arm/dts/k3-j7200-r5-common-proc-board.dts |  199 ++
 arch/arm/dts/k3-j7200-som-p0.dtsi |   29 +
 arch/arm/dts/k3-j7200.dtsi|  175 ++
 arch/arm/mach-k3/am6_init.c   |   12 +-
 arch/arm/mach-k3/common.c |   38 +
 arch/arm/mach-k3/common.h |4 +
 arch/arm/mach-k3/config.mk|8 +-
 arch/arm/mach-k3/include/mach/hardware.h  |7 +
 .../arm/mach-k3/include/mach/j721e_hardware.h |3 +
 arch/arm/mach-k3/include/mach/sys_proto.h |3 +
 arch/arm/mach-k3/include/mach/sysfw-loader.h  |4 +-
 arch/arm/mach-k3/j721e_init.c |   30 +-
 arch/arm/mach-k3/sysfw-loader.c   |   56 +-
 board/ti/common/board_detect.h|   13 +
 board/ti/j721e/Kconfig|   53 +
 board/ti/j721e/evm.c  |   25 +-
 configs/j7200_evm_a72_defconfig   |  172 ++
 configs/j7200_evm_r5_defconfig|  126 +
 drivers/ram/k3-j721e/lpddr4.c |   16 +-
 25 files changed, 3719 insertions(+), 69 deletions(-)
 create mode 100644 arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi
 create mode 100644 arch/arm/dts/k3-j7200-common-proc-board.dts
 create mode 100644 arch/arm/dts/k3-j7200-ddr-evm-lp4-1600.dtsi
 create mode 100644 arch/arm/dts/k3-j7200-main.dtsi
 create mode 100644 arch/arm/dts/k3-j7200-mcu-wakeup.dtsi
 create mode 100644 arch/arm/dts/k3-j7200-r5-common-proc-board.dts
 create mode 100644 arch/arm/dts/k3-j7200-som-p0.dtsi
 create mode 100644 arch/arm/dts/k3-j7200.dtsi
 create mode 100644 configs/j7200_evm_a72_defconfig
 create mode 100644 configs/j7200_evm_r5_defconfig

-- 
2.27.0



RE: [PATCH v4 2/6] drivers: net: add a DSA sandbox driver

2020-07-27 Thread Priyanka Jain (OSS)
>-Original Message-
>From: Claudiu Manoil 
>Sent: Friday, July 24, 2020 4:00 PM
>To: Priyanka Jain (OSS) ; u-boot@lists.denx.de
>Cc: joe.hershber...@ni.com; Alexandru Marginean
>; Vladimir Oltean
>
>Subject: RE: [PATCH v4 2/6] drivers: net: add a DSA sandbox driver
>
>
>
>>-Original Message-
>>From: Priyanka Jain (OSS) 
>[...]
>>
>>Kindly fix build error for target
>>BUILDMAN="sandbox x86" TOOLCHAIN="i386"
>>
>>https://travis-ci.org/github/p-priyanka-jain/u-boot/jobs/711090082
>>
>>
>
>Hi Priyanka,
>I will look into rebasing the patches and addressing these new found issues,
>unfortunately I'll be out of office for the next week.
>Also note that the patches are based on top of the -net tree (git.denx.de/u-
>boot-net.git), since they introduce networking features.  But -net didn't
>change for a long time.
>Should I base the patches on another upstream tree instead?
>
>Thanks.
>Claudiu

Please rebase patches on top of below:
git://git.denx.de/u-boot.git
master branch

Regards
Priyanka


  1   2   >