Re: [U-Boot] [PATCH v4 1/1] efi_loader: efi_setup_loaded_image() handle missing file name

2019-04-17 Thread Heinrich Schuchardt

On 4/18/19 6:59 AM, Heinrich Schuchardt wrote:

From: AKASHI Takahiro 

This is a preparatory patch.

efi_dp_split_file_path() is used to create device_path and file_path
from file_path for efi_setup_loaded_image().
In a special case, however, of HARDWARE_DEVICE/MEMORY, it doesn't
work expectedly since this path doesn't contain any FILE_PATH sub-type.

This patch makes a workaround.

Signed-off-by: AKASHI Takahiro 

Adjust the logic such that for all paths that do no end on a media file
path we return NULL as file_path.

Signed-off-by: Heinrich Schuchardt 
---
v4:
Handle all paths not ending on a media file path node the same.
---


Applied to efi-2019-07
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/1] efi_loader: export root node handle

2019-04-17 Thread Heinrich Schuchardt

On 4/18/19 7:02 AM, Heinrich Schuchardt wrote:

From: AKASHI Takahiro 

This is a preparatory patch.
The root node handle will be used as a dummy parent handle when invoking
an EFI image from bootefi/bootmgr command.

Signed-off-by: AKASHI Takahiro 

Rebased.

Signed-off-by: Heinrich Schuchardt 
---
v4
Rebase
---


Applied to efi-2019-07
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 1/1] efi_loader: export root node handle

2019-04-17 Thread Heinrich Schuchardt
From: AKASHI Takahiro 

This is a preparatory patch.
The root node handle will be used as a dummy parent handle when invoking
an EFI image from bootefi/bootmgr command.

Signed-off-by: AKASHI Takahiro 

Rebased.

Signed-off-by: Heinrich Schuchardt 
---
v4
Rebase
---
 include/efi_loader.h   | 3 +++
 lib/efi_loader/efi_root_node.c | 5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/efi_loader.h b/include/efi_loader.h
index f7bf732827..93f7672aec 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -25,6 +25,9 @@
EFI_GUID(0xe61d73b9, 0xa384, 0x4acc, \
 0xae, 0xab, 0x82, 0xe8, 0x28, 0xf3, 0x62, 0x8b)

+/* Root node */
+extern efi_handle_t efi_root;
+
 int __efi_entry_check(void);
 int __efi_exit_check(void);
 const char *__efi_nesting(void);
diff --git a/lib/efi_loader/efi_root_node.c b/lib/efi_loader/efi_root_node.c
index 392f5c4951..e0fcbb85a4 100644
--- a/lib/efi_loader/efi_root_node.c
+++ b/lib/efi_loader/efi_root_node.c
@@ -11,6 +11,8 @@

 const efi_guid_t efi_u_boot_guid = U_BOOT_GUID;

