Re: [U-Boot] [PATCH v2 4/4] mmc: zynq: Add fdt max-frequency support

2016-11-27 Thread Michal Simek
On 25.11.2016 14:59, Stefan Herbrechtsmeier wrote:
> The maximum supported peripheral clock frequency of the zynq depends on
> the IO routing. The MIO and EMIO support a maximum frequency of 50 MHz
> respectively 25 MHz. Use the max-frequency value of the device tree to
> determine the maximal supported peripheral clock frequency.
> 
> Signed-off-by: Stefan Herbrechtsmeier 
> 
> ---
> 
> Changes in v2: None
> 
>  drivers/mmc/zynq_sdhci.c | 9 -
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
> index 26bd1be..4d2f0b5 100644
> --- a/drivers/mmc/zynq_sdhci.c
> +++ b/drivers/mmc/zynq_sdhci.c
> @@ -16,6 +16,8 @@
>  
>  #include 
>  
> +DECLARE_GLOBAL_DATA_PTR;
> +
>  #ifndef CONFIG_ZYNQ_SDHCI_MIN_FREQ
>  # define CONFIG_ZYNQ_SDHCI_MIN_FREQ  0
>  #endif
> @@ -23,6 +25,7 @@
>  struct arasan_sdhci_plat {
>   struct mmc_config cfg;
>   struct mmc mmc;
> + unsigned int f_max;
>  };
>  
>  static int arasan_sdhci_probe(struct udevice *dev)
> @@ -67,7 +70,7 @@ static int arasan_sdhci_probe(struct udevice *dev)
>  
>   host->max_clk = clock;
>  
> - ret = sdhci_setup_cfg(>cfg, host, CONFIG_ZYNQ_SDHCI_MAX_FREQ,
> + ret = sdhci_setup_cfg(>cfg, host, plat->f_max,
> CONFIG_ZYNQ_SDHCI_MIN_FREQ);
>   host->mmc = >mmc;
>   if (ret)
> @@ -81,11 +84,15 @@ static int arasan_sdhci_probe(struct udevice *dev)
>  
>  static int arasan_sdhci_ofdata_to_platdata(struct udevice *dev)
>  {
> + struct arasan_sdhci_plat *plat = dev_get_platdata(dev);
>   struct sdhci_host *host = dev_get_priv(dev);
>  
>   host->name = dev->name;
>   host->ioaddr = (void *)dev_get_addr(dev);
>  
> + plat->f_max = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
> + "max-frequency", CONFIG_ZYNQ_SDHCI_MAX_FREQ);
> +
>   return 0;
>  }
>  
> 

Acked-by: Michal Simek 

Thanks,
Michal

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


Re: [U-Boot] [PATCH v2 3/4] mmc: zynq: Determine base clock frequency via clock framework

2016-11-27 Thread Michal Simek
Hi, +Siva,

On 25.11.2016 14:59, Stefan Herbrechtsmeier wrote:
> The zynq_sdhci controller driver use CONFIG_ZYNQ_SDHCI_MAX_FREQ as base
> clock frequency but this clock is not fixed and depends on the hardware
> configuration. Additionally the value of CONFIG_ZYNQ_SDHCI_MAX_FREQ
> doesn't match the real base clock frequency of SDIO_FREQ. Use the clock
> framework to determine the frequency at run time.
> 
> Signed-off-by: Stefan Herbrechtsmeier 
> 
> ---
> 
> Changes in v2:
> - Remove unused index from get sdio clock function
> - Introduce common get clock function
> 
>  arch/arm/mach-zynq/clk.c  | 50 
> ---
>  arch/arm/mach-zynq/include/mach/clk.h |  1 +
>  drivers/mmc/zynq_sdhci.c  | 33 +--
>  3 files changed, 72 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-zynq/clk.c b/arch/arm/mach-zynq/clk.c
> index e256b58..8df2de2 100644
> --- a/arch/arm/mach-zynq/clk.c
> +++ b/arch/arm/mach-zynq/clk.c
> @@ -550,20 +550,26 @@ void zynq_clk_early_init(void)
>  }
>  
>  /**
> - * get_uart_clk() - Get UART input frequency
> - * Returns UART input clock frequency in Hz.
> + * zynq_clk_get_early() - Get zynq clock frequency early
> + * Returns clock frequency in Hz.
>   *
>   * Compared to zynq_clk_get_rate() this function is designed to work before
> - * relocation and can be called when the serial UART is set up.
> + * relocation and can be called when the peripheral is set up.
>   */
> -unsigned long get_uart_clk(void)
> +unsigned long zynq_clk_get_early(u32 *addr)
>  {
> - u32 reg = readl(_base->uart_clk_ctrl);
> - u32 div = (reg & CLK_CTRL_DIV0_MASK) >> CLK_CTRL_DIV0_SHIFT;
> - u32 srcsel = (reg & CLK_CTRL_SRCSEL_MASK) >> CLK_CTRL_SRCSEL_SHIFT;
> - enum zynq_clk parent = __zynq_clk_periph_get_parent(srcsel);
> - u32 *pllreg = clkid_2_register(parent);
> - unsigned long prate = __zynq_clk_pll_get_rate(pllreg);
> + u32 reg, div, srcsel;
> + enum zynq_clk parent;
> + u32 *pllreg;
> + unsigned long prate;
> +
> + reg = readl(addr);
> + div = (reg & CLK_CTRL_DIV0_MASK) >> CLK_CTRL_DIV0_SHIFT;
> + srcsel = (reg & CLK_CTRL_SRCSEL_MASK) >> CLK_CTRL_SRCSEL_SHIFT;
> +
> + parent = __zynq_clk_periph_get_parent(srcsel);
> + pllreg = clkid_2_register(parent);
> + prate = __zynq_clk_pll_get_rate(pllreg);
>  
>   if (!div)
>   div = 1;
> @@ -572,6 +578,30 @@ unsigned long get_uart_clk(void)
>  }
>  
>  /**
> + * get_uart_clk() - Get UART input frequency
> + * Returns UART input clock frequency in Hz.
> + *
> + * Compared to zynq_clk_get_rate() this function is designed to work before
> + * relocation and can be called when the serial UART is set up.
> + */
> +unsigned long get_uart_clk(void)
> +{
> + return zynq_clk_get_early(_base->uart_clk_ctrl);
> +}
> +
> +/**
> + * get_sdio_clk() - Get SDIO input frequency
> + * Returns SDIO input clock frequency in Hz.
> + *
> + * Compared to zynq_clk_get_rate() this function is designed to work before
> + * relocation and can be called when the SDIO is set up.
> + */
> +unsigned long get_sdio_clk(void)
> +{
> + return zynq_clk_get_early(_base->sdio_clk_ctrl);
> +}
> +
> +/**
>   * set_cpu_clk_info() - Initialize clock framework
>   * Always returns zero.
>   *
> diff --git a/arch/arm/mach-zynq/include/mach/clk.h 
> b/arch/arm/mach-zynq/include/mach/clk.h
> index ba2210d..bed4903 100644
> --- a/arch/arm/mach-zynq/include/mach/clk.h
> +++ b/arch/arm/mach-zynq/include/mach/clk.h
> @@ -25,5 +25,6 @@ int zynq_clk_set_rate(enum zynq_clk clk, unsigned long 
> rate);
>  unsigned long zynq_clk_get_rate(enum zynq_clk clk);
>  const char *zynq_clk_get_name(enum zynq_clk clk);
>  unsigned long get_uart_clk(void);
> +unsigned long get_sdio_clk(void);
>  
>  #endif
> diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
> index 69efa38..26bd1be 100644
> --- a/drivers/mmc/zynq_sdhci.c
> +++ b/drivers/mmc/zynq_sdhci.c
> @@ -6,6 +6,7 @@
>   * SPDX-License-Identifier:  GPL-2.0+
>   */
>  
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -13,6 +14,8 @@
>  #include 
>  #include 
>  
> +#include 
> +
>  #ifndef CONFIG_ZYNQ_SDHCI_MIN_FREQ
>  # define CONFIG_ZYNQ_SDHCI_MIN_FREQ  0
>  #endif
> @@ -27,8 +30,34 @@ static int arasan_sdhci_probe(struct udevice *dev)
>   struct arasan_sdhci_plat *plat = dev_get_platdata(dev);
>   struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
>   struct sdhci_host *host = dev_get_priv(dev);
> + unsigned long clock;
>   int ret;
>  
> +#if defined(CONFIG_CLK) || defined(CONFIG_SPL_CLK)
> + struct clk clk;
> +
> + ret = clk_get_by_index(dev, 0, );
> + if (ret < 0) {
> + dev_err(dev, "failed to get clock\n");
> + return ret;
> + }
> +
> + clock = clk_get_rate();
> + if (IS_ERR_VALUE(clock)) {
> + dev_err(dev, "failed to get rate\n");
> + return 

Re: [U-Boot] [PATCH v2 2/4] serial: zynq: Remove unused index from get uart clock function

2016-11-27 Thread Michal Simek
On 25.11.2016 14:59, Stefan Herbrechtsmeier wrote:
> The index of the zynq serial driver is always zero and could be removed.
> 
> Signed-off-by: Stefan Herbrechtsmeier 
> 
> ---
> 
> Changes in v2:
> - Remove unused index from get uart clock function
> 
>  arch/arm/mach-zynq/clk.c  | 3 +--
>  arch/arm/mach-zynq/include/mach/clk.h | 2 +-
>  drivers/serial/serial_zynq.c  | 2 +-
>  3 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-zynq/clk.c b/arch/arm/mach-zynq/clk.c
> index 40383c1..e256b58 100644
> --- a/arch/arm/mach-zynq/clk.c
> +++ b/arch/arm/mach-zynq/clk.c
> @@ -551,13 +551,12 @@ void zynq_clk_early_init(void)
>  
>  /**
>   * get_uart_clk() - Get UART input frequency
> - * @dev_index:   UART ID
>   * Returns UART input clock frequency in Hz.
>   *
>   * Compared to zynq_clk_get_rate() this function is designed to work before
>   * relocation and can be called when the serial UART is set up.
>   */
> -unsigned long get_uart_clk(int dev_index)
> +unsigned long get_uart_clk(void)
>  {
>   u32 reg = readl(_base->uart_clk_ctrl);
>   u32 div = (reg & CLK_CTRL_DIV0_MASK) >> CLK_CTRL_DIV0_SHIFT;
> diff --git a/arch/arm/mach-zynq/include/mach/clk.h 
> b/arch/arm/mach-zynq/include/mach/clk.h
> index 250c5bc..ba2210d 100644
> --- a/arch/arm/mach-zynq/include/mach/clk.h
> +++ b/arch/arm/mach-zynq/include/mach/clk.h
> @@ -24,6 +24,6 @@ void zynq_clk_early_init(void);
>  int zynq_clk_set_rate(enum zynq_clk clk, unsigned long rate);
>  unsigned long zynq_clk_get_rate(enum zynq_clk clk);
>  const char *zynq_clk_get_name(enum zynq_clk clk);
> -unsigned long get_uart_clk(int dev_id);
> +unsigned long get_uart_clk(void);
>  
>  #endif
> diff --git a/drivers/serial/serial_zynq.c b/drivers/serial/serial_zynq.c
> index 4f6e7e4..461ba86 100644
> --- a/drivers/serial/serial_zynq.c
> +++ b/drivers/serial/serial_zynq.c
> @@ -134,7 +134,7 @@ int zynq_serial_setbrg(struct udevice *dev, int baudrate)
>   return ret;
>   }
>  #else
> - clock = get_uart_clk(0);
> + clock = get_uart_clk();
>  #endif
>   _uart_zynq_serial_setbrg(priv->regs, clock, baudrate);
>  
> 

Not a problem with this patch but real solution for this is code above.
When we move zynq clk driver to DM then we should remove these functions
entirely.

Anyway
Acked-by: Michal Simek 

Thanks,
Michal

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


Re: [U-Boot] [PATCH] net: zynq_gem: Return 0 on success, not -ENOSYS

2016-11-27 Thread Michal Simek
On 25.11.2016 16:41, Olliver Schinagl wrote:
> The .read_rom_hwaddr net_ops hook does not check the return value, which
> is why it was never caught that we are currently returning 0 if the
> read_rom_hwaddr function return -ENOSYS and -ENOSYS otherwise.
> 
> In this case we can simplify this by just returning the result of the
> function.
> 
> Signed-off-by: Olliver Schinagl 
> ---
>  drivers/net/zynq_gem.c | 8 +++-
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
> index 8b7c1be..04a3fd4 100644
> --- a/drivers/net/zynq_gem.c
> +++ b/drivers/net/zynq_gem.c
> @@ -593,14 +593,12 @@ __weak int zynq_board_read_rom_ethaddr(unsigned char 
> *ethaddr)
>  
>  static int zynq_gem_read_rom_mac(struct udevice *dev)
>  {
> - int retval;
>   struct eth_pdata *pdata = dev_get_platdata(dev);
>  
> - retval = zynq_board_read_rom_ethaddr(pdata->enetaddr);
> - if (retval == -ENOSYS)
> - retval = 0;
> + if (!dev)
> + return -ENOSYS;
>  
> - return retval;
> + return zynq_board_read_rom_ethaddr(pdata->enetaddr);
>  }
>  
>  static int zynq_gem_miiphy_read(struct mii_dev *bus, int addr,
> 

Not a problem with the patch above but I hope to get rid of this whole
function by using MAC reading from eeprom.

Also board specific functions should return error value when read is not
possible.

Acked-by: Michal Simek 

Thanks,
Michal

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


Re: [U-Boot] [PATCH] cmd: usb: run 'usb start' when USB is stopped

2016-11-27 Thread Minkyu Kang
Hi Jaehoon,

On 28/11/16 14:08, Jaehoon Chung wrote:
> Hi Marek,
> 
> On 09/23/2016 01:15 PM, Simon Glass wrote:
>> +Marek
>>
>> On 9 September 2016 at 04:20, Jaehoon Chung  wrote:
>>> If USB is stopped, just run 'usb start' instead of printing message.
>>> Then user didn't consider whether usb is started or stopped.
> 
> Do you have any other opinion for this? :)
> 
> Best Regards,
> Jaehoon Chung
> 
>>>
>>> Signed-off-by: Jaehoon Chung 
>>> ---
>>>  cmd/usb.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/cmd/usb.c b/cmd/usb.c
>>> index 455127c..4970851 100644
>>> --- a/cmd/usb.c
>>> +++ b/cmd/usb.c
>>> @@ -651,8 +651,8 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, 
>>> char * const argv[])
>>> return 0;
>>> }
>>> if (!usb_started) {
>>> -   printf("USB is stopped. Please issue 'usb start' first.\n");
>>> -   return 1;
>>> +   printf("USB is stopped. Running 'usb start' first.\n");
>>> +   do_usb_start();
>>> }

It seems to ambiguous whether initialization was succeed or not.

Thanks,
Minkyu Kang.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Macronix NOR_SPI and Quad I/O

2016-11-27 Thread Chin Liang See
On Sab, 2016-11-26 at 08:43 +0530, Jagan Teki wrote:
> On Fri, Nov 25, 2016 at 10:07 PM, Champ, Andy 
> wrote:
> > 
> > Hi all,
> > 
> > 
> > in the table in drivers/mtd/spi/spi_flash_ids.c there is a flag
> > WR_QPP set against Macronix devices (including the ones Dumitru is
> > just adding).
> > 
> > 
> > This is used when programming the devices on a 4-bit bus to select
> > the command to use for programming - either CMD_QUAD_PAGE_PROGRAM
> > (0x32) or CMD_PAGE_PROGRAM (0x2).
> > 
> > 
> > The Macronix devices that I have a spec for do not mention command
> > 0x32. Each of the devices that I have a spec for ( MX25L25635F
> > MX25U51245G MX25V8035F and MX25V1635F ) use command 0x38 instead.
> We need to fix this, till now no Macronix has been tested with QUAD I
> think, please send the suitable fix will review.
> 

Too bad that I don't have any Macronix part with me too.

Thanks
Chin Liang

> thanks!
> --
> Jagan Teki
> Free Software Engineer | www.openedev.com
> U-Boot, Linux | Upstream Maintainer
> Hyderabad, India.
> 
> 
> 
> Confidentiality Notice.
> This message may contain information that is confidential or
> otherwise protected from disclosure. If you are not the intended
> recipient, you are hereby notified that any use, disclosure,
> dissemination, distribution, or copying of this message, or any
> attachments, is strictly prohibited. If you have received this
> message in error, please advise the sender by reply e-mail, and
> delete the message and any attachments. Thank you.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: xhci: Limit transfer length in a single TD

2016-11-27 Thread Dongwoo Lee
On 11/26/2016 03:25 AM, Marek Vasut wrote:
> On 11/22/2016 03:42 AM, Dongwoo Lee wrote:
>> On 2016년 11월 18일 23:01, Marek Vasut wrote:
>>> On 11/18/2016 08:24 AM, Jaehoon Chung wrote:
 Hi,

 Added Marek as USB maintainer.

 On 11/17/2016 01:21 PM, Dongwoo Lee wrote:
> The transfer request exceeding 4032KB (the maximum number of TRBs per
> TD * the maximum size of transfer buffer on TRB) fails on xhci host
> with timed out error or babble error state. This failure occurs when
> accessing large files on USB mass-storage. Currently with xhci as well
> as ehci host, the driver requests maximum 30MB (65536 blks * 512 byte)
> to storage at once. However, xhci cannot handle this request because
> of the reason mentioned above, even though ehci can handle this. Thus,
> transfer request larger than this size should be splitted in order to
> limit the length of data in a single TD.
>
> Even though the single request is splitted into multiple requests,
> the transfer speed has affected insignificantly in comparison with
> ehci host: 22.6 MB/s on ehci and 22.3 MB/s on xhci for 100MB tranfer.

 I don't have USB knowledge..So i wonder that this is correct way.
 Have other guys ever seen the similar issue?
>>>
>>> Is this a controller limitation ?
>>>
>>> btw can you fix your mailer to NOT send HTML email to the list?
>>>
>>
>> If my understanding for xhci spec.(rev. 1.1) 4.9.2 is right, the controller 
>> has no limitation for transfer size because it can support a very large TRB 
>> ring with multiple Ring Segments. 
>>
>> However, the xhci driver seems not to be implemented for supporting it; 
>> the TRB ring is comprised of only a single segment. As a result, it cannot 
>> handle the request exceeding 4032KB (TRB_MAX_BUFF_SIZE(64KB) * 
>> (TRBS_PER_SEGMENT(64) - link TRB(1)), thus the request should be divided.  
> 
> Can we update the driver ?
> 

Yes, I agree. 
I think also updating driver is more reasonable.

Though I think it takes some time since I just started xhci, I will
prepare a patch for enabling multiple ring segments for the driver.




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


Re: [U-Boot] [PATCHv3 09/15] pci: layerscape: add pci driver based on DM

2016-11-27 Thread Z.Q. Hou
Hi Simon,

Thanks for your comments!

> -Original Message-
> From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass
> Sent: 2016年11月28日 1:02
> To: Z.Q. Hou 
> Cc: U-Boot Mailing List ; Albert ARIBAUD
> ; Prabhakar Kushwaha
> ; Huan Wang-B18965
> ; Sumit Garg ; Ruchika
> Gupta ; Saksham Jain
> ; york sun ; M.H. Lian
> ; Bin Meng ; Mingkai Hu
> 
> Subject: Re: [PATCHv3 09/15] pci: layerscape: add pci driver based on DM
> 
> Hi,
> 
> On 24 November 2016 at 02:28, Z.Q. Hou  wrote:
> > Hi Simon,
> >
> > Thanks for your comments!
> >
> >> -Original Message-
> >> From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass
> >> Sent: 2016年11月24日 10:21
> >> To: Z.Q. Hou 
> >> Cc: U-Boot Mailing List ; Albert ARIBAUD
> >> ; Prabhakar Kushwaha
> >> ; Huan Wang-B18965
> >> ; Sumit Garg ;
> Ruchika
> >> Gupta ; Saksham Jain
> >> ; york sun ; M.H.
> >> Lian ; Bin Meng ;
> Mingkai
> >> Hu 
> >> Subject: Re: [PATCHv3 09/15] pci: layerscape: add pci driver based on
> >> DM
> >>
> >> Hi,
> >>
> >> On 22 November 2016 at 02:25, Z.Q. Hou  wrote:
> >> > Hi Simon,
> >> >
> >> > Sorry for my delay respond due to out of the office several days,
> >> > and thanks
> >> a lot for your comments!
> >> >
> >> >> -Original Message-
> >> >> From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon
> >> >> Glass
> >> >> Sent: 2016年11月18日 9:15
> >> >> To: Z.Q. Hou 
> >> >> Cc: U-Boot Mailing List ; Albert ARIBAUD
> >> >> ; Prabhakar Kushwaha
> >> >> ; Huan Wang-B18965
> >> >> ; Sumit Garg ;
> >> Ruchika
> >> >> Gupta ; Saksham Jain
> >> >> ; york sun ;
> M.H.
> >> >> Lian ; Bin Meng ;
> >> Mingkai
> >> >> Hu 
> >> >> Subject: Re: [PATCHv3 09/15] pci: layerscape: add pci driver based
> >> >> on DM
> >> >>
> >> >> Hi,
> >> >>
> >> >> On 16 November 2016 at 02:48, Zhiqiang Hou 
> >> >> wrote:
> >> >> > From: Minghuan Lian 
> >> >> >
> >> >> > There are more than five kinds of Layerscape SoCs.
> >> >> > unfortunately, PCIe controller of each SoC is a little bit
> >> >> > different. In order to avoid too many macro definitions, the
> >> >> > patch addes a new implementation of PCIe driver based on DM.
> >> >> > PCIe dts node is used to describe the difference.
> >> >> >
> >> >> > Signed-off-by: Minghuan Lian 
> >> >> > Signed-off-by: Hou Zhiqiang 
> >> >> > ---
> >> >> > V3:
> >> >> >  - No change
> >> >> >
> >> >> >  drivers/pci/Kconfig   |   8 +
> >> >> >  drivers/pci/pcie_layerscape.c | 761
> >> >> > ++
> >> >> >  2 files changed, 769 insertions(+)
> >> >> >
> >>
> >> >> > +#ifdef CONFIG_FSL_LSCH3
> >> >>
> >> >> Can this be a run-time check?
> >> >
> >> > No, it is for Linux DT fixup and these functions is needed only by
> >> > FSL_LSCH3
> >> SoCs.
> >>
> >> I mean that you cannot have an #ifdef in a driver - it should be done
> >> at run-time by looking at the compatible strings.
> >
> > This driver work for many platforms, but this fixup is only used by
> > FSL_LSCH3 SoCs, if check the compatible string at run-time, the fixup will 
> > be
> still compiled for the platform which doesn't need it.
> > Why compile it into the binary for the platform which doesn't need it?
> 
> Because that's how it works. Drivers are drivers for their hardware.
> We cannot compile them differently depending on who might use them...
> 
> If this is a big problem you could split the driver into multiple parts 
> perhaps. But
> what exactly is the problem here?

It isn't a big problem, actually it is just kernel DT fixup function, and it 
doesn't affect the u-boot pcie driver.
But the fixup is LSCH3 SoC special, and some macros are only defined in header 
file of LSCH3, e.g. FSL_PEX_STREAM_ID_*.
So cannot removed the #ifdef CONFIG_FSL_LSCH3.

> 
> >
> >> >
> >> >>
> >> >> > +/*
> >> >> > + * Return next available LUT index.
> >> >> > + */
> >> >> > +static int ls_pcie_next_lut_index(struct ls_pcie *pcie) {
> >> >> > +   if (pcie->next_lut_index < PCIE_LUT_ENTRY_COUNT)
> >> >> > +   

Re: [U-Boot] [PATCH] cmd: usb: run 'usb start' when USB is stopped

2016-11-27 Thread Jaehoon Chung
Hi Marek,

On 09/23/2016 01:15 PM, Simon Glass wrote:
> +Marek
> 
> On 9 September 2016 at 04:20, Jaehoon Chung  wrote:
>> If USB is stopped, just run 'usb start' instead of printing message.
>> Then user didn't consider whether usb is started or stopped.

Do you have any other opinion for this? :)

Best Regards,
Jaehoon Chung

>>
>> Signed-off-by: Jaehoon Chung 
>> ---
>>  cmd/usb.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/cmd/usb.c b/cmd/usb.c
>> index 455127c..4970851 100644
>> --- a/cmd/usb.c
>> +++ b/cmd/usb.c
>> @@ -651,8 +651,8 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, 
>> char * const argv[])
>> return 0;
>> }
>> if (!usb_started) {
>> -   printf("USB is stopped. Please issue 'usb start' first.\n");
>> -   return 1;
>> +   printf("USB is stopped. Running 'usb start' first.\n");
>> +   do_usb_start();
>> }
>> if (strncmp(argv[1], "tree", 4) == 0) {
>> puts("USB device tree:\n");
>> --
>> 1.9.1
>>
> 
> Reviewed-by: Simon Glass 
> 
> 
> 

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


Re: [U-Boot] [PATCH v3] mmc: add bkops-enable command

2016-11-27 Thread Jaehoon Chung
Hi Tomas,

On 11/25/2016 06:01 PM, Tomas Melin wrote:
> Add new command that provides possibility to enable the
> background operations handshake functionality
> (BKOPS_EN, EXT_CSD byte [163]) on eMMC devices.
> 
> This is an optional feature of eMMCs, the setting is write-once.
> The command must be explicitly taken into use with
> CONFIG_CMD_BKOPS_ENABLE.
> 
> Signed-off-by: Tomas Melin 

Applied on u-boot-mmc.
Before applied this patch from patchwork, i changed Author from your email to 
your name, is it ok?

Best Regards,
Jaehoon Chung

> ---
>  cmd/Kconfig   |  9 +
>  cmd/mmc.c | 32 
>  drivers/mmc/mmc.c | 34 ++
>  include/mmc.h |  6 ++
>  4 files changed, 81 insertions(+)
> 
> diff --git a/cmd/Kconfig b/cmd/Kconfig
> index e339d86..6f9081a 100644
> --- a/cmd/Kconfig
> +++ b/cmd/Kconfig
> @@ -550,6 +550,15 @@ config SYS_AMBAPP_PRINT_ON_STARTUP
>   help
> Show AMBA Plug-n-Play information on startup.
>  
> +config CMD_BKOPS_ENABLE
> + bool "mmc bkops enable"
> + depends on CMD_MMC
> + default n
> + help
> +   Enable command for setting manual background operations handshake
> +   on a eMMC device. The feature is optionally available on eMMC devices
> +   conforming to standard >= 4.41.
> +
>  config CMD_BLOCK_CACHE
>   bool "blkcache - control and stats for block cache"
>   depends on BLOCK_CACHE
> diff --git a/cmd/mmc.c b/cmd/mmc.c
> index b2761e9..b8dcc26 100644
> --- a/cmd/mmc.c
> +++ b/cmd/mmc.c
> @@ -729,6 +729,31 @@ static int do_mmc_setdsr(cmd_tbl_t *cmdtp, int flag,
>   return ret;
>  }
>  
> +#ifdef CONFIG_CMD_BKOPS_ENABLE
> +static int do_mmc_bkops_enable(cmd_tbl_t *cmdtp, int flag,
> +int argc, char * const argv[])
> +{
> + int dev;
> + struct mmc *mmc;
> +
> + if (argc != 2)
> + return CMD_RET_USAGE;
> +
> + dev = simple_strtoul(argv[1], NULL, 10);
> +
> + mmc = init_mmc_device(dev, false);
> + if (!mmc)
> + return CMD_RET_FAILURE;
> +
> + if (IS_SD(mmc)) {
> + puts("BKOPS_EN only exists on eMMC\n");
> + return CMD_RET_FAILURE;
> + }
> +
> + return mmc_set_bkops_enable(mmc);
> +}
> +#endif
> +
>  static cmd_tbl_t cmd_mmc[] = {
>   U_BOOT_CMD_MKENT(info, 1, 0, do_mmcinfo, "", ""),
>   U_BOOT_CMD_MKENT(read, 4, 1, do_mmc_read, "", ""),
> @@ -749,6 +774,9 @@ static cmd_tbl_t cmd_mmc[] = {
>   U_BOOT_CMD_MKENT(rpmb, CONFIG_SYS_MAXARGS, 1, do_mmcrpmb, "", ""),
>  #endif
>   U_BOOT_CMD_MKENT(setdsr, 2, 0, do_mmc_setdsr, "", ""),
> +#ifdef CONFIG_CMD_BKOPS_ENABLE
> + U_BOOT_CMD_MKENT(bkops-enable, 2, 0, do_mmc_bkops_enable, "", ""),
> +#endif
>  };
>  
>  static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
> argv[])
> @@ -813,6 +841,10 @@ U_BOOT_CMD(
>   "mmc rpmb counter - read the value of the write counter\n"
>  #endif
>   "mmc setdsr  - set DSR register value\n"
> +#ifdef CONFIG_CMD_BKOPS_ENABLE
> + "mmc bkops-enable  - enable background operations handshake on 
> device\n"
> + "   WARNING: This is a write-once setting.\n"
> +#endif
>   );
>  
>  /* Old command kept for compatibility. Same as 'mmc info' */
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 0cec02c..680b5cc 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -1810,3 +1810,37 @@ int mmc_initialize(bd_t *bis)
>   mmc_do_preinit();
>   return 0;
>  }
> +
> +#ifdef CONFIG_CMD_BKOPS_ENABLE
> +int mmc_set_bkops_enable(struct mmc *mmc)
> +{
> + int err;
> + ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN);
> +
> + err = mmc_send_ext_csd(mmc, ext_csd);
> + if (err) {
> + puts("Could not get ext_csd register values\n");
> + return err;
> + }
> +
> + if (!(ext_csd[EXT_CSD_BKOPS_SUPPORT] & 0x1)) {
> + puts("Background operations not supported on device\n");
> + return -EMEDIUMTYPE;
> + }
> +
> + if (ext_csd[EXT_CSD_BKOPS_EN] & 0x1) {
> + puts("Background operations already enabled\n");
> + return 0;
> + }
> +
> + err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BKOPS_EN, 1);
> + if (err) {
> + puts("Failed to enable manual background operations\n");
> + return err;
> + }
> +
> + puts("Enabled manual background operations\n");
> +
> + return 0;
> +}
> +#endif
> diff --git a/include/mmc.h b/include/mmc.h
> index 5ef37d3..abf72f1 100644
> --- a/include/mmc.h
> +++ b/include/mmc.h
> @@ -175,6 +175,7 @@
>  #define EXT_CSD_MAX_ENH_SIZE_MULT157 /* R */
>  #define EXT_CSD_PARTITIONING_SUPPORT 160 /* RO */
>  #define EXT_CSD_RST_N_FUNCTION   162 /* R/W */
> +#define EXT_CSD_BKOPS_EN 163 /* R/W & R/W/E */
>  #define EXT_CSD_WR_REL_PARAM 166 /* R */
>  #define 

