Re: [U-Boot] [PATCH v1 07/14] pinctrl: imx: Replace static soc info definitions with run time allocations

2019-01-02 Thread Lukasz Majewski
Hi Marek,

> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
> > This commit is necessary to be able to re-use the pinctrl code in
> > early SPL to properly configure pins.
> > 
> > The problem is that those "static" structures are placed in the
> > SDRAM area, which corresponds to u-boot proper (not even SPL).
> > Hence, when one wants to configure pins before relocation via
> > DTS/DM, the board hangs (imx6q SoC powered one) as only OCRAM area
> > is available (0x009x).
> > 
> > It is also safe to use calloc in this case, as the early SPL code
> > provides it - either full or trimmed version. The allocated memory
> > is also correct in respect to the memory area in which the SoC is
> > currently running (OCRAM vs. SDRAM).  
> 
> You should be able to access static data in early environment, many
> other drivers have no problem with it. 

Have you used pinctrl IMX6Q driver with early DM at SPL?

> I believe there is some more
> fundamental problem that needs to be fixed, 

With the current code - which was not used in OCRAM only available
memory - the statics are placed in the SDRAM area (0x178x ).

Instead of changing linker script (and validate it for all drivers and
boards for SPL and u-boot proper) - the code has been rewritten to use
malloc (which is available in the early code - either full blown or
simple version).

> hacking around it like
> this is just hiding the real issue.

The real issue is that IMX6Q uses SDRAM memory for statics/globals from
the very beginning.

> 
> > Signed-off-by: Lukasz Majewski 
> > ---
> > 
> >  drivers/pinctrl/nxp/pinctrl-imx6.c | 39
> > +++--- 1 file changed, 19
> > insertions(+), 20 deletions(-)
> > 
> > diff --git a/drivers/pinctrl/nxp/pinctrl-imx6.c
> > b/drivers/pinctrl/nxp/pinctrl-imx6.c index d7c95bb738..876049b39b
> > 100644 --- a/drivers/pinctrl/nxp/pinctrl-imx6.c
> > +++ b/drivers/pinctrl/nxp/pinctrl-imx6.c
> > @@ -10,34 +10,33 @@
> >  
> >  #include "pinctrl-imx.h"
> >  
> > -static struct imx_pinctrl_soc_info imx6_pinctrl_soc_info;
> > -
> > -/* FIXME Before reloaction, BSS is overlapped with DT area */
> > -static struct imx_pinctrl_soc_info imx6ul_pinctrl_soc_info = {
> > -   .flags = ZERO_OFFSET_VALID,
> > -};
> > -
> > -static struct imx_pinctrl_soc_info imx6_snvs_pinctrl_soc_info = {
> > -   .flags = ZERO_OFFSET_VALID,
> > -};
> > -
> >  static int imx6_pinctrl_probe(struct udevice *dev)
> >  {
> > struct imx_pinctrl_soc_info *info =
> > -   (struct imx_pinctrl_soc_info
> > *)dev_get_driver_data(dev);
> > +   calloc(1, sizeof(struct imx_pinctrl_soc_info));
> > +
> > +   if (!info) {
> > +   printf("%s: Not enough memory!\n", __func__);
> > +   return -ENOMEM;
> > +   }
> > +
> > +   if (device_is_compatible(dev, "fsl,imx6sll-iomuxc-snvs") ||
> > +   device_is_compatible(dev, "fsl,imx6ull-iomuxc-snvs") ||
> > +   device_is_compatible(dev, "fsl,imx6ul-iomuxc"))
> > +   info->flags = ZERO_OFFSET_VALID;
> >  
> > return imx_pinctrl_probe(dev, info);
> >  }
> >  
> >  static const struct udevice_id imx6_pinctrl_match[] = {
> > -   { .compatible = "fsl,imx6q-iomuxc", .data =
> > (ulong)&imx6_pinctrl_soc_info },
> > -   { .compatible = "fsl,imx6dl-iomuxc", .data =
> > (ulong)&imx6_pinctrl_soc_info },
> > -   { .compatible = "fsl,imx6sl-iomuxc", .data =
> > (ulong)&imx6_pinctrl_soc_info },
> > -   { .compatible = "fsl,imx6sll-iomuxc-snvs", .data =
> > (ulong)&imx6_snvs_pinctrl_soc_info },
> > -   { .compatible = "fsl,imx6sll-iomuxc", .data =
> > (ulong)&imx6_pinctrl_soc_info },
> > -   { .compatible = "fsl,imx6sx-iomuxc", .data =
> > (ulong)&imx6_pinctrl_soc_info },
> > -   { .compatible = "fsl,imx6ul-iomuxc", .data =
> > (ulong)&imx6ul_pinctrl_soc_info },
> > -   { .compatible = "fsl,imx6ull-iomuxc-snvs", .data =
> > (ulong)&imx6_snvs_pinctrl_soc_info },
> > +   { .compatible = "fsl,imx6q-iomuxc" },
> > +   { .compatible = "fsl,imx6dl-iomuxc" },
> > +   { .compatible = "fsl,imx6sl-iomuxc" },
> > +   { .compatible = "fsl,imx6sll-iomuxc-snvs" },
> > +   { .compatible = "fsl,imx6sll-iomuxc" },
> > +   { .compatible = "fsl,imx6sx-iomuxc" },
> > +   { .compatible = "fsl,imx6ul-iomuxc" },
> > +   { .compatible = "fsl,imx6ull-iomuxc-snvs" },
> > { /* sentinel */ }
> >  };
> >  
> >   
> 
> 




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


pgpUiK79xve2w.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 v1 09/14] imx: serial: dm: Enable DM_FLAG_PRE_RELOC in the IMX uart driver

2019-01-02 Thread Lukasz Majewski
Hi Marek,

> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
> > The DM_FLAG_PRE_RELOC shall be enabled as this driver is going to be
> > re-used in the i.MX based SoCs.
> > 
> > It is crucial to have running the serial console before
> > relocation.  
> 
> But the patch doesn't do what the subject/commit message claims is
> does. If I understand it correctly, it sets the PRE_RELOC flag
> unconditionally.

The !CONFIG_IS_ENABLED(OF_CONTROL) [*] was set as a "workaround" for DM
problem:
SHA1: 4687919684e0e4390b9fc20d1809ecaa9dc3cb81

Let's look on this check [*] - we add this flag if the board doesn't
support OF_CONTROL. This is a bit strange as the serial_mxc.c can be
used with CONFIG_DM_SERIAL but without corresponding device tree
description (OF_CONTROL).

Other boards/SoCs have this flag set unconditionally.

And one more remark - with OF_CONTROL one needs to declare
'u-boot,dm-pre-reloc;' property in DTS to have the device probed in the
SPL's pre relocation stage.

> 
> > Signed-off-by: Lukasz Majewski 
> > ---
> > 
> >  drivers/serial/serial_mxc.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/drivers/serial/serial_mxc.c
> > b/drivers/serial/serial_mxc.c index 7e4e6d36b8..e586c18cf0 100644
> > --- a/drivers/serial/serial_mxc.c
> > +++ b/drivers/serial/serial_mxc.c
> > @@ -354,9 +354,7 @@ U_BOOT_DRIVER(serial_mxc) = {
> >  #endif
> > .probe = mxc_serial_probe,
> > .ops= &mxc_serial_ops,
> > -#if !CONFIG_IS_ENABLED(OF_CONTROL)
> > .flags = DM_FLAG_PRE_RELOC,
> > -#endif
> >  };
> >  #endif
> >  
> >   
> 
> 




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


pgp3pLcZRutc4.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 v1 11/14] DM: net: imx: Provide weak function to initialize fec clocks

2019-01-02 Thread Lukasz Majewski
Hi Marek,

> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
> > This patch is necessary to initialize some board/soc specific
> > clocks - like anatop, which is used to clock PHY and FEC block
> > itself.
> > 
> > The initialization is performed with device tree by introducing two
> > new properties - namely;
> > 'fsl,enet-loopback-clk' and 'fsl,enet-freq' which specify the need
> > to select proper enet clock and the clock value itself.
> > 
> > Previously this setup was done in the board_etc_init() function,
> > which has been removed after switching to DM/DTS.
> > 
> > Signed-off-by: Lukasz Majewski 
> > ---
> > 
> >  drivers/net/fec_mxc.c | 25 +
> >  drivers/net/fec_mxc.h |  2 ++
> >  2 files changed, 27 insertions(+)
> > 
> > diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> > index 99c5c649a0..728d6c9456 100644
> > --- a/drivers/net/fec_mxc.c
> > +++ b/drivers/net/fec_mxc.c
> > @@ -1297,6 +1297,23 @@ static void fec_gpio_reset(struct fec_priv
> > *priv) }
> >  }
> >  #endif
> > +/*
> > + * This function is mostly intended for some soc/board specific
> > + * clock initialization (like anatop clock on iMX6) done
> > + * previously in board_eth_init()
> > + */
> > +__weak int set_fec_clock(int fec_id, enum enet_freq freq);
> > +
> > +static int fec_clk_init(struct udevice *dev)
> > +{
> > +   struct fec_priv *priv = dev_get_priv(dev);
> > +   int ret = 0;
> > +
> > +   if (priv->enet_loopback_clk)
> > +   ret = set_fec_clock(dev->seq, priv->freq);
> > +
> > +   return ret;
> > +}
> >  
> >  static int fecmxc_probe(struct udevice *dev)
> >  {
> > @@ -1321,6 +1338,10 @@ static int fecmxc_probe(struct udevice *dev)
> > priv->clk_rate = clk_get_rate(&priv->ipg_clk);
> > }
> >  
> > +   ret = fec_clk_init(dev);
> > +   if (ret)
> > +   return ret;
> > +
> > ret = fec_alloc_descs(priv);
> > if (ret)
> > return ret;
> > @@ -1455,6 +1476,10 @@ static int fecmxc_ofdata_to_platdata(struct
> > udevice *dev) }
> >  #endif
> >  
> > +   priv->enet_loopback_clk = dev_read_bool(dev,
> > "fsl,enet-loopback-clk");
> > +   if (priv->enet_loopback_clk)
> > +   dev_read_u32(dev, "fsl,enet-freq", &priv->freq);  
> 
> dev_read_u32() returns error value, so what happens if this fails ?

Good point - I will add the necessary check.

> 
> > +
> > return 0;
> >  }
> >  
> > diff --git a/drivers/net/fec_mxc.h b/drivers/net/fec_mxc.h
> > index e9a661f0a1..666b34304c 100644
> > --- a/drivers/net/fec_mxc.h
> > +++ b/drivers/net/fec_mxc.h
> > @@ -261,6 +261,8 @@ struct fec_priv {
> >  #endif
> >  #ifdef CONFIG_DM_ETH
> > u32 interface;
> > +   bool enet_loopback_clk; /* anatop reference clk via PAD
> > loopback */
> > +   enum enet_freq freq;
> >  #endif
> > struct clk ipg_clk;
> > u32 clk_rate;
> >   
> 
> 




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


pgpkJGX7z1TVr.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 v1 13/14] DTS: imx: tpc70: Add TPC70 board (imx6q based) device tree description

2019-01-02 Thread Lukasz Majewski
Hi Marek,

> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
> > This commit defines the TPC70 imx6q board with device tree
> > description.
> > 
> > Signed-off-by: Lukasz Majewski   
> 
> Is this pulled from Linux ?

Yes, it is - the DTS code corresponds to v4.20

> 




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


pgp_9qKHtiTKx.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 6/6] ARM: socfpga: Synchronize the configuration for A10 SoCDK

2019-01-02 Thread Chee, Tien Fong
On Tue, 2019-01-01 at 21:35 +0100, Marek Vasut wrote:
> On 1/1/19 4:51 AM, Chee, Tien Fong wrote:
> > 
> > On Sun, 2018-12-30 at 16:54 +0100, Marek Vasut wrote:
> > > 
> > > On 12/30/18 9:13 AM, tien.fong.c...@intel.com wrote:
> > > > 
> > > > 
> > > > From: Marek Vasut 
> > > > 
> > > > Update the default configuration file to enable the necessary
> > > > functionality
> > > > the get the kit working. That includes SPL SD/MMC support, USB,
> > > > and
> > > > I2C.
> > > > 
> > > > Signed-off-by: Marek Vasut 
> > > > Signed-off-by: Tien Fong Chee 
> > > Is this patch needed ? Why ? This enables a whole lot of stuff
> > > 
> > These settings are mostly syn up from gen5 and our own downstream
> > A10.
> > These settings are mostly required to boot U-Boot and supporting
> > A10
> > golden system reference design.
> Hmmm, mind you, all the MTD and SPI stuff is not needed for the SDMMC
> configuration of the kit, which this patch would imply is the target.
> You want to split this into smaller config changes which enable
> logical
> blocks, not everything at once, and document why is each thing
> needed.
I can keep them minimal, enable them when required in separate patch.
> 
> > 
> > > 
> > > > 
> > > > 
> > > > ---
> > > >  configs/socfpga_arria10_defconfig |   38
> > > > +++-
> > > >  1 files changed, 32 insertions(+), 6 deletions(-)
> > > > 
> > > > diff --git a/configs/socfpga_arria10_defconfig
> > > > b/configs/socfpga_arria10_defconfig
> > > > index 8158dbb..4b93321 100644
> > > > --- a/configs/socfpga_arria10_defconfig
> > > > +++ b/configs/socfpga_arria10_defconfig
> > > > @@ -1,7 +1,7 @@
> > > >  CONFIG_ARM=y
> > > >  CONFIG_ARCH_SOCFPGA=y
> > > >  CONFIG_SYS_TEXT_BASE=0x0140
> > > > -CONFIG_SYS_MALLOC_F_LEN=0x2000
> > > > +CONFIG_SYS_MALLOC_F_LEN=0x8000
> Why is this increase in malloc area needed ?
This is set in the arria10_sdmmc_next, i guess you need this value for
your use case? I can revert it if it is no longer required.
> 
> > 
> > > 
> > > > 
> > > >  CONFIG_TARGET_SOCFPGA_ARRIA10_SOCDK=y
> > > >  CONFIG_SPL=y
> > > >  CONFIG_IDENT_STRING="socfpga_arria10"
> > > > @@ -10,26 +10,35 @@ CONFIG_NR_DRAM_BANKS=1
> > > >  CONFIG_USE_BOOTARGS=y
> > > >  CONFIG_BOOTARGS="console=ttyS0,115200"
> > > >  # CONFIG_USE_BOOTCOMMAND is not set
> > > > +CONFIG_SYS_CONSOLE_IS_IN_ENV=y
> > > > +CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
> > > > +CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y
> > > >  CONFIG_DEFAULT_FDT_FILE="socfpga_arria10_socdk_sdmmc.dtb"
> > > > +CONFIG_VERSION_VARIABLE=y
> > > >  CONFIG_DISPLAY_BOARDINFO_LATE=y
> > > > +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x800
> > > >  CONFIG_SPL_FPGA_SUPPORT=y
> > > > -CONFIG_SPL_SPI_LOAD=y
> > > >  CONFIG_CMD_ASKENV=y
> > > >  CONFIG_CMD_GREPENV=y
> > > > +CONFIG_CMD_DFU=y
> > > >  # CONFIG_CMD_FLASH is not set
> > > >  CONFIG_CMD_GPIO=y
> > > > +CONFIG_CMD_I2C=y
> > > >  CONFIG_CMD_MMC=y
> > > > +CONFIG_CMD_SF=y
> > > > +CONFIG_CMD_SPI=y
> > > > +CONFIG_CMD_USB=y
> > > > +CONFIG_CMD_USB_MASS_STORAGE=y
> > > >  CONFIG_CMD_CACHE=y
> > > >  CONFIG_CMD_EXT4_WRITE=y
> > > >  CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
> > > > -# CONFIG_SPL_DOS_PARTITION is not set
> > > > -# CONFIG_ISO_PARTITION is not set
> > > > -# CONFIG_EFI_PARTITION is not set
> > > > +CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dmas
> > > > dma-
> > > > names"
> > > >  CONFIG_DEFAULT_DEVICE_TREE="socfpga_arria10_socdk_sdmmc"
> > > >  CONFIG_ENV_IS_IN_MMC=y
> > > >  CONFIG_SPL_ENV_SUPPORT=y
> > > >  CONFIG_SPL_DM=y
> > > >  CONFIG_SPL_DM_SEQ_ALIAS=y
> > > > +CONFIG_DFU_MMC=y
> > > >  CONFIG_SPL_DM_MMC=y
> > > >  CONFIG_SPL_MMC_SUPPORT=y
> > > >  CONFIG_SPL_EXT_SUPPORT=y
> > > > @@ -40,13 +49,30 @@ CONFIG_FS_LOADER=y
> > > >  CONFIG_FPGA_SOCFPGA=y
> > > >  CONFIG_DM_GPIO=y
> > > >  CONFIG_DWAPB_GPIO=y
> > > > +CONFIG_SYS_I2C_DW=y
> > > >  CONFIG_DM_MMC=y
> > > >  CONFIG_MTD_DEVICE=y
> > > > +CONFIG_MTD_PARTITIONS=y
> > > > +CONFIG_MMC_DW=y
> > > > +CONFIG_SPI_FLASH=y
> > > > +CONFIG_SPI_FLASH_BAR=y
> > > > +CONFIG_SPI_FLASH_SPANSION=y
> > > > +CONFIG_SPI_FLASH_STMICRO=y
> > > > +CONFIG_PHY_MICREL=y
> > > > +CONFIG_PHY_MICREL_KSZ90X1=y
> > > >  CONFIG_DM_ETH=y
> > > >  CONFIG_ETH_DESIGNWARE=y
> > > >  CONFIG_MII=y
> > > > +CONFIG_SYS_NS16550=y
> > > >  CONFIG_SPI=y
> > > >  CONFIG_TIMER=y
> > > >  CONFIG_SPL_TIMER=y
> > > >  CONFIG_DESIGNWARE_APB_TIMER=y
> > > > -CONFIG_USE_TINY_PRINTF=y
> > > > +CONFIG_DESIGNWARE_SPI=y
> > > > +CONFIG_USB=y
> > > > +CONFIG_DM_USB=y
> > > > +CONFIG_USB_DWC2=y
> > > > +CONFIG_USB_STORAGE=y
> > > > +CONFIG_USB_GADGET=y
> > > > +CONFIG_USB_GADGET_DWC2_OTG=y
> > > > +CONFIG_USB_GADGET_DOWNLOAD=y
> USB and DFU could be enabled separately.
Okay.
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v1 10/14] imx: clock: Introduce set_fec_clock() to configure ETH clock (imx6)

2019-01-02 Thread Lukasz Majewski
Hi Marek,

> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
> > This patch provides a generic way to setup ENET (ETH) clocks for
> > imx6(q) based boards. Previously this was performed per board in the
> > board_eth_init() function.
> > 
> > Signed-off-by: Lukasz Majewski 
> > ---
> > 
> >  arch/arm/include/asm/arch-mx6/clock.h |  1 +
> >  arch/arm/mach-imx/mx6/clock.c | 17 +
> >  2 files changed, 18 insertions(+)
> > 
> > diff --git a/arch/arm/include/asm/arch-mx6/clock.h
> > b/arch/arm/include/asm/arch-mx6/clock.h index
> > a9481a5fea..9a217349f5 100644 ---
> > a/arch/arm/include/asm/arch-mx6/clock.h +++
> > b/arch/arm/include/asm/arch-mx6/clock.h @@ -72,6 +72,7 @@ int
> > enable_i2c_clk(unsigned char enable, unsigned i2c_num); int
> > enable_spi_clk(unsigned char enable, unsigned spi_num); void
> > enable_ipu_clock(void); int enable_fec_anatop_clock(int fec_id,
> > enum enet_freq freq); +int set_fec_clock(int fec_id, enum enet_freq
> > freq); void enable_enet_clk(unsigned char enable);
> >  int enable_lcdif_clock(u32 base_addr, bool enable);
> >  void enable_qspi_clk(int qspi_num);
> > diff --git a/arch/arm/mach-imx/mx6/clock.c
> > b/arch/arm/mach-imx/mx6/clock.c index 366a4e3c6b..8a4fb23090 100644
> > --- a/arch/arm/mach-imx/mx6/clock.c
> > +++ b/arch/arm/mach-imx/mx6/clock.c
> > @@ -902,6 +902,17 @@ void enable_qspi_clk(int qspi_num)
> >  #endif
> >  
> >  #ifdef CONFIG_FEC_MXC
> > +static void select_fec_clock_source(int fec_id)  
> 
> How is the fec_id() used in here ?

I guess that you refer to "int fec_id."

> Shouldn't this be part of
> enable_fec_anatop_clock() ?

The enable_fec_anatop_clock() function is used on several board files
- for example:
http://git.denx.de/?p=u-boot.git;a=blob;f=board/dhelectronics/dh_imx6/dh_imx6.c;h=f9ac5c10e1dc954b64605a1c4f84a6c819d183a7;hb=HEAD#l154

And changing it could break some boards.

The select_fec_clock_source() shall be used to replace several:
clrsetbits_le32(&iomuxc_regs->gpr[1], 0x1 << 21, 0x1 << 21);

clauses for imx6 variants.

Moreover, I'd pass 'fec_id' parameter anyway - it may be needed by other
imx6 variants.

> 
> > +{
> > +   struct iomuxc *iomuxc_regs = (struct iomuxc
> > *)IOMUXC_BASE_ADDR; +
> > +   if (is_mx6dq()) {
> > +   /* set gpr1[21] to select anatop clock */
> > +   setbits_le32(&iomuxc_regs->gpr[1],
> > +IOMUXC_GPR1_ENET_CLK_SEL_MASK);
> > +   }
> > +}
> > +
> >  int enable_fec_anatop_clock(int fec_id, enum enet_freq freq)
> >  {
> > u32 reg = 0;
> > @@ -976,6 +987,12 @@ int enable_fec_anatop_clock(int fec_id, enum
> > enet_freq freq) #endif
> > return 0;
> >  }
> > +
> > +int set_fec_clock(int fec_id, enum enet_freq freq)
> > +{
> > +   select_fec_clock_source(fec_id);
> > +   return enable_fec_anatop_clock(fec_id, freq);
> > +}
> >  #endif
> >  
> >  static u32 get_usdhc_clk(u32 port)
> >   
> 
> 




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


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


[U-Boot] [PATCH v3 0/6] mips: mscc: gpio: Add MSCC serial GPIO driver

2019-01-02 Thread Lars Povlsen
This patch series add the GPIO device (SIO) in the MSCC VCoreIII-based
SOCs, and enables it on the supported platforms.

By using a serial interface, the SIO controller significantly extends
the number of available GPIOs with a minimum number of additional pins
on the device. The primary purpose of the SIO controller is to connect
control signals from SFP modules and to act as an LED controller.

This version address comments from Daniel Schwierzeck
 and Linus Walleij
.

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

v3 changes:
 - Fail driver load if clk_get_rate() fails
 - Use dev_remap_addr() instead of map_physmem()
 - Use dev_err instead of printf
 - (DT doc) ngpios: Refer to gpio.txt

v2 changes:
 - Extended the DT bindings documentation
 - Eliminated the need for the "mscc,sgpio-bitcount" property.
 - Using dev_read_u32_default() instead of fdtdec_get_int()
 - Using map_physmem()
 - Added MAINTAINERS entry for driver

Lars Povlsen (6):
  mips: mscc_sgpio: Add the MSCC serial GPIO device (SIO)
  mips: mscc_sgpio: Add DT bindings documentation
  mips: luton: DT: Enable use of serial gpio
  mips: luton: Enable use of serial gpio for LED
  mips: ocelot: DT: Enable use of serial gpio
  mips: ocelot: Enable use of serial gpio for LED

 MAINTAINERS  |   1 +
 arch/mips/dts/luton_pcb090.dts   |  21 ++
 arch/mips/dts/luton_pcb091.dts   |  27 ++
 arch/mips/dts/mscc,luton.dtsi|  20 ++
 arch/mips/dts/mscc,ocelot.dtsi   |  23 ++
 arch/mips/dts/ocelot_pcb120.dts  |  76 +
 arch/mips/dts/ocelot_pcb123.dts  |  25 ++
 board/mscc/luton/luton.c |   6 +
 board/mscc/ocelot/ocelot.c   |   6 +
 configs/mscc_luton_defconfig |   3 +
 configs/mscc_ocelot_defconfig|   3 +
 doc/device-tree-bindings/gpio/mscc_sgpio.txt |  45 +++
 drivers/gpio/Kconfig |  11 +
 drivers/gpio/Makefile|   1 +
 drivers/gpio/mscc_sgpio.c| 275 +++
 15 files changed, 543 insertions(+)
 create mode 100644 doc/device-tree-bindings/gpio/mscc_sgpio.txt
 create mode 100644 drivers/gpio/mscc_sgpio.c

-- 
2.19.2

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


Re: [U-Boot] [PATCH v1 08/14] DTS: imx: Add "u-boot, dm-pre-reloc" property to relevant imx6qdl nodes

2019-01-02 Thread Lukasz Majewski
Hi Marek,

> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
> > This patch is a preparation for the imx6q to use DTS in the SPL for
> > very early configuration, as 'u-boot,dm-pre-reloc;' is necessary to
> > initialize uart and SD/eMMC controllers in SPL.
> > 
> > Signed-off-by: Lukasz Majewski   
> 
> Should be in U-Boot specific DTSI to allow easy resync of DTSIs with
> Linux.

Good point. I will do this in a way similar to
arch/arm/dts/unipher-v7-u-boot.dtsi

