Re: [U-Boot] [PATCH v1 11/21] ARM: DTS: Update pcm052 based dts files (bk4r1/pcm052.dts)

2019-01-15 Thread Lukasz Majewski
Hi Tom,

> On Tue, Jan 15, 2019 at 09:20:16AM +0100, Lukasz Majewski wrote:
> > Hi Tom,
> >   
> > > On Mon, Jan 14, 2019 at 03:17:30PM +0100, Lukasz Majewski wrote:  
> > > > This commit provides update to the bk4r1.dts file with
> > > > more on SoC HW description.
> > > > Moreover, a new vf610-pcm052.drsi file has been introduced
> > > > to reuse the common code between devices based on Phytec's
> > > > pcm052 modules.
> > > > Ported from Linux kernel - v4.20 (tag)
> > > > 
> > > > Signed-off-by: Lukasz Majewski 
> > > > ---
> > > > 
> > > >  arch/arm/dts/bk4r1.dts | 108 -
> > > >  arch/arm/dts/pcm052.dts|   6 +-
> > > >  arch/arm/dts/vf610-pcm052.dtsi | 266
> > > > + 3 files changed, 346
> > > > insertions(+), 34 deletions(-) create mode 100644
> > > > arch/arm/dts/vf610-pcm052.dtsi
> > > > 
> > > > diff --git a/arch/arm/dts/bk4r1.dts b/arch/arm/dts/bk4r1.dts
> > > > index 866b80e0b0..55cd53384a 100644
> > > > --- a/arch/arm/dts/bk4r1.dts
> > > > +++ b/arch/arm/dts/bk4r1.dts
> > > > @@ -1,47 +1,97 @@
> > > >  // SPDX-License-Identifier: GPL-2.0+ OR X11
> > > >  /*
> > > > + * (C) Copyright 2018
> > > > + * Lukasz Majewski, DENX Software Engineering, lu...@denx.de.
> > > > + *
> > > >   * Copyright 2016 Toradex AG
> > > >   */
> > > >  
> > > >  /dts-v1/;
> > > > -#include "vf.dtsi"
> > > > +#include "vf610-pcm052.dtsi"
> > > > +#include "vf610-pinfunc.h"
> > > >  
> > > >  / {
> > > > -   model = "Phytec phyCORE-Vybrid";
> > > > -   compatible = "phytec,pcm052", "fsl,vf610";
> > > > +   model = "Liebherr (LVF) BK4 Vybrid Board";
> > > > +   compatible = "lvf,bk4", "fsl,vf610";
> > > >  
> > > > -   chosen {
> > > > -   stdout-path = 
> > > > -   };
> > > > +   leds {
> > > > +   pinctrl-names = "default";
> > > > +   pinctrl-0 = <_gpio_leds>;
> > > >  
> > > > -   aliases {
> > > > -   spi0 = 
> > > > -   };
> > > > +   compatible = "gpio-leds";
> > > >  
> > > > -};
> > > > +   /* PTE15 PORT3[24] H6 green */
> > > > +   led@0 {
> > > > +   label = "0";
> > > > +   gpios = < 24 GPIO_ACTIVE_LOW>;
> > > > +   default-state = "off";
> > > > +   };
> > > > +
> > > > +   /* PTA12 PORT0[5] H5 green */
> > > > +   led@1 {
> > > > +   label = "1";
> > > > +   gpios = < 5 GPIO_ACTIVE_LOW>;
> > > > +   default-state = "off";
> > > > +   };
> > > > +
> > > > +   /* PTE20 PORT3[39] H4 green */
> > > > +   led@2 {
> > > > +   label = "2";
> > > > +   gpios = < 29 GPIO_ACTIVE_LOW>;
> > > > +   default-state = "off";
> > > > +   };
> > > >  
> > > > - {
> > > > -   status = "okay";
> > > > +   /* PTE12 PORT3[21] H3 green */
> > > > +   led@3 {
> > > > +   label = "3";
> > > > +   gpios = < 21 GPIO_ACTIVE_LOW>;
> > > > +   default-state = "off";
> > > > +   };
> > > > +
> > > > +   /* LED6 is now PRESET ETH -> PTA16 PORT0[6]  H6
> > > > red */
> > > > +   /* PTE9  PORT3[18] H5 red */
> > > > +   led@4 {
> > > > +   label = "5";
> > > > +   gpios = < 18 GPIO_ACTIVE_LOW>;
> > > > +   default-state = "off";
> > > > +   };
> > > > +
> > > > +   /* PTE23 PORT4[0]  H4 red */
> > > > +   led@5 {
> > > > +   label = "6";
> > > > +   gpios = < 0 GPIO_ACTIVE_LOW>;
> > > > +   default-state = "off";
> > > > +   };
> > > > +
> > > > +   /* PTE16 PORT3[25] H3 red */
> > > > +   led@6 {
> > > > +   label = "7";
> > > > +   gpios = < 25 GPIO_ACTIVE_LOW>;
> > > > +   default-state = "off";
> > > > +   };
> > > > +   };
> > > >  };
> > > >  
> > > > - {
> > > > -   bus-num = <0>;
> > > > -   num-cs = <2>;
> > > > -   status = "okay";
> > > > -
> > > > -   qflash0: spi_flash@0 {
> > > > -   #address-cells = <1>;
> > > > -   #size-cells = <1>;
> > > > -   compatible = "spi-flash";
> > > > -   spi-max-frequency = <10800>;
> > > > -   reg = <0>;
> > > > + {
> > > > +   pinctrl-0 = <_ddr _hog>;
> > > > +
> > > > +   pinctrl_hog: hoggrp {
> > > > +   fsl,pins = <
> > > > +   /* ETH control pins */
> > > > +   VF610_PAD_PTE17__GPIO_122
> > > > 0x1183
> > > > +   VF610_PAD_PTA16__GPIO_6 0x1183
> > > > +   >;
> > > > };
> > 

Re: [U-Boot] [U-Boot,v2] adding saveenv-command for bananapi r2

2019-01-15 Thread Frank Wunderlich
Hi,

Here is v3 :)

https://patchwork.ozlabs.org/patch/1025345/

Regards Frank

Am 16. Januar 2019 03:54:07 MEZ schrieb Tom Rini <>:

>> Applied to u-boot/master, thanks!
>
>Wait, no, silly me, I forgot to remove this from my local bundle.  I'm
>expecting a v3 and have been talking with Frank off-list.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v1 01/21] ARM: DTS: vybrid: Add vf-u-boot.dtsi to set 'u-boot, dm-pre-reloc' in soc

2019-01-15 Thread Lukasz Majewski
On Tue, 15 Jan 2019 21:24:31 -0500
Tom Rini  wrote:

> On Tue, Jan 15, 2019 at 08:58:58AM +0100, Lukasz Majewski wrote:
> > Hi Tom,
> >   
> > > On Mon, Jan 14, 2019 at 03:17:20PM +0100, Lukasz Majewski wrote:
> > >   
> > > > This property is necessary to allow pinctrl configuration before
> > > > relocation (uart, DDR pins).
> > > > 
> > > > Separate file will facilitate updating vf.dtsi from the Linux
> > > > kernel.
> > > > 
> > > > Signed-off-by: Lukasz Majewski 
> > > > ---
> > > > 
> > > >  arch/arm/dts/vf-u-boot.dtsi | 11 +++
> > > >  arch/arm/dts/vf.dtsi|  1 +
> > > >  2 files changed, 12 insertions(+)
> > > >  create mode 100644 arch/arm/dts/vf-u-boot.dtsi
> > > 
> > > We should call the file 'vf610-u-boot.dtsi' which will get it
> > > automatically included in all vf610 platforms but still allow
> > > boards that need their own -u-boot.dtsi file to #include
> > > vf610-u-boot.dtsi 
> > 
> > Please forgive me but I do have a hard time to parse the above
> > sentence.
> > 
> > Do you propose to:
> > 
> > 1. Rename vf-u-boot.dtsi -> vf610-u-boot.dtsi ?
> > 
> > And then just include it in the generic (easily ported from Linux)
> > vf.dtsi file?
> > 
> > or 
> > 
> > 2. Shall I rename vf-u-boot.dtsi -> vf610-u-boot.dtsi and then do
> > not include it into vf.dtsi, but it shall be included in board dts
> > files (like bk4.dtsi) ?  
> 
> Neither exactly.  See scripts/Makefile.lib for the rules that
> automatically pick up various -u-boot.dtsi suffixed files.  "vf610"
> will be picked up and "vf" will not.  You do _not_ need include it in
> other non "-u-boot.dtsi" files. 

Thanks Tom for sharing this information. I was not aware that such
*-u-boot.dtsi files are automatically picked for device tree
compilation.

> You will likely end up with
> vf610-bk4-u-boot.dtsi or something to both set stdout-path
> under /chosen and #include vf610-u-boot.dtsi.

Why do I need to #include vf610-u-boot.dtsi in the
vf610-bk4-u-boot.dtsi file as the vf610-u-boot.dtsi is picked
automatically for the compilation?

I guess that I shall #include vf610-bk4-u-boot.dtsi explicitly to the
bk4.dts (as it is not picked up) ?

> If you don't need a
> board specific -u-boot.dtsi file then just vf610-u-boot.dtsi gets
> picked up automatically and you're done.
> 

Yes. Now it is clear.



Best regards,

Lukasz Majewski

--

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


pgpFaekcFxrc7.pgp
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] efi_loader: implement GetNextVariableName()

2019-01-15 Thread AKASHI Takahiro
Alex, Heinrich,

Please review this patch set.

Thanks,
-Takahiro Akashi

On Fri, Dec 14, 2018 at 06:47:11PM +0900, AKASHI Takahiro wrote:
> The current GetNextVariableName() is a placeholder.
> With this patch, it works well as expected.
> 
> Signed-off-by: AKASHI Takahiro 
> ---
>  lib/efi_loader/efi_variable.c | 116 +-
>  1 file changed, 115 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
> index 19d9cb865f25..dac2f49aa1cc 100644
> --- a/lib/efi_loader/efi_variable.c
> +++ b/lib/efi_loader/efi_variable.c
> @@ -8,6 +8,9 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
> +#include 
>  
>  #define READ_ONLY BIT(31)
>  
> @@ -241,14 +244,125 @@ efi_status_t EFIAPI efi_get_variable(u16 
> *variable_name, efi_guid_t *vendor,
>   return EFI_EXIT(EFI_SUCCESS);
>  }
>  
> +static char *efi_variables_list;
> +static char *efi_cur_variable;
> +
> +static efi_status_t parse_uboot_variable(char *variable,
> +  efi_uintn_t *variable_name_size,
> +  u16 *variable_name,
> +  efi_guid_t *vendor,
> +  u32 *attribute)
> +{
> + char *guid, *name, *end, c;
> + unsigned long name_size;
> + u16 *p;
> +
> + guid = strchr(variable, '_');
> + if (!guid)
> + return EFI_NOT_FOUND;
> + guid++;
> + name = strchr(guid, '_');
> + if (!name)
> + return EFI_NOT_FOUND;
> + name++;
> + end = strchr(name, '=');
> + if (!end)
> + return EFI_NOT_FOUND;
> +
> + /* FIXME: size is in byte or u16? */
> + name_size = end - name;
> + if (*variable_name_size < (name_size + 1)) {
> + *variable_name_size = name_size + 1;
> + return EFI_BUFFER_TOO_SMALL;
> + }
> + end++; /* point to value */
> +
> + p = variable_name;
> + utf8_utf16_strncpy(, name, name_size);
> + variable_name[name_size] = 0;
> +
> + c = *(name - 1);
> + *(name - 1) = '\0'; /* guid need be null-terminated here */
> + uuid_str_to_bin(guid, (unsigned char *)vendor, UUID_STR_FORMAT_GUID);
> + *(name - 1) = c;
> +
> + parse_attr(end, attribute);
> +
> + return EFI_SUCCESS;
> +}
> +
>  /* 
> http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES#GetNextVariableName.28.29
>  */
>  efi_status_t EFIAPI efi_get_next_variable_name(efi_uintn_t 
> *variable_name_size,
>  u16 *variable_name,
>  efi_guid_t *vendor)
>  {
> + char *native_name, *variable;
> + ssize_t name_len, list_len;
> + char regex[256];
> + char * const regexlist[] = {regex};
> + u32 attribute;
> + int i;
> + efi_status_t ret;
> +
>   EFI_ENTRY("%p \"%ls\" %pUl", variable_name_size, variable_name, vendor);
>  
> - return EFI_EXIT(EFI_DEVICE_ERROR);
> + if (!variable_name_size || !variable_name || !vendor)
> + EFI_EXIT(EFI_INVALID_PARAMETER);
> +
> + if (variable_name[0]) {
> + /* check null-terminated string */
> + for (i = 0; i < *variable_name_size; i++)
> + if (!variable_name[i])
> + break;
> + if (i >= *variable_name_size)
> + return EFI_EXIT(EFI_INVALID_PARAMETER);
> +
> + /* search for the last-returned variable */
> + ret = efi_to_native(_name, variable_name, vendor);
> + if (ret)
> + return EFI_EXIT(ret);
> +
> + name_len = strlen(native_name);
> + for (variable = efi_variables_list; variable && *variable;) {
> + if (!strncmp(variable, native_name, name_len) &&
> + variable[name_len] == '=')
> + break;
> +
> + variable = strchr(variable, '\n');
> + if (variable)
> + variable++;
> + }
> +
> + free(native_name);
> + if (!(variable && *variable))
> + return EFI_EXIT(EFI_INVALID_PARAMETER);
> +
> + /* next variable */
> + variable = strchr(variable, '\n');
> + if (variable)
> + variable++;
> + if (!(variable && *variable))
> + return EFI_EXIT(EFI_NOT_FOUND);
> + } else {
> + /* new search */
> + free(efi_variables_list);
> + efi_variables_list = NULL;
> + efi_cur_variable = NULL;
> +
> + snprintf(regex, 256, "efi_.*-.*-.*-.*-.*_.*");
> + list_len = hexport_r(_htab, '\n',
> +  H_MATCH_REGEX | H_MATCH_KEY,
> +  _variables_list, 0, 1, regexlist);
> + if 

[U-Boot] [PATCH] configs: am335x_evm: Enable DM_SPI and DM_SPI_FLASH

2019-01-15 Thread Vignesh R
Enable DM_SPI and DM_SPI_FLASH for actively used defconfigs for
am335x_evm.

Signed-off-by: Vignesh R 
---
 configs/am335x_evm_defconfig | 2 ++
 configs/am335x_hs_evm_defconfig  | 2 ++
 configs/am335x_hs_evm_uart_defconfig | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 0931c1e97f2f..21c5bdb83e9f 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -37,6 +37,7 @@ CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_ETH=y
@@ -44,6 +45,7 @@ CONFIG_PHY_GIGE=y
 CONFIG_MII=y
 CONFIG_DRIVER_TI_CPSW=y
 CONFIG_SPI=y
+CONFIG_DM_SPI=y
 CONFIG_OMAP3_SPI=y
 CONFIG_TIMER=y
 CONFIG_OMAP_TIMER=y
diff --git a/configs/am335x_hs_evm_defconfig b/configs/am335x_hs_evm_defconfig
index 1a7c5cfb1728..b158fd1a277d 100644
--- a/configs/am335x_hs_evm_defconfig
+++ b/configs/am335x_hs_evm_defconfig
@@ -43,6 +43,7 @@ CONFIG_DM_MMC=y
 # CONFIG_MMC_HW_PARTITIONING is not set
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_ETH=y
@@ -50,6 +51,7 @@ CONFIG_PHY_GIGE=y
 CONFIG_MII=y
 CONFIG_DRIVER_TI_CPSW=y
 CONFIG_SPI=y
+CONFIG_DM_SPI=y
 CONFIG_OMAP3_SPI=y
 CONFIG_TIMER=y
 CONFIG_OMAP_TIMER=y
diff --git a/configs/am335x_hs_evm_uart_defconfig 
b/configs/am335x_hs_evm_uart_defconfig
index 147da80f0dcf..e5f54a0e2bc2 100644
--- a/configs/am335x_hs_evm_uart_defconfig
+++ b/configs/am335x_hs_evm_uart_defconfig
@@ -45,6 +45,7 @@ CONFIG_DM_MMC=y
 # CONFIG_MMC_HW_PARTITIONING is not set
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_ETH=y
@@ -52,6 +53,7 @@ CONFIG_PHY_GIGE=y
 CONFIG_MII=y
 CONFIG_DRIVER_TI_CPSW=y
 CONFIG_SPI=y
+CONFIG_DM_SPI=y
 CONFIG_OMAP3_SPI=y
 CONFIG_TIMER=y
 CONFIG_OMAP_TIMER=y
-- 
2.20.1

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


Re: [U-Boot] [PATCH 3/4] MIPS: mscc: ocelot: add switch reset support

2019-01-15 Thread Stefan Roese

On 15.01.19 17:56, Gregory CLEMENT wrote:

On some ocelots platform a workaround is needed in order to be able to
reset the switch without resetting the DDR.

Signed-off-by: Gregory CLEMENT 
---
  board/mscc/ocelot/ocelot.c | 28 
  1 file changed, 28 insertions(+)

diff --git a/board/mscc/ocelot/ocelot.c b/board/mscc/ocelot/ocelot.c
index 0f7a532158..88f59e8044 100644
--- a/board/mscc/ocelot/ocelot.c
+++ b/board/mscc/ocelot/ocelot.c
@@ -18,6 +18,34 @@ enum {
BOARD_TYPE_PCB123,
  };
  
+void mscc_switch_reset(bool enter)

+{
+   u32 reg, count = 0;
+
+   /* Nasty workaround to avoid GPIO19 (DDR!) being reset */
+   mscc_gpio_set_alternate(19, 2);
+
+   printf("applying SwC reset\n");
+
+   writel(ICPU_RESET_CORE_RST_PROTECT, BASE_CFG + ICPU_RESET);
+   writel(PERF_SOFT_RST_SOFT_CHIP_RST, BASE_DEVCPU_GCB + PERF_SOFT_RST);
+
+   do {
+   reg = readl(BASE_DEVCPU_GCB + PERF_SOFT_RST);
+   count++;
+   } while (reg & PERF_SOFT_RST_SOFT_CHIP_RST);


Perhaps use wait_for_bit_XX() to add some timeout handling as well?

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


Re: [U-Boot] [PATCH] common: Break USB_STORAGE dependency between SPL and u-boot proper

2019-01-15 Thread Vignesh R


On 15/01/19 9:12 PM, Abel Vesa wrote:
> On 19-01-15 18:38:00, Vignesh R wrote:
>>
>>
>> On 15/01/19 4:37 PM, Abel Vesa wrote:
>>> Some boards might need USB_STORAGE enabled in u-boot proper but not in SPL.
>>> Make a separate config for SPL and keep the same depends on conditions but 
>>> for SPL.
>>>
>>> Signed-off-by: Abel Vesa 
>>> ---
>>>  common/Makefile| 2 +-
>>>  configs/apalis_imx6_defconfig  | 1 +
>>>  configs/colibri_imx6_defconfig | 1 +
>>>  configs/mx6sabresd_defconfig   | 1 +
>>>  drivers/usb/Kconfig| 8 
>>>  5 files changed, 12 insertions(+), 1 deletion(-)
>>
>> New config SPL_USB_STORAGE should be enabled for all boards that
>> currently have CONFIG_SPL_USB_HOST_SUPPORT=y and CONFIG_USB_STORAGE=y
>> right? I see that atleast configs/am43xx_evm_usbhost_boot_defconfig is
>> not in the above list.
>>
> 
> As of commit ('d368926 Prepare v2019.01'), 
> 
> $ grep USB_STORAGE configs/am43xx_evm_usbhost_boot_defconfig
> $ 
> 
> so it doesn't seem to be the case.
> 

Ok, I see its removed as USB_STORAGE is implied for DISTRO_DEFAULTS.

toplevel Kconfig has:
config DISTRO_DEFAULTS
...
imply USB_STORAGE

So, you should probably add something like:
imply SPL_USB_STORAGE if SPL_USB_HOST_SUPPORT

at all places where there is "imply USB_STORAGE" currently.

Regards
Vignesh


>>
>>>
>>> diff --git a/common/Makefile b/common/Makefile
>>> index 0de60b3..34931f3 100644
>>> --- a/common/Makefile
>>> +++ b/common/Makefile
>>> @@ -77,7 +77,7 @@ obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o
>>>  
>>>  ifdef CONFIG_SPL_USB_HOST_SUPPORT
>>>  obj-$(CONFIG_SPL_USB_SUPPORT) += usb.o usb_hub.o
>>> -obj-$(CONFIG_USB_STORAGE) += usb_storage.o
>>> +obj-$(CONFIG_SPL_USB_STORAGE) += usb_storage.o
>>>  else
>>>  obj-$(CONFIG_USB_MUSB_HOST) += usb.o
>>>  endif
>>> diff --git a/configs/apalis_imx6_defconfig b/configs/apalis_imx6_defconfig
>>> index e02d9bc..c4916ad 100644
>>> --- a/configs/apalis_imx6_defconfig
>>> +++ b/configs/apalis_imx6_defconfig
>>> @@ -25,6 +25,7 @@ CONFIG_SPL_I2C_SUPPORT=y
>>>  CONFIG_SPL_USB_HOST_SUPPORT=y
>>>  CONFIG_SPL_USB_GADGET=y
>>>  CONFIG_SPL_USB_SDP_SUPPORT=y
>>> +CONFIG_SPL_USB_STORAGE=y
>>>  CONFIG_HUSH_PARSER=y
>>>  CONFIG_SYS_PROMPT="Apalis iMX6 # "
>>>  CONFIG_CMD_BOOTZ=y
>>> diff --git a/configs/colibri_imx6_defconfig b/configs/colibri_imx6_defconfig
>>> index 68f0746..441a4e7 100644
>>> --- a/configs/colibri_imx6_defconfig
>>> +++ b/configs/colibri_imx6_defconfig
>>> @@ -25,6 +25,7 @@ CONFIG_SPL_I2C_SUPPORT=y
>>>  CONFIG_SPL_USB_HOST_SUPPORT=y
>>>  CONFIG_SPL_USB_GADGET=y
>>>  CONFIG_SPL_USB_SDP_SUPPORT=y
>>> +CONFIG_SPL_USB_STORAGE=y
>>>  CONFIG_HUSH_PARSER=y
>>>  CONFIG_SYS_PROMPT="Colibri iMX6 # "
>>>  CONFIG_CMD_BOOTZ=y
>>> diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
>>> index 1857c18..3532fce 100644
>>> --- a/configs/mx6sabresd_defconfig
>>> +++ b/configs/mx6sabresd_defconfig
>>> @@ -21,6 +21,7 @@ CONFIG_SPL_OS_BOOT=y
>>>  CONFIG_SPL_USB_HOST_SUPPORT=y
>>>  CONFIG_SPL_USB_GADGET=y
>>>  CONFIG_SPL_USB_SDP_SUPPORT=y
>>> +CONFIG_SPL_USB_STORAGE=y
>>>  CONFIG_SPL_WATCHDOG_SUPPORT=y
>>>  CONFIG_HUSH_PARSER=y
>>>  CONFIG_CMD_BOOTZ=y
>>> diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
>>> index 3b53bf2..4185e16 100644
>>> --- a/drivers/usb/Kconfig
>>> +++ b/drivers/usb/Kconfig
>>> @@ -89,6 +89,14 @@ config USB_STORAGE
>>>   Say Y here if you want to connect USB mass storage devices to your
>>>   board's USB port.
>>>  
>>> +config SPL_USB_STORAGE
>>> +   bool "SPL USB Mass Storage support"
>>> +   depends on !(SPL_BLK && !SPL_DM_USB)
>>> +   ---help---
>>> + Say Y here if you want to connect USB mass storage devices to your
>>> + board's USB port in SPL.
>>> +
>>> +
>>>  config USB_KEYBOARD
>>> bool "USB Keyboard support"
>>> select SYS_STDIO_DEREGISTER
>>>
>>
>> -- 
>> Regards
>> Vignesh

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


Re: [U-Boot] [U-Boot, v2] kbuild: fix parallel build race caused by u-boot.cfg regeneration

2019-01-15 Thread Tom Rini
On Thu, Jan 10, 2019 at 11:11:39PM +0900, Masahiro Yamada wrote:

> Multiple people have reported intermittent build failure in parallel
> building.
> 
> Kever Yang reported this issue some time ago [1], but I could not
> get enough clue at that time.
> 
> This time, Richard Purdie provided a full build log [2], which was
> very helpful for me to root-cause it.
> 
> The cause of the problem is commit 0d982c585330 ("Makefile: add
> dependencies to regenerate u-boot.cfg when lost").
> 
> That commit added the 'cfg' as the prerequisite of the 'all' target,
> so the parallel build tries to run it simultaneously, then regenerates
> a symlink while building objects.
> 
> When u-boot.cfg is accidentally lost, let's rebuild it before
> descending into any subdirectories.
> 
> Also, what is annoying is u-boot.cfg is currently regenerated every
> time since it depends on FORCE. We can get rid of all the prerequisites
> of u-boot.cfg because u-boot.cfg is rebuilt anyway as the byproduct of
> auto.conf when a user updates the .config file.
> 
> [1] https://lists.denx.de/pipermail/u-boot/2018-June/330341.html
> [2] 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/65/builds/160/steps/7/logs/step1b
> 
> Fixes: 0d982c585330 ("Makefile: add dependencies to regenerate u-boot.cfg 
> when lost")
> Reported-by: Kever Yang 
> Reported-by: Richard Purdie 
> Signed-off-by: Masahiro Yamada 
> Reviewed-by: Simon Glass 

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] [U-Boot, 2/2, (RFT)] am335x: igep003x: Add Device Tree Support and DM_MMC driver

2019-01-15 Thread Tom Rini
On Fri, Dec 28, 2018 at 11:55:48AM +0100, Enric Balletbo i Serra wrote:

> This adds device tree and the DM_MMC driver for the AM335x IGEP based
> boards.
> 
> Signed-off-by: Enric Balletbo i Serra 

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] dtoc: make generated platdata structs const

2019-01-15 Thread Tom Rini
On Mon, Jan 07, 2019 at 08:29:26PM +0100, Simon Goldschmidt wrote:

> The platdata initialization structs are currently generated into .rwdata.
> Make sure the are put into .rodata by generating them as const.
> 
> Signed-off-by: Simon Goldschmidt 
> Reviewed-by: Simon Glass 

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] [U-Boot, 10/11] MAINTAINERS: ARM MEDIATEK: update file entries

2019-01-15 Thread Tom Rini
On Thu, Dec 20, 2018 at 04:12:58PM +0800, Weijie Gao wrote:

> This patch adds new file entries for MediaTek SoCs
> 
> Signed-off-by: Weijie Gao 

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] [U-Boot, v2, 1/3] include: configs: Add gunzip size for HiKey board

2019-01-15 Thread Tom Rini
On Thu, Dec 27, 2018 at 07:04:03PM +0530, Manivannan Sadhasivam wrote:

> From: Manivannan Sadhasivam 
> 
> Default 8MB gunzip size is not enough to load the release kernel, hence
> fix 64MB size for uncompressing the kernel.
> 
> Signed-off-by: Manivannan Sadhasivam 
> Reviewed-by: Simon Glass 
> Reviewed-by: Simon Glass 

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] [U-Boot, 2/5] omap3: igep00x0: Remove USB support due DM_USB deadline