Re: [U-Boot] [PATCH 08/14] mmc: Add JZ47xx SD/MMC controller driver

2016-11-27 Thread Jaehoon Chung
Hi Marek,

On 11/26/2016 07:32 AM, Marek Vasut wrote:
> From: Paul Burton 
> 
> Add driver for the JZ47xx MSC controller.

There are some checkpatch error and warings. Could you fix them?

And i don't know what means MSC?

> 
> Signed-off-by: Marek Vasut 
> Cc: Daniel Schwierzeck 
> Cc: Paul Burton 
> ---
>  drivers/mmc/Kconfig  |   6 +
>  drivers/mmc/Makefile |   1 +
>  drivers/mmc/jz_mmc.c | 443 
> +++
>  3 files changed, 450 insertions(+)
>  create mode 100644 drivers/mmc/jz_mmc.c
> 
> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
> index aca438b8..761b886 100644
> --- a/drivers/mmc/Kconfig
> +++ b/drivers/mmc/Kconfig
> @@ -102,6 +102,12 @@ config MMC_UNIPHIER
>   help
> This selects support for the SD/MMC Host Controller on UniPhier SoCs.
>  
> +config JZ47XX_MMC
> + bool "Ingenic JZ47xx SD/MMC Host Controller support"
> + depends on ARCH_JZ47XX
> + help
> +   This selects support for the SD Card Controller on Ingenic JZ47xx 
> SoCs.
> +
>  config SANDBOX_MMC
>   bool "Sandbox MMC support"
>   depends on MMC && SANDBOX
> diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
> index d850758..5f7cca3 100644
> --- a/drivers/mmc/Makefile
> +++ b/drivers/mmc/Makefile
> @@ -57,6 +57,7 @@ obj-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
>  obj-$(CONFIG_MMC_UNIPHIER) += uniphier-sd.o
>  obj-$(CONFIG_ZYNQ_SDHCI) += zynq_sdhci.o
>  obj-$(CONFIG_ROCKCHIP_SDHCI) += rockchip_sdhci.o
> +obj-$(CONFIG_JZ47XX_MMC) += jz_mmc.o
>  
>  ifdef CONFIG_SPL_BUILD
>  obj-$(CONFIG_SPL_MMC_BOOT) += fsl_esdhc_spl.o
> diff --git a/drivers/mmc/jz_mmc.c b/drivers/mmc/jz_mmc.c
> new file mode 100644
> index 000..213fe63
> --- /dev/null
> +++ b/drivers/mmc/jz_mmc.c
> @@ -0,0 +1,443 @@
> +/*
> + * Ingenic JZ MMC driver
> + *
> + * Copyright (c) 2013 Imagination Technologies
> + * Author: Paul Burton 
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/* Registers */
> +#define MSC_STRPCL   0x000
> +#define MSC_STAT 0x004
> +#define MSC_CLKRT0x008
> +#define MSC_CMDAT0x00c
> +#define MSC_RESTO0x010
> +#define MSC_RDTO 0x014
> +#define MSC_BLKLEN   0x018
> +#define MSC_NOB  0x01c
> +#define MSC_SNOB 0x020
> +#define MSC_IMASK0x024
> +#define MSC_IREG 0x028
> +#define MSC_CMD  0x02c
> +#define MSC_ARG  0x030
> +#define MSC_RES  0x034
> +#define MSC_RXFIFO   0x038
> +#define MSC_TXFIFO   0x03c
> +#define MSC_LPM  0x040
> +#define MSC_DMAC 0x044
> +#define MSC_DMANDA   0x048
> +#define MSC_DMADA0x04c
> +#define MSC_DMALEN   0x050
> +#define MSC_DMACMD   0x054
> +#define MSC_CTRL20x058
> +#define MSC_RTCNT0x05c
> +#define MSC_DBG  0x0fc
> +
> +/* MSC Clock and Control Register (MSC_STRPCL) */
> +
> +#define MSC_STRPCL_EXIT_MULTIPLE BIT(7)
> +#define MSC_STRPCL_EXIT_TRANSFER BIT(6)
> +#define MSC_STRPCL_START_READWAITBIT(5)
> +#define MSC_STRPCL_STOP_READWAIT BIT(4)
> +#define MSC_STRPCL_RESET BIT(3)
> +#define MSC_STRPCL_START_OP  BIT(2)
> +#define MSC_STRPCL_CLOCK_CONTROL_STOPBIT(0)
> +#define MSC_STRPCL_CLOCK_CONTROL_START   BIT(1)
> +
> +/* MSC Status Register (MSC_STAT) */
> +
> +#define MSC_STAT_AUTO_CMD_DONE   BIT(31)
> +#define MSC_STAT_IS_RESETTINGBIT(15)
> +#define MSC_STAT_SDIO_INT_ACTIVE BIT(14)
> +#define MSC_STAT_PRG_DONEBIT(13)
> +#define MSC_STAT_DATA_TRAN_DONE  BIT(12)
> +#define MSC_STAT_END_CMD_RES BIT(11)
> +#define MSC_STAT_DATA_FIFO_AFULL BIT(10)
> +#define MSC_STAT_IS_READWAIT BIT(9)
> +#define MSC_STAT_CLK_EN  BIT(8)
> +#define MSC_STAT_DATA_FIFO_FULL  BIT(7)
> +#define MSC_STAT_DATA_FIFO_EMPTY BIT(6)
> +#define MSC_STAT_CRC_RES_ERR BIT(5)
> +#define MSC_STAT_CRC_READ_ERROR  BIT(4)
> +#define MSC_STAT_CRC_WRITE_ERROR BIT(2)
> +#define MSC_STAT_CRC_WRITE_ERROR_NOSTS   BIT(4)
> +#define MSC_STAT_TIME_OUT_RESBIT(1)
> +#define MSC_STAT_TIME_OUT_READ   BIT(0)
> +
> +/* MSC Bus Clock Control Register (MSC_CLKRT) */
> +#define MSC_CLKRT_CLK_RATE_MASK  0x7
> +
> +/* MSC Command Sequence Control Register (MSC_CMDAT) */
> +
> +#define MSC_CMDAT_IO_ABORT   BIT(11)
> +#define 

Re: [U-Boot] [PATCH 02/14] spl: mmc: Fix build without LIBCOMMON_SUPPORT

2016-11-27 Thread Marek Vasut
On 11/28/2016 03:33 AM, Jaehoon Chung wrote:
> On 11/27/2016 05:58 AM, Marek Vasut wrote:
>> On 11/26/2016 09:45 PM, Tom Rini wrote:
>>> On Fri, Nov 25, 2016 at 11:32:23PM +0100, Marek Vasut wrote:
 If CONFIG_SPL_LIBCOMMON_SUPPORT is undefined, the following error
 will happen, so fix it.

 In file included from common/spl/spl_mmc.c:11:0:
 common/spl/spl_mmc.c: In function ‘spl_mmc_load_image’:
 include/spl.h:18:30: error: label at end of compound statement
  #define MMCSD_MODE_UNDEFINED 0
   ^
 common/spl/spl_mmc.c:335:7: note: in expansion of macro 
 ‘MMCSD_MODE_UNDEFINED’
   case MMCSD_MODE_UNDEFINED:
^
 Signed-off-by: Marek Vasut 
 Cc: Pantelis Antoniou 
 Cc: Tom Rini 
 ---
  common/spl/spl_mmc.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

 diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
 index 0b681c2..43c1030 100644
 --- a/common/spl/spl_mmc.c
 +++ b/common/spl/spl_mmc.c
 @@ -343,10 +343,12 @@ static int spl_mmc_load_image(struct spl_image_info 
 *spl_image,
  
break;
case MMCSD_MODE_UNDEFINED:
 -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
default:
 +  {
 +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
puts("spl: mmc: wrong boot mode\n");
  #endif
 +  }
}
  
return err;
>>>
>>> I think we have something slightly off here.  Is
>>> CONFIG_SPL_SERIAL_SUPPORT also enabled?  That would turn this into a
>>> no-op as puts becomes a do { } while(0), if disabled.  So I think we
>>> should just remove the ifdef here.
>>
>> No, series does not fit into SPL on this platform.
> 
> I don't know..but i remembered that i suggested about putting just "break;" 
> end of bracket.
> how about?

Sure, that works too.

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


Re: [U-Boot] [PATCH 02/14] spl: mmc: Fix build without LIBCOMMON_SUPPORT

2016-11-27 Thread Jaehoon Chung
On 11/27/2016 05:58 AM, Marek Vasut wrote:
> On 11/26/2016 09:45 PM, Tom Rini wrote:
>> On Fri, Nov 25, 2016 at 11:32:23PM +0100, Marek Vasut wrote:
>>> If CONFIG_SPL_LIBCOMMON_SUPPORT is undefined, the following error
>>> will happen, so fix it.
>>>
>>> In file included from common/spl/spl_mmc.c:11:0:
>>> common/spl/spl_mmc.c: In function ‘spl_mmc_load_image’:
>>> include/spl.h:18:30: error: label at end of compound statement
>>>  #define MMCSD_MODE_UNDEFINED 0
>>>   ^
>>> common/spl/spl_mmc.c:335:7: note: in expansion of macro 
>>> ‘MMCSD_MODE_UNDEFINED’
>>>   case MMCSD_MODE_UNDEFINED:
>>>^
>>> Signed-off-by: Marek Vasut 
>>> Cc: Pantelis Antoniou 
>>> Cc: Tom Rini 
>>> ---
>>>  common/spl/spl_mmc.c | 4 +++-
>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
>>> index 0b681c2..43c1030 100644
>>> --- a/common/spl/spl_mmc.c
>>> +++ b/common/spl/spl_mmc.c
>>> @@ -343,10 +343,12 @@ static int spl_mmc_load_image(struct spl_image_info 
>>> *spl_image,
>>>  
>>> break;
>>> case MMCSD_MODE_UNDEFINED:
>>> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>> default:
>>> +   {
>>> +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>> puts("spl: mmc: wrong boot mode\n");
>>>  #endif
>>> +   }
>>> }
>>>  
>>> return err;
>>
>> I think we have something slightly off here.  Is
>> CONFIG_SPL_SERIAL_SUPPORT also enabled?  That would turn this into a
>> no-op as puts becomes a do { } while(0), if disabled.  So I think we
>> should just remove the ifdef here.
> 
> No, series does not fit into SPL on this platform.

I don't know..but i remembered that i suggested about putting just "break;" end 
of bracket.
how about?

Best Regards,
Jaehoon Chung

> 

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


Re: [U-Boot] [PATCH 05/24] SPL: tiny-printf: add "l" modifier

2016-11-27 Thread André Przywara
On 27/11/16 17:02, Simon Glass wrote:

Hi,

> On 23 November 2016 at 20:19, Siarhei Siamashka
>  wrote:
>> On Sun, 20 Nov 2016 14:56:59 +
>> Andre Przywara  wrote:
>>
>>> tiny-printf does not know about the "l" modifier so far, which breaks
>>> the crash dump on AArch64, because it uses %lx to print the registers.
>>> Add an easy way of handling longs correctly.
>>
>> I can't help but notice that the changes of this kind are in a way
>> defeating the original purpose of tiny-printf. And it is surely not
>> the first patch adding features to tiny-printf. I guess, in the end
>> we may end up with a large and bloated printf implementation again :-)
>>
>> A possible solution might be just a strict check when parsing format
>> modifiers and abort with an error message (yeah, this will introduce
>> some size increase, but hopefully the last one). This way we
>> acknowledge the fact that tiny-printf is a reduced incomplete
>> implementation, and that the callers need to take this into account.
>>
>> As for the "l" modifier. How much does it add to the code size? IMHO
>> this information should be mentioned in the commit message. Can the
>> AArch64 crash dump code be modified to avoid using it? Or can we have
>> the "l" modifier supported on 64-bit platforms only?
>>
>>> Signed-off-by: Andre Przywara 
>>> ---
>>>  lib/tiny-printf.c | 43 +--
>>>  1 file changed, 33 insertions(+), 10 deletions(-)
> 
> I think I tested this patch as adding 36 bytes on Thumb2 so not too
> terrible. But I do agree with the sentiment.

Thanks for checking that!

> Why is aarch64 using tiny-printf? Surely all though chips have heaps of 
> space?!

Ha, one would hope so, right?
But in fact this is basically an existing 32-bit Allwinner chip with
64-bit cores - mostly because they can ;-). Replacing Cortex-A7 cores
with A53s seems to be a common exercise.

But the point is that even the most capable chip needs to be booted
somehow, and here the Allwinner boot ROM still loads only 32KB into some
SRAM. This hasn't changed for years, so even the 64-bit chips suffer
from the same SPL space limitations.
And since AArch64 does not define a tight encoding variant like Thumb,
we are even more limited in our code size.

Of course this only applies to the SPL, so once we have DRAM up and an
MMC driver initialized, we indeed have quite some resources available.

Cheers,
Andre.

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


Re: [U-Boot] [PATCH 05/24] SPL: tiny-printf: add "l" modifier

2016-11-27 Thread André Przywara
On 24/11/16 03:19, Siarhei Siamashka wrote:
> On Sun, 20 Nov 2016 14:56:59 +
> Andre Przywara  wrote:
> 
>> tiny-printf does not know about the "l" modifier so far, which breaks
>> the crash dump on AArch64, because it uses %lx to print the registers.
>> Add an easy way of handling longs correctly.
> 
> I can't help but notice that the changes of this kind are in a way
> defeating the original purpose of tiny-printf. And it is surely not
> the first patch adding features to tiny-printf. I guess, in the end
> we may end up with a large and bloated printf implementation again :-)

While I appreciate the fight against bloat, I am not sure severely
hacked or crippled code is much better. We are not talking about KBs
here, it's probably only a  small number of double digits bytes.
Frankly our existing tiny-printf implementation apparently did not live
fully up to its promise of replacing printf with a smaller
implementation. It's just that the missing code coverage has hidden this
so far. So actually we would need to add this code increase here to the
original size comparison.

In the end we can't really simplify the code beyond a certain point -
otherwise return 0; would be an even smaller implementation.

But see below ...

> A possible solution might be just a strict check when parsing format
> modifiers and abort with an error message (yeah, this will introduce
> some size increase, but hopefully the last one). This way we
> acknowledge the fact that tiny-printf is a reduced incomplete
> implementation, and that the callers need to take this into account.

On 64-bit we need "l" to differentiate between 32-bit and 64-bit variables.
I believe the crash dump code is shared between SPL and U-Boot proper,
and we probably want to keep it that way.

> As for the "l" modifier. How much does it add to the code size? IMHO
> this information should be mentioned in the commit message.

Yeah, good point. I will add the numbers.

> Can the AArch64 crash dump code be modified to avoid using it?

I really don't want to go there.

> Or can we have
> the "l" modifier supported on 64-bit platforms only?

That sounds more like an option. On 32-bit "l" is pretty useless, and we
don't need "ll", which I consider a reasonable limitation.
We could just ignore "l", like we do with "-".

But on 64-bit that's the way to differentiate between standard integers
and addresses (aka longs), and we need that there.
I'd rather avoid #ifdefs inside the routine, so I'd try Alex' suggestion
of adding " && sizeof(long) > 4" to let the compiler optimize this away.
Or I refactor this code into a separate (ifdef'ed) function.

Let me check.

Cheers,
Andre.

> 
>> Signed-off-by: Andre Przywara 
>> ---
>>  lib/tiny-printf.c | 43 +--
>>  1 file changed, 33 insertions(+), 10 deletions(-)
>>
>> diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c
>> index 30ac759..b01099d 100644
>> --- a/lib/tiny-printf.c
>> +++ b/lib/tiny-printf.c
>> @@ -38,8 +38,8 @@ static void out_dgt(struct printf_info *info, char dgt)
>>  info->zs = 1;
>>  }
>>  
>> -static void div_out(struct printf_info *info, unsigned int *num,
>> -unsigned int div)
>> +static void div_out(struct printf_info *info, unsigned long *num,
>> +unsigned long div)
>>  {
>>  unsigned char dgt = 0;
>>  
>> @@ -56,9 +56,9 @@ int _vprintf(struct printf_info *info, const char *fmt, 
>> va_list va)
>>  {
>>  char ch;
>>  char *p;
>> -unsigned int num;
>> +unsigned long num;
>>  char buf[12];
>> -unsigned int div;
>> +unsigned long div;
>>  
>>  while ((ch = *(fmt++))) {
>>  if (ch != '%') {
>> @@ -66,8 +66,12 @@ int _vprintf(struct printf_info *info, const char *fmt, 
>> va_list va)
>>  } else {
>>  bool lz = false;
>>  int width = 0;
>> +bool islong = false;
>>  
>>  ch = *(fmt++);
>> +if (ch == '-')
>> +ch = *(fmt++);
>> +
>>  if (ch == '0') {
>>  ch = *(fmt++);
>>  lz = 1;
>> @@ -80,6 +84,11 @@ int _vprintf(struct printf_info *info, const char *fmt, 
>> va_list va)
>>  ch = *fmt++;
>>  }
>>  }
>> +if (ch == 'l') {
>> +ch = *(fmt++);
>> +islong = true;
>> +}
>> +
>>  info->bf = buf;
>>  p = info->bf;
>>  info->zs = 0;
>> @@ -89,24 +98,38 @@ int _vprintf(struct printf_info *info, const char *fmt, 
>> va_list va)
>>  goto abort;
>>  case 'u':
>>  case 'd':
>> -num = va_arg(va, unsigned int);

[U-Boot] [RESEND][PATCH 20/24] sh: add shared relocate_code() function and call board_init_r()

2016-11-27 Thread Vladimir Zapolskiy
Commits b61e90e6fd83 ("sh: Drop the arch-specific board init") and
f41e6088eb1a ("sh: Fix build errors for generic board") left code and
data relocation done in start.S, however further actual U-boot
configuration is not started anymore. Practically SH boards with the
code relocated into the expected position by start.S still can be
booted, so the change adds this option and provides an option how to
relocate code for board_init_r() execution.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/cpu/sh2/cpu.c |  6 --
 arch/sh/cpu/sh3/cpu.c |  6 --
 arch/sh/cpu/sh4/cpu.c |  6 --
 arch/sh/lib/board.c   | 18 ++
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/arch/sh/cpu/sh2/cpu.c b/arch/sh/cpu/sh2/cpu.c
index 9a93cf5..a2f856f 100644
--- a/arch/sh/cpu/sh2/cpu.c
+++ b/arch/sh/cpu/sh2/cpu.c
@@ -83,9 +83,3 @@ int dcache_status(void)
 {
return 0;
 }
-
-void relocate_code(ulong start_addr_sp, gd_t *new_gd, ulong relocaaddr)
-{
-   /* TODO(sh maintainer): Implement this */
-   while (1);
-}
diff --git a/arch/sh/cpu/sh3/cpu.c b/arch/sh/cpu/sh3/cpu.c
index 494f908..ea0006a 100644
--- a/arch/sh/cpu/sh3/cpu.c
+++ b/arch/sh/cpu/sh3/cpu.c
@@ -66,9 +66,3 @@ int dcache_status(void)
 {
return 0;
 }
-
-void relocate_code(ulong start_addr_sp, gd_t *new_gd, ulong relocaaddr)
-{
-   /* TODO(sh maintainer): Implement this */
-   while (1);
-}
diff --git a/arch/sh/cpu/sh4/cpu.c b/arch/sh/cpu/sh4/cpu.c
index 49c58ae..aa8d4df 100644
--- a/arch/sh/cpu/sh4/cpu.c
+++ b/arch/sh/cpu/sh4/cpu.c
@@ -41,9 +41,3 @@ int cpu_eth_init(bd_t *bis)
 #endif
return 0;
 }
-
-void relocate_code(ulong start_addr_sp, gd_t *new_gd, ulong relocaaddr)
-{
-   /* TODO(sh maintainer): Implement this */
-   while (1);
-}
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index 7cb594e..aa967c0 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -15,3 +15,21 @@ int dram_init(void)
 
return 0;
 }
+
+void relocate_code(ulong start_addr_sp, gd_t *new_gd, ulong relocaddr)
+{
+   void (*reloc_board_init_r)(gd_t *gd, ulong dest) = board_init_r;
+
+   if (new_gd->reloc_off) {
+   memcpy((void *)new_gd->relocaddr,
+  (void *)(new_gd->relocaddr - new_gd->reloc_off),
+  new_gd->mon_len);
+
+   reloc_board_init_r += new_gd->reloc_off;
+   }
+
+   __asm__ __volatile__("mov.l %0, r15\n" : : "m" (new_gd->start_addr_sp));
+
+   while (1)
+   reloc_board_init_r(new_gd, 0x0);
+}
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 11/24] r2dplus: select rtl8139 driver in defconfig