> 
> > ---
> > 
> >  arch/arm/dts/imx6qdl.dtsi | 5 +
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/arch/arm/dts/imx6qdl.dtsi b/arch/arm/dts/imx6qdl.dtsi
> > index 476cf93445..61cb59cc94 100644
> > --- a/arch/arm/dts/imx6qdl.dtsi
> > +++ b/arch/arm/dts/imx6qdl.dtsi
> > @@ -72,6 +72,7 @@
> > #address-cells = <1>;
> > #size-cells = <1>;
> > compatible = "simple-bus";
> > +   u-boot,dm-pre-reloc;
> > interrupt-parent = <&gpc>;
> > ranges;
> >  
> > @@ -218,6 +219,7 @@
> >  
> > aips-bus@0200 { /* AIPS1 */
> > compatible = "fsl,aips-bus", "simple-bus";
> > +   u-boot,dm-pre-reloc;
> > #address-cells = <1>;
> > #size-cells = <1>;
> > reg = <0x0200 0x10>;
> > @@ -225,6 +227,7 @@
> >  
> > spba-bus@0200 {
> > compatible = "fsl,spba-bus",
> > "simple-bus";
> > +   u-boot,dm-pre-reloc;
> > #address-cells = <1>;
> > #size-cells = <1>;
> > reg = <0x0200 0x4>;
> > @@ -801,6 +804,7 @@
> >  
> > iomuxc: iomuxc@020e {
> > compatible = "fsl,imx6dl-iomuxc",
> > "fsl,imx6q-iomuxc";
> > +   u-boot,dm-pre-reloc;
> > reg = <0x020e 0x4000>;
> > };
> >  
> > @@ -882,6 +886,7 @@
> >  
> > aips-bus@0210 { /* AIPS2 */
> > compatible = "fsl,aips-bus", "simple-bus";
> > +   u-boot,dm-pre-reloc;
> > #address-cells = <1>;
> > #size-cells = <1>;
> > reg = <0x0210 0x10>;
> >   
> 
> 




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


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


[U-Boot] [PATCH v3 1/6] mips: mscc_sgpio: Add the MSCC serial GPIO device (SIO)

2019-01-02 Thread Lars Povlsen
This add support for the the MSCC serial GPIO driver in MSCC
VCoreIII-based SOCs.

By using a serial interface, the SIO controller significantly extends
the number of available GPIOs with a minimum number of additional pins
on the device. The primary purpose of the SIO controller is to connect
control signals from SFP modules and to act as an LED controller.

This adds the base driver.

Signed-off-by: Lars Povlsen 
---
 MAINTAINERS   |   1 +
 drivers/gpio/Kconfig  |  11 ++
 drivers/gpio/Makefile |   1 +
 drivers/gpio/mscc_sgpio.c | 275 ++
 4 files changed, 288 insertions(+)
 create mode 100644 drivers/gpio/mscc_sgpio.c

diff --git a/MAINTAINERS b/MAINTAINERS
index ae825014bd..494962e9b3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -523,6 +523,7 @@ F:  arch/mips/dts/mscc*
 F: arch/mips/dts/ocelot*
 F: board/mscc/
 F: configs/mscc*
+F: drivers/gpio/mscc_sgpio.c
 F: include/configs/vcoreiii.h
 
 MIPS JZ4780
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index c8c6c60623..aa55ff43c4 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -106,6 +106,17 @@ config MSCC_BITBANG_SPI_GPIO
  Support controlling the GPIO used for SPI bitbang by software. Can
  be used by the VCoreIII SoCs, but it was mainly useful for Luton.
 
+config MSCC_SGPIO
+   bool "Microsemi Serial GPIO driver"
+   depends on DM_GPIO && SOC_VCOREIII
+   help
+ Support for the VCoreIII SoC serial GPIO device. By using a
+  serial interface, the SIO controller significantly extends
+  the number of available GPIOs with a minimum number of
+  additional pins on the device. The primary purpose of the
+  SIO controller is to connect control signals from SFP
+  modules and to act as an LED controller.
+
 config MSM_GPIO
bool "Qualcomm GPIO driver"
depends on DM_GPIO
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 61feda1537..be2b3c792f 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -60,3 +60,4 @@ obj-$(CONFIG_$(SPL_)PCF8575_GPIO) += pcf8575_gpio.o
 obj-$(CONFIG_PM8916_GPIO)  += pm8916_gpio.o
 obj-$(CONFIG_MT7621_GPIO)  += mt7621_gpio.o
 obj-$(CONFIG_MSCC_BITBANG_SPI_GPIO)+= gpio-mscc-bitbang-spi.o
+obj-$(CONFIG_MSCC_SGPIO)   += mscc_sgpio.o
diff --git a/drivers/gpio/mscc_sgpio.c b/drivers/gpio/mscc_sgpio.c
new file mode 100644
index 00..c899454ec4
--- /dev/null
+++ b/drivers/gpio/mscc_sgpio.c
@@ -0,0 +1,275 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Microsemi SoCs serial gpio driver
+ *
+ * Author: 
+ *
+ * Copyright (c) 2018 Microsemi Corporation
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define MSCC_SGPIOS_PER_BANK   32
+#define MSCC_SGPIO_BANK_DEPTH  4
+
+enum {
+   REG_INPUT_DATA,
+   REG_PORT_CONFIG,
+   REG_PORT_ENABLE,
+   REG_SIO_CONFIG,
+   REG_SIO_CLOCK,
+   MAXREG
+};
+
+struct mscc_sgpio_bf {
+   u8 beg;
+   u8 end;
+};
+
+struct mscc_sgpio_props {
+   u8 regoff[MAXREG];
+   struct mscc_sgpio_bf auto_repeat;
+   struct mscc_sgpio_bf port_width;
+   struct mscc_sgpio_bf clk_freq;
+   struct mscc_sgpio_bf bit_source;
+};
+
+#define __M(bf)GENMASK((bf).end, (bf).beg)
+#define __F(bf, x) (__M(bf) & ((x) << (bf).beg))
+#define __X(bf, x) (((x) >> (bf).beg) & GENMASK(((bf).end - (bf).beg), 0))
+
+#define MSCC_M_CFG_SIO_AUTO_REPEAT(p)  BIT(p->props->auto_repeat.beg)
+#define MSCC_F_CFG_SIO_PORT_WIDTH(p, x)
__F(p->props->port_width, x)
+#define MSCC_M_CFG_SIO_PORT_WIDTH(p)   __M(p->props->port_width)
+#define MSCC_F_CLOCK_SIO_CLK_FREQ(p, x)__F(p->props->clk_freq, 
x)
+#define MSCC_M_CLOCK_SIO_CLK_FREQ(p)   __M(p->props->clk_freq)
+#define MSCC_F_PORT_CFG_BIT_SOURCE(p, x)   __F(p->props->bit_source, x)
+#define MSCC_X_PORT_CFG_BIT_SOURCE(p, x)   __X(p->props->bit_source, x)
+
+const struct mscc_sgpio_props props_luton = {
+   .regoff = { 0x00, 0x09, 0x29, 0x2a, 0x2b },
+   .auto_repeat = { 5, 5 },
+   .port_width  = { 2, 3 },
+   .clk_freq= { 0, 11 },
+   .bit_source  = { 0, 11 },
+};
+
+const struct mscc_sgpio_props props_ocelot = {
+   .regoff = { 0x00, 0x06, 0x26, 0x04, 0x05 },
+   .auto_repeat = { 10, 10 },
+   .port_width  = {  7, 8  },
+   .clk_freq= {  8, 19 },
+   .bit_source  = { 12, 23 },
+};
+
+struct mscc_sgpio_priv {
+   u32 bitcount;
+   u32 ports;
+   u32 clock;
+   u32 mode[MSCC_SGPIOS_PER_BANK];
+   u32 __iomem *regs;
+   const struct mscc_sgpio_props *props;
+};
+
+static inline u32 sgpio_readl(struct mscc_sgpio_priv *priv, u32 rno, u32 off)
+{
+   u32 __iomem *reg = &priv->regs[priv->props->regoff[rno] + off];
+
+   return readl(reg);
+}
+
+static inline void sgpio_writel(struct mscc_sgpio_priv *priv,
+

[U-Boot] [PATCH v3 2/6] mips: mscc_sgpio: Add DT bindings documentation

2019-01-02 Thread Lars Povlsen
From: Lars Povlsen 

This add device tree binding documentation for the MSCC serial GPIO
driver.

Signed-off-by: Lars Povlsen 
Acked-by: Linus Walleij 
---
 doc/device-tree-bindings/gpio/mscc_sgpio.txt | 45 
 1 file changed, 45 insertions(+)
 create mode 100644 doc/device-tree-bindings/gpio/mscc_sgpio.txt

diff --git a/doc/device-tree-bindings/gpio/mscc_sgpio.txt 
b/doc/device-tree-bindings/gpio/mscc_sgpio.txt
new file mode 100644
index 00..3d344d64ac
--- /dev/null
+++ b/doc/device-tree-bindings/gpio/mscc_sgpio.txt
@@ -0,0 +1,45 @@
+Microsemi Corporation (MSCC) Serial GPIO driver
+
+The MSCC serial GPIO extends the number or GPIO's on the system by
+means of 4 dedicated pins: one input, one output, one clock and one
+strobe pin. By attaching a number of (external) shift registers, the
+effective GPIO count can be extended by up to 128 GPIO's per
+controller.
+
+Required properties:
+- compatible : "mscc,luton-sgpio" or "mscc,ocelot-sgpio"
+- clock: Reference clock used to generate clock divider setting. See
+  mscc,sgpio-frequency property.
+- reg : Physical base address and length of the controller's registers.
+- #gpio-cells : Should be two. The first cell is the pin number and the
+  second cell is used to specify optional parameters:
+  - bit 0 specifies polarity (0 for normal, 1 for inverted)
+- gpio-controller : Marks the device node as a GPIO controller.
+- gpio-ranges: Standard gpio range(s): phandle, gpio base, pinctrl base
+  and count.
+
+Optional properties:
+- ngpios: See gpio.txt
+- mscc,sgpio-frequency: The frequency at which the serial bitstream is
+  generated and sampled. Default: 1250 (Hz).
+- mscc,sgpio-ports: A bitmask (32 bits) of which ports are enabled in
+  the serialized gpio stream. One 'port' will transport from 1 to 4
+  gpio bits. Default: 0x.
+
+Typically the pinctrl-0 and pinctrl-names properties will also be
+present to enable the use of the SIO CLK, LD, DI and DO for some
+regular GPIO pins.
+
+Example:
+
+sgpio: gpio@10700f8 {
+   compatible = "mscc,ocelot-sgpio";
+   pinctrl-0 = <&sgpio_pins>;
+   pinctrl-names = "default";
+   reg = <0x10700f8 0x100>;
+   gpio-controller;
+   #gpio-cells = <2>;
+   gpio-ranges = <&sgpio 0 0 64>;
+   mscc,sgpio-frequency = <12500>;
+   mscc,sgpio-ports = <0x000F>;
+};
-- 
2.19.2

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


[U-Boot] [PATCH v3 4/6] mips: luton: Enable use of serial gpio for LED

2019-01-02 Thread Lars Povlsen
This enables the use of the MSCC serial GPIO driver to control the
LEDs on the MSCC VCoreIII 'luton' SoC.

Signed-off-by: Lars Povlsen 
---
 board/mscc/luton/luton.c | 6 ++
 configs/mscc_luton_defconfig | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/board/mscc/luton/luton.c b/board/mscc/luton/luton.c
index b509b6beb3..807c717e33 100644
--- a/board/mscc/luton/luton.c
+++ b/board/mscc/luton/luton.c
@@ -5,6 +5,7 @@
 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -27,6 +28,11 @@ int board_early_init_r(void)
 
/* Address of boot parameters */
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE;
+
+   /* LED setup */
+   if (IS_ENABLED(CONFIG_LED))
+   led_default_state();
+
return 0;
 }
 
diff --git a/configs/mscc_luton_defconfig b/configs/mscc_luton_defconfig
index 03922f5379..0b3eb3865c 100644
--- a/configs/mscc_luton_defconfig
+++ b/configs/mscc_luton_defconfig
@@ -46,6 +46,9 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_CLK=y
 CONFIG_DM_GPIO=y
+CONFIG_MSCC_SGPIO=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
-- 
2.19.2

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


[U-Boot] [PATCH v3 6/6] mips: ocelot: Enable use of serial gpio for LED

2019-01-02 Thread Lars Povlsen
This enables the use of the MSCC serial GPIO driver to control the
LEDs on the MSCC VCoreIII 'ocelot' pcb123 and pcb120.

Signed-off-by: Lars Povlsen 
---
 board/mscc/ocelot/ocelot.c| 6 ++
 configs/mscc_ocelot_defconfig | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/board/mscc/ocelot/ocelot.c b/board/mscc/ocelot/ocelot.c
index a557cacd1b..a05c308669 100644
--- a/board/mscc/ocelot/ocelot.c
+++ b/board/mscc/ocelot/ocelot.c
@@ -9,6 +9,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -56,6 +57,11 @@ int board_early_init_r(void)
 
/* Address of boot parameters */
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE;
+
+   /* LED setup */
+   if (IS_ENABLED(CONFIG_LED))
+   led_default_state();
+
return 0;
 }
 
diff --git a/configs/mscc_ocelot_defconfig b/configs/mscc_ocelot_defconfig
index 66451000d9..fb6a5bdc31 100644
--- a/configs/mscc_ocelot_defconfig
+++ b/configs/mscc_ocelot_defconfig
@@ -48,6 +48,9 @@ CONFIG_CLK=y
 CONFIG_DM_GPIO=y
 CONFIG_MTD=y
 CONFIG_MTD_SPI_NAND=y
+CONFIG_MSCC_SGPIO=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
-- 
2.19.2

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


[U-Boot] [PATCH v3 3/6] mips: luton: DT: Enable use of serial gpio

2019-01-02 Thread Lars Povlsen
From: Lars Povlsen 

This enables the use of the MSCC serial GPIO driver, and add gpio-leds
nodes to the 'luton' pcb090 and pcb091 DT.

Signed-off-by: Lars Povlsen 
---
 arch/mips/dts/luton_pcb090.dts | 21 +
 arch/mips/dts/luton_pcb091.dts | 27 +++
 arch/mips/dts/mscc,luton.dtsi  | 20 
 3 files changed, 68 insertions(+)

diff --git a/arch/mips/dts/luton_pcb090.dts b/arch/mips/dts/luton_pcb090.dts
index a3f8926ad9..951d8da1be 100644
--- a/arch/mips/dts/luton_pcb090.dts
+++ b/arch/mips/dts/luton_pcb090.dts
@@ -18,6 +18,27 @@
chosen {
stdout-path = "serial0:115200n8";
};
+
+   gpio-leds {
+   compatible = "gpio-leds";
+
+   status_green {
+   label = "pcb090:green:status";
+   gpios = <&sgpio 64 GPIO_ACTIVE_HIGH>; /* p0.2 */
+   default-state = "on";
+   };
+
+   status_red {
+   label = "pcb090:red:status";
+   gpios = <&sgpio 65 GPIO_ACTIVE_HIGH>; /* p1.2 */
+   default-state = "off";
+   };
+   };
+};
+
+&sgpio {
+   status = "okay";
+   gpio-ranges = <&sgpio 0 0 96>;
 };
 
 &uart0 {
diff --git a/arch/mips/dts/luton_pcb091.dts b/arch/mips/dts/luton_pcb091.dts
index 74f9274c21..bf638b2bc7 100644
--- a/arch/mips/dts/luton_pcb091.dts
+++ b/arch/mips/dts/luton_pcb091.dts
@@ -18,6 +18,33 @@
chosen {
stdout-path = "serial0:115200n8";
};
+
+   gpio-leds {
+   compatible = "gpio-leds";
+
+   top_dimmer {
+   label = "pcb091:top:dimmer";
+   gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
+   default-state = "on";
+   };
+
+   status_green {
+   label = "pcb091:green:status";
+   gpios = <&sgpio 26 GPIO_ACTIVE_HIGH>; /* p26.0 */
+   default-state = "on";
+   };
+
+   status_red {
+   label = "pcb091:red:status";
+   gpios = <&sgpio 58 GPIO_ACTIVE_HIGH>; /* p26.1 */
+   default-state = "off";
+   };
+   };
+};
+
+&sgpio {
+   status = "okay";
+   mscc,sgpio-ports = <0xFFF000FF>;
 };
 
 &uart0 {
diff --git a/arch/mips/dts/mscc,luton.dtsi b/arch/mips/dts/mscc,luton.dtsi
index 6a4ad2a5be..87e27c6de5 100644
--- a/arch/mips/dts/mscc,luton.dtsi
+++ b/arch/mips/dts/mscc,luton.dtsi
@@ -25,6 +25,11 @@
serial0 = &uart0;
};
 
+   sys_clk: sys-clk {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <25000>;
+   };
ahb_clk: ahb-clk {
compatible = "fixed-clock";
#clock-cells = <0>;
@@ -57,11 +62,26 @@
#gpio-cells = <2>;
gpio-ranges = <&gpio 0 0 32>;
 
+   sgpio_pins: sgpio-pins {
+   pins = "GPIO_0", "GPIO_1", "GPIO_2", "GPIO_3";
+   function = "sio";
+   };
uart_pins: uart-pins {
pins = "GPIO_30", "GPIO_31";
function = "uart";
};
+   };
 
+   sgpio: gpio@70130 {
+   compatible = "mscc,luton-sgpio";
+   status = "disabled";
+   clocks = <&sys_clk>;
+   pinctrl-0 = <&sgpio_pins>;
+   pinctrl-names = "default";
+   reg = <0x0070130 0x100>;
+   gpio-controller;
+   #gpio-cells = <2>;
+   gpio-ranges = <&sgpio 0 0 64>;
};
 
gpio_spi_bitbang: gpio@1064 {
-- 
2.19.2

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


[U-Boot] [PATCH v3 5/6] mips: ocelot: DT: Enable use of serial gpio

2019-01-02 Thread Lars Povlsen
From: Lars Povlsen 

This enables the use of the MSCC serial GPIO driver on the MSCC
VCoreIII 'ocelot' SOC, and add gpio-leds nodes to the pcb123 and
pcb120 DT.

Signed-off-by: Lars Povlsen 
---
 arch/mips/dts/mscc,ocelot.dtsi  | 23 ++
 arch/mips/dts/ocelot_pcb120.dts | 76 +
 arch/mips/dts/ocelot_pcb123.dts | 25 +++
 3 files changed, 124 insertions(+)

diff --git a/arch/mips/dts/mscc,ocelot.dtsi b/arch/mips/dts/mscc,ocelot.dtsi
index 87b4736285..2592003103 100644
--- a/arch/mips/dts/mscc,ocelot.dtsi
+++ b/arch/mips/dts/mscc,ocelot.dtsi
@@ -37,6 +37,12 @@
clock-frequency = <5>;
};
 
+   sys_clk: sys-clk {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <25000>;
+   };
+
ahb_clk: ahb-clk {
compatible = "fixed-clock";
#clock-cells = <0>;
@@ -118,6 +124,11 @@
#gpio-cells = <2>;
gpio-ranges = <&gpio 0 0 22>;
 
+   sgpio_pins: sgpio-pins {
+   pins = "GPIO_0", "GPIO_1", "GPIO_2", "GPIO_3";
+   function = "sg0";
+   };
+
uart_pins: uart-pins {
pins = "GPIO_6", "GPIO_7";
function = "uart";
@@ -148,5 +159,17 @@
function = "si";
};
};
+
+   sgpio: gpio@10700f8 {
+   compatible = "mscc,ocelot-sgpio";
+   status = "disabled";
+   clocks = <&sys_clk>;
+   pinctrl-0 = <&sgpio_pins>;
+   pinctrl-names = "default";
+   reg = <0x10700f8 0x100>;
+   gpio-controller;
+   #gpio-cells = <2>;
+   gpio-ranges = <&sgpio 0 0 64>;
+   };
};
 };
diff --git a/arch/mips/dts/ocelot_pcb120.dts b/arch/mips/dts/ocelot_pcb120.dts
index 47d305a614..658719e684 100644
--- a/arch/mips/dts/ocelot_pcb120.dts
+++ b/arch/mips/dts/ocelot_pcb120.dts
@@ -9,4 +9,80 @@
 / {
model = "Ocelot PCB120 Reference Board";
compatible = "mscc,ocelot-pcb120", "mscc,ocelot";
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+
+   gpio-leds {
+   compatible = "gpio-leds";
+
+   poe_green {
+   label = "pcb120:green:poe";
+   gpios = <&sgpio 44 1>; /* p12.1 */
+   default-state = "off";
+   };
+
+   poe_red {
+   label = "pcb120:red:poe";
+   gpios = <&sgpio 12 1>; /* p12.0 */
+   default-state = "off";
+   };
+
+   alarm_green {
+   label = "pcb120:green:alarm";
+   gpios = <&sgpio 45 1>; /* p13.1 */
+   default-state = "off";
+   };
+
+   alarm_red {
+   label = "pcb120:red:alarm";
+   gpios = <&sgpio 13 1>; /* p13.0 */
+   default-state = "off";
+   };
+
+   dc_a_green {
+   label = "pcb120:green:dc_a";
+   gpios = <&sgpio 46 1>; /* p14.1 */
+   default-state = "off";
+   };
+
+   dc_a_red {
+   label = "pcb120:red:dc_a";
+   gpios = <&sgpio 14 1>; /* p14.0 */
+   default-state = "off";
+   };
+
+   dc_b_green {
+   label = "pcb120:green:dc_b";
+   gpios = <&sgpio 47 1>; /* p15.1 */
+   default-state = "off";
+   };
+
+   dc_b_red {
+   label = "pcb120:red:dc_b";
+   gpios = <&sgpio 15 1>; /* p15.0 */
+   default-state = "off";
+   };
+
+   status_green {
+   label = "pcb120:green:status";
+   gpios = <&sgpio 48 1>; /* p16.1 */
+   default-state = "on";
+   };
+
+   status_red {
+   label = "pcb120:red:alarm";
+   gpios = <&sgpio 16 1>; /* p16.0 */
+   default-state = "off";
+   };
+
+   };
+
+};
+
+&sgpio {
+   status = "okay";
+   mscc,sgpio-ports = <0x000F>;
 };
+
diff --git a/arch/mips/dts/ocelot_pcb123.dts b/arch/mips/dts/ocelot_pcb123.dts
index 17d8d326ce..c4cb7a1194 100644
--- a/arch/mips/dts/ocelot_pcb123.dts
+++ b/arch/mips/dts/ocelot_pcb123.dts
@@ -9,4 +9,29 @@
 / {
model = "Ocelot PCB123 Reference Board";
compatible = "mscc,ocelot-pcb12

Re: [U-Boot] [PATCH v1 04/14] DTS: imx: Remove not needed '#address-cells' and '#size-cells' properties

2019-01-02 Thread Lukasz Majewski
Hi Marek,

> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
> > This commit fixes warnings produced by newest in u-boot DTC
> > compiler: 'unnecessary #address-cells/#size-cells without "ranges"
> > or child "reg" property'
> > 
> > Signed-off-by: Lukasz Majewski   
> 
> I presume the DTSIs are taken from Linux, is this a backport from
> Linux then ?

Regarding Linux - with Version: DTC 1.4.7-gc86da84d and make W=1 I do
not see those warnings as in  scripts/Makefile.lib :

# Disable noisy checks by default
ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)
DTC_FLAGS += -Wno-unit_address_vs_reg \
-Wno-unit_address_format \
-Wno-avoid_unnecessary_addr_size \

those warnings are disabled (-Wno-avoid_unnecessary_addr_size).

On the other hand - in u-boot those warnings are checked (maybe are
necessary for OF_PLATDATA correct operation?).

> 
> > ---
> > 
> >  arch/arm/dts/imx6q.dtsi   | 4 
> >  arch/arm/dts/imx6qdl.dtsi | 9 -
> >  2 files changed, 13 deletions(-)
> > 
> > diff --git a/arch/arm/dts/imx6q.dtsi b/arch/arm/dts/imx6q.dtsi
> > index c30c8368ca..7f5d91d7f0 100644
> > --- a/arch/arm/dts/imx6q.dtsi
> > +++ b/arch/arm/dts/imx6q.dtsi
> > @@ -150,8 +150,6 @@
> > };
> >  
> > ipu2_di0: port@2 {
> > -   #address-cells = <1>;
> > -   #size-cells = <0>;
> > reg = <2>;
> >  
> > ipu2_di0_disp0: disp0-endpoint {
> > @@ -175,8 +173,6 @@
> > };
> >  
> > ipu2_di1: port@3 {
> > -   #address-cells = <1>;
> > -   #size-cells = <0>;
> > reg = <3>;
> >  
> > ipu2_di1_hdmi: hdmi-endpoint {
> > diff --git a/arch/arm/dts/imx6qdl.dtsi b/arch/arm/dts/imx6qdl.dtsi
> > index b13b0b2db8..476cf93445 100644
> > --- a/arch/arm/dts/imx6qdl.dtsi
> > +++ b/arch/arm/dts/imx6qdl.dtsi
> > @@ -49,9 +49,6 @@
> > };
> >  
> > clocks {
> > -   #address-cells = <1>;
> > -   #size-cells = <0>;
> > -
> > ckil {
> > compatible = "fsl,imx-ckil", "fixed-clock";
> > #clock-cells = <0>;
> > @@ -1125,8 +1122,6 @@
> > };
> >  
> > mipi_dsi: mipi@021e {
> > -   #address-cells = <1>;
> > -   #size-cells = <0>;
> > reg = <0x021e 0x4000>;
> > status = "disabled";
> >  
> > @@ -1228,8 +1223,6 @@
> > };
> >  
> > ipu1_di0: port@2 {
> > -   #address-cells = <1>;
> > -   #size-cells = <0>;
> > reg = <2>;
> >  
> > ipu1_di0_disp0: disp0-endpoint {
> > @@ -1253,8 +1246,6 @@
> > };
> >  
> > ipu1_di1: port@3 {
> > -   #address-cells = <1>;
> > -   #size-cells = <0>;
> > reg = <3>;
> >  
> > ipu1_di1_disp1: disp1-endpoint {
> >   
> 
> 




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


pgpYX0Ojr4jeF.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 v1 02/14] tpc70: config: Update TPC70 config to support eMMC's boot0 SPL update

2019-01-02 Thread Lukasz Majewski
Hi Marek,

> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
> > The TPC70 can boot from eMMC's boot0. This patch allows it to update
> > this HW partition's SPL.
> > 
> > Signed-off-by: Lukasz Majewski 
> > ---
> > 
> >  include/configs/kp_imx6q_tpc.h | 5 +
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/include/configs/kp_imx6q_tpc.h
> > b/include/configs/kp_imx6q_tpc.h index ee9c56bc21..f26b18442b 100644
> > --- a/include/configs/kp_imx6q_tpc.h
> > +++ b/include/configs/kp_imx6q_tpc.h
> > @@ -49,6 +49,7 @@
> >  #define CONFIG_SYS_FSL_ESDHC_ADDR  0
> >  #define CONFIG_SYS_FSL_USDHC_NUM   2
> >  #define CONFIG_SYS_MMC_ENV_DEV 1 /* 0 = SDHC2, 1 =
> > SDHC4 (eMMC) */ +#define CONFIG_SUPPORT_EMMC_BOOT
> >  
> >  /* UART */
> >  #define CONFIG_MXC_UART
> > @@ -109,6 +110,10 @@
> >"setexpr blkc ${blkc} + 1;" \
> >"mmc write ${loadaddr} 0x2 ${blkc};" \
> > "fi;\0" \
> > +   "upd_SPL_mmc=mmc dev 1; mmc partconf 1 0 1 1; run
> > upd_SPL_sd\0" \  
> 
> If mmc dev 1 fails, this will randomly rewrite or even damage some
> SD/MMC card that was selected before
>. Use && ...

Ok - good point.

> 
> > +   "upd_uboot_mmc=mmc dev 1; mmc partconf 1 0 1 1; run
> > upd_uboot_sd\0" \  
> 
> Deduplicate these repeated commands.

Could you be more specific here? 

Without mmc dev 1 and partconf I cannot access boot0 eMMC area. 
This particular board has the SD as mmc0 (rescue/devel) and eMMC as
mmc1 (and eMMC is a production boot medium).

> 
> > +   "up_mmc=run upd_SPL_mmc; run upd_uboot_mmc\0" \
> > +   "up_sd=run upd_SPL_sd; run upd_uboot_sd\0" \
> > "upd_wic=" \
> > "if tftp ${loadaddr} ${wic_file}; then " \
> >"setexpr blkc ${filesize} / 0x200;" \
> >   
> 
> 




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


pgpQUqTCiC4aL.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 v1 01/14] tpc70: config: Add script commands to update u-boot and OE's wic

2019-01-02 Thread Lukasz Majewski
Hi Marek,

> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
> > Signed-off-by: Lukasz Majewski   
> 
> The tags should be ARM: imx: ...
> 
> The commit message is missing.
> 
> > ---
> > 
> >  include/configs/kp_imx6q_tpc.h | 21 +
> >  1 file changed, 21 insertions(+)
> > 
> > diff --git a/include/configs/kp_imx6q_tpc.h
> > b/include/configs/kp_imx6q_tpc.h index b6b27ee1d5..ee9c56bc21 100644
> > --- a/include/configs/kp_imx6q_tpc.h
> > +++ b/include/configs/kp_imx6q_tpc.h
> > @@ -89,11 +89,32 @@
> > "rdinit=/sbin/init\0" \
> > "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit}
> > ${debug} \0" \ "fit_config=mx6q_tpc70_conf\0" \
> > +   "uboot_file=u-boot.img\0" \
> > +   "SPL_file=SPL\0" \
> > +   "wic_file=kp-image-kpimx6qtpc.wic\0" \  
> 
> Why don't you just generate a fitImage and use the fitupd for this ?

This is one of possible solutions - yes.

> 
> > "upd_image=st.4k\0" \
> > "updargs=setenv bootargs console=${console} ${smp}"\
> >"rdinit=${rdinit} ${debug} ${displayargs}\0" \
> > "loadusb=usb start; " \
> >"fatload usb 0 ${loadaddr} ${upd_image}\0" \
> > +   "upd_uboot_sd=" \
> > +   "if tftp ${loadaddr} ${uboot_file}; then " \
> > +  "setexpr blkc ${filesize} / 0x200;" \
> > +  "setexpr blkc ${blkc} + 1;" \
> > +  "mmc write ${loadaddr} 0x8A ${blkc};" \
> > +   "fi;\0" \
> > +   "upd_SPL_sd=" \
> > +   "if tftp ${loadaddr} ${SPL_file}; then " \
> > +  "setexpr blkc ${filesize} / 0x200;" \
> > +  "setexpr blkc ${blkc} + 1;" \
> > +  "mmc write ${loadaddr} 0x2 ${blkc};" \
> > +   "fi;\0" \
> > +   "upd_wic=" \
> > +   "if tftp ${loadaddr} ${wic_file}; then " \
> > +  "setexpr blkc ${filesize} / 0x200;" \
> > +  "setexpr blkc ${blkc} + 1;" \
> > +  "mmc write ${loadaddr} 0x0 ${blkc};" \
> > +   "fi;\0" \
> > "usbupd=echo Booting update from usb ...; " \
> >"setenv bootargs; " \
> >"run updargs; " \
> >   
> 
> 




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


pgpseO9EhUPwJ.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 v1 05/14] board: cosmetic: Use define to set ENET clock selection mask on TPC70

2019-01-02 Thread Lukasz Majewski
Hi Marek,

> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
> > This is a cosmetic change, just to use proper define.
> > 
> > Signed-off-by: Lukasz Majewski   
> 
> The subject tags are wrong, fix globally.

Is there any doc which describes the allowed/not allowed tags (either
with Linux or U-boot)? 

From my experience it is a some kind of a convention depending on the
maintainer (which helps him to spot relevant patches on ML).

In [1] - point 14) there is:
The canonical patch subject line is:
"Subject: [PATCH 001/123] subsystem: summary phrase"

and the "subsystem: " is the tag. 

In the case of this patch -> I do fix stuff in "board(s)" which is
"cosmetic".

Or will we only stick to tags/mails from ./doc/git-mailrc ?

[1] -
https://www.kernel.org/doc/html/v4.17/process/submitting-patches.html

> 
> > ---
> > 
> >  board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
> > b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c index
> > ace986fa05..bcc22b1aa8 100644 ---
> > a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c +++
> > b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c @@ -118,7 +118,8 @@ static
> > int setup_fec_clock(void) struct iomuxc *iomuxc_regs = (struct
> > iomuxc *)IOMUXC_BASE_ADDR; 
> > /* set gpr1[21] to select anatop clock */
> > -   clrsetbits_le32(&iomuxc_regs->gpr[1], 0x1 << 21, 0x1 <<
> > 21);
> > +   clrsetbits_le32(&iomuxc_regs->gpr[1],
> > IOMUXC_GPR1_ENET_CLK_SEL_MASK,
> > +   IOMUXC_GPR1_ENET_CLK_SEL_MASK);
> >  
> > return enable_fec_anatop_clock(0, ENET_50MHZ);
> >  }
> >   
> 
> 


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


pgp8ptG_wd2Ua.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 v1 12/14] imx: mmc: Use 'fsl, usdhc-index' property to provide esdhc controller number