2019-01-15 Thread Tom Rini
On Thu, Dec 27, 2018 at 05:03:27PM +0100, Enric Balletbo i Serra wrote:

> The USB support for this board was never really tested, in fact, the
> presence of these options are more a copy & paste error from the
> Beagleboard than a feature that really was used. As doesn't work, remove
> for now. If someone at some point want to add this support he'll need to
> migrate the board to use CONFIG_DM_USB instead.
> 
> Signed-off-by: Enric Balletbo i Serra 

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] Fix typo: missmatched -> mismatched.

2019-01-15 Thread Tom Rini
On Tue, Jan 08, 2019 at 01:10:23PM -0800, Vagrant Cascadian wrote:

> Signed-off-by: Vagrant Cascadian 
> Reviewed-by: Peng Fan 

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] [U-Boot,v2] adding saveenv-command for bananapi r2

2019-01-15 Thread Tom Rini
On Tue, Jan 15, 2019 at 09:39:39PM -0500, Tom Rini wrote:
> On Tue, Dec 04, 2018 at 02:44:28PM +0100, Frank Wunderlich wrote:
> 
> > changes since v1: fixed bracket-style in if-else statement
> > 
> > >From 47701fbea478ce09a5ef43d914261bf00eb50544 Mon Sep 17 00:00:00 2001
> > From: Frank Wunderlich 
> > Date: Mon, 3 Dec 2018 15:32:58 +0100
> > Subject: [PATCH] adding saveenv-command for bananapi r2
> > 
> > bananapi r2 can be booted from sd-card and emmc
> > saving the environment have to choose the storage
> > from which the device has booted
> > 
> > also the offset is set to 1MB to make sure env is written
> > to block "user data area" between uboot and first partition
> > 
> > https://www.fw-web.de/dokuwiki/lib/exe/fetch.php?cache==bpi-r2:boot-structure.png
> > 
> > Signed-off-by: Frank Wunderlich 
> 
> Applied to u-boot/master, thanks!

Wait, no, silly me, I forgot to remove this from my local bundle.  I'm
expecting a v3 and have been talking with Frank off-list.

-- 
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] [U-Boot, 1/5] omap3: igep00x0: Remove unmaintained IGEP0032 defconfig

2019-01-15 Thread Tom Rini
On Thu, Dec 27, 2018 at 05:03:26PM +0100, Enric Balletbo i Serra wrote:

> The IGEP0032 board was never officially pushed upstream and actually I
> don't have access to this hardware, unless someone with the hardware
> wants to start working on this doesn't makes sense have this defconfig
> here. So remove it.
> 
> Signed-off-by: Enric Balletbo i Serra 

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] [U-Boot,1/1] cmd: ubi: remove unreachable code

2019-01-15 Thread Tom Rini
On Sun, Jan 06, 2019 at 12:26:28PM +0100, Heinrich Schuchardt wrote:

> It does not make sense to check if argc < 2 a second time, especially after
> accessing argv[1].
> 
> Signed-off-by: Heinrich Schuchardt 

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] [U-Boot, 07/11] arm: dts: add ethernet related node for MT7629 SoC

2019-01-15 Thread Tom Rini
On Thu, Dec 20, 2018 at 04:12:55PM +0800, Weijie Gao wrote:

> This patch adds ethernet gmac node for MT7629 with internal gigabit phy.
> 
> Signed-off-by: Mark Lee 

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] mmc: Add support for downgrading HS200/HS400 to HS mode

2019-01-15 Thread Tom Rini
On Thu, Jan 03, 2019 at 09:19:24PM +0100, Marek Vasut wrote:

> The mmc_select_mode_and_width() function can be called while the card
> is in HS200/HS400 mode and can be used to downgrade the card to lower
> mode, e.g. HS. This is used for example by mmc_boot_part_access_chk()
> which cannot access the card in HS200/HS400 mode and which is in turn
> called by saveenv if env is in the MMC.
> 
> In such case, forcing the card clock to legacy frequency cannot work.
> Instead, the card must be switched to HS mode first, from which it can
> then be reprogrammed as needed.
> 
> However, this procedure needs additional code changes, since the current
> implementation checks whether the card correctly switched to HS mode in
> mmc_set_card_speed(). The check only expects that the card will be going
> to HS mode from lower modes, not from higher modes, hence add a parameter
> which indicates that the HS200/HS400 to HS downgrade is happening. This
> makes the code send the switch command first, reconfigure the controller
> next and finally perform the EXT_CSD readback check. The last two steps
> cannot be done in reverse order as the card is already in HS mode when
> the clock are being switched on the controller side.
> 
> Signed-off-by: Marek Vasut 
> Cc: Jaehoon Chung 

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] drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

2019-01-15 Thread Tom Rini
On Wed, Jan 09, 2019 at 08:27:09PM +0100, Simon Goldschmidt wrote:

> DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
> on DEBUG_UART.
> 
> Signed-off-by: Simon Goldschmidt 
> Reviewed-by: Simon Glass 

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] pylibfdt: Use Python 2 in Makefile

2019-01-15 Thread Tom Rini
On Tue, Jan 08, 2019 at 02:19:46PM +0100, Josef Lusticky wrote:

> pylibfdt needs Python 2 to build.
> Replace $(PYTHON) with $(PYTHON2) in pylibfdt Makefile
> to ensure Python 2 is used to build it.
> 
> This fixes build on systems where Python 3 is the default version
> of the "python" interpreter.
> Reviewed-by: Simon Glass 

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] [U-Boot, v2, 3/3] arm: dts: Add MMC nodes for HiKey board

2019-01-15 Thread Tom Rini
On Thu, Dec 27, 2018 at 07:04:05PM +0530, Manivannan Sadhasivam wrote:

> From: Manivannan Sadhasivam 
> 
> Add MMC nodes for HiKey board based on HI6220 SoC. There are three MMC
> controllers in this SoC, first one used for eMMC, second one used
> for SD card and third one is not used by u-boot.
> 
> Signed-off-by: Manivannan Sadhasivam 
> Reviewed-by: Simon Glass 
> Reviewed-by: Tom Rini 

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] serial: ns16550: fix debug uart putc called before init

2019-01-15 Thread Tom Rini
On Wed, Jan 09, 2019 at 08:35:31PM +0100, Simon Goldschmidt wrote:

> If _debug_uart_putc() is called before _debug_uart_init(), the
> ns16550 debug uart driver hangs in a tight loop waiting for the
> tx FIFO to get empty.
> 
> As this can happen via a printf sneaking in before the port calls
> debug_uart_init(), introduce a config option to ignore characters
> before the debug uart is initialized.
> 
> This is done by reading the baudrate divisor and aborting if is zero.
> 
> The Kconfig option is required as reading the baudrate divisor does
> not seem to work for all ns16500 compatibles (which is why the last
> attempt on this has been reverted in 1a67969a99).
> 
> Tested on socfpga_cyclone5_socrates.
> 
> Signed-off-by: Simon Goldschmidt 
> Reviewed-by: Simon Glass 

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] test: Use single quote consistently

2019-01-15 Thread Tom Rini
On Thu, Dec 27, 2018 at 08:11:13AM -0700, Simon Glass wrote:

> Some tests have ended up using double quotes where single quotes could be
> used. Adjust this for consistency with the rest of U-Boot's Python code.
> 
> Signed-off-by: Simon Glass 
> Reviewed-by: Heinrich Schuchardt 

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] [U-Boot,1/1] cmd: gpio: use correct printf code

2019-01-15 Thread Tom Rini
On Sun, Jan 06, 2019 at 11:31:54AM +0100, Heinrich Schuchardt wrote:

> gpio is defined as unsigned int. So we should use %u when calling printf().
> 
> Signed-off-by: Heinrich Schuchardt 
> Reviewed-by: Simon Glass 

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] [U-Boot,1/1] cmd: nvedit: use correct format code

2019-01-15 Thread Tom Rini
On Sun, Jan 06, 2019 at 11:52:06AM +0100, Heinrich Schuchardt wrote:

> len is defined as unsigned. So use %u for printf().
> 
> Signed-off-by: Heinrich Schuchardt 

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] [U-Boot, 2/2] poplar_defconfig: enable fastboot support

2019-01-15 Thread Tom Rini
On Tue, Dec 18, 2018 at 05:52:07PM +0800, Shawn Guo wrote:

> It enables fastboot support on Poplar board by using DWC2 OTG gadget
> driver.
> 
> Signed-off-by: Shawn Guo 

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] [U-Boot, 09/11] arm: MediaTek: add ethernet support for MT7629 boards

2019-01-15 Thread Tom Rini
On Thu, Dec 20, 2018 at 04:12:57PM +0800, Weijie Gao wrote:

> Enable ethernet related configs to mt7629_rfb_defconfig.
> Add default IP addresses.
> Enable noncached memory region required by ethernet driver.
> 
> Signed-off-by: Mark Lee 

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] configs: stm32: Remove CONFIG_OF_EMBED

2019-01-15 Thread Tom Rini
On Fri, Jan 04, 2019 at 11:48:55AM +0100, Patrice Chotard wrote:

> Building with CONFIG_OF_EMBED generates build warnings, as it should
> only be used for debugging purposes.
> 
> Remove CONFIG_OF_EMBED from all stm32 config files which are using
> this flag.
> 
> Signed-off-by: Patrice Chotard 

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] [U-Boot,1/2] poplar: add DWC2 OTG gadget support

2019-01-15 Thread Tom Rini
On Tue, Dec 18, 2018 at 05:52:06PM +0800, Shawn Guo wrote:

> It enables DWC2 OTG gadget driver support for Poplar board.  As
> usb2_phy_init() is being always called from board_init(), we can save
> the call from board_usb_init().
> 
> Signed-off-by: Shawn Guo 

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] lib: uuid: Do not enable UUID command SPL

2019-01-15 Thread Tom Rini
On Mon, Jan 07, 2019 at 09:23:38PM +0100, Marek Vasut wrote:

> The uuid command is only really useful in U-Boot, but it's useless in
> SPL. Worse yet, it pulls in various environment manipulation functions
> as it call env_set(). Do not compile the command in in SPL.
> 
> Signed-off-by: Marek Vasut 
> Cc: Tom Rini 

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] spl: ymodem: Add support for loading gzip compressed uImage

2019-01-15 Thread Tom Rini
On Mon, Jan 07, 2019 at 09:23:22PM +0100, Marek Vasut wrote:

> Add support for gunzip-ing gzip-compressed uImages in the SPL Ymodem code.
> Loading data over Ymodem can be gruelingly slow, gzip-ing the data can
> reduce that aggravating slowness at least slightly (depends on the data,
> u-boot.bin compresses to ~1/3 of it's original size on ARM64), hence add
> optional support for decompressing gzip-compressed uImages.
> 
> Signed-off-by: Marek Vasut 
> Cc: Tom Rini 

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] am57xx_evm_defconfig: Enable YMODEM support

2019-01-15 Thread Tom Rini
On Mon, Dec 17, 2018 at 09:27:59AM -0500, yan-...@ti.com wrote:

> From: Yan Liu 
> 
> Enable CONFIG_SPL_YMODEM_SUPPORT to support UART boot
> 
> Signed-off-by: Yan Liu 
> Reviewed-by: Lokesh Vutla 

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] [U-Boot,1/1] cmd: tpm-v2: use correct format code

2019-01-15 Thread Tom Rini
On Sun, Jan 06, 2019 at 12:09:10PM +0100, Heinrich Schuchardt wrote:

> updates is defined as unsigned int. So use %u for printf().
> 
> Signed-off-by: Heinrich Schuchardt 

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] [U-Boot, 5/5] omap3: igep00x0: Add Device Tree Support and DM_MMC driver

2019-01-15 Thread Tom Rini
On Thu, Dec 27, 2018 at 05:03:30PM +0100, Enric Balletbo i Serra wrote:

> This adds device tree for OMAP3 IGEP based boards and the DM_MMC driver.
> 
> Signed-off-by: Enric Balletbo i Serra 
> Reviewed-by: Tom Rini 

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] [U-Boot,1/1] cmd: sf: use correct printf code

2019-01-15 Thread Tom Rini
On Sun, Jan 06, 2019 at 12:03:37PM +0100, Heinrich Schuchardt wrote:

> test->time_ms[] is defined as unsigned. So use %u for printf().
> 
> Signed-off-by: Heinrich Schuchardt 
> Reviewed-by: Simon Glass 

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] [U-Boot,1/1] cmd: zip: use correct format code

2019-01-15 Thread Tom Rini
On Sun, Jan 06, 2019 at 12:38:37PM +0100, Heinrich Schuchardt wrote:

> dst_len is defined as unsigned long. So use %lu for printf().
> 
> Signed-off-by: Heinrich Schuchardt 

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] [U-Boot, 3/5] omap3: igep00x0: Switch to using TI_COMMON_CMD_OPTION

2019-01-15 Thread Tom Rini
On Thu, Dec 27, 2018 at 05:03:28PM +0100, Enric Balletbo i Serra wrote:

> Enable TI_COMMON_CMD_OPTIONS and remove similar options
> from the defconfig.
> 
> Signed-off-by: Enric Balletbo i Serra 

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] [U-Boot, 03/11] reset: MedaiTek: add reset controller driver for MediaTek SoCs

2019-01-15 Thread Tom Rini
On Thu, Dec 20, 2018 at 04:12:51PM +0800, Weijie Gao wrote:

> This patch adds reset controller driver for MediaTek SoCs.
> 
> Signed-off-by: Ryder Lee 
> Signed-off-by: Weijie Gao 

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] [U-Boot, v2, 2/3] mmc: Convert HI6220 MMC driver to driver model

2019-01-15 Thread Tom Rini
On Thu, Dec 27, 2018 at 07:04:04PM +0530, Manivannan Sadhasivam wrote:

> From: Manivannan Sadhasivam 
> 
> Convert HiSilicon HI6220 MMC driver based on DWMMC IP to driver
> model.
> 
> Signed-off-by: Manivannan Sadhasivam 
> Reviewed-by: Simon Glass 

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] [U-Boot, v3] xyz-modem: Fix timeout loop waiting with WATCHDOG

2019-01-15 Thread Tom Rini
On Tue, Jan 08, 2019 at 07:28:35PM +0530, Lokesh Vutla wrote:

> Commit 2c77c0d6524eb ("xyz-modem: Change getc timeout loop waiting")
> fixes the loop delay when using a hw watchdog, assuming that watchdog
> kicking is taken care of by getc(). But the xyzmodem driver tries to
> do a getc only after confirming that a character is available like below:
>   while (!tstc()) {
>   till timeout;
>   }
>   if (tstc())
>   *c = getc();
> 
> and getc() does a watchdog reset only if it fails to see a character.
> In this case, getc() always sees a character and never does a
> watchdog reset. So to make sure that watchdog doesn't get reset
> while loading the file, do a watchdog reset just before starting the
> image loading.
> 
> Signed-off-by: Lokesh Vutla 
> Signed-off-by: Vignesh R 
> Reviewed-by: Simon Glass 

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] [U-Boot, v2] common: command: Add support for $ auto-completion

2019-01-15 Thread Tom Rini
On Wed, Dec 05, 2018 at 09:26:50AM +0100, Boris Brezillon wrote:

> Add the dollar_complete() function to auto-complete arguments starting
> with a '$' and use it in the cmd_auto_complete() path such that all
> args starting with a $ can be auto-completed based on the available env
> vars.
> 
> Signed-off-by: Boris Brezillon 

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] [U-Boot, 05/11] ethernet: MediaTek: add ethernet driver for MediaTek ARM-based SoCs

2019-01-15 Thread Tom Rini
On Thu, Dec 20, 2018 at 04:12:53PM +0800, Weijie Gao wrote:

> This patch adds ethernet support for Mediatek ARM-based SoCs, including
> a minimum setup of the integrated switch.
> 
> Cc: Joe Hershberger 
> Signed-off-by: Mark Lee 
> Signed-off-by: Weijie Gao 
> Tested-By: "Frank Wunderlich" 

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] am335x: sl50: Add Device Tree Support and DM_MMC driver

2019-01-15 Thread Tom Rini
On Thu, Dec 27, 2018 at 05:34:11PM +0100, Enric Balletbo i Serra wrote:

> This adds device tree and the DM_MMC driver for the SL50 board.
> 
> Signed-off-by: Enric Balletbo i Serra 

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] [U-Boot, 11/11] configs: MediaTek: use OF_SEPARATE instead of OF_EMBED

2019-01-15 Thread Tom Rini
On Thu, Dec 20, 2018 at 04:12:59PM +0800, Weijie Gao wrote:

> This patch replace OF_EMBED with OF_SEPARATE of defconfig files of
> MediaTek boards because now OF_EMBED is only used for debugging purpose.
> 
> Signed-off-by: Weijie Gao 
> Reviewed-by: Simon Glass 

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] [U-Boot, 1/2] cmd: mmc: Force mmc reinit when no card present

2019-01-15 Thread Tom Rini
On Thu, Jan 03, 2019 at 10:09:43PM +0100, Marek Vasut wrote:

> In case the card is removed, force-init the MMC to start the internal
> machinery which deregisters and invalidate the MMC device.
> 
> Signed-off-by: Marek Vasut 
> Cc: Jaehoon Chung 

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] [U-Boot, 04/11] clk: MediaTek: bind ethsys reset controller

2019-01-15 Thread Tom Rini
On Thu, Dec 20, 2018 at 04:12:52PM +0800, Weijie Gao wrote:

> The ethsys contains not only the clock gating controller, but also the
> reset controller for the whole ethernet subsystem and its components.
> 
> This patch adds binding of the reset controller so that the ethernet node
> can have references on it.
> 
> Signed-off-by: Weijie Gao 

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] [U-Boot, 08/11] arm: MediaTek: add ethernet support for MT7623 boards

2019-01-15 Thread Tom Rini
On Thu, Dec 20, 2018 at 04:12:56PM +0800, Weijie Gao wrote:

> Enable ethernet related configs to mt7623n_bpir2_defconfig.
> Add default IP addresses.
> Enable noncached memory region required by ethernet driver.
> 
> Signed-off-by: Mark Lee 

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] test: bootcount: add bootcount-uclass test

2019-01-15 Thread Tom Rini
On Fri, Dec 14, 2018 at 09:14:29PM +0100, Philipp Tomsich wrote:

> Add a test for the bootcount uclass, which uses the RTC bootcount backend
> (i.e. drivers/bootcount/rtc.c is implictly also tested).
> 
> Signed-off-by: Philipp Tomsich 
> Reviewed-by: Simon Glass 

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] [U-Boot,1/1] cmd: unzip: use correct format code

2019-01-15 Thread Tom Rini
On Sun, Jan 06, 2019 at 12:34:16PM +0100, Heinrich Schuchardt wrote:

> src_len is defined as unsigned long. So use %lu for printf().
> 
> Signed-off-by: Heinrich Schuchardt 

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] [U-Boot, 4/5] omap3: igep00x0: Switch to simple malloc in SPL

2019-01-15 Thread Tom Rini
On Thu, Dec 27, 2018 at 05:03:29PM +0100, Enric Balletbo i Serra wrote:

> To save more space, switch to simple malloc here.
> 
> Signed-off-by: Enric Balletbo i Serra 

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] misc: fs_loader: Switching private data allocation to DM auto allocation

2019-01-15 Thread Tom Rini
On Mon, Dec 10, 2018 at 09:29:44PM +0800, tien.fong.c...@intel.com wrote:

> From: Tien Fong Chee 
> 
> Switching private data manual allocation to driver model auto allocation
> so users no longer need to deallocate themself because this would be
> deallocated by driver model when the device is no longer required.
> 
> Signed-off-by: Tien Fong Chee 
> Reviewed-by: Simon Glass 

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] [U-Boot, 06/11] arm: dts: add ethernet related node for MT7623 SoC

2019-01-15 Thread Tom Rini
On Thu, Dec 20, 2018 at 04:12:54PM +0800, Weijie Gao wrote:

> This patch adds ethernet gmac node for MT7623 with MT7530 gigabit switch.
> 
> Signed-off-by: Mark Lee 

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] [U-Boot, 2/2] cmd: mmc: Invalidate MMC block cache after init

2019-01-15 Thread Tom Rini
On Thu, Jan 03, 2019 at 10:09:44PM +0100, Marek Vasut wrote:

> Make sure the block cache is cleared for the MMC device after it was
> reinitialized to avoid having any stale data in the cache, like e.g.
> partition tables or such.
> 
> Signed-off-by: Marek Vasut 
> Cc: Jaehoon Chung 

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] [U-Boot, v4, 5/6] cmd: mtd: Use the subcmd infrastructure to declare mtd sub-commands

2019-01-15 Thread Tom Rini
On Mon, Dec 03, 2018 at 10:54:22PM +0100, Boris Brezillon wrote:

> It's way simpler this way, and we also gain auto-completion support for
> free (MTD name auto-completion has been added with mtd_name_complete())
> 
> Signed-off-by: Boris Brezillon 
> Reviewed-by: Tom Rini 

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] [U-Boot,v2] adding saveenv-command for bananapi r2

2019-01-15 Thread Tom Rini
On Tue, Dec 04, 2018 at 02:44:28PM +0100, Frank Wunderlich wrote:

> changes since v1: fixed bracket-style in if-else statement
> 
> >From 47701fbea478ce09a5ef43d914261bf00eb50544 Mon Sep 17 00:00:00 2001
> From: Frank Wunderlich 
> Date: Mon, 3 Dec 2018 15:32:58 +0100
> Subject: [PATCH] adding saveenv-command for bananapi r2
> 
> bananapi r2 can be booted from sd-card and emmc
> saving the environment have to choose the storage
> from which the device has booted
> 
> also the offset is set to 1MB to make sure env is written
> to block "user data area" between uboot and first partition
> 
> https://www.fw-web.de/dokuwiki/lib/exe/fetch.php?cache==bpi-r2:boot-structure.png
> 
> Signed-off-by: Frank Wunderlich 

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] [U-Boot, v4, 6/6] cmd: adc: Use the sub-command infrastructure

2019-01-15 Thread Tom Rini
On Mon, Dec 03, 2018 at 10:54:23PM +0100, Boris Brezillon wrote:

> And you get sub-command auto-completion for free.
> 
> Signed-off-by: Boris Brezillon 
> Reviewed-by: Tom Rini 

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] [U-Boot, v4, 2/6] common: command: Expose a generic helper to auto-complete sub commands

2019-01-15 Thread Tom Rini
On Mon, Dec 03, 2018 at 10:54:19PM +0100, Boris Brezillon wrote:

> Some commands have a table of sub-commands. With minor adjustments,
> complete_cmdv() is able to provide auto-completion for sub-commands
> (it's just about passing the table of commands instead of taking the
> global one).
> We rename this function into complete_subcmd() and implement
> complete_cmdv() as a wrapper around complete_subcmdv().
> 
> Signed-off-by: Boris Brezillon 
> Reviewed-by: Tom Rini 

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] [U-Boot,v2] image: fix compiling without CMD_FDT

2019-01-15 Thread Tom Rini
On Mon, Dec 17, 2018 at 08:14:42PM +0100, Simon Goldschmidt wrote:

> Booting an image currently sets the environment variable "fdtaddr"
> by calling into 'cmd/fdt.c'. As a result, linking U-Boot fails if
> CMD_FDT is not enabled.
> 
> Fix this by adding 'if (CONFIG_IS_ENABLED(CMD_FDT))' to the two
> places where 'set_working_fdt_addr()' is called.
> 
> Signed-off-by: Simon Goldschmidt 

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] [U-Boot, v4, 4/6] command: commands: Add macros to declare commands with subcmds

2019-01-15 Thread Tom Rini
On Mon, Dec 03, 2018 at 10:54:21PM +0100, Boris Brezillon wrote:

> Most cmd/xxx.c source files expose several commands through a single
> entry point. Some of them are doing the sub-command parsing manually in
> their do_() function, others are declaring a table of sub-commands
> and then use find_cmd_tbl() to delegate the request to the sub command
> handler.
> 
> In either case, the amount of code to do that is not negligible and
> repetitive, not to mention that almost no commands are implementing
> the auto-completion hook, which means most u-boot commands lack
> auto-completion.
> 
> Provide several macros to easily define commands exposing sub-commands.
> 
> Signed-off-by: Boris Brezillon 
> Reviewed-by: Tom Rini 

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] [U-Boot,RFC] blk: Increase cache element size

2019-01-15 Thread Tom Rini
On Wed, Aug 08, 2018 at 01:20:29PM +0200, Marek Vasut wrote:

> Cache up to 4 kiB entries. 4 kiB is the default block size on ext4, yet
> the underlying block layer devices usually report support for 512B . In
> most cases, the 512B support is emulated (ie. SD cards, SSDs, USB sticks
> etc.) and the real block size of those devices is much bigger.
> 
> To avoid performance degradation with such devices and FS setup, bump
> the maximum cache entry size to 4 kiB.
> 
> Signed-off-by: Marek Vasut 
> Cc: Tom Rini 
> Cc: Simon Glass 
> Reviewed-by: Tom Rini 

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] [U-Boot, v4, 3/6] common: command: Rework the 'cmd is repeatable' logic

2019-01-15 Thread Tom Rini
On Mon, Dec 03, 2018 at 10:54:20PM +0100, Boris Brezillon wrote:

> The repeatable property is currently attached to the main command and
> sub-commands have no way to change the repeatable value (the
> ->repeatable field in sub-command entries is ignored).
> 
> Replace the ->repeatable field by an extended ->cmd() hook (called
> ->cmd_rep()) which takes a new int pointer to store the repeatable cap
> of the command being executed.
> 
> With this trick, we can let sub-commands decide whether they are
> repeatable or not.
> 
> We also patch mmc and dtimg who are testing the ->repeatable field
> directly (they now use cmd_is_repeatable() instead), and fix the help
> entry manually since it doesn't use the U_BOOT_CMD() macro.
> 
> Signed-off-by: Boris Brezillon 
> Reviewed-by: Tom Rini 

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] [U-Boot, v4, 1/6] common: command: Fix command auto-completion

2019-01-15 Thread Tom Rini
On Mon, Dec 03, 2018 at 10:54:18PM +0100, Boris Brezillon wrote:

> When auto-completing command arguments, the last argument is not
> necessarily the one we need to auto-complete. When the last character is
> a space, a tab or '\0' what we want instead is list all possible values,
> or if there's only one possible value, place this value on the command
> line instead of trying to suffix the last valid argument with missing
> chars.
> 
> Signed-off-by: Boris Brezillon 
> Reviewed-by: Tom Rini 

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] [U-Boot, v4, 3/6] common: command: Rework the 'cmd is repeatable' logic