2016-11-27 Thread Vladimir Zapolskiy
CONFIG_RTL8139 was moved to a board defconfig by a commit 86e9dc86b1a2
("net: Move CONFIG_RTL8139 to Kconfig"), however it was done
incorrectly due to a missing CONFIG_NETDEVICES selection, thus
virtually it was just a removal of the driver compilation.

As an unlucky consequence the option was completely removed by a purge
commit adad96e60d0e ("configs: Re-sync HUSH options"), restore the
driver inclusion back.

Signed-off-by: Vladimir Zapolskiy 
---
 configs/r2dplus_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/r2dplus_defconfig b/configs/r2dplus_defconfig
index f4dc68e..2637723 100644
--- a/configs/r2dplus_defconfig
+++ b/configs/r2dplus_defconfig
@@ -5,5 +5,7 @@ CONFIG_BOOTDELAY=-1
 CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT2=y
+CONFIG_NETDEVICES=y
+CONFIG_RTL8139=y
 CONFIG_PCI=y
 CONFIG_USE_PRIVATE_LIBGCC=y
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 05/24] sh: cache: don't modify CCR from P1 area

2016-11-27 Thread Vladimir Zapolskiy
cache_wback_all() is a local function and it is called from
cache_control() only, which is in turn jumps to P2 area.

The change fixes an issue when cache_wback_all() returns from P2 to
P1, however cache_control() continues to manipulate with CCR
register, according to the User's Manual this is restricted.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/cpu/sh4/cache.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/sh/cpu/sh4/cache.c b/arch/sh/cpu/sh4/cache.c
index 50695b6..7750f0f 100644
--- a/arch/sh/cpu/sh4/cache.c
+++ b/arch/sh/cpu/sh4/cache.c
@@ -18,10 +18,10 @@ static inline void cache_wback_all(void)
 {
unsigned long addr, data, i, j;
 
-   jump_to_P2();
-   for (i = 0; i < CACHE_OC_NUM_ENTRIES; i++){
+   for (i = 0; i < CACHE_OC_NUM_ENTRIES; i++) {
for (j = 0; j < CACHE_OC_NUM_WAYS; j++) {
-   addr = CACHE_OC_ADDRESS_ARRAY | (j << 
CACHE_OC_WAY_SHIFT)
+   addr = CACHE_OC_ADDRESS_ARRAY
+   | (j << CACHE_OC_WAY_SHIFT)
| (i << CACHE_OC_ENTRY_SHIFT);
data = inl(addr);
if (data & CACHE_UPDATED) {
@@ -30,10 +30,8 @@ static inline void cache_wback_all(void)
}
}
}
-   back_to_P1();
 }
 
-
 #define CACHE_ENABLE  0
 #define CACHE_DISABLE 1
 
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 18/24] sh: define CONFIG_DISPLAY_BOARDINFO to print board information

2016-11-27 Thread Vladimir Zapolskiy
All SH boards define a checkboard() function which outputs basic board
information on boot, however generic board support requires to define
CONFIG_DISPLAY_BOARDINFO to do that, so define it for the boards.

Signed-off-by: Vladimir Zapolskiy 
---
 include/configs/MigoR.h  | 1 +
 include/configs/ap325rxa.h   | 1 +
 include/configs/ap_sh4a_4a.h | 1 +
 include/configs/ecovec.h | 1 +
 include/configs/espt.h   | 1 +
 include/configs/mpr2.h   | 2 ++
 include/configs/ms7720se.h   | 1 +
 include/configs/ms7722se.h   | 1 +
 include/configs/ms7750se.h   | 2 ++
 include/configs/r0p7734.h| 1 +
 include/configs/r2dplus.h| 2 ++
 include/configs/r7780mp.h| 2 ++
 include/configs/rsk7203.h| 1 +
 include/configs/rsk7264.h| 2 ++
 include/configs/rsk7269.h| 2 ++
 include/configs/sh7752evb.h  | 1 +
 include/configs/sh7753evb.h  | 1 +
 include/configs/sh7757lcr.h  | 1 +
 include/configs/sh7763rdp.h  | 1 +
 include/configs/sh7785lcr.h  | 1 +
 include/configs/shmin.h  | 1 +
 21 files changed, 27 insertions(+)

diff --git a/include/configs/MigoR.h b/include/configs/MigoR.h
index e1338cd..75c5af6 100644
--- a/include/configs/MigoR.h
+++ b/include/configs/MigoR.h
@@ -17,6 +17,7 @@
 #define CONFIG_BAUDRATE115200
 #define CONFIG_BOOTARGS"console=ttySC0,115200 root=1f01"
 
+#define CONFIG_DISPLAY_BOARDINFO
 #undef  CONFIG_SHOW_BOOT_PROGRESS
 
 /* SMC9111 */
diff --git a/include/configs/ap325rxa.h b/include/configs/ap325rxa.h
index 6e39868..c86ce05 100644
--- a/include/configs/ap325rxa.h
+++ b/include/configs/ap325rxa.h
@@ -20,6 +20,7 @@
 #define CONFIG_BAUDRATE38400
 #define CONFIG_BOOTARGS"console=ttySC2,38400"
 
+#define CONFIG_DISPLAY_BOARDINFO
 #undef  CONFIG_SHOW_BOOT_PROGRESS
 
 /* SMC9118 */
diff --git a/include/configs/ap_sh4a_4a.h b/include/configs/ap_sh4a_4a.h
index d2d9770..4b07f06 100644
--- a/include/configs/ap_sh4a_4a.h
+++ b/include/configs/ap_sh4a_4a.h
@@ -23,6 +23,7 @@
 #define CONFIG_BAUDRATE115200
 #define CONFIG_BOOTARGS"console=ttySC4,115200"
 
+#define CONFIG_DISPLAY_BOARDINFO
 #undef  CONFIG_SHOW_BOOT_PROGRESS
 
 /* Ether */
diff --git a/include/configs/ecovec.h b/include/configs/ecovec.h
index 19514b6..6470327 100644
--- a/include/configs/ecovec.h
+++ b/include/configs/ecovec.h
@@ -37,6 +37,7 @@
 #define CONFIG_BAUDRATE115200
 #define CONFIG_BOOTARGS"console=ttySC0,115200"
 
+#define CONFIG_DISPLAY_BOARDINFO
 #undef  CONFIG_SHOW_BOOT_PROGRESS
 
 /* I2C */
diff --git a/include/configs/espt.h b/include/configs/espt.h
index e76a4ee..9475740 100644
--- a/include/configs/espt.h
+++ b/include/configs/espt.h
@@ -23,6 +23,7 @@
 #define CONFIG_BOOTARGS "console=ttySC0,115200 root=1f01"
 #define CONFIG_ENV_OVERWRITE1
 
+#define CONFIG_DISPLAY_BOARDINFO
 #undef  CONFIG_SHOW_BOOT_PROGRESS
 
 /* SCIF */
diff --git a/include/configs/mpr2.h b/include/configs/mpr2.h
index 1a8909a..0d37912 100644
--- a/include/configs/mpr2.h
+++ b/include/configs/mpr2.h
@@ -22,6 +22,8 @@
 #define CONFIG_CPU_SH7720  1
 #define CONFIG_MPR21
 
+#define CONFIG_DISPLAY_BOARDINFO
+
 /* U-Boot internals */
 #define CONFIG_SYS_LONGHELP/* undef to save memory */
 #define CONFIG_SYS_CBSIZE  256 /* Buffer size for input from 
the Console */
diff --git a/include/configs/ms7720se.h b/include/configs/ms7720se.h
index d136726..87f8712 100644
--- a/include/configs/ms7720se.h
+++ b/include/configs/ms7720se.h
@@ -21,6 +21,7 @@
 #define CONFIG_BOOTFILE"/boot/zImage"
 #define CONFIG_LOADADDR0x8E00
 
+#define CONFIG_DISPLAY_BOARDINFO
 #undef  CONFIG_SHOW_BOOT_PROGRESS
 
 /* MEMORY */
diff --git a/include/configs/ms7722se.h b/include/configs/ms7722se.h
index a473eec..181d021 100644
--- a/include/configs/ms7722se.h
+++ b/include/configs/ms7722se.h
@@ -18,6 +18,7 @@
 #define CONFIG_BAUDRATE115200
 #define CONFIG_BOOTARGS"console=ttySC0,115200 root=1f01"
 
+#define CONFIG_DISPLAY_BOARDINFO
 #undef  CONFIG_SHOW_BOOT_PROGRESS
 
 /* SMC9111 */
diff --git a/include/configs/ms7750se.h b/include/configs/ms7750se.h
index c0fb16d..6268d73 100644
--- a/include/configs/ms7750se.h
+++ b/include/configs/ms7750se.h
@@ -15,6 +15,8 @@
 #define CONFIG_MS7750SE1
 #define __LITTLE_ENDIAN__  1
 
+#define CONFIG_DISPLAY_BOARDINFO
+
 /*
  * Command line configuration.
  */
diff --git a/include/configs/r0p7734.h b/include/configs/r0p7734.h
index 2ae9e02..f7412f0 100644
--- a/include/configs/r0p7734.h
+++ b/include/configs/r0p7734.h
@@ -23,6 +23,7 @@
 #define CONFIG_BAUDRATE115200
 #define CONFIG_BOOTARGS"console=ttySC3,115200"
 
+#define CONFIG_DISPLAY_BOARDINFO
 #undef  CONFIG_SHOW_BOOT_PROGRESS
 
 /* Ether */
diff --git a/include/configs/r2dplus.h b/include/configs/r2dplus.h
index a0e0c1c..e8f60b2 100644
--- 

[U-Boot] [RESEND][PATCH 21/24] sh4: fix start.S by calling board_init_f() after first code relocation

2016-11-27 Thread Vladimir Zapolskiy
Like on ARM platform keep the first code relocation from a U-boot
image storage to RAM at CONFIG_SYS_TEXT_BASE, then pass execution to a
generic board_init_f() with empty GD flags. If CONFIG_SYS_TEXT_BASE is
equal to a calculated by board_init_f() relocation address there will
be no more code and data copy, however it's worth to mention that the
first copy happens even if $pc on _start is the same as
CONFIG_SYS_TEXT_BASE, on practice this works without a problem.

Also note that _sh_start is renamed back to _start to correct
gd->mon_len calculation by setup_mon_len(), the opposite rename was
done in pre-generic board commit 2024b968ee9 ("sh: Fix build in start.S").

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/cpu/sh4/start.S | 23 +++
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/arch/sh/cpu/sh4/start.S b/arch/sh/cpu/sh4/start.S
index 77fc221..416adcf 100644
--- a/arch/sh/cpu/sh4/start.S
+++ b/arch/sh/cpu/sh4/start.S
@@ -1,6 +1,6 @@
 /*
- * (C) Copyright 2007, 2010
- * Nobuhiro Iwamatsu 
+ * Copyright (C) 2016 Vladimir Zapolskiy 
+ * Copyright (C) 2007, 2010 Nobuhiro Iwamatsu 
  *
  * SPDX-License-Identifier:GPL-2.0+
  */
@@ -12,7 +12,7 @@
.align  2
 
.global _start
-_sh_start:
+_start:
mov.l   ._lowlevel_init, r0
 100:   bsrfr0
nop
@@ -21,7 +21,7 @@ _sh_start:
nop
 1: sts pr, r5
mov.l   ._reloc_dst, r4
-   add #(_sh_start-1b), r5
+   add #(_start-1b), r5
mov.l   ._reloc_dst_end, r6
 
 2: mov.l   @r5+, r1
@@ -42,10 +42,9 @@ _sh_start:
mov.l   ._gd_init, r13  /* global data */
mov.l   ._stack_init, r15   /* stack */
 
-   #TODO(sh maintainer): Fix this up to call the correct code
-   #mov.l  ._sh_generic_init, r0
-   #jsr@r0
-   nop
+   mov.l   ._sh_generic_init, r0
+   jsr @r0
+   mov #0, r4
 
 loop:
bra loop
@@ -53,10 +52,10 @@ loop:
.align  2
 
 ._lowlevel_init:   .long   (lowlevel_init - (100b + 4))
-._reloc_dst:   .long   reloc_dst
+._reloc_dst:   .long   _start
 ._reloc_dst_end:   .long   reloc_dst_end
 ._bss_start:   .long   bss_start
 ._bss_end: .long   bss_end
-._gd_init: .long   (_sh_start - GENERATED_GBL_DATA_SIZE)
-._stack_init:  .long   (_sh_start - GENERATED_GBL_DATA_SIZE - 
CONFIG_SYS_MALLOC_LEN - 16)
-#._sh_generic_init:.long   sh_generic_init
+._gd_init: .long   (_start - GENERATED_GBL_DATA_SIZE)
+._stack_init:  .long   (_start - GENERATED_GBL_DATA_SIZE - 
CONFIG_SYS_MALLOC_LEN - 16)
+._sh_generic_init: .long   board_init_f
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 23/24] sh: generate position independent code for all platforms

2016-11-27 Thread Vladimir Zapolskiy
Finally add fpic compilation option to produce relocatable code.
Note that this requires to define CONFIG_NEEDS_MANUAL_RELOC for all
board files, also relocation support still has some limitations
(e.g. a developer should care not to overwrite the executing code or
memset() with zeroes not yet relocated data on malloc init etc.),
which may be fixed while switching to PIE.

Due to short investigation the architecture code is not ready for PIE
linking, this will require some manipulations with .dyn* sections.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/config.mk  | 1 +
 arch/sh/cpu/u-boot.lds | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/sh/config.mk b/arch/sh/config.mk
index 673ed8d..71540c8 100644
--- a/arch/sh/config.mk
+++ b/arch/sh/config.mk
@@ -15,5 +15,6 @@ CONFIG_STANDALONE_LOAD_ADDR += -EB
 endif
 
 PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
+PLATFORM_RELFLAGS += -fpic
 LDFLAGS_FINAL = --gc-sections
 PLATFORM_RELFLAGS += -ffixed-r13
diff --git a/arch/sh/cpu/u-boot.lds b/arch/sh/cpu/u-boot.lds
index f2e48c6..bbf9ff4 100644
--- a/arch/sh/cpu/u-boot.lds
+++ b/arch/sh/cpu/u-boot.lds
@@ -60,7 +60,7 @@ SECTIONS
PROVIDE (_fgot = .);
.got :
{
-   *(.got)
+   *(.got.plt) *(.got)
. = ALIGN(4);
} >ram
PROVIDE (_egot = .);
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 19/24] sh: add common dram_init() function for all boards

2016-11-27 Thread Vladimir Zapolskiy
Generic board support assumes a different method of specifying
DRAM size on board, also it can be shared among all boards, notably
only sh7763rdp board has a custom legacy dram_init(), however
the difference is only in printing some additional information,
this feature can be removed.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/lib/Makefile   |  2 +-
 arch/sh/lib/board.c| 17 +
 board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c | 11 ---
 board/espt/espt.c  | 10 --
 board/mpr2/mpr2.c  | 10 --
 board/ms7720se/ms7720se.c  | 10 --
 board/ms7722se/ms7722se.c  | 10 --
 board/ms7750se/ms7750se.c  | 10 --
 board/renesas/MigoR/migo_r.c   | 10 --
 board/renesas/ap325rxa/ap325rxa.c  | 10 --
 board/renesas/ecovec/ecovec.c  | 10 --
 board/renesas/r0p7734/r0p7734.c| 11 ---
 board/renesas/r2dplus/r2dplus.c| 10 --
 board/renesas/r7780mp/r7780mp.c| 10 --
 board/renesas/rsk7203/rsk7203.c| 10 --
 board/renesas/rsk7264/rsk7264.c| 10 --
 board/renesas/rsk7269/rsk7269.c| 10 --
 board/renesas/sh7752evb/sh7752evb.c| 11 ---
 board/renesas/sh7753evb/sh7753evb.c| 11 ---
 board/renesas/sh7757lcr/sh7757lcr.c| 25 -
 board/renesas/sh7763rdp/sh7763rdp.c| 10 --
 board/renesas/sh7785lcr/sh7785lcr.c| 10 --
 board/shmin/shmin.c| 10 --
 23 files changed, 18 insertions(+), 230 deletions(-)
 create mode 100644 arch/sh/lib/board.c

diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile
index c5cf89f..7be20b1 100644
--- a/arch/sh/lib/Makefile
+++ b/arch/sh/lib/Makefile
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-
+obj-y  += board.o
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 ifeq ($(CONFIG_CPU_SH2),y)
 obj-y  += time_sh2.o
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
new file mode 100644
index 000..7cb594e
--- /dev/null
+++ b/arch/sh/lib/board.c
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2016 Vladimir Zapolskiy 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int dram_init(void)
+{
+   gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
+   CONFIG_SYS_SDRAM_SIZE);
+
+   return 0;
+}
diff --git a/board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c 
b/board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c
index e65befc..31418a1 100644
--- a/board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c
+++ b/board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c
@@ -11,8 +11,6 @@
 #include 
 #include 
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define MODEMR (0xFFCC0020)
 #define MODEMR_MASK(0x6)
 #define MODEMR_533MHZ  (0x2)
@@ -172,12 +170,3 @@ int board_late_init(void)
 
return 0;
 }