2019-01-02 Thread Lukasz Majewski
On Wed, 2 Jan 2019 02:18:58 +0100
Marek Vasut  wrote:

> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
> > With the current code, it is not possible to assign different than
> > default numbers for mmc controllers.
> > 
> > Several in-tree boards depend on the pre-dm setup, corresponding to
> > following aliases:
> > 
> > mmc0 = &usdhc2; --> fsl,usdhc-index = <1>
> > mmc1 = &usdhc4; --> fsl,usdhc-index = <3>
> > 
> > Without this patch we are either forced to use default aliasing -
> > like:
> > 
> > mmc0 = &usdhc1;
> > mmc1 = &usdhc2;
> > mmc2 = &usdhc3;
> > mmc3 = &usdhc4;
> > 
> > to have the proper clocks setup for the controller. However, such
> > setup is not acceptable for some legacy scripts / code.
> > 
> > With this patch - by introducing 'fsl,usdhc-index' - one can
> > configure (get) clock rate corresponding to used controller.
> > 
> > Moreover, as this code is used in the SPL before relocation (and to
> > save space we strip the SPL DTS from clocks and its names) adding
> > separate properties seems to be the best approach here. One also
> > avoids adding clocks DM code to SPL.
> > 
> > Signed-off-by: Lukasz Majewski 
> > ---
> > 
> >  drivers/mmc/fsl_esdhc.c | 17 -
> >  1 file changed, 16 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
> > index 3cdfa7f5a6..49a6834a98 100644
> > --- a/drivers/mmc/fsl_esdhc.c
> > +++ b/drivers/mmc/fsl_esdhc.c
> > @@ -1401,6 +1401,7 @@ static int fsl_esdhc_probe(struct udevice
> > *dev) fdt_addr_t addr;
> > unsigned int val;
> > struct mmc *mmc;
> > +   int usdhc_idx;
> > int ret;
> >  
> > addr = dev_read_addr(dev);
> > @@ -1513,7 +1514,21 @@ static int fsl_esdhc_probe(struct udevice
> > *dev) 
> > priv->sdhc_clk = clk_get_rate(&priv->per_clk);
> > } else {
> > -   priv->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK +
> > dev->seq);
> > +   /*
> > +* Check for 'fsl,index' DTS property - as one may
> > want to have
> > +* following mmc setup:  
> 
> NAK, DT is a hardware description. This is encoding a policy, which
> should not be in DT.

Please look a few lines up in this file:

mmc0 = &usdhc1;
mmc1 = &usdhc2;
mmc2 = &usdhc3;
mmc3 = &usdhc4;

The fsl_esdhc.c has hardcoded ordering for eMMC devices when
setting/getting clock. 

If you change aliases on your dts (mmc0 -> usdhc2, etc). Then with a
bit of luck your second controller will be initialized with first's one
clock value :-). This of course works by chance with default ROM setup.

The problem is that many boards have different mmc ordering (starting
with mmc0, which in above scheme is usdhc2 controller. Also mmc1 is the
usdhc4 to which eMMC is connected in many boards). Of course this could
be changed, but please consider a lot of legacy code pilling up on the
customer's side.

The clock index @ (drivers/mmc/fsl_esdhc.c - L1517):
mxc_get_clock(MXC_ESDHC_CLK + dev->seq);

Here the dev->seq is 0,1 (with SEQ_ALIAS), which will provide clock
values from usdhc1 and usdhc2. However, we use usdhc4 (eMMC) and usdhc2
(SD).

> 
> This looks like some reimplementation of SEQ_ALIAS stuff.

No, this is a fix for hardcoded (assumed) clock setup in this driver.

The other option is to provide/port clock stuff from linux (and
implement CLK_DM in u-boot at least for this part). However, this will
not fix the problem described above (for other boards which use the
"legacy" approach).

> 
> > +* mmc0 = &usdhc2; --> fsl,index = <1>
> > +* mmc1 = &usdhc4; --> fsl,index = <3>
> > +*
> > +* So we do have dev->seq = {0, 1}, which in the
> > below code
> > +* doesn't correspond to correct USDHC clocks.
> > +*
> > +* For that reason a new "fsl,index" property has
> > been
> > +* introduced.
> > +*/
> > +   usdhc_idx = dev_read_u32_default(dev,
> > "fsl,usdhc-index",
> > +dev->seq);
> > +   priv->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK +
> > usdhc_idx); if (priv->sdhc_clk <= 0) {
> > dev_err(dev, "Unable to get clk for %s\n",
> > dev->name); return -EINVAL;
> >   
> 
> 




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


pgp7fFcu6WYxy.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] dm: usb: gadget: Fix boot breakage on sunxi platforms

2019-01-02 Thread Jean-Jacques Hiblot


On 29/12/2018 19:49, Jagan Teki wrote:

On Mon, Dec 24, 2018 at 3:44 AM Jagan Teki  wrote:

On Fri, Dec 21, 2018 at 2:20 PM Jean-Jacques Hiblot  wrote:
Better to have proper commit head that tells the real issue.


I found it hard to come up with a short description of the real issue.

At least this title makes it clear that it is a regression fix, not a 
new feature.


The details of the failures  are in the commit log (or so I thought)




Fixes commit 013116243950 ("dm: usb: create a new UCLASS ID for USB gadget
devices")

The UCLASS_DRIVER for id UCLASS_USB_GADGET_GENERIC needs to be declared
even for platforms that do not enable DM_USB_GADGET. Otherwise the driver
for their usb peripheral controller fails to bind.

Sorry this is unclear, you are trying to skip DM_USB_GADGET code even
though UCLASS_USB_GADGET_GENERIC id used. does it make sense?


Sorry for the delay. This was indeed a vacation time.

This patch does not skip DM_USB_GADGET. What it does is declare the 
UCLASS_DRIVER for USB peripheral devices even if DM_USB_GADGET is not set.


DM_USB_GADGET is a new option and not (yet) widely used and some drivers 
have their own version of the DM support for gadget drivers (ie they 
implement their own version of usb_gadget_initialize(), 
usb_gadget_release() and usb_gadget_handle_interrupts()). However all 
those drivers use the UCLASS_USB_GADGET_GENERIC uclass ID and thus the 
UCLASS_DRIVER for UCLASS_USB_GADGET_GENERIC must be declared. In the 
past they used UCLASS_USB_DEV_GENERIC, but this option is intended for 
the host side.



JJ


Any response on this?

We need the fix asap since the release is about a week.


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


Re: [U-Boot] [PATCH v2 0/3] ddr: vybrid: Support for vf610 built-in DDR3 memory calibration

2019-01-02 Thread Lukasz Majewski
Hi Fabio, Stefano,

> This patch series provides code to perform read leveling - RDLVL,
> which is adjusting the DQS strobe in relation to the DQ signals so
> that the strobe edge is centered in the window of valid read data.
> 
> The code is based on Vybrid's Reference Manual's:
> "VFxxx Controller Reference Manual, Rev. 0, 10/2016", page 1600,
> 10.1.6.16.4.1 "Software Read Leveling in MC Evaluation Mode"
> 
> and uses clarification provided by following NXP's community thread:
> "Vybrid: About DDR leveling feature on DDRMC."
> https://community.nxp.com/thread/395323
> 
> It depends on a BITMAP rework patch:
> usb: composite: Move bitmap related operations
> to ./include/linux/bitmap.h http://patchwork.ozlabs.org/patch/1006448/
> 

The above patch has found its way to main line, so there is no
obstacles to pull this code.

Moreover, some Stefan's patches:
[U-Boot,v1,0/4] ddr: vybrid: various fixes

http://patchwork.ozlabs.org/cover/1007547/

Are also related to DDR_MC setup on Vybrid and fix/cleanup some issues.

> 
> Changes in v2:
> - CR93_SWLVL_EXIT -> CR94_SWLVL_EXIT (EXIT is in CR94)
> - Add more defines to imx-regs.h (moved from *-calibration.h)
>  - CR93_SWLVL_EXIT -> CR94_SWLVL_EXIT (EXIT is in CR94)
>  - Update Kconfig information regarding DDRMC_VF610_CALIBRATION
>  - Update ddrmc-vf610-calibration. comment
>  - Update code after extending imx-regs.h
>  - Remove not needed #ifdef
> 
> Lukasz Majewski (3):
>   ddr: vybrid: Add DDRMC calibration related registers (DQS to DQ)
>   ddr: vybrid: Provide code to perform on-boot calibration
>   ddr: vybrid: Add calibration code to memory controler's (DDRMC)
> setup code
> 
>  arch/arm/include/asm/arch-vf610/imx-regs.h  |  14 +-
>  arch/arm/mach-imx/Kconfig   |  12 +
>  arch/arm/mach-imx/Makefile  |   1 +
>  arch/arm/mach-imx/ddrmc-vf610-calibration.c | 342
> 
> arch/arm/mach-imx/ddrmc-vf610-calibration.h |  45 
> arch/arm/mach-imx/ddrmc-vf610.c |   5 + 6 files changed,
> 418 insertions(+), 1 deletion(-) create mode 100644
> arch/arm/mach-imx/ddrmc-vf610-calibration.c create mode 100644
> arch/arm/mach-imx/ddrmc-vf610-calibration.h
> 




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


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


[U-Boot] [PATCH 1/1] cmd: usb: display bus number

2019-01-02 Thread Heinrich Schuchardt
If multiple USB buses exist, the output of the commands 'usb tree' and 'usb
info' is confusing because it is not clear where the output for a new bus
starts.

Print an additional line for each bus indicating the bus number, e.g.

=> usb tree
USB device tree:
USB bus 0
  1  Hub (5 Gb/s, 0mA)
 U-Boot XHCI Host Controller

USB bus 1
  1  Hub (5 Gb/s, 0mA)
 U-Boot XHCI Host Controller

Signed-off-by: Heinrich Schuchardt 
---
 cmd/usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cmd/usb.c b/cmd/usb.c
index 0ccb1b5148..6da945c376 100644
--- a/cmd/usb.c
+++ b/cmd/usb.c
@@ -470,6 +470,7 @@ static void usb_for_each_root_dev(usb_dev_func_t func)
if (!device_active(bus))
continue;
 
+   printf("USB bus %d\n", bus->seq);
device_find_first_child(bus, &dev);
if (dev && device_active(dev)) {
udev = dev_get_parent_priv(dev);
-- 
2.19.2

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


[U-Boot] [PATCH 1/1] cmd: usb: display bus number

2019-01-02 Thread Heinrich Schuchardt
If multiple USB buses exist, the output of the commands 'usb tree' and 'usb
info' is confusing because it is not clear where the output for a new bus
starts.

Print an additional line for each bus indicating the bus number, e.g.

=> usb tree
USB device tree:
USB bus 0
  1  Hub (5 Gb/s, 0mA)
 U-Boot XHCI Host Controller

USB bus 1
  1  Hub (5 Gb/s, 0mA)
 U-Boot XHCI Host Controller

Signed-off-by: Heinrich Schuchardt 
---
 cmd/usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cmd/usb.c b/cmd/usb.c
index 0ccb1b5148..6da945c376 100644
--- a/cmd/usb.c
+++ b/cmd/usb.c
@@ -470,6 +470,7 @@ static void usb_for_each_root_dev(usb_dev_func_t func)
if (!device_active(bus))
continue;
 
+   printf("USB bus %d\n", bus->seq);
device_find_first_child(bus, &dev);
if (dev && device_active(dev)) {
udev = dev_get_parent_priv(dev);
-- 
2.19.2

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


Re: [U-Boot] [PATCH 0/5] imx8: several fixes

2019-01-02 Thread Peng Fan
Ping.

Thanks,
Peng.

> -Original Message-
> From: Peng Fan [mailto:peng@nxp.com]
> Sent: 2018年12月15日 20:20
> To: sba...@denx.de
> Cc: Fabio Estevam ; u-boot@lists.denx.de;
> dl-uboot-imx ; Peng Fan 
> Subject: [PATCH 0/5] imx8: several fixes
> 
> Several fixes when moving to support SPL.
> 
> Peng Fan (5):
>   clk: imx8: fix build warning
>   misc: imx: scu: avoid write null pointer
>   misc: imx8: scu: use platdata instead of priv data
>   imx8: cpu: correct info
>   tools: imx8image: set dcd_skip to true
> 
>  arch/arm/mach-imx/imx8/cpu.c |  2 +-
>  drivers/clk/imx/clk-imx8.c   |  2 ++
>  drivers/misc/imx8/scu.c  | 26 +-
>  drivers/misc/imx8/scu_api.c  |  4 ++--
>  tools/imx8image.c|  2 +-
>  5 files changed, 19 insertions(+), 17 deletions(-)
> 
> --
> 2.14.1

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


Re: [U-Boot] [PATCH] dm: usb: gadget: Fix boot breakage on sunxi platforms

2019-01-02 Thread Lukasz Majewski
On Wed, 2 Jan 2019 11:38:47 +0100
Jean-Jacques Hiblot  wrote:

> On 29/12/2018 19:49, Jagan Teki wrote:
> > On Mon, Dec 24, 2018 at 3:44 AM Jagan Teki
> >  wrote:  
> >> On Fri, Dec 21, 2018 at 2:20 PM Jean-Jacques Hiblot
> >>  wrote: Better to have proper commit head that
> >> tells the real issue.  
> 
> I found it hard to come up with a short description of the real issue.
> 
> At least this title makes it clear that it is a regression fix, not a 
> new feature.
> 
> The details of the failures  are in the commit log (or so I thought)
> 
> >>  
> >>> Fixes commit 013116243950 ("dm: usb: create a new UCLASS ID for
> >>> USB gadget devices")
> >>>
> >>> The UCLASS_DRIVER for id UCLASS_USB_GADGET_GENERIC needs to be
> >>> declared even for platforms that do not enable DM_USB_GADGET.
> >>> Otherwise the driver for their usb peripheral controller fails to
> >>> bind.  
> >> Sorry this is unclear, you are trying to skip DM_USB_GADGET code
> >> even though UCLASS_USB_GADGET_GENERIC id used. does it make
> >> sense?  
> 
> Sorry for the delay. This was indeed a vacation time.
> 
> This patch does not skip DM_USB_GADGET. What it does is declare the 
> UCLASS_DRIVER for USB peripheral devices even if DM_USB_GADGET is not
> set.
> 
> DM_USB_GADGET is a new option and not (yet) widely used and some
> drivers have their own version of the DM support for gadget drivers
> (ie they implement their own version of usb_gadget_initialize(), 
> usb_gadget_release() and usb_gadget_handle_interrupts()). However all 
> those drivers use the UCLASS_USB_GADGET_GENERIC uclass ID and thus
> the UCLASS_DRIVER for UCLASS_USB_GADGET_GENERIC must be declared. In
> the past they used UCLASS_USB_DEV_GENERIC, but this option is
> intended for the host side.
> 

Thanks for a detailed explanation. Would you prepare v2 soon?

> 
> JJ
> 
> > Any response on this?
> >
> > We need the fix asap since the release is about a week.
> >  




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


pgpxWGW5W_MNZ.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 2/6] riscv: remove invalid dcache flush implementation

2019-01-02 Thread Auer, Lukas
Hi Rick,

On Wed, 2019-01-02 at 10:54 +0800, Rick Chen wrote:
> Hi Lukas
> 
> > > From: Lukas Auer [mailto:lukas.a...@aisec.fraunhofer.de]
> > > Sent: Monday, December 31, 2018 2:28 AM
> > > To: u-boot@lists.denx.de
> > > Cc: Anup Patel; Lukas Auer; Rick Jian-Zhi Chen(陳建志); Bin Meng;
> > > Greentime Hu
> > > Subject: [PATCH 2/6] riscv: remove invalid dcache flush
> > > implementation
> > > 
> > > The fence instruction is used to enforce device I/O and memory
> > > ordering
> > > constraints in RISC-V. It does not directly affect the data cache
> > > and particular
> > > cannot be used to flush or invalidate it. RISC-V does not have
> > > instructions for
> > > explicit cache control. Remove the flush_dcache_all
> > > implementation and its use
> > > in all dcache-specific functions in lib/cache.c.
> > > 
> 
> The privileged mention that fence is for the purposes of ordering,
> but
> does not say
> it can not be used to flush or invalidate.
> 
> Andes's ax25 have no coherence agent. So it need fence instruction to
> manipulate
> cache flush or invalidate. Or there will be some data synchronization
> error
> occurs on ae350 platform.
> 

I was not aware of this. Does the ax25 flush the whole dcache on any
fence instruction?

You are right, we can't remove it in this case. Since it is specific to
the ax25, should I move it into cpu/ax25/cache.c instead?

Thanks,
Lukas

> Thanks
> Rick
> 
> 
> > > This also adds a missing new line between flush_dcache_all and
> > > flush_dcache_range in lib/cache.c.
> > > 
> > > Signed-off-by: Lukas Auer 
> > > ---
> > > This patch only removes the implementation itself and its use in
> > > dcache-specific
> > > functions in lib/cache.c. There are more uses of it in
> > > arch/riscv/, which this patch
> > > does not remove.
> > > 
> > >  arch/riscv/lib/cache.c | 4 +---
> > >  1 file changed, 1 insertion(+), 3 deletions(-)
> > > 
> > > diff --git a/arch/riscv/lib/cache.c b/arch/riscv/lib/cache.c
> > > index
> > > ae5c60716f..203e287612 100644
> > > --- a/arch/riscv/lib/cache.c
> > > +++ b/arch/riscv/lib/cache.c
> > > @@ -13,11 +13,10 @@ void invalidate_icache_all(void)
> > > 
> > >  void flush_dcache_all(void)
> > >  {
> > > - asm volatile ("fence" :::"memory");
> > >  }
> > > +
> > >  void flush_dcache_range(unsigned long start, unsigned long
> > > end)  {
> > > - flush_dcache_all();
> > >  }
> > > 
> > >  void invalidate_icache_range(unsigned long start, unsigned long
> > > end) @@ -31,7
> > > +30,6 @@ void invalidate_icache_range(unsigned long start,
> > > unsigned long end)
> > > 
> > >  void invalidate_dcache_range(unsigned long start, unsigned long
> > > end)  {
> > > - flush_dcache_all();
> > >  }
> > > 
> > >  void cache_flush(void)
> > > --
> > > 2.20.1
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 0/9] Add common pinctrl driver support for rockchip

2019-01-02 Thread David Wu
The common pinctrl driver for rockchip Socs, it depends the PINCTRL_FULL config.
If use it, the default pinctrl setup from DTS could be configured at device 
probe.

Changes in v2:
- Remove px30, rk2928, rk3066*.
- Split it to multiple files for the relevant per-SoC data structures.

David Wu (9):
  rockchip: rk3399-evb: defconfig: Enable FDT for new pinctrl driver
  ARM: rockchip: rk3188: Remove the pinctrl setup and enable uart at SPL
  ARM: rockchip: Kconfig: Remove the SPL_PINCTRL for rk3188
  ARM: rockchip: Remove the pinctrl request at rk3288-board-spl
  rk3288: chrome: defconfig: Enable FDT for new pinctrl driver
  pinctrl: rockchip: Add common rockchip pinctrl driver
  rockchip: defconfig: Clean the unused pinctrl config
  pinctrl: rockchip: Clean the unused rockchip pinctrl drivers
  ARM: dts: rk322x: Correct the uart2 default pin configuration

 arch/arm/dts/rk322x.dtsi  |  11 +-
 arch/arm/mach-rockchip/Kconfig|   1 -
 arch/arm/mach-rockchip/rk3188-board-spl.c |  41 +-
 arch/arm/mach-rockchip/rk3288-board-spl.c |  79 --
 configs/chromebit_mickey_defconfig|   4 -
 configs/chromebook_jerry_defconfig|   4 -
 configs/chromebook_minnie_defconfig   |   4 -
 configs/evb-px5_defconfig |   1 -
 configs/evb-rk3128_defconfig  |   1 -
 configs/evb-rk3229_defconfig  |   1 -
 configs/evb-rk3288_defconfig  |   2 -
 configs/evb-rk3399_defconfig  |   2 -
 configs/evb-rv1108_defconfig  |   1 -
 configs/fennec-rk3288_defconfig   |   2 -
 configs/firefly-rk3288_defconfig  |   2 -
 configs/firefly-rk3399_defconfig  |   1 -
 configs/geekbox_defconfig |   1 -
 configs/kylin-rk3036_defconfig|   1 -
 configs/lion-rk3368_defconfig |   1 -
 configs/miqi-rk3288_defconfig |   2 -
 configs/phycore-rk3288_defconfig  |   2 -
 configs/popmetal-rk3288_defconfig |   2 -
 configs/puma-rk3399_defconfig |   1 -
 configs/rock2_defconfig   |   2 -
 configs/rock_defconfig|   1 -
 configs/sandbox_defconfig |   2 -
 configs/sandbox_flattree_defconfig|   2 -
 configs/sandbox_noblk_defconfig   |   2 -
 configs/sheep-rk3368_defconfig|   1 -
 configs/tinker-rk3288_defconfig   |   2 -
 configs/vyasa-rk3288_defconfig|   2 -
 drivers/pinctrl/Kconfig   |  91 +-
 drivers/pinctrl/Makefile  |   2 +-
 drivers/pinctrl/rockchip/Kconfig  |  17 +
 drivers/pinctrl/rockchip/Makefile |  19 +-
 drivers/pinctrl/rockchip/pinctrl-rk3036.c |  65 ++
 drivers/pinctrl/rockchip/pinctrl-rk3128.c | 155 +++
 drivers/pinctrl/rockchip/pinctrl-rk3188.c |  82 ++
 drivers/pinctrl/rockchip/pinctrl-rk322x.c | 215 
 drivers/pinctrl/rockchip/pinctrl-rk3288.c | 157 +++
 drivers/pinctrl/rockchip/pinctrl-rk3328.c | 227 
 drivers/pinctrl/rockchip/pinctrl-rk3368.c | 116 ++
 drivers/pinctrl/rockchip/pinctrl-rk3399.c | 193 
 .../pinctrl/rockchip/pinctrl-rockchip-core.c  | 788 ++
 drivers/pinctrl/rockchip/pinctrl-rockchip.h   | 302 ++
 drivers/pinctrl/rockchip/pinctrl-rv1108.c | 203 
 drivers/pinctrl/rockchip/pinctrl_rk3036.c | 671 
 drivers/pinctrl/rockchip/pinctrl_rk3128.c | 186 
 drivers/pinctrl/rockchip/pinctrl_rk3188.c | 989 --
 drivers/pinctrl/rockchip/pinctrl_rk322x.c | 894 
 drivers/pinctrl/rockchip/pinctrl_rk3288.c | 869 ---
 drivers/pinctrl/rockchip/pinctrl_rk3328.c | 705 -
 drivers/pinctrl/rockchip/pinctrl_rk3368.c | 739 -
 drivers/pinctrl/rockchip/pinctrl_rk3399.c | 503 -
 drivers/pinctrl/rockchip/pinctrl_rv1108.c | 580 --
 55 files changed, 2543 insertions(+), 6406 deletions(-)
 create mode 100644 drivers/pinctrl/rockchip/Kconfig
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3036.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3128.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3188.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk322x.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3288.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3328.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3368.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3399.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rockchip-core.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rockchip.h
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rv1108.c
 delete mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3036.c
 delete mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3128.c
 delete mode 100644 drivers/pinctrl/ro

[U-Boot] [PATCH v2 2/9] ARM: rockchip: rk3188: Remove the pinctrl setup and enable uart at SPL

2019-01-02 Thread David Wu
When the boot ROM sets up MMC we don't need to do it again. Remove the
MMC setup code entirely, but we also need to enable uart for debug message.

Signed-off-by: David Wu 
---

Changes in v2: None

 arch/arm/mach-rockchip/rk3188-board-spl.c | 41 ++-
 1 file changed, 2 insertions(+), 39 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c 
b/arch/arm/mach-rockchip/rk3188-board-spl.c
index 3c6c3d3c09..a5e4d39cb7 100644
--- a/arch/arm/mach-rockchip/rk3188-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3188-board-spl.c
@@ -120,7 +120,7 @@ void board_debug_uart_init(void)
 
 void board_init_f(ulong dummy)
 {
-   struct udevice *pinctrl, *dev;
+   struct udevice *dev;
int ret;
 
 #define EARLY_UART
@@ -134,10 +134,7 @@ void board_init_f(ulong dummy)
 * printascii("string");
 */
debug_uart_init();
-   printch('s');
-   printch('p');
-   printch('l');
-   printch('\n');
+   printascii("U-Boot SPL board init");
 #endif
 
 #ifdef CONFIG_ROCKCHIP_USB_UART
@@ -171,12 +168,6 @@ void board_init_f(ulong dummy)
return;
}
 
-   ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-   if (ret) {
-   debug("Pinctrl init failed: %d\n", ret);
-   return;
-   }
-
ret = uclass_get_device(UCLASS_RAM, 0, &dev);
if (ret) {
debug("DRAM init failed: %d\n", ret);
@@ -214,7 +205,6 @@ static int setup_led(void)
 
 void spl_board_init(void)
 {
-   struct udevice *pinctrl;
int ret;
 
ret = setup_led();
@@ -223,36 +213,9 @@ void spl_board_init(void)
hang();
}
 
-   ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-   if (ret) {
-   debug("%s: Cannot find pinctrl device\n", __func__);
-   goto err;
-   }
-
-#ifdef CONFIG_SPL_MMC_SUPPORT
-   ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_SDCARD);
-   if (ret) {
-   debug("%s: Failed to set up SD card\n", __func__);
-   goto err;
-   }
-#endif
-
-   /* Enable debug UART */
-   ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART_DBG);
-   if (ret) {
-   debug("%s: Failed to set up console UART\n", __func__);
-   goto err;
-   }
-
preloader_console_init();
 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 #endif
return;
-
-err:
-   printf("spl_board_init: Error %d\n", ret);
-
-   /* No way to report error here */
-   hang();
 }