2019-01-15 Thread Tom Rini
On Mon, Dec 03, 2018 at 10:54:20PM +0100, Boris Brezillon wrote:
> The repeatable property is currently attached to the main command and
> sub-commands have no way to change the repeatable value (the
> ->repeatable field in sub-command entries is ignored).
> 
> Replace the ->repeatable field by an extended ->cmd() hook (called
> ->cmd_rep()) which takes a new int pointer to store the repeatable cap
> of the command being executed.
> 
> With this trick, we can let sub-commands decide whether they are
> repeatable or not.
> 
> We also patch mmc and dtimg who are testing the ->repeatable field
> directly (they now use cmd_is_repeatable() instead), and fix the help
> entry manually since it doesn't use the U_BOOT_CMD() macro.
> 
> Signed-off-by: Boris Brezillon 
> Reviewed-by: Tom Rini 
> ---
> Changes in v4:
> -None
> 
> Changes in v3:
> - Add Tom's R-b
> 
> Changes in v2:
> - New patch
> ---
>  cmd/dtimg.c   |  2 +-
>  cmd/help.c|  2 +-
>  cmd/mmc.c |  4 ++--
>  common/command.c  | 36 
>  include/command.h | 52 +++
>  5 files changed, 84 insertions(+), 12 deletions(-)
> 
> diff --git a/cmd/dtimg.c b/cmd/dtimg.c
> index 65c8d101b98e..ae7d82f26dd2 100644
> --- a/cmd/dtimg.c
> +++ b/cmd/dtimg.c
> @@ -116,7 +116,7 @@ static int do_dtimg(cmd_tbl_t *cmdtp, int flag, int argc, 
> char * const argv[])
>  
>   if (!cp || argc > cp->maxargs)
>   return CMD_RET_USAGE;
> - if (flag == CMD_FLAG_REPEAT && !cp->repeatable)
> + if (flag == CMD_FLAG_REPEAT && !cmd_is_repeatable(cp))
>   return CMD_RET_SUCCESS;
>  
>   return cp->cmd(cmdtp, flag, argc, argv);
> diff --git a/cmd/help.c b/cmd/help.c
> index 503fa632e74e..fa2010c67eb1 100644
> --- a/cmd/help.c
> +++ b/cmd/help.c
> @@ -29,7 +29,7 @@ U_BOOT_CMD(
>  
>  /* This does not use the U_BOOT_CMD macro as ? can't be used in symbol names 
> */
>  ll_entry_declare(cmd_tbl_t, question_mark, cmd) = {
> - "?",CONFIG_SYS_MAXARGS, 1,  do_help,
> + "?",CONFIG_SYS_MAXARGS, cmd_always_repeatable,  do_help,
>   "alias for 'help'",
>  #ifdef  CONFIG_SYS_LONGHELP
>   ""
> diff --git a/cmd/mmc.c b/cmd/mmc.c
> index 3920a1836a59..42e38900df12 100644
> --- a/cmd/mmc.c
> +++ b/cmd/mmc.c
> @@ -247,7 +247,7 @@ static int do_mmcrpmb(cmd_tbl_t *cmdtp, int flag,
>  
>   if (cp == NULL || argc > cp->maxargs)
>   return CMD_RET_USAGE;
> - if (flag == CMD_FLAG_REPEAT && !cp->repeatable)
> + if (flag == CMD_FLAG_REPEAT && !cmd_is_repeatable(cp))
>   return CMD_RET_SUCCESS;
>  
>   mmc = init_mmc_device(curr_device, false);
> @@ -907,7 +907,7 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int 
> argc, char * const argv[])
>  
>   if (cp == NULL || argc > cp->maxargs)
>   return CMD_RET_USAGE;
> - if (flag == CMD_FLAG_REPEAT && !cp->repeatable)
> + if (flag == CMD_FLAG_REPEAT && !cmd_is_repeatable(cp))
>   return CMD_RET_SUCCESS;
>  
>   if (curr_device < 0) {
> diff --git a/common/command.c b/common/command.c
> index e13cb47ac18b..19f0534a76ea 100644
> --- a/common/command.c
> +++ b/common/command.c
> @@ -501,6 +501,30 @@ void fixup_cmdtable(cmd_tbl_t *cmdtp, int size)
>  }
>  #endif
>  
> +int cmd_always_repeatable(cmd_tbl_t *cmdtp, int flag, int argc,
> +   char * const argv[], int *repeatable)
> +{
> + *repeatable = 1;
> +
> + return cmdtp->cmd(cmdtp, flag, argc, argv);
> +}
> +
> +int cmd_never_repeatable(cmd_tbl_t *cmdtp, int flag, int argc,
> +  char * const argv[], int *repeatable)
> +{
> + *repeatable = 0;
> +
> + return cmdtp->cmd(cmdtp, flag, argc, argv);
> +}
> +
> +int cmd_discard_repeatable(cmd_tbl_t *cmdtp, int flag, int argc,
> +char * const argv[])
> +{
> + int repeatable;
> +
> + return cmdtp->cmd_rep(cmdtp, flag, argc, argv, );
> +}
> +
>  /**
>   * Call a command function. This should be the only route in U-Boot to call
>   * a command, so that we can track whether we are waiting for input or
> @@ -510,13 +534,15 @@ void fixup_cmdtable(cmd_tbl_t *cmdtp, int size)
>   * @param flag   Some flags normally 0 (see CMD_FLAG_.. above)
>   * @param argc   Number of arguments (arg 0 must be the command 
> text)
>   * @param argv   Arguments
> + * @param repeatable Can the command be repeated
>   * @return 0 if command succeeded, else non-zero (CMD_RET_...)
>   */
> -static int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
> argv[])
> +static int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
> argv[],
> + int *repeatable)
>  {
>   int result;
>  
> - result = (cmdtp->cmd)(cmdtp, flag, argc, argv);
> + result = cmdtp->cmd_rep(cmdtp, flag, argc, argv, repeatable);
>   if (result)
>   debug("Command failed, result=%d\n", result);
>   return 

Re: [U-Boot] [U-Boot, v2, 2/3] mmc: Convert HI6220 MMC driver to driver model

2019-01-15 Thread Tom Rini
On Thu, Dec 27, 2018 at 07:04:04PM +0530, Manivannan Sadhasivam wrote:

> From: Manivannan Sadhasivam 
> 
> Convert HiSilicon HI6220 MMC driver based on DWMMC IP to driver
> model.
> 
> Signed-off-by: Manivannan Sadhasivam 
> Reviewed-by: Simon Glass 
> ---
> 
> Changes in v2: Added Simon's Reviewed-by tag.
> 
>  configs/hikey_defconfig |   1 +
>  drivers/mmc/hi6220_dw_mmc.c | 100 +---
>  2 files changed, 70 insertions(+), 31 deletions(-)
> 
> diff --git a/configs/hikey_defconfig b/configs/hikey_defconfig
> index 8dc5a2823eb..cced2b4802e 100644
> --- a/configs/hikey_defconfig
> +++ b/configs/hikey_defconfig
> @@ -18,6 +18,7 @@ CONFIG_DEFAULT_DEVICE_TREE="hi6220-hikey"
>  CONFIG_ENV_IS_IN_FAT=y
>  CONFIG_ENV_FAT_INTERFACE="mmc"
>  CONFIG_ENV_FAT_DEVICE_AND_PART="1:1"
> +CONFIG_DM_MMC=y
>  CONFIG_MMC_DW=y
>  CONFIG_MMC_DW_K3=y
>  CONFIG_CONS_INDEX=4
> diff --git a/drivers/mmc/hi6220_dw_mmc.c b/drivers/mmc/hi6220_dw_mmc.c
> index ce395d53c94..cc58aff38cc 100644
> --- a/drivers/mmc/hi6220_dw_mmc.c
> +++ b/drivers/mmc/hi6220_dw_mmc.c
> @@ -5,51 +5,89 @@
>   */
>  
>  #include 
> +#include 
>  #include 
> +#include 
> +#include 
>  #include 
> -#include 
>  
> -#define  DWMMC_MAX_CH_NUM4
> +DECLARE_GLOBAL_DATA_PTR;
>  
> -#define  DWMMC_MAX_FREQ  5000
> -#define  DWMMC_MIN_FREQ  40
> +struct hi6220_dwmmc_plat {
> + struct mmc_config cfg;
> + struct mmc mmc;
> +};
>  
> -/* Source clock is configured to 100MHz by ATF bl1*/
> -#define MMC0_DEFAULT_FREQ1
> +struct hi6220_dwmmc_priv_data {
> + struct dwmci_host host;
> +};
>  
> -static int hi6220_dwmci_core_init(struct dwmci_host *host, int index)
> +static int hi6220_dwmmc_ofdata_to_platdata(struct udevice *dev)
>  {
> - host->name = "Hisilicon DWMMC";
> + struct hi6220_dwmmc_priv_data *priv = dev_get_priv(dev);
> + struct dwmci_host *host = >host;
>  
> - host->dev_index = index;
> + host->name = dev->name;
> + host->ioaddr = (void *)devfdt_get_addr(dev);
> + host->buswidth = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
> + "bus-width", 4);
> +
> + /* use non-removable property for differentiating SD card and eMMC */
> + if (dev_read_bool(dev, "non-removable"))
> + host->dev_index = 0;
> + else
> + host->dev_index = 1;
> +
> + host->priv = priv;
>  
> - /* Add the mmc channel to be registered with mmc core */
> - if (add_dwmci(host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ)) {
> - printf("DWMMC%d registration failed\n", index);
> - return -1;
> - }
>   return 0;
>  }
>  
> -/*
> - * This function adds the mmc channel to be registered with mmc core.
> - * index -   mmc channel number.
> - * regbase - register base address of mmc channel specified in 'index'.
> - * bus_width -   operating bus width of mmc channel specified in 'index'.
> - */
> -int hi6220_dwmci_add_port(int index, u32 regbase, int bus_width)
> +static int hi6220_dwmmc_probe(struct udevice *dev)
>  {
> - struct dwmci_host *host = NULL;
> + struct hi6220_dwmmc_plat *plat = dev_get_platdata(dev);
> + struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
> + struct hi6220_dwmmc_priv_data *priv = dev_get_priv(dev);
> + struct dwmci_host *host = >host;
>  
> - host = calloc(1, sizeof(struct dwmci_host));
> - if (!host) {
> - pr_err("dwmci_host calloc failed!\n");
> - return -ENOMEM;
> - }
> + /* Use default bus speed due to absence of clk driver */
> + host->bus_hz = 5000;
>  
> - host->ioaddr = (void *)(ulong)regbase;
> - host->buswidth = bus_width;
> - host->bus_hz = MMC0_DEFAULT_FREQ;
> + dwmci_setup_cfg(>cfg, host, host->bus_hz, 40);
> + host->mmc = >mmc;
>  
> - return hi6220_dwmci_core_init(host, index);
> + host->mmc->priv = >host;
> + upriv->mmc = host->mmc;
> + host->mmc->dev = dev;
> +
> + return dwmci_probe(dev);
>  }
> +
> +static int hi6220_dwmmc_bind(struct udevice *dev)
> +{
> + struct hi6220_dwmmc_plat *plat = dev_get_platdata(dev);
> + int ret;
> +
> + ret = dwmci_bind(dev, >mmc, >cfg);
> + if (ret)
> + return ret;
> +
> + return 0;
> +}
> +
> +static const struct udevice_id hi6220_dwmmc_ids[] = {
> + { .compatible = "hisilicon,hi6220-dw-mshc" },
> + { }
> +};
> +
> +U_BOOT_DRIVER(hi6220_dwmmc_drv) = {
> + .name = "hi6220_dwmmc",
> + .id = UCLASS_MMC,
> + .of_match = hi6220_dwmmc_ids,
> + .ofdata_to_platdata = hi6220_dwmmc_ofdata_to_platdata,
> + .ops = _dwmci_ops,
> + .bind = hi6220_dwmmc_bind,
> + .probe = hi6220_dwmmc_probe,
> + .priv_auto_alloc_size = sizeof(struct hi6220_dwmmc_priv_data),
> + .platdata_auto_alloc_size = sizeof(struct hi6220_dwmmc_plat),
> +};

-- 
Tom


signature.asc
Description: PGP signature

Re: [U-Boot] [PATCH v1 11/21] ARM: DTS: Update pcm052 based dts files (bk4r1/pcm052.dts)