-
-int dram_init(void)
-{
-   gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-   gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
-   printf("DRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
-
-   return 0;
-}
diff --git a/board/espt/espt.c b/board/espt/espt.c
index ee6e538..9ab71fe 100644
--- a/board/espt/espt.c
+++ b/board/espt/espt.c
@@ -11,8 +11,6 @@
 #include 
 #include 
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int checkboard(void)
 {
puts("BOARD: ESPT-GIGA\n");
@@ -24,14 +22,6 @@ int board_init(void)
return 0;
 }
 
-int dram_init(void)
-{
-   gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-   gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
-   printf("DRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
-   return 0;
-}
-
 void led_set_state(unsigned short value)
 {
 }
diff --git a/board/mpr2/mpr2.c b/board/mpr2/mpr2.c
index 7449e03..3788a39 100644
--- a/board/mpr2/mpr2.c
+++ b/board/mpr2/mpr2.c
@@ -11,8 +11,6 @@
 #include 
 #include 
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int checkboard(void)
 {
puts("BOARD: MPR2\n");
@@ -138,11 +136,3 @@ int board_init(void)
 
return 0;
 }
-
-int dram_init(void)
-{
-   gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-   gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
-   printf("SDRAM: %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
-   return 0;
-}
diff --git a/board/ms7720se/ms7720se.c b/board/ms7720se/ms7720se.c
index 534a422..48edcc6 100644
--- a/board/ms7720se/ms7720se.c
+++ b/board/ms7720se/ms7720se.c
@@ -17,8 +17,6 @@
 #include 
 #include 
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define LED_BASE   0xB080
 
 int checkboard(void)
@@ -32,14 +30,6 @@ int board_init(void)
return 0;
 }
 
-int dram_init(void)
-{
-   gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-   gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
-   printf("DRAM:  %dMB\n", 

[U-Boot] [RESEND][PATCH 24/24] r2dplus: fixup CONFIG_SYS_TEXT_BASE to account arch/sh changes

2016-11-27 Thread Vladimir Zapolskiy
This change allows to reserve enough space at the end of board SDRAM
to store two copies of U-Boot and malloc heap.

Due to selection of the CONFIG_SYS_TEXT_BASE the second code/data
copying is not avoided, first of all this may depend on a used
toolchain, secondly at this point some level of volatility is wanted
to do more platform changes and do not care about probably changed
calculated in runtime relocation offset.

Signed-off-by: Vladimir Zapolskiy 
---
 include/configs/r2dplus.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/r2dplus.h b/include/configs/r2dplus.h
index e8f60b2..0e954af 100644
--- a/include/configs/r2dplus.h
+++ b/include/configs/r2dplus.h
@@ -29,7 +29,7 @@
 #define CONFIG_SYS_SDRAM_BASE  0x8C00
 #define CONFIG_SYS_SDRAM_SIZE  0x0400
 
-#define CONFIG_SYS_TEXT_BASE   0x8FFC
+#define CONFIG_SYS_TEXT_BASE   0x8FE0
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_SYS_CBSIZE  256
 #define CONFIG_SYS_PBSIZE  256
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 22/24] sh: share the correct version of start.S among all cpus

2016-11-27 Thread Vladimir Zapolskiy
It is easy to note that SH2/SH3/SH4 start.S code is practically
the same with a minor difference for SH2 where a short data header is
present. To avoid unwanted code duplication and to automatically
convert SH2 and SH3 platforms to generic board support move fixed SH4
start.S into arch/sh/lib/start.S and share it among all platforms.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/Makefile |  2 +-
 arch/sh/cpu/sh2/Makefile |  1 -
 arch/sh/cpu/sh2/start.S  | 66 
 arch/sh/cpu/sh3/Makefile |  1 -
 arch/sh/cpu/sh3/start.S  | 65 ---
 arch/sh/cpu/sh4/Makefile |  1 -
 arch/sh/lib/Makefile |  2 ++
 arch/sh/{cpu/sh4 => lib}/start.S |  6 
 8 files changed, 9 insertions(+), 135 deletions(-)
 delete mode 100644 arch/sh/cpu/sh2/start.S
 delete mode 100644 arch/sh/cpu/sh3/start.S
 rename arch/sh/{cpu/sh4 => lib}/start.S (87%)

diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index ca55fac..14e0b66 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-head-y := arch/sh/cpu/$(CPU)/start.o
+head-y := arch/sh/lib/start.o
 
 libs-y += arch/sh/cpu/$(CPU)/
 libs-y += arch/sh/lib/
diff --git a/arch/sh/cpu/sh2/Makefile b/arch/sh/cpu/sh2/Makefile
index a19ed5e..80fff49 100644
--- a/arch/sh/cpu/sh2/Makefile
+++ b/arch/sh/cpu/sh2/Makefile
@@ -8,5 +8,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-extra-y= start.o
 obj-y  = cpu.o interrupts.o watchdog.o
diff --git a/arch/sh/cpu/sh2/start.S b/arch/sh/cpu/sh2/start.S
deleted file mode 100644
index 6171edc..000
--- a/arch/sh/cpu/sh2/start.S
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2007,2008 Nobuhiro Iwamatsu 
- * Copyright (C) 2008 Renesas Solutions Corp.
-
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-
-   .text
-   .align  2
-
-   .global _start
-_sh_start:
-   .long 0x0010/* Ppower ON reset PC*/
-   .long 0x
-   .long 0x0010/* Manual reset PC */
-   .long 0x
-_init:
-   mov.l   ._lowlevel_init, r0
-100:   bsrfr0
-   nop
-   bsr 1f
-   nop
-1: sts pr, r5
-   mov.l   ._reloc_dst, r4
-   add #(_sh_start-1b), r5
-   mov.l   ._reloc_dst_end, r6
-
-2: mov.l   @r5+, r1
-   mov.l   r1, @r4
-   add #4, r4
-   cmp/hs  r6, r4
-   bf  2b
-
-   mov.l   ._bss_start, r4
-   mov.l   ._bss_end, r5
-   mov #0, r1
-
-3: mov.l   r1, @r4 /* bss clear */
-   add #4, r4
-   cmp/hs  r5, r4
-   bf  3b
-
-   mov.l   ._gd_init, r13  /* global data */
-   mov.l   ._stack_init, r15   /* stack */
-
-   #TODO(sh maintainer): Fix this up to call the correct code
-   #mov.l  ._sh_generic_init, r0
-   #jsr@r0
-   nop
-
-loop:
-   bra loop
-
-   .align  2
-
-._lowlevel_init:   .long   (lowlevel_init - (100b + 4))
-._reloc_dst:   .long   reloc_dst
-._reloc_dst_end:   .long   reloc_dst_end
-._bss_start:   .long   bss_start
-._bss_end: .long   bss_end
-._gd_init: .long   (_sh_start - GENERATED_GBL_DATA_SIZE)
-._stack_init:  .long   (_sh_start - GENERATED_GBL_DATA_SIZE - 
CONFIG_SYS_MALLOC_LEN - 16)
-#._sh_generic_init:.long   sh_generic_init
diff --git a/arch/sh/cpu/sh3/Makefile b/arch/sh/cpu/sh3/Makefile
index 85917b9..cddc15b 100644
--- a/arch/sh/cpu/sh3/Makefile
+++ b/arch/sh/cpu/sh3/Makefile
@@ -11,5 +11,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-extra-y= start.o
 obj-y  = cpu.o interrupts.o watchdog.o
diff --git a/arch/sh/cpu/sh3/start.S b/arch/sh/cpu/sh3/start.S
deleted file mode 100644
index 9ed7198..000
--- a/arch/sh/cpu/sh3/start.S
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * (C) Copyright 2007
- * Yoshihiro Shimoda 
- *
- * (C) Copyright 2007
- * Nobuhiro Iwamatsu 
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-
-   .text
-   .align  2
-
-   .global _start
-_sh_start:
-   mov.l   ._lowlevel_init, r0
-100:   bsrfr0
-   nop
-
-   bsr 1f
-   nop
-1: sts pr, r5
-   mov.l   ._reloc_dst, r4
-   add #(_sh_start-1b), r5
-   mov.l   ._reloc_dst_end, r6
-
-2: mov.l   @r5+, r1
-   mov.l   r1, @r4
-   add #4, r4
-   cmp/hs  r6, r4
-   bf  2b
-
-   mov.l   ._bss_start, r4
-   mov.l   ._bss_end, r5
-   mov #0, r1
-
-3: mov.l   r1, @r4 /* bss clear */
-   add #4, r4
-   cmp/hs  r5, r4
-   bf  3b
-
-   mov.l   ._gd_init, r13  /* global data */
-   mov.l   ._stack_init, r15   /* stack */
-
-   #TODO(sh maintainer): Fix this up to call the correct code
-   #mov.l  

[U-Boot] [RESEND][PATCH 17/24] sh: remove undefined DEBUG preprocessor token from board config files

2016-11-27 Thread Vladimir Zapolskiy
By default this undef is a noop, moreover at this point when the
platform support is broken is prevents debugging of U-boot by manual
insertion of #define DEBUG into common files, so it makes sense to
remove the option from all SH boards as a harmful one.

Signed-off-by: Vladimir Zapolskiy 
---
 include/configs/MigoR.h  | 1 -
 include/configs/ap325rxa.h   | 1 -
 include/configs/ap_sh4a_4a.h | 1 -
 include/configs/ecovec.h | 1 -
 include/configs/r0p7734.h| 1 -
 include/configs/r2dplus.h| 2 --
 include/configs/r7780mp.h| 1 -
 include/configs/rsk7203.h| 1 -
 include/configs/rsk7264.h| 1 -
 include/configs/rsk7269.h| 1 -
 include/configs/sh7752evb.h  | 1 -
 include/configs/sh7753evb.h  | 1 -
 include/configs/sh7757lcr.h  | 1 -
 include/configs/sh7785lcr.h  | 1 -
 14 files changed, 15 deletions(-)

diff --git a/include/configs/MigoR.h b/include/configs/MigoR.h
index bb12785..e1338cd 100644
--- a/include/configs/MigoR.h
+++ b/include/configs/MigoR.h
@@ -9,7 +9,6 @@
 #ifndef __MIGO_R_H
 #define __MIGO_R_H
 
-#undef DEBUG
 #define CONFIG_CPU_SH7722  1
 #define CONFIG_MIGO_R  1
 
diff --git a/include/configs/ap325rxa.h b/include/configs/ap325rxa.h
index 9a4d2c9..6e39868 100644
--- a/include/configs/ap325rxa.h
+++ b/include/configs/ap325rxa.h
@@ -10,7 +10,6 @@
 #ifndef __AP325RXA_H
 #define __AP325RXA_H
 
-#undef DEBUG
 #define CONFIG_CPU_SH7723  1
 #define CONFIG_AP325RXA1
 
diff --git a/include/configs/ap_sh4a_4a.h b/include/configs/ap_sh4a_4a.h
index 93205aa..d2d9770 100644
--- a/include/configs/ap_sh4a_4a.h
+++ b/include/configs/ap_sh4a_4a.h
@@ -9,7 +9,6 @@
 #ifndef __AP_SH4A_4A_H
 #define __AP_SH4A_4A_H
 
-#undef DEBUG
 #define CONFIG_CPU_SH7734  1
 #define CONFIG_AP_SH4A_4A  1
 #define CONFIG_400MHZ_MODE 1
diff --git a/include/configs/ecovec.h b/include/configs/ecovec.h
index e1e3c78..19514b6 100644
--- a/include/configs/ecovec.h
+++ b/include/configs/ecovec.h
@@ -22,7 +22,6 @@
  *  0x1800_  MFI  16bit
  */
 
-#undef DEBUG
 #define CONFIG_CPU_SH7724  1
 #define CONFIG_BOARD_LATE_INIT 1
 #define CONFIG_ECOVEC  1
diff --git a/include/configs/r0p7734.h b/include/configs/r0p7734.h
index 0552003..2ae9e02 100644
--- a/include/configs/r0p7734.h
+++ b/include/configs/r0p7734.h
@@ -9,7 +9,6 @@
 #ifndef __R0P7734_H
 #define __R0P7734_H
 
-#undef DEBUG
 #define CONFIG_CPU_SH7734  1
 #define CONFIG_R0P7734 1
 #define CONFIG_400MHZ_MODE 1
diff --git a/include/configs/r2dplus.h b/include/configs/r2dplus.h
index 21bfe72..a0e0c1c 100644
--- a/include/configs/r2dplus.h
+++ b/include/configs/r2dplus.h
@@ -1,8 +1,6 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#undef DEBUG
-
 #define CONFIG_CPU_SH7751  1
 #define CONFIG_CPU_SH_TYPE_R   1
 #define CONFIG_R2DPLUS 1
diff --git a/include/configs/r7780mp.h b/include/configs/r7780mp.h
index 42d5135..9812bc8 100644
--- a/include/configs/r7780mp.h
+++ b/include/configs/r7780mp.h
@@ -10,7 +10,6 @@
 #ifndef __R7780RP_H
 #define __R7780RP_H
 
-#undef DEBUG
 #define CONFIG_CPU_SH7780  1
 #define CONFIG_R7780MP 1
 #define CONFIG_SYS_R7780MP_OLD_FLASH   1
diff --git a/include/configs/rsk7203.h b/include/configs/rsk7203.h
index 9db73d3..2eb9d31 100644
--- a/include/configs/rsk7203.h
+++ b/include/configs/rsk7203.h
@@ -10,7 +10,6 @@
 #ifndef __RSK7203_H
 #define __RSK7203_H
 
-#undef DEBUG
 #define CONFIG_CPU_SH7203  1
 #define CONFIG_RSK7203 1
 
diff --git a/include/configs/rsk7264.h b/include/configs/rsk7264.h
index 3f9fb7b..55dd2c4 100644
--- a/include/configs/rsk7264.h
+++ b/include/configs/rsk7264.h
@@ -11,7 +11,6 @@
 #ifndef __RSK7264_H
 #define __RSK7264_H
 
-#undef DEBUG
 #define CONFIG_CPU_SH7264  1
 #define CONFIG_RSK7264 1
 
diff --git a/include/configs/rsk7269.h b/include/configs/rsk7269.h
index b7f361b..ec7a99b 100644
--- a/include/configs/rsk7269.h
+++ b/include/configs/rsk7269.h
@@ -10,7 +10,6 @@
 #ifndef __RSK7269_H
 #define __RSK7269_H
 
-#undef DEBUG
 #define CONFIG_CPU_SH7269  1
 #define CONFIG_RSK7269 1
 
diff --git a/include/configs/sh7752evb.h b/include/configs/sh7752evb.h
index 23c8300..4f99856 100644
--- a/include/configs/sh7752evb.h
+++ b/include/configs/sh7752evb.h
@@ -9,7 +9,6 @@
 #ifndef __SH7752EVB_H
 #define __SH7752EVB_H
 
-#undef DEBUG
 #define CONFIG_CPU_SH7752  1
 #define CONFIG_SH7752EVB   1
 
diff --git a/include/configs/sh7753evb.h b/include/configs/sh7753evb.h
index 9c601b5..e2ef2d5 100644
--- a/include/configs/sh7753evb.h
+++ b/include/configs/sh7753evb.h
@@ -9,7 +9,6 @@
 #ifndef __SH7753EVB_H
 #define __SH7753EVB_H
 
-#undef DEBUG
 #define CONFIG_CPU_SH7753  1
 #define CONFIG_SH7753EVB   1
 
diff --git a/include/configs/sh7757lcr.h b/include/configs/sh7757lcr.h
index 8345e53..a5a9396 100644
--- a/include/configs/sh7757lcr.h
+++ b/include/configs/sh7757lcr.h
@@ -9,7 +9,6 @@
 #ifndef __SH7757LCR_H
 #define __SH7757LCR_H
 
-#undef DEBUG
 #define 

[U-Boot] [RESEND][PATCH 16/24] sh: add MEMORY command to a shared linker script

2016-11-27 Thread Vladimir Zapolskiy
At the moment in runtime all defined sections are copied into or
created in RAM, specify this explicitly to assert potential out of RAM
placements of the sections.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/cpu/u-boot.lds | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/arch/sh/cpu/u-boot.lds b/arch/sh/cpu/u-boot.lds
index bc240bd..f2e48c6 100644
--- a/arch/sh/cpu/u-boot.lds
+++ b/arch/sh/cpu/u-boot.lds
@@ -1,12 +1,8 @@
 /*
- * Copyright (C) 2007
- * Nobuhiro Iwamatsu 
- *
- * Copyright (C) 2008-2009
- * Yoshihiro Shimoda 
- *
- * Copyright (C) 2008
- * Mark Jonas 
+ * Copyright (C) 2016 Vladimir Zapolskiy 
+ * Copyright (C) 2008-2009 Yoshihiro Shimoda 
+ * Copyright (C) 2008 Mark Jonas 
+ * Copyright (C) 2007 Nobuhiro Iwamatsu 
  *
  * SPDX-License-Identifier:GPL-2.0+
  */
@@ -15,6 +11,12 @@
 
 OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
 OUTPUT_ARCH(sh)
+
+MEMORY
+{
+   ram : ORIGIN = CONFIG_SYS_SDRAM_BASE, LENGTH = CONFIG_SYS_SDRAM_SIZE
+}
+
 ENTRY(_start)
 
 SECTIONS
@@ -37,13 +39,13 @@ SECTIONS
. = ALIGN(8192);
*(.text)
. = ALIGN(4);
-   } =0xFF
+   } >ram =0xFF
PROVIDE (_ecode = .);
.rodata :
{
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
. = ALIGN(4);
-   }
+   } >ram
PROVIDE (_etext = .);
 
 
@@ -52,7 +54,7 @@ SECTIONS
{
*(.data)
. = ALIGN(4);
-   }
+   } >ram
PROVIDE (_edata = .);
 
PROVIDE (_fgot = .);
@@ -60,13 +62,12 @@ SECTIONS
{
*(.got)
. = ALIGN(4);
-   }
+   } >ram
PROVIDE (_egot = .);
 
-
.u_boot_list : {
KEEP(*(SORT(.u_boot_list*)));
-   }
+   } >ram
 
PROVIDE (__init_end = .);
PROVIDE (reloc_dst_end = .);
@@ -77,8 +78,7 @@ SECTIONS
{
*(.bss)
. = ALIGN(4);
-   }
+   } >ram
PROVIDE (bss_end = .);
-
PROVIDE (__bss_end = .);
 }
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 14/24] sh: place board lowlevel_init code in the beginning of .text

2016-11-27 Thread Vladimir Zapolskiy
Reference lowlevel_init of all supported SH2A/SH3/SH4/SH4A boards
from a shared linker script, the lowlevel_init function will be called
by a relative address.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/cpu/u-boot.lds | 2 +-
 board/alphaproject/ap_sh4a_4a/Makefile | 2 +-
 board/espt/Makefile| 2 +-
 board/mpr2/Makefile| 2 +-
 board/ms7720se/Makefile| 2 +-
 board/ms7722se/Makefile| 2 +-
 board/ms7750se/Makefile| 2 +-
 board/renesas/MigoR/Makefile   | 2 +-
 board/renesas/ap325rxa/Makefile| 2 +-
 board/renesas/ecovec/Makefile  | 2 +-
 board/renesas/r0p7734/Makefile | 2 +-
 board/renesas/r2dplus/Makefile | 2 +-
 board/renesas/r7780mp/Makefile | 2 +-
 board/renesas/rsk7203/Makefile | 2 +-
 board/renesas/rsk7264/Makefile | 2 +-
 board/renesas/rsk7269/Makefile | 2 +-
 board/renesas/sh7763rdp/Makefile   | 2 +-
 board/renesas/sh7785lcr/Makefile   | 2 +-
 board/shmin/Makefile   | 2 +-
 19 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/sh/cpu/u-boot.lds b/arch/sh/cpu/u-boot.lds
index 6f38563..e90ac06 100644
--- a/arch/sh/cpu/u-boot.lds
+++ b/arch/sh/cpu/u-boot.lds
@@ -31,7 +31,7 @@ SECTIONS
.text :
{
KEEP(*/start.o  (.text))
-   KEEP(CONFIG_BOARDDIR/lowlevel_init.o(.spiboot1.text))
+   KEEP(CONFIG_BOARDDIR/lowlevel_init.o(.text .spiboot1.text))
KEEP(*(.spiboot2.text))
. = ALIGN(8192);
common/env_embedded.o   (.ppcenv)
diff --git a/board/alphaproject/ap_sh4a_4a/Makefile 
b/board/alphaproject/ap_sh4a_4a/Makefile
index 486d0ac..df76466 100644
--- a/board/alphaproject/ap_sh4a_4a/Makefile
+++ b/board/alphaproject/ap_sh4a_4a/Makefile
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 obj-y  := ap_sh4a_4a.o
-obj-y  += lowlevel_init.o
+extra-y+= lowlevel_init.o
diff --git a/board/espt/Makefile b/board/espt/Makefile
index 8a8a2c9..f24e9cf 100644
--- a/board/espt/Makefile
+++ b/board/espt/Makefile
@@ -8,4 +8,4 @@
 #
 
 obj-y  := espt.o
-obj-y  += lowlevel_init.o
+extra-y+= lowlevel_init.o
diff --git a/board/mpr2/Makefile b/board/mpr2/Makefile
index b6cdeb4..0cb1dd6 100644
--- a/board/mpr2/Makefile
+++ b/board/mpr2/Makefile
@@ -16,4 +16,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 obj-y  := mpr2.o
-obj-y  += lowlevel_init.o
+extra-y+= lowlevel_init.o
diff --git a/board/ms7720se/Makefile b/board/ms7720se/Makefile
index 1819c4c..66c25fa 100644
--- a/board/ms7720se/Makefile
+++ b/board/ms7720se/Makefile
@@ -13,4 +13,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 obj-y  := ms7720se.o
-obj-y  += lowlevel_init.o
+extra-y+= lowlevel_init.o
diff --git a/board/ms7722se/Makefile b/board/ms7722se/Makefile
index 9f7af78..808d459 100644
--- a/board/ms7722se/Makefile
+++ b/board/ms7722se/Makefile
@@ -10,4 +10,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 obj-y  := ms7722se.o
-obj-y  += lowlevel_init.o
+extra-y+= lowlevel_init.o
diff --git a/board/ms7750se/Makefile b/board/ms7750se/Makefile
index a8e3ca0..a010e32 100644
--- a/board/ms7750se/Makefile
+++ b/board/ms7750se/Makefile
@@ -6,4 +6,4 @@
 #
 
 obj-y  := ms7750se.o
-obj-y  += lowlevel_init.o
+extra-y+= lowlevel_init.o
diff --git a/board/renesas/MigoR/Makefile b/board/renesas/MigoR/Makefile
index b4691a1..0686f97 100644
--- a/board/renesas/MigoR/Makefile
+++ b/board/renesas/MigoR/Makefile
@@ -10,4 +10,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 obj-y  := migo_r.o
-obj-y  += lowlevel_init.o
+extra-y+= lowlevel_init.o
diff --git a/board/renesas/ap325rxa/Makefile b/board/renesas/ap325rxa/Makefile
index ff72de9..18e1ed5 100644
--- a/board/renesas/ap325rxa/Makefile
+++ b/board/renesas/ap325rxa/Makefile
@@ -9,4 +9,4 @@
 #
 
 obj-y  := ap325rxa.o cpld-ap325rxa.o
-obj-y  += lowlevel_init.o
+extra-y+= lowlevel_init.o
diff --git a/board/renesas/ecovec/Makefile b/board/renesas/ecovec/Makefile
index 943fa47..2e6fb50 100644
--- a/board/renesas/ecovec/Makefile
+++ b/board/renesas/ecovec/Makefile
@@ -5,4 +5,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 obj-y := ecovec.o
-obj-y += lowlevel_init.o
+extra-y += lowlevel_init.o
diff --git a/board/renesas/r0p7734/Makefile b/board/renesas/r0p7734/Makefile
index 1f24d92..bfe52d6 100644
--- a/board/renesas/r0p7734/Makefile
+++ b/board/renesas/r0p7734/Makefile
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 obj-y  := r0p7734.o
-obj-y  += lowlevel_init.o
+extra-y+= lowlevel_init.o
diff --git a/board/renesas/r2dplus/Makefile b/board/renesas/r2dplus/Makefile
index acffb6d..4021ab6 100644
--- a/board/renesas/r2dplus/Makefile
+++ b/board/renesas/r2dplus/Makefile
@@ -6,4 +6,4 @@
 #
 
 obj-y  := r2dplus.o
-obj-y  += lowlevel_init.o
+extra-y+= lowlevel_init.o
diff --git 

[U-Boot] [RESEND][PATCH 15/24] sh: define entry point and reloc_dst inside a linker script

2016-11-27 Thread Vladimir Zapolskiy
No functional change, concentrate linker script commands in one
place for convenience. Entry point is set to CONFIG_SYS_TEXT_BASE by
default on build, so this option can be omitted from being added to
the linker script.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/config.mk  | 1 -
 arch/sh/cpu/u-boot.lds | 6 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/sh/config.mk b/arch/sh/config.mk
index 0578fa3..673ed8d 100644
--- a/arch/sh/config.mk
+++ b/arch/sh/config.mk
@@ -15,6 +15,5 @@ CONFIG_STANDALONE_LOAD_ADDR += -EB
 endif
 
 PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
-PLATFORM_LDFLAGS += -e $(CONFIG_SYS_TEXT_BASE) --defsym 
reloc_dst=$(CONFIG_SYS_TEXT_BASE)
 LDFLAGS_FINAL = --gc-sections
 PLATFORM_RELFLAGS += -ffixed-r13
diff --git a/arch/sh/cpu/u-boot.lds b/arch/sh/cpu/u-boot.lds
index e90ac06..bc240bd 100644
--- a/arch/sh/cpu/u-boot.lds
+++ b/arch/sh/cpu/u-boot.lds
@@ -19,10 +19,7 @@ ENTRY(_start)
 
 SECTIONS
 {
-   /*
-* entry and reloct_dst will be provided via ldflags
-*/
-   . = .;
+   reloc_dst = .;
 
PROVIDE (_ftext = .);
PROVIDE (_fcode = .);
@@ -73,7 +70,6 @@ SECTIONS
 
PROVIDE (__init_end = .);
PROVIDE (reloc_dst_end = .);
-   /* _reloc_dst_end = .; */
 
PROVIDE (bss_start = .);
PROVIDE (__bss_start = .);
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 12/24] common: sh: add necessary define bits to board_f

2016-11-27 Thread Vladimir Zapolskiy
Since a platform conversion to generic board support has not been
accomplished some architecture specific bits are missing from board_f
init sequence, the change adds a number of basic expected callbacks
into early init sequence.

Signed-off-by: Vladimir Zapolskiy 
Reviewed-by: Simon Glass 
---
 common/board_f.c | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index 4b74835..cc8aee7 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -276,7 +276,7 @@ static int setup_mon_len(void)
 #elif defined(CONFIG_BLACKFIN) || defined(CONFIG_NIOS2) || \
defined(CONFIG_XTENSA)
gd->mon_len = CONFIG_SYS_MONITOR_LEN;
-#elif defined(CONFIG_NDS32)
+#elif defined(CONFIG_NDS32) || defined(CONFIG_SH)
gd->mon_len = (ulong)(&__bss_end) - (ulong)(&_start);
 #elif defined(CONFIG_SYS_MONITOR_BASE)
/* TODO: use (ulong)&__bss_end - (ulong)&__text_start; ? */
@@ -619,7 +619,8 @@ static int display_new_sp(void)
return 0;
 }
 
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_MIPS)
+#if defined(CONFIG_M68K) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \
+   defined(CONFIG_SH)
 static int setup_board_part1(void)
 {
bd_t *bd = gd->bd;
@@ -884,7 +885,7 @@ static init_fnc_t init_sequence_f[] = {
 #endif
 #if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || \
defined(CONFIG_BLACKFIN) || defined(CONFIG_NDS32) || \
-   defined(CONFIG_SPARC)
+   defined(CONFIG_SH) || defined(CONFIG_SPARC)
timer_init, /* initialize timer */
 #endif
 #ifdef CONFIG_SYS_ALLOC_DPRAM
@@ -921,7 +922,7 @@ static init_fnc_t init_sequence_f[] = {
 #if defined(CONFIG_MPC83xx)
prt_83xx_rsr,
 #endif
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SH)
checkcpu,
 #endif
print_cpuinfo,  /* display cpu info (and speed) */
@@ -945,7 +946,8 @@ static init_fnc_t init_sequence_f[] = {
announce_dram_init,
/* TODO: unify all these dram functions? */
 #if defined(CONFIG_ARM) || defined(CONFIG_X86) || defined(CONFIG_NDS32) || \
-   defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32)
+   defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32) || \
+   defined(CONFIG_SH)
dram_init,  /* configure available RAM banks */
 #endif
 #if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_M68K)
@@ -1023,7 +1025,8 @@ static init_fnc_t init_sequence_f[] = {
reserve_stacks,
setup_dram_config,
show_dram_config,
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_MIPS)
+#if defined(CONFIG_M68K) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \
+   defined(CONFIG_SH)
setup_board_part1,
 #endif
 #if defined(CONFIG_PPC) || defined(CONFIG_M68K)
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 13/24] sh4: use single u-boot linker script for all boards

2016-11-27 Thread Vladimir Zapolskiy
Three supported SH4/SH4A boards with the bootloader image stored on
SPI flash have own flavour of a linker script, in turn they are equal
among each other. The only difference is that the text from
lowlevel_init.o is placed right after start.o, which makes sense.