-- 
2.19.1



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


[U-Boot] [PATCH v2 1/9] rockchip: rk3399-evb: defconfig: Enable FDT for new pinctrl driver

2019-01-02 Thread David Wu
The FDT is requested for new pinctrl driver, disable SPL_OF_PLATDATA
to make FDT be built in.

Signed-off-by: David Wu 
---

Changes in v2: None

 configs/evb-rk3399_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configs/evb-rk3399_defconfig b/configs/evb-rk3399_defconfig
index f173c10a6b..27cf8304be 100644
--- a/configs/evb-rk3399_defconfig
+++ b/configs/evb-rk3399_defconfig
@@ -31,7 +31,6 @@ CONFIG_CMD_TIME=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3399-evb"
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names 
interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
-CONFIG_SPL_OF_PLATDATA=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_REGMAP=y
-- 
2.19.1



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


[U-Boot] [PATCH v2 3/9] ARM: rockchip: Kconfig: Remove the SPL_PINCTRL for rk3188

2019-01-02 Thread David Wu
It seems that pinctrl is not requested for rk3188 SPL, remove it so
that can save more space for SPL image size.

Signed-off-by: David Wu 
Reviewed-by: Philipp Tomsich 
---

Changes in v2: None

 arch/arm/mach-rockchip/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 6dc8e3a017..15c6ed2340 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -29,7 +29,6 @@ config ROCKCHIP_RK3188
select SUPPORT_SPL
select SPL
select SPL_CLK
-   select SPL_PINCTRL
select SPL_REGMAP
select SPL_SYSCON
select SPL_RAM
-- 
2.19.1



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


[U-Boot] [PATCH v2 4/9] ARM: rockchip: Remove the pinctrl request at rk3288-board-spl

2019-01-02 Thread David Wu
If we use the new pinctrl driver, the pinctrl setup will be done
by device probe. Remove the pinctrl setup at rk3288-board-spl.

Signed-off-by: David Wu 
Reviewed-by: Philipp Tomsich 
---

Changes in v2: None

 arch/arm/mach-rockchip/rk3288-board-spl.c | 79 ---
 1 file changed, 79 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c 
b/arch/arm/mach-rockchip/rk3288-board-spl.c
index abd62e520f..9463b255e1 100644
--- a/arch/arm/mach-rockchip/rk3288-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
@@ -77,45 +77,6 @@ fallback:
return BOOT_DEVICE_MMC1;
 }
 
-#ifdef CONFIG_SPL_MMC_SUPPORT
-static int configure_emmc(struct udevice *pinctrl)
-{
-#if defined(CONFIG_TARGET_CHROMEBOOK_JERRY)
-
-   struct gpio_desc desc;
-   int ret;
-
-   pinctrl_request_noflags(pinctrl, PERIPH_ID_EMMC);
-
-   /*
-* TODO(s...@chromium.org): Pick this up from device tree or perhaps
-* use the EMMC_PWREN setting.
-*/
-   ret = dm_gpio_lookup_name("D9", &desc);
-   if (ret) {
-   debug("gpio ret=%d\n", ret);
-   return ret;
-   }
-   ret = dm_gpio_request(&desc, "emmc_pwren");
-   if (ret) {
-   debug("gpio_request ret=%d\n", ret);
-   return ret;
-   }
-   ret = dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
-   if (ret) {
-   debug("gpio dir ret=%d\n", ret);
-   return ret;
-   }
-   ret = dm_gpio_set_value(&desc, 1);
-   if (ret) {
-   debug("gpio value ret=%d\n", ret);
-   return ret;
-   }
-#endif
-   return 0;
-}
-#endif
-
 #if !defined(CONFIG_SPL_OF_PLATDATA)
 static int phycore_init(void)
 {
@@ -144,7 +105,6 @@ static int phycore_init(void)
 
 void board_init_f(ulong dummy)
 {
-   struct udevice *pinctrl;
struct udevice *dev;
int ret;
 
@@ -183,12 +143,6 @@ void board_init_f(ulong dummy)
return;
}
 
-   ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-   if (ret) {
-   debug("Pinctrl init failed: %d\n", ret);
-   return;
-   }
-
 #if !defined(CONFIG_SPL_OF_PLATDATA)
if (of_machine_is_compatible("phytec,rk3288-phycore-som")) {
ret = phycore_init();
@@ -239,52 +193,19 @@ static int setup_led(void)
 
 void spl_board_init(void)
 {
-   struct udevice *pinctrl;
int ret;
 
ret = setup_led();
-
if (ret) {
debug("LED ret=%d\n", ret);
hang();
}
 
-   ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-   if (ret) {
-   debug("%s: Cannot find pinctrl device\n", __func__);
-   goto err;
-   }
-
-#ifdef CONFIG_SPL_MMC_SUPPORT
-   ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_SDCARD);
-   if (ret) {
-   debug("%s: Failed to set up SD card\n", __func__);
-   goto err;
-   }
-   ret = configure_emmc(pinctrl);
-   if (ret) {
-   debug("%s: Failed to set up eMMC\n", __func__);
-   goto err;
-   }
-#endif
-
-   /* Enable debug UART */
-   ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART_DBG);
-   if (ret) {
-   debug("%s: Failed to set up console UART\n", __func__);
-   goto err;
-   }
-
preloader_console_init();
 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 #endif
return;
-err:
-   printf("spl_board_init: Error %d\n", ret);
-
-   /* No way to report error here */
-   hang();
 }
 
 #ifdef CONFIG_SPL_OS_BOOT
-- 
2.19.1



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


[U-Boot] [PATCH v2 5/9] rk3288: chrome: defconfig: Enable FDT for new pinctrl driver

2019-01-02 Thread David Wu
The FDT is requested for new pinctrl driver, disable SPL_OF_PLATDATA
and enable SPL_OF_LIBFDT to make FDT be built in.

Signed-off-by: David Wu 
---

Changes in v2: None

 configs/chromebit_mickey_defconfig  | 2 --
 configs/chromebook_jerry_defconfig  | 2 --
 configs/chromebook_minnie_defconfig | 2 --
 3 files changed, 6 deletions(-)

diff --git a/configs/chromebit_mickey_defconfig 
b/configs/chromebit_mickey_defconfig
index 79ab6acaec..5fbb5a4ebc 100644
--- a/configs/chromebit_mickey_defconfig
+++ b/configs/chromebit_mickey_defconfig
@@ -38,7 +38,6 @@ CONFIG_SPL_PARTITION_UUIDS=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3288-veyron-mickey"
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names 
interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
-CONFIG_SPL_OF_PLATDATA=y
 CONFIG_REGMAP=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SYSCON=y
@@ -93,4 +92,3 @@ CONFIG_DISPLAY_ROCKCHIP_HDMI=y
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
-# CONFIG_SPL_OF_LIBFDT is not set
diff --git a/configs/chromebook_jerry_defconfig 
b/configs/chromebook_jerry_defconfig
index d892d65bf0..f6f0697050 100644
--- a/configs/chromebook_jerry_defconfig
+++ b/configs/chromebook_jerry_defconfig
@@ -40,7 +40,6 @@ CONFIG_SPL_PARTITION_UUIDS=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3288-veyron-jerry"
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names 
interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
-CONFIG_SPL_OF_PLATDATA=y
 CONFIG_REGMAP=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SYSCON=y
@@ -95,4 +94,3 @@ CONFIG_DISPLAY_ROCKCHIP_HDMI=y
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
-# CONFIG_SPL_OF_LIBFDT is not set
diff --git a/configs/chromebook_minnie_defconfig 
b/configs/chromebook_minnie_defconfig
index b042874073..705a3cd0e5 100644
--- a/configs/chromebook_minnie_defconfig
+++ b/configs/chromebook_minnie_defconfig
@@ -39,7 +39,6 @@ CONFIG_SPL_PARTITION_UUIDS=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3288-veyron-minnie"
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names 
interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
-CONFIG_SPL_OF_PLATDATA=y
 CONFIG_REGMAP=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SYSCON=y
@@ -95,4 +94,3 @@ CONFIG_CONSOLE_SCROLL_LINES=10
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
-# CONFIG_SPL_OF_LIBFDT is not set
-- 
2.19.1



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


[U-Boot] [PATCH v2 6/9] pinctrl: rockchip: Add common rockchip pinctrl driver

2019-01-02 Thread David Wu
Use this driver to fit all Rockchip SOCs and to support
the desired pinctrl configuration via DTS.

Signed-off-by: David Wu 
---

Changes in v2:
- Remove px30, rk2928, rk3066*.
- Split it to multiple files for the relevant per-SoC data structures.

 drivers/pinctrl/Kconfig   |  91 +-
 drivers/pinctrl/Makefile  |   2 +-
 drivers/pinctrl/rockchip/Kconfig  |  17 +
 drivers/pinctrl/rockchip/Makefile |  19 +-
 drivers/pinctrl/rockchip/pinctrl-rk3036.c |  65 ++
 drivers/pinctrl/rockchip/pinctrl-rk3128.c | 155 
 drivers/pinctrl/rockchip/pinctrl-rk3188.c |  82 ++
 drivers/pinctrl/rockchip/pinctrl-rk322x.c | 215 +
 drivers/pinctrl/rockchip/pinctrl-rk3288.c | 157 
 drivers/pinctrl/rockchip/pinctrl-rk3328.c | 227 +
 drivers/pinctrl/rockchip/pinctrl-rk3368.c | 116 +++
 drivers/pinctrl/rockchip/pinctrl-rk3399.c | 193 +
 .../pinctrl/rockchip/pinctrl-rockchip-core.c  | 788 ++
 drivers/pinctrl/rockchip/pinctrl-rockchip.h   | 302 +++
 drivers/pinctrl/rockchip/pinctrl-rv1108.c | 203 +
 15 files changed, 2532 insertions(+), 100 deletions(-)
 create mode 100644 drivers/pinctrl/rockchip/Kconfig
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3036.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3128.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3188.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk322x.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3288.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3328.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3368.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rk3399.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rockchip-core.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rockchip.h
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rv1108.c

diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index 7e6fad305a..d2168f7b72 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -158,96 +158,6 @@ config PINCTRL_QCA953X
  the GPIO definitions and pin control functions for each available
  multiplex function.
 
-config PINCTRL_ROCKCHIP_RK3036
-   bool "Rockchip rk3036 pin control driver"
-   depends on DM
-   help
- Support pin multiplexing control on Rockchip rk3036 SoCs.
-
- The driver is controlled by a device tree node which contains both
- the GPIO definitions and pin control functions for each available
- multiplex function.
-
-config PINCTRL_ROCKCHIP_RK3128
-   bool "Rockchip rk3128 pin control driver"
-   depends on DM
-   help
- Support pin multiplexing control on Rockchip rk3128 SoCs.
-
- The driver is controlled by a device tree node which contains both
- the GPIO definitions and pin control functions for each available
- multiplex function.
-
-config PINCTRL_ROCKCHIP_RK3188
-   bool "Rockchip rk3188 pin control driver"
-   depends on DM
-   help
- Support pin multiplexing control on Rockchip rk3188 SoCs.
-
- The driver is controlled by a device tree node which contains both
- the GPIO definitions and pin control functions for each available
- multiplex function.
-
-config PINCTRL_ROCKCHIP_RK322X
-   bool "Rockchip rk322x pin control driver"
-   depends on DM
-   help
- Support pin multiplexing control on Rockchip rk322x SoCs.
-
- The driver is controlled by a device tree node which contains both
- the GPIO definitions and pin control functions for each available
- multiplex function.
-
-config PINCTRL_ROCKCHIP_RK3288
-   bool "Rockchip rk3288 pin control driver"
-   depends on DM
-   help
- Support pin multiplexing control on Rockchip rk3288 SoCs.
-
- The driver is controlled by a device tree node which contains both
- the GPIO definitions and pin control functions for each available
- multiplex function.
-
-config PINCTRL_ROCKCHIP_RK3328
-   bool "Rockchip rk3328 pin control driver"
-   depends on DM
-   help
- Support pin multiplexing control on Rockchip rk3328 SoCs.
-
- The driver is controlled by a device tree node which contains both
- the GPIO definitions and pin control functions for each available
- multiplex function.
-
-config PINCTRL_ROCKCHIP_RK3368
-   bool "Rockchip RK3368 pin control driver"
-   depends on DM
-   help
- Support pin multiplexing control on Rockchip rk3368 SoCs.
-
- The driver is controlled by a device tree node which contains both
- the GPIO definitions and pin control functions for each available
- multiplex function.
-
-config PINCTRL_ROCKCHIP_RK3399
-   bool "Rockchip rk3399 pin control driver"
-   depends on DM
-   help
- Support pin multiplexing contr

[U-Boot] [PATCH v2 7/9] rockchip: defconfig: Clean the unused pinctrl config

2019-01-02 Thread David Wu
If we used the pinctrl-rockchip driver, these config is not needed,
so remove them.

Signed-off-by: David Wu 
---

Changes in v2: None

 configs/chromebit_mickey_defconfig  | 2 --
 configs/chromebook_jerry_defconfig  | 2 --
 configs/chromebook_minnie_defconfig | 2 --
 configs/evb-px5_defconfig   | 1 -
 configs/evb-rk3128_defconfig| 1 -
 configs/evb-rk3229_defconfig| 1 -
 configs/evb-rk3288_defconfig| 2 --
 configs/evb-rk3399_defconfig| 1 -
 configs/evb-rv1108_defconfig| 1 -
 configs/fennec-rk3288_defconfig | 2 --
 configs/firefly-rk3288_defconfig| 2 --
 configs/firefly-rk3399_defconfig| 1 -
 configs/geekbox_defconfig   | 1 -
 configs/kylin-rk3036_defconfig  | 1 -
 configs/lion-rk3368_defconfig   | 1 -
 configs/miqi-rk3288_defconfig   | 2 --
 configs/phycore-rk3288_defconfig| 2 --
 configs/popmetal-rk3288_defconfig   | 2 --
 configs/puma-rk3399_defconfig   | 1 -
 configs/rock2_defconfig | 2 --
 configs/rock_defconfig  | 1 -
 configs/sandbox_defconfig   | 2 --
 configs/sandbox_flattree_defconfig  | 2 --
 configs/sandbox_noblk_defconfig | 2 --
 configs/sheep-rk3368_defconfig  | 1 -
 configs/tinker-rk3288_defconfig | 2 --
 configs/vyasa-rk3288_defconfig  | 2 --
 27 files changed, 42 deletions(-)

diff --git a/configs/chromebit_mickey_defconfig 
b/configs/chromebit_mickey_defconfig
index 5fbb5a4ebc..2b3e7b409a 100644
--- a/configs/chromebit_mickey_defconfig
+++ b/configs/chromebit_mickey_defconfig
@@ -61,8 +61,6 @@ CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
-# CONFIG_SPL_PINCTRL_FULL is not set
-CONFIG_PINCTRL_ROCKCHIP_RK3288=y
 CONFIG_DM_PMIC=y
 # CONFIG_SPL_PMIC_CHILDREN is not set
 CONFIG_PMIC_RK8XX=y
diff --git a/configs/chromebook_jerry_defconfig 
b/configs/chromebook_jerry_defconfig
index f6f0697050..d8db223e90 100644
--- a/configs/chromebook_jerry_defconfig
+++ b/configs/chromebook_jerry_defconfig
@@ -63,8 +63,6 @@ CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
-# CONFIG_SPL_PINCTRL_FULL is not set
-CONFIG_PINCTRL_ROCKCHIP_RK3288=y
 CONFIG_DM_PMIC=y
 # CONFIG_SPL_PMIC_CHILDREN is not set
 CONFIG_PMIC_RK8XX=y
diff --git a/configs/chromebook_minnie_defconfig 
b/configs/chromebook_minnie_defconfig
index 705a3cd0e5..ee92a22e18 100644
--- a/configs/chromebook_minnie_defconfig
+++ b/configs/chromebook_minnie_defconfig
@@ -62,8 +62,6 @@ CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
-# CONFIG_SPL_PINCTRL_FULL is not set
-CONFIG_PINCTRL_ROCKCHIP_RK3288=y
 CONFIG_DM_PMIC=y
 # CONFIG_SPL_PMIC_CHILDREN is not set
 CONFIG_PMIC_RK8XX=y
diff --git a/configs/evb-px5_defconfig b/configs/evb-px5_defconfig
index c3bda3bf3b..1d428e7ac8 100644
--- a/configs/evb-px5_defconfig
+++ b/configs/evb-px5_defconfig
@@ -22,7 +22,6 @@ CONFIG_CLK=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_PINCTRL=y
-CONFIG_PINCTRL_ROCKCHIP_RK3368=y
 CONFIG_RAM=y
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_DEBUG_UART_ANNOUNCE=y
diff --git a/configs/evb-rk3128_defconfig b/configs/evb-rk3128_defconfig
index 044e60735a..17ad6ae58d 100644
--- a/configs/evb-rk3128_defconfig
+++ b/configs/evb-rk3128_defconfig
@@ -31,7 +31,6 @@ CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_PHY=y
 CONFIG_PINCTRL=y
-CONFIG_PINCTRL_ROCKCHIP_RK3128=y
 CONFIG_REGULATOR_PWM=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_RAM=y
diff --git a/configs/evb-rk3229_defconfig b/configs/evb-rk3229_defconfig
index 0cc92a3314..14ff54af20 100644
--- a/configs/evb-rk3229_defconfig
+++ b/configs/evb-rk3229_defconfig
@@ -44,7 +44,6 @@ CONFIG_ETH_DESIGNWARE=y
 CONFIG_GMAC_ROCKCHIP=y
 CONFIG_PHY=y
 CONFIG_PINCTRL=y
-CONFIG_PINCTRL_ROCKCHIP_RK322X=y
 CONFIG_RAM=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=150
diff --git a/configs/evb-rk3288_defconfig b/configs/evb-rk3288_defconfig
index 1485844aa6..4bf548790c 100644
--- a/configs/evb-rk3288_defconfig
+++ b/configs/evb-rk3288_defconfig
@@ -57,8 +57,6 @@ CONFIG_ETH_DESIGNWARE=y
 CONFIG_GMAC_ROCKCHIP=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
-# CONFIG_SPL_PINCTRL_FULL is not set
-CONFIG_PINCTRL_ROCKCHIP_RK3288=y
 CONFIG_DM_PMIC=y
 CONFIG_PMIC_ACT8846=y
 CONFIG_REGULATOR_ACT8846=y
diff --git a/configs/evb-rk3399_defconfig b/configs/evb-rk3399_defconfig
index 27cf8304be..9746755f1e 100644
--- a/configs/evb-rk3399_defconfig
+++ b/configs/evb-rk3399_defconfig
@@ -49,7 +49,6 @@ CONFIG_ETH_DESIGNWARE=y
 CONFIG_GMAC_ROCKCHIP=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
-CONFIG_PINCTRL_ROCKCHIP_RK3399=y
 CONFIG_DM_PMIC=y
 CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_PWM=y
diff --git a/configs/evb-rv1108_defconfig b/configs/evb-rv1108_defconfig
index 2ef041f2c5..7836a772e2 100644
--- a/configs/evb-rv1108_defconfig
+++ b/configs/evb-rv1108_defconfig
@@ -37,7 +37,6 @@ CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_GMAC_ROCKCHIP=y
 CONFIG_PINCTRL=y
-CONFIG_PINCTRL_ROCKCHIP_RV1108=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_BAUDRATE=150
 # CO

[U-Boot] [PATCH v2 9/9] ARM: dts: rk322x: Correct the uart2 default pin configuration

2019-01-02 Thread David Wu
To match the iomux setting of uart2 at SPL, correct the uart2
default pin configuration, if not changed, the evb-rk3229 can't
output the log message.

Signed-off-by: David Wu 
---

Changes in v2: None

 arch/arm/dts/rk322x.dtsi | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/rk322x.dtsi b/arch/arm/dts/rk322x.dtsi
index be026b0e07..4a8be5dabb 100644
--- a/arch/arm/dts/rk322x.dtsi
+++ b/arch/arm/dts/rk322x.dtsi
@@ -206,7 +206,7 @@
clocks = <&cru SCLK_UART2>, <&cru PCLK_UART2>;
clock-names = "baudclk", "apb_pclk";
pinctrl-names = "default";
-   pinctrl-0 = <&uart2_xfer>;
+   pinctrl-0 = <&uart21_xfer>;
reg-shift = <2>;
reg-io-width = <4>;
status = "disabled";
@@ -748,7 +748,7 @@
 
uart2 {
uart2_xfer: uart2-xfer {
-   rockchip,pins = <1 RK_PC2 RK_FUNC_2 
&pcfg_pull_none>,
+   rockchip,pins = <1 RK_PC2 RK_FUNC_2 
&pcfg_pull_up>,
<1 RK_PC3 RK_FUNC_2 
&pcfg_pull_none>;
};
 
@@ -760,6 +760,13 @@
rockchip,pins = <0 RK_PD0 RK_FUNC_1 
&pcfg_pull_none>;
};
};
+
+   uart2-1 {
+   uart21_xfer: uart21-xfer {
+   rockchip,pins = <1 10 RK_FUNC_2 &pcfg_pull_up>,
+   <1 9 RK_FUNC_2 &pcfg_pull_none>;
+   };
+   };
};
 