2019-01-15 Thread Tom Rini
On Tue, Jan 15, 2019 at 09:20:16AM +0100, Lukasz Majewski wrote:
> Hi Tom,
> 
> > On Mon, Jan 14, 2019 at 03:17:30PM +0100, Lukasz Majewski wrote:
> > > This commit provides update to the bk4r1.dts file with
> > > more on SoC HW description.
> > > Moreover, a new vf610-pcm052.drsi file has been introduced
> > > to reuse the common code between devices based on Phytec's
> > > pcm052 modules.
> > > Ported from Linux kernel - v4.20 (tag)
> > > 
> > > Signed-off-by: Lukasz Majewski 
> > > ---
> > > 
> > >  arch/arm/dts/bk4r1.dts | 108 -
> > >  arch/arm/dts/pcm052.dts|   6 +-
> > >  arch/arm/dts/vf610-pcm052.dtsi | 266
> > > + 3 files changed, 346
> > > insertions(+), 34 deletions(-) create mode 100644
> > > arch/arm/dts/vf610-pcm052.dtsi
> > > 
> > > diff --git a/arch/arm/dts/bk4r1.dts b/arch/arm/dts/bk4r1.dts
> > > index 866b80e0b0..55cd53384a 100644
> > > --- a/arch/arm/dts/bk4r1.dts
> > > +++ b/arch/arm/dts/bk4r1.dts
> > > @@ -1,47 +1,97 @@
> > >  // SPDX-License-Identifier: GPL-2.0+ OR X11
> > >  /*
> > > + * (C) Copyright 2018
> > > + * Lukasz Majewski, DENX Software Engineering, lu...@denx.de.
> > > + *
> > >   * Copyright 2016 Toradex AG
> > >   */
> > >  
> > >  /dts-v1/;
> > > -#include "vf.dtsi"
> > > +#include "vf610-pcm052.dtsi"
> > > +#include "vf610-pinfunc.h"
> > >  
> > >  / {
> > > - model = "Phytec phyCORE-Vybrid";
> > > - compatible = "phytec,pcm052", "fsl,vf610";
> > > + model = "Liebherr (LVF) BK4 Vybrid Board";
> > > + compatible = "lvf,bk4", "fsl,vf610";
> > >  
> > > - chosen {
> > > - stdout-path = 
> > > - };
> > > + leds {
> > > + pinctrl-names = "default";
> > > + pinctrl-0 = <_gpio_leds>;
> > >  
> > > - aliases {
> > > - spi0 = 
> > > - };
> > > + compatible = "gpio-leds";
> > >  
> > > -};
> > > + /* PTE15 PORT3[24] H6 green */
> > > + led@0 {
> > > + label = "0";
> > > + gpios = < 24 GPIO_ACTIVE_LOW>;
> > > + default-state = "off";
> > > + };
> > > +
> > > + /* PTA12 PORT0[5] H5 green */
> > > + led@1 {
> > > + label = "1";
> > > + gpios = < 5 GPIO_ACTIVE_LOW>;
> > > + default-state = "off";
> > > + };
> > > +
> > > + /* PTE20 PORT3[39] H4 green */
> > > + led@2 {
> > > + label = "2";
> > > + gpios = < 29 GPIO_ACTIVE_LOW>;
> > > + default-state = "off";
> > > + };
> > >  
> > > - {
> > > - status = "okay";
> > > + /* PTE12 PORT3[21] H3 green */
> > > + led@3 {
> > > + label = "3";
> > > + gpios = < 21 GPIO_ACTIVE_LOW>;
> > > + default-state = "off";
> > > + };
> > > +
> > > + /* LED6 is now PRESET ETH -> PTA16 PORT0[6]  H6
> > > red */
> > > + /* PTE9  PORT3[18] H5 red */
> > > + led@4 {
> > > + label = "5";
> > > + gpios = < 18 GPIO_ACTIVE_LOW>;
> > > + default-state = "off";
> > > + };
> > > +
> > > + /* PTE23 PORT4[0]  H4 red */
> > > + led@5 {
> > > + label = "6";
> > > + gpios = < 0 GPIO_ACTIVE_LOW>;
> > > + default-state = "off";
> > > + };
> > > +
> > > + /* PTE16 PORT3[25] H3 red */
> > > + led@6 {
> > > + label = "7";
> > > + gpios = < 25 GPIO_ACTIVE_LOW>;
> > > + default-state = "off";
> > > + };
> > > + };
> > >  };
> > >  
> > > - {
> > > - bus-num = <0>;
> > > - num-cs = <2>;
> > > - status = "okay";
> > > -
> > > - qflash0: spi_flash@0 {
> > > - #address-cells = <1>;
> > > - #size-cells = <1>;
> > > - compatible = "spi-flash";
> > > - spi-max-frequency = <10800>;
> > > - reg = <0>;
> > > + {
> > > + pinctrl-0 = <_ddr _hog>;
> > > +
> > > + pinctrl_hog: hoggrp {
> > > + fsl,pins = <
> > > + /* ETH control pins */
> > > + VF610_PAD_PTE17__GPIO_122
> > > 0x1183
> > > + VF610_PAD_PTA16__GPIO_6 0x1183
> > > + >;
> > >   };
> > >  
> > > - qflash1: spi_flash@1 {
> > > - #address-cells = <1>;
> > > - #size-cells = <1>;
> > > - compatible = "spi-flash";
> > > - spi-max-frequency = <6600>;
> > > - reg = <1>;
> > > + pinctrl_gpio_leds: gpioledsgrp {
> > > + fsl,pins = <
> > > + /* LEDS */
> > > + VF610_PAD_PTE15__GPIO_120   0x1183
> > > + VF610_PAD_PTA12__GPIO_5 0x1183
> > > + VF610_PAD_PTE9__GPIO_1140x1183
> > > + VF610_PAD_PTE20__GPIO_125   0x1183
> > > + VF610_PAD_PTE23__GPIO_128   0x1183
> > > + VF610_PAD_PTE16__GPIO_121   0x1183
> > > + >;
> > >   };
> > >  

Re: [U-Boot] [PATCH v1 01/21] ARM: DTS: vybrid: Add vf-u-boot.dtsi to set 'u-boot, dm-pre-reloc' in soc

2019-01-15 Thread Tom Rini
On Tue, Jan 15, 2019 at 08:58:58AM +0100, Lukasz Majewski wrote:
> Hi Tom,
> 
> > On Mon, Jan 14, 2019 at 03:17:20PM +0100, Lukasz Majewski wrote:
> > 
> > > This property is necessary to allow pinctrl configuration before
> > > relocation (uart, DDR pins).
> > > 
> > > Separate file will facilitate updating vf.dtsi from the Linux
> > > kernel.
> > > 
> > > Signed-off-by: Lukasz Majewski 
> > > ---
> > > 
> > >  arch/arm/dts/vf-u-boot.dtsi | 11 +++
> > >  arch/arm/dts/vf.dtsi|  1 +
> > >  2 files changed, 12 insertions(+)
> > >  create mode 100644 arch/arm/dts/vf-u-boot.dtsi  
> > 
> > We should call the file 'vf610-u-boot.dtsi' which will get it
> > automatically included in all vf610 platforms but still allow boards
> > that need their own -u-boot.dtsi file to #include vf610-u-boot.dtsi
> > 
> 
> Please forgive me but I do have a hard time to parse the above sentence.
> 
> Do you propose to:
> 
> 1. Rename vf-u-boot.dtsi -> vf610-u-boot.dtsi ?
> 
> And then just include it in the generic (easily ported from Linux)
> vf.dtsi file?
> 
> or 
> 
> 2. Shall I rename vf-u-boot.dtsi -> vf610-u-boot.dtsi and then do not
> include it into vf.dtsi, but it shall be included in board dts files
> (like bk4.dtsi) ?

Neither exactly.  See scripts/Makefile.lib for the rules that automatically 
pick up
various -u-boot.dtsi suffixed files.  "vf610" will be picked up and "vf"
will not.  You do _not_ need include it in other non "-u-boot.dtsi"
files.  You will likely end up with vf610-bk4-u-boot.dtsi or something
to both set stdout-path under /chosen and #include vf610-u-boot.dtsi.
If you don't need a board specific -u-boot.dtsi file then just
vf610-u-boot.dtsi gets picked up automatically and you're done.

-- 
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] mmc: hi6220_dw_mmc: add driver model support

2019-01-15 Thread Tom Rini
On Mon, Dec 17, 2018 at 05:02:31PM +0800, Shawn Guo wrote:

> As requested by driver model migration plan, it adds driver model
> support, i.e. CONFIG_DM_MMC, for hi6220_dw_mmc driver.
> 
> Signed-off-by: Shawn Guo 
> ---
>  drivers/mmc/hi6220_dw_mmc.c | 83 +
>  1 file changed, 83 insertions(+)

This seems to be, or have been duplicated by
https://patchwork.ozlabs.org/project/uboot/list/?series=83670 and as
that series includes some other hikey changes I'm picking it up there.
Sorry/thanks!

-- 
Tom


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


[U-Boot] no DTB with nand SPL on sama5d3

2019-01-15 Thread Daniel Evans
After flashing my boot.bin to nand I get the following output:

RomBOOT
 Missing DTB
### ERROR ### Please RESET the board ###

I found the error message in fdtdec.c, but not sure what I am missing.  I have 
checked that my DTB is included in the boot.bin output.  Any insight on what I 
am missing?

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


Re: [U-Boot] Proposed fastboot changes

2019-01-15 Thread Douglas Zobel
On Tue, Jan 15, 2019 at 4:12 AM Alex Kiernan  wrote:

> On Mon, Jan 14, 2019 at 8:49 PM Douglas Zobel 
> wrote:
> >
> > I've made some changes to the fastboot handlers to meet my needs.  If
> there is interest, I can prepare patches and submit them upstream.  The
> changes are:
> >
> > BUGFIX:  Currently the 'fastboot format [partition]' command (run from
> PC) formats the partition smaller than expected.  Change
> getvar_partition_size() to return partition size in # of bytes instead of
> the current behavior of # of blocks.  The 'fastboot format [partition]'
> command expect u-boot to return the size in number of bytes in order to
> format the partition correctly.
> >
> > Make the a fastboot oem command handler with a dynamic lookup like the
> base fastboot command handler currently is.  This would allow easily adding
> new oem commands in the baseline software (such as below).  It would also
> allow for board files to extend the oem handler to handle OEM specific
> cases.  I would use a weakly defined default oem command handler (empty
> function) which a board file can optionally override to handle board
> specific commands.
> >
> > Currently the 'fastboot oem format' command (gpt write mmc #
> $partitions) is supported.  I'd like to add a 'fastboot oem verify' (gpt
> verify mmc # $partitions) to help the flashing PC detect when a board needs
> to be re-formatted.
> >
>
> I'd no need for it, but when I did all of the changes to add UDP
> support, my intention was that you'd implement oem command using
> linker lists, at that point you can plug in whatever you need.
>
>
I don't understand what you mean by linker lists.  Can you give an example?

-- 










This email and any attachments are for the exclusive use of the 
intended recipient(s) and may contain confidential and/or privileged 
information.  Inadvertent disclosure of this message does not constitute a 
waiver of any privilege, right or remedy.  If you are not the intended 
recipient, please do not directly or indirectly use, disclose or distribute 
this message, and please contact the sender and delete this email, any 
attachments and all copies.  Climate and its affiliates may use, read or 
archive email communications (including attachments) through its computer 
network, as permitted by applicable law.  Climate and its affiliates (or an 
external service provider) may also scan emails and attachments on its 
computer network to ensure systems operate efficiently and to minimize 
security risks. Thank you.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] pfuze100 regulator returning wrong values

2019-01-15 Thread Adam Ford
I have an i.MX6Q powered by the pfuze100 regulator with DM_PMIC,
DM_REGULATOR, and OF_CONTROL enabled along wtih CMD_REGULATOR and
CMD_PMIC.

Our device tree is configured to use the minimum and max voltage
ratings for the parts on the board, and not the absolute min and max
ratings for the PMIC itself.

For example, I have the device tree setup for one regulator as follows:

sw2_reg: sw2 {
 regulator-min-microvolt = <330>;
 regulator-max-microvolt = <330>;
 regulator-name = "gen_3v3";
 regulator-boot-on;
 regulator-always-on;
};

However, when I read the value  with 'regulator dev gen_3v3; regulator
status' it returns 455 which exceeds the max value.  Physically
reading this voltage on a scope show the correct value, so the PMIC is
regulating to what I want and expect.

When I look at the regulator driver, it appears as if we're taking the
value returned from the PMIC, masking it off, multiplying it by the
value of step, then adding it the min_uV value, but this seems wrong
if min = max.

If print the value of min_uV, it matches the minimum value from the
device tree.  Since the Min and max are both the same, adding anything
to the min value would exceed the max.

I compared this to the Linux driver, and the Linux driver has some
hard-coded values that it uses for min and max as opposed to using the
device tree, however, if I try to overrride the values of min_uV by
replacing them with the value passed from the Linux driver, it still
returns an incorrect value.  I've tried to disect the Linux driver,
but I haven't been able to figure out excactly how it determines the
values.  When I am in Linux, however, the returned values are correct,
so Linux is doing something correct, whereas the U-Boot isn't.

Might someone have any suggestions?

for sure the switching regulators are wrong.  I haven't fully tested
all the regulators.

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


Re: [U-Boot] [PATCH] net: dm: fec: Fix regulator enable when using DM_REGULATOR

2019-01-15 Thread Joe Hershberger
On Tue, Jan 15, 2019 at 11:27 AM Adam Ford  wrote:
>
> When DM_REGULATOR is enabled, the driver attempts to call
> regulator_autoset() which expects the regulators to be on at boot
> and/or always on and fails if they are not true.
> For a more generic approach, this patch just calls
> regulator_set_enable() which shouldn't have such restrictions.
>
> Fixes: ad8c43cbcafb ("net: dm: fec: Support the phy-supply
> binding")
>
> Signed-off-by: Adam Ford 

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


[U-Boot] [PATCH v3] adding saveenv-command for bananapi r2

2019-01-15 Thread Frank Wunderlich
bananapi r2 can be booted from sd-card and emmc
saving the environment have to choose the storage
from which the device has booted

also the offset is set to 1MB to make sure env is written
to block "user data area" between uboot and first partition

https://www.fw-web.de/dokuwiki/lib/exe/fetch.php?cache==bpi-r2:boot-structure.png

v3: using generated defconfig
v2: fixed bracket-style in if-else statement

Signed-off-by: Frank Wunderlich 
---
 board/mediatek/mt7623/mt7623_rfb.c | 19 +++
 configs/mt7623n_bpir2_defconfig|  1 +
 include/configs/mt7623.h   |  3 +++
 3 files changed, 23 insertions(+)

diff --git a/board/mediatek/mt7623/mt7623_rfb.c 
b/board/mediatek/mt7623/mt7623_rfb.c
index 08468b50ea..4ec2764976 100644
--- a/board/mediatek/mt7623/mt7623_rfb.c
+++ b/board/mediatek/mt7623/mt7623_rfb.c
@@ -14,3 +14,22 @@ int board_init(void)
 
return 0;
 }
+
+int mmc_get_boot_dev(void)
+{
+   int g_mmc_devid = -1;
+   char *uflag = (char *)0x81D0;
+   if (strncmp(uflag,"eMMC",4)==0) {
+   g_mmc_devid = 0;
+   printf("Boot From Emmc(id:%d)\n\n", g_mmc_devid);
+   } else {
+   g_mmc_devid = 1;
+   printf("Boot From SD(id:%d)\n\n", g_mmc_devid);
+   }
+   return g_mmc_devid;
+}
+
+int mmc_get_env_dev(void)
+{
+   return mmc_get_boot_dev();
+}
diff --git a/configs/mt7623n_bpir2_defconfig b/configs/mt7623n_bpir2_defconfig
index ae4fb280dc..fcb02f5a7b 100644
--- a/configs/mt7623n_bpir2_defconfig
+++ b/configs/mt7623n_bpir2_defconfig
@@ -28,6 +28,7 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_EMBED=y
 CONFIG_DEFAULT_DEVICE_TREE="mt7623n-bananapi-bpi-r2"
+CONFIG_ENV_IS_IN_MMC=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 # CONFIG_BLOCK_CACHE is not set
diff --git a/include/configs/mt7623.h b/include/configs/mt7623.h
index ba763501cf..fb6ac073f3 100644
--- a/include/configs/mt7623.h
+++ b/include/configs/mt7623.h
@@ -53,4 +53,7 @@
 #define CONFIG_EXTRA_ENV_SETTINGS  \
FDT_HIGH
 
+#define CONFIG_SYS_MMC_ENV_DEV 0
+#define CONFIG_ENV_OFFSET  0x10
+
 #endif
-- 
2.17.1

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


Re: [U-Boot] [PATCH] net: dm: fec: Fix regulator enable when using DM_REGULATOR

2019-01-15 Thread Martin Fuzzey

Hi Adam,

On 15/01/2019 18:26, Adam Ford wrote:

When DM_REGULATOR is enabled, the driver attempts to call
regulator_autoset() which expects the regulators to be on at boot
and/or always on and fails if they are not true.
For a more generic approach, this patch just calls
regulator_set_enable() which shouldn't have such restrictions.

Fixes: ad8c43cbcafb ("net: dm: fec: Support the phy-supply
binding")

Signed-off-by: Adam Ford 

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 32fb34b793..e924ddeb6d 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -1327,7 +1327,7 @@ static int fecmxc_probe(struct udevice *dev)
  
  #ifdef CONFIG_DM_REGULATOR

if (priv->phy_supply) {
-   ret = regulator_autoset(priv->phy_supply);
+   ret = regulator_set_enable(priv->phy_supply, true);
if (ret) {
printf("%s: Error enabling phy supply\n", dev->name);
return ret;


Thanks for fixing this.

Tested-by: Martin Fuzzey 


Regards,

Martin

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


[U-Boot] [PATCH] net: dm: fec: Fix regulator enable when using DM_REGULATOR

2019-01-15 Thread Adam Ford
When DM_REGULATOR is enabled, the driver attempts to call
regulator_autoset() which expects the regulators to be on at boot
and/or always on and fails if they are not true.
For a more generic approach, this patch just calls
regulator_set_enable() which shouldn't have such restrictions.

Fixes: ad8c43cbcafb ("net: dm: fec: Support the phy-supply
binding")

Signed-off-by: Adam Ford 

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 32fb34b793..e924ddeb6d 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -1327,7 +1327,7 @@ static int fecmxc_probe(struct udevice *dev)
 
 #ifdef CONFIG_DM_REGULATOR
if (priv->phy_supply) {
-   ret = regulator_autoset(priv->phy_supply);
+   ret = regulator_set_enable(priv->phy_supply, true);
if (ret) {
printf("%s: Error enabling phy supply\n", dev->name);
return ret;
-- 
2.17.1

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


Re: [U-Boot] [PATCH 3/4] net: dm: fec: Support the phy-supply binding

2019-01-15 Thread Adam Ford
On Tue, Jan 15, 2019 at 11:08 AM Martin Fuzzey
 wrote:
>
> Hi Adam,
>
> On 13/01/2019 15:00, Adam Ford wrote:
> > On Thu, Oct 4, 2018 at 12:55 PM Martin Fuzzey
> >  wrote:
> >> Configure the phy regulator if defined by the "phy-supply" DT phandle.
> >>
> >> Signed-off-by: Martin Fuzzey 
> > This patch seems to break the Ethernet on my board, but I think I have
> > a possible solution (see below)
>
> Ah you are right my bad.
>
> I guess this means that you already had the phy-supply property in your
> DT but unused up till now.

I haven't had DM_REGULATOR turned on until recently which is how I
found this bug.
>
>
> >
> > I have a board that uses a fixed regulator driven by a GPIO.  It's
> > neither always-on, nor it is enabled on boot and it doesn't have a
> > specified current setting.  With DM_REGULATOR set, regulator_autoset
> > fails and FEC doesn't come up.
> > Looking at a bunch of other drivers, and how they enable their
> > respective regulators, they're using regulator_set_enable instead of
> > autoset.
>
>
> Indeed, on my board I am setting the voltage and do have regulator-boot-on;,
>
> which is why I didn't run into this issue.
>
>
> Incidentally it looks like if you need to set the voltage you *need*
> regulator-boot-on, which means the regulator will always be enabled too.
>
> There seems to be no way to say "please set this voltage but only switch
> the regulator on if a driver requests it".
>
>
> > Is there a reason we couldn't use
> >
> >  ret = regulator_set_enable(priv->phy_supply, true);
>
> That looks good and tested ok on my board too.

good.
>
>
> Since my patch has now been merged it needs a follow up patch to replace
> regulator_autoset() with regulator_set_enable().

I agree.
>
> I'll send a fix patch soon unless you want to do it as the finder of the
> problem.

I have a patch ready to go.  I can just push it.  I'll CC you on the
e-mail and you can reply as tested-by or reviewed-by or whatever, if
you're open to that.

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


Re: [U-Boot] [PATCH 3/4] net: dm: fec: Support the phy-supply binding

2019-01-15 Thread Martin Fuzzey

Hi Adam,

On 13/01/2019 15:00, Adam Ford wrote:

On Thu, Oct 4, 2018 at 12:55 PM Martin Fuzzey
 wrote:

Configure the phy regulator if defined by the "phy-supply" DT phandle.

Signed-off-by: Martin Fuzzey 

This patch seems to break the Ethernet on my board, but I think I have
a possible solution (see below)


Ah you are right my bad.

I guess this means that you already had the phy-supply property in your 
DT but unused up till now.





I have a board that uses a fixed regulator driven by a GPIO.  It's
neither always-on, nor it is enabled on boot and it doesn't have a
specified current setting.  With DM_REGULATOR set, regulator_autoset
fails and FEC doesn't come up.
Looking at a bunch of other drivers, and how they enable their
respective regulators, they're using regulator_set_enable instead of
autoset.



Indeed, on my board I am setting the voltage and do have regulator-boot-on;,

which is why I didn't run into this issue.


Incidentally it looks like if you need to set the voltage you *need* 
regulator-boot-on, which means the regulator will always be enabled too.


There seems to be no way to say "please set this voltage but only switch 
the regulator on if a driver requests it".




Is there a reason we couldn't use

 ret = regulator_set_enable(priv->phy_supply, true);


That looks good and tested ok on my board too.


Since my patch has now been merged it needs a follow up patch to replace 
regulator_autoset() with regulator_set_enable().


I'll send a fix patch soon unless you want to do it as the finder of the 
problem.



Regards,

Martin


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


[U-Boot] [PATCH 2/2] MSCC: Remove reset.c

2019-01-15 Thread Horatiu Vultur
Remove reset.c because it is not used anymore. It is superseed by
sysreset driver.

Signed-off-by: Horatiu Vultur 
---
 arch/mips/mach-mscc/Makefile   |  2 +-
 arch/mips/mach-mscc/include/mach/ddr.h | 18 -
 arch/mips/mach-mscc/reset.c| 47 --
 3 files changed, 18 insertions(+), 49 deletions(-)
 delete mode 100644 arch/mips/mach-mscc/reset.c

diff --git a/arch/mips/mach-mscc/Makefile b/arch/mips/mach-mscc/Makefile
index f5b6968..349e889 100644
--- a/arch/mips/mach-mscc/Makefile
+++ b/arch/mips/mach-mscc/Makefile
@@ -2,6 +2,6 @@
 
 CFLAGS_cpu.o += -finline-limit=64000
 
-obj-y += cpu.o dram.o reset.o phy.o lowlevel_init.o
+obj-y += cpu.o dram.o phy.o lowlevel_init.o
 obj-$(CONFIG_SOC_LUTON) += lowlevel_init_luton.o gpio.o
 obj-$(CONFIG_SOC_OCELOT) += gpio.o
diff --git a/arch/mips/mach-mscc/include/mach/ddr.h 
b/arch/mips/mach-mscc/include/mach/ddr.h
index 7552acb..a2d20db 100644
--- a/arch/mips/mach-mscc/include/mach/ddr.h
+++ b/arch/mips/mach-mscc/include/mach/ddr.h
@@ -415,6 +415,22 @@ static inline void hal_vcoreiii_ddr_reset_release(void)
sleep_100ns(1);
 }
 
+static void ocelot_restart(void)
+{
+   register u32 resetbits = PERF_SOFT_RST_SOFT_CHIP_RST;
+   (void)readl(BASE_DEVCPU_GCB + PERF_SOFT_RST);
+
+   /* Make sure VCore is NOT protected from reset */
+   clrbits_le32(BASE_CFG + ICPU_RESET, ICPU_RESET_CORE_RST_PROTECT);
+
+   /* Change to SPI bitbang for SPI reset workaround... */
+   writel(ICPU_SW_MODE_SW_SPI_CS_OE(1) | ICPU_SW_MODE_SW_SPI_CS(1) |
+  ICPU_SW_MODE_SW_PIN_CTRL_MODE, BASE_CFG + ICPU_SW_MODE);
+
+   /* Do the global reset */
+   writel(resetbits, BASE_DEVCPU_GCB + PERF_SOFT_RST);
+}
+
 /*
  * DDR memory sanity checking failed, tally and do hard reset
  *
@@ -443,7 +459,7 @@ static inline void hal_vcoreiii_ddr_failed(void)
 * MIPS CPU (and the cache), and the CPU will start executing
 * from the reset vector.
 */
-   reset = KSEG0ADDR(_machine_restart);
+   reset = KSEG0ADDR(ocelot_restart);
icache_lock((void *)reset, 128);
asm volatile ("jr %0"::"r" (reset));
 
diff --git a/arch/mips/mach-mscc/reset.c b/arch/mips/mach-mscc/reset.c
deleted file mode 100644
index e0e610a..000
--- a/arch/mips/mach-mscc/reset.c
+++ /dev/null
@@ -1,47 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
-/*
- * Copyright (c) 2018 Microsemi Corporation
- */
-
-#include 
-
-#include 
-#include 
-
-#include 
-
-void _machine_restart(void)
-{
-#if defined(CONFIG_SOC_JR2)
-   register u32 reg = readl(BASE_CFG + ICPU_GENERAL_CTRL);
-   /* Set owner */
-   reg &= ~ICPU_GENERAL_CTRL_IF_SI_OWNER_M;
-   reg |= ICPU_GENERAL_CTRL_IF_SI_OWNER(1);
-   /* Set boot mode */
-   reg |= ICPU_GENERAL_CTRL_BOOT_MODE_ENA;
-   writel(reg, BASE_CFG + ICPU_GENERAL_CTRL);
-   /* Read back in order to make BOOT mode setting active */
-   reg = readl(BASE_CFG + ICPU_GENERAL_CTRL);
-   /* Reset CPU only - still executing _here_. but from cache */
-   writel(readl(BASE_CFG + ICPU_RESET) |
-  ICPU_RESET_CORE_RST_CPU_ONLY |
-  ICPU_RESET_CORE_RST_FORCE,
-  BASE_CFG + ICPU_RESET);
-#else
-   register u32 resetbits = PERF_SOFT_RST_SOFT_CHIP_RST;
-   (void)readl(BASE_DEVCPU_GCB + PERF_SOFT_RST);
-
-   /* Make sure VCore is NOT protected from reset */
-   clrbits_le32(BASE_CFG + ICPU_RESET, ICPU_RESET_CORE_RST_PROTECT);
-
-   /* Change to SPI bitbang for SPI reset workaround... */
-   writel(ICPU_SW_MODE_SW_SPI_CS_OE(1) | ICPU_SW_MODE_SW_SPI_CS(1) |
-  ICPU_SW_MODE_SW_PIN_CTRL_MODE, BASE_CFG + ICPU_SW_MODE);
-
-   /* Do the global reset */
-   writel(resetbits, BASE_DEVCPU_GCB + PERF_SOFT_RST);
-#endif
-
-   while (1)
-   ; /* NOP */
-}
-- 
2.7.4

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


[U-Boot] [PATCH 1/2] MSCC: Add sysreset drivers for MSCC Socs

2019-01-15 Thread Horatiu Vultur
Add sysreset driver for Luton, Ocelot and Jaguar2 SoCs.

Signed-off-by: Horatiu Vultur 
---
 MAINTAINERS  |   1 +
 arch/mips/dts/mscc,jr2.dtsi  |   7 +-
 arch/mips/dts/mscc,luton.dtsi|  10 +++
 arch/mips/dts/mscc,ocelot.dtsi   |   5 ++
 board/mscc/ocelot/ocelot.c   |  20 +
 configs/mscc_jr2_defconfig   |   2 +
 configs/mscc_luton_defconfig |   2 +
 configs/mscc_ocelot_defconfig|   2 +
 drivers/sysreset/Kconfig |   6 ++
 drivers/sysreset/Makefile|   1 +
 drivers/sysreset/sysreset_mscc.c | 157 +++
 11 files changed, 212 insertions(+), 1 deletion(-)
 create mode 100644 drivers/sysreset/sysreset_mscc.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 3fa5d3e..fb1b69b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -527,6 +527,7 @@ F:  board/mscc/
 F: configs/mscc*
 F: drivers/gpio/mscc_sgpio.c
 F: drivers/spi/mscc_bb_spi.c
+F: drivers/sysreset/sysreset_mscc.c
 F: include/configs/vcoreiii.h
 F: drivers/pinctrl/mscc/
 
diff --git a/arch/mips/dts/mscc,jr2.dtsi b/arch/mips/dts/mscc,jr2.dtsi
index 0900926..86d1378 100644
--- a/arch/mips/dts/mscc,jr2.dtsi
+++ b/arch/mips/dts/mscc,jr2.dtsi
@@ -52,7 +52,12 @@
interrupt-parent = <>;
 
cpu_ctrl: syscon@0 {
-   compatible = "mscc,jr2-cpu-syscon", "syscon";
+   compatible = "mscc,jaguar2-cpu-syscon", "syscon";
+   reg = <0x0 0x2c>;
+   };
+
+   sysreset: sysreset@0 {
+   compatible = "mscc,jaguar2-chip-reset";
reg = <0x0 0x2c>;
};
 
diff --git a/arch/mips/dts/mscc,luton.dtsi b/arch/mips/dts/mscc,luton.dtsi
index d11ec48..7cbb53b 100644
--- a/arch/mips/dts/mscc,luton.dtsi
+++ b/arch/mips/dts/mscc,luton.dtsi
@@ -42,6 +42,16 @@
#size-cells = <1>;
ranges = <0 0x6000 0x1020>;
 
+   cpu_ctrl: syscon@0 {
+   compatible = "mscc,luton-cpu-syscon", "syscon";
+   reg = <0x0 0x2c>;
+   };
+
+   sysreset: sysreset@70090 {
+   compatible = "mscc,luton-chip-reset";
+   reg = <0x70090 0x2c>;
+   };
+
uart0: serial@1010 {
pinctrl-0 = <_pins>;
pinctrl-names = "default";
diff --git a/arch/mips/dts/mscc,ocelot.dtsi b/arch/mips/dts/mscc,ocelot.dtsi
index 2592003..4287117 100644
--- a/arch/mips/dts/mscc,ocelot.dtsi
+++ b/arch/mips/dts/mscc,ocelot.dtsi
@@ -62,6 +62,11 @@
reg = <0x0 0x2c>;
};
 
+   sysreset: sysreset@1070008 {
+   compatible = "mscc,ocelot-chip-reset";
+   reg = <0x1070008 0x4>;
+   };
+
intc: interrupt-controller@70 {
compatible = "mscc,ocelot-icpu-intr";
reg = <0x70 0x70>;
diff --git a/board/mscc/ocelot/ocelot.c b/board/mscc/ocelot/ocelot.c
index 0f7a532..ae5eb4d 100644
--- a/board/mscc/ocelot/ocelot.c
+++ b/board/mscc/ocelot/ocelot.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -25,6 +26,25 @@ void board_debug_uart_init(void)
mscc_gpio_set_alternate(7, 1);
 }
 
+__weak int ocelot_sysreset_request(struct udevice *dev,
+  enum sysreset_t type)
+{
+   u32 resetbits = PERF_SOFT_RST_SOFT_CHIP_RST;
+   (void)readl(BASE_DEVCPU_GCB + PERF_SOFT_RST);
+
+   /* Make sure VCore is NOT protected from reset */
+   clrbits_le32(BASE_CFG + ICPU_RESET, ICPU_RESET_CORE_RST_PROTECT);
+
+   /* Change to SPI bitbang for SPI reset workaround... */
+   writel(ICPU_SW_MODE_SW_SPI_CS_OE(1) | ICPU_SW_MODE_SW_SPI_CS(1) |
+  ICPU_SW_MODE_SW_PIN_CTRL_MODE, BASE_CFG + ICPU_SW_MODE);
+
+   /* Do the global reset */
+   writel(resetbits, BASE_DEVCPU_GCB + PERF_SOFT_RST);
+
+   return -EINPROGRESS;
+}
+
 int board_early_init_r(void)
 {
/* Prepare SPI controller to be used in master mode */
diff --git a/configs/mscc_jr2_defconfig b/configs/mscc_jr2_defconfig
index b215754..0992185 100644
--- a/configs/mscc_jr2_defconfig
+++ b/configs/mscc_jr2_defconfig
@@ -57,3 +57,5 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_LZMA=y
 CONFIG_XZ=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_MSCC=y
diff --git a/configs/mscc_luton_defconfig b/configs/mscc_luton_defconfig
index 7154e97..7c94a76 100644
--- a/configs/mscc_luton_defconfig
+++ b/configs/mscc_luton_defconfig
@@ -69,3 +69,5 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_MSCC_BB_SPI=y
 CONFIG_LZMA=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_MSCC=y
diff --git a/configs/mscc_ocelot_defconfig b/configs/mscc_ocelot_defconfig
index fb6a5bd..7d9abb6 100644
--- a/configs/mscc_ocelot_defconfig
+++ b/configs/mscc_ocelot_defconfig
@@ -69,3 +69,5 @@ CONFIG_SYS_NS16550=y
 

[U-Boot] [PATCH 0/2] MSCC: Add sysreset driver for MSCC SoCs

2019-01-15 Thread Horatiu Vultur
This patch series adds sysreset drivers for MSCC SoCs. There are 3 drivers:
sysreset_jr2, sysreset_ocelot and sysreset_luton.

This is based off the u-boot-mips/next repository.

Horatiu Vultur (2):
  MSCC: Add sysreset drivers for MSCC Socs
  MSCC: Remove reset.c

 MAINTAINERS|   1 +
 arch/mips/dts/mscc,jr2.dtsi|   7 +-
 arch/mips/dts/mscc,luton.dtsi  |  10 +++
 arch/mips/dts/mscc,ocelot.dtsi |   5 ++
 arch/mips/mach-mscc/Makefile   |   2 +-
 arch/mips/mach-mscc/include/mach/ddr.h |  18 +++-
 arch/mips/mach-mscc/reset.c|  47 --
 board/mscc/ocelot/ocelot.c |  20 +
 configs/mscc_jr2_defconfig |   2 +
 configs/mscc_luton_defconfig   |   2 +
 configs/mscc_ocelot_defconfig  |   2 +
 drivers/sysreset/Kconfig   |   6 ++
 drivers/sysreset/Makefile  |   1 +
 drivers/sysreset/sysreset_mscc.c   | 157 +
 14 files changed, 230 insertions(+), 50 deletions(-)
 delete mode 100644 arch/mips/mach-mscc/reset.c
 create mode 100644 drivers/sysreset/sysreset_mscc.c

-- 
2.7.4

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


[U-Boot] [PATCH 1/4] MIPS: mscc: ocelot: Add ethernet nodes for Ocelot

2019-01-15 Thread Gregory CLEMENT
Import Ethernet related nodes from Linux

Signed-off-by: Gregory CLEMENT 
---
 arch/mips/dts/mscc,ocelot.dtsi  | 97 +
 arch/mips/dts/ocelot_pcb123.dts | 20 +++
 2 files changed, 117 insertions(+)

diff --git a/arch/mips/dts/mscc,ocelot.dtsi b/arch/mips/dts/mscc,ocelot.dtsi
index 2592003103..4f3fe356c4 100644
--- a/arch/mips/dts/mscc,ocelot.dtsi
+++ b/arch/mips/dts/mscc,ocelot.dtsi
@@ -112,6 +112,98 @@
status = "disabled";
};
 
+   switch@101 {
+   pinctrl-0 = <_pins>;
+   pinctrl-names = "default";
+
+   compatible = "mscc,vsc7514-switch";
+   reg = <0x101 0x1>, /* VTSS_TO_SYS */
+ <0x103 0x1>, /* VTSS_TO_REW */
+ <0x108 0x100>, /* VTSS_TO_DEVCPU_QS */
+ <0x10d 0x1>, /* VTSS_TO_HSIO */
+ <0x11e 0x100>, /* VTSS_TO_DEV_0 */
+ <0x11f 0x100>, /* VTSS_TO_DEV_1 */
+ <0x120 0x100>, /* VTSS_TO_DEV_2 */
+ <0x121 0x100>, /* VTSS_TO_DEV_3 */
+ <0x122 0x100>, /* VTSS_TO_DEV_4 */
+ <0x123 0x100>, /* VTSS_TO_DEV_5 */
+ <0x124 0x100>, /* VTSS_TO_DEV_6 */
+ <0x125 0x100>, /* VTSS_TO_DEV_7 */
+ <0x126 0x100>, /* VTSS_TO_DEV_8 */
+ <0x127 0x100>, /* NA */
+ <0x128 0x100>, /* NA */
+ <0x180 0x8>, /* VTSS_TO_QSYS */
+ <0x188 0x1>; /* VTSS_TO_ANA */
+   reg-names = "sys", "rew", "qs", "hsio", "port0",
+   "port1", "port2", "port3", "port4", "port5",
+   "port6", "port7", "port8", "port9",
+   "port10", "qsys", "ana";
+   interrupts = <21 22>;
+   interrupt-names = "xtr", "inj";
+   status = "okay";
+
+   ethernet-ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port0: port@0 {
+   reg = <0>;
+   };
+   port1: port@1 {
+   reg = <1>;
+   };
+   port2: port@2 {
+   reg = <2>;
+   };
+   port3: port@3 {
+   reg = <3>;
+   };
+   port4: port@4 {
+   reg = <4>;
+   };
+   port5: port@5 {
+   reg = <5>;
+   };
+   port6: port@6 {
+   reg = <6>;
+   };
+   port7: port@7 {
+   reg = <7>;
+   };
+   port8: port@8 {
+   reg = <8>;
+   };
+   port9: port@9 {
+   reg = <9>;
+   };
+   port10: port@10 {
+   reg = <10>;
+   };
+   };
+   };
+
+   mdio0: mdio@107009c {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "mscc,ocelot-miim";
+   reg = <0x107009c 0x24>, <0x10700f0 0x8>;
+   interrupts = <14>;
+   status = "disabled";
+
+   phy0: ethernet-phy@0 {
+   reg = <0>;
+   };
+   phy1: ethernet-phy@1 {
+   reg = <1>;
+   };
+   phy2: ethernet-phy@2 {
+   reg = <2>;
+   };
+   phy3: ethernet-phy@3 {
+   reg = <3>;
+   };
+   };
+
reset@1070008 {
compatible = "mscc,ocelot-chip-reset";
reg = <0x1070008 0x4>;
@@ -144,6 +236,11 @@
function = 

[U-Boot] [PATCH 0/4] Add network support for Ocelots SoCs

2019-01-15 Thread Gregory CLEMENT
Hello,

this series allows to use the switch component of the Ocelots SoC as
a network interface.

The binding used is exactly the same of the one already used by Linux.

There is also a patch adding a workaround needed on the Ocelot based
boards: indeed the pin connected to the DDR reset is part of the
switch subsystem. So we need ensure that the DDR is not reset during
the switch reset.

Gregory

Gregory CLEMENT (4):
  MIPS: mscc: ocelot: Add ethernet nodes for Ocelot
  net: add MSCC Ocelot switch support
  MIPS: mscc: ocelot: add switch reset support
  configs: mscc_ocelot: add network support

 MAINTAINERS |   1 +
 arch/mips/dts/mscc,ocelot.dtsi  |  97 
 arch/mips/dts/ocelot_pcb123.dts |  20 +
 board/mscc/ocelot/ocelot.c  |  28 ++
 configs/mscc_ocelot_defconfig   |   1 +
 drivers/net/Kconfig |   7 +
 drivers/net/Makefile|   1 +
 drivers/net/ocelot_switch.c | 837 
 8 files changed, 992 insertions(+)
 create mode 100644 drivers/net/ocelot_switch.c

-- 
2.20.1

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


[U-Boot] [PATCH 4/4] configs: mscc_ocelot: add network support

2019-01-15 Thread Gregory CLEMENT
Now that network support is added for the ocelot platform, let's add it
in the default configuration.

Signed-off-by: Gregory CLEMENT 
---
 configs/mscc_ocelot_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/mscc_ocelot_defconfig b/configs/mscc_ocelot_defconfig
index fb6a5bdc31..792d00e646 100644
--- a/configs/mscc_ocelot_defconfig
+++ b/configs/mscc_ocelot_defconfig
@@ -60,6 +60,7 @@ CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_DM_ETH=y
+CONFIG_MSCC_OCELOT_SWITCH=y
 CONFIG_PINCTRL=y
 CONFIG_PINCONF=y
 CONFIG_DM_SERIAL=y
-- 
2.20.1

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


[U-Boot] [PATCH 2/4] net: add MSCC Ocelot switch support

2019-01-15 Thread Gregory CLEMENT
This patch adds support for the Microsemi Ethernet switch present on
Ocelot SoCs.

Signed-off-by: Gregory CLEMENT 
---
 MAINTAINERS |   1 +
 drivers/net/Kconfig |   7 +
 drivers/net/Makefile|   1 +
 drivers/net/ocelot_switch.c | 837 
 4 files changed, 846 insertions(+)
 create mode 100644 drivers/net/ocelot_switch.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 3fa5d3e96f..af44e19eae 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -529,6 +529,7 @@ F:  drivers/gpio/mscc_sgpio.c
 F: drivers/spi/mscc_bb_spi.c
 F: include/configs/vcoreiii.h
 F: drivers/pinctrl/mscc/
+F: drivers/net/ocelot_switch.c
 
 MIPS JZ4780
 M: Ezequiel Garcia 
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 7044c6adf3..10ac15cc6c 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -432,6 +432,13 @@ config SNI_AVE
  This driver implements support for the Socionext AVE Ethernet
  controller, as found on the Socionext UniPhier family.
 
+config MSCC_OCELOT_SWITCH
+   bool "Ocelot switch driver"
+   depends on DM_ETH && ARCH_MSCC
+   select PHYLIB
+   help
+ This driver supports the Ocelot network switch device.
+
 config ETHER_ON_FEC1
bool "FEC1"
depends on MPC8XX_FEC
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 0dbfa03306..bd108c21d1 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -74,3 +74,4 @@ obj-$(CONFIG_DWC_ETH_QOS) += dwc_eth_qos.o
 obj-$(CONFIG_FSL_PFE) += pfe_eth/
 obj-$(CONFIG_SNI_AVE) += sni_ave.o
 obj-y += ti/
+obj-$(CONFIG_MSCC_OCELOT_SWITCH) += ocelot_switch.o
diff --git a/drivers/net/ocelot_switch.c b/drivers/net/ocelot_switch.c
new file mode 100644
index 00..7ad0538b76
--- /dev/null
+++ b/drivers/net/ocelot_switch.c
@@ -0,0 +1,837 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2018 Microsemi Corporation
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define MIIM_STATUS0x0
+#defineMIIM_STAT_BUSY  BIT(3)
+#define MIIM_CMD   0x8
+#defineMIIM_CMD_SCAN   BIT(0)
+#defineMIIM_CMD_OPR_WRITE  BIT(1)
+#defineMIIM_CMD_OPR_READ   BIT(2)
+#defineMIIM_CMD_SINGLE_SCANBIT(3)
+#defineMIIM_CMD_WRDATA(x)  ((x) << 4)
+#defineMIIM_CMD_REGAD(x)   ((x) << 20)
+#defineMIIM_CMD_PHYAD(x)   ((x) << 25)
+#defineMIIM_CMD_VLDBIT(31)
+#define MIIM_DATA  0xC
+#defineMIIM_DATA_ERROR (0x2 << 16)
+
+#define PHY_CFG0x0
+#define PHY_CFG_ENA0xF
+#define PHY_CFG_COMMON_RST BIT(4)
+#define PHY_CFG_RST(0xF << 5)
+#define PHY_STAT   0x4
+#define PHY_STAT_SUPERVISOR_COMPLETE   BIT(0)
+
+#define ANA_PORT_VLAN_CFG(x)   (0x7000 + 0x100 * (x))
+#defineANA_PORT_VLAN_CFG_AWARE_ENA BIT(20)
+#defineANA_PORT_VLAN_CFG_POP_CNT(x)((x) << 18)
+#define ANA_PORT_PORT_CFG(x)   (0x7070 + 0x100 * (x))
+#defineANA_PORT_PORT_CFG_RECV_ENA  BIT(6)
+#defineANA_TABLES_MACHDATA 0x8b34
+#defineANA_TABLES_MACLDATA 0x8b38
+#define ANA_TABLES_MACACCESS   0x8b3c
+#defineANA_TABLES_MACACCESS_VALID  BIT(11)
+#defineANA_TABLES_MACACCESS_ENTRYTYPE(x)   ((x) << 9)
+#defineANA_TABLES_MACACCESS_DEST_IDX(x)((x) << 3)
+#defineANA_TABLES_MACACCESS_MAC_TABLE_CMD(x)   (x)
+#defineANA_TABLES_MACACCESS_MAC_TABLE_CMD_MGENMASK(2, 0)
+#defineMACACCESS_CMD_IDLE 0
+#defineMACACCESS_CMD_LEARN1
+#defineMACACCESS_CMD_GET_NEXT 4
+#define ANA_PGID(x)(0x8c00 + 4 * (x))
+
+#define SYS_FRM_AGING  0x574
+#defineSYS_FRM_AGING_ENA   BIT(20)
+
+#define SYS_SYSTEM_RST_CFG 0x508
+#defineSYS_SYSTEM_RST_MEM_INIT BIT(0)
+#defineSYS_SYSTEM_RST_MEM_ENA  BIT(1)
+#defineSYS_SYSTEM_RST_CORE_ENA BIT(2)
+#define SYS_PORT_MODE(x)   (0x514 + 0x4 * (x))
+#defineSYS_PORT_MODE_INCL_INJ_HDR(x)   ((x) << 3)
+#defineSYS_PORT_MODE_INCL_INJ_HDR_MGENMASK(4, 3)
+#defineSYS_PORT_MODE_INCL_XTR_HDR(x)   ((x) << 1)
+#defineSYS_PORT_MODE_INCL_XTR_HDR_MGENMASK(2, 1)
+#defineSYS_PAUSE_CFG(x)(0x608 + 0x4 * (x))
+#defineSYS_PAUSE_CFG_PAUSE_ENA BIT(0)
+

[U-Boot] [PATCH 3/4] MIPS: mscc: ocelot: add switch reset support

2019-01-15 Thread Gregory CLEMENT
On some ocelots platform a workaround is needed in order to be able to
reset the switch without resetting the DDR.

Signed-off-by: Gregory CLEMENT 
---
 board/mscc/ocelot/ocelot.c | 28 
 1 file changed, 28 insertions(+)

diff --git a/board/mscc/ocelot/ocelot.c b/board/mscc/ocelot/ocelot.c
index 0f7a532158..88f59e8044 100644
--- a/board/mscc/ocelot/ocelot.c
+++ b/board/mscc/ocelot/ocelot.c
@@ -18,6 +18,34 @@ enum {
BOARD_TYPE_PCB123,
 };
 
+void mscc_switch_reset(bool enter)
+{
+   u32 reg, count = 0;
+
+   /* Nasty workaround to avoid GPIO19 (DDR!) being reset */
+   mscc_gpio_set_alternate(19, 2);
+
+   printf("applying SwC reset\n");
+
+   writel(ICPU_RESET_CORE_RST_PROTECT, BASE_CFG + ICPU_RESET);
+   writel(PERF_SOFT_RST_SOFT_CHIP_RST, BASE_DEVCPU_GCB + PERF_SOFT_RST);
+
+   do {
+   reg = readl(BASE_DEVCPU_GCB + PERF_SOFT_RST);
+   count++;
+   } while (reg & PERF_SOFT_RST_SOFT_CHIP_RST);
+
+   printf("SwC reset done - reg = 0x%08x, count %u\n", reg, count);
+
+   /*
+* Reset GPIO19 mode back as regular GPIO, output, high (DDR
+* not reset) (Order is important)
+*/
+   setbits_le32(BASE_DEVCPU_GCB + PERF_GPIO_OE, BIT(19));
+   writel(BIT(19), BASE_DEVCPU_GCB + PERF_GPIO_OUT_SET);
+   mscc_gpio_set_alternate(19, 0);
+}
+
 void board_debug_uart_init(void)
 {
/* too early for the pinctrl driver, so configure the UART pins here */
-- 
2.20.1

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


Re: [U-Boot] [PATCH 2/2] lib: fdtdec: fixup fdtdec_get_addr_size

2019-01-15 Thread Simon Glass
Hi Keerthy,

On Mon, 14 Jan 2019 at 18:52, J, KEERTHY  wrote:
>
>
>
> On 1/15/2019 6:23 AM, Simon Glass wrote:
> > Hi Keerthy,
> >
> > On Thu, 3 Jan 2019 at 21:39, Keerthy  wrote:
> >>
> >>
> >>
> >> On Thursday 03 January 2019 11:44 PM, s...@google.com wrote:
> >>> On 12/21/18 9:24 AM, Keerthy wrote:
>  fix up fdtdec_get_addr_size to use fdtdec_get_addr_size_auto_noparent
>  so that the address cells and size cells are obtained from the
>  parent instead of going by the fixed length.
> >>>
> >>> This patch makes perfect sense to me. However, I am worried about the
> >>> potential existence of code that assumes the current fixed-size logic;
> >>> in the past when fixing similar issues like this we've often run into
> >>> code that was use "get addr" functions when it should have been using
> >>> "get u32" functions and similar, which then broke when we fixed the
> >>> implementation to do the right thing. I guess we should still apply the
> >>> patch, and fix up any fallout as it appears.
> >>
> >> Thanks Simon!
> >
> > Unfortunately this breaks the tests (make qcheck). Can you please take a 
> > look?
>
>
> Simon,
>
> Can you paste the logs? I am at u-boot master tip and my qcheck seems to
> err out.
> https://pastebin.ubuntu.com/p/7Q53TMqxMQ/

You should get the tests running. In this case see README.sandbox.
Otherwise any patch you send may break U-Boot.

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


Re: [U-Boot] [PATCH] common: Break USB_STORAGE dependency between SPL and u-boot proper

2019-01-15 Thread Abel Vesa
On 19-01-15 11:10:51, Tom Rini wrote:
> On Tue, Jan 15, 2019 at 04:05:43PM +, Abel Vesa wrote:
> > On 19-01-15 11:02:09, Tom Rini wrote:
> > > On Tue, Jan 15, 2019 at 11:07:23AM +, Abel Vesa wrote:
> > > 
> > > > Some boards might need USB_STORAGE enabled in u-boot proper but not in 
> > > > SPL.
> > > > Make a separate config for SPL and keep the same depends on conditions 
> > > > but for SPL.
> > > > 
> > > > Signed-off-by: Abel Vesa 
> > > > ---
> > > >  common/Makefile| 2 +-
> > > >  configs/apalis_imx6_defconfig  | 1 +
> > > >  configs/colibri_imx6_defconfig | 1 +
> > > >  configs/mx6sabresd_defconfig   | 1 +
> > > >  drivers/usb/Kconfig| 8 
> > > >  5 files changed, 12 insertions(+), 1 deletion(-)
> > > 
> > > The root problem here, as I discovered today digging in another patch is
> > > that in essence CONFIG_SPL_USB_SUPPORT is mis-named and should be
> > > CONFIG_SPL_USB_STORAGE and all cases in Makefiles of
> > 
> > I think those too are two separete thing. You can have SPL_USB_SUPPORT 
> > enabled,
> > but the SPL_USB_STORAGE disabled. For example, for SDP support in SPL
> > you need SPL_USB_SUPPORT, but you don't need the SPL_USB_STORAGE. So,
> > IMO, they need to remain two separate things. 
> 
> No, you can't.  Or rather, the option names are a bit confusing.
> CONFIG_SPL_USB_SUPPORT controls common/spl/spl_usb.c and that will not
> function without CONFIG_USB_STORAGE support as it's specifically about
> loading from a device.  It's also only set for some TI AM43xx platforms
> as the ROM there supports booting from USB sticks and in turn we have
> SPL doing so.  CONFIG_SPL_USB_HOST_SUPPORT is different and is set on
> both AM43xx and various NXP platforms and is what you're after, without
> the storage support side.
> 
> Aside, what is the USB host case on i.MX?  It's not acting in host mode
> when being passed U-Boot via imx_usb, is it?

For imx_usb, SDP is used (CONFIG_SPL_USB_SDP_SUPPORT)
which is under CONFIG_SPL_USB_GADGET (not CONFIG_SPL_USB_SUPPORT
or CONFIG_SPL_USB_HOST_SUPPORT).

So you're right, CONFIG_SPL_USB_SUPPORT has nothing to do with SDP.


> 
> -- 
> Tom

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


Re: [U-Boot] [PATCH] common: Break USB_STORAGE dependency between SPL and u-boot proper

2019-01-15 Thread Abel Vesa
On 19-01-15 11:02:09, Tom Rini wrote:
> On Tue, Jan 15, 2019 at 11:07:23AM +, Abel Vesa wrote:
> 
> > Some boards might need USB_STORAGE enabled in u-boot proper but not in SPL.
> > Make a separate config for SPL and keep the same depends on conditions but 
> > for SPL.
> > 
> > Signed-off-by: Abel Vesa 
> > ---
> >  common/Makefile| 2 +-
> >  configs/apalis_imx6_defconfig  | 1 +
> >  configs/colibri_imx6_defconfig | 1 +
> >  configs/mx6sabresd_defconfig   | 1 +
> >  drivers/usb/Kconfig| 8 
> >  5 files changed, 12 insertions(+), 1 deletion(-)
> 
> The root problem here, as I discovered today digging in another patch is
> that in essence CONFIG_SPL_USB_SUPPORT is mis-named and should be
> CONFIG_SPL_USB_STORAGE and all cases in Makefiles of

Ithink those too are two separete thing. You can have SPL_USB_SUPPORT enabled,
but the SPL_USB_STORAGE disabled. For example, for SDP support in SPL you need 
SPL_USB_SUPPORT,
but you don't need the SPL_USB_STORAGE. So, IMO, they need to remain two 
separate things. 

> obj-$(CONFIG_USB_STORAGE) should be obj-$(CONFIG_$(SPL_)USB_STORAGE) and
> common/spl/spl_usb.c have its ifdef's cleaned slightly as that code
> cannot function without CONFIG_USB_STORAGE set (stor_dev will be NULL
> and that _will_ oops later on).
> 
> -- 
> Tom

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


[U-Boot] [PATCH u-boot 10/11] arm: meson64: enable console mux and console env by default

2019-01-15 Thread Neil Armstrong
From: Maxime Jourdan 

With the recent addition of the meson VPU driver, enable the following
config entries by default for meson-64 targets: CONFIG_CONSOLE_MUX,
CONFIG_SYS_CONSOLE_IS_IN_ENV.

This allows outputting the console via video if CONFIG_VIDEO_MESON is
selected.

Signed-off-by: Maxime Jourdan 
Signed-off-by: Neil Armstrong 
---
 configs/khadas-vim2_defconfig  | 2 ++
 configs/khadas-vim_defconfig   | 2 ++
 configs/libretech-cc_defconfig | 2 ++
 configs/odroid-c2_defconfig| 2 ++
 configs/p212_defconfig | 2 ++
 5 files changed, 10 insertions(+)

diff --git a/configs/khadas-vim2_defconfig b/configs/khadas-vim2_defconfig
index 75514d2ca5..ed8e32776c 100644
--- a/configs/khadas-vim2_defconfig
+++ b/configs/khadas-vim2_defconfig
@@ -44,3 +44,5 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
 CONFIG_USB_DWC3=y
 CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
diff --git a/configs/khadas-vim_defconfig b/configs/khadas-vim_defconfig
index cf87802653..add8e0973a 100644
--- a/configs/khadas-vim_defconfig
+++ b/configs/khadas-vim_defconfig
@@ -49,3 +49,5 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
 CONFIG_USB_DWC3=y
 CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
diff --git a/configs/libretech-cc_defconfig b/configs/libretech-cc_defconfig
index c21b9ad9ca..c3fdca5e67 100644
--- a/configs/libretech-cc_defconfig
+++ b/configs/libretech-cc_defconfig
@@ -49,3 +49,5 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
 CONFIG_USB_DWC3=y
 CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig
index 33e6e74fa2..60cf97b3b6 100644
--- a/configs/odroid-c2_defconfig
+++ b/configs/odroid-c2_defconfig
@@ -38,3 +38,5 @@ CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_DEBUG_UART_SKIP_INIT=y
 CONFIG_MESON_SERIAL=y
 CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
diff --git a/configs/p212_defconfig b/configs/p212_defconfig
index 2ab47e616f..d2c2da10f4 100644
--- a/configs/p212_defconfig
+++ b/configs/p212_defconfig
@@ -48,3 +48,5 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
 CONFIG_USB_DWC3=y
 CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
-- 
2.20.1

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


[U-Boot] [PATCH u-boot 11/11] arm: libretech-cc: enable video by default

2019-01-15 Thread Neil Armstrong
From: Maxime Jourdan 

libretech-cc being the main device tested with CONFIG_VIDEO_MESON, let's
enable it by default.

Also enable:
 - CONFIG_SYS_WHITE_ON_BLACK for prettiness
 - CONFIG_VIDEO_DT_SIMPLEFB for framebuffer sharing with kernel

Signed-off-by: Maxime Jourdan 
Signed-off-by: Neil Armstrong 
---
 configs/libretech-cc_defconfig | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/configs/libretech-cc_defconfig b/configs/libretech-cc_defconfig
index c3fdca5e67..fa01b15a0b 100644
--- a/configs/libretech-cc_defconfig
+++ b/configs/libretech-cc_defconfig
@@ -51,3 +51,9 @@ CONFIG_USB_DWC3=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_MESON_GX_VPU_POWER_DOMAIN=y
+CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_MESON=y
+CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_VIDEO_DT_SIMPLEFB=y
-- 
2.20.1

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


[U-Boot] [PATCH u-boot 05/11] arm64: dts: meson-gx: vpu should be probed before relocation

2019-01-15 Thread Neil Armstrong
From: Maxime Jourdan 

Flag the appropriate nodes with u-boot,dm-pre-reloc

Signed-off-by: Maxime Jourdan 
Signed-off-by: Neil Armstrong 
---
 arch/arm/dts/meson-gx-u-boot.dtsi | 15 +++
 arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi |  7 +++
 arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi  |  7 +++
 .../dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi|  7 +++
 .../dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi  |  7 +++
 arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi |  7 +++
 arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi|  7 +++
 7 files changed, 57 insertions(+)
 create mode 100644 arch/arm/dts/meson-gx-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi

diff --git a/arch/arm/dts/meson-gx-u-boot.dtsi 
b/arch/arm/dts/meson-gx-u-boot.dtsi
new file mode 100644
index 00..868a573e2a
--- /dev/null
+++ b/arch/arm/dts/meson-gx-u-boot.dtsi
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Maxime Jourdan 
+ */
+
+/ {
+   soc {
+   u-boot,dm-pre-reloc;
+   };
+};
+
+ {
+   u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi 
b/arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi
new file mode 100644
index 00..c35158d7e9
--- /dev/null
+++ b/arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong 
+ */
+
+#include "meson-gx-u-boot.dtsi"
diff --git a/arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi 
b/arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi
new file mode 100644
index 00..c35158d7e9
--- /dev/null
+++ b/arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong 
+ */
+
+#include "meson-gx-u-boot.dtsi"
diff --git a/arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi 
b/arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi
new file mode 100644
index 00..c35158d7e9
--- /dev/null
+++ b/arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong 
+ */
+
+#include "meson-gx-u-boot.dtsi"
diff --git a/arch/arm/dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi 
b/arch/arm/dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi
new file mode 100644
index 00..c35158d7e9
--- /dev/null
+++ b/arch/arm/dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong 
+ */
+
+#include "meson-gx-u-boot.dtsi"
diff --git a/arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi 
b/arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi
new file mode 100644
index 00..c35158d7e9
--- /dev/null
+++ b/arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong 
+ */
+
+#include "meson-gx-u-boot.dtsi"
diff --git a/arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi 
b/arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi
new file mode 100644
index 00..c35158d7e9
--- /dev/null
+++ b/arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong 
+ */
+
+#include "meson-gx-u-boot.dtsi"
-- 
2.20.1

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


[U-Boot] [PATCH u-boot 09/11] configs: meson64: use vidconsole and usbkbd if enabled

2019-01-15 Thread Neil Armstrong
Allows displaying the console via video and using a USB keyboard.

Also enables CONFIG_SPLASH_SCREEN if using video.

Signed-off-by: Neil Armstrong 
Signed-off-by: Maxime Jourdan 
---
 include/configs/meson64.h | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/include/configs/meson64.h b/include/configs/meson64.h
index 40ac079dfc..d82a674270 100644
--- a/include/configs/meson64.h
+++ b/include/configs/meson64.h
@@ -16,6 +16,26 @@
 #define GICC_BASE  0xc4302000
 #endif
 
+/* For splashscreen */
+#ifdef CONFIG_DM_VIDEO
+#define CONFIG_VIDEO_BMP_RLE8
+#define CONFIG_BMP_16BPP
+#define CONFIG_BMP_24BPP
+#define CONFIG_BMP_32BPP
+#define CONFIG_SPLASH_SCREEN
+#define CONFIG_SPLASH_SCREEN_ALIGN
+#define STDOUT_CFG "vidconsole,serial"
+#else
+#define STDOUT_CFG "serial"
+#endif
+
+#ifdef CONFIG_USB_KEYBOARD
+#define STDIN_CFG "usbkbd,serial"
+#define CONFIG_PREBOOT "usb start"
+#else
+#define STDIN_CFG "serial"
+#endif
+
 #define CONFIG_CPU_ARMV8
 #define CONFIG_REMAKE_ELF
 #define CONFIG_ENV_SIZE0x2000
@@ -59,6 +79,9 @@
 
 #ifndef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS \
+   "stdin=" STDIN_CFG "\0" \
+   "stdout=" STDOUT_CFG "\0" \
+   "stderr=" STDOUT_CFG "\0" \
"fdt_addr_r=0x08008000\0" \
"scriptaddr=0x0800\0" \
"kernel_addr_r=0x0808\0" \
-- 
2.20.1

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


[U-Boot] [PATCH u-boot 06/11] arm64: dts: meson-gx: Add hdmi_5v regulator as hdmi tx supply

2019-01-15 Thread Neil Armstrong
The hdmi_5v regulator must be enabled to provide power to the physical HDMI
PHY and enables the HDMI 5V presence loopback for the monitor.

Fixes: b409f625a6d5 ("ARM64: dts: meson-gx: Add HDMI_5V regulator on selected 
boards")
Signed-off-by: Neil Armstrong 
Signed-off-by: Kevin Hilman 
[backport of linux commit e1f2163deac059ad39f07aba9e314ebe605d5a7a]
---
 arch/arm/dts/meson-gxl-s905x-khadas-vim.dts   | 1 +
 arch/arm/dts/meson-gxl-s905x-libretech-cc.dts | 1 +
 arch/arm/dts/meson-gxl-s905x-p212.dts | 1 +
 arch/arm/dts/meson-gxm-khadas-vim2.dts| 1 +
 4 files changed, 4 insertions(+)

diff --git a/arch/arm/dts/meson-gxl-s905x-khadas-vim.dts 
b/arch/arm/dts/meson-gxl-s905x-khadas-vim.dts
index d32cf38463..ceb34afe42 100644
--- a/arch/arm/dts/meson-gxl-s905x-khadas-vim.dts
+++ b/arch/arm/dts/meson-gxl-s905x-khadas-vim.dts
@@ -78,6 +78,7 @@
status = "okay";
pinctrl-0 = <_hpd_pins>, <_i2c_pins>;
pinctrl-names = "default";
+   hdmi-supply = <_5v>;
 };
 
 _tx_tmds_port {
diff --git a/arch/arm/dts/meson-gxl-s905x-libretech-cc.dts 
b/arch/arm/dts/meson-gxl-s905x-libretech-cc.dts
index 90a56af967..a23252efc6 100644
--- a/arch/arm/dts/meson-gxl-s905x-libretech-cc.dts
+++ b/arch/arm/dts/meson-gxl-s905x-libretech-cc.dts
@@ -155,6 +155,7 @@
status = "okay";
pinctrl-0 = <_hpd_pins>, <_i2c_pins>;
pinctrl-names = "default";
+   hdmi-supply = <_5v>;
 };
 
 _tx_tmds_port {
diff --git a/arch/arm/dts/meson-gxl-s905x-p212.dts 
b/arch/arm/dts/meson-gxl-s905x-p212.dts
index 5896e8a5d8..2602940c20 100644
--- a/arch/arm/dts/meson-gxl-s905x-p212.dts
+++ b/arch/arm/dts/meson-gxl-s905x-p212.dts
@@ -51,6 +51,7 @@
status = "okay";
pinctrl-0 = <_hpd_pins>, <_i2c_pins>;
pinctrl-names = "default";
+   hdmi-supply = <_5v>;
 };
 
 _tx_tmds_port {
diff --git a/arch/arm/dts/meson-gxm-khadas-vim2.dts 
b/arch/arm/dts/meson-gxm-khadas-vim2.dts
index 313f88f875..782e9edac8 100644
--- a/arch/arm/dts/meson-gxm-khadas-vim2.dts
+++ b/arch/arm/dts/meson-gxm-khadas-vim2.dts
@@ -271,6 +271,7 @@
status = "okay";
pinctrl-0 = <_hpd_pins>, <_i2c_pins>;
pinctrl-names = "default";
+   hdmi-supply = <_5v>;
 };
 
 _tx_tmds_port {
-- 
2.20.1

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


[U-Boot] [PATCH u-boot 08/11] arm: meson: board-gx: Setup VPU in fdt

2019-01-15 Thread Neil Armstrong
From: Maxime Jourdan 

If VIDEO_MESON is enabled, we need to setup the fdt for the framebuffer.

Call meson_vpu_rsv_fb() which reserves the framebuffer memory region for
EFI, and sets up simple-framebuffer nodes if simplefb support is
enabled.

Signed-off-by: Maxime Jourdan 
Signed-off-by: Neil Armstrong 
---
 arch/arm/mach-meson/board-gx.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-meson/board-gx.c b/arch/arm/mach-meson/board-gx.c
index e41552db52..5b0126a72e 100644
--- a/arch/arm/mach-meson/board-gx.c
+++ b/arch/arm/mach-meson/board-gx.c
@@ -9,6 +9,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -65,6 +66,10 @@ void meson_init_reserved_memory(void *fdt)
/* Add BL32 reserved zone */
if (bl32_start && bl32_size)
meson_board_add_reserved_memory(fdt, bl32_start, bl32_size);
+
+#if defined(CONFIG_VIDEO_MESON)
+   meson_vpu_rsv_fb(fdt);
+#endif
 }
 
 phys_size_t get_effective_memsize(void)
-- 
2.20.1

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


[U-Boot] [PATCH u-boot 07/11] arm64: dts: meson-gx: add hhi reg entry to hdmi_tx

2019-01-15 Thread Neil Armstrong
From: Maxime Jourdan 

There's no reliable way to reuse the hhi entry from the vpu as is done
in the linux kernel, so we duplicate it here.

We will be able to sync against kernel DTS in the future when the VPU
gets based on the clock framework rather than the HHI reg.

Signed-off-by: Maxime Jourdan 
Signed-off-by: Neil Armstrong 
---
 arch/arm/dts/meson-gx-u-boot.dtsi | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/dts/meson-gx-u-boot.dtsi 
b/arch/arm/dts/meson-gx-u-boot.dtsi
index 868a573e2a..b84e5edba4 100644
--- a/arch/arm/dts/meson-gx-u-boot.dtsi
+++ b/arch/arm/dts/meson-gx-u-boot.dtsi
@@ -13,3 +13,9 @@
  {
u-boot,dm-pre-reloc;
 };
+
+_tx {
+   reg = <0x0 0xc883a000 0x0 0x1c>,
+ <0x0 0xc883c000 0x0 0x1000>;
+   reg-names = "hdmitx", "hhi";
+};
-- 
2.20.1

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


[U-Boot] [PATCH u-boot 02/11] video: dw_hdmi: support SoC specific read/write ops

2019-01-15 Thread Neil Armstrong
From: Jorge Ramirez-Ortiz 

Some IPs like the meson VPU have a specific way to write to dw_hdmi
registers. Make it configurable.

Signed-off-by: Jorge Ramirez-Ortiz 
[added commit description]
Signed-off-by: Maxime Jourdan 
Signed-off-by: Neil Armstrong 
---
 drivers/video/dw_hdmi.c | 14 --
 include/dw_hdmi.h   |  2 ++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/video/dw_hdmi.c b/drivers/video/dw_hdmi.c
index 229bd63c97..e03f24fa98 100644
--- a/drivers/video/dw_hdmi.c
+++ b/drivers/video/dw_hdmi.c
@@ -52,7 +52,7 @@ static const struct tmds_n_cts n_cts_table[] = {
}
 };
 
-static void hdmi_write(struct dw_hdmi *hdmi, u8 val, int offset)
+static void dw_hdmi_write(struct dw_hdmi *hdmi, u8 val, int offset)
 {
switch (hdmi->reg_io_width) {
case 1:
@@ -67,7 +67,7 @@ static void hdmi_write(struct dw_hdmi *hdmi, u8 val, int 
offset)
}
 }
 
-static u8 hdmi_read(struct dw_hdmi *hdmi, int offset)
+static u8 dw_hdmi_read(struct dw_hdmi *hdmi, int offset)
 {
switch (hdmi->reg_io_width) {
case 1:
@@ -82,6 +82,10 @@ static u8 hdmi_read(struct dw_hdmi *hdmi, int offset)
return 0;
 }
 
+static u8 (*hdmi_read)(struct dw_hdmi *hdmi, int offset) = dw_hdmi_read;
+static void (*hdmi_write)(struct dw_hdmi *hdmi, u8 val, int offset) =
+dw_hdmi_write;
+
 static void hdmi_mod(struct dw_hdmi *hdmi, unsigned reg, u8 mask, u8 data)
 {
u8 val = hdmi_read(hdmi, reg) & ~mask;
@@ -754,6 +758,12 @@ void dw_hdmi_init(struct dw_hdmi *hdmi)
  HDMI_IH_MUTE_MUTE_WAKEUP_INTERRUPT |
  HDMI_IH_MUTE_MUTE_ALL_INTERRUPT;
 
+   if (hdmi->write_reg)
+   hdmi_write = hdmi->write_reg;
+
+   if (hdmi->read_reg)
+   hdmi_read = hdmi->read_reg;
+
hdmi_write(hdmi, ih_mute, HDMI_IH_MUTE);
 
/* enable i2c master done irq */
diff --git a/include/dw_hdmi.h b/include/dw_hdmi.h
index 23088ec768..35edc189c0 100644
--- a/include/dw_hdmi.h
+++ b/include/dw_hdmi.h
@@ -472,6 +472,8 @@ struct dw_hdmi {
u8 reg_io_width;
 
int (*phy_set)(struct dw_hdmi *hdmi, uint mpixelclock);
+   void (*write_reg)(struct dw_hdmi *hdmi, u8 val, int offset);
+   u8 (*read_reg)(struct dw_hdmi *hdmi, int offset);
 };
 
 int dw_hdmi_phy_cfg(struct dw_hdmi *hdmi, uint mpixelclock);
-- 
2.20.1

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


[U-Boot] [PATCH u-boot 03/11] video: dw_hdmi: add support for color conversion

2019-01-15 Thread Neil Armstrong
From: Jorge Ramirez-Ortiz 

Some IPs like the meson VPU can only feed a particular pixel format to
dw_hdmi. As of now, the driver is hardcoded to use RGB888 as input.

This commit enables different pixel format inputs, with the appropriate
CSC configuration.

Signed-off-by: Jorge Ramire-Ortiz 
Signed-off-by: Maxime Jourdan 
Signed-off-by: Neil Armstrong 
---
 drivers/video/dw_hdmi.c| 253 -
 include/dw_hdmi.h  |  72 +++
 include/media_bus_format.h | 156 +++
 3 files changed, 480 insertions(+), 1 deletion(-)
 create mode 100644 include/media_bus_format.h

diff --git a/drivers/video/dw_hdmi.c b/drivers/video/dw_hdmi.c
index e03f24fa98..463436edf3 100644
--- a/drivers/video/dw_hdmi.c
+++ b/drivers/video/dw_hdmi.c
@@ -8,6 +8,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "dw_hdmi.h"
 
 struct tmds_n_cts {
@@ -52,6 +53,24 @@ static const struct tmds_n_cts n_cts_table[] = {
}
 };
 
+static const u16 csc_coeff_default[3][4] = {
+   { 0x2000, 0x, 0x, 0x },
+   { 0x, 0x2000, 0x, 0x },
+   { 0x, 0x, 0x2000, 0x }
+};
+
+static const u16 csc_coeff_rgb_in_eitu601[3][4] = {
+   { 0x2591, 0x1322, 0x074b, 0x },
+   { 0x6535, 0x2000, 0x7acc, 0x0200 },
+   { 0x6acd, 0x7534, 0x2000, 0x0200 }
+};
+
+static const u16 csc_coeff_rgb_out_eitu601[3][4] = {
+   { 0x2000, 0x6926, 0x74fd, 0x010e },
+   { 0x2000, 0x2cdd, 0x, 0x7e9a },
+   { 0x2000, 0x, 0x38b4, 0x7e3b }
+};
+
 static void dw_hdmi_write(struct dw_hdmi *hdmi, u8 val, int offset)
 {
switch (hdmi->reg_io_width) {
@@ -162,9 +181,52 @@ static void hdmi_audio_set_samplerate(struct dw_hdmi 
*hdmi, u32 pixel_clk)
  */
 static void hdmi_video_sample(struct dw_hdmi *hdmi)
 {
-   u32 color_format = 0x01;
+   u32 color_format;
uint val;
 
+   switch (hdmi->hdmi_data.enc_in_bus_format) {
+   case MEDIA_BUS_FMT_RGB888_1X24:
+   color_format = 0x01;
+   break;
+   case MEDIA_BUS_FMT_RGB101010_1X30:
+   color_format = 0x03;
+   break;
+   case MEDIA_BUS_FMT_RGB121212_1X36:
+   color_format = 0x05;
+   break;
+   case MEDIA_BUS_FMT_RGB161616_1X48:
+   color_format = 0x07;
+   break;
+   case MEDIA_BUS_FMT_YUV8_1X24:
+   case MEDIA_BUS_FMT_UYYVYY8_0_5X24:
+   color_format = 0x09;
+   break;
+   case MEDIA_BUS_FMT_YUV10_1X30:
+   case MEDIA_BUS_FMT_UYYVYY10_0_5X30:
+   color_format = 0x0B;
+   break;
+   case MEDIA_BUS_FMT_YUV12_1X36:
+   case MEDIA_BUS_FMT_UYYVYY12_0_5X36:
+   color_format = 0x0D;
+   break;
+   case MEDIA_BUS_FMT_YUV16_1X48:
+   case MEDIA_BUS_FMT_UYYVYY16_0_5X48:
+   color_format = 0x0F;
+   break;
+   case MEDIA_BUS_FMT_UYVY8_1X16:
+   color_format = 0x16;
+   break;
+   case MEDIA_BUS_FMT_UYVY10_1X20:
+   color_format = 0x14;
+   break;
+   case MEDIA_BUS_FMT_UYVY12_1X24:
+   color_format = 0x12;
+   break;
+   default:
+   color_format = 0x01;
+   break;
+   }
+
val = HDMI_TX_INVID0_INTERNAL_DE_GENERATOR_DISABLE |
  ((color_format << HDMI_TX_INVID0_VIDEO_MAPPING_OFFSET) &
  HDMI_TX_INVID0_VIDEO_MAPPING_MASK);
@@ -457,6 +519,180 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
hdmi_write(hdmi, edid->vsync_len.typ, HDMI_FC_VSYNCINWIDTH);
 }
 
+static bool hdmi_bus_fmt_is_rgb(unsigned int bus_format)
+{
+   switch (bus_format) {
+   case MEDIA_BUS_FMT_RGB888_1X24:
+   case MEDIA_BUS_FMT_RGB101010_1X30:
+   case MEDIA_BUS_FMT_RGB121212_1X36:
+   case MEDIA_BUS_FMT_RGB161616_1X48:
+   return true;
+
+   default:
+   return false;
+   }
+}
+
+static bool hdmi_bus_fmt_is_yuv444(unsigned int bus_format)
+{
+   switch (bus_format) {
+   case MEDIA_BUS_FMT_YUV8_1X24:
+   case MEDIA_BUS_FMT_YUV10_1X30:
+   case MEDIA_BUS_FMT_YUV12_1X36:
+   case MEDIA_BUS_FMT_YUV16_1X48:
+   return true;
+
+   default:
+   return false;
+   }
+}
+
+static bool hdmi_bus_fmt_is_yuv422(unsigned int bus_format)
+{
+   switch (bus_format) {
+   case MEDIA_BUS_FMT_UYVY8_1X16:
+   case MEDIA_BUS_FMT_UYVY10_1X20:
+   case MEDIA_BUS_FMT_UYVY12_1X24:
+   return true;
+
+   default:
+   return false;
+   }
+}
+
+static int is_color_space_interpolation(struct dw_hdmi *hdmi)
+{
+   if (!hdmi_bus_fmt_is_yuv422(hdmi->hdmi_data.enc_in_bus_format))
+   return 0;
+
+   if (hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_out_bus_format) ||
+   hdmi_bus_fmt_is_yuv444(hdmi->hdmi_data.enc_out_bus_format))
+   return 1;
+
+   return 

[U-Boot] [PATCH u-boot 01/11] power: domain: meson-gx-pwrc-vpu: add missing depends

2019-01-15 Thread Neil Armstrong
From: Maxime Jourdan 

MESON_GX_VPU_POWER_DOMAIN should depend on POWER_DOMAIN.

Signed-off-by: Maxime Jourdan 
Signed-off-by: Neil Armstrong 
---
 drivers/power/domain/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/domain/Kconfig b/drivers/power/domain/Kconfig
index 93deaef809..06bba6220b 100644
--- a/drivers/power/domain/Kconfig
+++ b/drivers/power/domain/Kconfig
@@ -32,7 +32,7 @@ config MTK_POWER_DOMAIN
 
 config MESON_GX_VPU_POWER_DOMAIN
bool "Enable Amlogic Meson GX VPU power domain driver"
-   depends on ARCH_MESON
+   depends on POWER_DOMAIN && ARCH_MESON
help
  Enable support for manipulating Amlogic Meson GX Video Processing
  Unit power domain.
-- 
2.20.1

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


[U-Boot] [PATCH u-boot 00/11] meson: add support for Video Output

2019-01-15 Thread Neil Armstrong
This patchset adds support for CVBS and/or HDMI output for Amlogic
Meson GX SoCs (GXBB, GXL and GXM) based on the Linux Meson DRM driver
ported to the U-Boot Video DM model. It supports only the "DMT" video
modes reported by the monitors since AVI InfoFrame management is
missing from the U-Boot video model.

The port includes some changes in the dw-hdmi driver to support custom
PHY calls and support for the ColorSpace converter since the
Amlogic Meson GX video pipeline can only output un YUV444 mode, thus
activating the CSC is needed to output RGB for HDMI.

Video Support needs some tweaks in the DT like the u-boot,dm-pre-reloc for
the VPU node and a tweak to access the HHI registers from the DW-HDMI
glue driver. A port of a linux patch is also necessary to hook a regulator
to enable HDMI.

Finally, it enables console mux and console env for all Amlogic boards
and enabled Video Support for the Libre Computer AML-S905X-CC board.

Jorge Ramirez-Ortiz (2):
  video: dw_hdmi: support SoC specific read/write ops
  video: dw_hdmi: add support for color conversion

Maxime Jourdan (6):
  power: domain: meson-gx-pwrc-vpu: add missing depends
  arm64: dts: meson-gx: vpu should be probed before relocation
  arm64: dts: meson-gx: add hhi reg entry to hdmi_tx
  arm: meson: board-gx: Setup VPU in fdt
  arm: meson64: enable console mux and console env by default
  arm: libretech-cc: enable video by default

Neil Armstrong (3):
  video: Add Meson Video Processing Unit Driver
  arm64: dts: meson-gx: Add hdmi_5v regulator as hdmi tx supply
  configs: meson64: use vidconsole and usbkbd if enabled

 arch/arm/dts/meson-gx-u-boot.dtsi |   21 +
 arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi |7 +
 arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi  |7 +
 .../meson-gxl-s905x-khadas-vim-u-boot.dtsi|7 +
 arch/arm/dts/meson-gxl-s905x-khadas-vim.dts   |1 +
 .../meson-gxl-s905x-libretech-cc-u-boot.dtsi  |7 +
 arch/arm/dts/meson-gxl-s905x-libretech-cc.dts |1 +
 arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi |7 +
 arch/arm/dts/meson-gxl-s905x-p212.dts |1 +
 .../arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi |7 +
 arch/arm/dts/meson-gxm-khadas-vim2.dts|1 +
 arch/arm/include/asm/arch-meson/meson-vpu.h   |   13 +
 arch/arm/mach-meson/board-gx.c|5 +
 configs/khadas-vim2_defconfig |2 +
 configs/khadas-vim_defconfig  |2 +
 configs/libretech-cc_defconfig|8 +
 configs/odroid-c2_defconfig   |2 +
 configs/p212_defconfig|2 +
 drivers/power/domain/Kconfig  |2 +-
 drivers/video/Kconfig |2 +
 drivers/video/Makefile|1 +
 drivers/video/dw_hdmi.c   |  267 ++-
 drivers/video/meson/Kconfig   |   12 +
 drivers/video/meson/Makefile  |9 +
 drivers/video/meson/meson_canvas.c|   45 +
 drivers/video/meson/meson_dw_hdmi.c   |  445 +
 drivers/video/meson/meson_dw_hdmi.h   |  134 ++
 drivers/video/meson/meson_plane.c |  177 ++
 drivers/video/meson/meson_registers.h | 1393 
 drivers/video/meson/meson_vclk.c  |  893 ++
 drivers/video/meson/meson_venc.c  | 1464 +
 drivers/video/meson/meson_vpu.c   |  211 +++
 drivers/video/meson/meson_vpu.h   |   97 ++
 drivers/video/meson/meson_vpu_init.c  |  440 +
 drivers/video/meson/simplefb_common.c |   29 +
 drivers/video/meson/simplefb_common.h |   21 +
 include/configs/meson64.h |   23 +
 include/dw_hdmi.h |   74 +
 include/media_bus_format.h|  156 ++
 39 files changed, 5992 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/dts/meson-gx-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi
 create mode 100644 arch/arm/include/asm/arch-meson/meson-vpu.h
 create mode 100644 drivers/video/meson/Kconfig
 create mode 100644 drivers/video/meson/Makefile
 create mode 100644 drivers/video/meson/meson_canvas.c
 create mode 100644 drivers/video/meson/meson_dw_hdmi.c
 create mode 100644 drivers/video/meson/meson_dw_hdmi.h
 create mode 100644 drivers/video/meson/meson_plane.c
 create mode 100644 drivers/video/meson/meson_registers.h
 create mode 100644 drivers/video/meson/meson_vclk.c
 create mode 100644 drivers/video/meson/meson_venc.c
 create mode 100644 drivers/video/meson/meson_vpu.c
 create mode 100644 

Re: [U-Boot] [PATCH] common: Break USB_STORAGE dependency between SPL and u-boot proper

2019-01-15 Thread Tom Rini
On Tue, Jan 15, 2019 at 04:05:43PM +, Abel Vesa wrote:
> On 19-01-15 11:02:09, Tom Rini wrote:
> > On Tue, Jan 15, 2019 at 11:07:23AM +, Abel Vesa wrote:
> > 
> > > Some boards might need USB_STORAGE enabled in u-boot proper but not in 
> > > SPL.
> > > Make a separate config for SPL and keep the same depends on conditions 
> > > but for SPL.
> > > 
> > > Signed-off-by: Abel Vesa 
> > > ---
> > >  common/Makefile| 2 +-
> > >  configs/apalis_imx6_defconfig  | 1 +
> > >  configs/colibri_imx6_defconfig | 1 +
> > >  configs/mx6sabresd_defconfig   | 1 +
> > >  drivers/usb/Kconfig| 8 
> > >  5 files changed, 12 insertions(+), 1 deletion(-)
> > 
> > The root problem here, as I discovered today digging in another patch is
> > that in essence CONFIG_SPL_USB_SUPPORT is mis-named and should be
> > CONFIG_SPL_USB_STORAGE and all cases in Makefiles of
> 
> I think those too are two separete thing. You can have SPL_USB_SUPPORT 
> enabled,
> but the SPL_USB_STORAGE disabled. For example, for SDP support in SPL
> you need SPL_USB_SUPPORT, but you don't need the SPL_USB_STORAGE. So,
> IMO, they need to remain two separate things. 

No, you can't.  Or rather, the option names are a bit confusing.
CONFIG_SPL_USB_SUPPORT controls common/spl/spl_usb.c and that will not
function without CONFIG_USB_STORAGE support as it's specifically about
loading from a device.  It's also only set for some TI AM43xx platforms
as the ROM there supports booting from USB sticks and in turn we have
SPL doing so.  CONFIG_SPL_USB_HOST_SUPPORT is different and is set on
both AM43xx and various NXP platforms and is what you're after, without
the storage support side.

Aside, what is the USB host case on i.MX?  It's not acting in host mode
when being passed U-Boot via imx_usb, is it?

-- 
Tom


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


  1   2   >