Note that .bss section is not marked as NOLOAD, because for about
10 years this is a default option of a GNU linker, either the
attribute is found or not the resulting image file is the same.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/cpu/u-boot.lds |  4 ++
 board/renesas/sh7752evb/Makefile   |  2 +-
 board/renesas/sh7752evb/u-boot.lds | 82 -
 board/renesas/sh7753evb/Makefile   |  2 +-
 board/renesas/sh7753evb/u-boot.lds | 82 -
 board/renesas/sh7757lcr/Makefile   |  2 +-
 board/renesas/sh7757lcr/u-boot.lds | 83 --
 include/configs/sh7752evb.h|  1 -
 include/configs/sh7753evb.h|  1 -
 include/configs/sh7757lcr.h|  1 -
 10 files changed, 7 insertions(+), 253 deletions(-)
 delete mode 100644 board/renesas/sh7752evb/u-boot.lds
 delete mode 100644 board/renesas/sh7753evb/u-boot.lds
 delete mode 100644 board/renesas/sh7757lcr/u-boot.lds

diff --git a/arch/sh/cpu/u-boot.lds b/arch/sh/cpu/u-boot.lds
index 78611c2..6f38563 100644
--- a/arch/sh/cpu/u-boot.lds
+++ b/arch/sh/cpu/u-boot.lds
@@ -11,6 +11,8 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
+#include "config.h"
+
 OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
 OUTPUT_ARCH(sh)
 ENTRY(_start)
@@ -29,6 +31,8 @@ SECTIONS
.text :
{
KEEP(*/start.o  (.text))
+   KEEP(CONFIG_BOARDDIR/lowlevel_init.o(.spiboot1.text))
+   KEEP(*(.spiboot2.text))
. = ALIGN(8192);
common/env_embedded.o   (.ppcenv)
. = ALIGN(8192);
diff --git a/board/renesas/sh7752evb/Makefile b/board/renesas/sh7752evb/Makefile
index 856af81..fb6eeec 100644
--- a/board/renesas/sh7752evb/Makefile
+++ b/board/renesas/sh7752evb/Makefile
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 obj-y  := sh7752evb.o spi-boot.o
-obj-y  += lowlevel_init.o
+extra-y+= lowlevel_init.o
diff --git a/board/renesas/sh7752evb/u-boot.lds 
b/board/renesas/sh7752evb/u-boot.lds
deleted file mode 100644
index 6cd4056..000
--- a/board/renesas/sh7752evb/u-boot.lds
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2007
- * Nobuhiro Iwamatsu 
- *
- * Copyright (C) 2012
- * Yoshihiro Shimoda 
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
-OUTPUT_ARCH(sh)
-ENTRY(_start)
-
-SECTIONS
-{
-   /*
-* entry and reloct_dst will be provided via ldflags
-*/
-   . = .;
-
-   PROVIDE (_ftext = .);
-   PROVIDE (_fcode = .);
-   PROVIDE (_start = .);
-
-   .text :
-   {
-   KEEP(arch/sh/cpu/sh4/start.o(.text))
-   *(.spiboot1.text)
-   *(.spiboot2.text)
-   . = ALIGN(8192);
-   common/env_embedded.o   (.ppcenv)
-   . = ALIGN(8192);
-   common/env_embedded.o   (.ppcenvr)
-   . = ALIGN(8192);
-   *(.text)
-   . = ALIGN(4);
-   } =0xFF
-   PROVIDE (_ecode = .);
-   .rodata :
-   {
-   *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
-   . = ALIGN(4);
-   }
-   PROVIDE (_etext = .);
-
-
-   PROVIDE (_fdata = .);
-   .data :
-   {
-   *(.data)
-   . = ALIGN(4);
-   }
-   PROVIDE (_edata = .);
-
-   PROVIDE (_fgot = .);
-   .got :
-   {
-   *(.got)
-   . = ALIGN(4);
-   }
-   PROVIDE (_egot = .);
-
-   .u_boot_list : {
-   KEEP(*(SORT(.u_boot_list*)));
-   }
-
-   PROVIDE (__init_end = .);
-   PROVIDE (reloc_dst_end = .);
-   /* _reloc_dst_end = .; */
-
-   PROVIDE (bss_start = .);
-   PROVIDE (__bss_start = .);
-   .bss (NOLOAD) :
-   {
-   *(.bss)
-   . = ALIGN(4);
-   }
-   PROVIDE (bss_end = .);
-
-   PROVIDE (__bss_end = .);
-}
diff --git a/board/renesas/sh7753evb/Makefile b/board/renesas/sh7753evb/Makefile
index f7c8e94..4293142 100644
--- a/board/renesas/sh7753evb/Makefile
+++ b/board/renesas/sh7753evb/Makefile
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 obj-y  := sh7753evb.o spi-boot.o
-obj-y  += lowlevel_init.o
+extra-y+= lowlevel_init.o
diff --git a/board/renesas/sh7753evb/u-boot.lds 
b/board/renesas/sh7753evb/u-boot.lds
deleted file mode 100644
index 6cd4056..000
--- a/board/renesas/sh7753evb/u-boot.lds
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2007
- * Nobuhiro Iwamatsu 
- *
- * 

[U-Boot] [RESEND][PATCH 09/24] sh4: remove __io config options from r2dplus and r7780mp boards

2016-11-27 Thread Vladimir Zapolskiy
Defined __io is no-op for the SH architecture and it can be removed
from board files without any functional change.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/include/asm/io.h  | 10 --
 include/configs/r2dplus.h |  1 -
 include/configs/r7780mp.h |  1 -
 3 files changed, 12 deletions(-)

diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index 5dc27be..5cb000c 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -68,13 +68,6 @@ extern void __raw_readsl(unsigned int addr, void *data, int 
longlen);
 #define __raw_base_readl(base, off)__arch_base_getl(base, off)
 
 /*
- * Now, pick up the machine-defined IO definitions
- */
-#if 0  /* XXX###XXX */
-#include 
-#endif /* XXX###XXX */
-
-/*
  *  IO port access primitives
  *  -
  *
@@ -82,9 +75,6 @@ extern void __raw_readsl(unsigned int addr, void *data, int 
longlen);
  * mapped.  Note that these are defined to perform little endian accesses
  * only.  Their primary purpose is to access PCI and ISA peripherals.
  *
- * The machine specific io.h include defines __io to translate an "IO"
- * address to a memory address.
- *
  * Note that we prevent GCC re-ordering or caching values in expressions
  * by introducing sequence points into the in*() definitions.  Note that
  * __raw_* do not guarantee this behaviour.
diff --git a/include/configs/r2dplus.h b/include/configs/r2dplus.h
index 477f035..2186915 100644
--- a/include/configs/r2dplus.h
+++ b/include/configs/r2dplus.h
@@ -91,7 +91,6 @@
 #define CONFIG_SH4_PCI
 #define CONFIG_SH7751_PCI
 #define CONFIG_PCI_SCAN_SHOW   1
-#define __io
 #define __mem_pci
 
 #define CONFIG_PCI_MEM_BUS 0xFD00  /* Memory space base addr */
diff --git a/include/configs/r7780mp.h b/include/configs/r7780mp.h
index d4f200a..42d5135 100644
--- a/include/configs/r7780mp.h
+++ b/include/configs/r7780mp.h
@@ -100,7 +100,6 @@
 #define CONFIG_SH7780_PCI_LAR  CONFIG_SYS_SDRAM_SIZE
 #define CONFIG_SH7780_PCI_BAR  CONFIG_SYS_SDRAM_SIZE
 #define CONFIG_PCI_SCAN_SHOW   1
-#define __io
 #define __mem_pci
 
 #define CONFIG_PCI_MEM_BUS 0xFD00  /* Memory space base addr */
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 08/24] pci: sh7751: map PCI memory space into SDRAM

2016-11-27 Thread Vladimir Zapolskiy
For ease of use and accounting a condition that on SH4
pci_phys_to_bus() and pci_bus_to_phys() are one in one mappings due to
unimplemented __iomem() conversion, this change fixes access to SDRAM
memory by PCI devices.

This change also generalizes PCI system memory configuration, which is
taken from board specific defines rather than hardcoded in the PCI
host driver.

Signed-off-by: Vladimir Zapolskiy 
---
 drivers/pci/pci_sh7751.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/pci_sh7751.c b/drivers/pci/pci_sh7751.c
index 420ae81..8a50445 100644
--- a/drivers/pci/pci_sh7751.c
+++ b/drivers/pci/pci_sh7751.c
@@ -66,9 +66,6 @@
 #define SH7751_PCI_IO_BASE 0xFE24
 #define SH7751_PCI_IO_SIZE 0x0004
 
-#define SH7751_CS3_BASE_ADDR0x0C00
-#define SH7751_P2CS3_BASE_ADDR  0xAC00
-
 #define SH7751_PCIPAR   (vu_long *)0xFE2001C0
 #define SH7751_PCIPDR   (vu_long *)0xFE200220
 
@@ -153,11 +150,12 @@ int pci_sh7751_init(struct pci_controller *hose)
 
/* Set up target memory mappings (for external DMA access) */
/* Map both P0 and P2 range to Area 3 RAM for ease of use */
-   p4_out((64 - 1) << 20, SH7751_PCILSR0);
-   p4_out(SH7751_CS3_BASE_ADDR, SH7751_PCILAR0);
+   p4_out(CONFIG_SYS_SDRAM_SIZE - 0x10, SH7751_PCILSR0);
+   p4_out(CONFIG_SYS_SDRAM_BASE & 0x1FF0, SH7751_PCILAR0);
+   p4_out(CONFIG_SYS_SDRAM_BASE & 0xFFF0, SH7751_PCICONF5);
+
p4_out(0, SH7751_PCILSR1);
p4_out(0, SH7751_PCILAR1);
-   p4_out(SH7751_CS3_BASE_ADDR, SH7751_PCICONF5);
p4_out(0xd000, SH7751_PCICONF6);
 
/* Map memory window to same address on PCI bus */
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 06/24] sh4: cache: move exported cache manipulation functions into cache.c

2016-11-27 Thread Vladimir Zapolskiy
No functional change, moving cache manipulation functions into cache.c
allows to collect all of them in a single location and as a pleasant
side effect cache_control() function can be unexported now.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/cpu/sh4/cache.c | 39 ---
 arch/sh/cpu/sh4/cpu.c   | 34 --
 arch/sh/include/asm/cache.h |  2 --
 3 files changed, 36 insertions(+), 39 deletions(-)

diff --git a/arch/sh/cpu/sh4/cache.c b/arch/sh/cpu/sh4/cache.c
index 7750f0f..6175c67 100644
--- a/arch/sh/cpu/sh4/cache.c
+++ b/arch/sh/cpu/sh4/cache.c
@@ -1,6 +1,6 @@
 /*
- * (C) Copyright 2007
- * Nobuhiro Iwamatsu 
+ * (C) Copyright 2016 Vladimir Zapolskiy 
+ * (C) Copyright 2007 Nobuhiro Iwamatsu 
  *
  * SPDX-License-Identifier:GPL-2.0+
  */
@@ -35,7 +35,7 @@ static inline void cache_wback_all(void)
 #define CACHE_ENABLE  0
 #define CACHE_DISABLE 1
 
-int cache_control(unsigned int cmd)
+static int cache_control(unsigned int cmd)
 {
unsigned long ccr;
 
@@ -75,3 +75,36 @@ void invalidate_dcache_range(unsigned long start, unsigned 
long end)
  : "m" (__m(v)));
}
 }
+
+void flush_cache(unsigned long addr, unsigned long size)
+{
+   flush_dcache_range(addr , addr + size);
+}
+
+void icache_enable(void)
+{
+   cache_control(CACHE_ENABLE);
+}
+
+void icache_disable(void)
+{
+   cache_control(CACHE_DISABLE);
+}
+
+int icache_status(void)
+{
+   return 0;
+}
+
+void dcache_enable(void)
+{
+}
+
+void dcache_disable(void)
+{
+}
+
+int dcache_status(void)
+{
+   return 0;
+}
diff --git a/arch/sh/cpu/sh4/cpu.c b/arch/sh/cpu/sh4/cpu.c
index a2cec98..49c58ae 100644
--- a/arch/sh/cpu/sh4/cpu.c
+++ b/arch/sh/cpu/sh4/cpu.c
@@ -9,7 +9,6 @@
 #include 
 #include 
 #include 
-#include 
 
 int checkcpu(void)
 {
@@ -35,39 +34,6 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
return 0;
 }
 
-void flush_cache (unsigned long addr, unsigned long size)
-{
-   flush_dcache_range(addr , addr + size);
-}
-
-void icache_enable (void)
-{
-   cache_control(0);
-}
-
-void icache_disable (void)
-{
-   cache_control(1);
-}
-
-int icache_status (void)
-{
-   return 0;
-}
-
-void dcache_enable (void)
-{
-}
-
-void dcache_disable (void)
-{
-}
-
-int dcache_status (void)
-{
-   return 0;
-}
-
 int cpu_eth_init(bd_t *bis)
 {
 #ifdef CONFIG_SH_ETHER
diff --git a/arch/sh/include/asm/cache.h b/arch/sh/include/asm/cache.h
index abaf405..b548a35 100644
--- a/arch/sh/include/asm/cache.h
+++ b/arch/sh/include/asm/cache.h
@@ -3,8 +3,6 @@
 
 #if defined(CONFIG_CPU_SH4)
 
-int cache_control(unsigned int cmd);
-
 #define L1_CACHE_BYTES 32
 
 struct __large_struct { unsigned long buf[100]; };
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 10/24] r2dplus: use P1 area space for text base and PCI system memory

2016-11-27 Thread Vladimir Zapolskiy
While both options are acceptable use P1 area physical addresses
instead of external memory space of text base and PCI system memory
for unification purposes, all other supported superh boards have the
same selection.

This allows to easily ensure that CONFIG_SYS_TEXT_BASE is located
within available DRAM.

Signed-off-by: Vladimir Zapolskiy 
---
 include/configs/r2dplus.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/configs/r2dplus.h b/include/configs/r2dplus.h
index 2186915..21bfe72 100644
--- a/include/configs/r2dplus.h
+++ b/include/configs/r2dplus.h
@@ -26,10 +26,10 @@
 #define CONFIG_ENV_OVERWRITE   1
 
 /* SDRAM */
-#define CONFIG_SYS_SDRAM_BASE  (0x8C00)
-#define CONFIG_SYS_SDRAM_SIZE  (0x0400)
+#define CONFIG_SYS_SDRAM_BASE  0x8C00
+#define CONFIG_SYS_SDRAM_SIZE  0x0400
 
-#define CONFIG_SYS_TEXT_BASE   0x0FFC
+#define CONFIG_SYS_TEXT_BASE   0x8FFC
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_SYS_CBSIZE  256
 #define CONFIG_SYS_PBSIZE  256
@@ -99,8 +99,8 @@
 #define CONFIG_PCI_IO_BUS  0xFE24  /* IO space base address */
 #define CONFIG_PCI_IO_PHYS CONFIG_PCI_IO_BUS
 #define CONFIG_PCI_IO_SIZE 0x0004  /* Size of IO window */
-#define CONFIG_PCI_SYS_BUS (CONFIG_SYS_SDRAM_BASE & 0x1fff)
-#define CONFIG_PCI_SYS_PHYS(CONFIG_SYS_SDRAM_BASE & 0x1fff)
+#define CONFIG_PCI_SYS_BUS CONFIG_SYS_SDRAM_BASE
+#define CONFIG_PCI_SYS_PHYSCONFIG_SYS_SDRAM_BASE
 #define CONFIG_PCI_SYS_SIZECONFIG_SYS_SDRAM_SIZE
 
 #endif /* __CONFIG_H */
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 04/24] sh: cache use jump_to_P2() and back_to_P1() from asm/system.h

2016-11-27 Thread Vladimir Zapolskiy
Both jump_to_P2() and back_to_P1() functions are found in asm/system.h
header file and functionally they are the same, don't redefine them.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/cpu/sh4/cache.c | 39 ++-
 1 file changed, 2 insertions(+), 37 deletions(-)

diff --git a/arch/sh/cpu/sh4/cache.c b/arch/sh/cpu/sh4/cache.c
index b3e5fd5..50695b6 100644
--- a/arch/sh/cpu/sh4/cache.c
+++ b/arch/sh/cpu/sh4/cache.c
@@ -7,44 +7,9 @@
 
 #include 
 #include 
-#include 
 #include 
-
-/*
- * Jump to P2 area.
- * When handling TLB or caches, we need to do it from P2 area.
- */
-#define jump_to_P2()   \
-  do { \
-unsigned long __dummy; \
-__asm__ __volatile__(  \
-   "mov.l  1f, %0\n\t" \
-   "or %1, %0\n\t" \
-   "jmp@%0\n\t"\
-   " nop\n\t"  \
-   ".balign 4\n"   \
-   "1: .long 2f\n" \
-   "2:"\
-   : "=" (__dummy)   \
-   : "r" (0x2000));\
-  } while (0)
-
-/*
- * Back to P1 area.
- */
-#define back_to_P1()   \
-  do { \
-unsigned long __dummy; \
-__asm__ __volatile__(  \
-   "nop;nop;nop;nop;nop;nop;nop\n\t"   \
-   "mov.l  1f, %0\n\t" \
-   "jmp@%0\n\t"\
-   " nop\n\t"  \
-   ".balign 4\n"   \
-   "1: .long 2f\n" \
-   "2:"\
-   : "=" (__dummy)); \
-  } while (0)
+#include 
+#include 
 
 #define CACHE_VALID   1
 #define CACHE_UPDATED 2
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 01/24] sh4: cache: correct dcache flush to invalidate with write-back

2016-11-27 Thread Vladimir Zapolskiy
In common usecases flush_cache() assumes both cache invalidation and
write-back to memory, thus in flush_dcache_range() implementation
change SH4 cache write-back only instruction 'ocbwb' with cache purge
instruction 'ocbp', according to the User's Manual there should be no
performance penalty for that.

Note that under circumstances only cache invalidation is expected from
flush_cache() call, in these occasional cases the current version of
flush_cache() works, which is a wrapper over invalidate_dcache_range()
at the moment, this will be fixed in the following change.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/cpu/sh4/cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sh/cpu/sh4/cache.c b/arch/sh/cpu/sh4/cache.c
index e1ee970..b3e5fd5 100644
--- a/arch/sh/cpu/sh4/cache.c
+++ b/arch/sh/cpu/sh4/cache.c
@@ -97,7 +97,7 @@ void flush_dcache_range(unsigned long start, unsigned long 
end)
 
start &= ~(L1_CACHE_BYTES - 1);
for (v = start; v < end; v += L1_CACHE_BYTES) {
-   asm volatile ("ocbwb %0" :  /* no output */
+   asm volatile ("ocbp %0" :   /* no output */
  : "m" (__m(v)));
}
 }
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 03/24] sh3: remove unused cache.c file from being built

2016-11-27 Thread Vladimir Zapolskiy
The change is similar to commit 994b56616bae ("sh: delete an unused
source file") for SH2, however here the removed cache.c file was
built and included into an image as a dead code.

If it is needed in future the contents can be reused from a similar
arch/sh/cpu/sh4/cache.c file, which is in turn will be moved to
a shared among all core flavours location at arch/sh/lib/cache.c.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/cpu/sh3/Makefile |  2 +-
 arch/sh/cpu/sh3/cache.c  | 96 
 2 files changed, 1 insertion(+), 97 deletions(-)
 delete mode 100644 arch/sh/cpu/sh3/cache.c

diff --git a/arch/sh/cpu/sh3/Makefile b/arch/sh/cpu/sh3/Makefile
index 1dccaf9..85917b9 100644
--- a/arch/sh/cpu/sh3/Makefile
+++ b/arch/sh/cpu/sh3/Makefile
@@ -12,4 +12,4 @@
 #
 
 extra-y= start.o
-obj-y  = cpu.o interrupts.o watchdog.o cache.o
+obj-y  = cpu.o interrupts.o watchdog.o
diff --git a/arch/sh/cpu/sh3/cache.c b/arch/sh/cpu/sh3/cache.c
deleted file mode 100644
index 34cbbff..000
--- a/arch/sh/cpu/sh3/cache.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * (C) Copyright 2007
- * Yoshihiro Shimoda 
- *
- * (C) Copyright 2007
- * Nobobuhiro Iwamatsu 
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-#include 
-#include 
-
-/*
- * Jump to P2 area.
- * When handling TLB or caches, we need to do it from P2 area.
- */
-#define jump_to_P2()\
-  do {\
-unsigned long __dummy; \
-__asm__ __volatile__(  \
-   "mov.l  1f, %0\n\t" \
-   "or %1, %0\n\t" \
-   "jmp@%0\n\t"\
-   " nop\n\t"  \
-   ".balign 4\n"   \
-   "1: .long 2f\n" \
-   "2:"\
-   : "=" (__dummy)   \
-   : "r" (0x2000));\
-  } while (0)
-
-/*
- * Back to P1 area.
- */
-#define back_to_P1()\
-  do {\
-unsigned long __dummy;  \
-__asm__ __volatile__(   \
-   "nop;nop;nop;nop;nop;nop;nop\n\t"   \
-   "mov.l  1f, %0\n\t" \
-   "jmp@%0\n\t"\
-   " nop\n\t"  \
-   ".balign 4\n"   \
-   "1: .long 2f\n" \
-   "2:"\
-   : "=" (__dummy)); \
-  } while (0)
-
-#define CACHE_VALID   1
-#define CACHE_UPDATED 2
-
-static inline void cache_wback_all(void)
-{
-   unsigned long addr, data, i, j;
-
-   jump_to_P2();
-   for (i = 0; i < CACHE_OC_NUM_ENTRIES; i++) {
-   for (j = 0; j < CACHE_OC_NUM_WAYS; j++) {
-   addr = CACHE_OC_ADDRESS_ARRAY
-   | (j << CACHE_OC_WAY_SHIFT)
-   | (i << CACHE_OC_ENTRY_SHIFT);
-   data = inl(addr);
-   if (data & CACHE_UPDATED) {
-   data &= ~CACHE_UPDATED;
-   outl(data, addr);
-   }
-   }
-   }
-   back_to_P1();
-}
-
-
-#define CACHE_ENABLE  0
-#define CACHE_DISABLE 1
-
-int cache_control(unsigned int cmd)
-{
-   unsigned long ccr;
-
-   jump_to_P2();
-   ccr = inl(CCR);
-
-   if (ccr & CCR_CACHE_ENABLE)
-   cache_wback_all();
-
-   if (cmd == CACHE_DISABLE)
-   outl(CCR_CACHE_STOP, CCR);
-   else
-   outl(CCR_CACHE_INIT, CCR);
-   back_to_P1();
-
-   return 0;
-}
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 07/24] pci: sh7751: fix up PCI I/O space address

2016-11-27 Thread Vladimir Zapolskiy
The change actually maps PCI I/O window to the same address on PCI bus
as it is stated by a comment, before the change transfers to the PCI I/O
space are failed due to misconfiguration of the most significant 14 bits
of the PCI address in PCIIOBR (note that it is set to 0x0).

Most probably the problem remained unnoticed, because communcation
to all tested PCI devices is done over PCI memory space only.

Signed-off-by: Vladimir Zapolskiy 
---
 drivers/pci/pci_sh7751.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pci_sh7751.c b/drivers/pci/pci_sh7751.c
index f189ed8..420ae81 100644
--- a/drivers/pci/pci_sh7751.c
+++ b/drivers/pci/pci_sh7751.c
@@ -164,7 +164,7 @@ int pci_sh7751_init(struct pci_controller *hose)
p4_out(SH7751_PCI_MEM_BASE, SH7751_PCIMBR);
 
/* Map IO window to same address on PCI bus */
-   p4_out(0x2000 & 0xfffc, SH7751_PCIIOBR);
+   p4_out(SH7751_PCI_IO_BASE, SH7751_PCIIOBR);
 
/* set BREQEN */
p4_out(inl(SH7751_BCR1) | 0x0008, SH7751_BCR1);
-- 
2.10.2

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


[U-Boot] [RESEND][PATCH 00/24] sh: add generic board support and fixes

2016-11-27 Thread Vladimir Zapolskiy
This is a combined series of the fixes to SH2/SH3/SH4/SH4A architecture port
of U-boot on top of the master branch, there is no functional difference
between this series and 3 my series sent in August 2016 for 2016.09, however
due to many positive generalization updates to U-boot sources the old
unreviewed series can not be cleanly applied anymore:

* [PATCH 0/6] sh4: fix and simplify cache manipulation
* [PATCH 0/5] sh4: fixes to SH7751 PCI host controller
* [PATCH] common: sh: add necessary define bits to board_f
* [PATCH 00/12] sh: change arch and boards code to generic board