+efi_handle_t efi_root = NULL;
+
 struct efi_root_dp {
struct efi_device_path_vendor vendor;
struct efi_device_path end;
@@ -26,7 +28,6 @@ struct efi_root_dp {
  */
 efi_status_t efi_root_node_register(void)
 {
-   efi_handle_t root = NULL;
struct efi_root_dp *dp;

/* Create device path protocol */
@@ -46,7 +47,7 @@ efi_status_t efi_root_node_register(void)
dp->end.length = sizeof(struct efi_device_path);

/* Create root node and install protocols */
-   return EFI_CALL(efi_install_multiple_protocol_interfaces(,
+   return EFI_CALL(efi_install_multiple_protocol_interfaces(_root,
   /* Device path protocol */
   _guid_device_path, dp,
   /* Device path to text protocol */
--
2.20.1

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


[U-Boot] [PATCH v4 1/1] efi_loader: efi_setup_loaded_image() handle missing file name

2019-04-17 Thread Heinrich Schuchardt
From: AKASHI Takahiro 

This is a preparatory patch.

efi_dp_split_file_path() is used to create device_path and file_path
from file_path for efi_setup_loaded_image().
In a special case, however, of HARDWARE_DEVICE/MEMORY, it doesn't
work expectedly since this path doesn't contain any FILE_PATH sub-type.

This patch makes a workaround.

Signed-off-by: AKASHI Takahiro 

Adjust the logic such that for all paths that do no end on a media file
path we return NULL as file_path.

Signed-off-by: Heinrich Schuchardt 
---
v4:
Handle all paths not ending on a media file path node the same.
---
 lib/efi_loader/efi_device_path.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index d8c052d6ec..6104c7d33b 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -917,14 +917,14 @@ struct efi_device_path *efi_dp_from_mem(uint32_t 
memory_type,
  *
  * @full_path: device path including device and file path
  * @device_path:   path of the device
- * @file_path: relative path of the file
+ * @file_path: relative path of the file or NULL if there is none
  * Return: status code
  */
 efi_status_t efi_dp_split_file_path(struct efi_device_path *full_path,
struct efi_device_path **device_path,
struct efi_device_path **file_path)
 {
-   struct efi_device_path *p, *dp, *fp;
+   struct efi_device_path *p, *dp, *fp = NULL;

*device_path = NULL;
*file_path = NULL;
@@ -935,7 +935,7 @@ efi_status_t efi_dp_split_file_path(struct efi_device_path 
*full_path,
while (!EFI_DP_TYPE(p, MEDIA_DEVICE, FILE_PATH)) {
p = efi_dp_next(p);
if (!p)
-   return EFI_INVALID_PARAMETER;
+   goto out;
}
fp = efi_dp_dup(p);
if (!fp)
@@ -944,6 +944,7 @@ efi_status_t efi_dp_split_file_path(struct efi_device_path 
*full_path,
p->sub_type = DEVICE_PATH_SUB_TYPE_END;
p->length = sizeof(*p);

+out:
*device_path = dp;
*file_path = fp;
return EFI_SUCCESS;
--
2.20.1

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


Re: [U-Boot] [PATCH] rockchip: add u-boot-tpl-v8.lds

2019-04-17 Thread Simon Glass
On Mon, 1 Apr 2019 at 02:16, Kever Yang  wrote:
>
> We don't have both sram and sdram in TPL, so update from:
> arch/arm/cpu/armv8/u-boot-spl.lds
>
> Signed-off-by: Kever Yang 
> ---
>
>  arch/arm/mach-rockchip/u-boot-tpl-v8.lds | 94 
>  1 file changed, 94 insertions(+)
>  create mode 100644 arch/arm/mach-rockchip/u-boot-tpl-v8.lds
>

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


Re: [U-Boot] [PATCH 1/3] rockchip: rk3399: add tpl support

2019-04-17 Thread Simon Glass
Hi Kever,

On Mon, 1 Apr 2019 at 02:21, Kever Yang  wrote:
>
> Rockchip platform suppose to use TPL(run in SRAM) as dram init and
> SPL(run in DDR SDRAM) as pre-loader, so that the SPL would not be
> limited by SRAM size.
> This patch add rk3399-board-tpl.c and its common configs.

So this means that TPL inits SDRAM? That seems strange to me...why
have SPL at all, then? What is SPL supported to do on RK3399
platforms?

Regards,
Simon


>
> Signed-off-by: Kever Yang 
> ---
>
>  arch/arm/mach-rockchip/Kconfig| 34 -
>  arch/arm/mach-rockchip/Makefile   |  1 +
>  arch/arm/mach-rockchip/rk3399-board-tpl.c | 84 +++
>  include/configs/rk3399_common.h   |  9 +++
>  4 files changed, 127 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/mach-rockchip/rk3399-board-tpl.c
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/2] net: eth-uclass: Support device tree MAC addresses

2019-04-17 Thread Simon Glass
Hi Thierry,

On Wed, 17 Apr 2019 at 08:03, Thierry Reding 
wrote:

> On Wed, Apr 17, 2019 at 02:49:22PM +0300, Grygorii Strashko wrote:
> >
> >
> > On 16.04.19 19:24, Thierry Reding wrote:
> > > From: Thierry Reding 
> > >
> > > Add the standard Ethernet device tree bindings (imported from v5.0 of
> > > the Linux kernel) and implement support for reading the MAC address for
> > > Ethernet devices in the Ethernet uclass. If the "mac-address" property
> > > exists, the MAC address will be parsed from that. If that property does
> > > not exist, the "local-mac-address" property will be tried as fallback.
> > >
> > > MAC addresses from device tree take precedence over the ones stored in
> > > a network interface card's ROM.
> > >
> > > Acked-by: Joe Hershberger 
> > > Signed-off-by: Thierry Reding 
> > > ---
> > > Changes in v2:
> > > - use dev_read_u8_array_ptr()
>

It would be good to have test cases for these.


> > >
> > >  .../devicetree/bindings/net/ethernet.txt  | 66 +++
> > >  net/eth-uclass.c  | 26 +++-
> > >  2 files changed, 89 insertions(+), 3 deletions(-)
> > >  create mode 100644 Documentation/devicetree/bindings/net/ethernet.txt
>
> Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] fs: cbfs: make file_cbfs_load_header(..) independent of end-of-rom

2019-04-17 Thread Bin Meng
Hi Christian,

On Wed, Apr 17, 2019 at 11:17 PM Christian Gmeiner
 wrote:
>
> Am Mi., 17. Apr. 2019 um 15:21 Uhr schrieb Christian Gmeiner
> :
> >
> > Signed-off-by: Christian Gmeiner 
>
> I think I will send out a v2 that compiles :/
>

and please add some descriptions in the commit message. Thanks!

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


Re: [U-Boot] [RFC v3 09/10] efi_loader: rework bootmgr/bootefi using load_image API

2019-04-17 Thread AKASHI Takahiro
Correction:

On Thu, Apr 18, 2019 at 09:13:52AM +0900, AKASHI Takahiro wrote:
> On Tue, Apr 16, 2019 at 12:56:32PM +0200, Heinrich Schuchardt wrote:
> > On 4/16/19 6:24 AM, AKASHI Takahiro wrote:
> > >In the current implementation, bootefi command and EFI boot manager
> > >don't use load_image API, instead, use more primitive and internal
> > >functions. This will introduce duplicated code and potentially
> > >unknown bugs as well as inconsistent behaviours.
> > >
> > >With this patch, do_efibootmgr() and do_boot_efi() are completely
> > >overhauled and re-implemented using load_image API.
> > >
> > >Signed-off-by: AKASHI Takahiro 
> > >---
> > >  cmd/bootefi.c | 197 +++---
> > >  include/efi_loader.h  |   5 +-
> > >  lib/efi_loader/efi_bootmgr.c  |  43 
> > >  lib/efi_loader/efi_boottime.c |   2 +
> > >  4 files changed, 134 insertions(+), 113 deletions(-)
> > >
> > >diff --git a/cmd/bootefi.c b/cmd/bootefi.c
> > >index f14966961b23..97d49a53a44b 100644
> > >--- a/cmd/bootefi.c
> > >+++ b/cmd/bootefi.c
> > >@@ -222,88 +222,39 @@ static efi_status_t efi_install_fdt(const char 
> > >*fdt_opt)
> > >  /**
> > >   * do_bootefi_exec() - execute EFI binary
> > >   *
> > >- * @efi:  address of the binary
> > >- * @device_path:  path of the device from which the binary was loaded
> > >- * @image_path:   device path of the binary
> > >+ * @handle:   handle of loaded image
> > >   * Return:   status code
> > >   *
> > >   * Load the EFI binary into a newly assigned memory unwinding the 
> > > relocation
> > >   * information, install the loaded image protocol, and call the binary.
> > >   */
> > >-static efi_status_t do_bootefi_exec(void *efi,
> > >-  struct efi_device_path *device_path,
> > >-  struct efi_device_path *image_path)
> > >+static efi_status_t do_bootefi_exec(efi_handle_t handle)
> > >  {
> > >-  efi_handle_t mem_handle = NULL;
> > >-  struct efi_device_path *memdp = NULL;
> > >-  efi_status_t ret;
> > >-  struct efi_loaded_image_obj *image_obj = NULL;
> > >   struct efi_loaded_image *loaded_image_info = NULL;
> > >-
> > >-  /*
> > >-   * Special case for efi payload not loaded from disk, such as
> > >-   * 'bootefi hello' or for example payload loaded directly into
> > >-   * memory via JTAG, etc:
> > >-   */
> > >-  if (!device_path && !image_path) {
> > >-  printf("WARNING: using memory device/image path, this may 
> > >confuse some payloads!\n");
> > >-  /* actual addresses filled in after efi_load_pe() */
> > >-  memdp = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE, 0, 0);
> > >-  device_path = image_path = memdp;
> > >-  /*
> > >-   * Grub expects that the device path of the loaded image is
> > >-   * installed on a handle.
> > >-   */
> > >-  ret = efi_create_handle(_handle);
> > >-  if (ret != EFI_SUCCESS)
> > >-  return ret; /* TODO: leaks device_path */
> > >-  ret = efi_add_protocol(mem_handle, _guid_device_path,
> > >- device_path);
> > >-  if (ret != EFI_SUCCESS)
> > >-  goto err_add_protocol;
> > >-  } else {
> > >-  assert(device_path && image_path);
> > >-  }
> > >-
> > >-  ret = efi_setup_loaded_image(device_path, image_path, _obj,
> > >-   _image_info);
> > >-  if (ret)
> > >-  goto err_prepare;
> > >+  efi_status_t ret;
> > >
> > >   /* Transfer environment variable as load options */
> > >-  set_load_options(loaded_image_info, "bootargs");
> > 
> > In set_load_options() an error could occur (out of memory). So I think
> > it should return a status.
> 
> I didn't change anything in set_load_options(), but I will follow
> your comment.
> 
> > >-
> > >-  /* Load the EFI payload */
> > >-  ret = efi_load_pe(image_obj, efi, loaded_image_info);
> > >+  ret = EFI_CALL(systab.boottime->open_protocol(
> > >+  handle,
> > >+  _guid_loaded_image,
> > >+  (void **)_image_info,
> > >+  NULL, NULL,
> > >+  EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL));
> > 
> > Shouldn't we move this to set_load_options()?
> 
> No. This line has nothing to do with "load options."

Wrong, I will follow your comment.
This change, however, uncovers one issue: Who is responsible
for freeing loaded_image_info->load_option, particularly,
when efi_exit()/unload_image() is fully implemented?
In such a case, we have no chance to access this handle,
hence loaded_image_info, after returning from efi_start_image().

Thanks,
-Takahiro Akashi

> > >   if (ret != EFI_SUCCESS)
> > >-  goto err_prepare;
> > >-
> > >-  if (memdp) {
> > >-  struct efi_device_path_memory *mdp = (void *)memdp;
> > >-  

Re: [U-Boot] [PATCH v2 09/14] rockchip: rk3399: Add 4GB LPDDR3-1866 DMC settings【请注意,邮件由linux-rockchip-bounces+kever.yang=rock-chips....@lists.infradead.org代发】

2019-04-17 Thread Kever Yang
Hi Jagan,


On 04/17/2019 07:11 PM, Jagan Teki wrote:
> On Wed, Apr 17, 2019 at 1:10 PM Kever Yang  wrote:
>> Hi Jagan,
>>
>>
>> On 04/16/2019 06:56 PM, Jagan Teki wrote:
>>> Add sdram dtsi file for 4GB LPDDR3-1866 DMC settings by reverse
>>> engineered from the rk3399_ddr_933Mhz_v1.14.bin file.
>>>
>>> Full credits to 'Liviu Dudau' who is the real author for this change.
>>>
>>> Signed-off-by: Liviu Dudau 
>>> Signed-off-by: Jagan Teki 
>>> ---
>>>  .../arm/dts/rk3399-sdram-lpddr3-4GB-1866.dtsi | 1535 +
>> Could you use rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi directly?
>> I think it should able to work.
> I supposed to take the same, but thought that it would be some samsung
> specific setting. but seems like it is nearly same and it worked. will
> update to use this. thanks!

I have check with rockchip dram driver owner, this setting is more generic
while the -samsung- dtsi is more for dedicate chromebook.
So I think we can merge this patch for other boards who using Rockchip
reference design.

Reviewed-by: Kever Yang 

Thanks,
- Kever



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


[U-Boot] [PATCH v3] ARM: dts: i.MX6Q: fix avoid_unnecessary_addr_size warnings

2019-04-17 Thread Peng Fan
> 
> From: Marcel Ziswiler 
> 
> Re-synced the device tree with Linux 5.0.
> 
> This fixes the following warnings:
> 
> w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
>  port@2/endpoint@0:reg: property has invalid length (4 bytes)
> (#address-cells == 2, #size-cells == 1)
> w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
>  port@2/endpoint@1:reg: property has invalid length (4 bytes)
> (#address-cells == 2, #size-cells == 1)
> w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
>  port@2/endpoint@2:reg: property has invalid length (4 bytes)
> (#address-cells == 2, #size-cells == 1)
> w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
>  port@2/endpoint@3:reg: property has invalid length (4 bytes)
> (#address-cells == 2, #size-cells == 1)
> w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
>  port@2/endpoint@4:reg: property has invalid length (4 bytes)
> (#address-cells == 2, #size-cells == 1)
> w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
>  port@3/endpoint@1:reg: property has invalid length (4 bytes)
> (#address-cells == 2, #size-cells == 1)
> w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
>  port@3/endpoint@2:reg: property has invalid length (4 bytes)
> (#address-cells == 2, #size-cells == 1)
> w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
>  port@3/endpoint@3:reg: property has invalid length (4 bytes)
> (#address-cells == 2, #size-cells == 1)
> w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
>  port@3/endpoint@4:reg: property has invalid length (4 bytes)
> (#address-cells == 2, #size-cells == 1)
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@2/endpoint@0: Relying on default #address-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@2/endpoint@0: Relying on default #size-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@2/endpoint@1: Relying on default #address-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@2/endpoint@1: Relying on default #size-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@2/endpoint@2: Relying on default #address-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@2/endpoint@2: Relying on default #size-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@2/endpoint@3: Relying on default #address-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@2/endpoint@3: Relying on default #size-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@2/endpoint@4: Relying on default #address-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@2/endpoint@4: Relying on default #size-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@3/endpoint@1: Relying on default #address-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@3/endpoint@1: Relying on default #size-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@3/endpoint@2: Relying on default #address-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@3/endpoint@2: Relying on default #size-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@3/endpoint@3: Relying on default #address-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@3/endpoint@3: Relying on default #size-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@3/endpoint@4: Relying on default #address-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
>  /soc/ipu@280/port@3/endpoint@4: Relying on default #size-cells
> value
> w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_unnecessary_addr_size):
>  Failed prerequisite 'avoid_default_addr_size'
> 
> Signed-off-by: Marcel Ziswiler 
> Reviewed-by: Fabio Estevam 
> Reviewed-by: Lukasz Majewski 
> 
> ---
> 
> Changes in v3:
> - Added Fabio and Lukasz' reviewed-by tags.
> 
> Changes in v2:
> - Re-synced the device tree with Linux 5.0 as suggested by Fabio.
> 
>  arch/arm/dts/imx6q.dtsi | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm/dts/imx6q.dtsi b/arch/arm/dts/imx6q.dtsi index
> ab1716b6b0..d038f41170 100644
> --- 

[U-Boot] [PATCH] imx: Add variscite DART-6UL Evaluation Kit

2019-04-17 Thread Peng Fan

> 
> 
> Port for the DART-6UL Evaluation Kit SBC. Based on the variscite DART-6UL
> iMX6ULL SoM.
> 
> CPU:   Freescale i.MX6ULL rev1.1 900 MHz (running at 396 MHz)
> CPU:   Commercial temperature grade (0C to 95C) at 43C
> Reset cause: POR
> Model: Variscite DART-6UL Evaluation Kit
> Board: Variscite DART-6UL Evaluation Kit
> DRAM:  512 MiB
> MMC:   FSL_SDHC: 0, FSL_SDHC: 1
> In:serial@0202
> Out:   serial@0202
> Err:   serial@0202
> Net:   FEC0
> 
> Working:
>  - Eth0
>  - i2c
>  - MMC/SD
>  - eMMC
>  - USB host
>  - UART 1
> 
> Note: LCDIF porting needs DM_VIDEO
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.d
> enx.de%2Fpipermail%2Fu-boot%2F2019-April%2F365506.htmldata=02
> %7C01%7Cpeng.fan%40nxp.com%7Ced2e2a78aa28409c4c1c08d6c380a738
> %7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636911354661076
> 012sdata=meF0d06pEsGDBXW83kDMr10Qu%2FafP76xBhdzFCzp8VY%
> 3Dreserved=0
> 
> Signed-off-by: Parthiban Nallathambi 
> ---
>  arch/arm/Kconfig |   1 +
>  arch/arm/dts/Makefile|   1 +
>  arch/arm/dts/imx6ull-dart-6ul.dts|  39 
>  arch/arm/dts/imx6ull-dart-6ul.dtsi   | 261
> +++
>  arch/arm/mach-imx/mx6/Kconfig|  12 ++
>  board/variscite/dart_6ul/Kconfig |  12 ++
>  board/variscite/dart_6ul/MAINTAINERS |   8 +
>  board/variscite/dart_6ul/Makefile|   4 +
>  board/variscite/dart_6ul/README  |  41 +
>  board/variscite/dart_6ul/dart_6ul.c  | 228 +++
>  board/variscite/dart_6ul/spl.c   | 215 ++
>  configs/variscite_dart6ul_defconfig  |  55 ++
>  include/configs/dart_6ul.h   | 131 ++
>  13 files changed, 1008 insertions(+)
>  create mode 100644 arch/arm/dts/imx6ull-dart-6ul.dts  create mode
> 100644 arch/arm/dts/imx6ull-dart-6ul.dtsi
>  create mode 100644 board/variscite/dart_6ul/Kconfig  create mode
> 100644 board/variscite/dart_6ul/MAINTAINERS
>  create mode 100644 board/variscite/dart_6ul/Makefile  create mode
> 100644 board/variscite/dart_6ul/README  create mode 100644
> board/variscite/dart_6ul/dart_6ul.c
>  create mode 100644 board/variscite/dart_6ul/spl.c  create mode 100644
> configs/variscite_dart6ul_defconfig
>  create mode 100644 include/configs/dart_6ul.h
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index
> 4640f3b3bd..c20866c86a 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1635,6 +1635,7 @@ source "board/tcl/sl50/Kconfig"
>  source "board/ucRobotics/bubblegum_96/Kconfig"
>  source "board/birdland/bav335x/Kconfig"
>  source "board/toradex/colibri_pxa270/Kconfig"
> +source "board/variscite/dart_6ul/Kconfig"
>  source "board/vscom/baltos/Kconfig"
>  source "board/woodburn/Kconfig"
>  source "board/xilinx/Kconfig"
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index
> 0aee8dfde0..6fb545dc9f 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -549,6 +549,7 @@ dtb-$(CONFIG_MX6UL) += \
>  dtb-$(CONFIG_MX6ULL) += \
> imx6ull-14x14-evk.dtb \
> imx6ull-colibri.dtb \
> +   imx6ull-dart-6ul.dtb
> 
>  dtb-$(CONFIG_ARCH_MX6) += \
> imx6-colibri.dtb
> diff --git a/arch/arm/dts/imx6ull-dart-6ul.dts
> b/arch/arm/dts/imx6ull-dart-6ul.dts
> new file mode 100644
> index 00..4cab1a048b
> --- /dev/null
> +++ b/arch/arm/dts/imx6ull-dart-6ul.dts
> @@ -0,0 +1,39 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (C) 2019 Parthiban Nallathambi   */
> +
> +/dts-v1/;
> +
> +#include "imx6ull.dtsi"
> +#include "imx6ull-dart-6ul.dtsi"
> +
> +/ {
> +   model = "Variscite DART-6UL Evaluation Kit";
> +   compatible = "variscite,imx6ull-dart-6ul", "fsl,imx6ull"; };
> +
> + {
> +   status = "okay";
> +};
> +
> + {
> +   pinctrl-names = "default";
> +   pinctrl-0 = <_usb_otg1_id>;
> +   dr_mode = "otg";
> +   srp-disable;
> +   hnp-disable;
> +   adp-disable;
> +   status = "okay";
> +};
> +
> + {
> +   pinctrl-names = "default";
> +
> +   pinctrl_usb_otg1_id: usbotg1idgrp {
> +   fsl,pins = <
> +   MX6UL_PAD_GPIO1_IO00__ANATOP_OTG1_ID
> 0x17059
> +   >;
> +   };
> +
> +};
> diff --git a/arch/arm/dts/imx6ull-dart-6ul.dtsi
> b/arch/arm/dts/imx6ull-dart-6ul.dtsi
> new file mode 100644
> index 00..e96669f493
> --- /dev/null
> +++ b/arch/arm/dts/imx6ull-dart-6ul.dtsi
> @@ -0,0 +1,261 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (C) 2019 Parthiban Nallathambi   */
> +
> +/ {
> +   model = "Variscite DART-6UL i.MX6 Ultra Low Lite SOM";
> +   compatible = "variscite,imx6ull-dart-6ul", "fsl,imx6ull";
> +
> +   memory {
> +   reg = <0x8000 0x2000>;
> +   };
> +
> +   chosen {
> +   stdout-path = 
> +   };
> +};
> +
> + {
> +   pinctrl-names = "default";
> +   pinctrl-0 = <_enet1>;
> +   phy-mode = "rmii";
> +   phy-handle = <>;
> +   status = 

Re: [U-Boot] [RESEND PATCH 0/3] arm: Introduce writel/readl_relaxed accessors

2019-04-17 Thread André Przywara
On 17/04/2019 13:00, Jagan Teki wrote:
> On Mon, Apr 15, 2019 at 1:21 PM André Przywara  wrote:
>>
>> On 15/04/2019 07:22, Jagan Teki wrote:
>>
>> Hi,
>>
>>> On Mon, Apr 15, 2019 at 11:40 AM Chen-Yu Tsai  wrote:

 On Mon, Apr 15, 2019 at 2:07 PM Jagan Teki  
 wrote:
>
> On Sun, Feb 10, 2019 at 9:49 PM Andre Przywara  
> wrote:
>>
>> Hi, this is a resend of what I posted some weeks ago, just adding the
>> missing Signed-off-by: in patch 2/3, as pointed out by Philipp. I used
>> the opportunity to add his Reviewed-by: tags on the first two patches.
>> (Many thanks for that!) The rest is unchanged.
>> ---
>>
>> Admittedly this is the long way round to solve some nasty SPL code size
>> problem, but it looked beneficial to others as well, so here we go:
>>
>> arch/arm/include/asm/io.h looks like it's been around since the dawn of
>> time, and was more or less blindly copied from Linux.
>> We don't use and don't need most of the definitions, and mainline Linux
>> got rid of them anyway, so patch 1/3 cleans up this header file to
>> just contain what we need in U-Boot.
>>
>> Patch 2/3 introduces readl/writel_relaxed accessors, which are cheaper,
>> but more importantly save one (barrier) instruction per accessor. This
>> helps to bring down code size, since especially DRAM controller inits in
>> SPLs tend to do a lot of MMIO.
>>
>> Consequently patch 3/3 introduces them in the Allwinner H6 DRAM driver,
>> which reduces the SPL size by a whopping 2KB, due to a twist:
>> The AArch64 exception table needs to be 2KB aligned, but we don't do
>> anything special about it the linker script. So depending on where the
>> code before the vectors ends, we have potentially large padding:
>> At the moment this last address is 0x1824 for the H6, so the vectors can
>> only start at 0x2000. By reducing the code size before the vectors by 
>> just
>> (at least) 9 instructions, the vectors start at 0x1800 and we save most 
>> of
>> the padding.
>
> How come it reduces to 2KB? I can see the diff size of 160 bytes for 
> gcc-6.3.1
>
> ₹ aarch64-linux-gnu-size spl/u-boot-spl*
>text   databssdechexfilename
>   28376408504  29288   7268spl/u-boot-spl
>
> ₹ aarch64-linux-gnu-size spl/u-boot-spl*
>text   databssdechexfilename
>   28216408504  29128   71c8spl/u-boot-spl

 Because of section alignment issues? I believe Andre is referring to the
 size of the whole file. Since it gets loaded as a whole, the total size
 is what matters, not the size of the individual sections.
>>>
>>> Well, the input for final sunxi-spl.bin would be u-boot-spl and the
>>> above shows the size of file as well 29128 bytes with -160 bytes from
>>> 29288.
>>>
>>> Since the size of sunxi-spl.bin is truncated to 32K, I couldn't see
>>> any difference either.
>>
>> As mentioned in the commit messasge, this is a fragile topic. Since
>> commit ef331e3685fe ("armv8: Disable exception vectors in SPL by
>> default") we disable the SPL exception vectors by default now, so the
>> numbers are now different.
> 
> Sorry, I over looked the commit messages.
> 
>> You should be able to see the 2K saving with the SPL exception vectors
>> explicitly enabled in menuconfig.
> 
> Oh. So I enabled the vectors via ARMV8_SPL_EXCEPTION_VECTORS=y but it
> seems increased the SPL size.
> 
> ₹ aarch64-linux-gnu-size spl/u-boot-spl
>text   databssdechexfilename
>   30130408504  31042   7942spl/u-boot-spl

Sure, I meant you should see an effect with vs. without these patches,
both with the vectors enabled. But as mentioned, this is somewhat
random, depending on other code changes.
With current mainline for pine_h64_defconfig I get 29344 vs. 29504 bytes
without the vectors, and 31202 vs. "will not fit" with the vectors.

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


Re: [U-Boot] [RFC v3 03/10] cmd: bootefi: carve out fdt handling from do_bootefi()

2019-04-17 Thread AKASHI Takahiro
On Wed, Apr 17, 2019 at 06:35:57PM +0200, Heinrich Schuchardt wrote:
> On 4/17/19 9:01 AM, AKASHI Takahiro wrote:
> >On Tue, Apr 16, 2019 at 06:54:58AM +0200, Heinrich Schuchardt wrote:
> >>On 4/16/19 6:24 AM, AKASHI Takahiro wrote:
> >>>This is a preparatory patch for reworking do_bootefi() in later patch.
> >>
> >>I would prefer a more informative commit message like:
> >>
> >>Carve out a function to handle the installation of the device tree as a
> >>configuration table.
> >
> >Okay, but it doesn't convey more than the subject.
> >
> >-Takahiro Akashi
> >
> >>Otherwise
> >>Reviewed-by: Heinrich Schuchardt 
> >>
> >>>
> >>>Signed-off-by: AKASHI Takahiro 
> >>>---
> >>>  cmd/bootefi.c | 53 ---
> >>>  1 file changed, 38 insertions(+), 15 deletions(-)
> >>>
> >>>diff --git a/cmd/bootefi.c b/cmd/bootefi.c
> >>>index 3619a20e6433..8cd9644115eb 100644
> >>>--- a/cmd/bootefi.c
> >>>+++ b/cmd/bootefi.c
> >>>@@ -198,6 +198,38 @@ static efi_status_t efi_install_fdt(ulong fdt_addr)
> >>>   return ret;
> >>>  }
> >>>
> >>>+/**
> >>>+ * efi_process_fdt() - process fdt passed by a command argument
> >>>+ * @fdt_opt:  pointer to argument
> >>>+ * Return:status code
> >>>+ *
> >>>+ * If specified, fdt will be installed as configuration table,
> >>>+ * otherwise no fdt will be passed.
> >>>+ */
> >>>+static efi_status_t efi_process_fdt(const char *fdt_opt)
> >>>+{
> >>>+  unsigned long fdt_addr;
> >>>+  efi_status_t ret;
> >>>+
> >>>+  if (fdt_opt) {
> >>>+  fdt_addr = simple_strtoul(fdt_opt, NULL, 16);
> >>>+  if (!fdt_addr && *fdt_opt != '0')
> >>>+  return EFI_INVALID_PARAMETER;
> >>>+
> >>>+  /* Install device tree */
> >>>+  ret = efi_install_fdt(fdt_addr);
> >>>+  if (ret != EFI_SUCCESS) {
> >>>+  printf("ERROR: failed to install device tree\n");
> >>>+  return ret;
> >>>+  }
> >>>+  } else {
> >>>+  /* Remove device tree. EFI_NOT_FOUND can be ignored here */
> >>>+  efi_install_configuration_table(_guid_fdt, NULL);
> >>>+  }
> >>>+
> >>>+  return EFI_SUCCESS;
> >>>+}
> >>>+
> >>>  static efi_status_t bootefi_run_prepare(const char *load_options_path,
> >>>   struct efi_device_path *device_path,
> >>>   struct efi_device_path *image_path,
> >>>@@ -407,21 +439,12 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, 
> >>>int argc, char * const argv[])
> >>>   if (argc < 2)
> >>>   return CMD_RET_USAGE;
> >>>
> >>>-  if (argc > 2) {
> >>>-  fdt_addr = simple_strtoul(argv[2], NULL, 16);
> >>>-  if (!fdt_addr && *argv[2] != '0')
> >>>-  return CMD_RET_USAGE;
> >>>-  /* Install device tree */
> >>>-  r = efi_install_fdt(fdt_addr);
> >>>-  if (r != EFI_SUCCESS) {
> >>>-  printf("ERROR: failed to install device tree\n");
> >>>-  return CMD_RET_FAILURE;
> >>>-  }
> >>>-  } else {
> >>>-  /* Remove device tree. EFI_NOT_FOUND can be ignored here */
> >>>-  efi_install_configuration_table(_guid_fdt, NULL);
> >>>-  printf("WARNING: booting without device tree\n");
> >>>-  }
> >>>+  r = fdt_process_fdt(argc > 2 ? argv[2] : NULL);
> 
> cmd/bootefi.c: In function ‘do_bootefi’:
> cmd/bootefi.c:442:6: warning: implicit declaration of function
> ‘fdt_process_fdt’; did you mean ‘efi_process_fdt’?
> [-Wimplicit-function-declaration]
>   r = fdt_process_fdt(argc > 2 ? argv[2] : NULL);
>   ^~~
>   efi_process_fdt

Oops. I think that I fixed it before.
Will fix along with patch#4.

> cmd/bootefi.c:424:16: warning: unused variable ‘fdt_addr’
> [-Wunused-variable]
>   unsigned long fdt_addr;
> ^~~~

Okay.

Thanks,
-Takahiro Akashi
> At top level:
>   CC  drivers/virtio/virtio_pci_legacy.o
> cmd/bootefi.c:209:21: warning: ‘efi_process_fdt’ defined but not used
> [-Wunused-function]
>  static efi_status_t efi_process_fdt(const char *fdt_opt)
>  ^~~
> 
> Please, check.
> 
> Best regards
> 
> Heinrich
> 
> >>>+  if (r == EFI_INVALID_PARAMETER)
> >>>+  return CMD_RET_USAGE;
> >>>+  else if (r != EFI_SUCCESS)
> >>>+  return CMD_RET_FAILURE;
> >>>+
> >>>  #ifdef CONFIG_CMD_BOOTEFI_HELLO
> >>>   if (!strcmp(argv[1], "hello")) {
> >>>   ulong size = __efi_helloworld_end - __efi_helloworld_begin;
> >>>
> >>
> >
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RFC v3 09/10] efi_loader: rework bootmgr/bootefi using load_image API

2019-04-17 Thread AKASHI Takahiro
On Tue, Apr 16, 2019 at 12:56:32PM +0200, Heinrich Schuchardt wrote:
> On 4/16/19 6:24 AM, AKASHI Takahiro wrote:
> >In the current implementation, bootefi command and EFI boot manager
> >don't use load_image API, instead, use more primitive and internal
> >functions. This will introduce duplicated code and potentially
> >unknown bugs as well as inconsistent behaviours.
> >
> >With this patch, do_efibootmgr() and do_boot_efi() are completely
> >overhauled and re-implemented using load_image API.
> >
> >Signed-off-by: AKASHI Takahiro 
> >---
> >  cmd/bootefi.c | 197 +++---
> >  include/efi_loader.h  |   5 +-
> >  lib/efi_loader/efi_bootmgr.c  |  43 
> >  lib/efi_loader/efi_boottime.c |   2 +
> >  4 files changed, 134 insertions(+), 113 deletions(-)
> >
> >diff --git a/cmd/bootefi.c b/cmd/bootefi.c
> >index f14966961b23..97d49a53a44b 100644
> >--- a/cmd/bootefi.c
> >+++ b/cmd/bootefi.c
> >@@ -222,88 +222,39 @@ static efi_status_t efi_install_fdt(const char 
> >*fdt_opt)
> >  /**
> >   * do_bootefi_exec() - execute EFI binary
> >   *
> >- * @efi:address of the binary
> >- * @device_path:path of the device from which the binary was loaded
> >- * @image_path: device path of the binary
> >+ * @handle: handle of loaded image
> >   * Return: status code
> >   *
> >   * Load the EFI binary into a newly assigned memory unwinding the 
> > relocation
> >   * information, install the loaded image protocol, and call the binary.
> >   */
> >-static efi_status_t do_bootefi_exec(void *efi,
> >-struct efi_device_path *device_path,
> >-struct efi_device_path *image_path)
> >+static efi_status_t do_bootefi_exec(efi_handle_t handle)
> >  {
> >-efi_handle_t mem_handle = NULL;
> >-struct efi_device_path *memdp = NULL;
> >-efi_status_t ret;
> >-struct efi_loaded_image_obj *image_obj = NULL;
> > struct efi_loaded_image *loaded_image_info = NULL;
> >-
> >-/*
> >- * Special case for efi payload not loaded from disk, such as
> >- * 'bootefi hello' or for example payload loaded directly into
> >- * memory via JTAG, etc:
> >- */
> >-if (!device_path && !image_path) {
> >-printf("WARNING: using memory device/image path, this may 
> >confuse some payloads!\n");
> >-/* actual addresses filled in after efi_load_pe() */
> >-memdp = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE, 0, 0);
> >-device_path = image_path = memdp;
> >-/*
> >- * Grub expects that the device path of the loaded image is
> >- * installed on a handle.
> >- */
> >-ret = efi_create_handle(_handle);
> >-if (ret != EFI_SUCCESS)
> >-return ret; /* TODO: leaks device_path */
> >-ret = efi_add_protocol(mem_handle, _guid_device_path,
> >-   device_path);
> >-if (ret != EFI_SUCCESS)
> >-goto err_add_protocol;
> >-} else {
> >-assert(device_path && image_path);
> >-}
> >-
> >-ret = efi_setup_loaded_image(device_path, image_path, _obj,
> >- _image_info);
> >-if (ret)
> >-goto err_prepare;
> >+efi_status_t ret;
> >
> > /* Transfer environment variable as load options */
> >-set_load_options(loaded_image_info, "bootargs");
> 
> In set_load_options() an error could occur (out of memory). So I think
> it should return a status.

I didn't change anything in set_load_options(), but I will follow
your comment.

> >-
> >-/* Load the EFI payload */
> >-ret = efi_load_pe(image_obj, efi, loaded_image_info);
> >+ret = EFI_CALL(systab.boottime->open_protocol(
> >+handle,
> >+_guid_loaded_image,
> >+(void **)_image_info,
> >+NULL, NULL,
> >+EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL));
> 
> Shouldn't we move this to set_load_options()?

No. This line has nothing to do with "load options."

> > if (ret != EFI_SUCCESS)
> >-goto err_prepare;
> >-
> >-if (memdp) {
> >-struct efi_device_path_memory *mdp = (void *)memdp;
> >-mdp->memory_type = loaded_image_info->image_code_type;
> >-mdp->start_address = (uintptr_t)loaded_image_info->image_base;
> >-mdp->end_address = mdp->start_address +
> >-loaded_image_info->image_size;
> >-}
> >+goto err;
> >+set_load_options(loaded_image_info, "bootargs");
> >
> > /* we don't support much: */
> > 
> > env_set("efi_8be4df61-93ca-11d2-aa0d-00e098032b8c_OsIndicationsSupported",
> > "{ro,boot}(blob)");
> 
> Shouldn't this move to 

[U-Boot] [PATCH v3 07/14] colibri-imx6ull: configuration clean-up

2019-04-17 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Drop disabling SPL_SYS_THUMB_BUILD as we anyway do not use SPL.
Enbale CRC32 verify, USB SDP and EFI loader support.
Drop CMD_GPT and disabling RANDOM_UUID.
Do savedefconfig which drops USB_FUNCTION_SDP.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Igor Opaniuk 

---

Changes in v3: None
Changes in v2:
- Added Igor's reviewed-by.

 configs/colibri-imx6ull_defconfig | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/configs/colibri-imx6ull_defconfig 
b/configs/colibri-imx6ull_defconfig
index dfe6ec1ce7..b19b3b7fb2 100644
--- a/configs/colibri-imx6ull_defconfig
+++ b/configs/colibri-imx6ull_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_SYS_THUMB_BUILD=y
-# CONFIG_SPL_SYS_THUMB_BUILD is not set
 CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x8780
 CONFIG_TARGET_COLIBRI_IMX6ULL=y
@@ -18,19 +17,20 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="Colibri iMX6ULL # "
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_ASKENV=y
+CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
-CONFIG_CMD_GPT=y
-# CONFIG_RANDOM_UUID is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_NAND_TORTURE=y
 CONFIG_CMD_USB=y
+CONFIG_CMD_USB_SDP=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
@@ -73,8 +73,6 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
 CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_USB_FUNCTION_SDP=y
 CONFIG_VIDEO=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
-# CONFIG_EFI_LOADER is not set
-- 
2.20.1

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


[U-Boot] [PATCH v3 12/14] ARM: dts: colibri-imx6ull: fix uart-has-rtscts property

2019-04-17 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Remove vendor pre-fix fsl, from uart-has-rtscts property.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Igor Opaniuk 

---

Changes in v3: None
Changes in v2:
- Added Igor's reviewed-by.

 arch/arm/dts/imx6ull-colibri.dts | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/imx6ull-colibri.dts b/arch/arm/dts/imx6ull-colibri.dts
index adb10ac8ca..6a2a934dff 100644
--- a/arch/arm/dts/imx6ull-colibri.dts
+++ b/arch/arm/dts/imx6ull-colibri.dts
@@ -182,21 +182,24 @@
status = "disabled";
 };
 
+/* Colibri UART_A */
  {
pinctrl-names = "default";
pinctrl-0 = <_uart1 _uart1_ctrl1>;
-   fsl,uart-has-rtscts;
+   uart-has-rtscts;
fsl,dte-mode;
status = "okay";
 };
 
+/* Colibri UART_B */
  {
pinctrl-names = "default";
pinctrl-0 = <_uart2>;
-   fsl,uart-has-rtscts;
+   uart-has-rtscts;
fsl,dte-mode;
 };
 
+/* Colibri UART_C */
  {
pinctrl-names = "default";
pinctrl-0 = <_uart5>;
-- 
2.20.1

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


[U-Boot] [PATCH v3 05/14] colibri-imx6ull: fix ethernet phy power on

2019-04-17 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Just give the new Ethernet PHY power save mode circuitry time to settle.

Signed-off-by: Marcel Ziswiler 
Acked-by: Max Krummenacher 
Reviewed-by: Igor Opaniuk 

---

Changes in v3: None
Changes in v2:
- Added Igor's reviewed-by tag.

 board/toradex/colibri-imx6ull/colibri-imx6ull.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/board/toradex/colibri-imx6ull/colibri-imx6ull.c 
b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
index fe60b8e870..b6f45edb86 100644
--- a/board/toradex/colibri-imx6ull/colibri-imx6ull.c
+++ b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
@@ -263,6 +263,9 @@ static int setup_fec(void)
IOMUX_GPR1_FEC2_CLOCK_MUX2_SEL_MASK,
IOMUX_GPR1_FEC2_CLOCK_MUX1_SEL_MASK);
 
+   /* give new Ethernet PHY power save mode circuitry time to settle */
+   mdelay(300);
+
return 0;
 }
 
-- 
2.20.1

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


[U-Boot] [PATCH v3 11/14] colibri-imx6ull: migrate fec to using driver model

2019-04-17 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Migrate Ethernet FEC to using driver model.
Drop PHY_MICREL_KSZ90X1 which slipped in from Apalis iMX6.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Igor Opaniuk 

---

Changes in v3: None
Changes in v2:
- Added Igor's reviewed-by.

 arch/arm/dts/imx6ull-colibri.dts  | 31 ---
 configs/colibri-imx6ull_defconfig |  3 +--
 include/configs/colibri-imx6ull.h |  4 
 3 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/arch/arm/dts/imx6ull-colibri.dts b/arch/arm/dts/imx6ull-colibri.dts
index 42ae70deff..adb10ac8ca 100644
--- a/arch/arm/dts/imx6ull-colibri.dts
+++ b/arch/arm/dts/imx6ull-colibri.dts
@@ -80,6 +80,7 @@
pinctrl-0 = <_ecspi1 _ecspi1_cs>;
 };
 
+/* Ethernet */
  {
pinctrl-names = "default";
pinctrl-0 = <_enet2>;
@@ -233,6 +234,21 @@
 };
 
  {
+   pinctrl_enet2: enet2-grp {
+   fsl,pins = <
+   MX6UL_PAD_GPIO1_IO06__ENET2_MDIO0x1b0b0
+   MX6UL_PAD_GPIO1_IO07__ENET2_MDC 0x1b0b0
+   MX6UL_PAD_ENET2_RX_DATA0__ENET2_RDATA00 0x1b0b0
+   MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x1b0b0
+   MX6UL_PAD_ENET2_RX_EN__ENET2_RX_EN  0x1b0b0
+   MX6UL_PAD_ENET2_RX_ER__ENET2_RX_ER  0x1b0b0
+   MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2  0x4001b031
+   MX6UL_PAD_ENET2_TX_DATA0__ENET2_TDATA00 0x1b0b0
+   MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x1b0b0
+   MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN  0x1b0b0
+   >;
+   };
+
pinctrl_gpio1: gpio1-grp {
fsl,pins = <
MX6UL_PAD_ENET1_RX_DATA0__GPIO2_IO000x74 /* SODIMM 
55 */
@@ -295,21 +311,6 @@
>;
};
 
-   pinctrl_enet2: enet2-grp {
-   fsl,pins = <
-   MX6UL_PAD_GPIO1_IO06__ENET2_MDIO0x1b0b0
-   MX6UL_PAD_GPIO1_IO07__ENET2_MDC 0x1b0b0
-   MX6UL_PAD_ENET2_RX_DATA0__ENET2_RDATA00 0x1b0b0
-   MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x1b0b0
-   MX6UL_PAD_ENET2_RX_EN__ENET2_RX_EN  0x1b0b0
-   MX6UL_PAD_ENET2_RX_ER__ENET2_RX_ER  0x1b0b0
-   MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2  0x4001b031
-   MX6UL_PAD_ENET2_TX_DATA0__ENET2_TDATA00 0x1b0b0
-   MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x1b0b0
-   MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN  0x1b0b0
-   >;
-   };
-
pinctrl_ecspi1_cs: ecspi1-cs-grp {
fsl,pins = <
MX6UL_PAD_LCD_DATA21__GPIO3_IO260x000a0
diff --git a/configs/colibri-imx6ull_defconfig 
b/configs/colibri-imx6ull_defconfig
index 0440b4ed94..a24c87f321 100644
--- a/configs/colibri-imx6ull_defconfig
+++ b/configs/colibri-imx6ull_defconfig
@@ -58,9 +58,8 @@ CONFIG_NAND_MXS=y
 CONFIG_NAND_MXS_DT=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_PHYLIB=y
-CONFIG_PHY_ADDR_ENABLE=y
 CONFIG_PHY_MICREL=y
-CONFIG_PHY_MICREL_KSZ90X1=y
+CONFIG_DM_ETH=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
diff --git a/include/configs/colibri-imx6ull.h 
b/include/configs/colibri-imx6ull.h
index 7a7a70e457..fc39e807b6 100644
--- a/include/configs/colibri-imx6ull.h
+++ b/include/configs/colibri-imx6ull.h
@@ -19,10 +19,6 @@
 #define CONFIG_SYS_MALLOC_LEN  (32 * SZ_1M)
 
 /* Network */
-#define CONFIG_FEC_XCV_TYPE RMII
-#define CONFIG_ETHPRIME "FEC"
-#define CONFIG_FEC_MXC_PHYADDR 0
-
 #define CONFIG_IP_DEFRAG
 #define CONFIG_TFTP_BLOCKSIZE  16352
 #define CONFIG_TFTP_TSIZE
-- 
2.20.1

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


[U-Boot] [PATCH v3 10/14] colibri-imx6ull: migrate usb to using driver model

2019-04-17 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Migrate USB to using driver model.
Add USBH_PEN GPIO regulator.
While at it also add alias e.g. as required for UMS.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Igor Opaniuk 

---

Changes in v3:
- Fixed issue with host mode as pointed out by Igor.

Changes in v2:
- Added Igor's reviewed-by.

 arch/arm/dts/imx6ull-colibri.dts  | 26 +-
 .../toradex/colibri-imx6ull/colibri-imx6ull.c | 48 ---
 configs/colibri-imx6ull_defconfig |  1 +
 3 files changed, 26 insertions(+), 49 deletions(-)

diff --git a/arch/arm/dts/imx6ull-colibri.dts b/arch/arm/dts/imx6ull-colibri.dts
index 0d416ebd10..42ae70deff 100644
--- a/arch/arm/dts/imx6ull-colibri.dts
+++ b/arch/arm/dts/imx6ull-colibri.dts
@@ -13,6 +13,7 @@
 
aliases {
mmc0 = 
+   usb0 =  /* required for ums */
};
 
chosen {
@@ -35,6 +36,13 @@
regulator-max-microvolt = <330>;
};
 
+   reg_5v0: regulator-5v0 {
+   compatible = "regulator-fixed";
+   regulator-name = "5V";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   };
+
reg_sd1_vmmc: regulator-sd1-vmmc {
compatible = "regulator-gpio";
gpio = < 9 GPIO_ACTIVE_HIGH>;
@@ -47,6 +55,17 @@
states = <180 0x1 330 0x0>;
vin-supply = <_module_3v3>;
};
+
+   reg_usbh_vbus: regulator-usbh-vbus {
+   compatible = "regulator-fixed";
+   pinctrl-names = "default";
+   pinctrl-0 = <_usbh_reg>;
+   regulator-name = "VCC_USB[1-4]";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   gpio = < 2 GPIO_ACTIVE_LOW>; /* USBH_PEN */
+   vin-supply = <_5v0>;
+   };
 };
 
  {
@@ -183,15 +202,20 @@
fsl,dte-mode;
 };
 
+/* Colibri USBC */
  {
-   dr_mode = "otg";
+   dr_mode = "host";
srp-disable;
hnp-disable;
adp-disable;
+   status = "okay";
 };
 
+/* Colibri USBH */
  {
dr_mode = "host";
+   vbus-supply = <_usbh_vbus>;
+   status = "okay";
 };
 
 /* Colibri MMC */
diff --git a/board/toradex/colibri-imx6ull/colibri-imx6ull.c 
b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
index c9af44e30e..21addaf6ed 100644
--- a/board/toradex/colibri-imx6ull/colibri-imx6ull.c
+++ b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
@@ -24,8 +24,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 
 #include "../common/tdx-common.h"
 #include "../common/tdx-cfg-block.h"
@@ -41,8 +39,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define NAND_PAD_READY0_CTRL (PAD_CTL_DSE_48ohm | PAD_CTL_PUS_22K_UP)
 
-#define USB_CDET_GPIO  IMX_GPIO_NR(7, 14)
-
 int dram_init(void)
 {
gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
@@ -50,10 +46,6 @@ int dram_init(void)
return 0;
 }
 
-static iomux_v3_cfg_t const usb_cdet_pads[] = {
-   MX6_PAD_SNVS_TAMPER2__GPIO5_IO02 | MUX_PAD_CTRL(NO_PAD_CTRL),
-};
-
 #ifdef CONFIG_NAND_MXS
 static void setup_gpmi_nand(void)
 {
@@ -163,11 +155,6 @@ int board_init(void)
setup_lcd();
 #endif
 
-#ifdef CONFIG_USB_EHCI_MX6
-   imx_iomux_v3_setup_multiple_pads(usb_cdet_pads, 
ARRAY_SIZE(usb_cdet_pads));
-   gpio_request(USB_CDET_GPIO, "usb-cdet-gpio");
-#endif
-
return 0;
 }
 
@@ -241,41 +228,6 @@ int ft_board_setup(void *blob, bd_t *bd)
 }
 #endif
 
-#ifdef CONFIG_USB_EHCI_MX6
-static iomux_v3_cfg_t const usb_otg2_pads[] = {
-   MX6_PAD_GPIO1_IO02__GPIO1_IO02 | MUX_PAD_CTRL(NO_PAD_CTRL),
-};
-
-int board_ehci_hcd_init(int port)
-{
-   switch (port) {
-   case 0:
-   break;
-   case 1:
-   imx_iomux_v3_setup_multiple_pads(usb_otg2_pads,
-ARRAY_SIZE(usb_otg2_pads));
-   break;
-   default:
-   return -EINVAL;
-   }
-   return 0;
-}
-
-int board_usb_phy_mode(int port)
-{
-   switch (port) {
-   case 0:
-   if (gpio_get_value(USB_CDET_GPIO))
-   return USB_INIT_DEVICE;
-   else
-   return USB_INIT_HOST;
-   case 1:
-   default:
-   return USB_INIT_HOST;
-   }
-}
-#endif
-
 static struct mxc_serial_platdata mxc_serial_plat = {
.reg = (struct mxc_uart *)UART1_BASE,
.use_dte = 1,
diff --git a/configs/colibri-imx6ull_defconfig 
b/configs/colibri-imx6ull_defconfig
index 69305323f2..0440b4ed94 100644
--- a/configs/colibri-imx6ull_defconfig
+++ b/configs/colibri-imx6ull_defconfig
@@ -71,6 +71,7 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Toradex"
 CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
-- 
2.20.1


[U-Boot] [PATCH v3 09/14] colibri-imx6ull: migrate mmc to using driver model

2019-04-17 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Migrate MMC to using driver model.
Migrate USDHC to using pinctrl.
While at it also add GPIO1_IO03__OSC32K_32K_OUT pin muxing.
While at it also update copyright period.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Igor Opaniuk 

---

Changes in v3: None
Changes in v2:
- Added Igor's reviewed-by.

 arch/arm/dts/imx6ull-colibri.dts  | 15 +++-
 .../toradex/colibri-imx6ull/colibri-imx6ull.c | 70 ---
 configs/colibri-imx6ull_defconfig |  1 +
 include/configs/colibri-imx6ull.h |  6 +-
 4 files changed, 17 insertions(+), 75 deletions(-)

diff --git a/arch/arm/dts/imx6ull-colibri.dts b/arch/arm/dts/imx6ull-colibri.dts
index 95c67be438..0d416ebd10 100644
--- a/arch/arm/dts/imx6ull-colibri.dts
+++ b/arch/arm/dts/imx6ull-colibri.dts
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
- * Copyright 2018 Toradex AG
+ * Copyright 2018-2019 Toradex AG
  */
 
 /dts-v1/;
@@ -11,6 +11,10 @@
model = "Toradex Colibri iMX6ULL";
compatible = "toradex,imx6ull-colibri", "fsl,imx6ull";
 
+   aliases {
+   mmc0 = 
+   };
+
chosen {
stdout-path = 
};
@@ -190,10 +194,18 @@
dr_mode = "host";
 };
 
+/* Colibri MMC */
  {
assigned-clocks = < IMX6UL_CLK_USDHC1_SEL>, < 
IMX6UL_CLK_USDHC1>;
assigned-clock-parents = < IMX6UL_CLK_PLL2_PFD2>;
assigned-clock-rates = <0>, <19800>;
+   cd-gpios = < 0 GPIO_ACTIVE_LOW>; /* MMC_CD */
+   pinctrl-names = "default", "state_100mhz", "state_200mhz";
+   pinctrl-0 = <_usdhc1 _snvs_usdhc1_cd>;
+   pinctrl-1 = <_usdhc1_100mhz>;
+   pinctrl-2 = <_usdhc1_200mhz>;
+   vmmc-supply = <_sd1_vmmc>;
+   status = "okay";
 };
 
  {
@@ -547,4 +559,3 @@
>;
};
 };
-
diff --git a/board/toradex/colibri-imx6ull/colibri-imx6ull.c 
b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
index 8493b1dfdd..c9af44e30e 100644
--- a/board/toradex/colibri-imx6ull/colibri-imx6ull.c
+++ b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
@@ -18,11 +18,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -34,10 +32,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP |   \
-   PAD_CTL_SPEED_LOW | PAD_CTL_DSE_40ohm | \
-   PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
-
 #define LCD_PAD_CTRL(PAD_CTL_HYS | PAD_CTL_PUS_100K_UP | \
PAD_CTL_DSE_48ohm)
 
@@ -56,19 +50,6 @@ int dram_init(void)
return 0;
 }
 
-#ifdef CONFIG_FSL_ESDHC
-static iomux_v3_cfg_t const usdhc1_pads[] = {
-   MX6_PAD_SD1_CLK__USDHC1_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX6_PAD_SD1_CMD__USDHC1_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX6_PAD_SD1_DATA0__USDHC1_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX6_PAD_SD1_DATA1__USDHC1_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX6_PAD_SD1_DATA2__USDHC1_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX6_PAD_SD1_DATA3__USDHC1_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-
-   MX6_PAD_SNVS_TAMPER0__GPIO5_IO00 | MUX_PAD_CTRL(NO_PAD_CTRL),
-};
-#endif
-
 static iomux_v3_cfg_t const usb_cdet_pads[] = {
MX6_PAD_SNVS_TAMPER2__GPIO5_IO02 | MUX_PAD_CTRL(NO_PAD_CTRL),
 };
@@ -135,57 +116,6 @@ static int setup_lcd(void)
 }
 #endif
 
-#ifdef CONFIG_FSL_ESDHC
-
-#define USDHC1_CD_GPIO IMX_GPIO_NR(5, 0)
-
-static struct fsl_esdhc_cfg usdhc_cfg[] = {
-   {USDHC1_BASE_ADDR, 0, 4},
-};
-
-int board_mmc_getcd(struct mmc *mmc)
-{
-   struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
-   int ret = 0;
-
-   switch (cfg->esdhc_base) {
-   case USDHC1_BASE_ADDR:
-   ret = !gpio_get_value(USDHC1_CD_GPIO);
-   break;
-   }
-
-   return ret;
-}
-
-int board_mmc_init(bd_t *bis)
-{
-   int i, ret;
-
-   /* USDHC1 is mmc0 */
-   for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) {
-   switch (i) {
-   case 0:
-   imx_iomux_v3_setup_multiple_pads(usdhc1_pads,
-
ARRAY_SIZE(usdhc1_pads));
-   gpio_request(USDHC1_CD_GPIO, "usdhc1_cd");
-   gpio_direction_input(USDHC1_CD_GPIO);
-   usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
-   break;
-   default:
-   printf("Warning: you configured more USDHC controllers"
-   "(%d) than supported by the board\n", i + 1);
-   return -EINVAL;
-   }
-
-   ret = fsl_esdhc_initialize(bis, _cfg[i]);
-   if (ret)
-   return ret;
-   }
-
-   return 0;
-}
-#endif
-
 #ifdef CONFIG_FEC_MXC
 static int setup_fec(void)
 {
diff --git a/configs/colibri-imx6ull_defconfig 
b/configs/colibri-imx6ull_defconfig
index 

[U-Boot] [PATCH v3 14/14] ARM: dts: colibri-imx6ull: update device tree

2019-04-17 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Fix compatible node to use regular Toradex notation.
Annotate device tree with standard Colibri pin muxing comments.
Use open-drain I2C pin muxings.
Alphabetically re-order iomuxc nodes.
Rename snvs-ad7879-int-grp touch interrupt node as per Linux device tree.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Igor Opaniuk 

---

Changes in v3: None
Changes in v2:
- Added Igor's reviewed-by.

 arch/arm/dts/imx6ull-colibri.dts | 91 ++--
 1 file changed, 52 insertions(+), 39 deletions(-)

diff --git a/arch/arm/dts/imx6ull-colibri.dts b/arch/arm/dts/imx6ull-colibri.dts
index a827e9ceeb..6c847ab792 100644
--- a/arch/arm/dts/imx6ull-colibri.dts
+++ b/arch/arm/dts/imx6ull-colibri.dts
@@ -9,7 +9,7 @@
 
 / {
model = "Toradex Colibri iMX6ULL";
-   compatible = "toradex,imx6ull-colibri", "fsl,imx6ull";
+   compatible = "toradex,colibri-imx6ull", "fsl,imx6ull";
 
aliases {
mmc0 = 
@@ -100,6 +100,7 @@
};
 };
 
+/* NAND */
  {
pinctrl-names = "default";
pinctrl-0 = <_gpmi_nand>;
@@ -110,21 +111,28 @@
status = "okay";
 };
 
+/*
+ * I2C3_SDA/SCL on SODIMM 194/196 (e.g. RTC on carrier board)
+ */
  {
pinctrl-names = "default", "gpio";
pinctrl-0 = <_i2c1>;
pinctrl-1 = <_i2c1_gpio>;
-   sda-gpios = < 29 GPIO_ACTIVE_LOW>;
-   scl-gpios = < 28 GPIO_ACTIVE_LOW>;
+   sda-gpios = < 29 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+   scl-gpios = < 28 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
status = "okay";
 };
 
+/*
+ * PWR_I2C: power I2C to audio codec, PMIC, temperature sensor and
+ * touch screen controller
+ */
  {
pinctrl-names = "default", "gpio";
pinctrl-0 = <_i2c2>;
pinctrl-1 = <_i2c2_gpio>;
-   sda-gpios = < 31 GPIO_ACTIVE_LOW>;
-   scl-gpios = < 30 GPIO_ACTIVE_LOW>;
+   sda-gpios = < 31 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+   scl-gpios = < 30 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
status = "okay";
 
ad7879@2c {
@@ -150,24 +158,28 @@
 _lcdif_ctrl>;
 };
 
+/* PWM  */
  {
pinctrl-names = "default";
pinctrl-0 = <_pwm4>;
#pwm-cells = <3>;
 };
 
+/* PWM  */
  {
pinctrl-names = "default";
pinctrl-0 = <_pwm5>;
#pwm-cells = <3>;
 };
 
+/* PWM  */
  {
pinctrl-names = "default";
pinctrl-0 = <_pwm6>;
#pwm-cells = <3>;
 };
 
+/* PWM  */
  {
pinctrl-names = "default";
pinctrl-0 = <_pwm7>;
@@ -237,6 +249,13 @@
 };
 
  {
+   pinctrl_can_int: canint-grp {
+   fsl,pins = <
+   /* SODIMM 73 */
+   MX6UL_PAD_ENET1_TX_DATA1__GPIO2_IO040X14
+   >;
+   };
+
pinctrl_enet2: enet2-grp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO06__ENET2_MDIO0x1b0b0
@@ -252,6 +271,33 @@
>;
};
 
+   pinctrl_ecspi1_cs: ecspi1-cs-grp {
+   fsl,pins = <
+   MX6UL_PAD_LCD_DATA21__GPIO3_IO260x000a0
+   >;
+   };
+
+   pinctrl_ecspi1: ecspi1-grp {
+   fsl,pins = <
+   MX6UL_PAD_LCD_DATA20__ECSPI1_SCLK   0x000a0
+   MX6UL_PAD_LCD_DATA22__ECSPI1_MOSI   0x000a0
+   MX6UL_PAD_LCD_DATA23__ECSPI1_MISO   0x100a0
+   >;
+   };
+
+   pinctrl_flexcan2: flexcan2-grp {
+   fsl,pins = <
+   MX6UL_PAD_ENET1_TX_DATA0__FLEXCAN2_RX   0x1b020
+   MX6UL_PAD_ENET1_RX_EN__FLEXCAN2_TX  0x1b020
+   >;
+   };
+
+   pinctrl_gpio_bl_on: gpio-bl-on-grp {
+   fsl,pins = <
+   MX6UL_PAD_JTAG_TMS__GPIO1_IO11  0x000a0
+   >;
+   };
+
pinctrl_gpio1: gpio1-grp {
fsl,pins = <
MX6UL_PAD_ENET1_RX_DATA0__GPIO2_IO000x74 /* SODIMM 
55 */
@@ -308,39 +354,6 @@
>;
};
 
-   pinctrl_can_int: canint-grp {
-   fsl,pins = <
-   MX6UL_PAD_ENET1_TX_DATA1__GPIO2_IO040X14 /* SODIMM 
73 */
-   >;
-   };
-
-   pinctrl_ecspi1_cs: ecspi1-cs-grp {
-   fsl,pins = <
-   MX6UL_PAD_LCD_DATA21__GPIO3_IO260x000a0
-   >;
-   };
-
-   pinctrl_ecspi1: ecspi1-grp {
-   fsl,pins = <
-   MX6UL_PAD_LCD_DATA20__ECSPI1_SCLK   0x000a0
-   MX6UL_PAD_LCD_DATA22__ECSPI1_MOSI   0x000a0
-   MX6UL_PAD_LCD_DATA23__ECSPI1_MISO   0x100a0
-   >;
-   };
-
-   pinctrl_flexcan2: flexcan2-grp {
-   fsl,pins = <
-   MX6UL_PAD_ENET1_TX_DATA0__FLEXCAN2_RX   0x1b020
-   MX6UL_PAD_ENET1_RX_EN__FLEXCAN2_TX  0x1b020
-   >;
-   };
-
- 

[U-Boot] [PATCH v3 00/14] colibri-imx6ull device tree enablement and driver model conversion

2019-04-17 Thread Marcel Ziswiler

This series addresses some shortcomings, enables/introduces device tree
support and converts all except video to using the driver model. This is
fully tested both running our latest downstream BSP as well as the
mainline Linux kernel.

This series is available together with my previous series addressing
Apalis and Colibri iMX6 as well as Colibri Vybrid aka VF50/VF61 on our
git server [1].

[1] http://git.toradex.com/cgit/u-boot-toradex.git/log/?h=for-next

Changes in v3:
- Fixed issue with host mode as pointed out by Igor.

Changes in v2:
- Added Igor's reviewed-by tag.

Gerard Salvatella (1):
  tdx-cfg-block: add support for new colibri iMX6ull skus

Marcel Ziswiler (9):
  colibri-imx6ull: fix ethernet phy power on
  colibri-imx6ull: configuration clean-up
  colibri-imx6ull: migrate pinctrl and regulators to dtb/dm
  colibri-imx6ull: migrate mmc to using driver model
  colibri-imx6ull: migrate usb to using driver model
  colibri-imx6ull: migrate fec to using driver model
  ARM: dts: colibri-imx6ull: fix uart-has-rtscts property
  ARM: dts: colibri-imx6ull: add osc32k_32k_out pinctrl
  ARM: dts: colibri-imx6ull: update device tree

Philippe Schenker (1):
  board: imx6ull: Add disable PMIC_STBY_REQ

Stefan Agner (3):
  tdx-cfg-block: simplify i.MX 6 module detection
  colibri-imx6ull: set module variant depending on config block
  apalis/colibri_imx6/imx6ull: make sure loadaddr does not collide

 arch/arm/dts/imx6ull-colibri.dts  | 172 -
 arch/arm/dts/imx6ull-pinfunc.h|  26 +-
 .../toradex/colibri-imx6ull/colibri-imx6ull.c | 225 +++---
 board/toradex/common/tdx-cfg-block.c  |  70 --
 board/toradex/common/tdx-cfg-block.h  |   3 +
 configs/colibri-imx6ull_defconfig |  18 +-
 include/configs/apalis_imx6.h |   4 +-
 include/configs/colibri-imx6ull.h |  14 +-
 include/configs/colibri_imx6.h|   4 +-
 9 files changed, 228 insertions(+), 308 deletions(-)

-- 
2.20.1

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


[U-Boot] [PATCH v3 08/14] colibri-imx6ull: migrate pinctrl and regulators to dtb/dm

2019-04-17 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Migrate pinctrl and regulators to device tree resp. driver model:
Ethernet, NAND and UART.
Drop BOARD_EARLY_INIT_F as it is anyway no longer used.
Enable CMD_DM, CMD_MTD, CMD_REGULATOR and DM_REGULATOR_FIXED.
While at it also update copyright period.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Igor Opaniuk 

---

Changes in v3: None
Changes in v2:
- Added Igor's reviewed-by.

 .../toradex/colibri-imx6ull/colibri-imx6ull.c | 82 ++-
 configs/colibri-imx6ull_defconfig |  5 +-
 2 files changed, 10 insertions(+), 77 deletions(-)

diff --git a/board/toradex/colibri-imx6ull/colibri-imx6ull.c 
b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
index f1d5cc6655..8493b1dfdd 100644
--- a/board/toradex/colibri-imx6ull/colibri-imx6ull.c
+++ b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
@@ -1,8 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright (C) 2018 Toradex AG
+ * Copyright (C) 2018-2019 Toradex AG
  */
 #include 
+
 #include 
 #include 
 #include 
@@ -14,7 +15,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -28,25 +28,16 @@
 #include 
 #include 
 #include 
+
 #include "../common/tdx-common.h"
 #include "../common/tdx-cfg-block.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP |  \
-   PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \
-   PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
-
 #define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP |   \
PAD_CTL_SPEED_LOW | PAD_CTL_DSE_40ohm | \
PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
 
-#define ENET_PAD_CTRL  (PAD_CTL_PUS_100K_UP |  \
-   PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS)
-#define ENET_PAD_CTRL_MII  (PAD_CTL_DSE_40ohm)
-
-#define ENET_RX_PAD_CTRL  (PAD_CTL_PUS_100K_UP | PAD_CTL_DSE_48ohm)
-
 #define LCD_PAD_CTRL(PAD_CTL_HYS | PAD_CTL_PUS_100K_UP | \
PAD_CTL_DSE_48ohm)
 
@@ -65,13 +56,6 @@ int dram_init(void)
return 0;
 }
 
-static iomux_v3_cfg_t const uart1_pads[] = {
-   MX6_PAD_UART1_TX_DATA__UART1_DTE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-   MX6_PAD_UART1_RX_DATA__UART1_DTE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-   MX6_PAD_UART1_RTS_B__UART1_DTE_CTS  | MUX_PAD_CTRL(UART_PAD_CTRL),
-   MX6_PAD_UART1_CTS_B__UART1_DTE_RTS  | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
 #ifdef CONFIG_FSL_ESDHC
 static iomux_v3_cfg_t const usdhc1_pads[] = {
MX6_PAD_SD1_CLK__USDHC1_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL),
@@ -90,31 +74,12 @@ static iomux_v3_cfg_t const usb_cdet_pads[] = {
 };
 
 #ifdef CONFIG_NAND_MXS
-static iomux_v3_cfg_t const gpmi_pads[] = {
-   MX6_PAD_NAND_DATA00__RAWNAND_DATA00 | MUX_PAD_CTRL(NAND_PAD_CTRL),
-   MX6_PAD_NAND_DATA01__RAWNAND_DATA01 | MUX_PAD_CTRL(NAND_PAD_CTRL),
-   MX6_PAD_NAND_DATA02__RAWNAND_DATA02 | MUX_PAD_CTRL(NAND_PAD_CTRL),
-   MX6_PAD_NAND_DATA03__RAWNAND_DATA03 | MUX_PAD_CTRL(NAND_PAD_CTRL),
-   MX6_PAD_NAND_DATA04__RAWNAND_DATA04 | MUX_PAD_CTRL(NAND_PAD_CTRL),
-   MX6_PAD_NAND_DATA05__RAWNAND_DATA05 | MUX_PAD_CTRL(NAND_PAD_CTRL),
-   MX6_PAD_NAND_DATA06__RAWNAND_DATA06 | MUX_PAD_CTRL(NAND_PAD_CTRL),
-   MX6_PAD_NAND_DATA07__RAWNAND_DATA07 | MUX_PAD_CTRL(NAND_PAD_CTRL),
-   MX6_PAD_NAND_CLE__RAWNAND_CLE   | MUX_PAD_CTRL(NAND_PAD_CTRL),
-   MX6_PAD_NAND_ALE__RAWNAND_ALE   | MUX_PAD_CTRL(NAND_PAD_CTRL),
-   MX6_PAD_NAND_RE_B__RAWNAND_RE_B | MUX_PAD_CTRL(NAND_PAD_CTRL),
-   MX6_PAD_NAND_WE_B__RAWNAND_WE_B | MUX_PAD_CTRL(NAND_PAD_CTRL),
-   MX6_PAD_NAND_CE0_B__RAWNAND_CE0_B   | MUX_PAD_CTRL(NAND_PAD_CTRL),
-   MX6_PAD_NAND_READY_B__RAWNAND_READY_B   | 
MUX_PAD_CTRL(NAND_PAD_READY0_CTRL),
-};
-
 static void setup_gpmi_nand(void)
 {
-   imx_iomux_v3_setup_multiple_pads(gpmi_pads, ARRAY_SIZE(gpmi_pads));
-
setup_gpmi_io_clk((3 << MXC_CCM_CSCDR1_BCH_PODF_OFFSET) |
  (3 << MXC_CCM_CSCDR1_GPMI_PODF_OFFSET));
 }
-#endif
+#endif /* CONFIG_NAND_MXS */
 
 #ifdef CONFIG_VIDEO_MXS
 static iomux_v3_cfg_t const lcd_pads[] = {
@@ -170,31 +135,6 @@ static int setup_lcd(void)
 }
 #endif
 
-#ifdef CONFIG_FEC_MXC
-static iomux_v3_cfg_t const fec2_pads[] = {
-   MX6_PAD_ENET2_TX_CLK__ENET2_REF_CLK2| 
MUX_PAD_CTRL(ENET_PAD_CTRL) | MUX_MODE_SION,
-   MX6_PAD_GPIO1_IO06__ENET2_MDIO  | 
MUX_PAD_CTRL(ENET_PAD_CTRL_MII),
-   MX6_PAD_GPIO1_IO07__ENET2_MDC   | 
MUX_PAD_CTRL(ENET_PAD_CTRL_MII),
-   MX6_PAD_ENET2_RX_DATA0__ENET2_RDATA00   | 
MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
-   MX6_PAD_ENET2_RX_DATA1__ENET2_RDATA01   | 
MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
-   MX6_PAD_ENET2_RX_ER__ENET2_RX_ER| 
MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
-   MX6_PAD_ENET2_RX_EN__ENET2_RX_EN| 
MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
-   

[U-Boot] [PATCH v3 13/14] ARM: dts: colibri-imx6ull: add osc32k_32k_out pinctrl

2019-04-17 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Add GPIO1_IO03__OSC32K_32K_OUT pin muxing.
While at it also fix indentation of pinfunc header file.

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Igor Opaniuk 

---

Changes in v3: None
Changes in v2:
- Added Igor's reviewed-by.

 arch/arm/dts/imx6ull-colibri.dts |  2 ++
 arch/arm/dts/imx6ull-pinfunc.h   | 26 ++
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/arch/arm/dts/imx6ull-colibri.dts b/arch/arm/dts/imx6ull-colibri.dts
index 6a2a934dff..a827e9ceeb 100644
--- a/arch/arm/dts/imx6ull-colibri.dts
+++ b/arch/arm/dts/imx6ull-colibri.dts
@@ -524,6 +524,8 @@
MX6UL_PAD_CSI_DATA03__USDHC2_DATA3  0x17059
MX6UL_PAD_CSI_HSYNC__USDHC2_CMD 0x17059
MX6UL_PAD_CSI_VSYNC__USDHC2_CLK 0x17059
+
+   MX6UL_PAD_GPIO1_IO03__OSC32K_32K_OUT0x14
>;
};
 };
diff --git a/arch/arm/dts/imx6ull-pinfunc.h b/arch/arm/dts/imx6ull-pinfunc.h
index fca003680b..7770ed39f6 100644
--- a/arch/arm/dts/imx6ull-pinfunc.h
+++ b/arch/arm/dts/imx6ull-pinfunc.h
@@ -14,6 +14,8 @@
  * The pin function ID is a tuple of
  * 
  */
+#define MX6UL_PAD_GPIO1_IO03__OSC32K_32K_OUT 0x0068 0x02f4 
0x 0x3 0x0
+
 #define MX6UL_PAD_ENET2_RX_DATA0__EPDC_SDDO080x00E4 0x0370 
0x 0x9 0x0
 #define MX6UL_PAD_ENET2_RX_DATA1__EPDC_SDDO090x00E8 0x0374 
0x 0x9 0x0
 #define MX6UL_PAD_ENET2_RX_EN__EPDC_SDDO10   0x00EC 0x0378 
0x 0x9 0x0
@@ -41,17 +43,17 @@
 #define MX6UL_PAD_LCD_DATA17__EPDC_GDSP  0x015C 0x03E8 
0x 0x9 0x0
 #define MX6UL_PAD_LCD_DATA21__EPDC_SDCE1 0x016C 0x03F8 
0x 0x9 0x0
 
-#define MX6UL_PAD_CSI_MCLK__ESAI_TX3_RX2  0x01D4 
0x0460 0x 0x9 0x0
-#define MX6UL_PAD_CSI_PIXCLK__ESAI_TX2_RX30x01D8 
0x0464 0x 0x9 0x0
-#define MX6UL_PAD_CSI_VSYNC__ESAI_TX4_RX1 0x01DC 
0x0468 0x 0x9 0x0
-#define MX6UL_PAD_CSI_HSYNC__ESAI_TX1 0x01E0 
0x046C 0x 0x9 0x0
-#define MX6UL_PAD_CSI_DATA00__ESAI_TX_HF_CLK  0x01E4 
0x0470 0x 0x9 0x0
-#define MX6UL_PAD_CSI_DATA01__ESAI_RX_HF_CLK  0x01E8 
0x0474 0x 0x9 0x0
-#define MX6UL_PAD_CSI_DATA02__ESAI_RX_FS  0x01EC 
0x0478 0x 0x9 0x0
-#define MX6UL_PAD_CSI_DATA03__ESAI_RX_CLK 0x01F0 
0x047C 0x 0x9 0x0
-#define MX6UL_PAD_CSI_DATA04__ESAI_TX_FS  0x01F4 
0x0480 0x 0x9 0x0
-#define MX6UL_PAD_CSI_DATA05__ESAI_TX_CLK 0x01F8 
0x0484 0x 0x9 0x0
-#define MX6UL_PAD_CSI_DATA06__ESAI_TX5_RX00x01FC 
0x0488 0x 0x9 0x0
-#define MX6UL_PAD_CSI_DATA07__ESAI_T0 0x0200 
0x048C 0x 0x9 0x0
+#define MX6UL_PAD_CSI_MCLK__ESAI_TX3_RX2 0x01D4 0x0460 
0x 0x9 0x0
+#define MX6UL_PAD_CSI_PIXCLK__ESAI_TX2_RX3   0x01D8 0x0464 
0x 0x9 0x0
+#define MX6UL_PAD_CSI_VSYNC__ESAI_TX4_RX10x01DC 0x0468 
0x 0x9 0x0
+#define MX6UL_PAD_CSI_HSYNC__ESAI_TX10x01E0 0x046C 
0x 0x9 0x0
+#define MX6UL_PAD_CSI_DATA00__ESAI_TX_HF_CLK 0x01E4 0x0470 
0x 0x9 0x0
+#define MX6UL_PAD_CSI_DATA01__ESAI_RX_HF_CLK 0x01E8 0x0474 
0x 0x9 0x0
+#define MX6UL_PAD_CSI_DATA02__ESAI_RX_FS 0x01EC 0x0478 
0x 0x9 0x0
+#define MX6UL_PAD_CSI_DATA03__ESAI_RX_CLK0x01F0 0x047C 
0x 0x9 0x0
+#define MX6UL_PAD_CSI_DATA04__ESAI_TX_FS 0x01F4 0x0480 
0x 0x9 0x0
+#define MX6UL_PAD_CSI_DATA05__ESAI_TX_CLK0x01F8 0x0484 
0x 0x9 0x0
+#define MX6UL_PAD_CSI_DATA06__ESAI_TX5_RX0   0x01FC 0x0488 
0x 0x9 0x0
+#define MX6UL_PAD_CSI_DATA07__ESAI_T00x0200 0x048C 
0x 0x9 0x0
 
 #endif /* __DTS_IMX6ULL_PINFUNC_H */
-- 
2.20.1

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


[U-Boot] [PATCH v3 04/14] apalis/colibri_imx6/imx6ull: make sure loadaddr does not collide

2019-04-17 Thread Marcel Ziswiler
From: Stefan Agner 

Currently $loadaddr and $fdt_addr_r point to the same address. This
might be not ideal for some distro boot scripts which make use of
$loadaddr after loading the device tree.

Make sure the two variables point to two different addresses. Moving
$loadaddr is not entirly trivial since it is defined in mx6_common.h.
Move $fdt_addr_r and $ramdisk_addr_r by 1MiB, which should be enough
for scripts.

Signed-off-by: Stefan Agner 
Acked-by: Marcel Ziswiler 
Reviewed-by: Igor Opaniuk 

---

Changes in v3: None
Changes in v2:
- Added Igor's reviewed-by.

 include/configs/apalis_imx6.h | 4 ++--
 include/configs/colibri-imx6ull.h | 4 ++--
 include/configs/colibri_imx6.h| 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h
index 96169f55f0..91054d8c05 100644
--- a/include/configs/apalis_imx6.h
+++ b/include/configs/apalis_imx6.h
@@ -138,12 +138,12 @@
 
 #define MEM_LAYOUT_ENV_SETTINGS \
"bootm_size=0x2000\0" \
-   "fdt_addr_r=0x1200\0" \
+   "fdt_addr_r=0x1210\0" \
"fdt_high=0x\0" \
"initrd_high=0x\0" \
"kernel_addr_r=0x1100\0" \
"pxefile_addr_r=0x1710\0" \
-   "ramdisk_addr_r=0x1210\0" \
+   "ramdisk_addr_r=0x1220\0" \
"scriptaddr=0x1700\0"
 
 #define NFS_BOOTCMD \
diff --git a/include/configs/colibri-imx6ull.h 
b/include/configs/colibri-imx6ull.h
index 7cf550cf9e..31248b14a1 100644
--- a/include/configs/colibri-imx6ull.h
+++ b/include/configs/colibri-imx6ull.h
@@ -48,12 +48,12 @@
 
 #define MEM_LAYOUT_ENV_SETTINGS \
"bootm_size=0x1000\0" \
-   "fdt_addr_r=0x8200\0" \
+   "fdt_addr_r=0x8210\0" \
"fdt_high=0x\0" \
"initrd_high=0x\0" \
"kernel_addr_r=0x8100\0" \
"pxefile_addr_r=0x8710\0" \
-   "ramdisk_addr_r=0x8210\0" \
+   "ramdisk_addr_r=0x8220\0" \
"scriptaddr=0x8700\0"
 
 #define NFS_BOOTCMD \
diff --git a/include/configs/colibri_imx6.h b/include/configs/colibri_imx6.h
index 803c9be064..fecea95d32 100644
--- a/include/configs/colibri_imx6.h
+++ b/include/configs/colibri_imx6.h
@@ -128,12 +128,12 @@
 
 #define MEM_LAYOUT_ENV_SETTINGS \
"bootm_size=0x1000\0" \
-   "fdt_addr_r=0x1200\0" \
+   "fdt_addr_r=0x1210\0" \
"fdt_high=0x\0" \
"initrd_high=0x\0" \
"kernel_addr_r=0x1100\0" \
"pxefile_addr_r=0x1710\0" \
-   "ramdisk_addr_r=0x1210\0" \
+   "ramdisk_addr_r=0x1220\0" \
"scriptaddr=0x1700\0"
 
 #define NFS_BOOTCMD \
-- 
2.20.1

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


[U-Boot] [PATCH v3 02/14] tdx-cfg-block: simplify i.MX 6 module detection

2019-04-17 Thread Marcel Ziswiler
From: Stefan Agner 

Use CONFIG_TARGET_... at compile time to differentiate between
Apalis iMX6, Colibri iMX6 and Colibri iMX6ULL. Avoid code
duplication by moving question about Wi-Fi / Bluetooth before
IT/non-IT decision.

Signed-off-by: Stefan Agner 
Acked-by: Marcel Ziswiler 
Reviewed-by: Igor Opaniuk 

---

Changes in v3: None
Changes in v2:
- Added Igor's reviewed-by.

 board/toradex/common/tdx-cfg-block.c | 68 ++--
 1 file changed, 34 insertions(+), 34 deletions(-)

diff --git a/board/toradex/common/tdx-cfg-block.c 
b/board/toradex/common/tdx-cfg-block.c
index 3b73421243..71ff40cfad 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -280,6 +280,9 @@ static int get_cfgblock_interactive(void)
char it = 'n';
int len;
 
+   /* Unknown module by default */
+   tdx_hw_tag.prodid = 0;
+
if (cpu_is_pxa27x())
sprintf(message, "Is the module the 312 MHz version? [y/N] ");
else
@@ -290,54 +293,49 @@ static int get_cfgblock_interactive(void)
 
soc = env_get("soc");
if (!strcmp("mx6", soc)) {
-#ifdef CONFIG_MACH_TYPE
-   if (it == 'y' || it == 'Y')
+#ifdef CONFIG_TARGET_APALIS_IMX6
+   if (it == 'y' || it == 'Y') {
if (is_cpu_type(MXC_CPU_MX6Q))
tdx_hw_tag.prodid = APALIS_IMX6Q_IT;
else
tdx_hw_tag.prodid = APALIS_IMX6D_IT;
-   else
+   } else {
if (is_cpu_type(MXC_CPU_MX6Q))
tdx_hw_tag.prodid = APALIS_IMX6Q;
else
tdx_hw_tag.prodid = APALIS_IMX6D;
-#else
-   char wb = 'n';
-
+   }
+#elif CONFIG_TARGET_COLIBRI_IMX6
if (it == 'y' || it == 'Y') {
-   if (is_cpu_type(MXC_CPU_MX6DL)) {
+   if (is_cpu_type(MXC_CPU_MX6DL))
tdx_hw_tag.prodid = COLIBRI_IMX6DL_IT;
-   } else if (is_cpu_type(MXC_CPU_MX6SOLO)) {
+   else if (is_cpu_type(MXC_CPU_MX6SOLO))
tdx_hw_tag.prodid = COLIBRI_IMX6S_IT;
-   } else {
-   sprintf(message, "Does the module have WiFi /" \
-" Bluetooth? [y/N] ");
-   len = cli_readline(message);
-   wb = console_buffer[0];
-   if (wb == 'y' || wb == 'Y')
-   tdx_hw_tag.prodid =
-   COLIBRI_IMX6ULL_WIFI_BT_IT;
-   else
-   tdx_hw_tag.prodid = COLIBRI_IMX6ULL_IT;
-   }
} else {
-   if (is_cpu_type(MXC_CPU_MX6DL)) {
+   if (is_cpu_type(MXC_CPU_MX6DL))
tdx_hw_tag.prodid = COLIBRI_IMX6DL;
-   } else if (is_cpu_type(MXC_CPU_MX6SOLO)) {
+   else if (is_cpu_type(MXC_CPU_MX6SOLO))
tdx_hw_tag.prodid = COLIBRI_IMX6S;
-   } else {
-   sprintf(message, "Does the module have WiFi /" \
-" Bluetooth? [y/N] ");
-   len = cli_readline(message);
-   wb = console_buffer[0];
-   if (wb == 'y' || wb == 'Y')
-   tdx_hw_tag.prodid =
-   COLIBRI_IMX6ULL_WIFI_BT;
-   else
-   tdx_hw_tag.prodid = COLIBRI_IMX6ULL;
-   }
}
-#endif /* CONFIG_MACH_TYPE */
+#elif CONFIG_TARGET_COLIBRI_IMX6ULL
+   char wb = 'n';
+
+   sprintf(message, "Does the module have Wi-Fi / Bluetooth? " \
+"[y/N] ");
+   len = cli_readline(message);
+   wb = console_buffer[0];
+   if (it == 'y' || it == 'Y') {
+   if (wb == 'y' || wb == 'Y')
+   tdx_hw_tag.prodid = COLIBRI_IMX6ULL_WIFI_BT_IT;
+   else
+   tdx_hw_tag.prodid = COLIBRI_IMX6ULL_IT;
+   } else {
+   if (wb == 'y' || wb == 'Y')
+   tdx_hw_tag.prodid = COLIBRI_IMX6ULL_WIFI_BT;
+   else
+   tdx_hw_tag.prodid = COLIBRI_IMX6ULL;
+   }
+#endif
} else if (!strcmp("imx7d", soc))
tdx_hw_tag.prodid = COLIBRI_IMX7D;
else if (!strcmp("imx7s", soc))

[U-Boot] [PATCH v3 06/14] board: imx6ull: Add disable PMIC_STBY_REQ

2019-04-17 Thread Marcel Ziswiler
From: Philippe Schenker 

Disable output driver of PAD CCM_PMIC_STBY_REQ. This prevents the
SOC to request for a lower voltage during sleep. This is necessary
because the voltage is changing too slow for the SOC to wake up
properly.

Signed-off-by: Philippe Schenker 
Acked-by: Marcel Ziswiler 
Reviewed-by: Igor Opaniuk 

---

Changes in v3: None
Changes in v2:
- Added Igor's reviewed-by.

 board/toradex/colibri-imx6ull/colibri-imx6ull.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/board/toradex/colibri-imx6ull/colibri-imx6ull.c 
b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
index b6f45edb86..f1d5cc6655 100644
--- a/board/toradex/colibri-imx6ull/colibri-imx6ull.c
+++ b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
@@ -50,6 +50,8 @@ DECLARE_GLOBAL_DATA_PTR;
 #define LCD_PAD_CTRL(PAD_CTL_HYS | PAD_CTL_PUS_100K_UP | \
PAD_CTL_DSE_48ohm)
 
+#define MX6_PAD_SNVS_PMIC_STBY_REQ_ADDR 0x2290040
+
 #define NAND_PAD_CTRL (PAD_CTL_DSE_48ohm | PAD_CTL_SRE_SLOW | PAD_CTL_HYS)
 
 #define NAND_PAD_READY0_CTRL (PAD_CTL_DSE_48ohm | PAD_CTL_PUS_22K_UP)
@@ -331,6 +333,14 @@ int board_late_init(void)
env_set("variant", "-wifi");
 #endif
 
+   /*
+* Disable output driver of PAD CCM_PMIC_STBY_REQ. This prevents the
+* SOC to request for a lower voltage during sleep. This is necessary
+* because the voltage is changing too slow for the SOC to wake up
+* properly.
+*/
+   __raw_writel(0x8080, MX6_PAD_SNVS_PMIC_STBY_REQ_ADDR);
+
 #ifdef CONFIG_CMD_BMODE
add_board_boot_modes(board_boot_modes);
 #endif
-- 
2.20.1

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


[U-Boot] [PATCH v3 03/14] colibri-imx6ull: set module variant depending on config block

2019-04-17 Thread Marcel Ziswiler
From: Stefan Agner 

Using CPU temperature grading as a discriminator if the Wi-Fi /
Bluetooth chip is populated is no longer possible due to upcoming
SKUs. Set variant to -wifi only if a valid config block is present
and the product id mentions a SKU with Wi-Fi / Bluetooth.

Signed-off-by: Stefan Agner 
Acked-by: Marcel Ziswiler 
Reviewed-by: Igor Opaniuk 

---

Changes in v3: None
Changes in v2:
- Added Igor's reviewed-by.

 board/toradex/colibri-imx6ull/colibri-imx6ull.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/board/toradex/colibri-imx6ull/colibri-imx6ull.c 
b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
index fcb49a0718..fe60b8e870 100644
--- a/board/toradex/colibri-imx6ull/colibri-imx6ull.c
+++ b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include "../common/tdx-common.h"
+#include "../common/tdx-cfg-block.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -317,10 +318,15 @@ static const struct boot_mode board_boot_modes[] = {
 
 int board_late_init(void)
 {
-   int minc, maxc;
-
-   if (get_cpu_temp_grade(, ) != TEMP_COMMERCIAL)
+#ifdef CONFIG_TDX_CFG_BLOCK
+   /*
+* If we have a valid config block and it says we are a module with
+* Wi-Fi/Bluetooth make sure we use the -wifi device tree.
+*/
+   if (tdx_hw_tag.prodid == COLIBRI_IMX6ULL_WIFI_BT_IT ||
+   tdx_hw_tag.prodid == COLIBRI_IMX6ULL_WIFI_BT)
env_set("variant", "-wifi");
+#endif
 
 #ifdef CONFIG_CMD_BMODE
add_board_boot_modes(board_boot_modes);
-- 
2.20.1

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


[U-Boot] [PATCH v3 01/14] tdx-cfg-block: add support for new colibri iMX6ull skus

2019-04-17 Thread Marcel Ziswiler
From: Gerard Salvatella 

Add support for new Colibri iMX6ULL SKUs.

While at it also checkpatch fix the whole files.

Signed-off-by: Gerard Salvatella 
Acked-by: Marcel Ziswiler 
Reviewed-by: Igor Opaniuk 

---

Changes in v3: None
Changes in v2:
- Added Igor's reviewed-by.

 board/toradex/common/tdx-cfg-block.c | 62 +---
 board/toradex/common/tdx-cfg-block.h |  3 ++
 2 files changed, 50 insertions(+), 15 deletions(-)

diff --git a/board/toradex/common/tdx-cfg-block.c 
b/board/toradex/common/tdx-cfg-block.c
index b90077bedc..3b73421243 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright (c) 2016 Toradex, Inc.
+ * Copyright (c) 2016-2019 Toradex, Inc.
  */
 
 #include 
@@ -98,6 +98,9 @@ const char * const toradex_modules[] = {
[40] = "Colibri iMX6ULL 512MB Wi-Fi / Bluetooth IT",
[41] = "Colibri iMX7 Dual 512MB EPDC",
[42] = "Apalis TK1 4GB",
+   [43] = "Colibri T20 512MB IT SETEK",
+   [44] = "Colibri iMX6ULL 512MB IT",
+   [45] = "Colibri iMX6ULL 512MB Wi-Fi / Bluetooth",
 };
 
 #ifdef CONFIG_TDX_CFG_BLOCK_IS_IN_MMC
@@ -299,22 +302,47 @@ static int get_cfgblock_interactive(void)
else
tdx_hw_tag.prodid = APALIS_IMX6D;
 #else
-   if (it == 'y' || it == 'Y')
-   if (is_cpu_type(MXC_CPU_MX6DL))
+   char wb = 'n';
+
+   if (it == 'y' || it == 'Y') {
+   if (is_cpu_type(MXC_CPU_MX6DL)) {
tdx_hw_tag.prodid = COLIBRI_IMX6DL_IT;
-   else
+   } else if (is_cpu_type(MXC_CPU_MX6SOLO)) {
tdx_hw_tag.prodid = COLIBRI_IMX6S_IT;
-   else
-   if (is_cpu_type(MXC_CPU_MX6DL))
+   } else {
+   sprintf(message, "Does the module have WiFi /" \
+" Bluetooth? [y/N] ");
+   len = cli_readline(message);
+   wb = console_buffer[0];
+   if (wb == 'y' || wb == 'Y')
+   tdx_hw_tag.prodid =
+   COLIBRI_IMX6ULL_WIFI_BT_IT;
+   else
+   tdx_hw_tag.prodid = COLIBRI_IMX6ULL_IT;
+   }
+   } else {
+   if (is_cpu_type(MXC_CPU_MX6DL)) {
tdx_hw_tag.prodid = COLIBRI_IMX6DL;
-   else
+   } else if (is_cpu_type(MXC_CPU_MX6SOLO)) {
tdx_hw_tag.prodid = COLIBRI_IMX6S;
+   } else {
+   sprintf(message, "Does the module have WiFi /" \
+" Bluetooth? [y/N] ");
+   len = cli_readline(message);
+   wb = console_buffer[0];
+   if (wb == 'y' || wb == 'Y')
+   tdx_hw_tag.prodid =
+   COLIBRI_IMX6ULL_WIFI_BT;
+   else
+   tdx_hw_tag.prodid = COLIBRI_IMX6ULL;
+   }
+   }
 #endif /* CONFIG_MACH_TYPE */
-   } else if (!strcmp("imx7d", soc)) {
+   } else if (!strcmp("imx7d", soc))
tdx_hw_tag.prodid = COLIBRI_IMX7D;
-   } else if (!strcmp("imx7s", soc)) {
+   else if (!strcmp("imx7s", soc))
tdx_hw_tag.prodid = COLIBRI_IMX7S;
-   } else if (!strcmp("tegra20", soc)) {
+   else if (!strcmp("tegra20", soc)) {
if (it == 'y' || it == 'Y')
if (gd->ram_size == 0x1000)
tdx_hw_tag.prodid = COLIBRI_T20_256MB_IT;
@@ -330,8 +358,9 @@ static int get_cfgblock_interactive(void)
tdx_hw_tag.prodid = COLIBRI_PXA270_312MHZ;
else
tdx_hw_tag.prodid = COLIBRI_PXA270_520MHZ;
+   }
 #ifdef CONFIG_MACH_TYPE
-   } else if (!strcmp("tegra30", soc)) {
+   else if (!strcmp("tegra30", soc)) {
if (CONFIG_MACH_TYPE == MACH_TYPE_APALIS_T30) {
if (it == 'y' || it == 'Y')
tdx_hw_tag.prodid = APALIS_T30_IT;
@@ -346,8 +375,9 @@ static int get_cfgblock_interactive(void)
else
tdx_hw_tag.prodid = COLIBRI_T30;
}
+   }
 #endif /* CONFIG_MACH_TYPE */
-   } else if (!strcmp("tegra124", soc)) {
+   else if (!strcmp("tegra124", soc)) {
tdx_hw_tag.prodid = APALIS_TK1_2GB;
} else 

[U-Boot] [PATCH v3] ARM: dts: i.MX6Q: fix avoid_unnecessary_addr_size warnings

2019-04-17 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Re-synced the device tree with Linux 5.0.

This fixes the following warnings:

w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
 port@2/endpoint@0:reg: property has invalid length (4 bytes)
 (#address-cells == 2, #size-cells == 1)
w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
 port@2/endpoint@1:reg: property has invalid length (4 bytes)
 (#address-cells == 2, #size-cells == 1)
w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
 port@2/endpoint@2:reg: property has invalid length (4 bytes)
 (#address-cells == 2, #size-cells == 1)
w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
 port@2/endpoint@3:reg: property has invalid length (4 bytes)
 (#address-cells == 2, #size-cells == 1)
w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
 port@2/endpoint@4:reg: property has invalid length (4 bytes)
 (#address-cells == 2, #size-cells == 1)
w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
 port@3/endpoint@1:reg: property has invalid length (4 bytes)
 (#address-cells == 2, #size-cells == 1)
w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
 port@3/endpoint@2:reg: property has invalid length (4 bytes)
 (#address-cells == 2, #size-cells == 1)
w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
 port@3/endpoint@3:reg: property has invalid length (4 bytes)
 (#address-cells == 2, #size-cells == 1)
w+arch/arm/dts/imx6-apalis.dtb: Warning (reg_format): /soc/ipu@280/
 port@3/endpoint@4:reg: property has invalid length (4 bytes)
 (#address-cells == 2, #size-cells == 1)
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@2/endpoint@0: Relying on default #address-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@2/endpoint@0: Relying on default #size-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@2/endpoint@1: Relying on default #address-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@2/endpoint@1: Relying on default #size-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@2/endpoint@2: Relying on default #address-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@2/endpoint@2: Relying on default #size-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@2/endpoint@3: Relying on default #address-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@2/endpoint@3: Relying on default #size-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@2/endpoint@4: Relying on default #address-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@2/endpoint@4: Relying on default #size-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@3/endpoint@1: Relying on default #address-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@3/endpoint@1: Relying on default #size-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@3/endpoint@2: Relying on default #address-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@3/endpoint@2: Relying on default #size-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@3/endpoint@3: Relying on default #address-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@3/endpoint@3: Relying on default #size-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@3/endpoint@4: Relying on default #address-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_default_addr_size):
 /soc/ipu@280/port@3/endpoint@4: Relying on default #size-cells
 value
w+arch/arm/dts/imx6-apalis.dtb: Warning (avoid_unnecessary_addr_size):
 Failed prerequisite 'avoid_default_addr_size'

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Fabio Estevam 
Reviewed-by: Lukasz Majewski 

---

Changes in v3:
- Added Fabio and Lukasz' reviewed-by tags.

Changes in v2:
- Re-synced the device tree with Linux 5.0 as suggested by Fabio.

 arch/arm/dts/imx6q.dtsi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/dts/imx6q.dtsi b/arch/arm/dts/imx6q.dtsi
index ab1716b6b0..d038f41170 100644
--- a/arch/arm/dts/imx6q.dtsi
+++ b/arch/arm/dts/imx6q.dtsi
@@ -202,6 +202,7 @@
 < IMX6QDL_CLK_GPU2D_CORE>;
clock-names = "bus", "core";

[U-Boot] [PATCH v3] apalis_imx6: add device tree to makefile

2019-04-17 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Add device tree to Makefile to avoid newly introduced error:

Device Tree Source is not correctly specified.
Please define 'CONFIG_DEFAULT_DEVICE_TREE'
or build with 'DEVICE_TREE=' argument

make[1]: *** [dts/Makefile:28: arch/arm/dts/imx6-apalis.dtb] Error 1
make: *** [Makefile:1009: dts/dt.dtb] Error 2

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Igor Opaniuk 

---

Changes in v3:
- Added Igor's reviewed-by tag.

Changes in v2:
- Drop adding the colibri-imx6 device tree as Stefano already pulled v1
  75992d0e7dfc ("apalis/colibri_imx6: add device trees to makefile") but
  somehow dropped adding the apalis-imx6 one as well.

 arch/arm/dts/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 92074cd8da..13d1d67624 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -548,6 +548,7 @@ dtb-$(CONFIG_MX6ULL) += \
imx6ull-colibri.dtb \
 
 dtb-$(CONFIG_ARCH_MX6) += \
+   imx6-apalis.dtb \
imx6-colibri.dtb
 
 dtb-$(CONFIG_MX7) += imx7d-sdb.dtb \
-- 
2.20.1

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


[U-Boot] [RFC PATCH v3] usb: limit USB_MAX_XFER_BLK to 256

2019-04-17 Thread Marcel Ziswiler
From: Peng Fan 

For Some USB mass storage devices, such as:
"
 - Kingston DataTraveler 2.0 001D7D06CF09B04199C7B3EA
 - Class: (from Interface) Mass Storage
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x0930  Product 0x6545 Version 1.16
"
When `usb read 0x8000 0 0x2000`, we met
"EHCI timed out on TD - token=0x80008d80".

The devices does not support scsi VPD page, we are not able
to get the maximum transfer length for READ(10)/WRITE(10).

So we limit this to 256 blocks as READ(6).

Signed-off-by: Peng Fan 
Acked-by: Marcel Ziswiler 
(cherry picked from commit df0052575b2bc9d66ae73584768e1a457ed5d914)

Signed-off-by: Marcel Ziswiler 

---
This comes from NXP's downstream and has proven to tremendously improve
the situation with those odd USB mass storage aka memory sticks. This is
why I post it here asking whether or not this may be something
benefiting more people. Any feedback and suggestions are welcome.

Changes in v3:
- Drop the reference to the NXP internal MLK-xxx tracking number as
  suggested by Peng.

Changes in v2:
- Fixed spelling in comment as suggested by Igor.

 common/usb_storage.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/common/usb_storage.c b/common/usb_storage.c
index 8c889bb1a6..4e284645f5 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -949,7 +949,11 @@ static void usb_stor_set_max_xfer_blk(struct usb_device 
*udev,
 * there is enough free heap space left, but the SCSI READ(10) and
 * WRITE(10) commands are limited to 65535 blocks.
 */
-   blk = USHRT_MAX;
+   /*
+* Some USB mass storage devices have issues, limiting this to 256
+* fixes this.
+*/
+   blk = 256;
 #else
blk = 20;
 #endif
-- 
2.20.1

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


[U-Boot] [PATCH] imx: Add variscite DART-6UL Evaluation Kit

2019-04-17 Thread Parthiban Nallathambi
Port for the DART-6UL Evaluation Kit SBC. Based on the variscite
DART-6UL iMX6ULL SoM.

CPU:   Freescale i.MX6ULL rev1.1 900 MHz (running at 396 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 43C
Reset cause: POR
Model: Variscite DART-6UL Evaluation Kit
Board: Variscite DART-6UL Evaluation Kit
DRAM:  512 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
In:serial@0202
Out:   serial@0202
Err:   serial@0202
Net:   FEC0

Working:
 - Eth0
 - i2c
 - MMC/SD
 - eMMC
 - USB host
 - UART 1

Note: LCDIF porting needs DM_VIDEO
https://lists.denx.de/pipermail/u-boot/2019-April/365506.html

Signed-off-by: Parthiban Nallathambi 
---
 arch/arm/Kconfig |   1 +
 arch/arm/dts/Makefile|   1 +
 arch/arm/dts/imx6ull-dart-6ul.dts|  39 
 arch/arm/dts/imx6ull-dart-6ul.dtsi   | 261 +++
 arch/arm/mach-imx/mx6/Kconfig|  12 ++
 board/variscite/dart_6ul/Kconfig |  12 ++
 board/variscite/dart_6ul/MAINTAINERS |   8 +
 board/variscite/dart_6ul/Makefile|   4 +
 board/variscite/dart_6ul/README  |  41 +
 board/variscite/dart_6ul/dart_6ul.c  | 228 +++
 board/variscite/dart_6ul/spl.c   | 215 ++
 configs/variscite_dart6ul_defconfig  |  55 ++
 include/configs/dart_6ul.h   | 131 ++
 13 files changed, 1008 insertions(+)
 create mode 100644 arch/arm/dts/imx6ull-dart-6ul.dts
 create mode 100644 arch/arm/dts/imx6ull-dart-6ul.dtsi
 create mode 100644 board/variscite/dart_6ul/Kconfig
 create mode 100644 board/variscite/dart_6ul/MAINTAINERS
 create mode 100644 board/variscite/dart_6ul/Makefile
 create mode 100644 board/variscite/dart_6ul/README
 create mode 100644 board/variscite/dart_6ul/dart_6ul.c
 create mode 100644 board/variscite/dart_6ul/spl.c
 create mode 100644 configs/variscite_dart6ul_defconfig
 create mode 100644 include/configs/dart_6ul.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 4640f3b3bd..c20866c86a 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1635,6 +1635,7 @@ source "board/tcl/sl50/Kconfig"
 source "board/ucRobotics/bubblegum_96/Kconfig"
 source "board/birdland/bav335x/Kconfig"
 source "board/toradex/colibri_pxa270/Kconfig"
+source "board/variscite/dart_6ul/Kconfig"
 source "board/vscom/baltos/Kconfig"
 source "board/woodburn/Kconfig"
 source "board/xilinx/Kconfig"
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 0aee8dfde0..6fb545dc9f 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -549,6 +549,7 @@ dtb-$(CONFIG_MX6UL) += \
 dtb-$(CONFIG_MX6ULL) += \
imx6ull-14x14-evk.dtb \
imx6ull-colibri.dtb \
+   imx6ull-dart-6ul.dtb
 
 dtb-$(CONFIG_ARCH_MX6) += \
imx6-colibri.dtb
diff --git a/arch/arm/dts/imx6ull-dart-6ul.dts 
b/arch/arm/dts/imx6ull-dart-6ul.dts
new file mode 100644
index 00..4cab1a048b
--- /dev/null
+++ b/arch/arm/dts/imx6ull-dart-6ul.dts
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Parthiban Nallathambi 
+ */
+
+/dts-v1/;
+
+#include "imx6ull.dtsi"
+#include "imx6ull-dart-6ul.dtsi"
+
+/ {
+   model = "Variscite DART-6UL Evaluation Kit";
+   compatible = "variscite,imx6ull-dart-6ul", "fsl,imx6ull";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_usb_otg1_id>;
+   dr_mode = "otg";
+   srp-disable;
+   hnp-disable;
+   adp-disable;
+   status = "okay";
+};
+
+ {
+   pinctrl-names = "default";
+
+   pinctrl_usb_otg1_id: usbotg1idgrp {
+   fsl,pins = <
+   MX6UL_PAD_GPIO1_IO00__ANATOP_OTG1_ID0x17059
+   >;
+   };
+
+};
diff --git a/arch/arm/dts/imx6ull-dart-6ul.dtsi 
b/arch/arm/dts/imx6ull-dart-6ul.dtsi
new file mode 100644
index 00..e96669f493
--- /dev/null
+++ b/arch/arm/dts/imx6ull-dart-6ul.dtsi
@@ -0,0 +1,261 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Parthiban Nallathambi 
+ */
+
+/ {
+   model = "Variscite DART-6UL i.MX6 Ultra Low Lite SOM";
+   compatible = "variscite,imx6ull-dart-6ul", "fsl,imx6ull";
+
+   memory {
+   reg = <0x8000 0x2000>;
+   };
+
+   chosen {
+   stdout-path = 
+   };
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_enet1>;
+   phy-mode = "rmii";
+   phy-handle = <>;
+   status = "okay";
+
+   mdio1: mdio1 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   ethphy0: ethernet-phy@1 {
+   reg = <1>;
+   micrel,led-mode = <1>;
+   };
+   };
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_enet2>;
+   phy-mode = "rmii";
+   phy-handle = <>;
+   status = "okay";
+
+   mdio2: mdio2 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   ethphy1: ethernet-phy@2 {
+   

Re: [U-Boot] [PATCH] MSCC: delete obsolete reference to MSCC_BITBANG_SPI_GPIO

2019-04-17 Thread Daniel Schwierzeck


Am 17.04.19 um 22:13 schrieb Robert P. J. Day:
> 
> Remove "select MSCC_BITBANG_SPI_GPIO" since Kbuild option was deleted
> back in commit ace9c103df2875d2b435dbd7b36618020edfd1c0:
> 
>   commit ace9c103df2875d2b435dbd7b36618020edfd1c0
>   Author: Lars Povlsen 
>   Date:   Tue Jan 8 10:38:35 2019 +0100
> 
> mips: gpio: mscc: Obsoleted gpio-mscc-bitbang-spi.c
> 
> ---
> 
>   not sure if someone already handled this.
> 

applied to u-boot-mips, thanks.

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


Re: [U-Boot] [PATCH v2 0/2] Fix minor issues with Serval SoC.

2019-04-17 Thread Daniel Schwierzeck


Am 15.04.19 um 11:56 schrieb Horatiu Vultur:
> This patch series fix different issues with Serval.
>  - first patch fix resets when DDR training fails.
>  - second patch fix the detection of the board.
> 
> This patch series is based on u-boot-mips/next.
> 
> v2-changes:
>  - Update reset based on Daniel's comments
> 
> Horatiu Vultur (2):
>   mips: mscc: serval: Fix reset
>   board: mscc: serval: Fix board detect
> 
>  arch/mips/mach-mscc/include/mach/ddr.h | 55 
> ++
>  arch/mips/mach-mscc/reset.c|  2 +-
>  board/mscc/serval/serval.c |  2 +-
>  3 files changed, 32 insertions(+), 27 deletions(-)
> 

series applied to u-boot-mips, thanks.

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


Re: [U-Boot] [PATCH 0/4] Add network support for Serval SoCs.

2019-04-17 Thread Daniel Schwierzeck


Am 11.04.19 um 14:11 schrieb Horatiu Vultur:
> This patch series add network support for Serval SoCs family.
> There are the following pcb: Serval-nid(pcb106), Serval-ref
> (pcb105).
> 
> Horatiu Vultur (4):
>   net: Add MSCC Serval network driver.
>   board: mscc: serval: Update MSCC Serval boards
>   net: mscc: serval: Add ethernet nodes for Serval
>   configs: mscc_serval: Add network support
> 
>  arch/mips/dts/mscc,serval.dtsi   |  58 +++
>  arch/mips/dts/serval_pcb105.dts  |  44 ++
>  arch/mips/dts/serval_pcb106.dts  |  44 ++
>  board/mscc/serval/serval.c   |  12 +
>  configs/mscc_serval_defconfig|   6 +-
>  drivers/net/mscc_eswitch/Kconfig |   7 +
>  drivers/net/mscc_eswitch/Makefile|   1 +
>  drivers/net/mscc_eswitch/serval_switch.c | 703 
> +++
>  include/dt-bindings/mscc/serval_data.h   |  19 +
>  9 files changed, 893 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/net/mscc_eswitch/serval_switch.c
>  create mode 100644 include/dt-bindings/mscc/serval_data.h
> 

series applied to u-boot-mips, thanks.

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


[U-Boot] [PATCH 3/4] ARM: socfpga: Fully unmap the FPGA bridges from L3 space

2019-04-17 Thread Marek Vasut
Instead of just putting the bridges into reset, fully remove the bridges
from the L3 main bridge space when disabling them by clearing bits in
NIC-301 remap register. Moreover, only touch the 3 LSbits in brgmodrst
register as the rest of the bits are undefined.

Signed-off-by: Marek Vasut 
Cc: Chin Liang See 
Cc: Dinh Nguyen 
Cc: Simon Goldschmidt 
Cc: Tien Fong Chee 
---
 arch/arm/mach-socfpga/reset_manager_gen5.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-socfpga/reset_manager_gen5.c 
b/arch/arm/mach-socfpga/reset_manager_gen5.c
index 66af924485..89a384b59c 100644
--- a/arch/arm/mach-socfpga/reset_manager_gen5.c
+++ b/arch/arm/mach-socfpga/reset_manager_gen5.c
@@ -103,7 +103,8 @@ void socfpga_bridges_reset(int enable)
 
if (enable) {
/* brdmodrst */
-   writel(0x, _manager_base->brg_mod_reset);
+   writel(0x7, _manager_base->brg_mod_reset);
+   writel(L3REGS_REMAP_OCRAM_MASK, SOCFPGA_L3REGS_ADDRESS);
} else {
socfpga_bridges_set_handoff_regs(false, false, false);
 
-- 
2.20.1

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


[U-Boot] [PATCH 2/4] ARM: socfpga: Disable bridges in SPL unless booting from FPGA

2019-04-17 Thread Marek Vasut
Disable bridges between L3 Main switch and FPGA unless booting
from FPGA and keep them disabled to prevent glitches and possible
hangs of the L3 Main switch.

The current version of the code could have enabled the bridges
between the L3 Main switch and FPGA for a short period of time
in board_init_f() in case the FPGA was programmed and then again
disable them at the end of board_init_f(). Replace this with a
code which only sets up the handoff registers and let the user
enable the bridges later on.

Signed-off-by: Marek Vasut 
Cc: Chin Liang See 
Cc: Dinh Nguyen 
Cc: Simon Goldschmidt 
Cc: Tien Fong Chee 
---
 arch/arm/mach-socfpga/spl_gen5.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/arm/mach-socfpga/spl_gen5.c b/arch/arm/mach-socfpga/spl_gen5.c
index 45382b549a..aa88f2cf3e 100644
--- a/arch/arm/mach-socfpga/spl_gen5.c
+++ b/arch/arm/mach-socfpga/spl_gen5.c
@@ -188,7 +188,7 @@ void board_init_f(ulong dummy)
 
/* De-assert reset for peripherals and bridges based on handoff */
reset_deassert_peripherals_handoff();
-   socfpga_bridges_reset(0);
+   socfpga_bridges_set_handoff_regs(true, true, true);
 
debug("Unfreezing/Thaw all I/O banks\n");
/* unfreeze / thaw all IO banks */
@@ -228,7 +228,4 @@ void board_init_f(ulong dummy)
puts("SDRAM size check failed!\n");
hang();
}
-
-   if (!socfpga_is_booting_from_fpga())
-   socfpga_bridges_reset(1);
 }
-- 
2.20.1

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


[U-Boot] [PATCH 4/4] ARM: socfpga: Add support for selecting bridges in bridge command

2019-04-17 Thread Marek Vasut
Add optional "mask" argument to the SoCFPGA bridge command, to select
which bridges should be enabled/disabled. This allows the user to avoid
enabling bridges which are not connected into the FPGA fabric. Default
behavior is to enable/disable all bridges.

Signed-off-by: Marek Vasut 
Cc: Chin Liang See 
Cc: Dinh Nguyen 
Cc: Simon Goldschmidt 
Cc: Tien Fong Chee 
---
 arch/arm/mach-socfpga/include/mach/misc.h |  2 +-
 arch/arm/mach-socfpga/misc.c  | 17 +++--
 arch/arm/mach-socfpga/misc_arria10.c  |  2 +-
 arch/arm/mach-socfpga/misc_gen5.c | 12 +++-
 arch/arm/mach-socfpga/misc_s10.c  |  2 +-
 5 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-socfpga/include/mach/misc.h 
b/arch/arm/mach-socfpga/include/mach/misc.h
index 86d5d2b62b..c3ca8cdf3b 100644
--- a/arch/arm/mach-socfpga/include/mach/misc.h
+++ b/arch/arm/mach-socfpga/include/mach/misc.h
@@ -39,6 +39,6 @@ void socfpga_init_security_policies(void);
 void socfpga_sdram_remap_zero(void);
 #endif
 
-void do_bridge_reset(int enable);
+void do_bridge_reset(int enable, unsigned int mask);
 
 #endif /* _MISC_H_ */
diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
index ec8339e045..e1ea8eb73e 100644
--- a/arch/arm/mach-socfpga/misc.c
+++ b/arch/arm/mach-socfpga/misc.c
@@ -126,17 +126,22 @@ int arch_cpu_init(void)
 #ifndef CONFIG_SPL_BUILD
 static int do_bridge(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-   if (argc != 2)
+   unsigned int mask = ~0;
+
+   if (argc < 2 || argc > 3)
return CMD_RET_USAGE;
 
argv++;
 
+   if (argc == 3)
+   mask = simple_strtoul(argv[1], NULL, 16);
+
switch (*argv[0]) {
case 'e':   /* Enable */
-   do_bridge_reset(1);
+   do_bridge_reset(1, mask);
break;
case 'd':   /* Disable */
-   do_bridge_reset(0);
+   do_bridge_reset(0, mask);
break;
default:
return CMD_RET_USAGE;
@@ -145,10 +150,10 @@ static int do_bridge(cmd_tbl_t *cmdtp, int flag, int 
argc, char * const argv[])
return 0;
 }
 
-U_BOOT_CMD(bridge, 2, 1, do_bridge,
+U_BOOT_CMD(bridge, 3, 1, do_bridge,
   "SoCFPGA HPS FPGA bridge control",
-  "enable  - Enable HPS-to-FPGA, FPGA-to-HPS, LWHPS-to-FPGA bridges\n"
-  "bridge disable - Enable HPS-to-FPGA, FPGA-to-HPS, LWHPS-to-FPGA 
bridges\n"
+  "enable [mask] - Enable HPS-to-FPGA, FPGA-to-HPS, LWHPS-to-FPGA 
bridges\n"
+  "bridge disable [mask] - Enable HPS-to-FPGA, FPGA-to-HPS, 
LWHPS-to-FPGA bridges\n"
   ""
 );
 
diff --git a/arch/arm/mach-socfpga/misc_arria10.c 
b/arch/arm/mach-socfpga/misc_arria10.c
index 63b8c75d31..2e2a40b65d 100644
--- a/arch/arm/mach-socfpga/misc_arria10.c
+++ b/arch/arm/mach-socfpga/misc_arria10.c
@@ -115,7 +115,7 @@ int print_cpuinfo(void)
 }
 #endif
 
-void do_bridge_reset(int enable)
+void do_bridge_reset(int enable, unsigned int mask)
 {
if (enable)
socfpga_reset_deassert_bridges_handoff();
diff --git a/arch/arm/mach-socfpga/misc_gen5.c 
b/arch/arm/mach-socfpga/misc_gen5.c
index 6e11ba6cb2..7876953595 100644
--- a/arch/arm/mach-socfpga/misc_gen5.c
+++ b/arch/arm/mach-socfpga/misc_gen5.c
@@ -249,9 +249,19 @@ static void socfpga_sdram_apply_static_cfg(void)
: : "r"(val), "r"(_ctrl->static_cfg) : "memory", "cc");
 }
 
-void do_bridge_reset(int enable)
+void do_bridge_reset(int enable, unsigned int mask)
 {
+   int i;
+
if (enable) {
+   socfpga_bridges_set_handoff_regs(!(mask & BIT(0)),
+!(mask & BIT(1)),
+!(mask & BIT(2)));
+   for (i = 0; i < 2; i++) {   /* Reload SW setting cache */
+   iswgrp_handoff[i] =
+   readl(_regs->iswgrp_handoff[i]);
+   }
+
writel(iswgrp_handoff[2], _regs->fpgaintfgrp_module);
socfpga_sdram_apply_static_cfg();
writel(iswgrp_handoff[3], _ctrl->fpgaport_rst);
diff --git a/arch/arm/mach-socfpga/misc_s10.c b/arch/arm/mach-socfpga/misc_s10.c
index 113eace650..60c96090ce 100644
--- a/arch/arm/mach-socfpga/misc_s10.c
+++ b/arch/arm/mach-socfpga/misc_s10.c
@@ -150,7 +150,7 @@ int arch_early_init_r(void)
return 0;
 }
 
-void do_bridge_reset(int enable)
+void do_bridge_reset(int enable, unsigned int mask)
 {
socfpga_bridges_reset(enable);
 }
-- 
2.20.1

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


[U-Boot] [PATCH 1/4] ARM: socfpga: Factor out handoff register configuration

2019-04-17 Thread Marek Vasut
Factor out the code for programming preloader handoff register values,
the ISWGRP Handoff 0 and 1. These registers later control which bridges
are enabled by the "bridge" command on Gen5 devices.

Signed-off-by: Marek Vasut 
Cc: Chin Liang See 
Cc: Dinh Nguyen 
Cc: Simon Goldschmidt 
Cc: Tien Fong Chee 
---
 .../include/mach/reset_manager_gen5.h |  1 +
 arch/arm/mach-socfpga/reset_manager_gen5.c| 25 +--
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-socfpga/include/mach/reset_manager_gen5.h 
b/arch/arm/mach-socfpga/include/mach/reset_manager_gen5.h
index dd58922cec..5e490d182e 100644
--- a/arch/arm/mach-socfpga/include/mach/reset_manager_gen5.h
+++ b/arch/arm/mach-socfpga/include/mach/reset_manager_gen5.h
@@ -9,6 +9,7 @@
 #include 
 
 void reset_deassert_peripherals_handoff(void);
+void socfpga_bridges_set_handoff_regs(bool h2f, bool lwh2f, bool f2h);
 void socfpga_bridges_reset(int enable);
 
 struct socfpga_reset_manager {
diff --git a/arch/arm/mach-socfpga/reset_manager_gen5.c 
b/arch/arm/mach-socfpga/reset_manager_gen5.c
index 25baef79bc..66af924485 100644
--- a/arch/arm/mach-socfpga/reset_manager_gen5.c
+++ b/arch/arm/mach-socfpga/reset_manager_gen5.c
@@ -73,6 +73,28 @@ void reset_deassert_peripherals_handoff(void)
 #define L3REGS_REMAP_HPS2FPGA_MASK 0x08
 #define L3REGS_REMAP_OCRAM_MASK0x01
 
+void socfpga_bridges_set_handoff_regs(bool h2f, bool lwh2f, bool f2h)
+{
+   u32 brgmask = 0x0;
+   u32 l3rmask = L3REGS_REMAP_OCRAM_MASK;
+
+   if (h2f)
+   brgmask |= BIT(0);
+   else
+   l3rmask |= L3REGS_REMAP_HPS2FPGA_MASK;
+
+   if (lwh2f)
+   brgmask |= BIT(1);
+   else
+   l3rmask |= L3REGS_REMAP_LWHPS2FPGA_MASK;
+
+   if (f2h)
+   brgmask |= BIT(2);
+
+   writel(brgmask, _regs->iswgrp_handoff[0]);
+   writel(l3rmask, _regs->iswgrp_handoff[1]);
+}
+
 void socfpga_bridges_reset(int enable)
 {
const u32 l3mask = L3REGS_REMAP_LWHPS2FPGA_MASK |
@@ -83,8 +105,7 @@ void socfpga_bridges_reset(int enable)
/* brdmodrst */
writel(0x, _manager_base->brg_mod_reset);
} else {
-   writel(0, _regs->iswgrp_handoff[0]);
-   writel(l3mask, _regs->iswgrp_handoff[1]);
+   socfpga_bridges_set_handoff_regs(false, false, false);
 
/* Check signal from FPGA. */
if (!fpgamgr_test_fpga_ready()) {
-- 
2.20.1

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


[U-Boot] [PATCH] MSCC: delete obsolete reference to MSCC_BITBANG_SPI_GPIO

2019-04-17 Thread Robert P. J. Day

Remove "select MSCC_BITBANG_SPI_GPIO" since Kbuild option was deleted
back in commit ace9c103df2875d2b435dbd7b36618020edfd1c0:

  commit ace9c103df2875d2b435dbd7b36618020edfd1c0
  Author: Lars Povlsen 
  Date:   Tue Jan 8 10:38:35 2019 +0100

mips: gpio: mscc: Obsoleted gpio-mscc-bitbang-spi.c

---

  not sure if someone already handled this.

diff --git a/arch/mips/mach-mscc/Kconfig b/arch/mips/mach-mscc/Kconfig
index 34584a1909..affc4721f8 100644
--- a/arch/mips/mach-mscc/Kconfig
+++ b/arch/mips/mach-mscc/Kconfig
@@ -29,7 +29,6 @@ config SOC_OCELOT
 config SOC_LUTON
bool "Luton SOC Family"
select SOC_VCOREIII
-   select MSCC_BITBANG_SPI_GPIO
help
  This supports MSCC Luton family of SOCs.


-- 


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

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

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


Re: [U-Boot] [PATCH] usb: dwc2: fix gadget disconnect

2019-04-17 Thread Marek Vasut
On 4/17/19 4:46 PM, Fabrice Gasnier wrote:
> This fixes a disconnect issue detected with fastboot command, when using
> dwc2 driver.
> - On u-boot side:
> uboot>$ fastboot 0
> - On USB host PC side, few seconds after
> PC>$ fastboot reboot # Get stuck, uboot target never reboots
> 
> By enabling DEBUG_ISR logs, the bus suspend interrupt is seen before the
> PC command has been issued. When the USB bus suspend occurs, there's a HACK
> that disables the fastboot (composite driver). Here is the call stack
> upon USB bus suspend:
> - dwc2_handle_usb_suspend_intr()
>   - dev->driver->disconnect()
> - composite_disconnect()
>   - reset_config()
> - f->disable()
>   - fastboot_disable()
> - usb_ep_disable(f_fb->out_ep);
> - usb_ep_disable(f_fb->in_ep);
> .. other disable calls.
> 
> When the resume interrupt happens, everything has been disabled, then
> nothing happens. fastboot command gets stuck on HOST side.
> 
> Remove original HACK, that disconnects the composite driver upon
> USB bus suspend. Implement disconnect detection instead:
> - check GINTSTS OTG interrupt
> - read GOTGINT register
> - check GOTGINT, SesEndDet bit (e.g. session end)
> This is inspired by what is implemented currently in Linux dwc2 driver.
> 
> Signed-off-by: Fabrice Gasnier 

Reviewed-by: Marek Vasut 

This is Lukasz's topic, so you need his RB too.

Thanks

> ---
> 
>  drivers/usb/gadget/dwc2_udc_otg_regs.h |  6 +-
>  drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c | 14 --
>  2 files changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/gadget/dwc2_udc_otg_regs.h 
> b/drivers/usb/gadget/dwc2_udc_otg_regs.h
> index a1829b3..b685256 100644
> --- a/drivers/usb/gadget/dwc2_udc_otg_regs.h
> +++ b/drivers/usb/gadget/dwc2_udc_otg_regs.h
> @@ -86,6 +86,9 @@ struct dwc2_usbotg_reg {
>  #define B_SESSION_VALID  (0x1<<19)
>  #define A_SESSION_VALID  (0x1<<18)
>  
> +/* DWC2_UDC_OTG_GOTINT */
> +#define GOTGINT_SES_END_DET  (1<<2)
> +
>  /* DWC2_UDC_OTG_GAHBCFG */
>  #define PTXFE_HALF   (0<<8)
>  #define PTXFE_ZERO   (1<<8)
> @@ -118,6 +121,7 @@ struct dwc2_usbotg_reg {
>  #define INT_NP_TX_FIFO_EMPTY (0x1<<5)
>  #define INT_RX_FIFO_NOT_EMPTY(0x1<<4)
>  #define INT_SOF  (0x1<<3)
> +#define INT_OTG  (0x1<<2)
>  #define INT_DEV_MODE (0x0<<0)
>  #define INT_HOST_MODE(0x1<<1)
>  #define INT_GOUTNakEff   (0x01<<7)
> @@ -246,7 +250,7 @@ struct dwc2_usbotg_reg {
>  
>  /* Masks definitions */
>  #define GINTMSK_INIT (INT_OUT_EP | INT_IN_EP | INT_RESUME | INT_ENUMDONE\
> - | INT_RESET | INT_SUSPEND)
> + | INT_RESET | INT_SUSPEND | INT_OTG)
>  #define DOEPMSK_INIT (CTRL_OUT_EP_SETUP_PHASE_DONE | AHB_ERROR|TRANSFER_DONE)
>  #define DIEPMSK_INIT (NON_ISO_IN_EP_TIMEOUT|AHB_ERROR|TRANSFER_DONE)
>  #define GAHBCFG_INIT (PTXFE_HALF | NPTXFE_HALF | MODE_DMA | BURST_INCR4\
> diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c 
> b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
> index a75af49..7eb632d 100644
> --- a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
> +++ b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
> @@ -467,7 +467,7 @@ static void process_ep_out_intr(struct dwc2_udc *dev)
>  static int dwc2_udc_irq(int irq, void *_dev)
>  {
>   struct dwc2_udc *dev = _dev;
> - u32 intr_status;
> + u32 intr_status, gotgint;
>   u32 usb_status, gintmsk;
>   unsigned long flags = 0;
>  
> @@ -521,14 +521,24 @@ static int dwc2_udc_irq(int irq, void *_dev)
>   && dev->driver) {
>   if (dev->driver->suspend)
>   dev->driver->suspend(>gadget);
> + }
> + }
> +
> + if (intr_status & INT_OTG) {
> + gotgint = readl(>gotgint);
> + debug_cond(DEBUG_ISR,
> +"\tOTG interrupt: (GOTGINT):0x%x\n", gotgint);
>  
> - /* HACK to let gadget detect disconnected state */
> + if (gotgint & GOTGINT_SES_END_DET) {
> + debug_cond(DEBUG_ISR, "\t\tSession End Detected\n");
> + /* Let gadget detect disconnected state */
>   if (dev->driver->disconnect) {
>   spin_unlock_irqrestore(>lock, flags);
>   dev->driver->disconnect(>gadget);
>   spin_lock_irqsave(>lock, flags);
>   }
>   }
> + writel(gotgint, >gotgint);
>   }
>  
>   if (intr_status & INT_RESUME) {
> 


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


Re: [U-Boot] [PATCH] board_f: Do not mark pre-relocated fdt space as reserved

2019-04-17 Thread Simon Goldschmidt

[This is a follow-up to https://patchwork.ozlabs.org/patch/1033584/ right?]

Am 16.04.2019 um 10:43 schrieb Lokesh Vutla:

SPL while copying u-boot and dtb it does the following:
- Copy u-boot
- Copy right dtb.
- mark dtb location as reserved in dtb.


Hmm, why does it do that? Reserving space when U-Boot starts Linux 
*might* make sense, but why should SPL add this reservation when 
starting U-Boot? These steps are for U-Boot in a fit-image, right? 
Because I can't see this for U-Boot as uImage.


Am I correct that 'fdt_shrink_to_minimum()' adds this reservation? The 
name of that function doesn't suggest that to me. Would it make more 
sense to let this funtion only *change* the reservation, i.e. only add 
it if it is removed at the beginning of said function? Would that fix 
your issue?


Something like this:

diff --git a/common/fdt_support.c b/common/fdt_support.c
index ab08a0114f..4e7cf6ebe9 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -597,6 +597,7 @@ int fdt_shrink_to_minimum(void *blob, uint extrasize)
uint64_t addr, size;
int total, ret;
uint actualsize;
+   int fdt_memrsv = 0;

if (!blob)
return 0;
@@ -606,6 +607,7 @@ int fdt_shrink_to_minimum(void *blob, uint extrasize)
fdt_get_mem_rsv(blob, i, , );
if (addr == (uintptr_t)blob) {
fdt_del_mem_rsv(blob, i);
+   fdt_memrsv = 1;
break;
}
}
@@ -627,10 +629,12 @@ int fdt_shrink_to_minimum(void *blob, uint extrasize)
/* Change the fdt header to reflect the correct size */
fdt_set_totalsize(blob, actualsize);

-   /* Add the new reservation */
-   ret = fdt_add_mem_rsv(blob, map_to_sysmem(blob), actualsize);
-   if (ret < 0)
-   return ret;
+   if (fdt_memrsv) {
+   /* Add the new reservation */
+   ret = fdt_add_mem_rsv(blob, map_to_sysmem(blob), 
actualsize);

+   if (ret < 0)
+   return ret;
+   }

return actualsize;
 }




U-Boot when copying images at U-Boot prompt, is not able to copy to the
above dtb location as it sees the region as reserved. But at this stage
dtb is re located to end of DDR. And the above dtb region is not reserved
anymore. So delete this reserved region when re locating dtb.

Reported-by: Keerthy 
Signed-off-by: Lokesh Vutla 
---
  common/board_f.c | 13 +
  1 file changed, 13 insertions(+)

diff --git a/common/board_f.c b/common/board_f.c
index 149a7229e8..e4383ae3fa 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -651,10 +651,23 @@ static int init_post(void)
  static int reloc_fdt(void)
  {
  #ifndef CONFIG_OF_EMBED
+   uint64_t addr, size;
+   int i, cnt, err;
+
if (gd->flags & GD_FLG_SKIP_RELOC)
return 0;
if (gd->new_fdt) {
memcpy(gd->new_fdt, gd->fdt_blob, gd->fdt_size);
+
+   /* Deleting the previously marked FDT reserved region */
+   cnt = fdt_num_mem_rsv(gd->new_fdt);
+   for (i = 0; i < cnt ; i++) {
+   err = fdt_get_mem_rsv(gd->new_fdt, i, , );
+   if (!err && addr == (uintptr_t)gd->fdt_blob) {
+   fdt_del_mem_rsv(gd->new_fdt, i);
+   break;
+   }
+   }


That code should work, but it's a bit unexpected in this location


gd->fdt_blob = gd->new_fdt;
}
  #endif



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


[U-Boot] [PATCH] ARM: da850evm: Fix TI boot scripts for MMC

2019-04-17 Thread Adam Ford
The da850evm include environment/ti/mmc.h and places
DEFAULT_MMC_TI_ARGS, defined int that file, in
CONFIG_EXTRA_ENV_SETTINGS.  This has been broken for some time
since neither CMD_PART nor CMD_UUID are available, so manually
changing the environmental variables was always required before
booting from MMC. With this patch, these scripts should work
again, and by default they point to mmc 0, partition 2, and
the dtb file exists in a /boot directory on partition 2.

Signed-off-by: Adam Ford 

diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig
index 745ae2b4b1..ee39b0b1bc 100644
--- a/configs/da850evm_defconfig
+++ b/configs/da850evm_defconfig
@@ -9,9 +9,9 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x800
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SYS_EXTRA_OPTIONS="MAC_ADDR_IN_SPIFLASH"
 CONFIG_BOOTDELAY=3
 CONFIG_DEFAULT_FDT_FILE="da850-evm.dtb"
@@ -30,11 +30,10 @@ CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_DM=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_GPT is not set
-# CONFIG_CMD_PART is not set
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_TIME is not set
 # CONFIG_CMD_EXT4 is not set
-# CONFIG_CMD_FS_GENERIC is not set
+CONFIG_CMD_FS_UUID=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nor0=spi0.0"
 
CONFIG_MTDPARTS_DEFAULT="mtdparts=spi0.0:512k(u-boot.ais),64k(u-boot-env),7552k(kernel-spare),64k(MAC-Address)"
-- 
2.17.1

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


[U-Boot] [PATCH] riscv:Add Microchip MPFS Icicle Board support

2019-04-17 Thread Padmarao Begari
This patch adds Microchip MPFS Icicle Board support.
For now, NS16550 serial driver is only enabled.
The Microchip MPFS Icicle defconfig by default builds
U-Boot for M-Mode with SMP support.

Signed-off-by: Padmarao Begari 
---
 arch/riscv/Kconfig|  4 ++
 board/microchip/mpfs-icicle/Kconfig   | 20 ++
 board/microchip/mpfs-icicle/MAINTAINERS   |  7 
 board/microchip/mpfs-icicle/Makefile  |  7 
 board/microchip/mpfs-icicle/mpfs-icicle.c | 31 +++
 configs/microchip-mpfs-icicle_defconfig   | 16 
 include/configs/microchip-mpfs-icicle.h   | 63 +++
 7 files changed, 148 insertions(+)
 create mode 100644 board/microchip/mpfs-icicle/Kconfig
 create mode 100644 board/microchip/mpfs-icicle/MAINTAINERS
 create mode 100644 board/microchip/mpfs-icicle/Makefile
 create mode 100644 board/microchip/mpfs-icicle/mpfs-icicle.c
 create mode 100644 configs/microchip-mpfs-icicle_defconfig
 create mode 100644 include/configs/microchip-mpfs-icicle.h

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index ae8ff7b..df9b2ea 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -17,12 +17,16 @@ config TARGET_QEMU_VIRT
 config TARGET_SIFIVE_FU540
bool "Support SiFive FU540 Board"
 
+config TARGET_MICROCHIP_MPFS
+   bool "Support Microchip PolarFire-SoC Icicle Board"
+
 endchoice
 
 # board-specific options below
 source "board/AndesTech/ax25-ae350/Kconfig"
 source "board/emulation/qemu-riscv/Kconfig"
 source "board/sifive/fu540/Kconfig"
+source "board/microchip/mpfs-icicle/Kconfig"
 
 # platform-specific options below
 source "arch/riscv/cpu/ax25/Kconfig"
diff --git a/board/microchip/mpfs-icicle/Kconfig 
b/board/microchip/mpfs-icicle/Kconfig
new file mode 100644
index 000..e17ba78
--- /dev/null
+++ b/board/microchip/mpfs-icicle/Kconfig
@@ -0,0 +1,20 @@
+if TARGET_MICROCHIP_MPFS
+
+config SYS_BOARD
+   default "mpfs-icicle"
+
+config SYS_VENDOR
+   default "microchip"
+
+config SYS_CPU
+   default "generic"
+
+config SYS_CONFIG_NAME
+   default "microchip-mpfs-icicle"
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+   def_bool y
+   select GENERIC_RISCV
+   imply SMP
+
+endif
diff --git a/board/microchip/mpfs-icicle/MAINTAINERS 
b/board/microchip/mpfs-icicle/MAINTAINERS
new file mode 100644
index 000..9987efe
--- /dev/null
+++ b/board/microchip/mpfs-icicle/MAINTAINERS
@@ -0,0 +1,7 @@
+Microchip MPFS icicle
+M: Padmarao Begari 
+M: Cyril Jean 
+S: Maintained
+F: board/microchip/mpfs-icicle/
+F: include/configs/microchip-mpfs-icicle.h
+F: configs/microchip-mpfs-icicle_defconfig
diff --git a/board/microchip/mpfs-icicle/Makefile 
b/board/microchip/mpfs-icicle/Makefile
new file mode 100644
index 000..4706586
--- /dev/null
+++ b/board/microchip/mpfs-icicle/Makefile
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2019 Microchip Technology Inc.
+# Padmarao Begari 
+#
+
+obj-y  += mpfs-icicle.o
diff --git a/board/microchip/mpfs-icicle/mpfs-icicle.c 
b/board/microchip/mpfs-icicle/mpfs-icicle.c
new file mode 100644
index 000..5a23a7d
--- /dev/null
+++ b/board/microchip/mpfs-icicle/mpfs-icicle.c
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Microchip Technology Inc.
+ * Padmarao Begari 
+ */
+
+#include 
+#include 
+#include 
+
+#define MPFS_SYSREG_SOFT_RESET ((unsigned int *)0x20002088)
+
+int board_init(void)
+{
+   /* For now nothing to do here. */
+
+   return 0;
+}
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+   unsigned int val;
+   /* Reset uart peripheral */
+   val = readl(MPFS_SYSREG_SOFT_RESET);
+   val = (val & ~(1u << 5u));
+   writel(val, MPFS_SYSREG_SOFT_RESET);
+
+   return 0;
+}
+#endif
diff --git a/configs/microchip-mpfs-icicle_defconfig 
b/configs/microchip-mpfs-icicle_defconfig
new file mode 100644
index 000..2d1bd4a
--- /dev/null
+++ b/configs/microchip-mpfs-icicle_defconfig
@@ -0,0 +1,16 @@
+CONFIG_RISCV=y
+CONFIG_SYS_TEXT_BASE=0x8000
+CONFIG_ARCH_RV64I=y
+CONFIG_NR_CPUS=5
+CONFIG_TARGET_MICROCHIP_MPFS=y
+CONFIG_BOOTDELAY=3
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_SYS_PROMPT="RISC-V # "
+CONFIG_FIT=y
+CONFIG_DM=y
+CONFIG_BAUDRATE=57600
+CONFIG_DM_SERIAL=y
+CONFIG_SYS_NS16550=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_OF_PRIOR_STAGE=y
+CONFIG_BOARD_EARLY_INIT_F=y
diff --git a/include/configs/microchip-mpfs-icicle.h 
b/include/configs/microchip-mpfs-icicle.h
new file mode 100644
index 000..82c7fbb
--- /dev/null
+++ b/include/configs/microchip-mpfs-icicle.h
@@ -0,0 +1,63 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2019 Microchip Technology Inc.
+ * Padmarao Begari 
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * CPU and Board Configuration Options
+ */
+#define CONFIG_BOOTP_SEND_HOSTNAME
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CONFIG_SYS_CBSIZE  1024 /* Console I/O Buffer Size */
+
+/*

[U-Boot] [PATCH] fw_env: Fix double free

2019-04-17 Thread Björn Stenberg
addr0 is being freed twice, leading to segmentation fault

Signed-off-by: Björn Stenberg 
---
 tools/env/fw_env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index a5d75958e1..1ed0f7e9cb 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -1566,7 +1566,7 @@ int fw_env_open(struct env_opts *opts)
  free(addr0);

  if (addr1)
- free(addr0);
+ free(addr1);

  return ret;
 }
-- 
2.20.1
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 00/12] Add support for applications of overlays in SPL

2019-04-17 Thread Michal Simek
On 17. 04. 19 14:29, Jean-Jacques Hiblot wrote:
> 
> On 17/04/2019 12:38, Michal Simek wrote:
>> On 17. 04. 19 11:34, Jean-Jacques Hiblot wrote:
>>> Hi Michal,
>>>
>>> On 28/03/2019 15:03, Michal Simek wrote:
 On 27. 03. 19 16:38, Jean-Jacques Hiblot wrote:
> The purpose of this series is to provide the SPL with ability to apply
> overlays for u-boot. this is only a RFC so far, to get a feedback
> on the
> approach.
>
> Our use-case is the support of the daughter boards of the AM65x
> EVM. In
> Linux, each board is supported by a unique overlay. The presence of
> the
> boards is detected at runtime, and some useful features (like USB) are
> implemented on those daughter boards. Instead of providing multiple
> dtbs
> and fall in a combinatorial pit, we propose to use DT overlays.
>
> Patch #1 "spl: fit: Add support for applying DT overlay" has been
> posted
> a few weeks ago by Michal Simek.
> Patch #2 and #3 amend Michal's patch.
> Patch #4 and #5 are simple fixes for the Makefile
> Patch #6 is not required but relates to this series and will be
> required
> later by the AM6x platform
> Patch #7 may be a bit controversial. It basically replaces u-boot.img
> with
> a symlink to u-boot.itb in case we use a "complex" FIT (ie: if
> SPL_FIT_SOURCE or SPL_FIT_GENERATOR are set). This breaks buildman for
> several platforms because not all the binaries embedded in the FIT are
> available.
> Patch #9 adds a way to dynamically select the DT overlays. That is
> were we
> would use HW detection to select the required overlays. In that case,
> the
> board-level code tells what overlay it needs (it gives the name of the
> node).
> Patch #10 disables advanced SPL FIT features to keep the size of the
> SPL of
> the am335x_evm in check
> Patch #11 is not required, but demonstrates on a DRA76-evm how this
> series
> can be used.
>
> On arm, if overlay are supported, this series increases the size of
> the SPL
> by 3-4 kB.
>
> Changes in v2:
> - reworked board_fit_get_additionnal_images() and how it used in
> spl_fit.c
> - removed dtbo generation from dtso files and use .dts extension
> for the
>     overlays
> - add dynamic allocation usage in a separate patch
> - defconfig change for the am335x_evm
 This series looks better.
 Is this able to also handle different images then just dtbs?
>>> Sorry I thought  had answered this.
>>>
>>> Yes this is able to handle different image types, not just dtbos.
>>>
>>> Have you been able to play with it ? any additional comment ?
>> I haven't had a time but series is going in a right direction.
>> I found 2 days ago that applying my patch is increasing size for some
>> platforms that travis is failing.
>> It means I would definitely suggest you to run travis on branch with all
>> patches applied to see if this passing or some changes need to happen.
> 
> Already done. https://travis-ci.org/jjhiblot/u-boot/builds/511617974
> 
> The failures (except dra7 which is unresolved) are all related to the
> generation of u-boot.itb (one patch replaces u-boot.img with a link to
> u-boot.itb, making travis build u-boot.itb)
> 
> Was the broken  platform the am335x_evm? In that case, the fix is in the
> series. I disabled advanced FIT features for this platform as this is
> definitely not needed.

https://travis-ci.org/michalsimek/u-boot/builds/518675021

This was the issue.

   aarch64:  +   orangepi_pc2
+aarch64-linux-ld.bfd: u-boot-spl section `.rodata' will not fit in
region `.sram'
+aarch64-linux-ld.bfd: region `.sram' overflowed by 3152 bytes

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


[U-Boot] [PATCH v2] regmap: fix regmap_read_poll_timeout warning about sandbox_timer_add_offset

2019-04-17 Thread Neil Armstrong
When fixing sandbox test for regmap_read_poll_timeout(), the
sandbox_timer_add_offset was introduced but only defined in sandbox code
thus generating warnings when used out of sandbox :

include/regmap.h:289:2: note: in expansion of macro 
'regmap_read_poll_timeout_test'
regmap_read_poll_timeout_test(map, addr, val, cond, sleep_us, \
  ^
drivers/spi/meson_spifc.c:169:8: note: in expansion of macro 
'regmap_read_poll_timeout'
ret = regmap_read_poll_timeout(spifc->regmap, REG_SLAVE, data,
^~~~
drivers/spi/meson_spifc.c: In function 'meson_spifc_txrx':
include/regmap.h:277:4: warning: implicit declaration of function 
'sandbox_timer_add_offset' [-Wimplicit-function-declaration]

This fix renames the sandbox_timer_add_offset() to a generic 
timer_test_add_offset()
function defined in time.h and renames the implementation and test usages.

Cc: Simon Glass 
Reported-by: Tom Rini 
Fixes: df9cf1cc08 ("test: dm: regmap: Fix the long test delay")
Signed-off-by: Neil Armstrong 
---
 arch/sandbox/include/asm/test.h | 8 
 board/sandbox/sandbox.c | 2 +-
 drivers/net/sandbox.c   | 2 +-
 drivers/timer/sandbox_timer.c   | 2 +-
 include/regmap.h| 2 +-
 include/time.h  | 8 
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h
index fc52f47f82..e956a05262 100644
--- a/arch/sandbox/include/asm/test.h
+++ b/arch/sandbox/include/asm/test.h
@@ -59,14 +59,6 @@ void sandbox_i2c_eeprom_set_test_mode(struct udevice *dev,
 
 void sandbox_i2c_eeprom_set_offset_len(struct udevice *dev, int offset_len);
 
-/*
- * sandbox_timer_add_offset()
- *
- * Allow tests to add to the time reported through lib/time.c functions
- * offset: number of milliseconds to advance the system time
- */
-void sandbox_timer_add_offset(unsigned long offset);
-
 /**
  * sandbox_i2c_rtc_set_offset() - set the time offset from system/base time
  *
diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c
index 397e7561d4..9ca1eca027 100644
--- a/board/sandbox/sandbox.c
+++ b/board/sandbox/sandbox.c
@@ -31,7 +31,7 @@ void flush_cache(unsigned long start, unsigned long size)
 /* system timer offset in ms */
 static unsigned long sandbox_timer_offset;
 
-void sandbox_timer_add_offset(unsigned long offset)
+void timer_test_add_offset(unsigned long offset)
 {
sandbox_timer_offset += offset;
 }
diff --git a/drivers/net/sandbox.c b/drivers/net/sandbox.c
index decce2fa59..c136392350 100644
--- a/drivers/net/sandbox.c
+++ b/drivers/net/sandbox.c
@@ -350,7 +350,7 @@ static int sb_eth_recv(struct udevice *dev, int flags, 
uchar **packetp)
struct eth_sandbox_priv *priv = dev_get_priv(dev);
 
if (skip_timeout) {
-   sandbox_timer_add_offset(11000UL);
+   timer_test_add_offset(11000UL);
skip_timeout = false;
}
 
diff --git a/drivers/timer/sandbox_timer.c b/drivers/timer/sandbox_timer.c
index 6d2b045fe8..5228486082 100644
--- a/drivers/timer/sandbox_timer.c
+++ b/drivers/timer/sandbox_timer.c
@@ -14,7 +14,7 @@
 /* system timer offset in ms */
 static unsigned long sandbox_timer_offset;
 
-void sandbox_timer_add_offset(unsigned long offset)
+void timer_test_add_offset(unsigned long offset)
 {
sandbox_timer_offset += offset;
 }
diff --git a/include/regmap.h b/include/regmap.h
index 8359c511d2..3cd7a66cea 100644
--- a/include/regmap.h
+++ b/include/regmap.h
@@ -274,7 +274,7 @@ int regmap_raw_read_range(struct regmap *map, uint 
range_num, uint offset,
if (cond) \
break; \
if (IS_ENABLED(CONFIG_SANDBOX) && test_add_time) \
-   sandbox_timer_add_offset(test_add_time); \
+   timer_test_add_offset(test_add_time); \
if ((timeout_ms) && get_timer(__start) > (timeout_ms)) { \
__ret = regmap_read((map), (addr), &(val)); \
break; \
diff --git a/include/time.h b/include/time.h
index 825991e222..9fd0d73fb4 100644
--- a/include/time.h
+++ b/include/time.h
@@ -13,6 +13,14 @@ unsigned long get_timer(unsigned long base);
  */
 unsigned long timer_get_us(void);
 
+/*
+ * timer_test_add_offset()
+ *
+ * Allow tests to add to the time reported through lib/time.c functions
+ * offset: number of milliseconds to advance the system time
+ */
+void timer_test_add_offset(unsigned long offset);
+
 /*
  * These inlines deal with timer wrapping correctly. You are
  * strongly encouraged to use them
-- 
2.21.0

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


[U-Boot] [PATCH 4/4] Update defconfig for minized.

2019-04-17 Thread Philip Balister
Signed-off-by: Philip Balister 
---
 configs/zynq_minized_defconfig | 16 +---
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/configs/zynq_minized_defconfig b/configs/zynq_minized_defconfig
index d61659f785..6c56b9b9b9 100644
--- a/configs/zynq_minized_defconfig
+++ b/configs/zynq_minized_defconfig
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_SYS_CONFIG_NAME="zynq_minized"
 CONFIG_ARCH_ZYNQ=y
 CONFIG_SYS_TEXT_BASE=0x400
 CONFIG_SPL=y
@@ -12,9 +13,9 @@ CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_OS_BOOT=y
+CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_PROMPT="Zynq> "
-CONFIG_CMD_THOR_DOWNLOAD=y
-CONFIG_CMD_DFU=y
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_FPGA_LOADBP=y
 CONFIG_CMD_FPGA_LOADFS=y
@@ -25,15 +26,12 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-minized"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
-CONFIG_NET_RANDOM_ETHADDR=y
+# CONFIG_NET is not set
 CONFIG_SPL_DM_SEQ_ALIAS=y
-CONFIG_DFU_MMC=y
-CONFIG_DFU_RAM=y
 CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
@@ -44,11 +42,6 @@ CONFIG_SF_DEFAULT_SPEED=3000
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
-CONFIG_PHY_MARVELL=y
-CONFIG_PHY_REALTEK=y
-CONFIG_PHY_XILINX=y
-CONFIG_MII=y
-CONFIG_ZYNQ_GEM=y
 CONFIG_DEBUG_UART_ZYNQ=y
 CONFIG_ZYNQ_SERIAL=y
 CONFIG_ZYNQ_QSPI=y
@@ -63,3 +56,4 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_THOR=y
+CONFIG_REGEX=y
-- 
2.20.1

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


[U-Boot] [PATCH 3/4] zynq_minized: Add configuration header file for board specific environment.

2019-04-17 Thread Philip Balister
Signed-off-by: Philip Balister 
---
 include/configs/zynq_minized.h | 54 ++
 1 file changed, 54 insertions(+)
 create mode 100644 include/configs/zynq_minized.h

diff --git a/include/configs/zynq_minized.h b/include/configs/zynq_minized.h
new file mode 100644
index 00..6d89e3da29
--- /dev/null
+++ b/include/configs/zynq_minized.h
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2019 Philip Balister .
+ *
+ * Configuration settings for the MiniZed board
+ * See zynq-common.h for Zynq common configs
+ */
+
+#ifndef __CONFIG_ZYNQ_MINIZED_H
+#define __CONFIG_ZYNQ_MINIZED_H
+
+#define CONFIG_EXTRA_ENV_SETTINGS   \
+   "fit_image=fitImage\0"   \
+   "bit_file=fpga.bit\0"   \
+   "load_addr=0x200\0" \
+   "fit_size=0x80\0"   \
+   "flash_off=0x10\0"  \
+   "nor_flash_off=0xE210\0"\
+   "fdt_high=0x2000\0" \
+   "initrd_high=0x2000\0"  \
+   "loadbootenv_addr=0x200\0" \
+   "fdt_addr_r=0x1f0\0"\
+   "kernel_addr_r=0x200\0" \
+   "ramdisk_addr_r=0x310\0"\
+   "bootenv=uEnv.txt\0" \
+   "bootenv_dev=mmc\0" \
+   "qspiboot=echo Copying FIT from QSPI to RAM... (Not Yet) \0" \
+   "mmcboot= " \
+   "echo Copying fpga.bit from MMC and loading FPGA... && " \
+   "load mmc 0:1 ${load_addr} /boot/${bit_file} && " \
+   "fpga loadb 0 ${load_addr} ${filesize} && " \
+   "echo Copying FIT from MMC to RAM... && " \
+   "load mmc 0:1 ${load_addr} /boot/${fit_image} && " \
+   "setenv bootargs root=/dev/mmcblk1p1 rootwait && " \
+   "bootm ${load_addr}\0" \
+   "usbboot=if usb start; then " \
+   "echo Copying fpga.bit from USB and loading FPGA... && " \
+   "load usb 0 ${load_addr} /boot/${bit_file} && " \
+   "fpga loadb 0 ${load_addr} ${filesize} && " \
+   "echo Copying FIT from USB to RAM... && " \
+   "load usb 0 ${load_addr} /boot/${fit_image} && " \
+   "setenv bootargs root=/dev/sda1 rootwait && " \
+   "bootm ${load_addr}; fi\0" \
+   "usbrecover=if usb start; then " \
+   "echo Copying fpga.bit from USB and loading FPGA... && " \
+   "load usb 0 ${load_addr} ${bit_file} && " \
+   "fpga loadb 0 ${load_addr} ${filesize} && " \
+   "echo Copying FIT from USB to RAM... && " \
+   "load usb 0 ${load_addr} ${fit_image} && " \
+   "bootm ${load_addr}; fi\0"
+
+#include 
+
+#endif /* __CONFIG_ZYNQ_MINIZED_H */
-- 
2.20.1

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


[U-Boot] [PATCH 2/4] mini-zed: Update mini-zed dts so we can use it for SPL.

2019-04-17 Thread Philip Balister
Signed-off-by: Philip Balister 
---
 arch/arm/dts/zynq-minized.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/dts/zynq-minized.dts b/arch/arm/dts/zynq-minized.dts
index 525921ee7b..9ad7f090fe 100644
--- a/arch/arm/dts/zynq-minized.dts
+++ b/arch/arm/dts/zynq-minized.dts
@@ -38,6 +38,7 @@
 };
 
  {
+   u-boot,dm-pre-reloc;
status = "okay";
is-dual = <0>;
num-cs = <1>;
-- 
2.20.1

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


[U-Boot] [PATCH v3 1/3] arm64: allwinner: sun50i: Sync H6 dts(i) files from Linux

2019-04-17 Thread Clément Péron
From: Jagan Teki 

Usually the Linux dts changes were synced in specific tags in Allwinner,
to keep track for whats been synced so-far and plan for future syncs.

But this patch sync sun50i-h6* dts(i) files from Linux w/o any specific
tag since these dts(i) changes are required for new H6 boards support.

Linux commit details about the sun50i-h6* sync:
"arm64: dts: allwinner: h6: move MMC pinctrl to dtsi"
(sha1: 6ba2e45d57afdfd982d12f168edd6a79a65075d8)

Linux commit details about the sun8i-tcon-top.h sync:
"dt-bindings: display: sunxi-drm: Add TCON TOP description"
(sha1: 59a9c39544cd1e5952c2a33028d71aa8180648f8)

Part of the sync initiated by 'Clément Péron'.

Signed-off-by: Clément Péron 
Signed-off-by: Jagan Teki 
---
 arch/arm/dts/sun50i-h6-orangepi.dtsi   |  62 +++-
 arch/arm/dts/sun50i-h6-pine-h64.dts|  88 -
 arch/arm/dts/sun50i-h6.dtsi| 398 -
 include/dt-bindings/clock/sun8i-tcon-top.h |  11 +
 4 files changed, 538 insertions(+), 21 deletions(-)
 create mode 100644 include/dt-bindings/clock/sun8i-tcon-top.h

diff --git a/arch/arm/dts/sun50i-h6-orangepi.dtsi 
b/arch/arm/dts/sun50i-h6-orangepi.dtsi
index 0612c19cd9..62e27948a3 100644
--- a/arch/arm/dts/sun50i-h6-orangepi.dtsi
+++ b/arch/arm/dts/sun50i-h6-orangepi.dtsi
@@ -21,17 +21,55 @@
chosen {
stdout-path = "serial0:115200n8";
};
+
+   leds {
+   compatible = "gpio-leds";
+
+   power {
+   label = "orangepi:red:power";
+   gpios = <_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
+   default-state = "on";
+   };
+
+   status {
+   label = "orangepi:green:status";
+   gpios = <_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */
+   };
+   };
+
+   reg_vcc5v: vcc5v {
+   /* board wide 5V supply directly from the DC jack */
+   compatible = "regulator-fixed";
+   regulator-name = "vcc-5v";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   regulator-always-on;
+   };
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
 };
 
  {
-   pinctrl-names = "default";
-   pinctrl-0 = <_pins>;
vmmc-supply = <_cldo1>;
cd-gpios = < 5 6 GPIO_ACTIVE_LOW>;
bus-width = <4>;
status = "okay";
 };
 
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
 _i2c {
status = "okay";
 
@@ -43,6 +81,14 @@
interrupt-controller;
#interrupt-cells = <1>;
x-powers,self-working-mode;
+   vina-supply = <_vcc5v>;
+   vinb-supply = <_vcc5v>;
+   vinc-supply = <_vcc5v>;
+   vind-supply = <_vcc5v>;
+   vine-supply = <_vcc5v>;
+   aldoin-supply = <_vcc5v>;
+   bldoin-supply = <_vcc5v>;
+   cldoin-supply = <_vcc5v>;
 
regulators {
reg_aldo1: aldo1 {
@@ -148,3 +194,15 @@
pinctrl-0 = <_ph_pins>;
status = "okay";
 };
+
+ {
+   dr_mode = "otg";
+   status = "okay";
+};
+
+ {
+   usb0_id_det-gpios = < 2 6 GPIO_ACTIVE_HIGH>; /* PC6 */
+   usb0_vbus-supply = <_vcc5v>;
+   usb3_vbus-supply = <_vcc5v>;
+   status = "okay";
+};
diff --git a/arch/arm/dts/sun50i-h6-pine-h64.dts 
b/arch/arm/dts/sun50i-h6-pine-h64.dts
index ceffc40810..4802902e12 100644
--- a/arch/arm/dts/sun50i-h6-pine-h64.dts
+++ b/arch/arm/dts/sun50i-h6-pine-h64.dts
@@ -14,6 +14,7 @@
compatible = "pine64,pine-h64", "allwinner,sun50i-h6";
 
aliases {
+   ethernet0 = 
serial0 = 
};
 
@@ -21,6 +22,17 @@
stdout-path = "serial0:115200n8";
};
 
+   connector {
+   compatible = "hdmi-connector";
+   type = "a";
+
+   port {
+   hdmi_con_in: endpoint {
+   remote-endpoint = <_out_con>;
+   };
+   };
+   };
+
leds {
compatible = "gpio-leds";
 
@@ -39,23 +51,79 @@
gpios = <_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */
};
};
+
+   reg_usb_vbus: vbus {
+   compatible = "regulator-fixed";
+   regulator-name = "usb-vbus";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   startup-delay-us = <10>;
+   gpio = <_pio 0 5 GPIO_ACTIVE_HIGH>;
+   enable-active-high;
+   };
 };
 
- {
+ {
pinctrl-names = "default";
-   pinctrl-0 = <_pins>;
+   pinctrl-0 = <_rgmii_pins>;
+   phy-mode = "rgmii";
+   phy-handle = <_rgmii_phy>;
+   phy-supply = <_aldo2>;
+   allwinner,rx-delay-ps = <200>;
+   

[U-Boot] [PATCH v3 3/3] arm: sunxi: h6: fix reset using r_wdog

2019-04-17 Thread Clément Péron
WDOG is broken for some H6 rev. The board is not
reseted correctly.

Use the R_WDOG instead.

Signed-off-by: Clément Péron 
---
 arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h | 1 +
 arch/arm/mach-sunxi/board.c | 9 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h 
b/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h
index 41a9b0fc47..6392cb07b4 100644
--- a/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h
+++ b/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h
@@ -60,6 +60,7 @@
 #define SUNXI_RTC_BASE 0x0700
 #define SUNXI_R_CPUCFG_BASE0x07000400
 #define SUNXI_PRCM_BASE0x0701
+#define SUNXI_R_WDOG_BASE  0x07020400
 #define SUNXI_R_PIO_BASE   0x07022000
 #define SUNXI_R_UART_BASE  0x0708
 #define SUNXI_R_TWI_BASE   0x07081400
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index c6dd7b8e54..921e4c5175 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -289,9 +289,14 @@ void reset_cpu(ulong addr)
writel(WDT_MODE_RESET_EN | WDT_MODE_EN, >mode);
}
 #elif defined(CONFIG_SUNXI_GEN_SUN6I) || defined(CONFIG_MACH_SUN50I_H6)
+#if defined(CONFIG_MACH_SUN50I_H6)
+   /* WDOG is broken for some H6 rev. use the R_WDOG instead */
static const struct sunxi_wdog *wdog =
-((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog;
-
+   (struct sunxi_wdog *)SUNXI_R_WDOG_BASE;
+#else
+   static const struct sunxi_wdog *wdog =
+   ((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog;
+#endif
/* Set the watchdog for its shortest interval (.5s) and wait */
writel(WDT_CFG_RESET, >cfg);
writel(WDT_MODE_EN, >mode);
-- 
2.17.1

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


[U-Boot] [PATCH v3 2/3] arm: dts: h6: Add Beelink GS1 initial support

2019-04-17 Thread Clément Péron
Beelink GS1 is an Allwinner H6 based TV box,
which support:
- Allwinner H6 Quad-core 64-bit ARM Cortex-A53
- GPU Mali-T720
- 2GB LPDDR3 RAM
- 16GB eMMC
- AXP805 PMIC
- 1Gbps GMAC via RTL8211E
- USB 2.0 and 3.0 Host
- HDMI port
- S/PDIF port
- 5V/2A DC power supply
- Wi-Fi/BT via Fn-Link 6222B-SRB (RTL8222BS)

Introduced in Linux with commit :
089bee8dd119 arm64: dts: allwinner: h6: Introduce Beelink GS1 board

Signed-off-by: Clément Péron 
---
 arch/arm/dts/Makefile  |   1 +
 arch/arm/dts/sun50i-h6-beelink-gs1.dts | 260 +
 board/sunxi/MAINTAINERS|   6 +
 configs/beelink_gs1_defconfig  |  15 ++
 4 files changed, 282 insertions(+)
 create mode 100644 arch/arm/dts/sun50i-h6-beelink-gs1.dts
 create mode 100644 configs/beelink_gs1_defconfig

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 0aee8dfde0..4bba8b81f8 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -469,6 +469,7 @@ dtb-$(CONFIG_MACH_SUN50I_H5) += \
sun50i-h5-orangepi-prime.dtb \
sun50i-h5-orangepi-zero-plus2.dtb
 dtb-$(CONFIG_MACH_SUN50I_H6) += \
+   sun50i-h6-beelink-gs1.dtb \
sun50i-h6-orangepi-lite2.dtb \
sun50i-h6-orangepi-one-plus.dtb \
sun50i-h6-pine-h64.dtb
diff --git a/arch/arm/dts/sun50i-h6-beelink-gs1.dts 
b/arch/arm/dts/sun50i-h6-beelink-gs1.dts
new file mode 100644
index 00..0dc33c90dd
--- /dev/null
+++ b/arch/arm/dts/sun50i-h6-beelink-gs1.dts
@@ -0,0 +1,260 @@
+// SPDX-License-Identifier: (GPL-2.0+ or MIT)
+/*
+ * Copyright (C) 2019 Clément Péron 
+ */
+
+/dts-v1/;
+
+#include "sun50i-h6.dtsi"
+
+#include 
+
+/ {
+   model = "Beelink GS1";
+   compatible = "azw,beelink-gs1", "allwinner,sun50i-h6";
+
+   aliases {
+   ethernet0 = 
+   serial0 = 
+   };
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+
+   connector {
+   compatible = "hdmi-connector";
+   type = "a";
+
+   port {
+   hdmi_con_in: endpoint {
+   remote-endpoint = <_out_con>;
+   };
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   power {
+   label = "beelink:white:power";
+   gpios = <_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
+   default-state = "on";
+   };
+   };
+
+   reg_vcc5v: vcc5v {
+   /* board wide 5V supply directly from the DC jack */
+   compatible = "regulator-fixed";
+   regulator-name = "vcc-5v";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   regulator-always-on;
+   };
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_rgmii_pins>;
+   phy-mode = "rgmii";
+   phy-handle = <_rgmii_phy>;
+   phy-supply = <_aldo2>;
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+_out {
+   hdmi_out_con: endpoint {
+   remote-endpoint = <_con_in>;
+   };
+};
+
+ {
+   ext_rgmii_phy: ethernet-phy@1 {
+   compatible = "ethernet-phy-ieee802.3-c22";
+   reg = <1>;
+   };
+};
+
+ {
+   vmmc-supply = <_cldo1>;
+   cd-gpios = < 5 6 GPIO_ACTIVE_LOW>;
+   bus-width = <4>;
+   status = "okay";
+};
+
+ {
+   vmmc-supply = <_cldo1>;
+   vqmmc-supply = <_bldo2>;
+   non-removable;
+   cap-mmc-hw-reset;
+   bus-width = <8>;
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   vcc-pd-supply = <_cldo1>;
+   vcc-pg-supply = <_aldo1>;
+};
+
+_i2c {
+   status = "okay";
+
+   axp805: pmic@36 {
+   compatible = "x-powers,axp805", "x-powers,axp806";
+   reg = <0x36>;
+   interrupt-parent = <_intc>;
+   interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+   interrupt-controller;
+   #interrupt-cells = <1>;
+   x-powers,self-working-mode;
+   vina-supply = <_vcc5v>;
+   vinb-supply = <_vcc5v>;
+   vinc-supply = <_vcc5v>;
+   vind-supply = <_vcc5v>;
+   vine-supply = <_vcc5v>;
+   aldoin-supply = <_vcc5v>;
+   bldoin-supply = <_vcc5v>;
+   cldoin-supply = <_vcc5v>;
+
+   regulators {
+   reg_aldo1: aldo1 {
+   regulator-always-on;
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-name = "vcc-pl";
+   };
+
+   reg_aldo2: aldo2 {
+   regulator-min-microvolt = <330>;
+   

[U-Boot] [PATCH v3 0/3] Add Beelink GS1 Board

2019-04-17 Thread Clément Péron
This serie introduce the Beelink GS1 board with a patch for
the reset on Allwinner H6.

The first patch has been submitted but is still not merged.
But it's required for this series

Thanks to Jagan Teki most of the Beelink GS1 device-tree is
taken from the Orange Pi boards.

Changes with v2:
 - Add myself in sunxi MAINTAINERS file
 - Update with Jagan Teki's rsync patch
 - Change to complete DTS same as linux
 - Add linux sha1 to the commit log

Changes with v1:
 - Add bus-width for mmc2 node
 - Add sha1 in the sync dts commit

Clément Péron (2):
  arm: dts: h6: Add Beelink GS1 initial support
  arm: sunxi: h6: fix reset using r_wdog

Jagan Teki (1):
  arm64: allwinner: sun50i: Sync H6 dts(i) files from Linux

 arch/arm/dts/Makefile |   1 +
 arch/arm/dts/sun50i-h6-beelink-gs1.dts| 260 
 arch/arm/dts/sun50i-h6-orangepi.dtsi  |  62 ++-
 arch/arm/dts/sun50i-h6-pine-h64.dts   |  88 +++-
 arch/arm/dts/sun50i-h6.dtsi   | 398 +-
 .../include/asm/arch-sunxi/cpu_sun50i_h6.h|   1 +
 arch/arm/mach-sunxi/board.c   |   9 +-
 board/sunxi/MAINTAINERS   |   6 +
 configs/beelink_gs1_defconfig |  15 +
 include/dt-bindings/clock/sun8i-tcon-top.h|  11 +
 10 files changed, 828 insertions(+), 23 deletions(-)
 create mode 100644 arch/arm/dts/sun50i-h6-beelink-gs1.dts
 create mode 100644 configs/beelink_gs1_defconfig
 create mode 100644 include/dt-bindings/clock/sun8i-tcon-top.h

-- 
2.17.1

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


Re: [U-Boot] [RFC v3 03/10] cmd: bootefi: carve out fdt handling from do_bootefi()

2019-04-17 Thread Heinrich Schuchardt

On 4/17/19 9:01 AM, AKASHI Takahiro wrote:

On Tue, Apr 16, 2019 at 06:54:58AM +0200, Heinrich Schuchardt wrote:

On 4/16/19 6:24 AM, AKASHI Takahiro wrote:

This is a preparatory patch for reworking do_bootefi() in later patch.


I would prefer a more informative commit message like:

Carve out a function to handle the installation of the device tree as a
configuration table.


Okay, but it doesn't convey more than the subject.

-Takahiro Akashi


Otherwise
Reviewed-by: Heinrich Schuchardt 



Signed-off-by: AKASHI Takahiro 
---
  cmd/bootefi.c | 53 ---
  1 file changed, 38 insertions(+), 15 deletions(-)

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 3619a20e6433..8cd9644115eb 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -198,6 +198,38 @@ static efi_status_t efi_install_fdt(ulong fdt_addr)
return ret;
  }

+/**
+ * efi_process_fdt() - process fdt passed by a command argument
+ * @fdt_opt:   pointer to argument
+ * Return: status code
+ *
+ * If specified, fdt will be installed as configuration table,
+ * otherwise no fdt will be passed.
+ */
+static efi_status_t efi_process_fdt(const char *fdt_opt)
+{
+   unsigned long fdt_addr;
+   efi_status_t ret;
+
+   if (fdt_opt) {
+   fdt_addr = simple_strtoul(fdt_opt, NULL, 16);
+   if (!fdt_addr && *fdt_opt != '0')
+   return EFI_INVALID_PARAMETER;
+
+   /* Install device tree */
+   ret = efi_install_fdt(fdt_addr);
+   if (ret != EFI_SUCCESS) {
+   printf("ERROR: failed to install device tree\n");
+   return ret;
+   }
+   } else {
+   /* Remove device tree. EFI_NOT_FOUND can be ignored here */
+   efi_install_configuration_table(_guid_fdt, NULL);
+   }
+
+   return EFI_SUCCESS;
+}
+
  static efi_status_t bootefi_run_prepare(const char *load_options_path,
struct efi_device_path *device_path,
struct efi_device_path *image_path,
@@ -407,21 +439,12 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int 
argc, char * const argv[])
if (argc < 2)
return CMD_RET_USAGE;

-   if (argc > 2) {
-   fdt_addr = simple_strtoul(argv[2], NULL, 16);
-   if (!fdt_addr && *argv[2] != '0')
-   return CMD_RET_USAGE;
-   /* Install device tree */
-   r = efi_install_fdt(fdt_addr);
-   if (r != EFI_SUCCESS) {
-   printf("ERROR: failed to install device tree\n");
-   return CMD_RET_FAILURE;
-   }
-   } else {
-   /* Remove device tree. EFI_NOT_FOUND can be ignored here */
-   efi_install_configuration_table(_guid_fdt, NULL);
-   printf("WARNING: booting without device tree\n");
-   }
+   r = fdt_process_fdt(argc > 2 ? argv[2] : NULL);


cmd/bootefi.c: In function ‘do_bootefi’:
cmd/bootefi.c:442:6: warning: implicit declaration of function
‘fdt_process_fdt’; did you mean ‘efi_process_fdt’?
[-Wimplicit-function-declaration]
  r = fdt_process_fdt(argc > 2 ? argv[2] : NULL);
  ^~~
  efi_process_fdt
cmd/bootefi.c:424:16: warning: unused variable ‘fdt_addr’
[-Wunused-variable]
  unsigned long fdt_addr;
^~~~
At top level:
  CC  drivers/virtio/virtio_pci_legacy.o
cmd/bootefi.c:209:21: warning: ‘efi_process_fdt’ defined but not used
[-Wunused-function]
 static efi_status_t efi_process_fdt(const char *fdt_opt)
 ^~~

Please, check.

Best regards

Heinrich


+   if (r == EFI_INVALID_PARAMETER)
+   return CMD_RET_USAGE;
+   else if (r != EFI_SUCCESS)
+   return CMD_RET_FAILURE;
+
  #ifdef CONFIG_CMD_BOOTEFI_HELLO
if (!strcmp(argv[1], "hello")) {
ulong size = __efi_helloworld_end - __efi_helloworld_begin;







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


[U-Boot] [PATCH] ARM: da850evm: Fix broken SPI Flash

2019-04-17 Thread Adam Ford
A previous patch converted a bunch of settings for CONFIG_SF_DEFAULT
but it broke the SPI Flash which now prevents booting.  This patch
now correctly sets CONFIG_SF_DEFAULT_SPEED=3000 to match what it
was before the conversion.

Fixes: 14453fbfadc2 ("Convert CONFIG_SF_DEFAULT_* to Kconfig")

Signed-off-by: Adam Ford 

diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig
index 4b09ba10a6..745ae2b4b1 100644
--- a/configs/da850evm_defconfig
+++ b/configs/da850evm_defconfig
@@ -55,6 +55,7 @@ CONFIG_DM_MMC=y
 CONFIG_MTD_DEVICE=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
+CONFIG_SF_DEFAULT_SPEED=3000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SPI_FLASH_MTD=y
-- 
2.17.1

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


Re: [U-Boot] [PATCH 1/2] fs: cbfs: make file_cbfs_load_header(..) independent of end-of-rom

2019-04-17 Thread Christian Gmeiner
Am Mi., 17. Apr. 2019 um 15:21 Uhr schrieb Christian Gmeiner
:
>
> Signed-off-by: Christian Gmeiner 

I think I will send out a v2 that compiles :/

-- 
greets
--
Christian Gmeiner, MSc

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


Re: [U-Boot] [PATCH v2 2/2] net: eth-uclass: Support device tree MAC addresses

2019-04-17 Thread Thierry Reding
On Wed, Apr 17, 2019 at 02:49:22PM +0300, Grygorii Strashko wrote:
> 
> 
> On 16.04.19 19:24, Thierry Reding wrote:
> > From: Thierry Reding 
> > 
> > Add the standard Ethernet device tree bindings (imported from v5.0 of
> > the Linux kernel) and implement support for reading the MAC address for
> > Ethernet devices in the Ethernet uclass. If the "mac-address" property
> > exists, the MAC address will be parsed from that. If that property does
> > not exist, the "local-mac-address" property will be tried as fallback.
> > 
> > MAC addresses from device tree take precedence over the ones stored in
> > a network interface card's ROM.
> > 
> > Acked-by: Joe Hershberger 
> > Signed-off-by: Thierry Reding 
> > ---
> > Changes in v2:
> > - use dev_read_u8_array_ptr()
> > 
> >  .../devicetree/bindings/net/ethernet.txt  | 66 +++
> >  net/eth-uclass.c  | 26 +++-
> >  2 files changed, 89 insertions(+), 3 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/net/ethernet.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/net/ethernet.txt 
> > b/Documentation/devicetree/bindings/net/ethernet.txt
> > new file mode 100644
> > index ..cfc376bc977a
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/ethernet.txt
> > @@ -0,0 +1,66 @@
> > +The following properties are common to the Ethernet controllers:
> > +
> > +NOTE: All 'phy*' properties documented below are Ethernet specific. For the
> > +generic PHY 'phys' property, see
> > +Documentation/devicetree/bindings/phy/phy-bindings.txt.
> > +
> > +- local-mac-address: array of 6 bytes, specifies the MAC address that was
> > +  assigned to the network device;
> > +- mac-address: array of 6 bytes, specifies the MAC address that was last 
> > used by
> > +  the boot program; should be used in cases where the MAC address assigned 
> > to
> > +  the device by the boot program is different from the "local-mac-address"
> > +  property;
> > +- nvmem-cells: phandle, reference to an nvmem node for the MAC address;
> > +- nvmem-cell-names: string, should be "mac-address" if nvmem is to be used;
> > +- max-speed: number, specifies maximum speed in Mbit/s supported by the 
> > device;
> > +- max-frame-size: number, maximum transfer unit (IEEE defined MTU), rather 
> > than
> > +  the maximum frame size (there's contradiction in the Devicetree
> > +  Specification).
> > +- phy-mode: string, operation mode of the PHY interface. This is now a 
> > de-facto
> > +  standard property; supported values are:
> > +  * "internal"
> > +  * "mii"
> > +  * "gmii"
> > +  * "sgmii"
> > +  * "qsgmii"
> > +  * "tbi"
> > +  * "rev-mii"
> > +  * "rmii"
> > +  * "rgmii" (RX and TX delays are added by the MAC when required)
> > +  * "rgmii-id" (RGMII with internal RX and TX delays provided by the PHY, 
> > the
> > + MAC should not add the RX or TX delays in this case)
> > +  * "rgmii-rxid" (RGMII with internal RX delay provided by the PHY, the MAC
> > + should not add an RX delay in this case)
> > +  * "rgmii-txid" (RGMII with internal TX delay provided by the PHY, the MAC
> > + should not add an TX delay in this case)
> > +  * "rtbi"
> > +  * "smii"
> > +  * "xgmii"
> > +  * "trgmii"
> > +  * "2000base-x",
> > +  * "2500base-x",
> > +  * "rxaui"
> > +  * "xaui"
> > +  * "10gbase-kr" (10GBASE-KR, XFI, SFI)
> > +- phy-connection-type: the same as "phy-mode" property but described in the
> > +  Devicetree Specification;
> > +- phy-handle: phandle, specifies a reference to a node representing a PHY
> > +  device; this property is described in the Devicetree Specification and so
> > +  preferred;
> > +- phy: the same as "phy-handle" property, not recommended for new bindings.
> > +- phy-device: the same as "phy-handle" property, not recommended for new
> > +  bindings.
> > +- rx-fifo-depth: the size of the controller's receive fifo in bytes. This
> > +  is used for components that can have configurable receive fifo sizes,
> > +  and is useful for determining certain configuration settings such as
> > +  flow control thresholds.
> > +- tx-fifo-depth: the size of the controller's transmit fifo in bytes. This
> > +  is used for components that can have configurable fifo sizes.
> > +- managed: string, specifies the PHY management type. Supported values are:
> > +  "auto", "in-band-status". "auto" is the default, it usess MDIO for
> > +  management if fixed-link is not specified.
> > +
> > +Child nodes of the Ethernet controller are typically the individual PHY 
> > devices
> > +connected via the MDIO bus (sometimes the MDIO bus controller is separate).
> > +They are described in the phy.txt file in this same directory.
> > +For non-MDIO PHY management see fixed-link.txt.
> > diff --git a/net/eth-uclass.c b/net/eth-uclass.c
> > index 4225aabf1fa1..c6d5ec013bd8 100644
> > --- a/net/eth-uclass.c
> > +++ b/net/eth-uclass.c
> > @@ -455,6 +455,23 @@ static int eth_pre_unbind(struct udevice *dev)
> > 

[U-Boot] [PATCH] usb: dwc2: fix gadget disconnect

2019-04-17 Thread Fabrice Gasnier
This fixes a disconnect issue detected with fastboot command, when using
dwc2 driver.
- On u-boot side:
uboot>$ fastboot 0
- On USB host PC side, few seconds after
PC>$ fastboot reboot # Get stuck, uboot target never reboots

By enabling DEBUG_ISR logs, the bus suspend interrupt is seen before the
PC command has been issued. When the USB bus suspend occurs, there's a HACK
that disables the fastboot (composite driver). Here is the call stack
upon USB bus suspend:
- dwc2_handle_usb_suspend_intr()
  - dev->driver->disconnect()
- composite_disconnect()
  - reset_config()
- f->disable()
  - fastboot_disable()
- usb_ep_disable(f_fb->out_ep);
- usb_ep_disable(f_fb->in_ep);
.. other disable calls.

When the resume interrupt happens, everything has been disabled, then
nothing happens. fastboot command gets stuck on HOST side.

Remove original HACK, that disconnects the composite driver upon
USB bus suspend. Implement disconnect detection instead:
- check GINTSTS OTG interrupt
- read GOTGINT register
- check GOTGINT, SesEndDet bit (e.g. session end)
This is inspired by what is implemented currently in Linux dwc2 driver.

Signed-off-by: Fabrice Gasnier 
---

 drivers/usb/gadget/dwc2_udc_otg_regs.h |  6 +-
 drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c | 14 --
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/dwc2_udc_otg_regs.h 
b/drivers/usb/gadget/dwc2_udc_otg_regs.h
index a1829b3..b685256 100644
--- a/drivers/usb/gadget/dwc2_udc_otg_regs.h
+++ b/drivers/usb/gadget/dwc2_udc_otg_regs.h
@@ -86,6 +86,9 @@ struct dwc2_usbotg_reg {
 #define B_SESSION_VALID(0x1<<19)
 #define A_SESSION_VALID(0x1<<18)
 
+/* DWC2_UDC_OTG_GOTINT */
+#define GOTGINT_SES_END_DET(1<<2)
+
 /* DWC2_UDC_OTG_GAHBCFG */
 #define PTXFE_HALF (0<<8)
 #define PTXFE_ZERO (1<<8)
@@ -118,6 +121,7 @@ struct dwc2_usbotg_reg {
 #define INT_NP_TX_FIFO_EMPTY   (0x1<<5)
 #define INT_RX_FIFO_NOT_EMPTY  (0x1<<4)
 #define INT_SOF(0x1<<3)
+#define INT_OTG(0x1<<2)
 #define INT_DEV_MODE   (0x0<<0)
 #define INT_HOST_MODE  (0x1<<1)
 #define INT_GOUTNakEff (0x01<<7)
@@ -246,7 +250,7 @@ struct dwc2_usbotg_reg {
 
 /* Masks definitions */
 #define GINTMSK_INIT   (INT_OUT_EP | INT_IN_EP | INT_RESUME | INT_ENUMDONE\
-   | INT_RESET | INT_SUSPEND)
+   | INT_RESET | INT_SUSPEND | INT_OTG)
 #define DOEPMSK_INIT   (CTRL_OUT_EP_SETUP_PHASE_DONE | AHB_ERROR|TRANSFER_DONE)
 #define DIEPMSK_INIT   (NON_ISO_IN_EP_TIMEOUT|AHB_ERROR|TRANSFER_DONE)
 #define GAHBCFG_INIT   (PTXFE_HALF | NPTXFE_HALF | MODE_DMA | BURST_INCR4\
diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c 
b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
index a75af49..7eb632d 100644
--- a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
+++ b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
@@ -467,7 +467,7 @@ static void process_ep_out_intr(struct dwc2_udc *dev)
 static int dwc2_udc_irq(int irq, void *_dev)
 {
struct dwc2_udc *dev = _dev;
-   u32 intr_status;
+   u32 intr_status, gotgint;
u32 usb_status, gintmsk;
unsigned long flags = 0;
 
@@ -521,14 +521,24 @@ static int dwc2_udc_irq(int irq, void *_dev)
&& dev->driver) {
if (dev->driver->suspend)
dev->driver->suspend(>gadget);
+   }
+   }
+
+   if (intr_status & INT_OTG) {
+   gotgint = readl(>gotgint);
+   debug_cond(DEBUG_ISR,
+  "\tOTG interrupt: (GOTGINT):0x%x\n", gotgint);
 
-   /* HACK to let gadget detect disconnected state */
+   if (gotgint & GOTGINT_SES_END_DET) {
+   debug_cond(DEBUG_ISR, "\t\tSession End Detected\n");
+   /* Let gadget detect disconnected state */
if (dev->driver->disconnect) {
spin_unlock_irqrestore(>lock, flags);
dev->driver->disconnect(>gadget);
spin_lock_irqsave(>lock, flags);
}
}
+   writel(gotgint, >gotgint);
}
 
if (intr_status & INT_RESUME) {
-- 
2.7.4

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


[U-Boot] [PATCH] kwbimage: fixing the issue with proper return code checking

2019-04-17 Thread Young Xiao
EVP_VerifyFinal would return one of three values:
1 if the data is verified to be correct;
0 if it is incorrect;
-1 if there is any failure in the verification process.

The varification in unpatched version is wrong, since it ignored
the return value of -1.

The bug allows a malformed signature to be treated as a good
signature rather than as an error. This issue affects the
signature checks on DSA ans ECDSA keys used with SSL/TLS.

This issue is similar to CVE-2008-5077, CVE-2009-0021,
CVE-2009-0025, CVE-2009-0046 ~ CVE-2009-0049.

Signed-off-by: Young Xiao <92siuy...@gmail.com>
---
 tools/kwbimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index dffaf90..b8f8d38 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -701,7 +701,7 @@ int kwb_verify(RSA *key, void *data, int datasz, struct 
sig_v1 *sig,
goto err_ctx;
}
 
-   if (!EVP_VerifyFinal(ctx, sig->sig, sizeof(sig->sig), evp_key)) {
+   if (EVP_VerifyFinal(ctx, sig->sig, sizeof(sig->sig), evp_key) != 1) {
ret = openssl_err("Could not verify signature");
goto err_ctx;
}
-- 
2.7.4

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


Re: [U-Boot] [RFC PATCH v2 00/12] Add support for applications of overlays in SPL

2019-04-17 Thread Jean-Jacques Hiblot


On 17/04/2019 12:38, Michal Simek wrote:

On 17. 04. 19 11:34, Jean-Jacques Hiblot wrote:

Hi Michal,

On 28/03/2019 15:03, Michal Simek wrote:

On 27. 03. 19 16:38, Jean-Jacques Hiblot wrote:

The purpose of this series is to provide the SPL with ability to apply
overlays for u-boot. this is only a RFC so far, to get a feedback on the
approach.

Our use-case is the support of the daughter boards of the AM65x EVM. In
Linux, each board is supported by a unique overlay. The presence of the
boards is detected at runtime, and some useful features (like USB) are
implemented on those daughter boards. Instead of providing multiple dtbs
and fall in a combinatorial pit, we propose to use DT overlays.

Patch #1 "spl: fit: Add support for applying DT overlay" has been posted
a few weeks ago by Michal Simek.
Patch #2 and #3 amend Michal's patch.
Patch #4 and #5 are simple fixes for the Makefile
Patch #6 is not required but relates to this series and will be required
later by the AM6x platform
Patch #7 may be a bit controversial. It basically replaces u-boot.img
with
a symlink to u-boot.itb in case we use a "complex" FIT (ie: if
SPL_FIT_SOURCE or SPL_FIT_GENERATOR are set). This breaks buildman for
several platforms because not all the binaries embedded in the FIT are
available.
Patch #9 adds a way to dynamically select the DT overlays. That is
were we
would use HW detection to select the required overlays. In that case,
the
board-level code tells what overlay it needs (it gives the name of the
node).
Patch #10 disables advanced SPL FIT features to keep the size of the
SPL of
the am335x_evm in check
Patch #11 is not required, but demonstrates on a DRA76-evm how this
series
can be used.

On arm, if overlay are supported, this series increases the size of
the SPL
by 3-4 kB.

Changes in v2:
- reworked board_fit_get_additionnal_images() and how it used in
spl_fit.c
- removed dtbo generation from dtso files and use .dts extension for the
    overlays
- add dynamic allocation usage in a separate patch
- defconfig change for the am335x_evm

This series looks better.
Is this able to also handle different images then just dtbs?

Sorry I thought  had answered this.

Yes this is able to handle different image types, not just dtbos.

Have you been able to play with it ? any additional comment ?

I haven't had a time but series is going in a right direction.
I found 2 days ago that applying my patch is increasing size for some
platforms that travis is failing.
It means I would definitely suggest you to run travis on branch with all
patches applied to see if this passing or some changes need to happen.


Already done. https://travis-ci.org/jjhiblot/u-boot/builds/511617974

The failures (except dra7 which is unresolved) are all related to the 
generation of u-boot.itb (one patch replaces u-boot.img with a link to 
u-boot.itb, making travis build u-boot.itb)


Was the broken  platform the am335x_evm? In that case, the fix is in the 
series. I disabled advanced FIT features for this platform as this is 
definitely not needed.


Thanks,

JJ




Thanks,
Michal




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


Re: [U-Boot] [RFC PATCH v2 00/12] Add support for applications of overlays in SPL

2019-04-17 Thread Jean-Jacques Hiblot

Tom, Simon,

On 28/03/2019 15:03, Michal Simek wrote:

On 27. 03. 19 16:38, Jean-Jacques Hiblot wrote:

The purpose of this series is to provide the SPL with ability to apply
overlays for u-boot. this is only a RFC so far, to get a feedback on the
approach.

Our use-case is the support of the daughter boards of the AM65x EVM. In
Linux, each board is supported by a unique overlay. The presence of the
boards is detected at runtime, and some useful features (like USB) are
implemented on those daughter boards. Instead of providing multiple dtbs
and fall in a combinatorial pit, we propose to use DT overlays.

Patch #1 "spl: fit: Add support for applying DT overlay" has been posted
a few weeks ago by Michal Simek.
Patch #2 and #3 amend Michal's patch.
Patch #4 and #5 are simple fixes for the Makefile
Patch #6 is not required but relates to this series and will be required
later by the AM6x platform
Patch #7 may be a bit controversial. It basically replaces u-boot.img with
a symlink to u-boot.itb in case we use a "complex" FIT (ie: if
SPL_FIT_SOURCE or SPL_FIT_GENERATOR are set). This breaks buildman for
several platforms because not all the binaries embedded in the FIT are
available.
Patch #9 adds a way to dynamically select the DT overlays. That is were we
would use HW detection to select the required overlays. In that case, the
board-level code tells what overlay it needs (it gives the name of the
node).
Patch #10 disables advanced SPL FIT features to keep the size of the SPL of
the am335x_evm in check
Patch #11 is not required, but demonstrates on a DRA76-evm how this series
can be used.

On arm, if overlay are supported, this series increases the size of the SPL
by 3-4 kB.

Changes in v2:
- reworked board_fit_get_additionnal_images() and how it used in spl_fit.c
- removed dtbo generation from dtso files and use .dts extension for the
   overlays
- add dynamic allocation usage in a separate patch
- defconfig change for the am335x_evm


I don't know if you had time to look at this series. Its purpose is to 
allow the SPL to apply DT overlays to the FDT loaded for u-boot based on 
a runtime detection of the HW.


We are going to need this kind of feature in our tree, I would really 
appreciate your feedback. I don't want to go in the wrong direction.


JJ



This series looks better.
Is this able to also handle different images then just dtbs?
Thanks,
Michal


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


Re: [U-Boot] [RFC PATCH v2 00/12] Add support for applications of overlays in SPL

2019-04-17 Thread Michal Simek
On 17. 04. 19 11:34, Jean-Jacques Hiblot wrote:
> Hi Michal,
> 
> On 28/03/2019 15:03, Michal Simek wrote:
>> On 27. 03. 19 16:38, Jean-Jacques Hiblot wrote:
>>> The purpose of this series is to provide the SPL with ability to apply
>>> overlays for u-boot. this is only a RFC so far, to get a feedback on the
>>> approach.
>>>
>>> Our use-case is the support of the daughter boards of the AM65x EVM. In
>>> Linux, each board is supported by a unique overlay. The presence of the
>>> boards is detected at runtime, and some useful features (like USB) are
>>> implemented on those daughter boards. Instead of providing multiple dtbs
>>> and fall in a combinatorial pit, we propose to use DT overlays.
>>>
>>> Patch #1 "spl: fit: Add support for applying DT overlay" has been posted
>>> a few weeks ago by Michal Simek.
>>> Patch #2 and #3 amend Michal's patch.
>>> Patch #4 and #5 are simple fixes for the Makefile
>>> Patch #6 is not required but relates to this series and will be required
>>> later by the AM6x platform
>>> Patch #7 may be a bit controversial. It basically replaces u-boot.img
>>> with
>>> a symlink to u-boot.itb in case we use a "complex" FIT (ie: if
>>> SPL_FIT_SOURCE or SPL_FIT_GENERATOR are set). This breaks buildman for
>>> several platforms because not all the binaries embedded in the FIT are
>>> available.
>>> Patch #9 adds a way to dynamically select the DT overlays. That is
>>> were we
>>> would use HW detection to select the required overlays. In that case,
>>> the
>>> board-level code tells what overlay it needs (it gives the name of the
>>> node).
>>> Patch #10 disables advanced SPL FIT features to keep the size of the
>>> SPL of
>>> the am335x_evm in check
>>> Patch #11 is not required, but demonstrates on a DRA76-evm how this
>>> series
>>> can be used.
>>>
>>> On arm, if overlay are supported, this series increases the size of
>>> the SPL
>>> by 3-4 kB.
>>>
>>> Changes in v2:
>>> - reworked board_fit_get_additionnal_images() and how it used in
>>> spl_fit.c
>>> - removed dtbo generation from dtso files and use .dts extension for the
>>>    overlays
>>> - add dynamic allocation usage in a separate patch
>>> - defconfig change for the am335x_evm
>> This series looks better.
>> Is this able to also handle different images then just dtbs?
> 
> Sorry I thought  had answered this.
> 
> Yes this is able to handle different image types, not just dtbos.
> 
> Have you been able to play with it ? any additional comment ?

I haven't had a time but series is going in a right direction.
I found 2 days ago that applying my patch is increasing size for some
platforms that travis is failing.
It means I would definitely suggest you to run travis on branch with all
patches applied to see if this passing or some changes need to happen.

Thanks,
Michal



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


Re: [U-Boot] [RFC PATCH v2 00/12] Add support for applications of overlays in SPL

2019-04-17 Thread Jean-Jacques Hiblot

Hi Michal,

On 28/03/2019 15:03, Michal Simek wrote:

On 27. 03. 19 16:38, Jean-Jacques Hiblot wrote:

The purpose of this series is to provide the SPL with ability to apply
overlays for u-boot. this is only a RFC so far, to get a feedback on the
approach.

Our use-case is the support of the daughter boards of the AM65x EVM. In
Linux, each board is supported by a unique overlay. The presence of the
boards is detected at runtime, and some useful features (like USB) are
implemented on those daughter boards. Instead of providing multiple dtbs
and fall in a combinatorial pit, we propose to use DT overlays.

Patch #1 "spl: fit: Add support for applying DT overlay" has been posted
a few weeks ago by Michal Simek.
Patch #2 and #3 amend Michal's patch.
Patch #4 and #5 are simple fixes for the Makefile
Patch #6 is not required but relates to this series and will be required
later by the AM6x platform
Patch #7 may be a bit controversial. It basically replaces u-boot.img with
a symlink to u-boot.itb in case we use a "complex" FIT (ie: if
SPL_FIT_SOURCE or SPL_FIT_GENERATOR are set). This breaks buildman for
several platforms because not all the binaries embedded in the FIT are
available.
Patch #9 adds a way to dynamically select the DT overlays. That is were we
would use HW detection to select the required overlays. In that case, the
board-level code tells what overlay it needs (it gives the name of the
node).
Patch #10 disables advanced SPL FIT features to keep the size of the SPL of
the am335x_evm in check
Patch #11 is not required, but demonstrates on a DRA76-evm how this series
can be used.

On arm, if overlay are supported, this series increases the size of the SPL
by 3-4 kB.

Changes in v2:
- reworked board_fit_get_additionnal_images() and how it used in spl_fit.c
- removed dtbo generation from dtso files and use .dts extension for the
   overlays
- add dynamic allocation usage in a separate patch
- defconfig change for the am335x_evm

This series looks better.
Is this able to also handle different images then just dtbs?


Sorry I thought  had answered this.

Yes this is able to handle different image types, not just dtbos.

Have you been able to play with it ? any additional comment ?

JJ



Thanks,
Michal


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


[U-Boot] [PATCH] kwbimage: fixing the issue with proper return code checking

2019-04-17 Thread Young Xiao
EVP_VerifyFinal would return one of three values:
1 if the data is verified to be correct;
0 if it is incorrect;
-1 if there is any failure in the verification process.

The varification in unpatched version is wrong, since it ignored
the return value of -1.

The bug allows a malformed signature to be treated as a good
signature rather than as an error. This issue affects the
signature checks on DSA ans ECDSA keys used with SSL/TLS.

This issue is similar to CVE-2008-5077, CVE-2009-0021,
CVE-2009-0025, CVE-2009-0046 ~ CVE-2009-0049.

Signed-off-by: Young Xiao <92siuy...@gmail.com>
---
 tools/kwbimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index dffaf90..b8f8d38 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -701,7 +701,7 @@ int kwb_verify(RSA *key, void *data, int datasz, struct 
sig_v1 *sig,
goto err_ctx;
}
 
-   if (!EVP_VerifyFinal(ctx, sig->sig, sizeof(sig->sig), evp_key)) {
+   if (EVP_VerifyFinal(ctx, sig->sig, sizeof(sig->sig), evp_key) != 1) {
ret = openssl_err("Could not verify signature");
goto err_ctx;
}
-- 
2.7.4

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


[U-Boot] [PATCH] Enable CONFIG_SPI_FLASH to Kconfig for non-TFA

2019-04-17 Thread Chuanhua Han
This enables the folowing to Kconfig:
CONFIG_SPI_FLASH

Signed-off-by: Chuanhua Han 
---
 configs/ls2080ardb_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/ls2080ardb_defconfig b/configs/ls2080ardb_defconfig
index a1ddc1add6..d54bb8d922 100644
--- a/configs/ls2080ardb_defconfig
+++ b/configs/ls2080ardb_defconfig
@@ -41,6 +41,7 @@ CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_E1000=y
-- 
2.17.1

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


[U-Boot] [PATCH] Enable CONFIG_SPI_FLASH to Kconfig for non-TFA

2019-04-17 Thread Chuanhua Han
This enables the folowing to Kconfig:
CONFIG_SPI_FLASH

Signed-off-by: Chuanhua Han 
---
 configs/ls2080ardb_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/ls2080ardb_defconfig b/configs/ls2080ardb_defconfig
index a1ddc1add6..d54bb8d922 100644
--- a/configs/ls2080ardb_defconfig
+++ b/configs/ls2080ardb_defconfig
@@ -41,6 +41,7 @@ CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_E1000=y
-- 
2.17.1

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


Re: [U-Boot] [PATCH v2 2/8] video/console: Implement reverse video ANSI sequence for DM_VIDEO

2019-04-17 Thread Anatolij Gustschin
On Sun, 14 Apr 2019 15:05:36 +0200
Anatolij Gustschin ag...@denx.de wrote:
...
> Changes in v2:
>  - Fix to render standard bg colors (as used to be before v1 2/8 patch).
>Catched by "dm video_ansi" test.
> 
>  drivers/video/vidconsole-uclass.c | 13 +++--
>  drivers/video/video-uclass.c  |  1 +
>  include/video.h   |  2 ++
>  3 files changed, 14 insertions(+), 2 deletions(-)

Applied to u-boot-video/master, thanks!

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


Re: [U-Boot] [PATCH v2 1/1] video: backlight: Parse PWM polarity cell

2019-04-17 Thread Anatolij Gustschin
On Fri, 12 Apr 2019 08:56:27 +0300
Stefan Mavrodiev ste...@olimex.com wrote:
...
> Changes for v2:
> - Check if phandle has polarity cell
> - Add missing signed-off-by
> 
>  drivers/video/pwm_backlight.c | 11 +++
>  1 file changed, 11 insertions(+)

Applied to u-boot-video/master, thanks!

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


[U-Boot] [PATCH 2/2] fs: cbfs: add file_cbfs_init_ext(..)

2019-04-17 Thread Christian Gmeiner
On Intel Apollolake the BIOS region on the flash is mapped right below 4GiB
in the address space. However, 256KiB right below 4GiB is decoded by read-only
SRAM. For this case we need a new API to handle this case - 
file_cbfs_init_ext().

This patch only does the groundwork to fix this issue. The caller of this
API is responsible to calucalte/determine the correct cbfs addresses.

Signed-off-by: Christian Gmeiner 
---
 fs/cbfs/cbfs.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c
index c60a8d5dc1..97272ce5e8 100644
--- a/fs/cbfs/cbfs.c
+++ b/fs/cbfs/cbfs.c
@@ -193,6 +193,19 @@ void file_cbfs_init(uintptr_t end_of_rom)
initialized = 1;
 }
 
+void file_cbfs_init_ext(uintptr_t header, uintptr_t cbfs_start, u32 cbfs_size)
+{
+   initialized = 0;
+
+   if (file_cbfs_load_header(header, _header))
+   return;
+
+   file_cbfs_fill_cache((u8 *)cbfs_start, cbfs_size, cbfs_header.align);
+
+   if (file_cbfs_result == CBFS_SUCCESS)
+   initialized = 1;
+}
+
 const struct cbfs_header *file_cbfs_get_header(void)
 {
if (initialized) {
-- 
2.20.1

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


[U-Boot] [PATCH 1/2] fs: cbfs: make file_cbfs_load_header(..) independent of end-of-rom

2019-04-17 Thread Christian Gmeiner
Signed-off-by: Christian Gmeiner 
---
 fs/cbfs/cbfs.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c
index 7b2513cb24..c60a8d5dc1 100644
--- a/fs/cbfs/cbfs.c
+++ b/fs/cbfs/cbfs.c
@@ -162,13 +162,10 @@ static void file_cbfs_fill_cache(u8 *start, u32 size, u32 
align)
 }
 
 /* Get the CBFS header out of the ROM and do endian conversion. */
-static int file_cbfs_load_header(uintptr_t end_of_rom,
-struct cbfs_header *header)
+static int file_cbfs_load_header(uintptr_t addr, struct cbfs_header *header)
 {
-   struct cbfs_header *header_in_rom;
-   int32_t offset = *(u32 *)(end_of_rom - 3);
+   struct cbfs_header *header_in_rom = (struct cbfs_header *)addr;
 
-   header_in_rom = (struct cbfs_header *)(end_of_rom + offset + 1);
swap_header(header, header_in_rom);
 
if (header->magic != good_magic || header->offset >
@@ -183,8 +180,9 @@ void file_cbfs_init(uintptr_t end_of_rom)
 {
u8 *start_of_rom;
initialized = 0;
+   const int32_t offset = *(u32 *)(end_of_rom - 3);
 
-   if (file_cbfs_load_header(end_of_rom, _header))
+   if (file_cbfs_load_header(end_of_rom + offset + 1, _header))
return;
 
start_of_rom = (u8 *)(end_of_rom + 1 - cbfs_header.rom_size);
-- 
2.20.1

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


Re: [U-Boot] Pull request: u-boot-imx u -boot-imx-201900415

2019-04-17 Thread Tom Rini
On Mon, Apr 15, 2019 at 09:48:09AM +0200, Stefano Babic wrote:

> Hi Tom,
> 
> please pull from u-boot-imx, thanks !
> 
> Travis:
>   https://travis-ci.org/sbabic/u-boot-imx/builds/520010229
>   
> The following changes since commit 015289580f81733f7358227743e3e5881653a797:
> 
>   Merge tag 'u-boot-stm32-20190412' of
> https://github.com/patrickdelaunay/u-boot (2019-04-12 15:43:19 -0400)
> 
> are available in the Git repository at:
> 
>   git://www.denx.de/git/u-boot-imx.git tags/u-boot-imx-20190415
> 
> for you to fetch changes up to e0627f77f55ea8d606cd4b0902bc47ffaad220d0:
> 
>   board: tbs2910: Remove CMD_FDT support in defconfig to reduce u-boot
> size (2019-04-14 21:33:12 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Pull request for UEFI sub-system for v2019.07-rc1 (2)

2019-04-17 Thread Tom Rini
On Sun, Apr 14, 2019 at 09:09:25PM +0200, Heinrich Schuchardt wrote:

> The following changes since commit 40a9546c7b6217a78a3a010a0142529a837e46b6:
> 
>   Merge branch '2019-04-11-ti-master-imports' (2019-04-12 12:22:43 -0400)
> 
> are available in the Git repository at:
> 
>   https://git.denx.de/u-boot-efi.git tags/efi-2019-07-rc1-2
> 
> for you to fetch changes up to 8688b753916bfdde3c2911f14d4489c36e705db7:
> 
>   efi_selftest: expect boot services data for fdt (2019-04-12 22:09:09
> +0200)
> 
> Travis CI showed no errors:
> https://travis-ci.org/xypron2/u-boot/builds/519424329
> 
> Primary key fingerprint:
> 6DC4 F9C7 1F29 A6FA 06B7  6D33 C481 DBBC 2C05 1AC4
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Please pull u-boot-video

2019-04-17 Thread Tom Rini
On Sun, Apr 14, 2019 at 08:10:51PM +0200, Anatolij Gustschin wrote:

> Hi Tom,
> 
> please pull video updates for v2019.07-rc1.
> 
> Travis CI: https://travis-ci.org/vdsao/u-boot-video/builds/51990
> 
> Thanks,
> Anatolij
> 
> The following changes since commit cf5eebeb18f7790d5030eb94f51fca0ebcd6e406:
> 
>   Merge tag 'pull-12apr19' of git://git.denx.de/u-boot-dm (2019-04-13 
> 08:27:35 -0400)
> 
> are available in the Git repository at:
> 
>   git://git.denx.de/u-boot-video.git tags/video-for-2019.07-rc1
> 
> for you to fetch changes up to 7b64a70a3a0113f9cd5356b3260d4740edb03265:
> 
>   sunxi: allow boards to de-select SYS_WHITE_ON_BLACK font scheme (2019-04-14 
> 14:18:48 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v2] mtd: spi: Improve spi_nor_write_data() implementation

2019-04-17 Thread Vignesh Raghavendra



On 16/04/19 5:29 PM, Rajat Srivastava wrote:

Maximum write size in a single write operation in
spi_nor_write_data() function can be equal to slave
tx buffer, which is adjusted in spi_mem_adjust_op_size()
and write operation gets fragmented.

Previously data write for the above fragmentation
didn't incorporate write enable and status checks.
It was sent to flash at page offsets only.

Signed-off-by: Rajat Srivastava 
---
Changes in v2:
  Incorporating review comments given by Vignesh.
  [PATCH v1]: https://patchwork.ozlabs.org/patch/1078183/


Changes look good as such, but I cannot seem to apply these patch 
locally as mbox for testing. Looking at mail source, it seems to be sent 
in binary format instead of plain text. Could you resend in plain text?	




  drivers/mtd/spi/spi-nor-core.c | 28 ++--
  1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index c4e2f6a08f..8e754d445d 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -116,7 +116,6 @@ static ssize_t spi_nor_write_data(struct spi_nor *nor, 
loff_t to, size_t len,
   SPI_MEM_OP_ADDR(nor->addr_width, to, 1),
   SPI_MEM_OP_NO_DUMMY,
   SPI_MEM_OP_DATA_OUT(len, buf, 1));
-   size_t remaining = len;
int ret;
  
  	/* get transfer protocols. */

@@ -127,22 +126,19 @@ static ssize_t spi_nor_write_data(struct spi_nor *nor, 
loff_t to, size_t len,
if (nor->program_opcode == SPINOR_OP_AAI_WP && nor->sst_write_second)
op.addr.nbytes = 0;
  
-	while (remaining) {

-   op.data.nbytes = remaining < UINT_MAX ? remaining : UINT_MAX;
-   ret = spi_mem_adjust_op_size(nor->spi, );
-   if (ret)
-   return ret;
+   op.data.nbytes = len < UINT_MAX ? len : UINT_MAX;
+   ret = spi_mem_adjust_op_size(nor->spi, );
+   if (ret)
+   return ret;
  
-		ret = spi_mem_exec_op(nor->spi, );

-   if (ret)
-   return ret;
+   ret = spi_mem_exec_op(nor->spi, );
+   if (ret)
+   return ret;
  
-		op.addr.val += op.data.nbytes;

-   remaining -= op.data.nbytes;
-   op.data.buf.out += op.data.nbytes;
-   }
+   op.addr.val += op.data.nbytes;
+   op.data.buf.out += op.data.nbytes;
  
-	return len;

+   return op.data.nbytes;
  }
  
  /*

@@ -1101,10 +1097,6 @@ static int spi_nor_write(struct mtd_info *mtd, loff_t 
to, size_t len,
goto write_err;
*retlen += written;
i += written;
-   if (written != page_remain) {
-   ret = -EIO;
-   goto write_err;
-   }
}
  
  write_err:



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


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

2019-04-17 Thread Vignesh Raghavendra



On 17/04/19 5:51 PM, Jagan Teki wrote:

Hi Tom,

Please pull this PR.



Thanks Jagan!

Tom,
These patches depend on [1] that drops cl-som-am57x board support.
http://patchwork.ozlabs.org/patch/1085281/

Regards
Vignesh


Summary:
- drop non-DM code from ti_qspi
- support spi-mem for ti_qspi

thanks,
Jagan.

The following changes since commit 216800acf1fbf9f498455bf3c92d4513d9a4c681:

   Merge branch 'master' of git://git.denx.de/u-boot-spi (2019-04-14 00:03:06 
-0400)

are available in the Git repository at:

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

for you to fetch changes up to 4c96c61216719155b3a1d51f6373e996335861de:

   spi: ti_qspi: Convert to spi-mem ops (2019-04-17 17:43:54 +0530)


Vignesh Raghavendra (2):
   spi: ti_qspi: Drop non DM code
   spi: ti_qspi: Convert to spi-mem ops

  doc/driver-model/MIGRATION.txt |   1 -
  drivers/spi/Kconfig|  13 +-
  drivers/spi/Makefile   |   2 +-
  drivers/spi/ti_qspi.c  | 351 -
  include/configs/am43xx_evm.h   |   6 -
  include/configs/am57xx_evm.h   |   5 -
  include/configs/cm_t43.h   |   3 -
  include/configs/dra7xx_evm.h   |   5 -
  scripts/config_whitelist.txt   |   3 -
  9 files changed, 108 insertions(+), 281 deletions(-)


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


[U-Boot] [PATCH] x86: coreboot: make it possible to process unhandled tags

2019-04-17 Thread Christian Gmeiner
coreboot makes it possible to add own entries into coreboot's
table at a per mainboard basis. As there might be some custom
ones it makes sense to provide a way to process them.

Signed-off-by: Christian Gmeiner 
---
 arch/x86/cpu/coreboot/tables.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/cpu/coreboot/tables.c b/arch/x86/cpu/coreboot/tables.c
index bc18b710c9..a7c55c7dd1 100644
--- a/arch/x86/cpu/coreboot/tables.c
+++ b/arch/x86/cpu/coreboot/tables.c
@@ -109,6 +109,8 @@ static void cb_parse_string(unsigned char *ptr, char **info)
*info = (char *)((struct cb_string *)ptr)->string;
 }
 
+__weak void cb_parse_unhandled(u32 tag, unsigned char *ptr) {}
+
 static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
 {
struct cb_header *header;
@@ -211,6 +213,9 @@ static int cb_parse_header(void *addr, int len, struct 
sysinfo_t *info)
case CB_TAG_VBNV:
cb_parse_vbnv(ptr, info);
break;
+   default:
+   cb_parse_unhandled(rec->tag, ptr);
+   break;
}
 
ptr += rec->size;
-- 
2.20.1

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


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

2019-04-17 Thread Jagan Teki
Hi Tom,

Please pull this PR.

Summary:
- Convert DM_MMC and DM_SCSI
- A20, R40, H6 Linux dts(i) sync
- CLK, RESET support for sunxi, sun8_emac net drivers

thanks,
Jagan.

The following changes since commit 216800acf1fbf9f498455bf3c92d4513d9a4c681:

  Merge branch 'master' of git://git.denx.de/u-boot-spi (2019-04-14 00:03:06 
-0400)

are available in the Git repository at:

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

for you to fetch changes up to f8c8669760610b2949d8d9ccaeef8231a44d4205:

  sunxi: update SATA driver to always use DM_SCSI (2019-04-17 14:34:45 +0530)


Andre Przywara (1):
  sunxi: update SATA driver to always use DM_SCSI

Jagan Teki (13):
  arm64: allwinner: sun50i: Sync H6 dts(i) files from Linux
  clk: sunxi: r40: Fix GMAC reset reg offset
  net: sunxi_emac: Add CLK support
  net: sun8i_emac: Retrieve GMAC clock via 'syscon' phandle
  net: sun8i_emac: Add CLK and RESET support
  board: sunxi: gmac: Remove Ethernet clock and reset
  arm: allwinner: r40: Sync R40 dts(i) files from Linux 5.1-rc2
  arm: allwinner: dts: a20: Sync A20 dts(i) files from Linux 5.1-rc2
  board: sunxi: Add R40 sata compatible
  ARM: dts: a20-m5: Enable AHCI
  ARM: dts: a20-wits-pro-a20-dkt: Enable AHCI
  ARM: dts: sun8i-r40-bananapi-m2-berry: Enable AHCI
  arm: sunxi: Enable DM_MMC and DM_SCSI

 arch/arm/Kconfig   |   2 +
 arch/arm/dts/sun50i-h6-orangepi.dtsi   |  62 +++-
 arch/arm/dts/sun50i-h6-pine-h64.dts|  88 -
 arch/arm/dts/sun50i-h6.dtsi| 398 -
 arch/arm/dts/sun7i-a20-ainol-aw1.dts   |   2 +-
 arch/arm/dts/sun7i-a20-bananapi-m1-plus.dts|  46 +--
 arch/arm/dts/sun7i-a20-bananapi.dts|  49 +--
 arch/arm/dts/sun7i-a20-bananapro.dts   |  65 +---
 arch/arm/dts/sun7i-a20-cubieboard2.dts |  21 +-
 arch/arm/dts/sun7i-a20-cubietruck.dts  |  83 ++---
 arch/arm/dts/sun7i-a20-hummingbird.dts |  60 +---
 arch/arm/dts/sun7i-a20-i12-tvbox.dts   |  47 +--
 arch/arm/dts/sun7i-a20-icnova-swac.dts |  10 +-
 arch/arm/dts/sun7i-a20-itead-ibox.dts  |  10 +-
 arch/arm/dts/sun7i-a20-lamobo-r1.dts   |  48 +--
 arch/arm/dts/sun7i-a20-m3.dts  |  21 +-
 arch/arm/dts/sun7i-a20-m5.dts  |   8 +-
 arch/arm/dts/sun7i-a20-mk808c.dts  |  26 +-
 arch/arm/dts/sun7i-a20-olimex-som-evb-emmc.dts |  35 ++
 arch/arm/dts/sun7i-a20-olimex-som-evb.dts  |  68 +---
 arch/arm/dts/sun7i-a20-olimex-som204-evb-emmc.dts  |   2 -
 arch/arm/dts/sun7i-a20-olimex-som204-evb.dts   |  36 +-
 arch/arm/dts/sun7i-a20-olinuxino-lime.dts  |  22 +-
 arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts|  11 -
 arch/arm/dts/sun7i-a20-olinuxino-lime2.dts |  34 +-
 arch/arm/dts/sun7i-a20-olinuxino-micro-emmc.dts|   2 -
 arch/arm/dts/sun7i-a20-olinuxino-micro.dts |  54 +--
 arch/arm/dts/sun7i-a20-orangepi-mini.dts   |  52 +--
 arch/arm/dts/sun7i-a20-orangepi.dts|  44 +--
 arch/arm/dts/sun7i-a20-pcduino3-nano.dts   |  31 +-
 arch/arm/dts/sun7i-a20-pcduino3.dts|  39 +-
 arch/arm/dts/sun7i-a20-primo73.dts |   4 +-
 arch/arm/dts/sun7i-a20-wexler-tab7200.dts  |  39 +-
 .../arm/dts/sun7i-a20-wits-pro-a20-dkt-u-boot.dtsi |  10 +
 arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts|  23 +-
 arch/arm/dts/sun7i-a20-yones-toptech-bd1078.dts|   2 +-
 arch/arm/dts/sun7i-a20.dtsi| 209 +++
 arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts   |  91 -
 arch/arm/dts/sun8i-r40.dtsi| 364 ++-
 arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts   |  20 +-
 arch/arm/dts/sunxi-itead-core-common.dtsi  |   6 +-
 arch/arm/mach-sunxi/Kconfig|  13 -
 board/sunxi/Makefile   |   3 -
 board/sunxi/gmac.c |   8 -
 drivers/ata/Kconfig|   8 +
 drivers/ata/Makefile   |   1 +
 board/sunxi/ahci.c => drivers/ata/ahci_sunxi.c |  11 +-
 drivers/clk/sunxi/clk_r40.c|   3 +-
 drivers/net/sun8i_emac.c   | 112 +++---
 drivers/net/sunxi_emac.c   |  28 +-
 include/configs/sunxi-common.h |   6 -
 include/dt-bindings/clock/sun8i-tcon-top.h |  11 +
 scripts/config_whitelist.txt   |   1 -
 53 files changed, 1493 insertions(+), 956 deletions(-)
 create mode 100644 arch/arm/dts/sun7i-a20-olimex-som-evb-emmc.dts
 create mode 100644 arch/arm/dts/sun7i-a20-wits-pro-a20-dkt-u-boot.dtsi
 rename board/sunxi/ahci.c => drivers/ata/ahci_sunxi.c (94%)
 create mode 100644 

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

2019-04-17 Thread Jagan Teki
Hi Tom,

Please pull this PR.

Summary:
- drop non-DM code from ti_qspi
- support spi-mem for ti_qspi

thanks,
Jagan.

The following changes since commit 216800acf1fbf9f498455bf3c92d4513d9a4c681:

  Merge branch 'master' of git://git.denx.de/u-boot-spi (2019-04-14 00:03:06 
-0400)

are available in the Git repository at:

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

for you to fetch changes up to 4c96c61216719155b3a1d51f6373e996335861de:

  spi: ti_qspi: Convert to spi-mem ops (2019-04-17 17:43:54 +0530)


Vignesh Raghavendra (2):
  spi: ti_qspi: Drop non DM code
  spi: ti_qspi: Convert to spi-mem ops

 doc/driver-model/MIGRATION.txt |   1 -
 drivers/spi/Kconfig|  13 +-
 drivers/spi/Makefile   |   2 +-
 drivers/spi/ti_qspi.c  | 351 -
 include/configs/am43xx_evm.h   |   6 -
 include/configs/am57xx_evm.h   |   5 -
 include/configs/cm_t43.h   |   3 -
 include/configs/dra7xx_evm.h   |   5 -
 scripts/config_whitelist.txt   |   3 -
 9 files changed, 108 insertions(+), 281 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RESEND PATCH v2 2/2] spi: ti_qspi: Convert to spi-mem ops

2019-04-17 Thread Jagan Teki
On Tue, Apr 16, 2019 at 9:33 PM Vignesh Raghavendra  wrote:
>
> Convert driver to use  spi-mem ops in order to support accelerated MMIO
> flash interface in generic way and for better performance.
>
> Signed-off-by: Vignesh Raghavendra 
> Reviewed-by: Tom Rini 
> ---

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


Re: [U-Boot] [RESEND PATCH v2 1/2] spi: ti_qspi: Drop non DM code

2019-04-17 Thread Jagan Teki
On Tue, Apr 16, 2019 at 9:32 PM Vignesh Raghavendra  wrote:
>
> Now that all boards using TI QSPI have moved to DM and DT, drop non DM
> code completely.
>
> Signed-off-by: Vignesh Raghavendra 
> Reviewed-by: Tom Rini 
> ---
>  drivers/spi/Kconfig  |  13 +-
>  drivers/spi/Makefile |   2 +-
>  drivers/spi/ti_qspi.c| 231 ++-
>  include/configs/am43xx_evm.h |   6 -
>  include/configs/am57xx_evm.h |   5 -
>  include/configs/cm_t43.h |   3 -
>  include/configs/dra7xx_evm.h |   5 -
>  scripts/config_whitelist.txt |   3 -

Fixed config_whitelist.txt rebase and updated MIGRATION.txt.

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


[U-Boot] [PATCH v1 5/6] dm: arm: imx: cx9020: remove unused mmc functions

2019-04-17 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

These mmc functions were not used anymore since DM_MMC was introduced.

Acked-by: Patrick Bruenn 
Signed-off-by: Steffen Dirkwinkel 
---

 board/beckhoff/mx53cx9020/mx53cx9020.c | 55 --
 1 file changed, 55 deletions(-)

diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
b/board/beckhoff/mx53cx9020/mx53cx9020.c
index fdef4477d9a..de1d85f1518 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -9,7 +9,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -20,11 +19,8 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
-#include 
 #include 
 
 enum LED_GPIOS {
@@ -148,57 +144,6 @@ int board_ehci_hcd_init(int port)
 }
 #endif
 
-#ifdef CONFIG_FSL_ESDHC
-struct fsl_esdhc_cfg esdhc_cfg[2] = {
-   {MMC_SDHC1_BASE_ADDR},
-   {MMC_SDHC2_BASE_ADDR},
-};
-
-int board_mmc_getcd(struct mmc *mmc)
-{
-   struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
-   int ret;
-
-   gpio_request(GPIO_SD1_CD, "GPIO_SD1_CD");
-   gpio_request(GPIO_SD2_CD, "GPIO_SD2_CD");
-   gpio_direction_input(GPIO_SD1_CD);
-   gpio_direction_input(GPIO_SD2_CD);
-
-   if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
-   ret = !gpio_get_value(GPIO_SD1_CD);
-   else
-   ret = !gpio_get_value(GPIO_SD2_CD);
-
-   return ret;
-}
-
-int board_mmc_init(bd_t *bis)
-{
-   u32 index;
-   int ret;
-
-   esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
-   esdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
-
-   for (index = 0; index < CONFIG_SYS_FSL_ESDHC_NUM; index++) {
-   switch (index) {
-   case 0:
-   break;
-   case 1:
-   break;
-   default:
-   printf("Warning: you configured more ESDHC 
controller(%d) as supported by the board(2)\n",
-  CONFIG_SYS_FSL_ESDHC_NUM);
-   return -EINVAL;
-   }
-   ret = fsl_esdhc_initialize(bis, _cfg[index]);
-   if (ret)
-   return ret;
-   }
-
-   return 0;
-}
-#endif
 
 static int power_init(void)
 {
-- 
2.21.0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RESEND PATCH 0/3] arm: Introduce writel/readl_relaxed accessors

2019-04-17 Thread Jagan Teki
On Mon, Apr 15, 2019 at 1:21 PM André Przywara  wrote:
>
> On 15/04/2019 07:22, Jagan Teki wrote:
>
> Hi,
>
> > On Mon, Apr 15, 2019 at 11:40 AM Chen-Yu Tsai  wrote:
> >>
> >> On Mon, Apr 15, 2019 at 2:07 PM Jagan Teki  
> >> wrote:
> >>>
> >>> On Sun, Feb 10, 2019 at 9:49 PM Andre Przywara  
> >>> wrote:
> 
>  Hi, this is a resend of what I posted some weeks ago, just adding the
>  missing Signed-off-by: in patch 2/3, as pointed out by Philipp. I used
>  the opportunity to add his Reviewed-by: tags on the first two patches.
>  (Many thanks for that!) The rest is unchanged.
>  ---
> 
>  Admittedly this is the long way round to solve some nasty SPL code size
>  problem, but it looked beneficial to others as well, so here we go:
> 
>  arch/arm/include/asm/io.h looks like it's been around since the dawn of
>  time, and was more or less blindly copied from Linux.
>  We don't use and don't need most of the definitions, and mainline Linux
>  got rid of them anyway, so patch 1/3 cleans up this header file to
>  just contain what we need in U-Boot.
> 
>  Patch 2/3 introduces readl/writel_relaxed accessors, which are cheaper,
>  but more importantly save one (barrier) instruction per accessor. This
>  helps to bring down code size, since especially DRAM controller inits in
>  SPLs tend to do a lot of MMIO.
> 
>  Consequently patch 3/3 introduces them in the Allwinner H6 DRAM driver,
>  which reduces the SPL size by a whopping 2KB, due to a twist:
>  The AArch64 exception table needs to be 2KB aligned, but we don't do
>  anything special about it the linker script. So depending on where the
>  code before the vectors ends, we have potentially large padding:
>  At the moment this last address is 0x1824 for the H6, so the vectors can
>  only start at 0x2000. By reducing the code size before the vectors by 
>  just
>  (at least) 9 instructions, the vectors start at 0x1800 and we save most 
>  of
>  the padding.
> >>>
> >>> How come it reduces to 2KB? I can see the diff size of 160 bytes for 
> >>> gcc-6.3.1
> >>>
> >>> ₹ aarch64-linux-gnu-size spl/u-boot-spl*
> >>>text   databssdechexfilename
> >>>   28376408504  29288   7268spl/u-boot-spl
> >>>
> >>> ₹ aarch64-linux-gnu-size spl/u-boot-spl*
> >>>text   databssdechexfilename
> >>>   28216408504  29128   71c8spl/u-boot-spl
> >>
> >> Because of section alignment issues? I believe Andre is referring to the
> >> size of the whole file. Since it gets loaded as a whole, the total size
> >> is what matters, not the size of the individual sections.
> >
> > Well, the input for final sunxi-spl.bin would be u-boot-spl and the
> > above shows the size of file as well 29128 bytes with -160 bytes from
> > 29288.
> >
> > Since the size of sunxi-spl.bin is truncated to 32K, I couldn't see
> > any difference either.
>
> As mentioned in the commit messasge, this is a fragile topic. Since
> commit ef331e3685fe ("armv8: Disable exception vectors in SPL by
> default") we disable the SPL exception vectors by default now, so the
> numbers are now different.

Sorry, I over looked the commit messages.

> You should be able to see the 2K saving with the SPL exception vectors
> explicitly enabled in menuconfig.

Oh. So I enabled the vectors via ARMV8_SPL_EXCEPTION_VECTORS=y but it
seems increased the SPL size.

₹ aarch64-linux-gnu-size spl/u-boot-spl
   text   databssdechexfilename
  30130408504  31042   7942spl/u-boot-spl
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 6/6] arm: imx: cx9020: remove unnecessary includes

2019-04-17 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

There are several includes in mx53cx9020.c which are not required
anymore.

Acked-by: Patrick Bruenn 
Signed-off-by: Steffen Dirkwinkel 
---

 board/beckhoff/mx53cx9020/mx53cx9020.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
b/board/beckhoff/mx53cx9020/mx53cx9020.c
index de1d85f1518..9450d925f6f 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -8,20 +8,12 @@
  */
 
 #include 
-#include 
-#include 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
 
 enum LED_GPIOS {
GPIO_SD1_CD = IMX_GPIO_NR(1, 1),
-- 
2.21.0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 4/6] dm: arm: imx: cx9020: migrate to dm_video

2019-04-17 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

Enable DM_VIDEO in config and don't overwrite console so it can be set
from environment

Acked-by: Patrick Bruenn 
Signed-off-by: Steffen Dirkwinkel 
---

 board/beckhoff/mx53cx9020/Makefile   |  2 +-
 board/beckhoff/mx53cx9020/mx53cx9020.c   | 11 -
 board/beckhoff/mx53cx9020/mx53cx9020_video.c | 51 +---
 configs/mx53cx9020_defconfig |  5 +-
 include/configs/mx53cx9020.h |  6 +--
 5 files changed, 28 insertions(+), 47 deletions(-)

diff --git a/board/beckhoff/mx53cx9020/Makefile 
b/board/beckhoff/mx53cx9020/Makefile
index 423a5532ca6..7f15fc5746d 100644
--- a/board/beckhoff/mx53cx9020/Makefile
+++ b/board/beckhoff/mx53cx9020/Makefile
@@ -4,4 +4,4 @@
 # Patrick Bruenn 
 
 obj-y   += mx53cx9020.o
-obj-$(CONFIG_VIDEO) += mx53cx9020_video.o
+obj-$(CONFIG_DM_VIDEO) += mx53cx9020_video.o
diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
b/board/beckhoff/mx53cx9020/mx53cx9020.c
index 79ea4560283..fdef4477d9a 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -23,8 +23,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -232,15 +230,6 @@ int board_early_init_f(void)
return 0;
 }
 
-/*
- * Do not overwrite the console
- * Use always serial for U-Boot console
- */
-int overwrite_console(void)
-{
-   return 1;
-}
-
 int board_init(void)
 {
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
diff --git a/board/beckhoff/mx53cx9020/mx53cx9020_video.c 
b/board/beckhoff/mx53cx9020/mx53cx9020_video.c
index 85f1cdae8af..bf472902562 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020_video.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020_video.c
@@ -8,29 +8,34 @@
  */
 
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
+#include 
+#include 
 
 #define CX9020_DVI_PWD IMX_GPIO_NR(6, 1)
 
-static struct fb_videomode const vga_640x480 = {
-   .name = "VESA_VGA_640x480",
-   .refresh = 60,
-   .xres = 640,
-   .yres = 480,
-   .pixclock = 39721,  /* picosecond (25.175 MHz) */
-   .left_margin = 40,
-   .right_margin = 60,
-   .upper_margin = 10,
-   .lower_margin = 10,
-   .hsync_len = 20,
-   .vsync_len = 10,
-   .sync = 0,
-   .vmode = FB_VMODE_NONINTERLACED
-};
+struct display_info_t const displays[] = {{
+   .bus= -1,
+   .addr   = 0,
+   .pixfmt = IPU_PIX_FMT_RGB24,
+   .detect = NULL,
+   .enable = NULL,
+   .mode   = {
+   .name   = "DVI",
+   .refresh = 60,
+   .xres = 640,
+   .yres = 480,
+   .pixclock = 39721,  /* picosecond (25.175 MHz) */
+   .left_margin = 40,
+   .right_margin = 60,
+   .upper_margin = 10,
+   .lower_margin = 10,
+   .hsync_len = 20,
+   .vsync_len = 10,
+   .sync = 0,
+   .vmode = FB_VMODE_NONINTERLACED
+} } };
+size_t display_count = ARRAY_SIZE(displays);
 
 void setup_iomux_lcd(void)
 {
@@ -39,11 +44,3 @@ void setup_iomux_lcd(void)
gpio_request(CX9020_DVI_PWD, "CX9020_DVI_PWD");
gpio_direction_output(CX9020_DVI_PWD, 1);
 }
-
-int board_video_skip(void)
-{
-   const int ret = ipuv3_fb_init(_640x480, 0, IPU_PIX_FMT_RGB24);
-   if (ret)
-   printf("VESA VG 640x480 cannot be configured: %d\n", ret);
-   return ret;
-}
diff --git a/configs/mx53cx9020_defconfig b/configs/mx53cx9020_defconfig
index 93c113aba73..11b414f790e 100644
--- a/configs/mx53cx9020_defconfig
+++ b/configs/mx53cx9020_defconfig
@@ -33,6 +33,5 @@ CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX5=y
 CONFIG_MXC_UART=y
-CONFIG_VIDEO=y
-CONFIG_VIDEO_IPUV3=y
-# CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_IPUV3=y
\ No newline at end of file
diff --git a/include/configs/mx53cx9020.h b/include/configs/mx53cx9020.h
index 1e3ea88b77a..66a0f319c45 100644
--- a/include/configs/mx53cx9020.h
+++ b/include/configs/mx53cx9020.h
@@ -160,11 +160,7 @@
 #define CONFIG_SYS_MMC_ENV_DEV 0
 
 /* Framebuffer and LCD */
+#define CONFIG_IMX_VIDEO_SKIP
 #define CONFIG_PREBOOT
-#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_BMP_16BPP
-#define CONFIG_VIDEO_LOGO
 
 #endif /* __CONFIG_H */
-- 
2.21.0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 3/6] arm: imx: add ipu to imx53.dts and set dm-pre-reloc

2019-04-17 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

The ipu node in imx53 is needed for DM_VIDEO. We also need to set
u-boot,dm-pre-reloc to initialize before relocation.

Signed-off-by: Steffen Dirkwinkel 
---

 arch/arm/dts/imx53.dtsi | 137 
 1 file changed, 137 insertions(+)

diff --git a/arch/arm/dts/imx53.dtsi b/arch/arm/dts/imx53.dtsi
index 0fd4acc6f53..7a47602b53d 100644
--- a/arch/arm/dts/imx53.dtsi
+++ b/arch/arm/dts/imx53.dtsi
@@ -31,6 +31,7 @@
i2c0 = 
i2c1 = 
i2c2 = 
+   ipu0 = 
mmc0 = 
mmc1 = 
mmc2 = 
@@ -50,6 +51,7 @@
compatible = "simple-bus";
interrupt-parent = <>;
ranges;
+   u-boot,dm-pre-reloc;
 
aips@5000 { /* AIPS1 */
compatible = "fsl,aips-bus", "simple-bus";
@@ -273,5 +275,140 @@
status = "disabled";
};
};
+
+   ipu: ipu@1800 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "fsl,imx53-ipu";
+   reg = <0x1800 0x0800>;
+   interrupts = <11 10>;
+   clocks = < IMX5_CLK_IPU_GATE>,
+< IMX5_CLK_IPU_DI0_GATE>,
+< IMX5_CLK_IPU_DI1_GATE>;
+   clock-names = "bus", "di0", "di1";
+   resets = < 2>;
+   u-boot,dm-pre-reloc;
+
+   ipu_csi0: port@0 {
+   reg = <0>;
+   };
+
+   ipu_csi1: port@1 {
+   reg = <1>;
+   };
+
+   ipu_di0: port@2 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <2>;
+
+   ipu_di0_disp0: endpoint@0 {
+   reg = <0>;
+   };
+
+   ipu_di0_lvds0: endpoint@1 {
+   reg = <1>;
+   remote-endpoint = <_in>;
+   };
+   };
+
+   ipu_di1: port@3 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <3>;
+
+   ipu_di1_disp1: endpoint@0 {
+   reg = <0>;
+   };
+
+   ipu_di1_lvds1: endpoint@1 {
+   reg = <1>;
+   remote-endpoint = <_in>;
+   };
+
+   ipu_di1_tve: endpoint@2 {
+   reg = <2>;
+   remote-endpoint = <_in>;
+   };
+   };
+   };
+
+   tve: tve@63ff {
+   compatible = "fsl,imx53-tve";
+   reg = <0x63ff 0x1000>;
+   interrupts = <92>;
+   clocks = < IMX5_CLK_TVE_GATE>,
+< IMX5_CLK_IPU_DI1_SEL>;
+   clock-names = "tve", "di_sel";
+   status = "disabled";
+
+   port {
+   tve_in: endpoint {
+   remote-endpoint = 
<_di1_tve>;
+   };
+   };
+   };
+
+   src: src@53fd {
+   compatible = "fsl,imx53-src", "fsl,imx51-src";
+   reg = <0x53fd 0x4000>;
+   #reset-cells = <1>;
+   };
+
+   ldb: ldb@53fa8008 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "fsl,imx53-ldb";
+   reg = <0x53fa8008 0x4>;
+   gpr = <>;
+   clocks = < IMX5_CLK_LDB_DI0_SEL>,
+< IMX5_CLK_LDB_DI1_SEL>,
+< IMX5_CLK_IPU_DI0_SEL>,
+< IMX5_CLK_IPU_DI1_SEL>,
+< IMX5_CLK_LDB_DI0_GATE>,
+< IMX5_CLK_LDB_DI1_GATE>;
+   clock-names = "di0_pll", 

[U-Boot] [PATCH v1 2/6] dm: arm: imx: video: add compatible for imx53-ipu

2019-04-17 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

This code also works with imx53 ipus so we can enable it for them.

Signed-off-by: Steffen Dirkwinkel 
---

 drivers/video/imx/mxc_ipuv3_fb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/imx/mxc_ipuv3_fb.c b/drivers/video/imx/mxc_ipuv3_fb.c
index 3e38d4bdcc3..1aca9eba228 100644
--- a/drivers/video/imx/mxc_ipuv3_fb.c
+++ b/drivers/video/imx/mxc_ipuv3_fb.c
@@ -685,6 +685,7 @@ static int ipuv3_video_bind(struct udevice *dev)
 
 static const struct udevice_id ipuv3_video_ids[] = {
{ .compatible = "fsl,imx6q-ipu" },
+   { .compatible = "fsl,imx53-ipu" },
{ }
 };
 
-- 
2.21.0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 1/6] dm: arm: imx: cx9020: enable DM_GPIO

2019-04-17 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

Switch to DM_GPIO and add gpio_request where necessary.
This is needed for DM_VIDEO and fixes an issue with sd card detection
which was introduced by the combination of these commits:

commit 7a0425dd969c ("mmc: fsl_esdhc: make get_cd work well in dm_mmc_ops")
commit 7e04b4c751a1 ("dm: arm: imx: migrate cx9020 to CONFIG_DM_MMC")

Acked-by: Patrick Bruenn 
Signed-off-by: Steffen Dirkwinkel 
---

 board/beckhoff/mx53cx9020/mx53cx9020.c   | 25 
 board/beckhoff/mx53cx9020/mx53cx9020_video.c |  1 +
 configs/mx53cx9020_defconfig |  2 ++
 3 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
b/board/beckhoff/mx53cx9020/mx53cx9020.c
index 79d8a62cf1b..79ea4560283 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -91,6 +91,9 @@ void weim_cs0_settings(u32 mode)
 
 static void setup_gpio_eim(void)
 {
+   gpio_request(GPIO_C3_STATUS, "GPIO_C3_STATUS");
+   gpio_request(GPIO_C3_DONE, "GPIO_C3_DONE");
+   gpio_request(GPIO_C3_CONFIG, "GPIO_C3_CONFIG");
gpio_direction_input(GPIO_C3_STATUS);
gpio_direction_input(GPIO_C3_DONE);
gpio_direction_output(GPIO_C3_CONFIG, 1);
@@ -100,6 +103,7 @@ static void setup_gpio_eim(void)
 
 static void setup_gpio_sups(void)
 {
+   gpio_request(GPIO_SUPS_INT, "GPIO_SUPS_INT");
gpio_direction_input(GPIO_SUPS_INT);
 
static const int BLINK_INTERVALL = 5;
@@ -116,6 +120,16 @@ static void setup_gpio_sups(void)
 
 static void setup_gpio_leds(void)
 {
+   gpio_request(GPIO_LED_SD2_R, "GPIO_LED_SD2_R");
+   gpio_request(GPIO_LED_SD2_B, "GPIO_LED_SD2_B");
+   gpio_request(GPIO_LED_SD2_G, "GPIO_LED_SD2_G");
+   gpio_request(GPIO_LED_SD1_R, "GPIO_LED_SD1_R");
+   gpio_request(GPIO_LED_SD1_B, "GPIO_LED_SD1_B");
+   gpio_request(GPIO_LED_SD1_G, "GPIO_LED_SD1_G");
+   gpio_request(GPIO_LED_PWR_R, "GPIO_LED_PWR_R");
+   gpio_request(GPIO_LED_PWR_B, "GPIO_LED_PWR_B");
+   gpio_request(GPIO_LED_PWR_G, "GPIO_LED_PWR_G");
+
gpio_direction_output(GPIO_LED_SD2_R, 0);
gpio_direction_output(GPIO_LED_SD2_B, 0);
gpio_direction_output(GPIO_LED_SD2_G, 0);
@@ -147,6 +161,8 @@ int board_mmc_getcd(struct mmc *mmc)
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
int ret;
 
+   gpio_request(GPIO_SD1_CD, "GPIO_SD1_CD");
+   gpio_request(GPIO_SD2_CD, "GPIO_SD2_CD");
gpio_direction_input(GPIO_SD1_CD);
gpio_direction_input(GPIO_SD2_CD);
 
@@ -212,10 +228,6 @@ static void clock_1GHz(void)
 
 int board_early_init_f(void)
 {
-   setup_gpio_leds();
-   setup_gpio_sups();
-   setup_gpio_eim();
-   setup_iomux_lcd();
 
return 0;
 }
@@ -235,6 +247,11 @@ int board_init(void)
 
mxc_set_sata_internal_clock();
 
+   setup_gpio_leds();
+   setup_gpio_sups();
+   setup_gpio_eim();
+   setup_iomux_lcd();
+
return 0;
 }
 
diff --git a/board/beckhoff/mx53cx9020/mx53cx9020_video.c 
b/board/beckhoff/mx53cx9020/mx53cx9020_video.c
index 4055bccc2b7..85f1cdae8af 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020_video.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020_video.c
@@ -36,6 +36,7 @@ void setup_iomux_lcd(void)
 {
/* Turn on DVI_PWD */
imx_iomux_v3_setup_pad(MX53_PAD_CSI0_DAT15__GPIO6_1);
+   gpio_request(CX9020_DVI_PWD, "CX9020_DVI_PWD");
gpio_direction_output(CX9020_DVI_PWD, 1);
 }
 
diff --git a/configs/mx53cx9020_defconfig b/configs/mx53cx9020_defconfig
index 831d50925f3..93c113aba73 100644
--- a/configs/mx53cx9020_defconfig
+++ b/configs/mx53cx9020_defconfig
@@ -24,7 +24,9 @@ CONFIG_DEFAULT_DEVICE_TREE="imx53-cx9020"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_FPGA_ALTERA=y
 CONFIG_FPGA_CYCLON2=y
+CONFIG_DM=y
 CONFIG_DM_MMC=y
+CONFIG_DM_GPIO=y
 CONFIG_FSL_ESDHC=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
-- 
2.21.0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 0/6] arm: imx: cx9020: Migrate to DM_VIDEO and DM_GPIO

2019-04-17 Thread linux-kernel-dev
From: Steffen Dirkwinkel 


This series migrates mx53cx9020 to DM_VIDEO and DM_GPIO.
The first patch allows the board to boot again by enabling DM_GPIO.
This was broken due to card detect not working with a combination
of previous commits.
Patches 2-4 add ipu device tree nodes for mx53, enable them in the video
driver and migrate the board to using DM_VIDEO.
The last patches remove functions which were used before DM_MMC and
uneccessary includes.


Steffen Dirkwinkel (6):
  dm: arm: imx: cx9020: enable DM_GPIO
  dm: arm: imx: video: add compatible for imx53-ipu
  arm: imx: add ipu to imx53.dts and set dm-pre-reloc
  dm: arm: imx: cx9020: migrate to dm_video
  dm: arm: imx: cx9020: remove unused mmc functions
  arm: imx: cx9020: remove unnecessary includes

 arch/arm/dts/imx53.dtsi  | 137 +++
 board/beckhoff/mx53cx9020/Makefile   |   2 +-
 board/beckhoff/mx53cx9020/mx53cx9020.c   |  95 +++--
 board/beckhoff/mx53cx9020/mx53cx9020_video.c |  52 ---
 configs/mx53cx9020_defconfig |   7 +-
 drivers/video/imx/mxc_ipuv3_fb.c |   1 +
 include/configs/mx53cx9020.h |   6 +-
 7 files changed, 188 insertions(+), 112 deletions(-)

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


Re: [U-Boot] [PATCH v2 2/2] net: eth-uclass: Support device tree MAC addresses

2019-04-17 Thread Grygorii Strashko


On 16.04.19 19:24, Thierry Reding wrote:
> From: Thierry Reding 
> 
> Add the standard Ethernet device tree bindings (imported from v5.0 of
> the Linux kernel) and implement support for reading the MAC address for
> Ethernet devices in the Ethernet uclass. If the "mac-address" property
> exists, the MAC address will be parsed from that. If that property does
> not exist, the "local-mac-address" property will be tried as fallback.
> 
> MAC addresses from device tree take precedence over the ones stored in
> a network interface card's ROM.
> 
> Acked-by: Joe Hershberger 
> Signed-off-by: Thierry Reding 
> ---
> Changes in v2:
> - use dev_read_u8_array_ptr()
> 
>  .../devicetree/bindings/net/ethernet.txt  | 66 +++
>  net/eth-uclass.c  | 26 +++-
>  2 files changed, 89 insertions(+), 3 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/net/ethernet.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/ethernet.txt 
> b/Documentation/devicetree/bindings/net/ethernet.txt
> new file mode 100644
> index ..cfc376bc977a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/ethernet.txt
> @@ -0,0 +1,66 @@
> +The following properties are common to the Ethernet controllers:
> +
> +NOTE: All 'phy*' properties documented below are Ethernet specific. For the
> +generic PHY 'phys' property, see
> +Documentation/devicetree/bindings/phy/phy-bindings.txt.
> +
> +- local-mac-address: array of 6 bytes, specifies the MAC address that was
> +  assigned to the network device;
> +- mac-address: array of 6 bytes, specifies the MAC address that was last 
> used by
> +  the boot program; should be used in cases where the MAC address assigned to
> +  the device by the boot program is different from the "local-mac-address"
> +  property;
> +- nvmem-cells: phandle, reference to an nvmem node for the MAC address;
> +- nvmem-cell-names: string, should be "mac-address" if nvmem is to be used;
> +- max-speed: number, specifies maximum speed in Mbit/s supported by the 
> device;
> +- max-frame-size: number, maximum transfer unit (IEEE defined MTU), rather 
> than
> +  the maximum frame size (there's contradiction in the Devicetree
> +  Specification).
> +- phy-mode: string, operation mode of the PHY interface. This is now a 
> de-facto
> +  standard property; supported values are:
> +  * "internal"
> +  * "mii"
> +  * "gmii"
> +  * "sgmii"
> +  * "qsgmii"
> +  * "tbi"
> +  * "rev-mii"
> +  * "rmii"
> +  * "rgmii" (RX and TX delays are added by the MAC when required)
> +  * "rgmii-id" (RGMII with internal RX and TX delays provided by the PHY, the
> + MAC should not add the RX or TX delays in this case)
> +  * "rgmii-rxid" (RGMII with internal RX delay provided by the PHY, the MAC
> + should not add an RX delay in this case)
> +  * "rgmii-txid" (RGMII with internal TX delay provided by the PHY, the MAC
> + should not add an TX delay in this case)
> +  * "rtbi"
> +  * "smii"
> +  * "xgmii"
> +  * "trgmii"
> +  * "2000base-x",
> +  * "2500base-x",
> +  * "rxaui"
> +  * "xaui"
> +  * "10gbase-kr" (10GBASE-KR, XFI, SFI)
> +- phy-connection-type: the same as "phy-mode" property but described in the
> +  Devicetree Specification;
> +- phy-handle: phandle, specifies a reference to a node representing a PHY
> +  device; this property is described in the Devicetree Specification and so
> +  preferred;
> +- phy: the same as "phy-handle" property, not recommended for new bindings.
> +- phy-device: the same as "phy-handle" property, not recommended for new
> +  bindings.
> +- rx-fifo-depth: the size of the controller's receive fifo in bytes. This
> +  is used for components that can have configurable receive fifo sizes,
> +  and is useful for determining certain configuration settings such as
> +  flow control thresholds.
> +- tx-fifo-depth: the size of the controller's transmit fifo in bytes. This
> +  is used for components that can have configurable fifo sizes.
> +- managed: string, specifies the PHY management type. Supported values are:
> +  "auto", "in-band-status". "auto" is the default, it usess MDIO for
> +  management if fixed-link is not specified.
> +
> +Child nodes of the Ethernet controller are typically the individual PHY 
> devices
> +connected via the MDIO bus (sometimes the MDIO bus controller is separate).
> +They are described in the phy.txt file in this same directory.
> +For non-MDIO PHY management see fixed-link.txt.
> diff --git a/net/eth-uclass.c b/net/eth-uclass.c
> index 4225aabf1fa1..c6d5ec013bd8 100644
> --- a/net/eth-uclass.c
> +++ b/net/eth-uclass.c
> @@ -455,6 +455,23 @@ static int eth_pre_unbind(struct udevice *dev)
>   return 0;
>  }
>  
> +static bool eth_dev_get_mac_address(struct udevice *dev, u8 mac[ARP_HLEN])
> +{
> + const uint8_t *p;
> +
> + p = dev_read_u8_array_ptr(dev, "mac-address", ARP_HLEN);
> + if (!p)
> + p = dev_read_u8_array_ptr(dev, "local-mac-address", ARP_HLEN);
> +
> 

Re: [U-Boot] [RESEND-2 PATCH 0/4] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY

2019-04-17 Thread Jagan Teki
Hi,

On Fri, Apr 12, 2019 at 4:05 PM Chen-Yu Tsai  wrote:
>
> From: Chen-Yu Tsai 
>
> (Resending yet again with correct email address now subscribed
>  and with proper cover letter subject. Sorry for the noise.)
>
> Hi everyone,
>
> This series enables EMAC (Ethernet controller) on two A83T boards,
> the Cubietruck Plus and Bananapi M3.
>
> A couple of changes are required to the clock definitions to make the
> compiler happy, as it hasn't been coverted to use the common CLK and
> DM_RESET framework. These changes are not used in the A83T code path.
>
> The other two patches enable the sun8i-emac and Realtek PHY driver in
> their respective defconfigs. The device trees already have the EMAC
> enabled.
>
> Since these are compile time issues, all patches should go through
> the same tree.
>
> Regards
> ChenYu
>
>
> Chen-Yu Tsai (4):
>   sunxi: Fix compilation of sun8i-emac for A83T
>   net: sun8i-emac: Fix compilation for A83T
>   sunxi: Enable EMAC on the Cubietruck Plus
>   sunxi: Enable EMAC on the Bananapi M3

We have EPHY clock and reset support via respective framework [1]
would you rebase these changes on top this.

[1] 
http://git.denx.de/?p=u-boot-sunxi.git;a=commitdiff;h=6b2ccabee2368d059513a9be37c0ffaa4a47ec99
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [linux-sunxi] [PATCH] phy: sun4i-usb: Fix PHY0 routing and passby configuration for MUSB

2019-04-17 Thread Jagan Teki
On Mon, Apr 15, 2019 at 1:52 PM Paul Kocialkowski
 wrote:
>
> Hi,
>
> Le vendredi 12 avril 2019 à 14:49 +0530, Jagan Teki a écrit :
> > On Thu, Mar 14, 2019 at 4:08 PM Paul Kocialkowski
> >  wrote:
> > > Recent Allwinner platforms (starting with the H3) only use the MUSB
> > > controller for peripheral mode and use HCI for host mode. As a result,
> > > extra steps need to be taken to properly route USB signals to one or
> > > the other. More precisely, the following is required:
> > > * Routing the pins to either HCI/MUSB (controlled by PHY);
> > > * Enabling USB PHY passby in HCI mode (controlled by PMU).
> > >
> > > The current code will enable passby for each PHY and reroute PHY0 to
> > > MUSB, which is inconsistent and results in broken USB peripheral support.
> > >
> > > Passby on PHY0 must only be enabled when we want to use HCI. Since
> > > host/device mode detection is not available from the PHY code and
> > > because U-Boot does not support changing the mode dynamically anyway,
> > > we can just mux the controller to MUSB if it is enabled and mux it to
> > > HCI otherwise.
> > >
> > > This fixes USB peripheral support for platforms with PHY0 dual-route,
> > > especially H3/H5 and V3s.
> > >
> > > Signed-off-by: Paul Kocialkowski 
> > > ---
> > >  drivers/phy/allwinner/phy-sun4i-usb.c | 14 +-
> > >  1 file changed, 13 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c 
> > > b/drivers/phy/allwinner/phy-sun4i-usb.c
> > > index f206fa3f5d48..4f1c7e519d71 100644
> > > --- a/drivers/phy/allwinner/phy-sun4i-usb.c
> > > +++ b/drivers/phy/allwinner/phy-sun4i-usb.c
> > > @@ -302,9 +302,21 @@ static int sun4i_usb_phy_init(struct phy *phy)
> > > data->cfg->disc_thresh, 
> > > PHY_DISCON_TH_LEN);
> > > }
> > >
> > > +#ifdef CONFIG_USB_MUSB_SUNXI
> > > +   /* Needed for HCI and conflicts with MUSB, keep PHY0 on MUSB */
> > > +   if (usb_phy->id != 0)
> > > +   sun4i_usb_phy_passby(phy, true);
> > > +
> > > +   /* Route PHY0 to MUSB to allow USB gadget */
> > > +   if (data->cfg->phy0_dual_route)
> > > +   sun4i_usb_phy0_reroute(data, true);
> > > +#else
> > > sun4i_usb_phy_passby(phy, true);
> > >
> > > -   sun4i_usb_phy0_reroute(data, true);
> > > +   /* Route PHY0 to HCI to allow USB host */
> > > +   if (data->cfg->phy0_dual_route)
> > > +   sun4i_usb_phy0_reroute(data, false);
> > > +#endif
> >
> > I think we can manage this route and passby dynamically by detecting
> > id since we have dr_mode verify the MUSB host or peripheral via
> > usb_get_dr_mode, any chance to try that way?
>
> Oh, I didn't know that U-Boot has support for usb_get_dr_mode these
> days. Thanks!
>
> So far, the sunxi port has been using Kconfig to distinguish between
> host/device (unless I'm mistaken?) so I feel like this should be a
> separate follow-up patch to convert the sunxi MUSB glue + PHY to
> detecting dr_mode using usb_get_dr_mode. This feels like a significant
> rework, too.

Yes.

>
> Also, how should we handle the OTG case? I'm not sure we can support
> having both musb host and gadget built-in at this point. But that would
> certainly be welcome as part of the rework, too.
>
> What do you think?

You mean handling dr_mode at runtime.

If yes, It is bit new where we can register the musb as UCLASS_MISC
wrapper and decide to bind driver for host and peripheral by decoding
dr_mode. and indeed host should register with UCLASS_USB and
peripheral with UCLASS_USB_GADGET_GENERIC.

I tried this wrapper before, not placed in-between because of other
work but TI musb has similar code to manage this
drivers/usb/musb-new/ti-musb.c

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


Re: [U-Boot] [PATCH v2 00/14] rockchip: Add new rk3399 boards

2019-04-17 Thread Jagan Teki
Hi Paul,

On Tue, Apr 16, 2019 at 5:29 PM Paul Kocialkowski
 wrote:
>
> Hi,
>
> Le mardi 16 avril 2019 à 16:26 +0530, Jagan Teki a écrit :
> > This series is combination of previous version[1] plus new rk3399
> > boards addition.
>
> Thanks for following-up on this series!
>
> > Overall this series add support below rk3399 boards
> > - Orangepi RK3399
> > - Nanopc T4
> > - Nanopi M4
> > - Nanopi NEO4
> > - Orangepi RK3399
> > - Rockpro64
> >
> > All the respective dts(i) files are synced from Linux 5.1-rc2 and few
> > dts(i) from linux-next.
> >
> > Nanopi NEO4, Rockpro64 are supporting via Rockchip miniloader, and rest
> > support both Rockchip miniloader along with U-Boot SPL.
> >
> > - Rockpro64, is not possible to boot via U-Boot SPL since it has dependency 
> > with LPDDR4
> >   code which is work-in-progress and as soon it arrived in mailing list, 
> > will update the
> >   same with ddr dtsi.
> > - Nanopi NEO4 has some ddr issue with[2] rk3399-sdram-ddr3-1866.dtsi,
> >   will update the same with U-Boot SPL once it is fixed.

Thanks for your time on reviewing the series.

>
> Has the status evolved since? It looks like both have SPL enabled in

For rockpro64, I'm trying hard to get things up. neo4 I have tried
many options to dig into existing rk3399-sdram-ddr3-1866.dtsi to
produce 1GB timings but not succeed at the end.

> this series. If the SPL doesn't support DRAM configuration yet, it
> should probably be explicitly disabled.

True, indeed I even tried of disabling SPL for these boards but it
rather bit hard to manage lot of Kconfig options to rework since
rk3399 make the boards do use SPL by default. Since the work for ddr
in-progress I mark it as it is.

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


Re: [U-Boot] [PATCH v2 09/14] rockchip: rk3399: Add 4GB LPDDR3-1866 DMC settings【请注意,邮件由linux-rockchip-bounces+kever.yang=rock-chips....@lists.infradead.org代发】

2019-04-17 Thread Jagan Teki
On Wed, Apr 17, 2019 at 1:10 PM Kever Yang  wrote:
>
> Hi Jagan,
>
>
> On 04/16/2019 06:56 PM, Jagan Teki wrote:
> > Add sdram dtsi file for 4GB LPDDR3-1866 DMC settings by reverse
> > engineered from the rk3399_ddr_933Mhz_v1.14.bin file.
> >
> > Full credits to 'Liviu Dudau' who is the real author for this change.
> >
> > Signed-off-by: Liviu Dudau 
> > Signed-off-by: Jagan Teki 
> > ---
> >  .../arm/dts/rk3399-sdram-lpddr3-4GB-1866.dtsi | 1535 +
>
> Could you use rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi directly?
> I think it should able to work.

I supposed to take the same, but thought that it would be some samsung
specific setting. but seems like it is nearly same and it worked. will
update to use this. thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 08/14] rockchip: dts: rk3399: nanopi4: Use CD pin as RK_FUNC_1

2019-04-17 Thread Jagan Teki
On Tue, Apr 16, 2019 at 4:40 PM Robin Murphy  wrote:
>
> On 16/04/2019 11:56, Jagan Teki wrote:
> > sdmmc cd pin is configured as RK_FUNC_GPIO which is wrong and
> > indeed failed to detect the sdcard on the board with below error
> >
> >Card did not respond to voltage select!
> >
> > So, fix it by replacing RK_FUNC_GPIO with RK_FUNC_1 which
> > is already defined in rk3399.dts so make use of same like
> > other boards.
>
> I guess the U-Boot dwmmc driver doesn't support using a GPIO? The reason
> we do this for Linux is that the dedicated function is not compatible
> with runtime power management - once we see that no card is present and
> suspend the idle controller, the CD logic is also powered off and thus
> no longer capable of generating the interrupt necessary to wake
> everything up again. The GPIO function of the same pin, however, is in
> an always-on power domain so is able to do the right thing.

I can see these gpio pins were managed via
drivers/pinctrl/rockchip/pinctrl-rk3399.c and drivers/gpio/rk_gpio.c .
On the other hand other boards do use RKFUNC_1 for CD pin(even in
Linux) but what is different in nanopi4? do other boards are yet to
change?
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RFC v3 04/10] cmd: bootefi: merge efi_install_fdt() and efi_process_fdt()

2019-04-17 Thread Heinrich Schuchardt

On 4/16/19 6:24 AM, AKASHI Takahiro wrote:

This is a preparatory patch for reworking do_bootefi() in later patch.
For simplicity, merge two functions.

Signed-off-by: AKASHI Takahiro 
---
  cmd/bootefi.c | 67 +--
  1 file changed, 28 insertions(+), 39 deletions(-)

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 8cd9644115eb..0f58f51cbc76 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -165,62 +165,51 @@ static void efi_carve_out_dt_rsv(void *fdt)
}
  }

-static efi_status_t efi_install_fdt(ulong fdt_addr)
-{
-   bootm_headers_t img = { 0 };
-   efi_status_t ret;
-   void *fdt;
-
-   fdt = map_sysmem(fdt_addr, 0);
-   if (fdt_check_header(fdt)) {
-   printf("ERROR: invalid device tree\n");
-   return EFI_INVALID_PARAMETER;
-   }
-
-   /* Create memory reservation as indicated by the device tree */
-   efi_carve_out_dt_rsv(fdt);
-
-   /* Prepare fdt for payload */
-   ret = copy_fdt();
-   if (ret)
-   return ret;
-
-   if (image_setup_libfdt(, fdt, 0, NULL)) {
-   printf("ERROR: failed to process device tree\n");
-   return EFI_LOAD_ERROR;
-   }
-
-   /* Link to it in the efi tables */
-   ret = efi_install_configuration_table(_guid_fdt, fdt);
-   if (ret != EFI_SUCCESS)
-   return EFI_OUT_OF_RESOURCES;
-
-   return ret;
-}
-
  /**
- * efi_process_fdt() - process fdt passed by a command argument
+ * efi_install_fdt() - install fdt passed by a command argument
   * @fdt_opt:  pointer to argument
   * Return:status code
   *
   * If specified, fdt will be installed as configuration table,
   * otherwise no fdt will be passed.
   */
-static efi_status_t efi_process_fdt(const char *fdt_opt)
+static efi_status_t efi_install_fdt(const char *fdt_opt)
  {
unsigned long fdt_addr;
+   void *fdt;
+   bootm_headers_t img = { 0 };
efi_status_t ret;

if (fdt_opt) {
+   /* Install device tree */
fdt_addr = simple_strtoul(fdt_opt, NULL, 16);
if (!fdt_addr && *fdt_opt != '0')
return EFI_INVALID_PARAMETER;

-   /* Install device tree */
-   ret = efi_install_fdt(fdt_addr);
+   fdt = map_sysmem(fdt_addr, 0);
+   if (fdt_check_header(fdt)) {
+   printf("ERROR: invalid device tree\n");
+   return EFI_INVALID_PARAMETER;
+   }
+
+   /* Create memory reservation as indicated by the device tree */
+   efi_carve_out_dt_rsv(fdt);
+
+   /* Prepare fdt for payload */
+   ret = copy_fdt();
+   if (ret)
+   return ret;
+
+   if (image_setup_libfdt(, fdt, 0, NULL)) {
+   printf("ERROR: failed to process device tree\n");
+   return EFI_LOAD_ERROR;
+   }
+
+   /* Link to it in the efi tables */
+   ret = efi_install_configuration_table(_guid_fdt, fdt);
if (ret != EFI_SUCCESS) {
printf("ERROR: failed to install device tree\n");
-   return ret;
+   return EFI_OUT_OF_RESOURCES;
}
} else {
/* Remove device tree. EFI_NOT_FOUND can be ignored here */
@@ -439,7 +428,7 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
if (argc < 2)
return CMD_RET_USAGE;

-   r = fdt_process_fdt(argc > 2 ? argv[2] : NULL);
+   r = fdt_install_fdt(argc > 2 ? argv[2] : NULL);



cmd/bootefi.c: In function ‘do_bootefi’:
cmd/bootefi.c:431:6: warning: implicit declaration of function
‘fdt_install_fdt’; did you mean ‘efi_install_fdt’?
[-Wimplicit-function-declaration]
  r = fdt_install_fdt(argc > 2 ? argv[2] : NULL);
  ^~~
  efi_install_fdt
cmd/bootefi.c:413:16: warning: unused variable ‘fdt_addr’
[-Wunused-variable]
  unsigned long fdt_addr;
^~~~
At top level:
cmd/bootefi.c:176:21: warning: ‘efi_install_fdt’ defined but not used
[-Wunused-function]
 static efi_status_t efi_install_fdt(const char *fdt_opt)

Please, check.

Best regards

Heinrich


if (r == EFI_INVALID_PARAMETER)
return CMD_RET_USAGE;
else if (r != EFI_SUCCESS)



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


[U-Boot] [v3 2/2] scsi: ceva: Clean up the driver code

2019-04-17 Thread Peng Ma
Distinguish the ecc val by chassis version and move the ecc addr to dts.
Add ls1028a soc support.

Signed-off-by: Peng Ma 
Reviewed-by: Michal Simek 
---
changed for v3:
- Add Reviewed-by.

 drivers/ata/sata_ceva.c |   50 +++
 1 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/drivers/ata/sata_ceva.c b/drivers/ata/sata_ceva.c
index 8887be9..2d49630 100644
--- a/drivers/ata/sata_ceva.c
+++ b/drivers/ata/sata_ceva.c
@@ -8,6 +8,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /* Vendor Specific Register Offsets */
 #define AHCI_VEND_PCFG  0xA4
@@ -88,20 +89,16 @@
 #define LS1021_CEVA_PHY4_CFG   0x064a080b
 #define LS1021_CEVA_PHY5_CFG   0x2aa86470
 
-/* for ls1088a */
-#define LS1088_ECC_DIS_ADDR_CH20x100520
-#define LS1088_ECC_DIS_VAL_CH2 0x4000
-
-/* ecc addr-val pair */
-#define ECC_DIS_ADDR_CH2   0x20140520
+/* ecc val pair */
+#define ECC_DIS_VAL_CH10x0002
 #define ECC_DIS_VAL_CH20x8000
-#define SATA_ECC_REG_ADDR  0x20220520
-#define SATA_ECC_DISABLE   0x0002
+#define ECC_DIS_VAL_CH30x4000
 
 enum ceva_soc {
CEVA_1V84,
CEVA_LS1012A,
CEVA_LS1021A,
+   CEVA_LS1028A,
CEVA_LS1043A,
CEVA_LS1046A,
CEVA_LS1088A,
@@ -110,12 +107,14 @@ enum ceva_soc {
 
 struct ceva_sata_priv {
ulong base;
+   ulong ecc_base;
enum ceva_soc soc;
ulong flag;
 };
 
 static int ceva_init_sata(struct ceva_sata_priv *priv)
 {
+   ulong ecc_addr = priv->ecc_base;
ulong base = priv->base;
ulong tmp;
 
@@ -132,38 +131,42 @@ static int ceva_init_sata(struct ceva_sata_priv *priv)
break;
 
case CEVA_LS1021A:
-   writel(SATA_ECC_DISABLE, SATA_ECC_REG_ADDR);
+   if (!ecc_addr)
+   return -EINVAL;
+   writel(ECC_DIS_VAL_CH1, ecc_addr);
writel(CEVA_PHY1_CFG, base + AHCI_VEND_PPCFG);
writel(LS1021_CEVA_PHY2_CFG, base + AHCI_VEND_PP2C);
writel(LS1021_CEVA_PHY3_CFG, base + AHCI_VEND_PP3C);
writel(LS1021_CEVA_PHY4_CFG, base + AHCI_VEND_PP4C);
writel(LS1021_CEVA_PHY5_CFG, base + AHCI_VEND_PP5C);
writel(CEVA_TRANS_CFG, base + AHCI_VEND_PTC);
-   if (priv->flag & FLAG_COHERENT)
-   writel(CEVA_AXICC_CFG, base + LS1021_AHCI_VEND_AXICC);
break;
 
case CEVA_LS1012A:
case CEVA_LS1043A:
case CEVA_LS1046A:
-   writel(ECC_DIS_VAL_CH2, ECC_DIS_ADDR_CH2);
+   if (!ecc_addr)
+   return -EINVAL;
+   writel(ECC_DIS_VAL_CH2, ecc_addr);
/* fallthrough */
case CEVA_LS2080A:
writel(CEVA_PHY1_CFG, base + AHCI_VEND_PPCFG);
writel(CEVA_TRANS_CFG, base + AHCI_VEND_PTC);
-   if (priv->flag & FLAG_COHERENT)
-   writel(CEVA_AXICC_CFG, base + AHCI_VEND_AXICC);
break;
 
+   case CEVA_LS1028A:
case CEVA_LS1088A:
-   writel(LS1088_ECC_DIS_VAL_CH2, LS1088_ECC_DIS_ADDR_CH2);
+   if (!ecc_addr)
+   return -EINVAL;
+   writel(ECC_DIS_VAL_CH3, ecc_addr);
writel(CEVA_PHY1_CFG, base + AHCI_VEND_PPCFG);
writel(CEVA_TRANS_CFG, base + AHCI_VEND_PTC);
-   if (priv->flag & FLAG_COHERENT)
-   writel(CEVA_AXICC_CFG, base + AHCI_VEND_AXICC);
break;
}
 
+   if (priv->flag & FLAG_COHERENT)
+   writel(CEVA_AXICC_CFG, base + AHCI_VEND_AXICC);
+
return 0;
 }
 
@@ -187,6 +190,7 @@ static const struct udevice_id sata_ceva_ids[] = {
{ .compatible = "ceva,ahci-1v84", .data = CEVA_1V84 },
{ .compatible = "fsl,ls1012a-ahci", .data = CEVA_LS1012A },
{ .compatible = "fsl,ls1021a-ahci", .data = CEVA_LS1021A },
+   { .compatible = "fsl,ls1028a-ahci", .data = CEVA_LS1028A },
{ .compatible = "fsl,ls1043a-ahci", .data = CEVA_LS1043A },
{ .compatible = "fsl,ls1046a-ahci", .data = CEVA_LS1046A },
{ .compatible = "fsl,ls1088a-ahci", .data = CEVA_LS1088A },
@@ -197,6 +201,8 @@ static const struct udevice_id sata_ceva_ids[] = {
 static int sata_ceva_ofdata_to_platdata(struct udevice *dev)
 {
struct ceva_sata_priv *priv = dev_get_priv(dev);
+   struct resource res_regs;
+   int ret;
 
if (dev_read_bool(dev, "dma-coherent"))
priv->flag |= FLAG_COHERENT;
@@ -205,8 +211,18 @@ static int sata_ceva_ofdata_to_platdata(struct udevice 
*dev)
if (priv->base == FDT_ADDR_T_NONE)
return -EINVAL;
 
+   ret = dev_read_resource_byname(dev, "ecc-addr", _regs);
+   if (ret)
+   priv->ecc_base = 0;
+   else
+   priv->ecc_base = res_regs.start;
+

[U-Boot] [v3 1/2] ARM: dts: Freescale: Add ecc addr for sata node

2019-04-17 Thread Peng Ma
Move the ecc addr from driver to dts.

Signed-off-by: Peng Ma 
---
changed for v3:
- remove some dts node reg to fix build error

 arch/arm/dts/fsl-ls1012a.dtsi |4 +++-
 arch/arm/dts/fsl-ls1043a.dtsi |4 +++-
 arch/arm/dts/fsl-ls1046a.dtsi |4 +++-
 arch/arm/dts/fsl-ls1088a.dtsi |4 +++-
 arch/arm/dts/ls1021a.dtsi |4 +++-
 5 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/arch/arm/dts/fsl-ls1012a.dtsi b/arch/arm/dts/fsl-ls1012a.dtsi
index f22cbf4..30af2e1 100644
--- a/arch/arm/dts/fsl-ls1012a.dtsi
+++ b/arch/arm/dts/fsl-ls1012a.dtsi
@@ -136,7 +136,9 @@
 
sata: sata@320 {
compatible = "fsl,ls1012a-ahci";
-   reg = <0x0 0x320 0x0 0x1>;
+   reg = <0x0 0x320 0x0 0x1/* ccsr sata 
base */
+  0x0 0x20140520 0x0 0x4>; /* ecc sata 
addr*/
+   reg-names = "sata-base", "ecc-addr";
interrupts = <0 69 4>;
clocks = < 4 0>;
status = "disabled";
diff --git a/arch/arm/dts/fsl-ls1043a.dtsi b/arch/arm/dts/fsl-ls1043a.dtsi
index bb70992..c7fa9e2 100644
--- a/arch/arm/dts/fsl-ls1043a.dtsi
+++ b/arch/arm/dts/fsl-ls1043a.dtsi
@@ -290,7 +290,9 @@
 
sata: sata@320 {
compatible = "fsl,ls1043a-ahci";
-   reg = <0x0 0x320 0x0 0x1>;
+   reg = <0x0 0x320 0x0 0x1/* ccsr sata 
base */
+  0x0 0x20140520 0x0 0x4>; /* ecc sata 
addr*/
+   reg-names = "sata-base", "ecc-addr";
interrupts = <0 69 4>;
clocks = < 4 0>;
status = "disabled";
diff --git a/arch/arm/dts/fsl-ls1046a.dtsi b/arch/arm/dts/fsl-ls1046a.dtsi
index 5ac10e0..d56ecd6 100644
--- a/arch/arm/dts/fsl-ls1046a.dtsi
+++ b/arch/arm/dts/fsl-ls1046a.dtsi
@@ -294,7 +294,9 @@
 
sata: sata@320 {
compatible = "fsl,ls1046a-ahci";
-   reg = <0x0 0x320 0x0 0x1>;
+   reg = <0x0 0x320 0x0 0x1/* ccsr sata 
base */
+  0x0 0x20140520 0x0 0x4>; /* ecc sata 
addr*/
+   reg-names = "sata-base", "ecc-addr";
interrupts = <0 69 4>;
clocks = < 4 1>;
status = "disabled";
diff --git a/arch/arm/dts/fsl-ls1088a.dtsi b/arch/arm/dts/fsl-ls1088a.dtsi
index 9455e03..b7dd3ba 100644
--- a/arch/arm/dts/fsl-ls1088a.dtsi
+++ b/arch/arm/dts/fsl-ls1088a.dtsi
@@ -153,7 +153,9 @@
 
sata: sata@320 {
compatible = "fsl,ls1088a-ahci";
-   reg = <0x0 0x320 0x0 0x1>;
+   reg = <0x0 0x320 0x0 0x1/* ccsr sata base */
+  0x7 0x100520  0x0 0x4>;  /* ecc sata addr*/
+   reg-names = "sata-base", "ecc-addr";
interrupts = <0 133 4>;
status = "disabled";
};
diff --git a/arch/arm/dts/ls1021a.dtsi b/arch/arm/dts/ls1021a.dtsi
index 7670a39..cc5d56c 100644
--- a/arch/arm/dts/ls1021a.dtsi
+++ b/arch/arm/dts/ls1021a.dtsi
@@ -406,7 +406,9 @@
 
sata: sata@320 {
compatible = "fsl,ls1021a-ahci";
-   reg = <0x320 0x1>;
+   reg = <0x0 0x320 0x0 0x1/* ccsr sata 
base */
+  0x0 0x20220520 0x0 0x4>; /* ecc sata 
addr*/
+   reg-names = "sata-base", "ecc-addr";
interrupts = <0 101 4>;
status = "disabled";
};
-- 
1.7.1

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


  1   2   >