dmc: dmc@1120 {
-- 
2.19.1



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


[U-Boot] [PATCH] exynos: allow SPL to build in thumb mode

2019-01-02 Thread Guillaume GARDET
Building peach-pi smdk5420 and peach-pit with thumb mode for SPL
ends-up in the following error:

Error: Thumb encoding does not support an immediate here -- `msr 
cpsr_c,#0x13|0xC0'

Use an intermediate register to be able to use thumb for exynos5 SPL.


Signed-off-by: Guillaume GARDET 

Cc: Albert Aribaud 
Cc: Minkyu Kang 
Cc: Tom Rini 

---
 arch/arm/mach-exynos/include/mach/system.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-exynos/include/mach/system.h 
b/arch/arm/mach-exynos/include/mach/system.h
index 4837781957..81fa9800b4 100644
--- a/arch/arm/mach-exynos/include/mach/system.h
+++ b/arch/arm/mach-exynos/include/mach/system.h
@@ -58,7 +58,8 @@ struct exynos5_sysreg {
 /* Move 0xd3 value to CPSR register to enable SVC mode */
 #define svc32_mode_en() __asm__ __volatile__   \
("@ I&F disable, Mode: 0x13 - SVC\n\t"  \
-"msr cpsr_c, #0x13|0xC0\n\t" : : )
+"mov r0, #0x13|0xC0\n\t"   \
+"msr cpsr_c, r0\n\t" : : )
 
 /* Set program counter with the given value */
 #define set_pc(x) __asm__ __volatile__ ("mov pc, %0\n\t" : : "r"(x))
-- 
2.20.1


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


[U-Boot] Re : Re : Re: please pull u-boot-samsung master

2019-01-02 Thread Guillaume GARDET

Hi,


- Guillaume GARDET  a écrit :
> 
> Hi,
> 
> - Minkyu Kang  a écrit :
> > Dear Guillaume GARDET,
> > 
> > On 28/12/18 00:41, Tom Rini wrote:
> > > On Thu, Dec 27, 2018 at 12:49:53PM +0900, Minkyu Kang wrote:
> > > 
> > >> Dear Tom,
> > >>
> > >> The following changes since commit 
> > >> 1f2e948d6d53f77a2ddb2dde3531b0d5bc2815ad:
> > >>
> > >>   Prepare v2019.01-rc2 (2018-12-17 20:25:24 -0500)
> > >>
> > >> are available in the git repository at:
> > >>
> > >>   git://git.denx.de/u-boot-samsung master
> > >>
> > >> for you to fetch changes up to c96d90367a6a229210b8b16681cfe9e5c8aeced1:
> > >>
> > >>   exynos: imply SYS_THUMB_BUILD (2018-12-26 11:57:48 +0900)
> > >>
> > >> 
> > >> Anand Moon (2):
> > >>   exynos5-dt-types: add missing dtb file for Odroid HC1/HC2
> > >>   odroid: Update README.odroid for support of Odroid HC1
> > >>
> > >> Guillaume GARDET (1):
> > >>   exynos: imply SYS_THUMB_BUILD
> > >>
> > >> Seung-Woo Kim (1):
> > >>   Revert "arm: config: fix default console only to specify the 
> > >> device"
> > >>
> > >>  arch/arm/Kconfig| 1 +
> > >>  doc/README.odroid   | 7 +--
> > >>  include/configs/odroid.h| 4 ++--
> > >>  include/configs/odroid_xu3.h| 5 +++--
> > >>  include/configs/s5p_goni.h  | 4 ++--
> > >>  include/configs/s5pc210_universal.h | 4 ++--
> > >>  include/configs/trats.h | 4 ++--
> > >>  include/configs/trats2.h| 4 ++--
> > >>  8 files changed, 19 insertions(+), 14 deletions(-)
> > > 
> > > NAK:
> > > 18: Merge branch 'master' of git://git.denx.de/u-boot-samsung
> > >arm:  +   peach-pi smdk5420 peach-pit
> > > +(peach-pi,smdk5420,peach-pit) {standard input}: Assembler messages:
> > > +(peach-pi,smdk5420,peach-pit) {standard input}:117: Error: Thumb 
> > > encoding does not support an immediate here -- `msr cpsr_c,#0x13|0xC0'
> > > +(peach-pi,smdk5420,peach-pit) {standard input}:325: Error: Thumb 
> > > encoding does not support an immediate here -- `msr cpsr_c,#0x13|0xC0'
> > > +(peach-pi,smdk5420,peach-pit) make[3]: *** 
> > > [../scripts/Makefile.build:279: spl/arch/arm/mach-exynos/lowlevel_init.o] 
> > > Error 1
> > > +(peach-pi,smdk5420,peach-pit) make[2]: *** [../scripts/Makefile.spl:383: 
> > > spl/arch/arm/mach-exynos] Error 2
> > > +(peach-pi,smdk5420,peach-pit) make[1]: *** [Makefile:1597: 
> > > spl/u-boot-spl] Error 2
> > > +(peach-pi,smdk5420,peach-pit) make: *** [Makefile:148: sub-make] Error 2
> > > 
> > 
> > Because of this, thumb build feature cannot applied.
> > Do you have an idea?
> 
> We should disable thumb explicitly for this board.
> 
> I will not be in front of a computer for the next days, so please wait until 
> 2nd of January, or you can do it, if you want.

Instead of disabling thumb for SPL in 3 default configs, I sent a patch to get 
it built in thumb mode: 
  https://lists.denx.de/pipermail/u-boot/2019-January/353347.html

Build tested on peach-pi peach-pit and smdk5420 configs.

Thanks,
Guillaume


> 
> Thanks,
> Guillaume
>  
> > 
> > Thanks,
> > Minkyu Kang.
> 

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


[U-Boot] [PATCH v4 1/8] rockchip: rk3399-puma: Cleanup of vdd_log DTS entry.

2019-01-02 Thread Christoph Muellner
This patch eliminates the non-standard entries "rockchip,pwm_id"
and "rockchip,pwm_voltage". They are neither documented nor
read out by any driver.

Additionally it introduces the entry regulator-init-microvolt
and sets it to 900 mV, which is the default target value
for VDD_LOG.

Signed-off-by: Christoph Muellner 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/dts/rk3399-puma.dtsi | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/arm/dts/rk3399-puma.dtsi b/arch/arm/dts/rk3399-puma.dtsi
index 9a61fbb453..09f7992f65 100644
--- a/arch/arm/dts/rk3399-puma.dtsi
+++ b/arch/arm/dts/rk3399-puma.dtsi
@@ -172,10 +172,7 @@
regulator-max-microvolt = <140>;
regulator-always-on;
regulator-boot-on;
-
-   /* for rockchip boot on */
-   rockchip,pwm_id= <2>;
-   rockchip,pwm_voltage = <100>;
+   regulator-init-microvolt = <90>;
};
 };
 
-- 
2.11.0

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


[U-Boot] [PATCH v4 2/8] power: regulator: Allow PWM regulator to be omitted from SPL.

2019-01-02 Thread Christoph Muellner
This patch allows to enable the PWM regulator driver
independent for U-Boot and SPL.

Signed-off-by: Christoph Muellner 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/power/regulator/Kconfig  | 7 +++
 drivers/power/regulator/Makefile | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig
index 09b311de8b..3ed0dd2264 100644
--- a/drivers/power/regulator/Kconfig
+++ b/drivers/power/regulator/Kconfig
@@ -61,6 +61,13 @@ config REGULATOR_PWM
This driver is controlled by a device tree node
which includes voltage limits.
 
+config SPL_REGULATOR_PWM
+   bool "Enable Driver for PWM regulators in SPL"
+   depends on REGULATOR_PWM
+   help
+ This config enables implementation of driver-model regulator uclass
+ features for PWM regulators in SPL.
+
 config DM_REGULATOR_MAX77686
bool "Enable Driver Model for REGULATOR MAX77686"
depends on DM_REGULATOR && DM_PMIC_MAX77686
diff --git a/drivers/power/regulator/Makefile b/drivers/power/regulator/Makefile
index 8017045d54..f617ce723a 100644
--- a/drivers/power/regulator/Makefile
+++ b/drivers/power/regulator/Makefile
@@ -9,7 +9,7 @@ obj-$(CONFIG_REGULATOR_ACT8846) += act8846.o
 obj-$(CONFIG_REGULATOR_AS3722) += as3722_regulator.o
 obj-$(CONFIG_DM_REGULATOR_MAX77686) += max77686.o
 obj-$(CONFIG_$(SPL_)DM_PMIC_PFUZE100) += pfuze100.o
-obj-$(CONFIG_REGULATOR_PWM) += pwm_regulator.o
+obj-$(CONFIG_$(SPL_)REGULATOR_PWM) += pwm_regulator.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_FAN53555) += fan53555.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_FIXED) += fixed.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_GPIO) += gpio-regulator.o
-- 
2.11.0

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


[U-Boot] [PATCH v4 3/8] rockchip: rk3399-puma: enable PWM regulator in Puma defconfig.

2019-01-02 Thread Christoph Muellner
This patch enables the PWM regulator driver in the defconfig
for the RK3399-Q7.

Signed-off-by: Christoph Muellner 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 configs/puma-rk3399_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
index a45a34be31..1afa5a75f9 100644
--- a/configs/puma-rk3399_defconfig
+++ b/configs/puma-rk3399_defconfig
@@ -79,6 +79,7 @@ CONFIG_DM_PMIC=y
 CONFIG_DM_PMIC_FAN53555=y
 CONFIG_PMIC_RK8XX=y
 CONFIG_SPL_DM_REGULATOR=y
+CONFIG_REGULATOR_PWM=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_SPL_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
-- 
2.11.0

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


[U-Boot] [PATCH v4 5/8] rockchip: rk3399: Add improved pinctrl driver.

2019-01-02 Thread Christoph Muellner
The current pinctrl driver for the RK3399 has a range of qulity issues.
E.g. it only implements the .set_state_simple() callback, it
does not parse the available pinctrl information from the DTS
(instead uses hardcoded values), is not flexible enough to cover
devices without 'interrupt' field in the DTS (e.g. PWM),
is not written generic enough to make code reusable among other
rockchip SoCs...

This patch addresses these issues by reimplementing the whole driver
from scratch using the .set_state() callback.
The new implementation covers all featurese of the old code
(i.e. it supports pinmuxing and pullup/pulldown configuration).

This patch has been tested on a RK3399-Q7 SoM (Puma).

Signed-off-by: Christoph Muellner 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/pinctrl/rockchip/pinctrl_rk3399.c | 227 ++
 1 file changed, 227 insertions(+)

diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3399.c 
b/drivers/pinctrl/rockchip/pinctrl_rk3399.c
index bc92dd7c06..a1d5e8d0d5 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rk3399.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rk3399.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ * (C) 2018 Theobroma Systems Design und Consulting GmbH
  */
 
 #include 
@@ -14,11 +15,235 @@
 #include 
 #include 
 
+static const u32 RK_GRF_P_PULLUP = 1;
+static const u32 RK_GRF_P_PULLDOWN = 2;
+
 struct rk3399_pinctrl_priv {
struct rk3399_grf_regs *grf;
struct rk3399_pmugrf_regs *pmugrf;
+   struct rockchip_pin_bank *banks;
+};
+
+/* Location of pinctrl/pinconf registers. */
+enum rk_grf_location {
+   RK_GRF,
+   RK_PMUGRF,
+};
+
+/**
+ * @nr_pins: number of pins in this bank
+ * @grf_location: location of pinctrl/pinconf registers
+ * @bank_num: number of the bank, to account for holes
+ * @iomux: array describing the 4 iomux sources of the bank
+ */
+struct rockchip_pin_bank {
+   u8 nr_pins;
+   enum rk_grf_location grf_location;
+   size_t iomux_offset;
+   size_t pupd_offset;
+};
+
+#define PIN_BANK(pins, grf, iomux, pupd)   \
+   {   \
+   .nr_pins = pins,\
+   .grf_location = grf,\
+   .iomux_offset = iomux,  \
+   .pupd_offset = pupd,\
+   }
+
+static struct rockchip_pin_bank rk3399_pin_banks[] = {
+   PIN_BANK(16, RK_PMUGRF,
+offsetof(struct rk3399_pmugrf_regs, gpio0a_iomux),
+offsetof(struct rk3399_pmugrf_regs, gpio0_p)),
+   PIN_BANK(32, RK_PMUGRF,
+offsetof(struct rk3399_pmugrf_regs, gpio1a_iomux),
+offsetof(struct rk3399_pmugrf_regs, gpio1_p)),
+   PIN_BANK(32, RK_GRF,
+offsetof(struct rk3399_grf_regs, gpio2a_iomux),
+offsetof(struct rk3399_grf_regs, gpio2_p)),
+   PIN_BANK(32, RK_GRF,
+offsetof(struct rk3399_grf_regs, gpio3a_iomux),
+offsetof(struct rk3399_grf_regs, gpio3_p)),
+   PIN_BANK(32, RK_GRF,
+offsetof(struct rk3399_grf_regs, gpio4a_iomux),
+offsetof(struct rk3399_grf_regs, gpio4_p)),
 };
 
+static void rk_pinctrl_get_info(uintptr_t base, u32 index, uintptr_t *addr,
+   u32 *shift, u32 *mask)
+{
+   /*
+* In general we four subsequent 32-bit configuration registers
+* per bank (e.g. GPIO2A_P, GPIO2B_P, GPIO2C_P, GPIO2D_P).
+* The configuration for each pin has two bits.
+*
+* @base...contains the address to the first register.
+* @index...defines the pin within the bank (0..31).
+* @addr...will be the address of the actual register to use
+* @shift...will be the bit position in the configuration register
+* @mask...will be the (unshifted) mask
+*/
+
+   const u32 pins_per_register = 8;
+   const u32 config_bits_per_pin = 2;
+
+   /* Get the address of the configuration register. */
+   *addr = base + (index / pins_per_register) * sizeof(u32);
+
+   /* Get the bit offset within the configuration register. */
+   *shift = (index & (pins_per_register - 1)) * config_bits_per_pin;
+
+   /* Get the (unshifted) mask for the configuration pins. */
+   *mask = ((1 << config_bits_per_pin) - 1);
+
+   pr_debug("%s: addr=0x%lx, mask=0x%x, shift=0x%x\n",
+__func__, *addr, *mask, *shift);
+}
+
+static void rk3399_pinctrl_set_pin_iomux(uintptr_t grf_addr,
+struct rockchip_pin_bank *bank,
+u32 index, u32 muxval)
+{
+   uintptr_t iomux_base, addr;
+   u32 shift, mask;
+
+   iomux_base = grf_addr + bank->iomux_offset;
+   rk_pinctrl_get_info(iomux_base, index, &addr, &shift, &mask);
+
+   /* Set 

[U-Boot] [PATCH v4 4/8] dm: pinctrl: Add pinctrl_decode_pin_config_dm().

2019-01-02 Thread Christoph Muellner
pinctrl_decode_pin_config_dm() is basically a feature-equivalent
implementation of pinctrl_decode_pin_config(), which operates
on struct udevice devices and uses the dev_read_*() API.

Signed-off-by: Christoph Muellner 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/pinctrl/pinctrl-uclass.c | 22 ++
 include/dm/pinctrl.h | 12 
 2 files changed, 34 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c
index 29c910c55f..c8b38d78f6 100644
--- a/drivers/pinctrl/pinctrl-uclass.c
+++ b/drivers/pinctrl/pinctrl-uclass.c
@@ -27,6 +27,28 @@ int pinctrl_decode_pin_config(const void *blob, int node)
return flags;
 }
 
+/*
+ * TODO: this function is temporary for v2019.01.
+ * It should be renamed to pinctrl_decode_pin_config(),
+ * the original pinctrl_decode_pin_config() function should
+ * be removed and all callers of the original function should
+ * be migrated to use the new one.
+ */
+int pinctrl_decode_pin_config_dm(struct udevice *dev)
+{
+   int pinconfig = 0;
+
+   if (dev->uclass->uc_drv->id != UCLASS_PINCONFIG)
+   return -EINVAL;
+
+   if (dev_read_bool(dev, "bias-pull-up"))
+   pinconfig |= 1 << PIN_CONFIG_BIAS_PULL_UP;
+   else if (dev_read_bool(dev, "bias-pull-down"))
+   pinconfig |= 1 << PIN_CONFIG_BIAS_PULL_DOWN;
+
+   return pinconfig;
+}
+
 #if CONFIG_IS_ENABLED(PINCTRL_FULL)
 /**
  * pinctrl_config_one() - apply pinctrl settings for a single node
diff --git a/include/dm/pinctrl.h b/include/dm/pinctrl.h
index 63a7d55b88..ff2b82e7c2 100644
--- a/include/dm/pinctrl.h
+++ b/include/dm/pinctrl.h
@@ -355,6 +355,18 @@ int pinctrl_get_periph_id(struct udevice *dev, struct 
udevice *periph);
 int pinctrl_decode_pin_config(const void *blob, int node);
 
 /**
+ * pinctrl_decode_pin_config_dm() - decode pin configuration flags
+ *
+ * This decodes some of the PIN_CONFIG values into flags, with each value
+ * being (1 << pin_cfg). This does not support things with values like the
+ * slew rate.
+ *
+ * @pinconfig: Pinconfig udevice
+ * @return decoded flag value, or -ve on error
+ */
+int pinctrl_decode_pin_config_dm(struct udevice *dev);
+
+/**
  * pinctrl_get_gpio_mux() - get the mux value for a particular GPIO
  *
  * This allows the raw mux value for a GPIO to be obtained. It is
-- 
2.11.0

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


[U-Boot] [PATCH v4 6/8] rockchip: rk3399: Add Kconfig option for full pinctrl driver

2019-01-02 Thread Christoph Muellner
This patch adds a Kconfig option to enable the full pinctrl driver
for the RK3399. This flag needs to be enabed in order to get the
features of the full pinctrl driver compiled in (i.e. a .set_state()
callback).

Signed-off-by: Christoph Muellner 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/pinctrl/Kconfig   | 10 ++
 drivers/pinctrl/rockchip/pinctrl_rk3399.c |  9 +
 2 files changed, 19 insertions(+)

diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index 1dbe2b104b..30a6aa6ee8 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -238,6 +238,16 @@ config PINCTRL_ROCKCHIP_RK3399
  the GPIO definitions and pin control functions for each available
  multiplex function.
 
+config PINCTRL_ROCKCHIP_RK3399_FULL
+   bool "Rockchip rk3399 pin control driver (full)"
+   depends on PINCTRL_FULL && PINCTRL_ROCKCHIP_RK3399
+   help
+ Support full pin multiplexing control on Rockchip rk3399 SoCs.
+
+ This enables the full pinctrl driver for the RK3399.
+ Contrary to the non-full pinctrl driver, this will evaluate
+ the board DTB to get the pinctrl settings.
+
 config PINCTRL_ROCKCHIP_RV1108
bool "Rockchip rv1108 pin control driver"
depends on DM
diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3399.c 
b/drivers/pinctrl/rockchip/pinctrl_rk3399.c
index a1d5e8d0d5..c4746b0122 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rk3399.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rk3399.c
@@ -15,8 +15,10 @@
 #include 
 #include 
 
+#if CONFIG_IS_ENABLED(PINCTRL_ROCKCHIP_RK3399_FULL)
 static const u32 RK_GRF_P_PULLUP = 1;
 static const u32 RK_GRF_P_PULLDOWN = 2;
+#endif /* PINCTRL_ROCKCHIP_RK3399_FULL */
 
 struct rk3399_pinctrl_priv {
struct rk3399_grf_regs *grf;
@@ -24,6 +26,7 @@ struct rk3399_pinctrl_priv {
struct rockchip_pin_bank *banks;
 };
 
+#if CONFIG_IS_ENABLED(PINCTRL_ROCKCHIP_RK3399_FULL)
 /* Location of pinctrl/pinconf registers. */
 enum rk_grf_location {
RK_GRF,
@@ -244,6 +247,8 @@ end:
return ret;
 }
 
+#endif /* PINCTRL_ROCKCHIP_RK3399_FULL */
+
 static void pinctrl_rk3399_pwm_config(struct rk3399_grf_regs *grf,
struct rk3399_pmugrf_regs *pmugrf, int pwm_id)
 {
@@ -693,7 +698,9 @@ static int rk3399_pinctrl_set_state_simple(struct udevice 
*dev,
 }
 
 static struct pinctrl_ops rk3399_pinctrl_ops = {
+#if CONFIG_IS_ENABLED(PINCTRL_ROCKCHIP_RK3399_FULL)
.set_state  = rk3399_pinctrl_set_state,
+#endif
.set_state_simple   = rk3399_pinctrl_set_state_simple,
.request= rk3399_pinctrl_request,
.get_periph_id  = rk3399_pinctrl_get_periph_id,
@@ -707,7 +714,9 @@ static int rk3399_pinctrl_probe(struct udevice *dev)
priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF);
debug("%s: grf=%p, pmugrf=%p\n", __func__, priv->grf, priv->pmugrf);
+#if CONFIG_IS_ENABLED(PINCTRL_ROCKCHIP_RK3399_FULL)
priv->banks = rk3399_pin_banks;
+#endif /* PINCTRL_ROCKCHIP_RK3399_FULL */
 
return ret;
 }
-- 
2.11.0

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


[U-Boot] [PATCH v4 7/8] rockchip: rk3399-puma: enable full pinctrl driver in Puma defconfig.

2019-01-02 Thread Christoph Muellner
This patch enables the full pinctrl driver in the defconfig
for the RK3399-Q7.

Signed-off-by: Christoph Muellner 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 configs/puma-rk3399_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
index 1afa5a75f9..3c293b69e4 100644
--- a/configs/puma-rk3399_defconfig
+++ b/configs/puma-rk3399_defconfig
@@ -75,6 +75,7 @@ CONFIG_GMAC_ROCKCHIP=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_ROCKCHIP_RK3399=y
+CONFIG_PINCTRL_ROCKCHIP_RK3399_FULL=y
 CONFIG_DM_PMIC=y
 CONFIG_DM_PMIC_FAN53555=y
 CONFIG_PMIC_RK8XX=y
-- 
2.11.0

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


[U-Boot] [PATCH v4 0/8] rk3399-puma: Enable PWM regulator for RK3399-Q7

2019-01-02 Thread Christoph Muellner
This patch series allows to tune VDD_LOG on RK3399-Q7 Puma boards
to a voltage level defined in the DTS using a PWM adjustable regulator.

To do so a reimplemenation of the RK3399 pinctrl driver has been done.
Although the new pinctrl driver is written in a way, that we could
merge it with other rockchip pinctrl drivers, this is not part
of this series.

The effect of the series is, that VDD_LOG will be set to about 950 mV
on Puma. This is required to address stability issues on Puma.
As a side effect, the pinctrl settings of all RK3399 boards will
be configured according to the description in the DTS.

Changes in v4:
 - Changed patches according to review feedback.

Changes in v3:
 - Fix message verbosity in pinctrl driver.
 - Changed patches according to review feedback.
 - Add patch to enable the full pinctrl driver only for Puma boards.

Changes in v2:
 - Changed patches according to review feedback.
 - Fix pinctrl infrastructure instead of hacking board_init() code.

Christoph Muellner (8):
  rockchip: rk3399-puma: Cleanup of vdd_log DTS entry.
  power: regulator: Allow PWM regulator to be omitted from SPL.
  rockchip: rk3399-puma: enable PWM regulator in Puma defconfig.
  dm: pinctrl: Add pinctrl_decode_pin_config_dm().
  rockchip: rk3399: Add improved pinctrl driver.
  rockchip: rk3399: Add Kconfig option for full pinctrl driver
  rockchip: rk3399-puma: enable full pinctrl driver in Puma defconfig.
  rockchip: rk3399-puma: Set VDD_LOG to 950 mV.

 arch/arm/dts/rk3399-puma.dtsi |   5 +-
 configs/puma-rk3399_defconfig |   2 +
 drivers/pinctrl/Kconfig   |  10 ++
 drivers/pinctrl/pinctrl-uclass.c  |  22 +++
 drivers/pinctrl/rockchip/pinctrl_rk3399.c | 236 ++
 drivers/power/regulator/Kconfig   |   7 +
 drivers/power/regulator/Makefile  |   2 +-
 include/dm/pinctrl.h  |  12 ++
 8 files changed, 291 insertions(+), 5 deletions(-)

-- 
2.11.0

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


[U-Boot] [PATCH v4 8/8] rockchip: rk3399-puma: Set VDD_LOG to 950 mV.

2019-01-02 Thread Christoph Muellner
This patch sets VDD_LOG to 950 mV on RK3399-Q7.
This is required to address stability issues on Puma
in heavy-load use-cases.

Reported-by: Assaf Agmon 
Signed-off-by: Philipp Tomsich 
Signed-off-by: Christoph Muellner 

---

Changes in v4:
 - Changed patches according to review feedback.

Changes in v3:
 - Fix message verbosity in pinctrl driver.
 - Changed patches according to review feedback.
 - Add patch to enable the full pinctrl driver only for Puma boards.

Changes in v2:
 - Changed patches according to review feedback.
 - Fix pinctrl infrastructure instead of hacking board_init() code.

 arch/arm/dts/rk3399-puma.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/dts/rk3399-puma.dtsi b/arch/arm/dts/rk3399-puma.dtsi
index 09f7992f65..8304f67192 100644
--- a/arch/arm/dts/rk3399-puma.dtsi
+++ b/arch/arm/dts/rk3399-puma.dtsi
@@ -172,7 +172,7 @@
regulator-max-microvolt = <140>;
regulator-always-on;
regulator-boot-on;
-   regulator-init-microvolt = <90>;
+   regulator-init-microvolt = <95>;
};
 };
 
-- 
2.11.0

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


Re: [U-Boot] [PATCH v1 01/14] tpc70: config: Add script commands to update u-boot and OE's wic

2019-01-02 Thread Marek Vasut
On 1/2/19 10:50 AM, Lukasz Majewski wrote:
> Hi Marek,
> 
>> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
>>> Signed-off-by: Lukasz Majewski   
>>
>> The tags should be ARM: imx: ...
>>
>> The commit message is missing.
>>
>>> ---
>>>
>>>  include/configs/kp_imx6q_tpc.h | 21 +
>>>  1 file changed, 21 insertions(+)
>>>
>>> diff --git a/include/configs/kp_imx6q_tpc.h
>>> b/include/configs/kp_imx6q_tpc.h index b6b27ee1d5..ee9c56bc21 100644
>>> --- a/include/configs/kp_imx6q_tpc.h
>>> +++ b/include/configs/kp_imx6q_tpc.h
>>> @@ -89,11 +89,32 @@
>>> "rdinit=/sbin/init\0" \
>>> "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit}
>>> ${debug} \0" \ "fit_config=mx6q_tpc70_conf\0" \
>>> +   "uboot_file=u-boot.img\0" \
>>> +   "SPL_file=SPL\0" \
>>> +   "wic_file=kp-image-kpimx6qtpc.wic\0" \  
>>
>> Why don't you just generate a fitImage and use the fitupd for this ?
> 
> This is one of possible solutions - yes.

It's the only solution if you want to prevent SPL and U-Boot from being
out of sync.

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


Re: [U-Boot] [PATCH v1 04/14] DTS: imx: Remove not needed '#address-cells' and '#size-cells' properties

2019-01-02 Thread Marek Vasut
On 1/2/19 10:43 AM, Lukasz Majewski wrote:
> Hi Marek,
> 
>> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
>>> This commit fixes warnings produced by newest in u-boot DTC
>>> compiler: 'unnecessary #address-cells/#size-cells without "ranges"
>>> or child "reg" property'
>>>
>>> Signed-off-by: Lukasz Majewski   
>>
>> I presume the DTSIs are taken from Linux, is this a backport from
>> Linux then ?
> 
> Regarding Linux - with Version: DTC 1.4.7-gc86da84d and make W=1 I do
> not see those warnings as in  scripts/Makefile.lib :
> 
> # Disable noisy checks by default
> ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)
> DTC_FLAGS += -Wno-unit_address_vs_reg \
> -Wno-unit_address_format \
> -Wno-avoid_unnecessary_addr_size \
> 
> those warnings are disabled (-Wno-avoid_unnecessary_addr_size).
> 
> On the other hand - in u-boot those warnings are checked (maybe are
> necessary for OF_PLATDATA correct operation?).

No, keep the DTs synced and fix things upstream (in Linux) if needed,
then backport the fixes.

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


Re: [U-Boot] [PATCH v1 02/14] tpc70: config: Update TPC70 config to support eMMC's boot0 SPL update

2019-01-02 Thread Marek Vasut
On 1/2/19 10:47 AM, Lukasz Majewski wrote:
> Hi Marek,
> 
>> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
>>> The TPC70 can boot from eMMC's boot0. This patch allows it to update
>>> this HW partition's SPL.
>>>
>>> Signed-off-by: Lukasz Majewski 
>>> ---
>>>
>>>  include/configs/kp_imx6q_tpc.h | 5 +
>>>  1 file changed, 5 insertions(+)
>>>
>>> diff --git a/include/configs/kp_imx6q_tpc.h
>>> b/include/configs/kp_imx6q_tpc.h index ee9c56bc21..f26b18442b 100644
>>> --- a/include/configs/kp_imx6q_tpc.h
>>> +++ b/include/configs/kp_imx6q_tpc.h
>>> @@ -49,6 +49,7 @@
>>>  #define CONFIG_SYS_FSL_ESDHC_ADDR  0
>>>  #define CONFIG_SYS_FSL_USDHC_NUM   2
>>>  #define CONFIG_SYS_MMC_ENV_DEV 1 /* 0 = SDHC2, 1 =
>>> SDHC4 (eMMC) */ +#define CONFIG_SUPPORT_EMMC_BOOT
>>>  
>>>  /* UART */
>>>  #define CONFIG_MXC_UART
>>> @@ -109,6 +110,10 @@
>>>"setexpr blkc ${blkc} + 1;" \
>>>"mmc write ${loadaddr} 0x2 ${blkc};" \
>>> "fi;\0" \
>>> +   "upd_SPL_mmc=mmc dev 1; mmc partconf 1 0 1 1; run
>>> upd_SPL_sd\0" \  
>>
>> If mmc dev 1 fails, this will randomly rewrite or even damage some
>> SD/MMC card that was selected before
>> . Use && ...
> 
> Ok - good point.
> 
>>
>>> +   "upd_uboot_mmc=mmc dev 1; mmc partconf 1 0 1 1; run
>>> upd_uboot_sd\0" \  
>>
>> Deduplicate these repeated commands.
> 
> Could you be more specific here? 
> 
> Without mmc dev 1 and partconf I cannot access boot0 eMMC area. 
> This particular board has the SD as mmc0 (rescue/devel) and eMMC as
> mmc1 (and eMMC is a production boot medium).

The same commands are called from multiple scripts.

>>> +   "up_mmc=run upd_SPL_mmc; run upd_uboot_mmc\0" \
>>> +   "up_sd=run upd_SPL_sd; run upd_uboot_sd\0" \
>>> "upd_wic=" \
>>> "if tftp ${loadaddr} ${wic_file}; then " \
>>>"setexpr blkc ${filesize} / 0x200;" \
>>>   
>>
>>
> 
> 
> 
> 
> 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
> 


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


Re: [U-Boot] [PATCH v1 07/14] pinctrl: imx: Replace static soc info definitions with run time allocations

2019-01-02 Thread Marek Vasut
On 1/2/19 9:26 AM, Lukasz Majewski wrote:
> Hi Marek,
> 
>> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
>>> This commit is necessary to be able to re-use the pinctrl code in
>>> early SPL to properly configure pins.
>>>
>>> The problem is that those "static" structures are placed in the
>>> SDRAM area, which corresponds to u-boot proper (not even SPL).
>>> Hence, when one wants to configure pins before relocation via
>>> DTS/DM, the board hangs (imx6q SoC powered one) as only OCRAM area
>>> is available (0x009x).
>>>
>>> It is also safe to use calloc in this case, as the early SPL code
>>> provides it - either full or trimmed version. The allocated memory
>>> is also correct in respect to the memory area in which the SoC is
>>> currently running (OCRAM vs. SDRAM).  
>>
>> You should be able to access static data in early environment, many
>> other drivers have no problem with it. 
> 
> Have you used pinctrl IMX6Q driver with early DM at SPL?
> 
>> I believe there is some more
>> fundamental problem that needs to be fixed, 
> 
> With the current code - which was not used in OCRAM only available
> memory - the statics are placed in the SDRAM area (0x178x ).
> 
> Instead of changing linker script (and validate it for all drivers and
> boards for SPL and u-boot proper) - the code has been rewritten to use
> malloc (which is available in the early code - either full blown or
> simple version).
> 
>> hacking around it like
>> this is just hiding the real issue.
> 
> The real issue is that IMX6Q uses SDRAM memory for statics/globals from
> the very beginning.
Fix it ? What you're implying here is that rodata (preinitialized static
variables) are misplaced.

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


Re: [U-Boot] [PATCH v1 05/14] board: cosmetic: Use define to set ENET clock selection mask on TPC70

2019-01-02 Thread Marek Vasut
On 1/2/19 11:06 AM, Lukasz Majewski wrote:
> Hi Marek,
> 
>> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
>>> This is a cosmetic change, just to use proper define.
>>>
>>> Signed-off-by: Lukasz Majewski   
>>
>> The subject tags are wrong, fix globally.
> 
> Is there any doc which describes the allowed/not allowed tags (either
> with Linux or U-boot)? 

I am not aware of one, however you can write one if you feel inclined to
do so.

> From my experience it is a some kind of a convention depending on the
> maintainer (which helps him to spot relevant patches on ML).

Right, and this is ARM imx board, hence those tags should be included.

> In [1] - point 14) there is:
> The canonical patch subject line is:
> "Subject: [PATCH 001/123] subsystem: summary phrase"
> 
> and the "subsystem: " is the tag. 
> 
> In the case of this patch -> I do fix stuff in "board(s)" which is
> "cosmetic".
> 
> Or will we only stick to tags/mails from ./doc/git-mailrc ?
> 
> [1] -
> https://www.kernel.org/doc/html/v4.17/process/submitting-patches.html

[...]

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


Re: [U-Boot] [PATCH v1 10/14] imx: clock: Introduce set_fec_clock() to configure ETH clock (imx6)

2019-01-02 Thread Marek Vasut
On 1/2/19 10:00 AM, Lukasz Majewski wrote:
> Hi Marek,
> 
>> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
>>> This patch provides a generic way to setup ENET (ETH) clocks for
>>> imx6(q) based boards. Previously this was performed per board in the
>>> board_eth_init() function.
>>>
>>> Signed-off-by: Lukasz Majewski 
>>> ---
>>>
>>>  arch/arm/include/asm/arch-mx6/clock.h |  1 +
>>>  arch/arm/mach-imx/mx6/clock.c | 17 +
>>>  2 files changed, 18 insertions(+)
>>>
>>> diff --git a/arch/arm/include/asm/arch-mx6/clock.h
>>> b/arch/arm/include/asm/arch-mx6/clock.h index
>>> a9481a5fea..9a217349f5 100644 ---
>>> a/arch/arm/include/asm/arch-mx6/clock.h +++
>>> b/arch/arm/include/asm/arch-mx6/clock.h @@ -72,6 +72,7 @@ int
>>> enable_i2c_clk(unsigned char enable, unsigned i2c_num); int
>>> enable_spi_clk(unsigned char enable, unsigned spi_num); void
>>> enable_ipu_clock(void); int enable_fec_anatop_clock(int fec_id,
>>> enum enet_freq freq); +int set_fec_clock(int fec_id, enum enet_freq
>>> freq); void enable_enet_clk(unsigned char enable);
>>>  int enable_lcdif_clock(u32 base_addr, bool enable);
>>>  void enable_qspi_clk(int qspi_num);
>>> diff --git a/arch/arm/mach-imx/mx6/clock.c
>>> b/arch/arm/mach-imx/mx6/clock.c index 366a4e3c6b..8a4fb23090 100644
>>> --- a/arch/arm/mach-imx/mx6/clock.c
>>> +++ b/arch/arm/mach-imx/mx6/clock.c
>>> @@ -902,6 +902,17 @@ void enable_qspi_clk(int qspi_num)
>>>  #endif
>>>  
>>>  #ifdef CONFIG_FEC_MXC
>>> +static void select_fec_clock_source(int fec_id)  
>>
>> How is the fec_id() used in here ?
> 
> I guess that you refer to "int fec_id."

Yes, how is it used ? I guess it is not ... so why is this parameter
even here ?

>> Shouldn't this be part of
>> enable_fec_anatop_clock() ?
> 
> The enable_fec_anatop_clock() function is used on several board files
> - for example:
> http://git.denx.de/?p=u-boot.git;a=blob;f=board/dhelectronics/dh_imx6/dh_imx6.c;h=f9ac5c10e1dc954b64605a1c4f84a6c819d183a7;hb=HEAD#l154
> 
> And changing it could break some boards.
> 
> The select_fec_clock_source() shall be used to replace several:
>   clrsetbits_le32(&iomuxc_regs->gpr[1], 0x1 << 21, 0x1 << 21);
> 
> clauses for imx6 variants.
> 
> Moreover, I'd pass 'fec_id' parameter anyway - it may be needed by other
> imx6 variants.
It can be added when it is needed.

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


Re: [U-Boot] [PATCH v1 13/14] DTS: imx: tpc70: Add TPC70 board (imx6q based) device tree description

2019-01-02 Thread Marek Vasut
On 1/2/19 9:49 AM, Lukasz Majewski wrote:
> Hi Marek,
> 
>> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
>>> This commit defines the TPC70 imx6q board with device tree
>>> description.
>>>
>>> Signed-off-by: Lukasz Majewski   
>>
>> Is this pulled from Linux ?
> 
> Yes, it is - the DTS code corresponds to v4.20

This should be in the commit message, including the commit hash of the
commit from which this was taken.

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


Re: [U-Boot] [PATCH 1/1] cmd: usb: display bus number

2019-01-02 Thread Marek Vasut
On 1/2/19 12:29 PM, Heinrich Schuchardt wrote:
> If multiple USB buses exist, the output of the commands 'usb tree' and 'usb
> info' is confusing because it is not clear where the output for a new bus
> starts.
> 
> Print an additional line for each bus indicating the bus number, e.g.
> 
> => usb tree
> USB device tree:
> USB bus 0
>   1  Hub (5 Gb/s, 0mA)
>  U-Boot XHCI Host Controller
> 
> USB bus 1
>   1  Hub (5 Gb/s, 0mA)
>  U-Boot XHCI Host Controller
> 
> Signed-off-by: Heinrich Schuchardt 
> ---
>  cmd/usb.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/cmd/usb.c b/cmd/usb.c
> index 0ccb1b5148..6da945c376 100644
> --- a/cmd/usb.c
> +++ b/cmd/usb.c
> @@ -470,6 +470,7 @@ static void usb_for_each_root_dev(usb_dev_func_t func)
>   if (!device_active(bus))
>   continue;
>  
> + printf("USB bus %d\n", bus->seq);

Isn't this only valid if you use SEQ_ALIAS ?

>   device_find_first_child(bus, &dev);
>   if (dev && device_active(dev)) {
>   udev = dev_get_parent_priv(dev);
> 


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


Re: [U-Boot] [PATCH v1 09/14] imx: serial: dm: Enable DM_FLAG_PRE_RELOC in the IMX uart driver

2019-01-02 Thread Marek Vasut
On 1/2/19 9:42 AM, Lukasz Majewski wrote:
> Hi Marek,
> 
>> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
>>> The DM_FLAG_PRE_RELOC shall be enabled as this driver is going to be
>>> re-used in the i.MX based SoCs.
>>>
>>> It is crucial to have running the serial console before
>>> relocation.  
>>
>> But the patch doesn't do what the subject/commit message claims is
>> does. If I understand it correctly, it sets the PRE_RELOC flag
>> unconditionally.
> 
> The !CONFIG_IS_ENABLED(OF_CONTROL) [*] was set as a "workaround" for DM
> problem:
> SHA1: 4687919684e0e4390b9fc20d1809ecaa9dc3cb81
> 
> Let's look on this check [*] - we add this flag if the board doesn't
> support OF_CONTROL. This is a bit strange as the serial_mxc.c can be
> used with CONFIG_DM_SERIAL but without corresponding device tree
> description (OF_CONTROL).
> 
> Other boards/SoCs have this flag set unconditionally.
> 
> And one more remark - with OF_CONTROL one needs to declare
> 'u-boot,dm-pre-reloc;' property in DTS to have the device probed in the
> SPL's pre relocation stage.

Explain it in the patch description and send V2.

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


Re: [U-Boot] [PATCH 6/6] ARM: socfpga: Synchronize the configuration for A10 SoCDK

2019-01-02 Thread Marek Vasut
On 1/2/19 9:50 AM, Chee, Tien Fong wrote:
> On Tue, 2019-01-01 at 21:35 +0100, Marek Vasut wrote:
>> On 1/1/19 4:51 AM, Chee, Tien Fong wrote:
>>>
>>> On Sun, 2018-12-30 at 16:54 +0100, Marek Vasut wrote:

 On 12/30/18 9:13 AM, tien.fong.c...@intel.com wrote:
>
>
> From: Marek Vasut 
>
> Update the default configuration file to enable the necessary
> functionality
> the get the kit working. That includes SPL SD/MMC support, USB,
> and
> I2C.
>
> Signed-off-by: Marek Vasut 
> Signed-off-by: Tien Fong Chee 
 Is this patch needed ? Why ? This enables a whole lot of stuff
 
>>> These settings are mostly syn up from gen5 and our own downstream
>>> A10.
>>> These settings are mostly required to boot U-Boot and supporting
>>> A10
>>> golden system reference design.
>> Hmmm, mind you, all the MTD and SPI stuff is not needed for the SDMMC
>> configuration of the kit, which this patch would imply is the target.
>> You want to split this into smaller config changes which enable
>> logical
>> blocks, not everything at once, and document why is each thing
>> needed.
> I can keep them minimal, enable them when required in separate patch.

Please do

>>
>>>

>
>
> ---
>  configs/socfpga_arria10_defconfig |   38
> +++-
>  1 files changed, 32 insertions(+), 6 deletions(-)
>
> diff --git a/configs/socfpga_arria10_defconfig
> b/configs/socfpga_arria10_defconfig
> index 8158dbb..4b93321 100644
> --- a/configs/socfpga_arria10_defconfig
> +++ b/configs/socfpga_arria10_defconfig
> @@ -1,7 +1,7 @@
>  CONFIG_ARM=y
>  CONFIG_ARCH_SOCFPGA=y
>  CONFIG_SYS_TEXT_BASE=0x0140
> -CONFIG_SYS_MALLOC_F_LEN=0x2000
> +CONFIG_SYS_MALLOC_F_LEN=0x8000
>> Why is this increase in malloc area needed ?
> This is set in the arria10_sdmmc_next, i guess you need this value for
> your use case? I can revert it if it is no longer required.

I mean, you're sending a patch, I'd expect you know what it does ? :-)

[...]

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


Re: [U-Boot] [PATCH v1 12/14] imx: mmc: Use 'fsl, usdhc-index' property to provide esdhc controller number

2019-01-02 Thread Marek Vasut
On 1/2/19 11:31 AM, Lukasz Majewski wrote:
> On Wed, 2 Jan 2019 02:18:58 +0100
> Marek Vasut  wrote:
> 
>> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
>>> With the current code, it is not possible to assign different than
>>> default numbers for mmc controllers.
>>>
>>> Several in-tree boards depend on the pre-dm setup, corresponding to
>>> following aliases:
>>>
>>> mmc0 = &usdhc2; --> fsl,usdhc-index = <1>
>>> mmc1 = &usdhc4; --> fsl,usdhc-index = <3>
>>>
>>> Without this patch we are either forced to use default aliasing -
>>> like:
>>>
>>> mmc0 = &usdhc1;
>>> mmc1 = &usdhc2;
>>> mmc2 = &usdhc3;
>>> mmc3 = &usdhc4;
>>>
>>> to have the proper clocks setup for the controller. However, such
>>> setup is not acceptable for some legacy scripts / code.
>>>
>>> With this patch - by introducing 'fsl,usdhc-index' - one can
>>> configure (get) clock rate corresponding to used controller.
>>>
>>> Moreover, as this code is used in the SPL before relocation (and to
>>> save space we strip the SPL DTS from clocks and its names) adding
>>> separate properties seems to be the best approach here. One also
>>> avoids adding clocks DM code to SPL.
>>>
>>> Signed-off-by: Lukasz Majewski 
>>> ---
>>>
>>>  drivers/mmc/fsl_esdhc.c | 17 -
>>>  1 file changed, 16 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
>>> index 3cdfa7f5a6..49a6834a98 100644
>>> --- a/drivers/mmc/fsl_esdhc.c
>>> +++ b/drivers/mmc/fsl_esdhc.c
>>> @@ -1401,6 +1401,7 @@ static int fsl_esdhc_probe(struct udevice
>>> *dev) fdt_addr_t addr;
>>> unsigned int val;
>>> struct mmc *mmc;
>>> +   int usdhc_idx;
>>> int ret;
>>>  
>>> addr = dev_read_addr(dev);
>>> @@ -1513,7 +1514,21 @@ static int fsl_esdhc_probe(struct udevice
>>> *dev) 
>>> priv->sdhc_clk = clk_get_rate(&priv->per_clk);
>>> } else {
>>> -   priv->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK +
>>> dev->seq);
>>> +   /*
>>> +* Check for 'fsl,index' DTS property - as one may
>>> want to have
>>> +* following mmc setup:  
>>
>> NAK, DT is a hardware description. This is encoding a policy, which
>> should not be in DT.
> 
> Please look a few lines up in this file:
> 
> mmc0 = &usdhc1;
> mmc1 = &usdhc2;
> mmc2 = &usdhc3;
> mmc3 = &usdhc4;
> 
> The fsl_esdhc.c has hardcoded ordering for eMMC devices when
> setting/getting clock. 
> 
> If you change aliases on your dts (mmc0 -> usdhc2, etc). Then with a
> bit of luck your second controller will be initialized with first's one
> clock value :-). This of course works by chance with default ROM setup.
> 
> The problem is that many boards have different mmc ordering (starting
> with mmc0, which in above scheme is usdhc2 controller. Also mmc1 is the
> usdhc4 to which eMMC is connected in many boards). Of course this could
> be changed, but please consider a lot of legacy code pilling up on the
> customer's side.
> 
> The clock index @ (drivers/mmc/fsl_esdhc.c - L1517):
> mxc_get_clock(MXC_ESDHC_CLK + dev->seq);
> 
> Here the dev->seq is 0,1 (with SEQ_ALIAS), which will provide clock
> values from usdhc1 and usdhc2. However, we use usdhc4 (eMMC) and usdhc2
> (SD).
> 
>>
>> This looks like some reimplementation of SEQ_ALIAS stuff.
> 
> No, this is a fix for hardcoded (assumed) clock setup in this driver.
> 
> The other option is to provide/port clock stuff from linux (and
> implement CLK_DM in u-boot at least for this part). However, this will
> not fix the problem described above (for other boards which use the
> "legacy" approach).

Well fix the clock code then ? All the other subsystems use the
SEQ_ALIAS and DT /aliases node to define ordering, I don't see why FSL
SDHC driver should get some special hacky treatment which will only make
it difficult to maintain in the future .

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


Re: [U-Boot] [PATCH v1 04/14] DTS: imx: Remove not needed '#address-cells' and '#size-cells' properties

2019-01-02 Thread Lukasz Majewski
Hi Marek,

> On 1/2/19 10:43 AM, Lukasz Majewski wrote:
> > Hi Marek,
> >   
> >> On 1/2/19 12:37 AM, Lukasz Majewski wrote:  
> >>> This commit fixes warnings produced by newest in u-boot DTC
> >>> compiler: 'unnecessary #address-cells/#size-cells without "ranges"
> >>> or child "reg" property'
> >>>
> >>> Signed-off-by: Lukasz Majewski 
> >>
> >> I presume the DTSIs are taken from Linux, is this a backport from
> >> Linux then ?  
> > 
> > Regarding Linux - with Version: DTC 1.4.7-gc86da84d and make W=1 I
> > do not see those warnings as in  scripts/Makefile.lib :
> > 
> > # Disable noisy checks by default
> > ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)
> > DTC_FLAGS += -Wno-unit_address_vs_reg \
> > -Wno-unit_address_format \
> > -Wno-avoid_unnecessary_addr_size \
> > 
> > those warnings are disabled (-Wno-avoid_unnecessary_addr_size).
> > 
> > On the other hand - in u-boot those warnings are checked (maybe are
> > necessary for OF_PLATDATA correct operation?).  
> 
> No, keep the DTs synced and fix things upstream (in Linux) if needed,
> then backport the fixes.

Please correct my understanding if I get this wrong.

Do you recommend to send this patch to Linux upstream to fix warnings,
which are disabled (no checked and not present) by default in Linux ?

After this patch is accepted in Linux - I shall backport it to u-boot ?

> 


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


pgpdfeFvFmNTC.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 v1 05/14] board: cosmetic: Use define to set ENET clock selection mask on TPC70

2019-01-02 Thread Lukasz Majewski
Hi Marek,

> On 1/2/19 11:06 AM, Lukasz Majewski wrote:
> > Hi Marek,
> >   
> >> On 1/2/19 12:37 AM, Lukasz Majewski wrote:  
> >>> This is a cosmetic change, just to use proper define.
> >>>
> >>> Signed-off-by: Lukasz Majewski 
> >>
> >> The subject tags are wrong, fix globally.  
> > 
> > Is there any doc which describes the allowed/not allowed tags
> > (either with Linux or U-boot)?   
> 
> I am not aware of one, however you can write one if you feel inclined
> to do so.

I was just curious if I have overlooked something.

> 
> > From my experience it is a some kind of a convention depending on
> > the maintainer (which helps him to spot relevant patches on ML).  
> 
> Right, and this is ARM imx board, hence those tags should be
> included.
> 
> > In [1] - point 14) there is:
> > The canonical patch subject line is:
> > "Subject: [PATCH 001/123] subsystem: summary phrase"
> > 
> > and the "subsystem: " is the tag. 
> > 
> > In the case of this patch -> I do fix stuff in "board(s)" which is
> > "cosmetic".
> > 
> > Or will we only stick to tags/mails from ./doc/git-mailrc ?
> > 
> > [1] -
> > https://www.kernel.org/doc/html/v4.17/process/submitting-patches.html  
> 
> [...]
> 




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


pgpFm1EUNS4B7.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] dm: usb: gadget: Fix boot breakage on sunxi platforms

2019-01-02 Thread Jean-Jacques Hiblot


On 02/01/2019 13:15, Lukasz Majewski wrote:

On Wed, 2 Jan 2019 11:38:47 +0100
Jean-Jacques Hiblot  wrote:


On 29/12/2018 19:49, Jagan Teki wrote:

On Mon, Dec 24, 2018 at 3:44 AM Jagan Teki
 wrote:

On Fri, Dec 21, 2018 at 2:20 PM Jean-Jacques Hiblot
 wrote: Better to have proper commit head that
tells the real issue.

I found it hard to come up with a short description of the real issue.

At least this title makes it clear that it is a regression fix, not a
new feature.

The details of the failures  are in the commit log (or so I thought)

  

Fixes commit 013116243950 ("dm: usb: create a new UCLASS ID for
USB gadget devices")

The UCLASS_DRIVER for id UCLASS_USB_GADGET_GENERIC needs to be
declared even for platforms that do not enable DM_USB_GADGET.
Otherwise the driver for their usb peripheral controller fails to
bind.

Sorry this is unclear, you are trying to skip DM_USB_GADGET code
even though UCLASS_USB_GADGET_GENERIC id used. does it make
sense?

Sorry for the delay. This was indeed a vacation time.

This patch does not skip DM_USB_GADGET. What it does is declare the
UCLASS_DRIVER for USB peripheral devices even if DM_USB_GADGET is not
set.

DM_USB_GADGET is a new option and not (yet) widely used and some
drivers have their own version of the DM support for gadget drivers
(ie they implement their own version of usb_gadget_initialize(),
usb_gadget_release() and usb_gadget_handle_interrupts()). However all
those drivers use the UCLASS_USB_GADGET_GENERIC uclass ID and thus
the UCLASS_DRIVER for UCLASS_USB_GADGET_GENERIC must be declared. In
the past they used UCLASS_USB_DEV_GENERIC, but this option is
intended for the host side.


Thanks for a detailed explanation. Would you prepare v2 soon?

Honestly I don't know what i would change in a v2.



JJ


Any response on this?

We need the fix asap since the release is about a week.
  




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

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


Re: [U-Boot] [PATCH 1/1] cmd: usb: display bus number

2019-01-02 Thread Heinrich Schuchardt
Spam detection software, running on the system "lists.denx.de",
has identified this incoming email as possible spam.  The original
message has been attached to this so you can view it or label
similar future email.  If you have any questions, see
@@CONTACT_ADDRESS@@ for details.

Content preview:  On 1/2/19 3:21 PM, Marek Vasut wrote: > On 1/2/19 12:29 PM,
   Heinrich Schuchardt wrote: >> If multiple USB buses exist, the output of
  the commands 'usb tree' and 'usb >> info' is confusing because it is not clear
   where the output for a new bus >> starts. >> >> Print an additional line
  for each bus indicating the bus number, e.g. >> >> => usb tree >> USB device
   tree: >> USB bus 0 >> 1 Hub (5 Gb/s, 0mA) >> U-Boot XHCI Host Controller
  >> >> USB bus 1 >> 1 Hub (5 Gb/s, 0mA) >> U-Boot XHCI Host Controller >> >>
   Signed-off-by: Heinrich Schuchardt >> --- >> cmd/usb.c | 1 + >> 1 file 
changed,
   1 insertion(+) >> >> diff --git a/cmd/usb.c b/cmd/usb.c >> index 
0ccb1b5148..6da945c376
   100644 >> --- a/cmd/usb.c >> +++ b/cmd/usb.c >> @@ -470,6 +470,7 @@ static
   void usb_for_each_root_dev(usb_dev_func_t func) >> if (!device_active(bus))
   >> continue; >> >> + printf("USB bus %d\n", bus->seq); > > Isn't this only
   valid if you use SEQ_ALIAS ? [...] 

Content analysis details:   (5.5 points, 5.0 required)

 pts rule name  description
 -- --
 0.0 RCVD_IN_DNSWL_BLOCKED  RBL: ADMINISTRATOR NOTICE: The query to DNSWL
was blocked.  See

http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
 for more information.
[212.227.15.19 listed in list.dnswl.org]
 3.0 SINGLE_HEADER_3K   A single header contains 3K-4K characters
 0.0 FREEMAIL_FROM  Sender email is commonly abused enduser mail 
provider
(xypron.glpk[at]gmx.de)
 2.5 DRUGS_MUSCLE   Refers to a muscle relaxant


--- Begin Message ---
On 1/2/19 3:21 PM, Marek Vasut wrote:
> On 1/2/19 12:29 PM, Heinrich Schuchardt wrote:
>> If multiple USB buses exist, the output of the commands 'usb tree' and 'usb
>> info' is confusing because it is not clear where the output for a new bus
>> starts.
>>
>> Print an additional line for each bus indicating the bus number, e.g.
>>
>> => usb tree
>> USB device tree:
>> USB bus 0
>>   1  Hub (5 Gb/s, 0mA)
>>  U-Boot XHCI Host Controller
>>
>> USB bus 1
>>   1  Hub (5 Gb/s, 0mA)
>>  U-Boot XHCI Host Controller
>>
>> Signed-off-by: Heinrich Schuchardt 
>> ---
>>  cmd/usb.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/cmd/usb.c b/cmd/usb.c
>> index 0ccb1b5148..6da945c376 100644
>> --- a/cmd/usb.c
>> +++ b/cmd/usb.c
>> @@ -470,6 +470,7 @@ static void usb_for_each_root_dev(usb_dev_func_t func)
>>  if (!device_active(bus))
>>  continue;
>>  
>> +printf("USB bus %d\n", bus->seq);
> 
> Isn't this only valid if you use SEQ_ALIAS ?

Kconfig symbol SEQ_ALIAS does not exist. I assume you mean DM_SEQ_ALIAS.

In device_probe() seq is set unconditionally
(drivers/core/device.c:306).

CONFIG_DM_SEQ_ALIAS=y allows to influence the value of seq via the
device tree.

Best regards

Heinrich

> 
>>  device_find_first_child(bus, &dev);
>>  if (dev && device_active(dev)) {
>>  udev = dev_get_parent_priv(dev);
>>
> 
> 

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


[U-Boot] [PATCH] board: mvebu: drop unused ETH_PHY macro definitions

2019-01-02 Thread Baruch Siach
These macros are not used anywhere in the boards code.

Cc: Chris Packham 
Cc: Dirk Eibach 
Cc: Mario Six 
Cc: Dennis Gilmore 
Signed-off-by: Baruch Siach 
---
 board/Marvell/db-88f6820-amc/db-88f6820-amc.c | 4 
 board/Marvell/db-88f6820-gp/db-88f6820-gp.c   | 4 
 board/gdsys/a38x/controlcenterdc.c| 4 
 board/kobol/helios4/helios4.c | 4 
 board/solidrun/clearfog/clearfog.c| 4 
 5 files changed, 20 deletions(-)

diff --git a/board/Marvell/db-88f6820-amc/db-88f6820-amc.c 
b/board/Marvell/db-88f6820-amc/db-88f6820-amc.c
index bc18fe6ddf4a..922576e9d599 100644
--- a/board/Marvell/db-88f6820-amc/db-88f6820-amc.c
+++ b/board/Marvell/db-88f6820-amc/db-88f6820-amc.c
@@ -16,10 +16,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define ETH_PHY_CTRL_REG   0
-#define ETH_PHY_CTRL_POWER_DOWN_BIT11
-#define ETH_PHY_CTRL_POWER_DOWN_MASK   (1 << ETH_PHY_CTRL_POWER_DOWN_BIT)
-
 /*
  * Those values and defines are taken from the Marvell U-Boot version
  * "u-boot-2013.01-2016_T1.0.eng_drop_v10"
diff --git a/board/Marvell/db-88f6820-gp/db-88f6820-gp.c 
b/board/Marvell/db-88f6820-gp/db-88f6820-gp.c
index 9368bce26cee..1a0746b9d3d5 100644
--- a/board/Marvell/db-88f6820-gp/db-88f6820-gp.c
+++ b/board/Marvell/db-88f6820-gp/db-88f6820-gp.c
@@ -16,10 +16,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define ETH_PHY_CTRL_REG   0
-#define ETH_PHY_CTRL_POWER_DOWN_BIT11
-#define ETH_PHY_CTRL_POWER_DOWN_MASK   (1 << ETH_PHY_CTRL_POWER_DOWN_BIT)
-
 /*
  * Those values and defines are taken from the Marvell U-Boot version
  * "u-boot-2013.01-2014_T3.0"
diff --git a/board/gdsys/a38x/controlcenterdc.c 
b/board/gdsys/a38x/controlcenterdc.c
index 86051aedf8e1..9e448fcd10d9 100644
--- a/board/gdsys/a38x/controlcenterdc.c
+++ b/board/gdsys/a38x/controlcenterdc.c
@@ -22,10 +22,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define ETH_PHY_CTRL_REG   0
-#define ETH_PHY_CTRL_POWER_DOWN_BIT11
-#define ETH_PHY_CTRL_POWER_DOWN_MASK   (1 << ETH_PHY_CTRL_POWER_DOWN_BIT)
-
 #define DB_GP_88F68XX_GPP_OUT_ENA_LOW  0x7fff
 #define DB_GP_88F68XX_GPP_OUT_ENA_MID  0xefff
 
diff --git a/board/kobol/helios4/helios4.c b/board/kobol/helios4/helios4.c
index 8c0864bcdd4d..3c3592ecf58b 100644
--- a/board/kobol/helios4/helios4.c
+++ b/board/kobol/helios4/helios4.c
@@ -17,10 +17,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define ETH_PHY_CTRL_REG   0
-#define ETH_PHY_CTRL_POWER_DOWN_BIT11
-#define ETH_PHY_CTRL_POWER_DOWN_MASK   BIT(ETH_PHY_CTRL_POWER_DOWN_BIT)
-
 /*
  * Those values and defines are taken from the Marvell U-Boot version
  * "u-boot-2013.01-15t1-helios4" as well as the upstream config for clearfog
diff --git a/board/solidrun/clearfog/clearfog.c 
b/board/solidrun/clearfog/clearfog.c
index 1742aa8921c9..03724fee10c1 100644
--- a/board/solidrun/clearfog/clearfog.c
+++ b/board/solidrun/clearfog/clearfog.c
@@ -16,10 +16,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define ETH_PHY_CTRL_REG   0
-#define ETH_PHY_CTRL_POWER_DOWN_BIT11
-#define ETH_PHY_CTRL_POWER_DOWN_MASK   (1 << ETH_PHY_CTRL_POWER_DOWN_BIT)
-
 /*
  * Those values and defines are taken from the Marvell U-Boot version
  * "u-boot-2013.01-15t1-clearfog"
-- 
2.19.2

___
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-02 Thread Stephen Warren

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.

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


Re: [U-Boot] [PATCH 1/1] cmd: usb: display bus number

2019-01-02 Thread Marek Vasut
On 1/2/19 5:03 PM, Heinrich Schuchardt wrote:
> On 1/2/19 3:21 PM, Marek Vasut wrote:
>> On 1/2/19 12:29 PM, Heinrich Schuchardt wrote:
>>> If multiple USB buses exist, the output of the commands 'usb tree' and 'usb
>>> info' is confusing because it is not clear where the output for a new bus
>>> starts.
>>>
>>> Print an additional line for each bus indicating the bus number, e.g.
>>>
>>> => usb tree
>>> USB device tree:
>>> USB bus 0
>>>   1  Hub (5 Gb/s, 0mA)
>>>  U-Boot XHCI Host Controller
>>>
>>> USB bus 1
>>>   1  Hub (5 Gb/s, 0mA)
>>>  U-Boot XHCI Host Controller
>>>
>>> Signed-off-by: Heinrich Schuchardt 
>>> ---
>>>  cmd/usb.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/cmd/usb.c b/cmd/usb.c
>>> index 0ccb1b5148..6da945c376 100644
>>> --- a/cmd/usb.c
>>> +++ b/cmd/usb.c
>>> @@ -470,6 +470,7 @@ static void usb_for_each_root_dev(usb_dev_func_t func)
>>> if (!device_active(bus))
>>> continue;
>>>  
>>> +   printf("USB bus %d\n", bus->seq);
>>
>> Isn't this only valid if you use SEQ_ALIAS ?
> 
> Kconfig symbol SEQ_ALIAS does not exist. I assume you mean DM_SEQ_ALIAS.
> 
> In device_probe() seq is set unconditionally
> (drivers/core/device.c:306).
> 
> CONFIG_DM_SEQ_ALIAS=y allows to influence the value of seq via the
> device tree.

I know what it does. Without this option being set, the bus->seq number
will be either some obscure gigantic number or undefined, right ?

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


Re: [U-Boot] [PATCH] dm: usb: gadget: Fix boot breakage on sunxi platforms

2019-01-02 Thread Jagan Teki
On Wed, Jan 2, 2019 at 4:08 PM Jean-Jacques Hiblot  wrote:
>
>
> On 29/12/2018 19:49, Jagan Teki wrote:
> > On Mon, Dec 24, 2018 at 3:44 AM Jagan Teki  
> > wrote:
> >> On Fri, Dec 21, 2018 at 2:20 PM Jean-Jacques Hiblot  
> >> wrote:
> >> Better to have proper commit head that tells the real issue.
>
> I found it hard to come up with a short description of the real issue.
>
> At least this title makes it clear that it is a regression fix, not a
> new feature.
>
> The details of the failures  are in the commit log (or so I thought)
>
> >>
> >>> Fixes commit 013116243950 ("dm: usb: create a new UCLASS ID for USB gadget
> >>> devices")
> >>>
> >>> The UCLASS_DRIVER for id UCLASS_USB_GADGET_GENERIC needs to be declared
> >>> even for platforms that do not enable DM_USB_GADGET. Otherwise the driver
> >>> for their usb peripheral controller fails to bind.
> >> Sorry this is unclear, you are trying to skip DM_USB_GADGET code even
> >> though UCLASS_USB_GADGET_GENERIC id used. does it make sense?
>
> Sorry for the delay. This was indeed a vacation time.
>
> This patch does not skip DM_USB_GADGET. What it does is declare the
> UCLASS_DRIVER for USB peripheral devices even if DM_USB_GADGET is not set.
>
> DM_USB_GADGET is a new option and not (yet) widely used and some drivers
> have their own version of the DM support for gadget drivers (ie they
> implement their own version of usb_gadget_initialize(),
> usb_gadget_release() and usb_gadget_handle_interrupts()). However all
> those drivers use the UCLASS_USB_GADGET_GENERIC uclass ID and thus the
> UCLASS_DRIVER for UCLASS_USB_GADGET_GENERIC must be declared. In the
> past they used UCLASS_USB_DEV_GENERIC, but this option is intended for
> the host side.

Acked-by: Jagan Teki 

Marek, any comments?
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1] cmd: usb: display bus number

2019-01-02 Thread Heinrich Schuchardt
On 1/2/19 5:37 PM, Marek Vasut wrote:
> On 1/2/19 5:03 PM, Heinrich Schuchardt wrote:
>> On 1/2/19 3:21 PM, Marek Vasut wrote:
>>> On 1/2/19 12:29 PM, Heinrich Schuchardt wrote:
 If multiple USB buses exist, the output of the commands 'usb tree' and 'usb
 info' is confusing because it is not clear where the output for a new bus
 starts.

 Print an additional line for each bus indicating the bus number, e.g.

 => usb tree
 USB device tree:
 USB bus 0
   1  Hub (5 Gb/s, 0mA)
  U-Boot XHCI Host Controller

 USB bus 1
   1  Hub (5 Gb/s, 0mA)
  U-Boot XHCI Host Controller

 Signed-off-by: Heinrich Schuchardt 
 ---
  cmd/usb.c | 1 +
  1 file changed, 1 insertion(+)

 diff --git a/cmd/usb.c b/cmd/usb.c
 index 0ccb1b5148..6da945c376 100644
 --- a/cmd/usb.c
 +++ b/cmd/usb.c
 @@ -470,6 +470,7 @@ static void usb_for_each_root_dev(usb_dev_func_t func)
if (!device_active(bus))
continue;
  
 +  printf("USB bus %d\n", bus->seq);
>>>
>>> Isn't this only valid if you use SEQ_ALIAS ?
>>
>> Kconfig symbol SEQ_ALIAS does not exist. I assume you mean DM_SEQ_ALIAS.
>>
>> In device_probe() seq is set unconditionally
>> (drivers/core/device.c:306).
>>
>> CONFIG_DM_SEQ_ALIAS=y allows to influence the value of seq via the
>> device tree.
> 
> I know what it does. Without this option being set, the bus->seq number
> will be either some obscure gigantic number or undefined, right ?
> 

I disabled CONFIG_DM_SEQ_ALIAS and this is the output on my MACCHIATObin
(with the second USB bus enabled in the device tree).

=> usb start
starting USB...
USB0:   Register 2000120 NbrPorts 2
Starting the controller
USB XHCI 1.00
USB1:   Register 2000120 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
   scanning usb for storage devices... 0 Storage Device(s) found
=> usb tree
USB device tree:
USB bus 0
  1  Hub (5 Gb/s, 0mA)
 U-Boot XHCI Host Controller

USB bus 1
  1  Hub (5 Gb/s, 0mA)
 U-Boot XHCI Host Controller

Could you, please, indicate under which circumstances seq might be
undefined.

Best regards

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


Re: [U-Boot] [PATCH 1/1] tools: imx8image: use correct printf escape sequence

2019-01-02 Thread Heinrich Schuchardt
On 12/17/18 10:22 AM, Heinrich Schuchardt wrote:
> core is of type uint64_t. So for printing we need "%"PRIu64 (not "%lu").
> 
> Without the patch a warning is issued when building on a 32bit system.
> 
> Signed-off-by: Heinrich Schuchardt 
> ---
>  tools/imx8image.c | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/imx8image.c b/tools/imx8image.c
> index 6e8ac464e7..f3158bc434 100644
> --- a/tools/imx8image.c
> +++ b/tools/imx8image.c
> @@ -555,7 +555,8 @@ static void set_image_array_entry(flash_header_v3_t 
> *container,
>   } else if (soc == QM && core == CORE_CA72) {
>   meta = IMAGE_A72_DEFAULT_META(custom_partition);
>   } else {
> - fprintf(stderr, "Error: invalid AP core id: %lu\n",
> + fprintf(stderr,
> + "Error: invalid AP core id: %" PRIu64 "\n",
>   core);
>   exit(EXIT_FAILURE);
>   }
> @@ -577,7 +578,9 @@ static void set_image_array_entry(flash_header_v3_t 
> *container,
>   core = CORE_CM4_1;
>   meta = IMAGE_M4_1_DEFAULT_META(custom_partition);
>   } else {
> - fprintf(stderr, "Error: invalid m4 core id: %lu\n", 
> core);
> + fprintf(stderr,
> + "Error: invalid m4 core id: %" PRIu64 "\n",
> + core);
>   exit(EXIT_FAILURE);
>   }
>   img->hab_flags |= IMG_TYPE_EXEC;
> 

Hello Stefano,

in patchwork this patch has been assigned to you. Could you, please,
review it.

Best regards

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


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

2019-01-02 Thread Jagan Teki
Hi Tom,

Please pull this spi PR as part of 2019.01

thanks,
Jagan.

The following changes since commit 08337cd64832ed7f8147da75013510b92bbcd188:

  riscv: bootm: Support booting VxWorks (2018-12-31 08:08:51 -0500)

are available in the Git repository at:

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

for you to fetch changes up to 689795242b1cb7de5a3d8c8bf1a9582a8924ff69:

  dm: MIGRATION: Update migration plan for DM_SPI_FLASH (2019-01-02 01:00:31 
+0530)


Jagan Teki (2):
  dm: MIGRATION: Update migration plan for SPI
  dm: MIGRATION: Update migration plan for DM_SPI_FLASH

Nikolai Zhubr (1):
  mtd: nand: raw: Add Hynix H27UBG8T2BTR id table

Stefan Mavrodiev (1):
  spi: sun4i: Add rx_buf NULL pointer check

 Makefile| 21 +
 doc/driver-model/MIGRATION.txt  | 10 +++---
 drivers/mtd/nand/raw/nand_ids.c |  4 
 drivers/spi/sun4i_spi.c |  3 ++-
 4 files changed, 34 insertions(+), 4 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/2] dm: MIGRATION: Update migration plan for SPI

2019-01-02 Thread Jagan Teki
On Wed, Jan 2, 2019 at 12:47 AM Jagan Teki  wrote:
>
> - v2019.04 for no dm conversion drivers
> - v2019.07 for partially converted drivers.
>
> Note: there were many updates on this deadline, so better
> not update this again.
>
> Signed-off-by: Jagan Teki 
> ---

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


Re: [U-Boot] configs: move CONFIG_SPL_TEXT_BASE to Kconfig

2019-01-02 Thread Simon Goldschmidt

Hi Marek,

Am 14.11.2018 um 19:51 schrieb Simon Goldschmidt:

On 07.10.2018 02:49, Tom Rini wrote:

On Sun, Sep 30, 2018 at 02:31:53PM +0200, Simon Goldschmidt wrote:


Moved CONFIG_SPL_TEXT_BASE to common/spl/Kconfig with
help from moveconfig.py (only had to prepare socfpga,
stm32f746 and am33x/43x manually)

Signed-off-by: Simon Goldschmidt 
---

This patch is in preparation for boot-from-FPGA for
socfpga cyclone5, where we need a different SPL_TEXT_BASE.
By moving this to Kconfig, this can then be done via
defconfig.

I did notice that some defconfig files change more than
necessary, it seems like they are out of sync?

So, I see at least one set of problems with the conversion, the am33*
family gets put to 0x0 which isn't right.  I'm going to pull out the
print tool I made and posted a while back and use that for conversion.
Thanks for the starting point!


Tom, what's the status on this? I still can't build an SPL for socfpga
gen5 boot from FPGA because I can't change SPL_TEXT_BASE.

Marek, if getting CONFIG_SPL_TEXT_BASE into 2019.01 won't work, can we
have a separate (k)config option for socfpga only? That might be useful
anyway as when booting from fpga, there is no 64 KByte size limit and
the "magic value into magic register to unlock support for issuing warm
reset" must not be written as the SPL is not in SRAM. But that might
have its separate config option, too...

Anyway, I just need input to know in which direction I should continue.
I'm waiting to get all our versions of SPL and U-Boot running from
mainline (with only board configs added for our private boards).


I still cannot build an SPL to boot from FPGA since CONFIG_SPL_TEXT_BASE 
is hard-coded to OnChip RAM (while when booting from FPGA, it has to be 
placed into the FPGA bridge).


Since both Tom and myself did not seem to have immediate luck with 
bringing CONFIG_SPL_TEXT_BASE to Kconfig, may I suggest to add a Kconfig 
option 'Boot from FPGA' for socfpga_gen5?


Or do you have another idea at hand of how to proceed here?

Please note that there might be other settings that may change when 
booting from FPGA, e.g. the maximum code size for SPL is not limited any 
more.


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


Re: [U-Boot] [U-Boot,1/2] rockchip: rk3036: ram: update license

2019-01-02 Thread Philipp Tomsich
> All the source code of sdram_rk3036.c are from Rockchip, update the
> copyright to owned by Rockchip.
> 
> Because rockchip may use this copy of code both for open source
> project and internal project, update the license to use both
> GPL2.0+ and BSD-3 Clause.
> 
> Signed-off-by: Kever Yang 
> ---
> 
>  arch/arm/mach-rockchip/rk3036/sdram_rk3036.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

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


Re: [U-Boot] [U-Boot, 2/2] rockchip: ram: update license for sdram driver

2019-01-02 Thread Philipp Tomsich
> Rockchip may use this sdram copy of source code for both open source
> and internal project, update the license to use both GPL2.0+ and
> BSD-3 Clause.
> 
> Signed-off-by: Kever Yang 
> ---
> 
>  drivers/ram/rockchip/sdram_rk3128.c | 2 +-
>  drivers/ram/rockchip/sdram_rk3188.c | 2 +-
>  drivers/ram/rockchip/sdram_rk322x.c | 2 +-
>  drivers/ram/rockchip/sdram_rk3288.c | 2 +-
>  drivers/ram/rockchip/sdram_rk3328.c | 2 +-
>  drivers/ram/rockchip/sdram_rk3399.c | 2 +-
>  6 files changed, 6 insertions(+), 6 deletions(-)
> 

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


Re: [U-Boot] [U-Boot, v4, 2/8] power: regulator: Allow PWM regulator to be omitted from SPL.

2019-01-02 Thread Philipp Tomsich
> This patch allows to enable the PWM regulator driver
> independent for U-Boot and SPL.
> 
> Signed-off-by: Christoph Muellner 
> ---
> 
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
> 
>  drivers/power/regulator/Kconfig  | 7 +++
>  drivers/power/regulator/Makefile | 2 +-
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 

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


Re: [U-Boot] [U-Boot, v4, 1/8] rockchip: rk3399-puma: Cleanup of vdd_log DTS entry.

2019-01-02 Thread Philipp Tomsich
> This patch eliminates the non-standard entries "rockchip,pwm_id"
> and "rockchip,pwm_voltage". They are neither documented nor
> read out by any driver.
> 
> Additionally it introduces the entry regulator-init-microvolt
> and sets it to 900 mV, which is the default target value
> for VDD_LOG.
> 
> Signed-off-by: Christoph Muellner 
> ---
> 
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
> 
>  arch/arm/dts/rk3399-puma.dtsi | 5 +
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 

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


Re: [U-Boot] [U-Boot, v4, 4/8] dm: pinctrl: Add pinctrl_decode_pin_config_dm().

2019-01-02 Thread Philipp Tomsich
> pinctrl_decode_pin_config_dm() is basically a feature-equivalent
> implementation of pinctrl_decode_pin_config(), which operates
> on struct udevice devices and uses the dev_read_*() API.
> 
> Signed-off-by: Christoph Muellner 
> ---
> 
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
> 
>  drivers/pinctrl/pinctrl-uclass.c | 22 ++
>  include/dm/pinctrl.h | 12 
>  2 files changed, 34 insertions(+)
> 

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


Re: [U-Boot] [U-Boot, v4, 3/8] rockchip: rk3399-puma: enable PWM regulator in Puma defconfig.

2019-01-02 Thread Philipp Tomsich
> This patch enables the PWM regulator driver in the defconfig
> for the RK3399-Q7.
> 
> Signed-off-by: Christoph Muellner 
> ---
> 
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
> 
>  configs/puma-rk3399_defconfig | 1 +
>  1 file changed, 1 insertion(+)
> 

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


Re: [U-Boot] [U-Boot, v4, 8/8] rockchip: rk3399-puma: Set VDD_LOG to 950 mV.

2019-01-02 Thread Philipp Tomsich
> This patch sets VDD_LOG to 950 mV on RK3399-Q7.
> This is required to address stability issues on Puma
> in heavy-load use-cases.
> 
> Reported-by: Assaf Agmon 
> Signed-off-by: Philipp Tomsich 
> Signed-off-by: Christoph Muellner 
> ---
> 
> Changes in v4:
>  - Changed patches according to review feedback.
> 
> Changes in v3:
>  - Fix message verbosity in pinctrl driver.
>  - Changed patches according to review feedback.
>  - Add patch to enable the full pinctrl driver only for Puma boards.
> 
> Changes in v2:
>  - Changed patches according to review feedback.
>  - Fix pinctrl infrastructure instead of hacking board_init() code.
> 
>  arch/arm/dts/rk3399-puma.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

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


Re: [U-Boot] [U-Boot, v4, 6/8] rockchip: rk3399: Add Kconfig option for full pinctrl driver

2019-01-02 Thread Philipp Tomsich
> This patch adds a Kconfig option to enable the full pinctrl driver
> for the RK3399. This flag needs to be enabed in order to get the
> features of the full pinctrl driver compiled in (i.e. a .set_state()
> callback).
> 
> Signed-off-by: Christoph Muellner 
> ---
> 
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
> 
>  drivers/pinctrl/Kconfig   | 10 ++
>  drivers/pinctrl/rockchip/pinctrl_rk3399.c |  9 +
>  2 files changed, 19 insertions(+)
> 

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


Re: [U-Boot] [U-Boot, v4, 5/8] rockchip: rk3399: Add improved pinctrl driver.

2019-01-02 Thread Philipp Tomsich
> The current pinctrl driver for the RK3399 has a range of qulity issues.
> E.g. it only implements the .set_state_simple() callback, it
> does not parse the available pinctrl information from the DTS
> (instead uses hardcoded values), is not flexible enough to cover
> devices without 'interrupt' field in the DTS (e.g. PWM),
> is not written generic enough to make code reusable among other
> rockchip SoCs...
> 
> This patch addresses these issues by reimplementing the whole driver
> from scratch using the .set_state() callback.
> The new implementation covers all featurese of the old code
> (i.e. it supports pinmuxing and pullup/pulldown configuration).
> 
> This patch has been tested on a RK3399-Q7 SoM (Puma).
> 
> Signed-off-by: Christoph Muellner 
> ---
> 
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
> 
>  drivers/pinctrl/rockchip/pinctrl_rk3399.c | 227 
> ++
>  1 file changed, 227 insertions(+)
> 

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


Re: [U-Boot] [U-Boot, v4, 7/8] rockchip: rk3399-puma: enable full pinctrl driver in Puma defconfig.

2019-01-02 Thread Philipp Tomsich
> This patch enables the full pinctrl driver in the defconfig
> for the RK3399-Q7.
> 
> Signed-off-by: Christoph Muellner 
> ---
> 
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
> 
>  configs/puma-rk3399_defconfig | 1 +
>  1 file changed, 1 insertion(+)
> 

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


Re: [U-Boot] [PATCH u-boot 0/2] net: designware: add meson meson compatibles

2019-01-02 Thread Joe Hershberger
On Fri, Nov 9, 2018 at 8:21 AM Neil Armstrong  wrote:
>
> Add the compatible strings in the Synopsys DWMAC driver for :
> - The Amlogic GXBB (and other GX) SoC
> - The Amlogic AXG (and other GX) SoC
>
> Neil Armstrong (2):
>   net: designware: add meson meson gxbb comptatible
>   net: designware: add meson meson axg compatible

Hi Neil,

Trying to catch up on patches - I don't see this series in patchwork -
should it be?

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


Re: [U-Boot] [PATCH] net: phy: Add clause 45 identifier to phy_device

2019-01-02 Thread Joe Hershberger
On Fri, Nov 16, 2018 at 12:26 AM Pankaj Bansal  wrote:
>
> The phy devices can be accessed via clause 22 or via clause 45.
> This information can be deduced when we read phy id. if the phy id
> is read without giving any MDIO Manageable Device Address (MMD), then
> it conforms to clause 22. otherwise it conforms to clause 45.
>
> Signed-off-by: Pankaj Bansal 

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


Re: [U-Boot] [PATCH v9 09/10] tftp: prevent overwriting reserved memory

2019-01-02 Thread Joe Hershberger
On Wed, Dec 19, 2018 at 1:04 PM Simon Goldschmidt
 wrote:
>
> This fixes CVE-2018-18439 ("insufficient boundary checks in network
> image boot") by using lmb to check for a valid range to store
> received blocks.
>
> Signed-off-by: Simon Goldschmidt 

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


Re: [U-Boot] [PATCH] bmips: fix config warnings from 2019.01

2019-01-02 Thread Álvaro Fernández Rojas
I only tested it on Comtrend AR-5387un, I will test it on other boards 
and report back.


El 01/01/2019 a las 20:19, Tom Rini escribió:

On Tue, Jan 01, 2019 at 07:45:03PM +0100, Álvaro Fernández Rojas wrote:


- Fixes CONFIG_OF_EMBED warning.
- Fixes missing CONFIG_BLK warning for CONFIG_USB.

Signed-off-by: Álvaro Fernández Rojas 

To be clear, some number of these have been boot tested too, right?
Thanks!


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


Re: [U-Boot] [PATCH] bmips: fix config warnings from 2019.01

2019-01-02 Thread Álvaro Fernández Rojas

Hi Marek,

Check commits 841d5fbae4e993476fa87d8933db0cd58d3c2d41 and 
109d8bf3ac7b9bb04f3c46bb540eb2bb865f3dd7.


http://git.denx.de/?p=u-boot.git;a=commitdiff;h=841d5fbae4e993476fa87d8933db0cd58d3c2d41 



http://git.denx.de/?p=u-boot.git;a=commitdiff;h=109d8bf3ac7b9bb04f3c46bb540eb2bb865f3dd7


El 01/01/2019 a las 21:24, Marek Vasut escribió:

On 1/1/19 7:45 PM, Álvaro Fernández Rojas wrote:

- Fixes CONFIG_OF_EMBED warning.
- Fixes missing CONFIG_BLK warning for CONFIG_USB.

More details on those warnings that are supposedly fixed would be
appreciated. It's really unclear what this patch does.


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


Re: [U-Boot] [PATCH] bmips: fix config warnings from 2019.01

2019-01-02 Thread Tom Rini
On Wed, Jan 02, 2019 at 11:11:09PM +0100, Álvaro Fernández Rojas wrote:

> Hi Marek,
> 
> Check commits 841d5fbae4e993476fa87d8933db0cd58d3c2d41 and
> 109d8bf3ac7b9bb04f3c46bb540eb2bb865f3dd7.
> 
> http://git.denx.de/?p=u-boot.git;a=commitdiff;h=841d5fbae4e993476fa87d8933db0cd58d3c2d41
> 
> 
> http://git.denx.de/?p=u-boot.git;a=commitdiff;h=109d8bf3ac7b9bb04f3c46bb540eb2bb865f3dd7

Right.  But Marek is asking for something more like:
- Use of CONFIG_OF_EMBED isn't intended for deployment use, switch to
  CONFIG_OF_SEPARATE instead.
- We can fully migrate to CONIG_DM_USB so enable CONFIG_BLK now.

ie why we're changing things, not just that we're fixing the warning.

-- 
Tom


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


Re: [U-Boot] [PATCH 2/6] riscv: remove invalid dcache flush implementation

2019-01-02 Thread Rick Chen
Hi Lukas

Auer, Lukas  於 2019年1月2日 週三 下午8:22寫道:
>
> Hi Rick,
>
> On Wed, 2019-01-02 at 10:54 +0800, Rick Chen wrote:
> > Hi Lukas
> >
> > > > From: Lukas Auer [mailto:lukas.a...@aisec.fraunhofer.de]
> > > > Sent: Monday, December 31, 2018 2:28 AM
> > > > To: u-boot@lists.denx.de
> > > > Cc: Anup Patel; Lukas Auer; Rick Jian-Zhi Chen(陳建志); Bin Meng;
> > > > Greentime Hu
> > > > Subject: [PATCH 2/6] riscv: remove invalid dcache flush
> > > > implementation
> > > >
> > > > The fence instruction is used to enforce device I/O and memory
> > > > ordering
> > > > constraints in RISC-V. It does not directly affect the data cache
> > > > and particular
> > > > cannot be used to flush or invalidate it. RISC-V does not have
> > > > instructions for
> > > > explicit cache control. Remove the flush_dcache_all
> > > > implementation and its use
> > > > in all dcache-specific functions in lib/cache.c.
> > > >
> >
> > The privileged mention that fence is for the purposes of ordering,
> > but
> > does not say
> > it can not be used to flush or invalidate.
> >
> > Andes's ax25 have no coherence agent. So it need fence instruction to
> > manipulate
> > cache flush or invalidate. Or there will be some data synchronization
> > error
> > occurs on ae350 platform.
> >
>
> I was not aware of this. Does the ax25 flush the whole dcache on any
> fence instruction?

Yes.
It will flush the whole dcache when execute fence.

>
> You are right, we can't remove it in this case. Since it is specific to
> the ax25, should I move it into cpu/ax25/cache.c instead?

OK
It is good to me.
And thanks for your understanding and improvements.

Regards
Rick

>
> Thanks,
> Lukas
>
> > Thanks
> > Rick
> >
> >
> > > > This also adds a missing new line between flush_dcache_all and
> > > > flush_dcache_range in lib/cache.c.
> > > >
> > > > Signed-off-by: Lukas Auer 
> > > > ---
> > > > This patch only removes the implementation itself and its use in
> > > > dcache-specific
> > > > functions in lib/cache.c. There are more uses of it in
> > > > arch/riscv/, which this patch
> > > > does not remove.
> > > >
> > > >  arch/riscv/lib/cache.c | 4 +---
> > > >  1 file changed, 1 insertion(+), 3 deletions(-)
> > > >
> > > > diff --git a/arch/riscv/lib/cache.c b/arch/riscv/lib/cache.c
> > > > index
> > > > ae5c60716f..203e287612 100644
> > > > --- a/arch/riscv/lib/cache.c
> > > > +++ b/arch/riscv/lib/cache.c
> > > > @@ -13,11 +13,10 @@ void invalidate_icache_all(void)
> > > >
> > > >  void flush_dcache_all(void)
> > > >  {
> > > > - asm volatile ("fence" :::"memory");
> > > >  }
> > > > +
> > > >  void flush_dcache_range(unsigned long start, unsigned long
> > > > end)  {
> > > > - flush_dcache_all();
> > > >  }
> > > >
> > > >  void invalidate_icache_range(unsigned long start, unsigned long
> > > > end) @@ -31,7
> > > > +30,6 @@ void invalidate_icache_range(unsigned long start,
> > > > unsigned long end)
> > > >
> > > >  void invalidate_dcache_range(unsigned long start, unsigned long
> > > > end)  {
> > > > - flush_dcache_all();
> > > >  }
> > > >
> > > >  void cache_flush(void)
> > > > --
> > > > 2.20.1
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] Booting on RK3399

2019-01-02 Thread Simon Glass
Hi Kever,

I have a firefly-rk3399 and would like to boot it into U-Boot (as a start)
from an uSD card.

Are there instructions somewhere on how to do this? I gather that I need
OP-TEE but not how to build it or how to put the image together. I would
like to have instructions in README.rockchip if possible.

I'm planning to add U-Boot support for bob and maybe kevin (both
Chromebooks) but am not sure where to start. I thought the firefly might be
best since it is pretty common.

Thanks for any help you can provide.

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


[U-Boot] [PATCH 0/8] Convert i.MX7 WaRP7 ports to DM

2019-01-02 Thread Bryan O'Donoghue
This series does a minimal conversion of WaRP7 and the BL33 version of
WaRP7 to the DM.

Pinctrl, GPIO, I2C, Regulators, PMIC and MMC are converted. Later patches
will convert USB and UART.

Bryan O'Donoghue (8):
  arm: dts: imx7s-warp: Import Linux warp7 dts
  arm: imx7s-warp: Add DT file hooks
  arm: imx7s-warp: Convert to DM MMC initialization
  arm: dts: imx7s-warp: Create alias for mmc0 to &usdhc3
  warp7: defconfig: Switch on IMX7 pinctrl for both ports
  warp7: defconfig: Switch on DM GPIO for both warp7 ports
  warp7: defconfig: Switch to DM for I2C
  arm: imx7s-warp: Convert to DM PMIC

 arch/arm/dts/Makefile|   3 +-
 arch/arm/dts/imx7s-warp.dts  | 416 +++
 board/warp7/warp7.c  |  85 +--
 configs/warp7_bl33_defconfig |  14 +-
 configs/warp7_defconfig  |  14 +-
 include/configs/warp7.h  |   8 -
 6 files changed, 455 insertions(+), 85 deletions(-)
 create mode 100644 arch/arm/dts/imx7s-warp.dts

-- 
2.20.0

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


[U-Boot] [PATCH 1/8] arm: dts: imx7s-warp: Import Linux warp7 dts

2019-01-02 Thread Bryan O'Donoghue
This patch imports the Linux kernel warp7 dts as at upstream kernel commit
cf76c364a1e1.

The following was dropped from the incoming kernel DTS file

-&wdog1 {
-   pinctrl-names = "default";
-   pinctrl-0 = <&pinctrl_wdog>;
-   fsl,ext-reset-output;
-   status = "okay";
-};
-
-
-&iomuxc_lpsr {
-   pinctrl_wdog: wdoggrp {
-   fsl,pins = <
-   MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG_B  0x74
-   >;
-   };
-};

it causes a DTC compile error for me and isn't needed for u-boot in any
case.

Signed-off-by: Bryan O'Donoghue 
Cc: Albert Aribaud 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 arch/arm/dts/imx7s-warp.dts | 423 
 1 file changed, 423 insertions(+)
 create mode 100644 arch/arm/dts/imx7s-warp.dts

diff --git a/arch/arm/dts/imx7s-warp.dts b/arch/arm/dts/imx7s-warp.dts
new file mode 100644
index 00..c44db20734
--- /dev/null
+++ b/arch/arm/dts/imx7s-warp.dts
@@ -0,0 +1,423 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2016 NXP Semiconductors.
+ * Author: Fabio Estevam 
+ */
+
+/dts-v1/;
+
+#include 
+#include "imx7s.dtsi"
+
+/ {
+   model = "Warp i.MX7 Board";
+   compatible = "warp,imx7s-warp", "fsl,imx7s";
+
+   memory@8000 {
+   reg = <0x8000 0x2000>;
+   };
+
+   gpio-keys {
+   compatible = "gpio-keys";
+   pinctrl-0 = <&pinctrl_gpio>;
+   autorepeat;
+
+   back {
+   label = "Back";
+   gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>;
+   linux,code = ;
+   wakeup-source;
+   };
+   };
+
+   reg_brcm: regulator-brcm {
+   compatible = "regulator-fixed";
+   enable-active-high;
+   gpio = <&gpio5 10 GPIO_ACTIVE_HIGH>;
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_brcm_reg>;
+   regulator-name = "brcm_reg";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   startup-delay-us = <20>;
+   };
+
+   reg_bt: regulator-bt {
+   compatible = "regulator-fixed";
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_bt_reg>;
+   enable-active-high;
+   gpio = <&gpio5 17 GPIO_ACTIVE_HIGH>;
+   regulator-name = "bt_reg";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-always-on;
+   };
+
+   sound {
+   compatible = "simple-audio-card";
+   simple-audio-card,name = "imx7-sgtl5000";
+   simple-audio-card,format = "i2s";
+   simple-audio-card,bitclock-master = <&dailink_master>;
+   simple-audio-card,frame-master = <&dailink_master>;
+   simple-audio-card,cpu {
+   sound-dai = <&sai1>;
+   };
+
+   dailink_master: simple-audio-card,codec {
+   sound-dai = <&codec>;
+   clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+   };
+   };
+};
+
+&clks {
+   assigned-clocks = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
+   assigned-clock-rates = <884736000>;
+};
+
+&i2c1 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_i2c1>;
+   status = "okay";
+
+   pmic: pfuze3000@8 {
+   compatible = "fsl,pfuze3000";
+   reg = <0x08>;
+
+   regulators {
+   sw1a_reg: sw1a {
+   regulator-min-microvolt = <70>;
+   regulator-max-microvolt = <1475000>;
+   regulator-boot-on;
+   regulator-always-on;
+   regulator-ramp-delay = <6250>;
+   };
+
+   /* use sw1c_reg to align with pfuze100/pfuze200 */
+   sw1c_reg: sw1b {
+   regulator-min-microvolt = <70>;
+   regulator-max-microvolt = <1475000>;
+   regulator-boot-on;
+   regulator-always-on;
+   regulator-ramp-delay = <6250>;
+   };
+
+   sw2_reg: sw2 {
+   regulator-min-microvolt = <150>;
+   regulator-max-microvolt = <185>;
+   regulator-boot-on;
+   regulator-always-on;
+   };
+
+   sw3a_reg: sw3 {
+   regulator-min-microvolt = <90>;
+   regulator-max-microvolt = <165>;
+   

[U-Boot] [PATCH 6/8] warp7: defconfig: Switch on DM GPIO for both warp7 ports

2019-01-02 Thread Bryan O'Donoghue
This patch switches on DM_GPIO for both WaRP7 ports.

Signed-off-by: Bryan O'Donoghue 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 configs/warp7_bl33_defconfig | 1 +
 configs/warp7_defconfig  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index a2c2555315..7f21bb4f53 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -43,3 +43,4 @@ CONFIG_OPTEE_TZDRAM_SIZE=0x200
 CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
+CONFIG_DM_GPIO=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 8691d00491..2d3171e42a 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -56,3 +56,4 @@ CONFIG_BOOTM_OPTEE=y
 CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
+CONFIG_DM_GPIO=y
-- 
2.20.0

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


[U-Boot] [PATCH 7/8] warp7: defconfig: Switch to DM for I2C

2019-01-02 Thread Bryan O'Donoghue
This commit switches to DM I2C for warp7 and warp7_bl33 defconfigs.

Signed-off-by: Bryan O'Donoghue 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 board/warp7/warp7.c  | 24 
 configs/warp7_bl33_defconfig |  1 +
 configs/warp7_defconfig  |  1 +
 include/configs/warp7.h  |  2 --
 4 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index 146d722b15..19f0df4d09 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -31,26 +31,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define UART_PAD_CTRL  (PAD_CTL_DSE_3P3V_49OHM | PAD_CTL_PUS_PU100KOHM | \
PAD_CTL_HYS)
 
-#define I2C_PAD_CTRL   (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \
-   PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU100KOHM)
-
-#ifdef CONFIG_SYS_I2C_MXC
-#define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
-/* I2C1 for PMIC */
-static struct i2c_pads_info i2c_pad_info1 = {
-   .scl = {
-   .i2c_mode = MX7D_PAD_I2C1_SCL__I2C1_SCL | PC,
-   .gpio_mode = MX7D_PAD_I2C1_SCL__GPIO4_IO8 | PC,
-   .gp = IMX_GPIO_NR(4, 8),
-   },
-   .sda = {
-   .i2c_mode = MX7D_PAD_I2C1_SDA__I2C1_SDA | PC,
-   .gpio_mode = MX7D_PAD_I2C1_SDA__GPIO4_IO9 | PC,
-   .gp = IMX_GPIO_NR(4, 9),
-   },
-};
-#endif
-
 int dram_init(void)
 {
gd->ram_size = PHYS_SDRAM_SIZE;
@@ -130,10 +110,6 @@ int board_init(void)
/* address of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
-   #ifdef CONFIG_SYS_I2C_MXC
-   setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
-   #endif
-
return 0;
 }
 
diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index 7f21bb4f53..2e80011cbc 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -44,3 +44,4 @@ CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_I2C=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 2d3171e42a..9f7dc73a11 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -57,3 +57,4 @@ CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_I2C=y
diff --git a/include/configs/warp7.h b/include/configs/warp7.h
index a391dfb5c1..41eb8d7e1d 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -126,9 +126,7 @@
(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
 /* I2C configs */
-#define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_MXC
-#define CONFIG_SYS_I2C_MXC_I2C1
 #define CONFIG_SYS_I2C_SPEED   10
 
 /* PMIC */
-- 
2.20.0

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


[U-Boot] [PATCH 5/8] warp7: defconfig: Switch on IMX7 pinctrl for both ports

2019-01-02 Thread Bryan O'Donoghue
Switches on the IMX7 pinctrl driver for the warp7 and warp7_bl33 ports,
necessary to convert over to DM for this board.

Signed-off-by: Bryan O'Donoghue 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 configs/warp7_bl33_defconfig | 2 ++
 configs/warp7_defconfig  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index b2f943c775..a2c2555315 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -41,3 +41,5 @@ CONFIG_USB_ETH_CDC=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_OPTEE_TZDRAM_SIZE=0x200
 CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX7=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 65d801ffe2..8691d00491 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -54,3 +54,5 @@ CONFIG_OPTEE_TZDRAM_SIZE=0x300
 CONFIG_OPTEE_TZDRAM_BASE=0x9d00
 CONFIG_BOOTM_OPTEE=y
 CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX7=y
-- 
2.20.0

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


[U-Boot] [PATCH 2/8] arm: imx7s-warp: Add DT file hooks

2019-01-02 Thread Bryan O'Donoghue
This patch adds DT file hooks for imx7s-warp.dtb to the warp7 and
warp7_bl33 builds.

Signed-off-by: Bryan O'Donoghue 
Cc: Albert Aribaud 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 arch/arm/dts/Makefile| 3 ++-
 configs/warp7_bl33_defconfig | 3 ++-
 configs/warp7_defconfig  | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index dda4e59491..4fe7e90902 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -460,7 +460,8 @@ dtb-$(CONFIG_MX6ULL) += imx6ull-14x14-evk.dtb
 
 dtb-$(CONFIG_MX7) += imx7-colibri.dtb \
imx7d-sdb.dtb \
-   imx7d-sdb-qspi.dtb
+   imx7d-sdb-qspi.dtb \
+   imx7s-warp.dtb
 
 dtb-$(CONFIG_ARCH_MX7ULP) += imx7ulp-evk.dtb
 
diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index a568c6d10e..12141fedd3 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -20,6 +20,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DFU_MMC=y
@@ -37,5 +38,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
 CONFIG_USB_ETH_CDC=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
-CONFIG_OF_LIBFDT=y
 CONFIG_OPTEE_TZDRAM_SIZE=0x200
+CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 4d443295ba..fee98dfbbe 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -29,6 +29,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DFU_MMC=y
@@ -47,8 +48,8 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
 CONFIG_USB_ETH_CDC=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
-CONFIG_OF_LIBFDT=y
 CONFIG_OPTEE_LOAD_ADDR=0x8400
 CONFIG_OPTEE_TZDRAM_SIZE=0x300
 CONFIG_OPTEE_TZDRAM_BASE=0x9d00
 CONFIG_BOOTM_OPTEE=y
+CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
-- 
2.20.0

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


[U-Boot] [PATCH 3/8] arm: imx7s-warp: Convert to DM MMC initialization

2019-01-02 Thread Bryan O'Donoghue
Converts from fixed initialization of MMC to DM initialization of MMC.

Signed-off-by: Bryan O'Donoghue 
Cc: Albert Aribaud 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 arch/arm/dts/imx7s-warp.dts  | 11 ---
 board/warp7/warp7.c  | 34 --
 configs/warp7_bl33_defconfig |  1 +
 configs/warp7_defconfig  |  1 +
 4 files changed, 2 insertions(+), 45 deletions(-)

diff --git a/arch/arm/dts/imx7s-warp.dts b/arch/arm/dts/imx7s-warp.dts
index c44db20734..615ed7ed80 100644
--- a/arch/arm/dts/imx7s-warp.dts
+++ b/arch/arm/dts/imx7s-warp.dts
@@ -251,17 +251,6 @@
status = "okay";
 };
 
-&usdhc1 {
-   pinctrl-names = "default";
-   pinctrl-0 = <&pinctrl_usdhc1>;
-   bus-width = <4>;
-   keep-power-in-suspend;
-   no-1-8-v;
-   non-removable;
-   vmmc-supply = <®_brcm>;
-   status = "okay";
-};
-
 &usdhc3 {
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <&pinctrl_usdhc3>;
diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index 3d32b3eb52..146d722b15 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -30,8 +30,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define UART_PAD_CTRL  (PAD_CTL_DSE_3P3V_49OHM | PAD_CTL_PUS_PU100KOHM | \
PAD_CTL_HYS)
-#define USDHC_PAD_CTRL (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW |\
-   PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU47KOHM)
 
 #define I2C_PAD_CTRL   (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \
PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU100KOHM)
@@ -74,43 +72,11 @@ static iomux_v3_cfg_t const uart1_pads[] = {
MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
 };
 
-static iomux_v3_cfg_t const usdhc3_pads[] = {
-   MX7D_PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA4__SD3_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA5__SD3_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA6__SD3_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA7__SD3_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_RESET_B__SD3_RESET_B | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-};
-
 static void setup_iomux_uart(void)
 {
imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
 };
 
-static struct fsl_esdhc_cfg usdhc_cfg[1] = {
-   {USDHC3_BASE_ADDR},
-};
-
-int board_mmc_getcd(struct mmc *mmc)
-{
-   /* Assume uSDHC3 emmc is always present */
-   return 1;
-}
-
-int board_mmc_init(bd_t *bis)
-{
-   imx_iomux_v3_setup_multiple_pads(usdhc3_pads, ARRAY_SIZE(usdhc3_pads));
-   usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
-
-   return fsl_esdhc_initialize(bis, &usdhc_cfg[0]);
-}
-
 int board_early_init_f(void)
 {
setup_iomux_uart();
diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index 12141fedd3..b2f943c775 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -24,6 +24,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DFU_MMC=y
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index fee98dfbbe..65d801ffe2 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -33,6 +33,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DFU_MMC=y
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_OPTEE=y
 CONFIG_USB=y
-- 
2.20.0

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


u-boot@lists.denx.de

2019-01-02 Thread Bryan O'Donoghue
This patch sets up an alias for mmc0 to usdhc3.

Before the DM conversion only usdhc3 was enabled and therefore it appeared
as MMC 0 to u-boot. After enabling MMC DM though usdhc3 defaults to MMC 2,
which left unattended would drive changes to existing warp7 bootscripts and
environment variables that rely on mmc 0.

Setup the alias of mmc0 and usdhc3 so that existing warp7 boot code will
work unmodified.

Signed-off-by: Bryan O'Donoghue 
Cc: Albert Aribaud 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 arch/arm/dts/imx7s-warp.dts | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/imx7s-warp.dts b/arch/arm/dts/imx7s-warp.dts
index 615ed7ed80..279f02ecef 100644
--- a/arch/arm/dts/imx7s-warp.dts
+++ b/arch/arm/dts/imx7s-warp.dts
@@ -17,6 +17,10 @@
reg = <0x8000 0x2000>;
};
 
+   aliases {
+   mmc0 = &usdhc3;
+   };
+
gpio-keys {
compatible = "gpio-keys";
pinctrl-0 = <&pinctrl_gpio>;
-- 
2.20.0

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


[U-Boot] [PATCH 8/8] arm: imx7s-warp: Convert to DM PMIC

2019-01-02 Thread Bryan O'Donoghue
This patch converts the warp7 and warp7_bl33 board ports over to using the
DM PMIC model.

Signed-off-by: Bryan O'Donoghue 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 board/warp7/warp7.c  | 27 +++
 configs/warp7_bl33_defconfig |  6 ++
 configs/warp7_defconfig  |  6 ++
 include/configs/warp7.h  |  6 --
 4 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index 19f0df4d09..6ebeb08e33 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -64,29 +64,24 @@ int board_early_init_f(void)
return 0;
 }
 
-#ifdef CONFIG_POWER
-#define I2C_PMIC   0
-static struct pmic *pfuze;
+#ifdef CONFIG_DM_PMIC
 int power_init_board(void)
 {
-   int ret;
-   unsigned int reg, rev_id;
+   struct udevice *dev;
+   int ret, dev_id, rev_id;
 
-   ret = power_pfuze3000_init(I2C_PMIC);
-   if (ret)
+   ret = pmic_get("pfuze3000", &dev);
+   if (ret == -ENODEV)
+   return 0;
+   if (ret != 0)
return ret;
 
-   pfuze = pmic_get("PFUZE3000");
-   ret = pmic_probe(pfuze);
-   if (ret)
-   return ret;
-
-   pmic_reg_read(pfuze, PFUZE3000_DEVICEID, ®);
-   pmic_reg_read(pfuze, PFUZE3000_REVID, &rev_id);
-   printf("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n", reg, rev_id);
+   dev_id = pmic_reg_read(dev, PFUZE3000_DEVICEID);
+   rev_id = pmic_reg_read(dev, PFUZE3000_REVID);
+   printf("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n", dev_id, rev_id);
 
/* disable Low Power Mode during standby mode */
-   pmic_reg_write(pfuze, PFUZE3000_LDOGCTL, 0x1);
+   pmic_clrsetbits(dev, PFUZE3000_LDOGCTL, 0, 1);
 
return 0;
 }
diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index 2e80011cbc..7b40bfbd6d 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -45,3 +45,9 @@ CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_I2C=y
+CONFIG_DM_PMIC=y
+CONFIG_DM_PMIC_PFUZE100=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_PFUZE100=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 9f7dc73a11..d1c8e403a7 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -58,3 +58,9 @@ CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_I2C=y
+CONFIG_DM_PMIC=y
+CONFIG_DM_PMIC_PFUZE100=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_PFUZE100=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
diff --git a/include/configs/warp7.h b/include/configs/warp7.h
index 41eb8d7e1d..043f2861b6 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -129,12 +129,6 @@
 #define CONFIG_SYS_I2C_MXC
 #define CONFIG_SYS_I2C_SPEED   10
 
-/* PMIC */
-#define CONFIG_POWER
-#define CONFIG_POWER_I2C
-#define CONFIG_POWER_PFUZE3000
-#define CONFIG_POWER_PFUZE3000_I2C_ADDR0x08
-
 /* environment organization */
 #define CONFIG_ENV_SIZESZ_8K
 
-- 
2.20.0

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


Re: [U-Boot] Booting on RK3399

2019-01-02 Thread Mark Kettenis
> From: Simon Glass 
> Date: Wed, 2 Jan 2019 18:15:31 -0700
> 
> Hi Kever,
> 
> I have a firefly-rk3399 and would like to boot it into U-Boot (as a start)
> from an uSD card.
> 
> Are there instructions somewhere on how to do this? I gather that I need
> OP-TEE but not how to build it or how to put the image together. I would
> like to have instructions in README.rockchip if possible.
> 
> I'm planning to add U-Boot support for bob and maybe kevin (both
> Chromebooks) but am not sure where to start. I thought the firefly might be
> best since it is pretty common.

Hi Simon,

The instructions in board/u-boot/rockchip/evb_rk3399/README apply to
the firefly-rk3399 as well.  I've successfully built working firmware
for my board using the TF-A (ATF) 2.0 release and U-Boot SPL in the
past that way.

One complication with the firefly board is that by default it boots
from eMMC, so you can't easily test new firmware by putting it on uSD
card unless you make the eMMC unbootable somehow (e.g. by overwriting
the start of the eMMC storage with zeroes).  In that case you can boot
from uSD card if you write U-Boot SPL and U-Boot proper at the right
offsets:

# dd if=idbspl.img of=/dev/sd1c seek=64
# dd if=u-boot.itb of=/dev/sd1c seek=16384

(that's on OpenBSD, on Linux the device names will be different)

Haven't tested flashing eMMC with rkdeveloptool myself, but that
should work on the firefly as well.

Another complication as that the serial console speed defaults to
150 which isn't supported by all serial-to-USB chips and frankly
too sensitive to wire noise.  Also be aware that TF-A built from the
official ARM sources at

  https://github.com/ARM-software/arm-trusted-firmware.git

defaults to 115200 (which is more reasonable IMHO).  So I have the
following diff in my U-Boot tree.  The device tree change comes in
handy if you want to boot from uSD card, otherwise U-Boot SPL will
attempt to load the full U-Boot from eMMC.  Perhaps that bit should be
committed at some point.

Having support for bob would be great.  I have one, and would like to
make OpenBSD run on it.

Cheers,

Mark


diff --git a/arch/arm/dts/rk3399-firefly.dts b/arch/arm/dts/rk3399-firefly.dts
index be350866a7..f90e7e88db 100644
--- a/arch/arm/dts/rk3399-firefly.dts
+++ b/arch/arm/dts/rk3399-firefly.dts
@@ -15,7 +15,7 @@
 
chosen {
stdout-path = &uart2;
-   u-boot,spl-boot-order = &sdhci, &sdmmc;
+   u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
};
 
backlight: backlight {
diff --git a/configs/firefly-rk3399_defconfig b/configs/firefly-rk3399_defconfig
index 7ac4064a8b..01b3a0771f 100644
--- a/configs/firefly-rk3399_defconfig
+++ b/configs/firefly-rk3399_defconfig
@@ -58,7 +58,7 @@ CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_RAM=y
 CONFIG_SPL_RAM=y
-CONFIG_BAUDRATE=150
+CONFIG_BAUDRATE=115200
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYSRESET=y
 CONFIG_USB=y
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] MTD: mxs_nand: Fix BCH read timeout error on boards requiring ECC

2019-01-02 Thread Adam Ford
The LogicPD board uses a Micron Flash with ECC.  To boot this from
SPL, the ECC needs to be correctly configured or the BCH engine
times out.

Signed-off-by: Adam Ford 

diff --git a/drivers/mtd/nand/raw/mxs_nand.c b/drivers/mtd/nand/raw/mxs_nand.c
index e3341812a2..2d84bfffe2 100644
--- a/drivers/mtd/nand/raw/mxs_nand.c
+++ b/drivers/mtd/nand/raw/mxs_nand.c
@@ -1163,6 +1163,12 @@ int mxs_nand_init_spl(struct nand_chip *nand)
 
nand_info->gpmi_regs = (struct mxs_gpmi_regs *)MXS_GPMI_BASE;
nand_info->bch_regs = (struct mxs_bch_regs *)MXS_BCH_BASE;
+
+   if (is_mx6sx() || is_mx7())
+   nand_info->max_ecc_strength_supported = 62;
+   else
+   nand_info->max_ecc_strength_supported = 40;
+
err = mxs_nand_alloc_buffers(nand_info);
if (err)
return err;
diff --git a/drivers/mtd/nand/raw/mxs_nand_spl.c 
b/drivers/mtd/nand/raw/mxs_nand_spl.c
index c628f3adec..ba85baac60 100644
--- a/drivers/mtd/nand/raw/mxs_nand_spl.c
+++ b/drivers/mtd/nand/raw/mxs_nand_spl.c
@@ -201,6 +201,7 @@ static int mxs_nand_init(void)
/* setup flash layout (does not scan as we override that) */
mtd->size = nand_chip.chipsize;
nand_chip.scan_bbt(mtd);
+   mxs_nand_setup_ecc(mtd);
 
return 0;
 }
-- 
2.17.1

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


Re: [U-Boot] Booting on RK3399

2019-01-02 Thread Simon Glass
HI Mark,

On Wed, 2 Jan 2019 at 18:50, Mark Kettenis  wrote:
>
> > From: Simon Glass 
> > Date: Wed, 2 Jan 2019 18:15:31 -0700
> >
> > Hi Kever,
> >
> > I have a firefly-rk3399 and would like to boot it into U-Boot (as a start)
> > from an uSD card.
> >
> > Are there instructions somewhere on how to do this? I gather that I need
> > OP-TEE but not how to build it or how to put the image together. I would
> > like to have instructions in README.rockchip if possible.
> >
> > I'm planning to add U-Boot support for bob and maybe kevin (both
> > Chromebooks) but am not sure where to start. I thought the firefly might be
> > best since it is pretty common.
>
> Hi Simon,
>
> The instructions in board/u-boot/rockchip/evb_rk3399/README apply to
> the firefly-rk3399 as well.  I've successfully built working firmware
> for my board using the TF-A (ATF) 2.0 release and U-Boot SPL in the
> past that way.

Thanks for the pointer. That was the file I was looking for and I
didn't think to look at the evb.

>
> One complication with the firefly board is that by default it boots
> from eMMC, so you can't easily test new firmware by putting it on uSD
> card unless you make the eMMC unbootable somehow (e.g. by overwriting
> the start of the eMMC storage with zeroes).  In that case you can boot
> from uSD card if you write U-Boot SPL and U-Boot proper at the right
> offsets:
>
> # dd if=idbspl.img of=/dev/sd1c seek=64
> # dd if=u-boot.itb of=/dev/sd1c seek=16384
>
> (that's on OpenBSD, on Linux the device names will be different)

Yes I did that with my board, so it already boots from uSD.

>
> Haven't tested flashing eMMC with rkdeveloptool myself, but that
> should work on the firefly as well.
>
> Another complication as that the serial console speed defaults to
> 150 which isn't supported by all serial-to-USB chips and frankly

Yes I seem to have one that supports this, so this is fine.

> too sensitive to wire noise.  Also be aware that TF-A built from the
> official ARM sources at
>
>   https://github.com/ARM-software/arm-trusted-firmware.git
>
> defaults to 115200 (which is more reasonable IMHO).  So I have the
> following diff in my U-Boot tree.  The device tree change comes in
> handy if you want to boot from uSD card, otherwise U-Boot SPL will
> attempt to load the full U-Boot from eMMC.  Perhaps that bit should be
> committed at some point.
>
> Having support for bob would be great.  I have one, and would like to
> make OpenBSD run on it.

OK well I think I'll start with an existing board and then see what is needed.

Regards,
Simon

>
> Cheers,
>
> Mark
>
>
> diff --git a/arch/arm/dts/rk3399-firefly.dts b/arch/arm/dts/rk3399-firefly.dts
> index be350866a7..f90e7e88db 100644
> --- a/arch/arm/dts/rk3399-firefly.dts
> +++ b/arch/arm/dts/rk3399-firefly.dts
> @@ -15,7 +15,7 @@
>
> chosen {
> stdout-path = &uart2;
> -   u-boot,spl-boot-order = &sdhci, &sdmmc;
> +   u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
> };
>
> backlight: backlight {
> diff --git a/configs/firefly-rk3399_defconfig 
> b/configs/firefly-rk3399_defconfig
> index 7ac4064a8b..01b3a0771f 100644
> --- a/configs/firefly-rk3399_defconfig
> +++ b/configs/firefly-rk3399_defconfig
> @@ -58,7 +58,7 @@ CONFIG_REGULATOR_RK8XX=y
>  CONFIG_PWM_ROCKCHIP=y
>  CONFIG_RAM=y
>  CONFIG_SPL_RAM=y
> -CONFIG_BAUDRATE=150
> +CONFIG_BAUDRATE=115200
>  CONFIG_DEBUG_UART_SHIFT=2
>  CONFIG_SYSRESET=y
>  CONFIG_USB=y
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


  1   2   >