I have to resend the changes, because apparently Nobuhiro Iwamatsu is
too busy to maintain SH port and I ask Tom/Simon/Marek and other active
U-boot developers to review and apply the changes, it is highly desirable
to have a possibility to run modern U-boot on boards powered by SH cores.

The changeset implements initial support of relocatable U-Boot code
for SH2/SH3/SH4 architectures and boards, as weel as it restores
a possibility to boot U-Boot on SH boards, which has not been converted
to generic board in time (for more details see commit f41e6088eb1
("sh: Fix build errors for generic board")). Special attention from
maintainers of all touched boards is required, due to inaccessibility
of hardware for me it would be a troublesome task.

*** CACHE SUPPORT COVER LETTER ***

In my tests I experience that sometimes SH4 does not properly
fetch instructions after immediate jump to a code loaded by
means of rtl8139, the problem is gone if "icache off" is
executed after load or if cache invalidation and write-back
is used on data load instead of just cache invalidation,
which is apparently an improper backbone of flush_dcache_range()
function.

The changeset contains a couple of bugfixes and a general
simplification of the code related to cache manipulation. Note
that while caches are found on SH2 and SH3 for long time
they were inactive in U-Boot, because I don't have SH2/SH3
hardware for testing I don't spread SH4 cache fixes to those
cpus, however generally it should be the same, in that case
arch/sh/cpu/sh4/cache.c file can be moved to arch/sh/lib
folder

*** PCI CONTROLLER CHANGES COVER LETTER ***

This series fixes 2 bugs found in SH7751 PCI host controller driver,
also it restores r2dplus defconfig and slightly simplifies the code
related to the SH7751 PCI controller, more improvements may follow
in future.

The change is independent on the following conversion to generic
board, however it adds some bits to simplify porting of r2dplus
board by moving board specific CONFIG_SYS_TEXT_BASE into P1 area,

Before the change even if rtl8139 driver is selected in a defconfig
the device was unusable due to invalid phys to bus mapping (e.g. test
with 'dhcp' command shows it), this most probably was caused by some
unnoticed generic change in PCI driver framework, however now it is
fixed by the series.

*** GENERIC BOARD CHANGES COVER LETTER ***

Now code/data initialization and relocation in general resemble the
procedure on ARM with minor peculiarities (same one relocation from a
storage device if calculated reloc_off == 0, otherwise two relocations),
however please note that the change does *not* add PIE support (only PIC),
so it may end up that there are persistent pointers to some non-relocated
data, this point requires better investion.

Only r2dplus board is actually converted to support new architectural
changes, the rest of the boards require attention from board maintainers
or they will be removed. Board maintainers may pay attention to
CONFIG_SYS_MALLOC_CLEAR_ON_INIT, CONFIG_NEEDS_MANUAL_RELOC,
CONFIG_SYS_GENERIC_GLOBAL_DATA etc. options.

This r2dplus board change allows immediately check the correctness of
the series on a r2dplus qemu target, note that the second copy is
not avoided in this case, also for simplicity SDRAM area up to text base
is large enough to store malloc pool and two copies of loaded code/data.

The change was tested on one custom SH4 (SH7551R) board, r2dplus qemu
target (see also SH7751 PCI change under review), the rest of the boards
are compile tested only.

Multiple kudos to Simon for great patience and a decision to not remove
the code.

Vladimir Zapolskiy (24):
  sh4: cache: correct dcache flush to invalidate with write-back
  sh4: cache: correct flush_cache() to writeback and invalidate
  sh3: remove unused cache.c file from being built
  sh: cache use jump_to_P2() and back_to_P1() from asm/system.h
  sh: cache: don't modify CCR from P1 area
  sh4: cache: move exported cache manipulation functions into cache.c
  pci: sh7751: fix up PCI I/O space address
  pci: sh7751: map PCI memory space into SDRAM
  sh4: remove __io config options from r2dplus and r7780mp boards
  r2dplus: use P1 area space for text base and PCI system memory
  r2dplus: select rtl8139 driver in defconfig
  common: sh: add necessary define bits to board_f
  sh4: use single u-boot linker script for all boards
  sh: place board 

[U-Boot] [RESEND][PATCH 02/24] sh4: cache: correct flush_cache() to writeback and invalidate

2016-11-27 Thread Vladimir Zapolskiy
In common usecases flush_cache() assumes both cache invalidation and
write-back to memory, instead of doing cache invalidation only with
the wrapped 'ocbi' instruction pin flush_cache() to cache invalidation
with memory write-back done by 'ocbp'.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/sh/cpu/sh4/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sh/cpu/sh4/cpu.c b/arch/sh/cpu/sh4/cpu.c
index de90ca7..a2cec98 100644
--- a/arch/sh/cpu/sh4/cpu.c
+++ b/arch/sh/cpu/sh4/cpu.c
@@ -37,7 +37,7 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
 
 void flush_cache (unsigned long addr, unsigned long size)
 {
-   invalidate_dcache_range(addr , addr + size);
+   flush_dcache_range(addr , addr + size);
 }
 
 void icache_enable (void)
-- 
2.10.2

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


Re: [U-Boot] [PATCH 09/27] sh: Use asm-generic/io.h

2016-11-27 Thread Vladimir Zapolskiy

On 10/01/2016 05:19 PM, Paul Burton wrote:

Convert the sh architecture to make use of the new asm-generic/io.h to
provide address mapping functions. As the generic implementations are
suitable for sh this is primarily a matter of moving code.

Feedback from architecture maintainers is welcome.

Signed-off-by: Paul Burton 
Cc: Nobuhiro Iwamatsu 
---



Reviewed-by: Vladimir Zapolskiy 
Tested-by: Vladimir Zapolskiy 

Thank you for the change.

--
With best wishes,
Vladimir
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] About U-boot's TPM

2016-11-27 Thread Ronny Ko
Hi Simon,

I'm using Minnowboard MAX. It has fTPM, which is an integrated TPM into SoC
(Bay Trail).

http://wiki.minnowboard.org/MinnowBoard_MAX
https://firmware.intel.com/blog/security-technologies-and-minnowboard-max
https://prosauce.org/blog/2016/1/11/minnowboard-max-enable-and-test-the-firmware-txe-tpm-20

Ronny

On Sun, Nov 27, 2016 at 7:02 PM, Simon Glass  wrote:

> Hi Ronny,
>
> On 24 November 2016 at 14:20, Ronny Ko  wrote:
> > Hi Simon,
> >
> > I have a question about using a TPM from U-Boot. I try to run U-Boot on
> > Minnowboard MAX, which has a firmware TPM (fTPM), instead of discrete TPM
> > (dTPM). I wonder if the way of using fTPM from U-Boot is the same as
> using
> > dTPM. I suppose the answer is yes, if an fTPM is simply a virtual
> version of
> > dTPM. Or is it not so?
>
> I don't know how that is connected. Do you have any documentation?
>
> Regards,
> Simon
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 4/7] env: Introduce "transient" and "system" access flags

2016-11-27 Thread Joe Hershberger
On Wed, Nov 16, 2016 at 4:29 AM, Bernhard Nortmann
 wrote:
> "transient" (='t') is like "any", but requests that a variable
> should not be exported (ENV_FLAGS_VARACCESS_PREVENT_EXPORT).
>
> "system" (='S') is meant for 'internal' variables that

The flags are positional, so 's' is not in use. It seems it would be
cleaner to use a lower-case 's'.

> aren't supposed to be changed by the user. It corresponds
> to "transient" plus "read-only".
>
> Signed-off-by: Bernhard Nortmann 
>
> ---
>
> Changes in v2:
> - Fixed outdated "env_flags_varaccess_lock" to the correct
>   "env_flags_varaccess_system"
>
>  common/env_flags.c  | 11 +--
>  include/env_flags.h |  2 ++
>  2 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/common/env_flags.c b/common/env_flags.c
> index f39d952..2c30c7f 100644
> --- a/common/env_flags.c
> +++ b/common/env_flags.c
> @@ -28,7 +28,7 @@
>  #endif
>
>  static const char env_flags_vartype_rep[] = "sdxb" 
> ENV_FLAGS_NET_VARTYPE_REPS;
> -static const char env_flags_varaccess_rep[] = "aroc";
> +static const char env_flags_varaccess_rep[] = "aroctS";
>  static const int env_flags_varaccess_mask[] = {
> 0,
> ENV_FLAGS_VARACCESS_PREVENT_DELETE |
> @@ -37,7 +37,12 @@ static const int env_flags_varaccess_mask[] = {
> ENV_FLAGS_VARACCESS_PREVENT_DELETE |
> ENV_FLAGS_VARACCESS_PREVENT_OVERWR,
> ENV_FLAGS_VARACCESS_PREVENT_DELETE |
> -   ENV_FLAGS_VARACCESS_PREVENT_NONDEF_OVERWR};
> +   ENV_FLAGS_VARACCESS_PREVENT_NONDEF_OVERWR,
> +   ENV_FLAGS_VARACCESS_PREVENT_EXPORT,
> +   ENV_FLAGS_VARACCESS_PREVENT_DELETE |
> +   ENV_FLAGS_VARACCESS_PREVENT_CREATE |
> +   ENV_FLAGS_VARACCESS_PREVENT_OVERWR |
> +   ENV_FLAGS_VARACCESS_PREVENT_EXPORT};
>
>  #ifdef CONFIG_CMD_ENV_FLAGS
>  static const char * const env_flags_vartype_names[] = {
> @@ -55,6 +60,8 @@ static const char * const env_flags_varaccess_names[] = {
> "read-only",
> "write-once",
> "change-default",
> +   "transient",/* do not export/save */
> +   "system",   /* = "transient" plus "read-only" */

I'm not sure why you are adding "transient" or "volatile" to the
varaccess. It is an orthogonal property of a variable. This is obvious
from the fact that you need to add yet another to compose varaccess
with varlifetime (or something).

I worked on something similar years ago, but never posted an RFC.

http://lists.denx.de/pipermail/u-boot/2010-June/073027.html

>  };
>
>  /*
> diff --git a/include/env_flags.h b/include/env_flags.h
> index 7e2362a..9d66706 100644
> --- a/include/env_flags.h
> +++ b/include/env_flags.h
> @@ -25,6 +25,8 @@ enum env_flags_varaccess {
> env_flags_varaccess_readonly,
> env_flags_varaccess_writeonce,
> env_flags_varaccess_changedefault,
> +   env_flags_varaccess_transient,
> +   env_flags_varaccess_system,
> env_flags_varaccess_end
>  };
>
> --
> 2.7.3
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 05/14] serial: 16550: Add port type as driver data

2016-11-27 Thread Marek Vasut
On 11/27/2016 06:03 PM, Simon Glass wrote:
> Hi Marex,
> 
> On 25 November 2016 at 15:32, Marek Vasut  wrote:
>> Add driver data to each compatible string to identify the type of
>> the port. Since all the ports in the driver are entirely compatible
>> with 16550 for now, all are marked with PORT_NS16550. But, there
>> are ports which have specific quirks, like the JZ4780 UART, which
>> do not have any DT property to denote the quirks. Instead, Linux
>> uses the compatible string to discern such ports and enable the
>> necessary quirks.
>>
>> Signed-off-by: Marek Vasut 
>> Cc: Tom Rini 
>> Cc: Simon Glass 
>> ---
>>  drivers/serial/ns16550.c | 26 --
>>  1 file changed, 16 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
>> index 3c9f3b0..3130a1d 100644
>> --- a/drivers/serial/ns16550.c
>> +++ b/drivers/serial/ns16550.c
>> @@ -360,6 +360,12 @@ int ns16550_serial_probe(struct udevice *dev)
>> return 0;
>>  }
>>
>> +#if CONFIG_IS_ENABLED(OF_CONTROL)
>> +enum {
>> +   PORT_NS16550 = 0,
>> +};
>> +#endif
>> +
>>  #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
>>  int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
>>  {
>> @@ -453,16 +459,16 @@ const struct dm_serial_ops ns16550_serial_ops = {
>>   * compatible string to your dts.
>>   */
>>  static const struct udevice_id ns16550_serial_ids[] = {
>> -   { .compatible = "ns16550" },
>> -   { .compatible = "ns16550a" },
>> -   { .compatible = "nvidia,tegra20-uart" },
>> -   { .compatible = "snps,dw-apb-uart" },
>> -   { .compatible = "ti,omap2-uart" },
>> -   { .compatible = "ti,omap3-uart" },
>> -   { .compatible = "ti,omap4-uart" },
>> -   { .compatible = "ti,am3352-uart" },
>> -   { .compatible = "ti,am4372-uart" },
>> -   { .compatible = "ti,dra742-uart" },
>> +   { .compatible = "ns16550",  .data = PORT_NS16550 },
>> +   { .compatible = "ns16550a", .data = PORT_NS16550 },
>> +   { .compatible = "nvidia,tegra20-uart",  .data = PORT_NS16550 },
>> +   { .compatible = "snps,dw-apb-uart", .data = PORT_NS16550 },
>> +   { .compatible = "ti,omap2-uart",.data = PORT_NS16550 },
>> +   { .compatible = "ti,omap3-uart",.data = PORT_NS16550 },
>> +   { .compatible = "ti,omap4-uart",.data = PORT_NS16550 },
>> +   { .compatible = "ti,am3352-uart",   .data = PORT_NS16550 },
>> +   { .compatible = "ti,am4372-uart",   .data = PORT_NS16550 },
>> +   { .compatible = "ti,dra742-uart",   .data = PORT_NS16550 },
> 
> But can we have 0 as the default so we don't need these values?

PORT_NS16550 is zero anyway, it's just explicitly spelled here.

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


[U-Boot] arch/arm/mach-sunxi/dram_sun8i_a33.c and 1Gb detect as 512Mb on A33.

2016-11-27 Thread far5893

I have a tablet with 1Gb of ram (two chips),but not u-boot neither kernel 
detect it (only 512Mb).

Does i need to change something in arch/arm/mach-sunxi/dram_sun8i_a33.c ?

i posta alettronica found this struct in sunxi_dram_init(void) function:

struct dram_para para = {
.cs1 = 0,
.bank = 1,
.rank = 1,
.rows = 15,
.bus_width = 16,
.page_size = 2048,
};



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


Re: [U-Boot] [PATCH 06/14] serial: 16550: Add Ingenic JZ4780 support

2016-11-27 Thread Marek Vasut
On 11/27/2016 06:03 PM, Simon Glass wrote:
> Hi Marex,
> 
> On 25 November 2016 at 15:32, Marek Vasut  wrote:
>> Add compatibility string for the Ingenic JZ4780 SoC, the necessary
>> UART enable bit into FCR and register shift. Neither are encoded
>> in the DTS coming from Linux, so we need to support it this way.
>>
>> Signed-off-by: Marek Vasut 
>> Cc: Tom Rini 
>> Cc: Simon Glass 
>> Cc: Daniel Schwierzeck 
>> Cc: Paul Burton 
>> ---
>>  drivers/serial/ns16550.c | 7 +++
>>  include/ns16550.h| 3 +++
>>  2 files changed, 10 insertions(+)
>>
>> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
>> index 3130a1d..d00161c 100644
>> --- a/drivers/serial/ns16550.c
>> +++ b/drivers/serial/ns16550.c
>> @@ -363,6 +363,7 @@ int ns16550_serial_probe(struct udevice *dev)
>>  #if CONFIG_IS_ENABLED(OF_CONTROL)
>>  enum {
>> PORT_NS16550 = 0,
>> +   PORT_JZ4780,
>>  };
>>  #endif
>>
>> @@ -370,6 +371,7 @@ enum {
>>  int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
>>  {
>> struct ns16550_platdata *plat = dev->platdata;
>> +   const u32 port_type = dev_get_driver_data(dev);
>> fdt_addr_t addr;
>> struct clk clk;
>> int err;
>> @@ -439,6 +441,10 @@ int ns16550_serial_ofdata_to_platdata(struct udevice 
>> *dev)
>> }
>>
>> plat->fcr = UART_FCRVAL;
>> +   if (port_type == PORT_JZ4780) {
>> +   plat->fcr |= UART_FCR_UME;
>> +   plat->reg_shift = 2;
> 
> This should be in the device tree, shouldn't it?

Yeah, thanks.

>> +   }
>>
>> return 0;
>>  }
>> @@ -461,6 +467,7 @@ const struct dm_serial_ops ns16550_serial_ops = {
>>  static const struct udevice_id ns16550_serial_ids[] = {
>> { .compatible = "ns16550",  .data = PORT_NS16550 },
>> { .compatible = "ns16550a", .data = PORT_NS16550 },
>> +   { .compatible = "ingenic,jz4780-uart",  .data = PORT_JZ4780  },
>> { .compatible = "nvidia,tegra20-uart",  .data = PORT_NS16550 },
>> { .compatible = "snps,dw-apb-uart", .data = PORT_NS16550 },
>> { .compatible = "ti,omap2-uart",.data = PORT_NS16550 },
>> diff --git a/include/ns16550.h b/include/ns16550.h
>> index 45fd68b..7c97036 100644
>> --- a/include/ns16550.h
>> +++ b/include/ns16550.h
>> @@ -118,6 +118,9 @@ typedef struct NS16550 *NS16550_t;
>>  #define UART_FCR_RXSR  0x02 /* Receiver soft reset */
>>  #define UART_FCR_TXSR  0x04 /* Transmitter soft reset */
>>
>> +/* Ingenic JZ47xx specific UART-enable bit. */
>> +#define UART_FCR_UME   0x10
>> +
>>  /*
>>   * These are the definitions for the Modem Control Register
>>   */
>> --
>> 2.10.2
>>
> 
> Regards,
> Simon
> 


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


[U-Boot] [PATCH v3 7/9] rockchip: evb-rk3339: Enable DHCP

2016-11-27 Thread Simon Glass
This is the only RK3288 device without DHCP. Enable it so that we
can use a common BOOT_TARGET_DEVICES setting. It is likely useful to be
able to use USB networking, at least. Full networking can be enabled when
a suitable platform needs it.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Add new patch to enable networking on evb-rk3288

Changes in v2: None

 configs/evb-rk3399_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/evb-rk3399_defconfig b/configs/evb-rk3399_defconfig
index 40a8295..be522fb 100644
--- a/configs/evb-rk3399_defconfig
+++ b/configs/evb-rk3399_defconfig
@@ -11,6 +11,9 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH v3 9/9] rockchip: Drop Ethernet from the TODO

2016-11-27 Thread Simon Glass
From: Sjoerd Simons 

Now that ethernet support works, it can be dropped from the rockchip
TODO

Signed-off-by: Sjoerd Simons 
Acked-by: Simon Glass 
Signed-off-by: Simon Glass 
---

Changes in v3:
- Add a few new patches
- Drop the 'net: designware: Add a fix_mac_speed hook' patch

Changes in v2: None

 doc/README.rockchip | 1 -
 1 file changed, 1 deletion(-)

diff --git a/doc/README.rockchip b/doc/README.rockchip
index 06ec80e..43cafc7 100644
--- a/doc/README.rockchip
+++ b/doc/README.rockchip
@@ -219,7 +219,6 @@ Immediate priorities are:
 - USB host
 - USB device
 - Run CPU at full speed (code exists but we only see ~60 DMIPS maximum)
-- Ethernet
 - NAND flash
 - Support for other Rockchip parts
 - Boot U-Boot proper over USB OTG (at present only SPL works)
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH v3 4/9] net: designware: Export the operation functions

2016-11-27 Thread Simon Glass
Export all functions so that drivers can use them, or not, as the need
arises.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Add new patch to export the operation functions

Changes in v2: None

 drivers/net/designware.c | 19 +--
 drivers/net/designware.h |  9 +
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 0c596a7..f242fc6 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -271,7 +271,7 @@ static void _dw_eth_halt(struct dw_eth_dev *priv)
phy_shutdown(priv->phydev);
 }
 
-static int _dw_eth_init(struct dw_eth_dev *priv, u8 *enetaddr)
+int designware_eth_init(struct dw_eth_dev *priv, u8 *enetaddr)
 {
struct eth_mac_regs *mac_p = priv->mac_regs_p;
struct eth_dma_regs *dma_p = priv->dma_regs_p;
@@ -330,7 +330,7 @@ static int _dw_eth_init(struct dw_eth_dev *priv, u8 
*enetaddr)
return 0;
 }
 
-static int designware_eth_enable(struct dw_eth_dev *priv)
+int designware_eth_enable(struct dw_eth_dev *priv)
 {
struct eth_mac_regs *mac_p = priv->mac_regs_p;
 
@@ -493,7 +493,7 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis)
 {
int ret;
 
-   ret = _dw_eth_init(dev->priv, dev->enetaddr);
+   ret = designware_eth_init(dev->priv, dev->enetaddr);
if (!ret)
ret = designware_eth_enable(dev->priv);
 
@@ -591,7 +591,7 @@ static int designware_eth_start(struct udevice *dev)
struct dw_eth_dev *priv = dev_get_priv(dev);
int ret;
 
-   ret = _dw_eth_init(priv, pdata->enetaddr);
+   ret = designware_eth_init(priv, pdata->enetaddr);
if (ret)
return ret;
ret = designware_eth_enable(priv);
@@ -601,36 +601,35 @@ static int designware_eth_start(struct udevice *dev)
return 0;
 }
 
-static int designware_eth_send(struct udevice *dev, void *packet, int length)
+int designware_eth_send(struct udevice *dev, void *packet, int length)
 {
struct dw_eth_dev *priv = dev_get_priv(dev);
 
return _dw_eth_send(priv, packet, length);
 }
 
-static int designware_eth_recv(struct udevice *dev, int flags, uchar **packetp)
+int designware_eth_recv(struct udevice *dev, int flags, uchar **packetp)
 {
struct dw_eth_dev *priv = dev_get_priv(dev);
 
return _dw_eth_recv(priv, packetp);
 }
 
-static int designware_eth_free_pkt(struct udevice *dev, uchar *packet,
-  int length)
+int designware_eth_free_pkt(struct udevice *dev, uchar *packet, int length)
 {
struct dw_eth_dev *priv = dev_get_priv(dev);
 
return _dw_free_pkt(priv);
 }
 
-static void designware_eth_stop(struct udevice *dev)
+void designware_eth_stop(struct udevice *dev)
 {
struct dw_eth_dev *priv = dev_get_priv(dev);
 
return _dw_eth_halt(priv);
 }
 
-static int designware_eth_write_hwaddr(struct udevice *dev)
+int designware_eth_write_hwaddr(struct udevice *dev)
 {
struct eth_pdata *pdata = dev_get_platdata(dev);
struct dw_eth_dev *priv = dev_get_priv(dev);
diff --git a/drivers/net/designware.h b/drivers/net/designware.h
index 087ebef..7992d0e 100644
--- a/drivers/net/designware.h
+++ b/drivers/net/designware.h
@@ -253,6 +253,15 @@ struct dw_eth_pdata {
struct eth_pdata eth_pdata;
u32 reset_delays[3];
 };
+
+int designware_eth_init(struct dw_eth_dev *priv, u8 *enetaddr);
+int designware_eth_enable(struct dw_eth_dev *priv);
+int designware_eth_send(struct udevice *dev, void *packet, int length);
+int designware_eth_recv(struct udevice *dev, int flags, uchar **packetp);
+int designware_eth_free_pkt(struct udevice *dev, uchar *packet,
+  int length);
+void designware_eth_stop(struct udevice *dev);
+int designware_eth_write_hwaddr(struct udevice *dev);
 #endif
 
 #endif
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH v3 8/9] rockchip: Add PXE and DHCP to the default boot targets

2016-11-27 Thread Simon Glass
From: Sjoerd Simons 

Now that at least on the firefly board we have network support, enable
PXE and DHCP boot targets by default.

Signed-off-by: Sjoerd Simons 
Acked-by: Simon Glass 
Signed-off-by: Simon Glass 
---

Changes in v3: None
Changes in v2: None

 include/configs/rockchip-common.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/configs/rockchip-common.h 
b/include/configs/rockchip-common.h
index 9ec71c4..be53e65 100644
--- a/include/configs/rockchip-common.h
+++ b/include/configs/rockchip-common.h
@@ -14,7 +14,9 @@
 /* First try to boot from SD (index 0), then eMMC (index 1 */
 #define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 0) \
-   func(MMC, mmc, 1)
+   func(MMC, mmc, 1) \
+   func(PXE, pxe, na) \
+   func(DHCP, dchp, na)
 
  /* Enable gpt partition table */
 #define CONFIG_CMD_GPT
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH v3 5/9] net: gmac_rk3288: Add RK3288 GMAC driver

2016-11-27 Thread Simon Glass
From: Sjoerd Simons 

Add a new driver for the GMAC ethernet interface present in Rockchip
RK3288 SOCs. This driver subclasses the generic design-ware driver to
add the glue needed specifically for Rockchip.

Signed-off-by: Sjoerd Simons 
Signed-off-by: Simon Glass 
---

Changes in v3:
- Add comments for struct gmac_rk3288_platdata
- Adjust binding to use r/tx-delay instead of r/tx_delay
- Sort includes
- Use debug() instead of printf() for error
- Use function calls instead of fix_mac_speed() hook
- Use new clk interface

Changes in v2:
- Adjust to new hook name
- Fix various coding style nits

 drivers/net/Kconfig   |   7 +++
 drivers/net/Makefile  |   1 +
 drivers/net/gmac_rk3288.c | 154 ++
 3 files changed, 162 insertions(+)
 create mode 100644 drivers/net/gmac_rk3288.c

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index f25d3ff..0027a2e 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -215,4 +215,11 @@ config PIC32_ETH
  This driver implements 10/100 Mbps Ethernet and MAC layer for
  Microchip PIC32 microcontrollers.
 
+config GMAC_RK3288
+   bool "Rockchip RK3288 Synopsys Designware Ethernet MAC"
+   depends on DM_ETH && ETH_DESIGNWARE
+   help
+ This driver provides Rockchip RK3288 network support based on the
+ Synopsys Designware driver.
+
 endif # NETDEVICES
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 9a7bfc6..348e98b 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -34,6 +34,7 @@ obj-$(CONFIG_FTGMAC100) += ftgmac100.o
 obj-$(CONFIG_FTMAC110) += ftmac110.o
 obj-$(CONFIG_FTMAC100) += ftmac100.o
 obj-$(CONFIG_GRETH) += greth.o
+obj-$(CONFIG_GMAC_RK3288) += gmac_rk3288.o
 obj-$(CONFIG_DRIVER_TI_KEYSTONE_NET) += keystone_net.o
 obj-$(CONFIG_KS8851_MLL) += ks8851_mll.o
 obj-$(CONFIG_LAN91C96) += lan91c96.o
diff --git a/drivers/net/gmac_rk3288.c b/drivers/net/gmac_rk3288.c
new file mode 100644
index 000..0c22756
--- /dev/null
+++ b/drivers/net/gmac_rk3288.c
@@ -0,0 +1,154 @@
+/*
+ * (C) Copyright 2015 Sjoerd Simons 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ *
+ * Rockchip GMAC ethernet IP driver for U-Boot
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "designware.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Platform data for the gmac
+ *
+ * dw_eth_pdata: Required platform data for designware driver (must be first)
+ */
+struct gmac_rk3288_platdata {
+   struct dw_eth_pdata dw_eth_pdata;
+   int tx_delay;
+   int rx_delay;
+};
+
+static int gmac_rk3288_ofdata_to_platdata(struct udevice *dev)
+{
+   struct gmac_rk3288_platdata *pdata = dev_get_platdata(dev);
+
+   pdata->tx_delay = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
+"tx-delay", 0x30);
+   pdata->rx_delay = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
+"rx-delay", 0x10);
+
+   return designware_eth_ofdata_to_platdata(dev);
+}
+
+static int gmac_rk3288_fix_mac_speed(struct dw_eth_dev *priv)
+{
+   struct rk3288_grf *grf;
+   int clk;
+
+   switch (priv->phydev->speed) {
+   case 10:
+   clk = GMAC_CLK_SEL_2_5M;
+   break;
+   case 100:
+   clk = GMAC_CLK_SEL_25M;
+   break;
+   case 1000:
+   clk = GMAC_CLK_SEL_125M;
+   break;
+   default:
+   debug("Unknown phy speed: %d\n", priv->phydev->speed);
+   return -EINVAL;
+   }
+
+   grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
+   rk_clrsetreg(>soc_con1,
+GMAC_CLK_SEL_MASK << GMAC_CLK_SEL_SHIFT,
+clk << GMAC_CLK_SEL_SHIFT);
+
+   return 0;
+}
+
+static int gmac_rk3288_probe(struct udevice *dev)
+{
+   struct gmac_rk3288_platdata *pdata = dev_get_platdata(dev);
+   struct rk3288_grf *grf;
+   struct clk clk;
+   int ret;
+
+   ret = clk_get_by_index(dev, 0, );
+   if (ret)
+   return ret;
+
+   /* Since mac_clk is fed by an external clock we can use 0 here */
+   ret = clk_set_rate(, 0);
+   if (ret)
+   return ret;
+
+   /* Set to RGMII mode */
+   grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
+   rk_clrsetreg(>soc_con1,
+RMII_MODE_MASK << RMII_MODE_SHIFT |
+GMAC_PHY_INTF_SEL_MASK << GMAC_PHY_INTF_SEL_SHIFT,
+GMAC_PHY_INTF_SEL_RGMII << GMAC_PHY_INTF_SEL_SHIFT);
+
+   rk_clrsetreg(>soc_con3,
+RXCLK_DLY_ENA_GMAC_MASK <<  RXCLK_DLY_ENA_GMAC_SHIFT |
+TXCLK_DLY_ENA_GMAC_MASK <<  TXCLK_DLY_ENA_GMAC_SHIFT |
+CLK_RX_DL_CFG_GMAC_MASK <<  CLK_RX_DL_CFG_GMAC_SHIFT |

[U-Boot] [PATCH v3 6/9] rockchip: Enable networking support on rock2 and firefly

2016-11-27 Thread Simon Glass
From: Sjoerd Simons 

Enable the various configuration option required to get the ethernet
interface up and running on Radxa Rock2 and Firefly.

Signed-off-by: Sjoerd Simons 
Reviewed-by: Simon Glass 
Signed-off-by: Simon Glass 
---

Changes in v3: None
Changes in v2: None

 configs/firefly-rk3288_defconfig | 4 
 configs/rock2_defconfig  | 4 
 2 files changed, 8 insertions(+)

diff --git a/configs/firefly-rk3288_defconfig b/configs/firefly-rk3288_defconfig
index 4910c80..82787dc 100644
--- a/configs/firefly-rk3288_defconfig
+++ b/configs/firefly-rk3288_defconfig
@@ -44,6 +44,10 @@ CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_ROCKCHIP_DWMMC=y
+CONFIG_DM_ETH=y
+CONFIG_NETDEVICES=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_GMAC_RK3288=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 # CONFIG_SPL_PINCTRL_FULL is not set
diff --git a/configs/rock2_defconfig b/configs/rock2_defconfig
index 1883f07..f8436d6 100644
--- a/configs/rock2_defconfig
+++ b/configs/rock2_defconfig
@@ -43,6 +43,10 @@ CONFIG_SPL_CLK=y
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_ROCKCHIP_DWMMC=y
+CONFIG_DM_ETH=y
+CONFIG_NETDEVICES=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_GMAC_RK3288=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 # CONFIG_SPL_PINCTRL_FULL is not set
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH v3 3/9] net: designware: Split the link init into a separate function

2016-11-27 Thread Simon Glass
With rockchip we need to make adjustments after the link speed is set but
before enabling received/transmit. In preparation for this, split these
two pieces into separate functions.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Add new patch to split the link init into a separate function

Changes in v2: None

 drivers/net/designware.c | 26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index ebcef8b..0c596a7 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -327,6 +327,13 @@ static int _dw_eth_init(struct dw_eth_dev *priv, u8 
*enetaddr)
if (ret)
return ret;
 
+   return 0;
+}
+
+static int designware_eth_enable(struct dw_eth_dev *priv)
+{
+   struct eth_mac_regs *mac_p = priv->mac_regs_p;
+
if (!priv->phydev->link)
return -EIO;
 
@@ -484,7 +491,13 @@ static int dw_phy_init(struct dw_eth_dev *priv, void *dev)
 #ifndef CONFIG_DM_ETH
 static int dw_eth_init(struct eth_device *dev, bd_t *bis)
 {
-   return _dw_eth_init(dev->priv, dev->enetaddr);
+   int ret;
+
+   ret = _dw_eth_init(dev->priv, dev->enetaddr);
+   if (!ret)
+   ret = designware_eth_enable(dev->priv);
+
+   return ret;
 }
 
 static int dw_eth_send(struct eth_device *dev, void *packet, int length)
@@ -575,8 +588,17 @@ int designware_initialize(ulong base_addr, u32 interface)
 static int designware_eth_start(struct udevice *dev)
 {
struct eth_pdata *pdata = dev_get_platdata(dev);
+   struct dw_eth_dev *priv = dev_get_priv(dev);
+   int ret;
 
-   return _dw_eth_init(dev->priv, pdata->enetaddr);
+   ret = _dw_eth_init(priv, pdata->enetaddr);
+   if (ret)
+   return ret;
+   ret = designware_eth_enable(priv);
+   if (ret)
+   return ret;
+
+   return 0;
 }
 
 static int designware_eth_send(struct udevice *dev, void *packet, int length)
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH v3 0/9] From Simon:

2016-11-27 Thread Simon Glass
This v3 patch is an update on Sjoerd's original v2 series from Feburary.
I have dealt with the changes requested at the time, and adjusted the way
that the speed change is handled.

Tested on firefly-rk3288, rock2.

Original cover letter:
To add support I've taken a slightly different approach then some of the
other boards with a designware IP block, by creating a new driver to
take care of the platfrom glue which subclasses the main designware driver
instead of adding the compatibility string the designware driver
directly and doing the SoC specific setup in the board files. This seems
quite a bit more elegant in a device model based world.

I've only tested this series on a Radxa Rock 2 board, it would be great
if someone could test this on other boards with the designware IP
especially for those with the reset GPIO in devicetree (e.g. some of the
Allwinner boards).

Compared to the first one round the pinctrl related bits were dropped as
RK3288 now has a full pinctrl driver. Furthermore the started hook in the
designware driver was renamed to fix_mac_speed in line with what linux
uses and moved to the dw_link_adjust function.

Changes in v3:
- Add a few new patches
- Add comments for struct gmac_rk3288_platdata
- Add new patch to adjust dw_adjust_link() to return an error
- Add new patch to enable networking on evb-rk3288
- Add new patch to export the operation functions
- Add new patch to split the link init into a separate function
- Adjust binding to use r/tx-delay instead of r/tx_delay
- Drop the 'net: designware: Add a fix_mac_speed hook' patch
- Sort includes
- Use debug() instead of printf() for error
- Use function calls instead of fix_mac_speed() hook
- Use new clk interface

Changes in v2:
- Adjust to new hook name
- Fix various coding style nits

Simon Glass (4):
  net: designware: Adjust dw_adjust_link() to return an error
  net: designware: Split the link init into a separate function
  net: designware: Export the operation functions
  rockchip: evb-rk3339: Enable DHCP

Sjoerd Simons (5):
  net: designware: Export various functions/struct to allow subclassing
  net: gmac_rk3288: Add RK3288 GMAC driver
  rockchip: Enable networking support on rock2 and firefly
  rockchip: Add PXE and DHCP to the default boot targets
  rockchip: Drop Ethernet from the TODO

 configs/evb-rk3399_defconfig  |   3 +
 configs/firefly-rk3288_defconfig  |   4 +
 configs/rock2_defconfig   |   4 +
 doc/README.rockchip   |   1 -
 drivers/net/Kconfig   |   7 ++
 drivers/net/Makefile  |   1 +
 drivers/net/designware.c  |  57 ++
 drivers/net/designware.h  |  13 
 drivers/net/gmac_rk3288.c | 154 ++
 include/configs/rockchip-common.h |   4 +-
 10 files changed, 230 insertions(+), 18 deletions(-)
 create mode 100644 drivers/net/gmac_rk3288.c

-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH v3 2/9] net: designware: Adjust dw_adjust_link() to return an error

2016-11-27 Thread Simon Glass
This function can fail, so return the error if there is one.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Add new patch to adjust dw_adjust_link() to return an error

Changes in v2: None

 drivers/net/designware.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 6ef36bc..ebcef8b 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -230,14 +230,14 @@ static int _dw_write_hwaddr(struct dw_eth_dev *priv, u8 
*mac_id)
return 0;
 }
 
-static void dw_adjust_link(struct eth_mac_regs *mac_p,
-  struct phy_device *phydev)
+static int dw_adjust_link(struct dw_eth_dev *priv, struct eth_mac_regs *mac_p,
+ struct phy_device *phydev)
 {
u32 conf = readl(_p->conf) | FRAMEBURSTENABLE | DISABLERXOWN;
 
if (!phydev->link) {
printf("%s: No link.\n", phydev->dev->name);
-   return;
+   return 0;
}
 
if (phydev->speed != 1000)
@@ -256,6 +256,8 @@ static void dw_adjust_link(struct eth_mac_regs *mac_p,
printf("Speed: %d, %s duplex%s\n", phydev->speed,
   (phydev->duplex) ? "full" : "half",
   (phydev->port == PORT_FIBRE) ? ", fiber mode" : "");
+
+   return 0;
 }
 
 static void _dw_eth_halt(struct dw_eth_dev *priv)
@@ -321,7 +323,9 @@ static int _dw_eth_init(struct dw_eth_dev *priv, u8 
*enetaddr)
return ret;
}
 
-   dw_adjust_link(mac_p, priv->phydev);
+   ret = dw_adjust_link(priv, mac_p, priv->phydev);
+   if (ret)
+   return ret;
 
if (!priv->phydev->link)
return -EIO;
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH v3 1/9] net: designware: Export various functions/struct to allow subclassing

2016-11-27 Thread Simon Glass
From: Sjoerd Simons 

To allow other DM drivers to subclass the designware driver various
functions and structures need to be exported. Export these.

Signed-off-by: Sjoerd Simons 
Reviewed-by: Bin Meng 
Acked-by: Simon Glass 
Signed-off-by: Simon Glass 
---

Changes in v3: None
Changes in v2: None

 drivers/net/designware.c | 6 +++---
 drivers/net/designware.h | 4 
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 9e6d726..6ef36bc 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -628,7 +628,7 @@ static int designware_eth_bind(struct udevice *dev)
return 0;
 }
 
-static int designware_eth_probe(struct udevice *dev)
+int designware_eth_probe(struct udevice *dev)
 {
struct eth_pdata *pdata = dev_get_platdata(dev);
struct dw_eth_dev *priv = dev_get_priv(dev);
@@ -678,7 +678,7 @@ static int designware_eth_remove(struct udevice *dev)
return 0;
 }
 
-static const struct eth_ops designware_eth_ops = {
+const struct eth_ops designware_eth_ops = {
.start  = designware_eth_start,
.send   = designware_eth_send,
.recv   = designware_eth_recv,
@@ -687,7 +687,7 @@ static const struct eth_ops designware_eth_ops = {
.write_hwaddr   = designware_eth_write_hwaddr,
 };
 
-static int designware_eth_ofdata_to_platdata(struct udevice *dev)
+int designware_eth_ofdata_to_platdata(struct udevice *dev)
 {
struct dw_eth_pdata *dw_pdata = dev_get_platdata(dev);
 #ifdef CONFIG_DM_GPIO
diff --git a/drivers/net/designware.h b/drivers/net/designware.h
index d345c5b..087ebef 100644
--- a/drivers/net/designware.h
+++ b/drivers/net/designware.h
@@ -245,6 +245,10 @@ struct dw_eth_dev {
 };
 
 #ifdef CONFIG_DM_ETH
+int designware_eth_ofdata_to_platdata(struct udevice *dev);
+int designware_eth_probe(struct udevice *dev);
+extern const struct eth_ops designware_eth_ops;
+
 struct dw_eth_pdata {
struct eth_pdata eth_pdata;
u32 reset_delays[3];
-- 
2.8.0.rc3.226.g39d4020

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


Re: [U-Boot] [PATCH 05/14] serial: 16550: Add port type as driver data

2016-11-27 Thread Simon Glass
Hi Marex,

On 25 November 2016 at 15:32, Marek Vasut  wrote:
> Add driver data to each compatible string to identify the type of
> the port. Since all the ports in the driver are entirely compatible
> with 16550 for now, all are marked with PORT_NS16550. But, there
> are ports which have specific quirks, like the JZ4780 UART, which
> do not have any DT property to denote the quirks. Instead, Linux
> uses the compatible string to discern such ports and enable the
> necessary quirks.
>
> Signed-off-by: Marek Vasut 
> Cc: Tom Rini 
> Cc: Simon Glass 
> ---
>  drivers/serial/ns16550.c | 26 --
>  1 file changed, 16 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
> index 3c9f3b0..3130a1d 100644
> --- a/drivers/serial/ns16550.c
> +++ b/drivers/serial/ns16550.c
> @@ -360,6 +360,12 @@ int ns16550_serial_probe(struct udevice *dev)
> return 0;
>  }
>
> +#if CONFIG_IS_ENABLED(OF_CONTROL)
> +enum {
> +   PORT_NS16550 = 0,
> +};
> +#endif
> +
>  #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
>  int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
>  {
> @@ -453,16 +459,16 @@ const struct dm_serial_ops ns16550_serial_ops = {
>   * compatible string to your dts.
>   */
>  static const struct udevice_id ns16550_serial_ids[] = {
> -   { .compatible = "ns16550" },
> -   { .compatible = "ns16550a" },
> -   { .compatible = "nvidia,tegra20-uart" },
> -   { .compatible = "snps,dw-apb-uart" },
> -   { .compatible = "ti,omap2-uart" },
> -   { .compatible = "ti,omap3-uart" },
> -   { .compatible = "ti,omap4-uart" },
> -   { .compatible = "ti,am3352-uart" },
> -   { .compatible = "ti,am4372-uart" },
> -   { .compatible = "ti,dra742-uart" },
> +   { .compatible = "ns16550",  .data = PORT_NS16550 },
> +   { .compatible = "ns16550a", .data = PORT_NS16550 },
> +   { .compatible = "nvidia,tegra20-uart",  .data = PORT_NS16550 },
> +   { .compatible = "snps,dw-apb-uart", .data = PORT_NS16550 },
> +   { .compatible = "ti,omap2-uart",.data = PORT_NS16550 },
> +   { .compatible = "ti,omap3-uart",.data = PORT_NS16550 },
> +   { .compatible = "ti,omap4-uart",.data = PORT_NS16550 },
> +   { .compatible = "ti,am3352-uart",   .data = PORT_NS16550 },
> +   { .compatible = "ti,am4372-uart",   .data = PORT_NS16550 },
> +   { .compatible = "ti,dra742-uart",   .data = PORT_NS16550 },

But can we have 0 as the default so we don't need these values?

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


Re: [U-Boot] [PATCH 06/14] serial: 16550: Add Ingenic JZ4780 support

2016-11-27 Thread Simon Glass
Hi Marex,

On 25 November 2016 at 15:32, Marek Vasut  wrote:
> Add compatibility string for the Ingenic JZ4780 SoC, the necessary
> UART enable bit into FCR and register shift. Neither are encoded
> in the DTS coming from Linux, so we need to support it this way.
>
> Signed-off-by: Marek Vasut 
> Cc: Tom Rini 
> Cc: Simon Glass 
> Cc: Daniel Schwierzeck 
> Cc: Paul Burton 
> ---
>  drivers/serial/ns16550.c | 7 +++
>  include/ns16550.h| 3 +++
>  2 files changed, 10 insertions(+)
>
> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
> index 3130a1d..d00161c 100644
> --- a/drivers/serial/ns16550.c
> +++ b/drivers/serial/ns16550.c
> @@ -363,6 +363,7 @@ int ns16550_serial_probe(struct udevice *dev)
>  #if CONFIG_IS_ENABLED(OF_CONTROL)
>  enum {
> PORT_NS16550 = 0,
> +   PORT_JZ4780,
>  };
>  #endif
>
> @@ -370,6 +371,7 @@ enum {
>  int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
>  {
> struct ns16550_platdata *plat = dev->platdata;
> +   const u32 port_type = dev_get_driver_data(dev);
> fdt_addr_t addr;
> struct clk clk;
> int err;
> @@ -439,6 +441,10 @@ int ns16550_serial_ofdata_to_platdata(struct udevice 
> *dev)
> }
>
> plat->fcr = UART_FCRVAL;
> +   if (port_type == PORT_JZ4780) {
> +   plat->fcr |= UART_FCR_UME;
> +   plat->reg_shift = 2;

This should be in the device tree, shouldn't it?

> +   }
>
> return 0;
>  }
> @@ -461,6 +467,7 @@ const struct dm_serial_ops ns16550_serial_ops = {
>  static const struct udevice_id ns16550_serial_ids[] = {
> { .compatible = "ns16550",  .data = PORT_NS16550 },
> { .compatible = "ns16550a", .data = PORT_NS16550 },
> +   { .compatible = "ingenic,jz4780-uart",  .data = PORT_JZ4780  },
> { .compatible = "nvidia,tegra20-uart",  .data = PORT_NS16550 },
> { .compatible = "snps,dw-apb-uart", .data = PORT_NS16550 },
> { .compatible = "ti,omap2-uart",.data = PORT_NS16550 },
> diff --git a/include/ns16550.h b/include/ns16550.h
> index 45fd68b..7c97036 100644
> --- a/include/ns16550.h
> +++ b/include/ns16550.h
> @@ -118,6 +118,9 @@ typedef struct NS16550 *NS16550_t;
>  #define UART_FCR_RXSR  0x02 /* Receiver soft reset */
>  #define UART_FCR_TXSR  0x04 /* Transmitter soft reset */
>
> +/* Ingenic JZ47xx specific UART-enable bit. */
> +#define UART_FCR_UME   0x10
> +
>  /*
>   * These are the definitions for the Modem Control Register
>   */
> --
> 2.10.2
>

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


Re: [U-Boot] [PATCH 1/6] net: dw: Add read_rom_hwaddr net_op hook

2016-11-27 Thread Simon Glass
Hi,

On 25 November 2016 at 08:38, Olliver Schinagl  wrote:
> Add the read_rom_hwaddr net_op hook so that it can be called from boards
> to read the mac from a ROM chip.
>
> Signed-off-by: Olliver Schinagl 
> ---
>  drivers/net/designware.c | 16 
>  1 file changed, 16 insertions(+)
>
> diff --git a/drivers/net/designware.c b/drivers/net/designware.c
> index 9e6d726..3f2f67c 100644
> --- a/drivers/net/designware.c
> +++ b/drivers/net/designware.c
> @@ -230,6 +230,21 @@ static int _dw_write_hwaddr(struct dw_eth_dev *priv, u8 
> *mac_id)
> return 0;
>  }
>
> +__weak int dw_board_read_rom_hwaddr(unsigned char *enetaddr, int id)
> +{
> +   return -ENOSYS;
> +}
> +
> +static int designware_eth_read_rom_hwaddr(struct udevice *dev)
> +{
> +   struct eth_pdata *pdata = dev_get_platdata(dev);
> +
> +   if (!dev)
> +   return -ENOSYS;
> +
> +   return dw_board_read_rom_hwaddr(pdata->enetaddr, dev->seq);
> +}
> +
>  static void dw_adjust_link(struct eth_mac_regs *mac_p,
>struct phy_device *phydev)
>  {
> @@ -685,6 +700,7 @@ static const struct eth_ops designware_eth_ops = {
> .free_pkt   = designware_eth_free_pkt,
> .stop   = designware_eth_stop,
> .write_hwaddr   = designware_eth_write_hwaddr,
> +   .read_rom_hwaddr= designware_eth_read_rom_hwaddr,
>  };
>
>  static int designware_eth_ofdata_to_platdata(struct udevice *dev)

You should not call board code from a driver. But since this is a
sunxi driver, why not move all the code that reads the serial number
into this file?

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


Re: [U-Boot] [PATCH v2 2/2] splash: sort include files

2016-11-27 Thread Simon Glass
On 25 November 2016 at 02:45, Tomas Melin  wrote:
> Sort include files in accordance to u-boot coding style.
>
> Signed-off-by: Tomas Melin 
> ---
>  common/splash_source.c | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)

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


Re: [U-Boot] [PATCH 04/14] serial: 16550: Add getfcr accessor

2016-11-27 Thread Simon Glass
On 25 November 2016 at 15:32, Marek Vasut  wrote:
> Add function which allows fetching the default FCR register setting
> from platform data for DM , while retaining old behavior for non-DM
> by returning UART_FCRVAL.
>
> Signed-off-by: Marek Vasut 
> Cc: Tom Rini 
> Cc: Simon Glass 
> ---
> V2: If CONFIG_DM_SERIAL and DEBUG_UART are enabled, the ns16550_getfcr()
> can be invoked with NULL plat data . Check for this case and return
> the default UART_FCRVAL then.
> V3: It turns out that if DEBUG_UART is defined, $port points directly to
> hardware registers. Add additional ifdef to handle the case where
> debug uart is enabled with DM_SERIAL correctly.
> V4: Use UART_FCRVAL in _debug_uart_init() directly
> ---
>  drivers/serial/ns16550.c | 18 --
>  include/ns16550.h|  1 +
>  2 files changed, 17 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [RFC PATCH v2 4/7] env: Introduce "transient" and "system" access flags

2016-11-27 Thread Simon Glass
On 25 November 2016 at 03:48, Bernhard Nortmann
 wrote:
> Hi Simon,
>
> Am 23.11.2016 um 00:08 schrieb Simon Glass:
>>
>> Hi Bernhard,
>>
>> [...]
>> Well you could add a separate patch before this one which renames
>> everything. I don't think anyone else is working in this area.
>>
>> Regards,
>> Simon
>
>
> Doing so, I have arrived at the (additional) commit attached below.
> With that added to the series, do you think this has matured enough
> to promote it from "RFC" to an actual PATCH when submitting v3?

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


Re: [U-Boot] About U-boot's TPM

2016-11-27 Thread Simon Glass
Hi Ronny,

On 24 November 2016 at 14:20, Ronny Ko  wrote:
> Hi Simon,
>
> I have a question about using a TPM from U-Boot. I try to run U-Boot on
> Minnowboard MAX, which has a firmware TPM (fTPM), instead of discrete TPM
> (dTPM). I wonder if the way of using fTPM from U-Boot is the same as using
> dTPM. I suppose the answer is yes, if an fTPM is simply a virtual version of
> dTPM. Or is it not so?

I don't know how that is connected. Do you have any documentation?

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


Re: [U-Boot] [PATCHv3 09/15] pci: layerscape: add pci driver based on DM

2016-11-27 Thread Simon Glass
Hi,

On 24 November 2016 at 02:28, Z.Q. Hou  wrote:
> Hi Simon,
>
> Thanks for your comments!
>
>> -Original Message-
>> From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass
>> Sent: 2016年11月24日 10:21
>> To: Z.Q. Hou 
>> Cc: U-Boot Mailing List ; Albert ARIBAUD
>> ; Prabhakar Kushwaha
>> ; Huan Wang-B18965
>> ; Sumit Garg ; Ruchika
>> Gupta ; Saksham Jain
>> ; york sun ; M.H. Lian
>> ; Bin Meng ; Mingkai Hu
>> 
>> Subject: Re: [PATCHv3 09/15] pci: layerscape: add pci driver based on DM
>>
>> Hi,
>>
>> On 22 November 2016 at 02:25, Z.Q. Hou  wrote:
>> > Hi Simon,
>> >
>> > Sorry for my delay respond due to out of the office several days, and 
>> > thanks
>> a lot for your comments!
>> >
>> >> -Original Message-
>> >> From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass
>> >> Sent: 2016年11月18日 9:15
>> >> To: Z.Q. Hou 
>> >> Cc: U-Boot Mailing List ; Albert ARIBAUD
>> >> ; Prabhakar Kushwaha
>> >> ; Huan Wang-B18965
>> >> ; Sumit Garg ;
>> Ruchika
>> >> Gupta ; Saksham Jain
>> >> ; york sun ; M.H.
>> >> Lian ; Bin Meng ;
>> Mingkai
>> >> Hu 
>> >> Subject: Re: [PATCHv3 09/15] pci: layerscape: add pci driver based on
>> >> DM
>> >>
>> >> Hi,
>> >>
>> >> On 16 November 2016 at 02:48, Zhiqiang Hou 
>> >> wrote:
>> >> > From: Minghuan Lian 
>> >> >
>> >> > There are more than five kinds of Layerscape SoCs. unfortunately,
>> >> > PCIe controller of each SoC is a little bit different. In order to
>> >> > avoid too many macro definitions, the patch addes a new
>> >> > implementation of PCIe driver based on DM. PCIe dts node is used to
>> >> > describe the difference.
>> >> >
>> >> > Signed-off-by: Minghuan Lian 
>> >> > Signed-off-by: Hou Zhiqiang 
>> >> > ---
>> >> > V3:
>> >> >  - No change
>> >> >
>> >> >  drivers/pci/Kconfig   |   8 +
>> >> >  drivers/pci/pcie_layerscape.c | 761
>> >> > ++
>> >> >  2 files changed, 769 insertions(+)
>> >> >
>>
>> >> > +#ifdef CONFIG_FSL_LSCH3
>> >>
>> >> Can this be a run-time check?
>> >
>> > No, it is for Linux DT fixup and these functions is needed only by 
>> > FSL_LSCH3
>> SoCs.
>>
>> I mean that you cannot have an #ifdef in a driver - it should be done at
>> run-time by looking at the compatible strings.
>
> This driver work for many platforms, but this fixup is only used by FSL_LSCH3 
> SoCs,
> if check the compatible string at run-time, the fixup will be still compiled 
> for the platform which doesn't need it.
> Why compile it into the binary for the platform which doesn't need it?

Because that's how it works. Drivers are drivers for their hardware.
We cannot compile them differently depending on who might use them...

If this is a big problem you could split the driver into multiple
parts perhaps. But what exactly is the problem here?

>
>> >
>> >>
>> >> > +/*
>> >> > + * Return next available LUT index.
>> >> > + */
>> >> > +static int ls_pcie_next_lut_index(struct ls_pcie *pcie) {
>> >> > +   if (pcie->next_lut_index < PCIE_LUT_ENTRY_COUNT)
>> >> > +   return pcie->next_lut_index++;
>> >> > +   else
>> >> > +   return -1;  /* LUT is full */
>> >>
>> >> -ENOSPC?
>> >
>> > Yes, ENOSPC is more reasonable.
>> >
>> >>
>> >> > +}
>> >> > +
>> >> > +/*
>> >> > + * Program a single LUT entry
>> >> > + */
>> >> > +static void ls_pcie_lut_set_mapping(struct ls_pcie *pcie, int
>> >> > +index, u32
>> >> devid,
>> >> > +   u32 streamid) {
>> >> > +   /* leave mask as all zeroes, want to match all bits */
>> >> > +   lut_writel(pcie, devid << 16, PCIE_LUT_UDR(index));
>> >> > +   lut_writel(pcie, streamid | PCIE_LUT_ENABLE,
>> >> > +PCIE_LUT_LDR(index)); }
>> >> > +
>> >> > +/* returns the next available streamid */ static u32
>> >> > +ls_pcie_next_streamid(void) {
>> >> > +   static int next_stream_id = FSL_PEX_STREAM_ID_START;
>> >> > +
>> >> > +   if (next_stream_id > FSL_PEX_STREAM_ID_END)
>> >> > +   return 0x;
>> >>
>> >> Is FSL_PEX_STREAM_ID_END the maximum value, or the number of values?
>> >
>> > The maximum value for PCIe.
>> >
>> >> > +
>> >> > +   return next_stream_id++;
>> >> > +}
>> >> > +
>> >> > +/*
>> >> > + * An msi-map is a property to be added to the pci controller
>> 

Re: [U-Boot] [Resend RFC PATCH v1 1/3] add support of GPT partitioning over MTD

2016-11-27 Thread Simon Glass
Hi Patrick,

On 24 November 2016 at 03:27, Patrick DELAUNAY  wrote:
> Hi Simon,
>
>>
>> Hi Patrick,
>>
>> On 22 November 2016 at 06:24, Patrick Delaunay
>>  wrote:
>> > From: Patrick Delaunay 
>> >
>> > Signed-off-by: Patrick Delaunay 
>> > Signed-off-by: Patrick Delaunay 
>> > ---
>> >
>> >  Kconfig|  12 ++
>> >  cmd/gpt.c  |  98 --
>> >  cmd/mtdparts.c | 103 ++-
>> >  cmd/part.c |  48 -
>> >  disk/part_efi.c| 526
>> -
>> >  doc/README.gpt.mtd | 189 +++
>> >  include/part.h |  13 +-
>> >  include/uuid.h |   1 +
>> >  lib/uuid.c |  33 
>> >  9 files changed, 944 insertions(+), 79 deletions(-)  create mode
>> > 100644 doc/README.gpt.mtd
>>
>> General comments:
>>
>> - use 'U-Boot' consistently rather than variations
>> - can you split your large function up a bit?
>> - can you make a precursor patch to refactor things, so reducing the size of
>> this one?
>
> Yes, I will do this split in v2 to reduce each patch size:
> - one patch to uuid new function
> - one precursor for efi part : refactor
> - one patch for GPT over MTD in part_efi.c
> & I will split large function
> - one patch for each command update
>
>> - nice README!
>>
>> >
>> > diff --git a/Kconfig b/Kconfig
>> > index 1263d0b..c2388e1 100644
>> > --- a/Kconfig
>> > +++ b/Kconfig
>> > @@ -335,6 +335,18 @@ config ARCH_FIXUP_FDT
>> >
>> >  endmenu# Boot images
>> >
>> > +config EFI_PARTITION_MTD
>> > +   bool "Support GPT over MTD"
>> > +   help
>> > + The GPT partition is normally defined only for block device with
>> > + built-in controller which manage flash translation layer
>> > + This option activate the GPT partition support over RAW device
>> > + using the MTD framework
>> > + - manage partition over MTD devices (as flash: NOR and NAND)
>> > + - extract MTD information
>> > + - update command gpt, mtdparts and part
>> > + NB: depends on EFI_PARTITION
>>
>> So do you want 'depends on EFI_PARTITION'?
>
> Yes I expect it, I try to add
> depends on EFI_PARTITION
> but is not working as it is not (yet ?)  one KCONFIG option.
> I add this comment to add this line when part lib will integrate KCONFIG

I see. Well if you have the energy you could use moveconfig.py to convert it.

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


Re: [U-Boot] [PATCH] cmd/fdt: fix uncallable systemsetup command

2016-11-27 Thread Simon Glass
On 24 November 2016 at 07:02, Fabien Parent  wrote:
> The function that is processing the 'fdt' parameters is one big
> if-else if. In order to be able to type command faster only the first
> few letter are checked to know which block of code to execute. For
> systemsetup, the block of code that was executed was always the wrong
> one and ended up in a failure.
>
> } else if (argv[1][0] == 's') {
> process "fdt set" command
> } else if (strncmp(argv[1], "sys", 3) == 0) {
> process "fdt systemsetup" command.
> }
>
> When typing "fdt systemsetup", the code that was executed was the code
> for "fdt set".
>
> This commit fix this issue by moving the "else if" for systemsetup
> before the else if for "fdt set". This allow us to keep compatibility
> with any script that make use of "fdt s" to set node values.
>
> Signed-off-by: Fabien Parent 
> ---
>  cmd/fdt.c | 22 ++
>  1 file changed, 10 insertions(+), 12 deletions(-)

Acked-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 00/97] Replace some powerpc CONFIG_* macros to Kconfig options

2016-11-27 Thread Simon Glass
On 24 November 2016 at 00:59, york sun  wrote:
> This set converts all CONFIG_PPC_* SoC macros to Kconfig ARCH_* options
> and drop existing macros.
>
> CONFIG_MAX_CPUS is converted to Kconfig option for mpc85xx, and dropped
> for mpc86xx.

Looks good, thanks for doing this!

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


Re: [U-Boot] [PATCH v3 1/6] drivers: usb: gadget: ether: adopt to usb driver model

2016-11-27 Thread Simon Glass
Hi Mugunthan,

On 24 November 2016 at 01:11, Mugunthan V N  wrote:
> Hi Simon
>
> On Thursday 24 November 2016 07:51 AM, Simon Glass wrote:
>> Hi Mugunthan,
>>
>> On 20 November 2016 at 22:38, Mugunthan V N  wrote:
>>> Hi Simon,
>>>
>>> On Saturday 19 November 2016 01:04 AM, Simon Glass wrote:
 Hi Mugunthan,

 On 17 November 2016 at 01:09, Mugunthan V N  wrote:
> Convert usb ether gadget to adopt usb driver model
>
> Signed-off-by: Mugunthan V N 
> Reviewed-by: Simon Glass 

 Sorry, but I'd like to 'un-review' this.

> ---
>  drivers/usb/gadget/ether.c | 36 
>  1 file changed, 36 insertions(+)
>
> diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
> index 497b981129..9bc61186cf 100644
> --- a/drivers/usb/gadget/ether.c
> +++ b/drivers/usb/gadget/ether.c
> @@ -24,6 +24,10 @@
>  #include "gadget_chips.h"
>  #include "rndis.h"
>
> +#include 
> +#include 
> +#include 
> +
>  #define USB_NET_NAME "usb_ether"
>
>  #define atomic_read
> @@ -101,6 +105,9 @@ struct eth_dev {
> struct usb_gadget   *gadget;
> struct usb_request  *req;   /* for control responses 
> */
> struct usb_request  *stat_req;  /* for cdc & rndis status 
> */
> +#ifdef CONFIG_DM_USB
> +   struct udevice  *usb_udev;
> +#endif
>
> u8  config;
> struct usb_ep   *in_ep, *out_ep, *status_ep;
> @@ -2303,6 +2310,24 @@ fail:
>
>  
> /*-*/
>
> +#ifdef CONFIG_DM_USB
> +int dm_usb_init(struct eth_dev *e_dev)
> +{
> +   struct udevice *dev = NULL;
> +   int ret;
> +
> +   ret = uclass_first_device(UCLASS_USB_DEV_GENERIC, );
> +   if (!dev || ret) {
> +   error("No USB device found\n");
> +   return -ENODEV;
> +   }
> +
> +   e_dev->usb_udev = dev;
> +
> +   return ret;
> +}
> +#endif
> +
>  static int usb_eth_init(struct eth_device *netdev, bd_t *bd)
>  {
> struct eth_dev *dev = _ethdev;
> @@ -2315,7 +2340,14 @@ static int usb_eth_init(struct eth_device *netdev, 
> bd_t *bd)
> goto fail;
> }
>
> +#ifdef CONFIG_DM_USB
> +   if (dm_usb_init(dev)) {
> +   error("USB ether not found\n");
> +   return -ENODEV;
> +   }
> +#else
> board_usb_init(0, USB_INIT_DEVICE);
> +#endif
>
> /* Configure default mac-addresses for the USB ethernet device */
>  #ifdef CONFIG_USBNET_DEV_ADDR
> @@ -2497,7 +2529,11 @@ void usb_eth_halt(struct eth_device *netdev)
> }
>
> usb_gadget_unregister_driver(_driver);
> +#ifdef CONFIG_DM_USB
> +   device_remove(dev->usb_udev);
> +#else
> board_usb_cleanup(0, USB_INIT_DEVICE);
> +#endif

 This doesn't look right to me. If your board is to be an Ethernet
 device then it should do:

 uclass_first_device(UCLASS_ETH, )

 to get the device. That could be in the device tree under the USB
 node, or perhaps you want to have a setup function which manualy binds
 the device, a bit like usb_find_and_bind_driver().

>>>
>>> This patch is to get usb device for the ether gadget. It uses the same
>>> api with UCLASS_USB_DEV_GENERIC to get usb device. The patch hadn't done
>>> for eth driver model adoption.
>>
>> So can you do that one first, or is it coming soon?
>>
>
> Its already implemented above in the function dm_usb_init()

So are you saying that the Ethernet 'USB device' driver needs to be
converted to driver model? Otherwise what stops us from using
UCLASS_ETH here?

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


Re: [U-Boot] [PATCH 16/19] pinctrl: imx6: support i.MX6SLL

2016-11-27 Thread Simon Glass
On 23 November 2016 at 23:47, Peng Fan  wrote:
> There two iomuxc for i.MX6SLL. One is normal IOMUXC, the other
> is for IOMUXC_SNVS.
>
> Signed-off-by: Peng Fan 
> Cc: Stefano Babic 
> Cc: Simon Glass 
> ---
>  drivers/pinctrl/nxp/pinctrl-imx6.c | 2 ++
>  1 file changed, 2 insertions(+)

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


Re: [U-Boot] [PATCH v2 4/4] dts: popmetal: add usb host power supply node

2016-11-27 Thread Simon Glass
On 24 November 2016 at 00:29, Kever Yang  wrote:
> The popmetal board using a HOST_VBUS_DRV gpio signal to control the
> USB host port 5V power, add a fix regulator and pinctrl for it, and
> enable the USB host1 controller with the vbus-supply.
>
> Signed-off-by: Kever Yang 
> ---
>
> Changes in v2: None
>
>  arch/arm/dts/rk3288-popmetal.dtsi | 23 +++
>  1 file changed, 23 insertions(+)

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


Re: [U-Boot] [PATCH 05/24] SPL: tiny-printf: add "l" modifier

2016-11-27 Thread Simon Glass
Hi,

On 23 November 2016 at 20:19, Siarhei Siamashka
 wrote:
> On Sun, 20 Nov 2016 14:56:59 +
> Andre Przywara  wrote:
>
>> tiny-printf does not know about the "l" modifier so far, which breaks
>> the crash dump on AArch64, because it uses %lx to print the registers.
>> Add an easy way of handling longs correctly.
>
> I can't help but notice that the changes of this kind are in a way
> defeating the original purpose of tiny-printf. And it is surely not
> the first patch adding features to tiny-printf. I guess, in the end
> we may end up with a large and bloated printf implementation again :-)
>
> A possible solution might be just a strict check when parsing format
> modifiers and abort with an error message (yeah, this will introduce
> some size increase, but hopefully the last one). This way we
> acknowledge the fact that tiny-printf is a reduced incomplete
> implementation, and that the callers need to take this into account.
>
> As for the "l" modifier. How much does it add to the code size? IMHO
> this information should be mentioned in the commit message. Can the
> AArch64 crash dump code be modified to avoid using it? Or can we have
> the "l" modifier supported on 64-bit platforms only?
>
>> Signed-off-by: Andre Przywara 
>> ---
>>  lib/tiny-printf.c | 43 +--
>>  1 file changed, 33 insertions(+), 10 deletions(-)

I think I tested this patch as adding 36 bytes on Thumb2 so not too
terrible. But I do agree with the sentiment.

Why is aarch64 using tiny-printf? Surely all though chips have heaps of space?!

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


[U-Boot] [PATCH RESEND] imx-common: hab: fix return value from hab_auth_img

2016-11-27 Thread Eric Nelson
The authenticate_image routine returns a boolean to indicate
a valid (1) or invalid (0) image.

The hab_auth_img should return CMD_RET_SUCCESS to indicate
success (a valid image), but currently doesn't.

Before this patch, a valid image at addres 0x1200
with an IVT offset of 0x7a8000 will produce the following:

=> if hab_auth_img 0x1200 0x7a8000 ; then
> echo worked
>   else
> echo failed
>   fi
Authenticate image from DDR location 0x1200...
Secure boot enabled
HAB Configuration: 0xcc, HAB State: 0x99
failed

Signed-off-by: Eric Nelson 
---
 arch/arm/imx-common/hab.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/imx-common/hab.c b/arch/arm/imx-common/hab.c
index 6731825..e2c04f9 100644
--- a/arch/arm/imx-common/hab.c
+++ b/arch/arm/imx-common/hab.c
@@ -486,7 +486,9 @@ static int do_authenticate_image(cmd_tbl_t *cmdtp, int 
flag, int argc,
 
rcode = authenticate_image(addr, ivt_offset);
 
-   return rcode;
+   return (rcode != 0)
+   ? CMD_RET_SUCCESS
+   : CMD_RET_FAILURE;
 }
 
 U_BOOT_CMD(
-- 
2.7.4

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


[U-Boot] [PATCH] tbs2910: Make Ethernet functional again

2016-11-27 Thread Soeren Moch
Configure the PHY to output a 125MHz clk from CLK_25M and set tx clock delay.
This patch is similar to commit 4b6035da482cccda06aeb419634f99937c9fc783
("mx6sabresd: Make Ethernet functional again").

Signed-off-by: Soeren Moch 
---
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: u-boot@lists.denx.de
---
 board/tbs/tbs2910/tbs2910.c | 33 +
 1 file changed, 33 insertions(+)

diff --git a/board/tbs/tbs2910/tbs2910.c b/board/tbs/tbs2910/tbs2910.c
index 0d9d17a..db0c58f 100644
--- a/board/tbs/tbs2910/tbs2910.c
+++ b/board/tbs/tbs2910/tbs2910.c
@@ -359,6 +359,39 @@ static void setup_display(void)
 }
 #endif /* CONFIG_VIDEO_IPUV3 */
 
+static int ar8035_phy_fixup(struct phy_device *phydev)
+{
+   unsigned short val;
+
+   /* To enable AR8035 ouput a 125MHz clk from CLK_25M */
+   phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x7);
+   phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x8016);
+   phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x4007);
+
+   val = phy_read(phydev, MDIO_DEVAD_NONE, 0xe);
+   val &= 0xffe3;
+   val |= 0x18;
+   phy_write(phydev, MDIO_DEVAD_NONE, 0xe, val);
+
+   /* introduce tx clock delay */
+   phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x5);
+   val = phy_read(phydev, MDIO_DEVAD_NONE, 0x1e);
+   val |= 0x0100;
+   phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, val);
+
+   return 0;
+}
+
+int board_phy_config(struct phy_device *phydev)
+{
+   ar8035_phy_fixup(phydev);
+
+   if (phydev->drv->config)
+   phydev->drv->config(phydev);
+
+   return 0;
+}
+
 int board_eth_init(bd_t *bis)
 {
setup_iomux_enet();
-- 
1.9.1

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


Re: [U-Boot] [U-Boot, v3, 5/6] efi_loader: Allow to compile helloworld.efi w/o bundling it

2016-11-27 Thread Tom Rini
On Thu, Nov 17, 2016 at 10:40:10PM +0100, Alexander Graf wrote:

> Today we can compile a self-contained hello world efi test binary that
> allows us to quickly verify whether the EFI loader framwork works.
> 
> We can use that binary outside of the self-contained test case though,
> by providing it to a to-be-tested system via tftp.
> 
> This patch separates compilation of the helloworld.efi file from
> including it in the u-boot binary for "bootefi hello". It also modifies
> the efi_loader test case to enable travis to pick up the compiled file.
> Because we're now no longer bloating the resulting u-boot binary, we
> can enable compilation always, giving us good travis test coverage.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2] travis: Add efi_loader grub2 test

2016-11-27 Thread Tom Rini
On Fri, Nov 18, 2016 at 01:18:00PM +0100, Alexander Graf wrote:

> We have all the building blocks now to run arbitrary efi applications
> in travis. The most important one out there is grub2, so let's add
> a simple test to verify that grub2 still comes up.
> 
> Signed-off-by: Alexander Graf 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 3/6] travis: Add python path for environments

2016-11-27 Thread Tom Rini
On Thu, Nov 17, 2016 at 06:31:04PM +0100, Alexander Graf wrote:

> When running in travis-ci, we want to pass environment configuration to
> the tests. These reside in a path available through PYTHONPATH, so let's
> define that one to point to the unit test repo.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 6/6] Travis: Remove sleep test from integratorcp_cm926ejs-qemu test

2016-11-27 Thread Tom Rini
On Thu, Nov 17, 2016 at 06:31:07PM +0100, Alexander Graf wrote:

> Most of the time when running the sleep test in Travis for
> the integratorcp_cm926ejs target I get errors like this:
> 
>   E   assert 2.01056289673 >= 3
> 
> The deviation is tiny, but fails the overall build result. Since
> the sleep test is not terribly important as gate keeper for travis
> tests, let's just exclude it for this board.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 4/6] tests: Add efi_loader hello world test

2016-11-27 Thread Tom Rini
On Thu, Nov 17, 2016 at 06:31:05PM +0100, Alexander Graf wrote:

> Now that we have working network tests and a hello world efi application
> built inside our tree, we can automatically test that efi binary running
> inside of U-Boot.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2,1/6] tests: net: Offset downloads to 4MB

2016-11-27 Thread Tom Rini
On Thu, Nov 17, 2016 at 06:31:02PM +0100, Alexander Graf wrote:

> The network test currently downloads files at 0MB offset of RAM start.
> This works for most ARM systems, but x86 has weird memory layout constraints
> on the first MB of RAM.
> 
> To not get caught into any of these, let's add a 4MB pad from start
> of RAM to the default memory offset.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2,2/6] Travis: Expose build dir as variable

2016-11-27 Thread Tom Rini
On Thu, Nov 17, 2016 at 06:31:03PM +0100, Alexander Graf wrote:

> Some travis QEMU tests can transfer files between the build directory
> and the guest U-Boot instance. For that to work, both need to have access
> to the same directory.
> 
> This patch puts the current build path into an environment variable, so
> that the environment generating python scripts can extract it from there
> and read the respective files.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot