Re: [U-Boot] [PATCH v3 00/20] Bring NAND support to Nintendo NES Classic

2018-03-06 Thread Maxime Ripard
Hi Scott,

On Wed, Feb 28, 2018 at 08:51:42PM +0100, Miquel Raynal wrote:
> This series first adds fixes and enhancements to sunxi NAND drivers (SPL
> and U-Boot). Once this is done, the SPL NAND driver is converted to use
> PIO instead of DMA with the goal to support all SoCs with this IP
> without the need for DMA-related code. Finally, NAND support is added to
> Nintendo NES Classic through Kconfig and DT additions.

Should we merge it through the sunxi tree, or do you want to merge
these changes through yours?

Thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com


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


Re: [U-Boot] [PATCH] spi: atcspi200: Full dm conversion

2018-03-06 Thread 陳建志
2018-03-07 15:20 GMT+08:00 Jagan Teki :
> On Wed, Mar 7, 2018 at 12:34 PM, Andes  wrote:
>> From: Rick Chen 
>>
>> atcspi200_spi now support dt along with platform data.
>>
>> Signed-off-by: Rick Chen 
>> Signed-off-by: Rick Chen 
>> Signed-off-by: Greentime Hu 
>> ---
>>  drivers/spi/atcspi200_spi.c  |  134 
>> ++
>>  include/dm/platform_data/spi_atcspi200.h |   15 
>
> I have seen only two boards using this driver (adp-ae3xx_defconfig,
> nx25-ae250_defconfig) and both are enabled DM_SPI with OF_CONTROL why
> we need to have platdata for this? here [1] is non-dm code drop.
>
> [1] https://patchwork.ozlabs.org/patch/882404/

Hi Tagan Teki

I just refer to [PATCH][Boards Need to Switch DM] spi: davinci: Full
dm conversion
And have this modification.

So it is not necessary to add platdata for atcspi200_spi, just drop
non-dm code, right ?

Thank you

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


Re: [U-Boot] [PATCH] spi: atcspi200: Full dm conversion

2018-03-06 Thread Jagan Teki
On Wed, Mar 7, 2018 at 12:34 PM, Andes  wrote:
> From: Rick Chen 
>
> atcspi200_spi now support dt along with platform data.
>
> Signed-off-by: Rick Chen 
> Signed-off-by: Rick Chen 
> Signed-off-by: Greentime Hu 
> ---
>  drivers/spi/atcspi200_spi.c  |  134 
> ++
>  include/dm/platform_data/spi_atcspi200.h |   15 

I have seen only two boards using this driver (adp-ae3xx_defconfig,
nx25-ae250_defconfig) and both are enabled DM_SPI with OF_CONTROL why
we need to have platdata for this? here [1] is non-dm code drop.

[1] https://patchwork.ozlabs.org/patch/882404/
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] spi: atcspi200: Full dm conversion

2018-03-06 Thread Andes
From: Rick Chen 

atcspi200_spi now support dt along with platform data.

Signed-off-by: Rick Chen 
Signed-off-by: Rick Chen 
Signed-off-by: Greentime Hu 
---
 drivers/spi/atcspi200_spi.c  |  134 ++
 include/dm/platform_data/spi_atcspi200.h |   15 
 2 files changed, 42 insertions(+), 107 deletions(-)
 create mode 100644 include/dm/platform_data/spi_atcspi200.h

diff --git a/drivers/spi/atcspi200_spi.c b/drivers/spi/atcspi200_spi.c
index 5b2e9d6..0c39c80 100644
--- a/drivers/spi/atcspi200_spi.c
+++ b/drivers/spi/atcspi200_spi.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -75,9 +76,6 @@ struct atcspi200_spi_regs {
 };
 
 struct nds_spi_slave {
-#ifndef CONFIG_DM_SPI
-   struct spi_slave slave;
-#endif
volatile struct atcspi200_spi_regs *regs;
int to;
unsigned intfreq;
@@ -286,89 +284,6 @@ static int __atcspi200_spi_xfer(struct nds_spi_slave *ns,
return ret;
 }
 
-#ifndef CONFIG_DM_SPI
-#define to_nds_spi_slave(s) container_of(s, struct nds_spi_slave, slave)
-struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
-   unsigned int max_hz, unsigned int mode)
-{
-   struct nds_spi_slave *ns;
-
-   if (!spi_cs_is_valid(bus, cs))
-   return NULL;
-
-   ns = spi_alloc_slave(struct nds_spi_slave, bus, cs);
-   if (!ns)
-   return NULL;
-
-   switch (bus) {
-   case SPI0_BUS:
-   ns->regs = (struct atcspi200_spi_regs *)SPI0_BASE;
-   break;
-
-   case SPI1_BUS:
-   ns->regs = (struct atcspi200_spi_regs *)SPI1_BASE;
-   break;
-
-   default:
-   return NULL;
-   }
-
-   ns->freq= max_hz;
-   ns->mode = mode;
-   ns->to = SPI_TIMEOUT;
-   ns->max_transfer_length = MAX_TRANSFER_LEN;
-   ns->slave.max_write_size = MAX_TRANSFER_LEN;
-
-   return >slave;
-}
-
-void spi_free_slave(struct spi_slave *slave)
-{
-   struct nds_spi_slave *ns = to_nds_spi_slave(slave);
-   free(ns);
-}
-
-void spi_init(void)
-{
-   /* do nothing */
-}
-
-int spi_claim_bus(struct spi_slave *slave)
-{
-   struct nds_spi_slave *ns = to_nds_spi_slave(slave);
-   return __atcspi200_spi_claim_bus(ns);
-}
-
-void spi_release_bus(struct spi_slave *slave)
-{
-   struct nds_spi_slave *ns = to_nds_spi_slave(slave);
-   __atcspi200_spi_release_bus(ns);
-}
-
-int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void 
*data_out,
-   void *data_in, unsigned long flags)
-{
-   struct nds_spi_slave *ns = to_nds_spi_slave(slave);
-   return __atcspi200_spi_xfer(ns, bitlen, data_out, data_in, flags);
-}
-
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
-   return bus == 0 && cs < NSPI_MAX_CS_NUM;
-}
-
-void spi_cs_activate(struct spi_slave *slave)
-{
-   struct nds_spi_slave *ns = to_nds_spi_slave(slave);
-   __atcspi200_spi_start(ns);
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
-   struct nds_spi_slave *ns = to_nds_spi_slave(slave);
-   __atcspi200_spi_stop(ns);
-}
-#else
 static int atcspi200_spi_set_speed(struct udevice *bus, uint max_hz)
 {
struct nds_spi_slave *ns = dev_get_priv(bus);
@@ -447,7 +362,10 @@ static int atcspi200_spi_get_clk(struct udevice *bus)
 static int atcspi200_spi_probe(struct udevice *bus)
 {
struct nds_spi_slave *ns = dev_get_priv(bus);
+   struct atcspi200_spi_platdata *plat = bus->platdata;
 
+   ns->regs = plat->regs;
+   ns->num_cs = plat->num_cs;
ns->to = SPI_TIMEOUT;
ns->max_transfer_length = MAX_TRANSFER_LEN;
ns->mtiming = ns->regs->timing;
@@ -456,24 +374,6 @@ static int atcspi200_spi_probe(struct udevice *bus)
return 0;
 }
 
-static int atcspi200_ofdata_to_platadata(struct udevice *bus)
-{
-   struct nds_spi_slave *ns = dev_get_priv(bus);
-   const void *blob = gd->fdt_blob;
-   int node = dev_of_offset(bus);
-
-   ns->regs = map_physmem(devfdt_get_addr(bus),
-sizeof(struct atcspi200_spi_regs),
-MAP_NOCACHE);
-   if (!ns->regs) {
-   printf("%s: could not map device address\n", __func__);
-   return -EINVAL;
-   }
-   ns->num_cs = fdtdec_get_int(blob, node, "num-cs", 4);
-
-   return 0;
-}
-
 static const struct dm_spi_ops atcspi200_spi_ops = {
.claim_bus  = atcspi200_spi_claim_bus,
.release_bus= atcspi200_spi_release_bus,
@@ -482,18 +382,38 @@ static const struct dm_spi_ops atcspi200_spi_ops = {
.set_mode   = atcspi200_spi_set_mode,
 };
 
+#if CONFIG_IS_ENABLED(OF_CONTROL)
+static int atcspi200_ofdata_to_platadata(struct udevice *bus)
+{
+   struct 

[U-Boot] [PATCH v3 2/2] mmc: zynq_sdhci: use correct quirk if CONFIG_ZYNQ_HISPD_BROKEN is defined

2018-03-06 Thread Hannes Schmelzer
The 'SDHCI_QUIRK_NO_HISPD_BIT' is used wrong here. The purpose of this
quirk is to tell the sdhci-driver that the IP-core doesn't have a "high-
speed-enable" bit in its registers.

With this commit we change this to the correct quirk:
SDHCI_QUIRK_BROKEN_HISPD_MODE

Signed-off-by: Hannes Schmelzer 
---

Changes in v3: None
Changes in v2: None

 drivers/mmc/zynq_sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
index 9463a06..76fe97f 100644
--- a/drivers/mmc/zynq_sdhci.c
+++ b/drivers/mmc/zynq_sdhci.c
@@ -54,7 +54,7 @@ static int arasan_sdhci_probe(struct udevice *dev)
   SDHCI_QUIRK_BROKEN_R1B;
 
 #ifdef CONFIG_ZYNQ_HISPD_BROKEN
-   host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT;
+   host->quirks |= SDHCI_QUIRK_BROKEN_HISPD_MODE;
 #endif
 
host->max_clk = clock;
-- 
2.7.4


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


[U-Boot] [PATCH v3 1/2] mmc: sdhci: add SDHCI_QUIRK_BROKEN_HISPD_MODE

2018-03-06 Thread Hannes Schmelzer
From: Hannes Schmelzer 

Some IP-core implementations of the SDHCI have different troubles on the
silicon where they are placed.

On ZYNQ platform for example Xilinx doesn't accept the hold timing of an
eMMC chip which operates in High-Speed mode and must be forced to
operate in non high-speed mode. To get rid of this
"SDHCI_QUIRK_BROKEN_HISPD_MODE" is introduced.

For more details about this refer to the Xilinx answer-recor #5
https://www.xilinx.com/support/answers/5.html

This commit:
- doesn't set HISPD bit on the host-conroller
- reflects this fact within the host-controller capabilities

Upon this the layer above (mmc-driver) can setup the card correctly.

Otherwise the MMC card will be switched into high-speed mode and causes
possible timing violation on the host-controller side.

Signed-off-by: Hannes Schmelzer 

Signed-off-by: Hannes Schmelzer 
---

Changes in v3:
- cleanup sign-off tag
- fix typo (sdci -> sdhci)
- combine the if instruction SDHCI_QUIRK_BROKEN_HISPD_MODE with the
  existing SDHCI_QUIRK_NO_HISPD_BIT

Changes in v2:
- don't use the SDHCI_QUIRK_NO_HISPD_BIT for getting rid of this,
since this quirk was designed for another purpose. Instead introduce the
new SDHCI_QUIRK_BROKEN_HISPD_MODE quirk.

 drivers/mmc/sdhci.c | 8 +++-
 include/sdhci.h | 6 ++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index d31793a..1e5e8a6 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -462,7 +462,8 @@ static int sdhci_set_ios(struct mmc *mmc)
else
ctrl &= ~SDHCI_CTRL_HISPD;
 
-   if (host->quirks & SDHCI_QUIRK_NO_HISPD_BIT)
+   if ((host->quirks & SDHCI_QUIRK_NO_HISPD_BIT) ||
+   (host->quirks & SDHCI_QUIRK_BROKEN_HISPD_MODE))
ctrl &= ~SDHCI_CTRL_HISPD;
 
sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
@@ -602,6 +603,11 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct 
sdhci_host *host,
cfg->host_caps &= ~MMC_MODE_8BIT;
}
 
+   if (host->quirks & SDHCI_QUIRK_BROKEN_HISPD_MODE) {
+   cfg->host_caps &= ~MMC_MODE_HS;
+   cfg->host_caps &= ~MMC_MODE_HS_52MHz;
+   }
+
if (host->host_caps)
cfg->host_caps |= host->host_caps;
 
diff --git a/include/sdhci.h b/include/sdhci.h
index 7e84012..ed35f04 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -213,6 +213,12 @@
 #define SDHCI_QUIRK_BROKEN_R1B (1 << 2)
 #define SDHCI_QUIRK_NO_HISPD_BIT   (1 << 3)
 #define SDHCI_QUIRK_BROKEN_VOLTAGE (1 << 4)
+/*
+ * SDHCI_QUIRK_BROKEN_HISPD_MODE
+ * the hardware cannot operate correctly in high-speed mode,
+ * this quirk forces the sdhci host-controller to non high-speed mode
+ */
+#define SDHCI_QUIRK_BROKEN_HISPD_MODE  BIT(5)
 #define SDHCI_QUIRK_WAIT_SEND_CMD  (1 << 6)
 #define SDHCI_QUIRK_USE_WIDE8  (1 << 8)
 
-- 
2.7.4


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


Re: [U-Boot] imx: get_ticks in syscounter.c get miscompiled by GCC 6

2018-03-06 Thread Yasushi SHOJI
Hi,

On Tue, Mar 6, 2018 at 10:11 PM, Fabio Estevam  wrote:
> On Tue, Mar 6, 2018 at 9:31 AM, Lothar Waßmann  
> wrote:
>
>> Without the 'volatile' attribute the compiler is entitled to move the
>> asm code around or optimize it out.
>> So, your patch is the correct fix independent from the gcc version
>> used.
>
> Yes, but then it would be better to fix all the places where asm is
> used without volatile.

That'd be a quite big patch.  A quick grep shows me that
there is over 100 asm() without volatile.

git grep -e '\basm *(' | grep  -v -e volatile -e nop | wc -l
153

Do you guys really want to put volatile on all of these now?
We are at rc4 and Tom is planing to cut the release
March 12th.

I'm attaching a tentative patch to fix only syscounter.c.
If it looks good, I'l resend it by git-send-email.

Best,
-- 
yashi
From 8772a9b5b532da4c1d0656ffa21f324e72d369e8 Mon Sep 17 00:00:00 2001
From: Yasushi SHOJI 
Date: Wed, 7 Mar 2018 14:38:05 +0900
Subject: [PATCH] imx: syscounter: make sure asm is volatile

Without the volatile attribute, compilers are entitled to optimize out
the same asm().  In the case of __udelay() in syscounter.c, it calls
`get_ticks()` twice, one for the starting time and the second in the
loop to check the current time.  When compilers inline `get_ticks()`
they see the same `mrrc` instructions and optimize out the second one.
This leads to infinite loop since we don't get updated value from the
system counter.

Here is a portion of the disassembly of __udelay:

  88:	428b  	cmp	r3, r1
  8a:	f8ce 20a4 	str.w	r2, [lr, #164]	; 0xa4
  8e:	bf08  	it	eq
  90:	4282  	cmpeq	r2, r0
  92:	f8ce 30a0 	str.w	r3, [lr, #160]	; 0xa0
  96:	d3f7  	bcc.n	88 <__udelay+0x88>
  98:	e8bd 8cf0 	ldmia.w	sp!, {r4, r5, r6, r7, sl, fp, pc}

Note that final jump / loop at 96 to 88, we don't have any `mrrc`.

With a volatile attribute, the above changes to this:

  8a:	ec53 2f0e 	mrrc	15, 0, r2, r3, cr14
  8e:	42ab  	cmp	r3, r5
  90:	f8c1 20a4 	str.w	r2, [r1, #164]	; 0xa4
  94:	bf08  	it	eq
  96:	42a2  	cmpeq	r2, r4
  98:	f8c1 30a0 	str.w	r3, [r1, #160]	; 0xa0
  9c:	d3f5  	bcc.n	8a <__udelay+0x8a>
  9e:	e8bd 8cf0 	ldmia.w	sp!, {r4, r5, r6, r7, sl, fp, pc}
  a2:	bf00  	nop

I'm advised to put volatile on all asm(), so this commit also adds it
to the asm() in timer_init().
---
 arch/arm/mach-imx/syscounter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/syscounter.c b/arch/arm/mach-imx/syscounter.c
index 9290918dca..1d4ebfe343 100644
--- a/arch/arm/mach-imx/syscounter.c
+++ b/arch/arm/mach-imx/syscounter.c
@@ -62,7 +62,7 @@ int timer_init(void)
 	unsigned long val, freq;
 
 	freq = CONFIG_SC_TIMER_CLK;
-	asm("mcr p15, 0, %0, c14, c0, 0" : : "r" (freq));
+	asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (freq));
 
 	writel(freq, >cntfid0);
 
@@ -82,7 +82,7 @@ unsigned long long get_ticks(void)
 {
 	unsigned long long now;
 
-	asm("mrrc p15, 0, %Q0, %R0, c14" : "=r" (now));
+	asm volatile("mrrc p15, 0, %Q0, %R0, c14" : "=r" (now));
 
 	gd->arch.tbl = (unsigned long)(now & 0x);
 	gd->arch.tbu = (unsigned long)(now >> 32);
-- 
2.16.2

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


[U-Boot] [PATCH][Boards Need to Switch DM] spi: atmel: Full dm conversion

2018-03-06 Thread Jagan Teki
atmel_spi now support dt along with platform data,
respective boards need to switch into dm for the same.

Signed-off-by: Jagan Teki 
---
 drivers/spi/atmel_spi.c  | 294 +++
 include/dm/platform_data/spi_atmel.h |  17 ++
 2 files changed, 69 insertions(+), 242 deletions(-)
 create mode 100644 include/dm/platform_data/spi_atmel.h

diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index 8010ab434c..0bd395bb4a 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -12,240 +12,31 @@
 #include 
 
 #include 
-
 #include 
 #include 
-#ifdef CONFIG_DM_SPI
 #include 
-#endif
-#ifdef CONFIG_DM_GPIO
 #include 
-#endif
+
+#include 
 
 #include "atmel_spi.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifndef CONFIG_DM_SPI
-
-static int spi_has_wdrbt(struct atmel_spi_slave *slave)
-{
-   unsigned int ver;
-
-   ver = spi_readl(slave, VERSION);
-
-   return (ATMEL_SPI_VERSION_REV(ver) >= 0x210);
-}
-
-void spi_init()
-{
-
-}
-
-struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
-   unsigned int max_hz, unsigned int mode)
-{
-   struct atmel_spi_slave  *as;
-   unsigned intscbr;
-   u32 csrx;
-   void*regs;
-
-   if (!spi_cs_is_valid(bus, cs))
-   return NULL;
-
-   switch (bus) {
-   case 0:
-   regs = (void *)ATMEL_BASE_SPI0;
-   break;
-#ifdef ATMEL_BASE_SPI1
-   case 1:
-   regs = (void *)ATMEL_BASE_SPI1;
-   break;
-#endif
-#ifdef ATMEL_BASE_SPI2
-   case 2:
-   regs = (void *)ATMEL_BASE_SPI2;
-   break;
-#endif
-#ifdef ATMEL_BASE_SPI3
-   case 3:
-   regs = (void *)ATMEL_BASE_SPI3;
-   break;
-#endif
-   default:
-   return NULL;
-   }
-
-
-   scbr = (get_spi_clk_rate(bus) + max_hz - 1) / max_hz;
-   if (scbr > ATMEL_SPI_CSRx_SCBR_MAX)
-   /* Too low max SCK rate */
-   return NULL;
-   if (scbr < 1)
-   scbr = 1;
-
-   csrx = ATMEL_SPI_CSRx_SCBR(scbr);
-   csrx |= ATMEL_SPI_CSRx_BITS(ATMEL_SPI_BITS_8);
-   if (!(mode & SPI_CPHA))
-   csrx |= ATMEL_SPI_CSRx_NCPHA;
-   if (mode & SPI_CPOL)
-   csrx |= ATMEL_SPI_CSRx_CPOL;
-
-   as = spi_alloc_slave(struct atmel_spi_slave, bus, cs);
-   if (!as)
-   return NULL;
-
-   as->regs = regs;
-   as->mr = ATMEL_SPI_MR_MSTR | ATMEL_SPI_MR_MODFDIS
-   | ATMEL_SPI_MR_PCS(~(1 << cs) & 0xf);
-   if (spi_has_wdrbt(as))
-   as->mr |= ATMEL_SPI_MR_WDRBT;
-
-   spi_writel(as, CSR(cs), csrx);
-
-   return >slave;
-}
-
-void spi_free_slave(struct spi_slave *slave)
-{
-   struct atmel_spi_slave *as = to_atmel_spi(slave);
-
-   free(as);
-}
-
-int spi_claim_bus(struct spi_slave *slave)
-{
-   struct atmel_spi_slave *as = to_atmel_spi(slave);
-
-   /* Enable the SPI hardware */
-   spi_writel(as, CR, ATMEL_SPI_CR_SPIEN);
-
-   /*
-* Select the slave. This should set SCK to the correct
-* initial state, etc.
-*/
-   spi_writel(as, MR, as->mr);
-
-   return 0;
-}
-
-void spi_release_bus(struct spi_slave *slave)
-{
-   struct atmel_spi_slave *as = to_atmel_spi(slave);
-
-   /* Disable the SPI hardware */
-   spi_writel(as, CR, ATMEL_SPI_CR_SPIDIS);
-}
-
-int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
-   const void *dout, void *din, unsigned long flags)
-{
-   struct atmel_spi_slave *as = to_atmel_spi(slave);
-   unsigned intlen_tx;
-   unsigned intlen_rx;
-   unsigned intlen;
-   u32 status;
-   const u8*txp = dout;
-   u8  *rxp = din;
-   u8  value;
-
-   if (bitlen == 0)
-   /* Finish any previously submitted transfers */
-   goto out;
-
-   /*
-* TODO: The controller can do non-multiple-of-8 bit
-* transfers, but this driver currently doesn't support it.
-*
-* It's also not clear how such transfers are supposed to be
-* represented as a stream of bytes...this is a limitation of
-* the current SPI interface.
-*/
-   if (bitlen % 8) {
-   /* Errors always terminate an ongoing transfer */
-   flags |= SPI_XFER_END;
-   goto out;
-   }
-
-   len = bitlen / 8;
-
-   /*
-* The controller can do automatic CS control, but it is
-* somewhat quirky, and it doesn't really buy us much anyway
-* in the context of U-Boot.
-*/
-   if (flags & SPI_XFER_BEGIN) {
-   spi_cs_activate(slave);
-   /*
-* sometimes the RDR is not empty when we get here,
-* in theory that should not happen, but it 

Re: [U-Boot] [PATCHv2 1/2] dra7xx: Always enable UART1 and UART3 in early_padconf

2018-03-06 Thread Lokesh Vutla


On Wednesday 07 March 2018 05:32 AM, Tom Rini wrote:
> It is safe to always setup the pinmux for UART1 and UART3 to be used in
> early_padconf and then if these pins are needed later on, they will be
> re-muxed.  This allows us to drop the usage of CONFIG_CONS_INDEX here.

Reviewed-by: Lokesh Vutla 

Thanks and regards,
Lokesh

> 
> Cc: Lokesh Vutla 
> Signed-off-by: Tom Rini 
> ---
>  board/ti/dra7xx/mux_data.h | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/board/ti/dra7xx/mux_data.h b/board/ti/dra7xx/mux_data.h
> index b5dcaa584a24..32c9ecacce2a 100644
> --- a/board/ti/dra7xx/mux_data.h
> +++ b/board/ti/dra7xx/mux_data.h
> @@ -372,13 +372,10 @@ const struct pad_conf_entry dra71x_core_padconf_array[] 
> = {
>  };
>  
>  const struct pad_conf_entry early_padconf[] = {
> -#if (CONFIG_CONS_INDEX == 1)
>   {UART1_RXD, (PIN_INPUT_SLEW | M0)}, /* UART1_RXD */
>   {UART1_TXD, (PIN_INPUT_SLEW | M0)}, /* UART1_TXD */
> -#elif (CONFIG_CONS_INDEX == 3)
>   {UART3_RXD, (PIN_INPUT_SLEW | M0)}, /* UART3_RXD */
>   {UART3_TXD, (PIN_INPUT_SLEW | M0)}, /* UART3_TXD */
> -#endif
>   {I2C1_SDA, (PIN_INPUT | M0)},   /* I2C1_SDA */
>   {I2C1_SCL, (PIN_INPUT | M0)},   /* I2C1_SCL */
>  };
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [UBOOT PATCH v3] microblaze: wdt: Added Kconfig support for CONFIG_XILINX_TB_WATCHDOG

2018-03-06 Thread Vipul Kumar
This patch added Kconfig support for CONFIG_XILINX_TB_WATCHDOG
and enabled it in respective defconfig.

Signed-off-by: Vipul Kumar 
Signed-off-by: Siva Durga Prasad Paladugu 
---
Changes in v3:
- Removed select hw_watchdog
- Branch: u-boot-microblaze/kconfig
---
 configs/microblaze-generic_defconfig | 1 +
 drivers/watchdog/Kconfig | 6 ++
 include/configs/microblaze-generic.h | 1 -
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/configs/microblaze-generic_defconfig 
b/configs/microblaze-generic_defconfig
index 699dc44..fba3820 100644
--- a/configs/microblaze-generic_defconfig
+++ b/configs/microblaze-generic_defconfig
@@ -63,3 +63,4 @@ CONFIG_XILINX_AXIEMAC=y
 CONFIG_XILINX_EMACLITE=y
 CONFIG_SYS_NS16550=y
 CONFIG_XILINX_UARTLITE=y
+CONFIG_XILINX_TB_WATCHDOG=y
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index fc46b67..bd209fa 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -78,4 +78,10 @@ config WDT_ORION
   Select this to enable Orion watchdog timer, which can be found on 
some
   Marvell Armada chips.

+config XILINX_TB_WATCHDOG
+   bool "Xilinx watchdog timer support"
+   depends on MICROBLAZE && !SPL_BUILD
+   help
+ Available for Xilinx Axi platforms to service timebase watchdog timer.
+
 endmenu
diff --git a/include/configs/microblaze-generic.h 
b/include/configs/microblaze-generic.h
index 73c3c2a..391b26a 100644
--- a/include/configs/microblaze-generic.h
+++ b/include/configs/microblaze-generic.h
@@ -50,7 +50,6 @@
 # define CONFIG_WATCHDOG_IRQ   XILINX_WATCHDOG_IRQ
 # ifndef CONFIG_SPL_BUILD
 #  define CONFIG_HW_WATCHDOG
-#  define CONFIG_XILINX_TB_WATCHDOG
 # endif
 #endif

--
2.7.4

This email and any attachments are intended for the sole use of the named 
recipient(s) and contain(s) confidential information that may be proprietary, 
privileged or copyrighted under applicable law. If you are not the intended 
recipient, do not read, copy, or forward this email message or any attachments. 
Delete this email message and any attachments immediately.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH][Boards Need to Switch DM] spi: davinci: Full dm conversion

2018-03-06 Thread Jagan Teki
davinci_spi now support dt along with platform data,
respective boards need to switch into dm for the same.

Signed-off-by: Jagan Teki 
---
 drivers/spi/Kconfig|  12 +-
 drivers/spi/davinci_spi.c  | 275 +
 include/dm/platform_data/spi_davinci.h |  15 ++
 3 files changed, 90 insertions(+), 212 deletions(-)
 create mode 100644 include/dm/platform_data/spi_davinci.h

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 2f231fc12b..589484fba0 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -70,6 +70,12 @@ config CADENCE_QSPI
  used to access the SPI NOR flash on platforms embedding this
  Cadence IP core.
 
+config DAVINCI_SPI
+   bool "Davinci & Keystone SPI driver"
+   depends on ARCH_DAVINCI || ARCH_KEYSTONE
+   help
+ Enable the Davinci SPI driver
+
 config DESIGNWARE_SPI
bool "Designware SPI driver"
help
@@ -246,12 +252,6 @@ config FSL_QSPI
  used to access the SPI NOR flash on platforms embedding this
  Freescale IP core.
 
-config DAVINCI_SPI
-   bool "Davinci & Keystone SPI driver"
-   depends on ARCH_DAVINCI || ARCH_KEYSTONE
-   help
- Enable the Davinci SPI driver
-
 config SH_SPI
bool "SuperH SPI driver"
help
diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
index eda252d0b3..8fa5a22c78 100644
--- a/drivers/spi/davinci_spi.c
+++ b/drivers/spi/davinci_spi.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /* SPIGCR0 */
 #define SPIGCR0_SPIENA_MASK0x1
@@ -119,9 +120,6 @@ struct davinci_spi_regs {
 
 /* davinci spi slave */
 struct davinci_spi_slave {
-#ifndef CONFIG_DM_SPI
-   struct spi_slave slave;
-#endif
struct davinci_spi_regs *regs;
unsigned int freq; /* current SPI bus frequency */
unsigned int mode; /* current SPI mode used */
@@ -241,11 +239,43 @@ static int davinci_spi_read_write(struct 
davinci_spi_slave *ds, unsigned
return 0;
 }
 
+static int davinci_spi_set_speed(struct udevice *bus, uint max_hz)
+{
+   struct davinci_spi_slave *ds = dev_get_priv(bus);
+
+   debug("%s speed %u\n", __func__, max_hz);
+   if (max_hz > CONFIG_SYS_SPI_CLK / 2)
+   return -EINVAL;
 
-static int __davinci_spi_claim_bus(struct davinci_spi_slave *ds, int cs)
+   ds->freq = max_hz;
+
+   return 0;
+}
+
+static int davinci_spi_set_mode(struct udevice *bus, uint mode)
 {
+   struct davinci_spi_slave *ds = dev_get_priv(bus);
+
+   debug("%s mode %u\n", __func__, mode);
+   ds->mode = mode;
+
+   return 0;
+}
+
+static int davinci_spi_claim_bus(struct udevice *dev)
+{
+   struct dm_spi_slave_platdata *slave_plat =
+   dev_get_parent_platdata(dev);
+   struct udevice *bus = dev->parent;
+   struct davinci_spi_slave *ds = dev_get_priv(bus);
unsigned int mode = 0, scalar;
 
+   if (slave_plat->cs >= ds->num_cs) {
+   printf("Invalid SPI chipselect\n");
+   return -EINVAL;
+   }
+   ds->half_duplex = slave_plat->mode & SPI_PREAMBLE;
+
/* Enable the SPI hardware */
writel(SPIGCR0_SPIRST_MASK, >regs->gcr0);
udelay(1000);
@@ -255,7 +285,7 @@ static int __davinci_spi_claim_bus(struct davinci_spi_slave 
*ds, int cs)
writel(SPIGCR1_MASTER_MASK | SPIGCR1_CLKMOD_MASK, >regs->gcr1);
 
/* CS, CLK, SIMO and SOMI are functional pins */
-   writel(((1 << cs) | SPIPC0_CLKFUN_MASK |
+   writel(((1 << slave_plat->cs) | SPIPC0_CLKFUN_MASK |
SPIPC0_DOFUN_MASK | SPIPC0_DIFUN_MASK), >regs->pc0);
 
/* setup format */
@@ -293,20 +323,32 @@ static int __davinci_spi_claim_bus(struct 
davinci_spi_slave *ds, int cs)
return 0;
 }
 
-static int __davinci_spi_release_bus(struct davinci_spi_slave *ds)
+static int davinci_spi_release_bus(struct udevice *dev)
 {
+   struct davinci_spi_slave *ds = dev_get_priv(dev->parent);
+
/* Disable the SPI hardware */
writel(SPIGCR0_SPIRST_MASK, >regs->gcr0);
 
return 0;
 }
 
-static int __davinci_spi_xfer(struct davinci_spi_slave *ds,
-   unsigned int bitlen,  const void *dout, void *din,
-   unsigned long flags)
+static int davinci_spi_xfer(struct udevice *dev, unsigned int bitlen,
+   const void *dout, void *din,
+   unsigned long flags)
 {
+   struct dm_spi_slave_platdata *slave =
+   dev_get_parent_platdata(dev);
+   struct udevice *bus = dev->parent;
+   struct davinci_spi_slave *ds = dev_get_priv(bus);
unsigned int len;
 
+   if (slave->cs >= ds->num_cs) {
+   printf("Invalid SPI chipselect\n");
+   return -EINVAL;
+   }
+   ds->cur_cs = slave->cs;
+
if (bitlen == 0)
/* Finish any previously submitted transfers */
goto out;

[U-Boot] [PATCH] spi: atcspi200: Drop non-dm code

2018-03-06 Thread Jagan Teki
Boards adp-ae3xx_defconfig, nx25-ae250_defconfig
already enabled DM_SPI, so non-dm code make no use
of it hence droped.

Signed-off-by: Jagan Teki 
---
 drivers/spi/Kconfig | 14 
 drivers/spi/atcspi200_spi.c | 87 -
 2 files changed, 7 insertions(+), 94 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 56c337f664..2f231fc12b 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -23,6 +23,13 @@ config ALTERA_SPI
  IP core. Please find details on the "Embedded Peripherals IP
  User Guide" of Altera.
 
+config ATCSPI200_SPI
+   bool "Andestech ATCSPI200 SPI driver"
+   help
+ Enable the Andestech ATCSPI200 SPI driver. This driver can be
+ used to access the SPI flash on AE3XX and AE250 platforms embedding
+ this Andestech IP core.
+
 config ATH79_SPI
bool "Atheros SPI driver"
depends on ARCH_ATH79
@@ -239,13 +246,6 @@ config FSL_QSPI
  used to access the SPI NOR flash on platforms embedding this
  Freescale IP core.
 
-config ATCSPI200_SPI
-   bool "Andestech ATCSPI200 SPI driver"
-   help
- Enable the Andestech ATCSPI200 SPI driver. This driver can be
- used to access the SPI flash on AE3XX and AE250 platforms embedding
- this Andestech IP core.
-
 config DAVINCI_SPI
bool "Davinci & Keystone SPI driver"
depends on ARCH_DAVINCI || ARCH_KEYSTONE
diff --git a/drivers/spi/atcspi200_spi.c b/drivers/spi/atcspi200_spi.c
index 5b2e9d6264..bc08914b9e 100644
--- a/drivers/spi/atcspi200_spi.c
+++ b/drivers/spi/atcspi200_spi.c
@@ -75,9 +75,6 @@ struct atcspi200_spi_regs {
 };
 
 struct nds_spi_slave {
-#ifndef CONFIG_DM_SPI
-   struct spi_slave slave;
-#endif
volatile struct atcspi200_spi_regs *regs;
int to;
unsigned intfreq;
@@ -286,89 +283,6 @@ static int __atcspi200_spi_xfer(struct nds_spi_slave *ns,
return ret;
 }
 
-#ifndef CONFIG_DM_SPI
-#define to_nds_spi_slave(s) container_of(s, struct nds_spi_slave, slave)
-struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
-   unsigned int max_hz, unsigned int mode)
-{
-   struct nds_spi_slave *ns;
-
-   if (!spi_cs_is_valid(bus, cs))
-   return NULL;
-
-   ns = spi_alloc_slave(struct nds_spi_slave, bus, cs);
-   if (!ns)
-   return NULL;
-
-   switch (bus) {
-   case SPI0_BUS:
-   ns->regs = (struct atcspi200_spi_regs *)SPI0_BASE;
-   break;
-
-   case SPI1_BUS:
-   ns->regs = (struct atcspi200_spi_regs *)SPI1_BASE;
-   break;
-
-   default:
-   return NULL;
-   }
-
-   ns->freq= max_hz;
-   ns->mode = mode;
-   ns->to = SPI_TIMEOUT;
-   ns->max_transfer_length = MAX_TRANSFER_LEN;
-   ns->slave.max_write_size = MAX_TRANSFER_LEN;
-
-   return >slave;
-}
-
-void spi_free_slave(struct spi_slave *slave)
-{
-   struct nds_spi_slave *ns = to_nds_spi_slave(slave);
-   free(ns);
-}
-
-void spi_init(void)
-{
-   /* do nothing */
-}
-
-int spi_claim_bus(struct spi_slave *slave)
-{
-   struct nds_spi_slave *ns = to_nds_spi_slave(slave);
-   return __atcspi200_spi_claim_bus(ns);
-}
-
-void spi_release_bus(struct spi_slave *slave)
-{
-   struct nds_spi_slave *ns = to_nds_spi_slave(slave);
-   __atcspi200_spi_release_bus(ns);
-}
-
-int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void 
*data_out,
-   void *data_in, unsigned long flags)
-{
-   struct nds_spi_slave *ns = to_nds_spi_slave(slave);
-   return __atcspi200_spi_xfer(ns, bitlen, data_out, data_in, flags);
-}
-
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
-   return bus == 0 && cs < NSPI_MAX_CS_NUM;
-}
-
-void spi_cs_activate(struct spi_slave *slave)
-{
-   struct nds_spi_slave *ns = to_nds_spi_slave(slave);
-   __atcspi200_spi_start(ns);
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
-   struct nds_spi_slave *ns = to_nds_spi_slave(slave);
-   __atcspi200_spi_stop(ns);
-}
-#else
 static int atcspi200_spi_set_speed(struct udevice *bus, uint max_hz)
 {
struct nds_spi_slave *ns = dev_get_priv(bus);
@@ -496,4 +410,3 @@ U_BOOT_DRIVER(atcspi200_spi) = {
.priv_auto_alloc_size = sizeof(struct nds_spi_slave),
.probe = atcspi200_spi_probe,
 };
-#endif
-- 
2.14.3

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


[U-Boot] [PATCH v2 2/2][Boards Need to Switch DM] spi: omap3_spi: Full dm conversion

2018-03-06 Thread Jagan Teki
omap3_spi now support dt along with platform data,
respective boards need to switch into dm for the same.

Signed-off-by: Jagan Teki 
---
Changes for v2:
- Fixes omap3_spi_ofdata_to_platdata, build 

 drivers/spi/Kconfig  |  14 +-
 drivers/spi/omap3_spi.c  | 342 +++
 include/dm/platform_data/spi_omap3.h |  16 ++
 3 files changed, 125 insertions(+), 247 deletions(-)
 create mode 100644 include/dm/platform_data/spi_omap3.h

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index fd3f115ccf..56c337f664 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -99,6 +99,13 @@ config MVEBU_A3700_SPI
  used to access the SPI NOR flash on platforms embedding this
  Marvell IP core.
 
+config OMAP3_SPI
+   bool "McSPI driver for OMAP"
+   help
+ SPI master controller for OMAP24XX and later Multichannel SPI
+ (McSPI). This driver be used to access SPI chips on platforms
+ embedding this OMAP3 McSPI IP core.
+
 config PIC32_SPI
bool "Microchip PIC32 SPI driver"
depends on MACH_PIC32
@@ -291,11 +298,4 @@ config MXS_SPI
  Enable the MXS SPI controller driver. This driver can be used
  on the i.MX23 and i.MX28 SoCs.
 
-config OMAP3_SPI
-   bool "McSPI driver for OMAP"
-   help
- SPI master controller for OMAP24XX and later Multichannel SPI
- (McSPI). This driver be used to access SPI chips on platforms
- embedding this OMAP3 McSPI IP core.
-
 endmenu # menu "SPI Support"
diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c
index b8a0bf495a..a6f1533985 100644
--- a/drivers/spi/omap3_spi.c
+++ b/drivers/spi/omap3_spi.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -109,9 +110,6 @@ struct mcspi {
 };
 
 struct omap3_spi_priv {
-#ifndef CONFIG_DM_SPI
-   struct spi_slave slave;
-#endif
struct mcspi *regs;
unsigned int cs;
unsigned int freq;
@@ -312,12 +310,16 @@ static int omap3_spi_txrx(struct omap3_spi_priv *priv, 
unsigned int len,
return 0;
 }
 
-static int _spi_xfer(struct omap3_spi_priv *priv, unsigned int bitlen,
-const void *dout, void *din, unsigned long flags)
+static int omap3_spi_xfer(struct udevice *dev, unsigned int bitlen,
+ const void *dout, void *din, unsigned long flags)
 {
-   unsigned intlen;
+   struct udevice *bus = dev->parent;
+   struct omap3_spi_priv *priv = dev_get_priv(bus);
+   struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+   unsigned int len;
int ret = -1;
 
+   priv->cs = slave_plat->cs;
if (priv->wordlen < 4 || priv->wordlen > 32) {
printf("omap3_spi: invalid wordlen %d\n", priv->wordlen);
return -1;
@@ -353,78 +355,6 @@ static int _spi_xfer(struct omap3_spi_priv *priv, unsigned 
int bitlen,
return ret;
 }
 
-static void _omap3_spi_set_speed(struct omap3_spi_priv *priv)
-{
-   uint32_t confr, div = 0;
-
-   confr = readl(>regs->channel[priv->cs].chconf);
-
-   /* Calculate clock divisor. Valid range: 0x0 - 0xC ( /1 - /4096 ) */
-   if (priv->freq) {
-   while (div <= 0xC && (OMAP3_MCSPI_MAX_FREQ / (1 << div))
-   > priv->freq)
-   div++;
-   } else {
-div = 0xC;
-   }
-
-   /* set clock divisor */
-   confr &= ~OMAP3_MCSPI_CHCONF_CLKD_MASK;
-   confr |= div << 2;
-
-   omap3_spi_write_chconf(priv, confr);
-}
-
-static void _omap3_spi_set_mode(struct omap3_spi_priv *priv)
-{
-   uint32_t confr;
-
-   confr = readl(>regs->channel[priv->cs].chconf);
-
-   /* standard 4-wire master mode:  SCK, MOSI/out, MISO/in, nCS
-* REVISIT: this controller could support SPI_3WIRE mode.
-*/
-   if (priv->pin_dir == MCSPI_PINDIR_D0_IN_D1_OUT) {
-   confr &= ~(OMAP3_MCSPI_CHCONF_IS|OMAP3_MCSPI_CHCONF_DPE1);
-   confr |= OMAP3_MCSPI_CHCONF_DPE0;
-   } else {
-   confr &= ~OMAP3_MCSPI_CHCONF_DPE0;
-   confr |= OMAP3_MCSPI_CHCONF_IS|OMAP3_MCSPI_CHCONF_DPE1;
-   }
-
-   /* set SPI mode 0..3 */
-   confr &= ~(OMAP3_MCSPI_CHCONF_POL | OMAP3_MCSPI_CHCONF_PHA);
-   if (priv->mode & SPI_CPHA)
-   confr |= OMAP3_MCSPI_CHCONF_PHA;
-   if (priv->mode & SPI_CPOL)
-   confr |= OMAP3_MCSPI_CHCONF_POL;
-
-   /* set chipselect polarity; manage with FORCE */
-   if (!(priv->mode & SPI_CS_HIGH))
-   confr |= OMAP3_MCSPI_CHCONF_EPOL; /* active-low; normal */
-   else
-   confr &= ~OMAP3_MCSPI_CHCONF_EPOL;
-
-   /* Transmit & receive mode */
-   confr &= ~OMAP3_MCSPI_CHCONF_TRM_MASK;
-
-   omap3_spi_write_chconf(priv, confr);
-}
-
-static void _omap3_spi_set_wordlen(struct 

[U-Boot] [PATCH v2 1/2] spi: omap3: Skip set_mode, set_speed from claim

2018-03-06 Thread Jagan Teki
set_mode, set_seed functions has separate function pointers
in dm_spi_ops, so use them in relevent one instead of
calling from claim_bus.

Signed-off-by: Jagan Teki 
---
Changes for v2:
- None

 drivers/spi/omap3_spi.c | 21 -
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c
index 1da4542af0..b8a0bf495a 100644
--- a/drivers/spi/omap3_spi.c
+++ b/drivers/spi/omap3_spi.c
@@ -456,9 +456,6 @@ static void _omap3_spi_claim_bus(struct omap3_spi_priv 
*priv)
conf |= OMAP3_MCSPI_MODULCTRL_SINGLE;
 
writel(conf, >regs->modulctrl);
-
-   _omap3_spi_set_mode(priv);
-   _omap3_spi_set_speed(priv);
 }
 
 #ifndef CONFIG_DM_SPI
@@ -594,8 +591,6 @@ static int omap3_spi_claim_bus(struct udevice *dev)
struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
 
priv->cs = slave_plat->cs;
-   priv->mode = slave_plat->mode;
-   priv->freq = slave_plat->max_hz;
_omap3_spi_claim_bus(priv);
 
return 0;
@@ -652,11 +647,27 @@ static int omap3_spi_xfer(struct udevice *dev, unsigned 
int bitlen,
 
 static int omap3_spi_set_speed(struct udevice *bus, unsigned int speed)
 {
+   struct udevice *bus = dev->parent;
+   struct omap3_spi_priv *priv = dev_get_priv(bus);
+   struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+
+   priv->cs = slave_plat->cs;
+   priv->freq = slave_plat->max_hz;
+   _omap3_spi_set_speed(priv);
+
return 0;
 }
 
 static int omap3_spi_set_mode(struct udevice *bus, uint mode)
 {
+   struct udevice *bus = dev->parent;
+   struct omap3_spi_priv *priv = dev_get_priv(bus);
+   struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+
+   priv->cs = slave_plat->cs;
+   priv->mode = slave_plat->mode;
+   _omap3_spi_set_mode(priv);
+
return 0;
 }
 
-- 
2.14.3

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


Re: [U-Boot] [PATCH 2/2][Boards Need to Switch DM] spi: omap3_spi: Full dm conversion

2018-03-06 Thread Jagan Teki
On Wed, Mar 7, 2018 at 5:46 AM, Adam Ford  wrote:
> On Tue, Mar 6, 2018 at 12:03 PM, Jagan Teki  wrote:
>> omap3_spi now support dt along with platform data,
>> respective boards need to switch into dm for the same.
>
> I applied both 1/2 and 2/2 patches and tested them together on omap3_logic.
>
> Without any changes to my config, this patch fails to build. That
> board has CONFIG_OMAP3_SPI=y by default.
>
> cmd/built-in.o: In function `do_spi_xfer':
> /home/aford/src/u-boot/cmd/spi.c:61: undefined reference to `spi_setup_slave'
> /home/aford/src/u-boot/cmd/spi.c:68: undefined reference to `spi_claim_bus'
> /home/aford/src/u-boot/cmd/spi.c:71: undefined reference to `spi_xfer'
> /home/aford/src/u-boot/cmd/spi.c:88: undefined reference to `spi_release_bus'
> /home/aford/src/u-boot/cmd/spi.c:90: undefined reference to `spi_free_slave'
> common/built-in.o: In function `jumptable_init':
> /home/aford/src/u-boot/common/exports.c:30: undefined reference to `spi_init'
> /home/aford/src/u-boot/common/exports.c:30: undefined reference to
> `spi_setup_slave'
> /home/aford/src/u-boot/common/exports.c:30: undefined reference to
> `spi_free_slave'
> /home/aford/src/u-boot/common/exports.c:30: undefined reference to
> `spi_claim_bus'
> /home/aford/src/u-boot/common/exports.c:30: undefined reference to
> `spi_release_bus'
> /home/aford/src/u-boot/common/exports.c:30: undefined reference to `spi_xfer'
> arm-linux-ld.bfd: BFD (GNU Binutils) 2.29.1 assertion fail elf32-arm.c:9509
> arm-linux-ld.bfd: BFD (GNU Binutils) 2.29.1 assertion fail elf32-arm.c:9509
> arm-linux-ld.bfd: BFD (GNU Binutils) 2.29.1 assertion fail elf32-arm.c:9509
> arm-linux-ld.bfd: BFD (GNU Binutils) 2.29.1 assertion fail elf32-arm.c:9509
> arm-linux-ld.bfd: BFD (GNU Binutils) 2.29.1 assertion fail elf32-arm.c:9509

This is expected, ie reason I've mentioned commit head 'Boards Need to
Switch DM'

>
> If seems to me like we at least should keep the non-DM version of the
> driver working in addition to the DM version until all the boards are
> migrated.

This migration seems not happening since from long, ie reason we
praposed deadline for migrating onto dm [1] So better to migrate
before deadline.

>
>
> Having said that, When I enabled DM_SPI and McSPI, I got the following errors:
>
>
>   CC  common/fdt_support.o
> drivers/spi/omap3_spi.c: In function ‘omap3_spi_ofdata_to_platdata’:
> drivers/spi/omap3_spi.c:537:34: error: ‘blob’ undeclared (first use in
> this function); did you mean ‘_log’?
>   plat->pin_dir = fdtdec_get_uint(blob, node, "ti,pindir-d0-out-d1-in",
>   ^~~~
>   _log
> drivers/spi/omap3_spi.c:537:34: note: each undeclared identifier is
> reported only once for each function it appears in
> drivers/spi/omap3_spi.c:537:40: error: ‘node’ undeclared (first use in
> this function); did you mean ‘ofnode’?
>   plat->pin_dir = fdtdec_get_uint(blob, node, "ti,pindir-d0-out-d1-in",
> ^~~~
> ofnode
> scripts/Makefile.build:280: recipe for target 'drivers/spi/omap3_spi.o' failed
> make[1]: *** [drivers/spi/omap3_spi.o] Error 1
> Makefile:1330: recipe for target 'drivers/spi' failed
>
> Any suggestions on how to proceed?

Yes, I'm sending v2 to fix these.

[1] 
http://u-boot.denx.narkive.com/BBRm2pZc/spi-zapping-non-dm-drivers-deadline-v2018-09
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/1] MAINTAINERS: bring sections into alphabetic order

2018-03-06 Thread Heinrich Schuchardt
NETWORK should be after NAND_FLASH.

Signed-off-by: Heinrich Schuchardt 
---
I missed some irregularities in my 1st patch
---
 MAINTAINERS | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index bf10f3aad8..d4900e000d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -59,12 +59,6 @@ S:   Maintained
 T: git git://git.denx.de/u-boot-arc.git
 F: arch/arc/
 
-ARC HSDK CREG GPIO
-M: Eugeniy Paltsev 
-S: Maintained
-L: uboot-snps-...@synopsys.com
-F: drivers/gpio/hsdk-creg-gpio.c
-
 ARC HSDK CGU CLOCK
 M: Eugeniy Paltsev 
 S: Maintained
@@ -73,6 +67,12 @@ F:   drivers/clk/clk-hsdk-cgu.c
 F: include/dt-bindings/clock/snps,hsdk-cgu.h
 F: doc/device-tree-bindings/clock/snps,hsdk-cgu.txt
 
+ARC HSDK CREG GPIO
+M: Eugeniy Paltsev 
+S: Maintained
+L: uboot-snps-...@synopsys.com
+F: drivers/gpio/hsdk-creg-gpio.c
+
 ARM
 M: Albert Aribaud 
 S: Maintained
@@ -185,6 +185,12 @@ M: Mateusz Kulikowski 
 S: Maintained
 F: arch/arm/mach-snapdragon/
 
+ARM STI
+M: Patrice Chotard 
+S: Maintained
+F: arch/arm/mach-sti/
+F: arch/arm/include/asm/arch-sti*/
+
 ARM STM SPEAR
 #M:Vipin Kumar 
 S: Orphaned (Since 2016-02)
@@ -198,12 +204,6 @@ S: Maintained
 F: arch/arm/cpu/armv7/stv0991/
 F: arch/arm/include/asm/arch-stv0991/
 
-ARM STI
-M: Patrice Chotard 
-S: Maintained
-F: arch/arm/mach-sti/
-F: arch/arm/include/asm/arch-sti*/
-
 ARM SUNXI
 M: Jagan Teki 
 M: Maxime Ripard 
@@ -354,13 +354,6 @@ S: Maintained
 T: git git://git.denx.de/u-boot-mmc.git
 F: drivers/mmc/
 
-NETWORK
-M: Joe Hershberger 
-S: Maintained
-T: git git://git.denx.de/u-boot-net.git
-F: drivers/net/
-F: net/
-
 NAND FLASH
 M: Scott Wood 
 S: Maintained
@@ -373,6 +366,13 @@ S: Maintained
 T: git git://git.denx.de/u-boot-nds32.git
 F: arch/nds32/
 
+NETWORK
+M: Joe Hershberger 
+S: Maintained
+T: git git://git.denx.de/u-boot-net.git
+F: drivers/net/
+F: net/
+
 NIOS
 M: Thomas Chou 
 S: Maintained
-- 
2.14.2

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


[U-Boot] [PATCH 1/1] net: mvpp2x: add check after calloc

2018-03-06 Thread Heinrich Schuchardt
After allocating plat the pointer is checked.
Afterwards name is allocated and not checked.

Add the missing check to avoid a possible NULL dereference.

Signed-off-by: Heinrich Schuchardt 
---
 drivers/net/mvpp2.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
index e3d31a560d..62c0c2be06 100644
--- a/drivers/net/mvpp2.c
+++ b/drivers/net/mvpp2.c
@@ -5598,6 +5598,10 @@ static int mvpp2_base_bind(struct udevice *parent)
id += base_id_add;
 
name = calloc(1, 16);
+   if (!name) {
+   free(plat);
+   return -ENOMEM;
+   }
sprintf(name, "mvpp2-%d", id);
 
/* Create child device UCLASS_ETH and bind it */
-- 
2.14.2

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


Re: [U-Boot] [PATCH RFC 1/2] ARM: sunxi: Move u-boot-sunxi-with-spl.bin rule to Makefile

2018-03-06 Thread André Przywara
Hi,

On 06/03/18 21:38, Tuomas Tynkkynen wrote:
> We're going to need this logic for 64-bit builds as well, so move it
> out from under arch/arm/cpu/armv7.
> 
> Signed-off-by: Tuomas Tynkkynen 

Reviewed-by: Andre Przywara 

Thanks!
Andre.

> ---
>  Makefile   | 5 +
>  arch/arm/cpu/armv7/sunxi/config.mk | 6 --
>  2 files changed, 5 insertions(+), 6 deletions(-)
>  delete mode 100644 arch/arm/cpu/armv7/sunxi/config.mk
> 
> diff --git a/Makefile b/Makefile
> index c6819d5742..24a79446d8 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -800,6 +800,11 @@ ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),)
>  ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
>  endif
>  
> +# Build a combined spl + u-boot image for sunxi
> +ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy)
> +ALL-y += u-boot-sunxi-with-spl.bin
> +endif
> +
>  # enable combined SPL/u-boot/dtb rules for tegra
>  ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
>  ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin
> diff --git a/arch/arm/cpu/armv7/sunxi/config.mk 
> b/arch/arm/cpu/armv7/sunxi/config.mk
> deleted file mode 100644
> index 76ffec9df6..00
> --- a/arch/arm/cpu/armv7/sunxi/config.mk
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -# Build a combined spl + u-boot image
> -ifdef CONFIG_SPL
> -ifndef CONFIG_SPL_BUILD
> -ALL-y += u-boot-sunxi-with-spl.bin
> -endif
> -endif
> 

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


Re: [U-Boot] [PATCH RFC 2/2] ARM: sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

2018-03-06 Thread André Przywara
Hi,

On 06/03/18 21:38, Tuomas Tynkkynen wrote:
> In README.sunxi64 we tell the user how to optionally create
> u-boot-sunxi-with-spl.bin by manually running cat. Instead, have the
> build system create the file automatically just like it does for 32-bit
> sunxi boards.
> 
> Signed-off-by: Tuomas Tynkkynen 

Reviewed-by: Andre Przywara 

Cheers,
Andre.

> ---
>  Makefile   | 5 +
>  board/sunxi/README.sunxi64 | 3 +--
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 24a79446d8..4b203a0155 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1191,8 +1191,13 @@ u-boot-x86-16bit.bin: u-boot FORCE
>  endif
>  
>  ifneq ($(CONFIG_ARCH_SUNXI),)
> +ifeq ($(CONFIG_ARM64),)
>  u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE
>   $(call if_changed,binman)
> +else
> +u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE
> + $(call if_changed,cat)
> +endif
>  endif
>  
>  ifneq ($(CONFIG_TEGRA),)
> diff --git a/board/sunxi/README.sunxi64 b/board/sunxi/README.sunxi64
> index c492f749b8..5a363d27b8 100644
> --- a/board/sunxi/README.sunxi64
> +++ b/board/sunxi/README.sunxi64
> @@ -95,9 +95,8 @@ Transfer the SPL and the U-Boot FIT image directly to an 
> uSD card:
>  (replace /dev/sdx with you SD card device file name, which could be
>  /dev/mmcblk[x] as well).
>  
> -Alternatively you can concatenate the SPL and the U-Boot FIT image into a
> +Alternatively you can use the SPL and the U-Boot FIT image combined into a
>  single file and transfer that instead:
> -$ cat spl/sunxi-spl.bin u-boot.itb > u-boot-sunxi-with-spl.bin
>  # dd if=u-boot-sunxi-with-spl.bin of=/dev/sdx bs=8k seek=1
>  
>  You can partition the microSD card, but leave the first MB unallocated (most
> 

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


Re: [U-Boot] [PATCH RFC 0/2] sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

2018-03-06 Thread André Przywara
Hi,

On 06/03/18 21:38, Tuomas Tynkkynen wrote:
> For some reason we seem to have documented how to build
> u-boot-sunxi-with-spl.bin manually with cat but not have a build system
> rule for it. Let's fix this to have the file built by default just like
> it is on 32-bit sunxi boards.

Ah, thanks a lot! Admittedly I was just too lazy to find out how this
works for the 32-bit boards, and how to pull this into the 64 bit builds
as well.

> Build-tested only.

I actually booted from an SD card and it works like a charm!
So thanks again for pulling this together.

Cheers,
Andre.

> 
> Tuomas Tynkkynen (2):
>   ARM: sunxi: Move u-boot-sunxi-with-spl.bin rule to Makefile
>   ARM: sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well
> 
>  Makefile   | 10 ++
>  arch/arm/cpu/armv7/sunxi/config.mk |  6 --
>  board/sunxi/README.sunxi64 |  3 +--
>  3 files changed, 11 insertions(+), 8 deletions(-)
>  delete mode 100644 arch/arm/cpu/armv7/sunxi/config.mk
> 

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


Re: [U-Boot] [PATCH 1/2] mmc: add HS400 support

2018-03-06 Thread Peng Fan

Hi Simon,

> -Original Message-
> From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass
> Sent: 2018年3月7日 1:42
> To: Peng Fan 
> Cc: Jaehoon Chung ; Stefano Babic
> ; U-Boot Mailing List ; Jean-Jacques
> Hiblot ; Kishon Vijay Abraham I ; Bin Meng
> 
> Subject: Re: [PATCH 1/2] mmc: add HS400 support
> 
> Hi Peng,
> 
> On 5 March 2018 at 02:11, Peng Fan  wrote:
> > Add HS400 support.
> > Selecting HS400 needs first select HS199 according to spec, so use a
> > dedicated function for HS400.
> > Add HS400 related macros.
> > Remove the restriction of only using the low 6 bits of
> > EXT_CSD_CARD_TYPE, using all the 8 bits.
> >
> > Signed-off-by: Peng Fan 
> > Cc: Jaehoon Chung 
> > Cc: Jean-Jacques Hiblot 
> > Cc: Stefano Babic 
> > Cc: Simon Glass 
> > Cc: Kishon Vijay Abraham I 
> > Cc: Bin Meng 
> > ---
> >  drivers/mmc/Kconfig |   7 +++
> >  drivers/mmc/mmc.c   | 133
> ++--
> >  include/mmc.h   |  12 +
> >  3 files changed, 127 insertions(+), 25 deletions(-)
> >
> > diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index
> > 5f67e336db..e9be18b333 100644
> > --- a/drivers/mmc/Kconfig
> > +++ b/drivers/mmc/Kconfig
> > @@ -104,6 +104,13 @@ config SPL_MMC_UHS_SUPPORT
> >   cards. The IO voltage must be switchable from 3.3v to 1.8v. The
> bus
> >   frequency can go up to 208MHz (SDR104)
> >
> > +config MMC_HS400_SUPPORT
> > +   bool "enable HS400 support"
> > +   select MMC_HS200_SUPPORT
> > +   help
> > + The HS400 mode is support by some eMMC. The bus frequency is
> up to
> > + 200MHz. This mode requires tuning the IO.
> > +
> >  config MMC_HS200_SUPPORT
> > bool "enable HS200 support"
> > help
> > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index
> > 92ea78b8af..eef229c8b4 100644
> > --- a/drivers/mmc/mmc.c
> > +++ b/drivers/mmc/mmc.c
> > @@ -169,6 +169,7 @@ const char *mmc_mode_name(enum bus_mode
> mode)
> >   [MMC_HS_52]   = "MMC High Speed (52MHz)",
> >   [MMC_DDR_52]  = "MMC DDR52 (52MHz)",
> >   [MMC_HS_200]  = "HS200 (200MHz)",
> > + [MMC_HS_400]  = "HS400 (200MHz)",
> > };
> >
> > if (mode >= MMC_MODES_END)
> > @@ -193,6 +194,7 @@ static uint mmc_mode2freq(struct mmc *mmc, enum
> bus_mode mode)
> >   [UHS_DDR50]   = 5000,
> >   [UHS_SDR104]  = 20800,
> >   [MMC_HS_200]  = 2,
> > + [MMC_HS_400]  = 2,
> > };
> >
> > if (mode == MMC_LEGACY)
> > @@ -790,6 +792,11 @@ static int mmc_set_card_speed(struct mmc *mmc,
> enum bus_mode mode)
> > case MMC_HS_200:
> > speed_bits = EXT_CSD_TIMING_HS200;
> > break;
> > +#endif
> > +#if CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)
> > +   case MMC_HS_400:
> > +   speed_bits = EXT_CSD_TIMING_HS400;
> > +   break;
> >  #endif
> > case MMC_LEGACY:
> > speed_bits = EXT_CSD_TIMING_LEGACY; @@ -837,7
> +844,7
> > @@ static int mmc_get_capabilities(struct mmc *mmc)
> >
> > mmc->card_caps |= MMC_MODE_4BIT | MMC_MODE_8BIT;
> >
> > -   cardtype = ext_csd[EXT_CSD_CARD_TYPE] & 0x3f;
> > +   cardtype = ext_csd[EXT_CSD_CARD_TYPE];
> > mmc->cardtype = cardtype;
> >
> >  #if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)
> > @@ -845,6 +852,12 @@ static int mmc_get_capabilities(struct mmc *mmc)
> > EXT_CSD_CARD_TYPE_HS200_1_8V)) {
> > mmc->card_caps |= MMC_MODE_HS200;
> > }
> > +#endif
> > +#if CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)
> 
> Is it possible to use if () instead of #if

Just want to keep the same code style in the file. How about use a dedicated 
patch to
cleanup the file after this patch?
Thanks,
Peng.

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


[U-Boot] [PATCH 1/1] efi_loader: parameter checks for LoadImage

2018-03-06 Thread Heinrich Schuchardt
Add parameter checks in efi_load_image().
Check memory allocation is successful in efi_load_image().

Signed-off-by: Heinrich Schuchardt 
---
 lib/efi_loader/efi_boottime.c | 20 
 1 file changed, 20 insertions(+)

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 6c7a2ebf95..1ff0568d47 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1573,8 +1573,27 @@ static efi_status_t EFIAPI efi_load_image(bool 
boot_policy,
EFI_ENTRY("%d, %p, %pD, %p, %ld, %p", boot_policy, parent_image,
  file_path, source_buffer, source_size, image_handle);
 
+   if (!image_handle || !parent_image) {
+   ret = EFI_INVALID_PARAMETER;
+   goto error;
+   }
+
+   if (!source_buffer && !file_path) {
+   ret = EFI_NOT_FOUND;
+   goto error;
+   }
+
info = calloc(1, sizeof(*info));
+   if (!info) {
+   ret = EFI_OUT_OF_RESOURCES;
+   goto error;
+   }
obj = calloc(1, sizeof(*obj));
+   if (!obj) {
+   free(info);
+   ret = EFI_OUT_OF_RESOURCES;
+   goto error;
+   }
 
if (!source_buffer) {
struct efi_device_path *dp, *fp;
@@ -1610,6 +1629,7 @@ static efi_status_t EFIAPI efi_load_image(bool 
boot_policy,
 failure:
free(info);
efi_delete_handle(obj);
+error:
return EFI_EXIT(ret);
 }
 
-- 
2.14.2

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


Re: [U-Boot] [PATCH v3 00/13] LS1012A PFE driver patch series

2018-03-06 Thread Calvin Johnson
Joe,

> -Original Message-
> From: U-Boot [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Joe
> Hershberger
> Sent: Wednesday, March 7, 2018 1:09 AM
> To: York Sun 
> Cc: Joe Hershberger ; Bhaskar Upadhaya
> ; Anji Jagarlmudi ; u-
> b...@lists.denx.de
> Subject: Re: [U-Boot] [PATCH v3 00/13] LS1012A PFE driver patch series
> 
> On Tue, Mar 6, 2018 at 10:28 AM, York Sun  wrote:
> > On 03/06/2018 06:28 AM, Calvin Johnson wrote:
> >> Hi Joe,
> >>
> >> Thanks for reviewing all the patches.
> >
> > Joe,
> >
> > Do you want to bring them in, or leave them to me?
> 
> I'll bring them in through my tree.
> 
> Calvin,
> 
> It seems we have an issue with the series.  Please have a look:
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftravis-
> ci.org%2Fjhershbe%2Fu-
> boot%2Fbuilds%2F349955957=02%7C01%7Ccalvin.johnson%40nxp.com%7C
> c9c0274c79314e401a3808d58399f600%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C
> 0%7C0%7C636559619645909270=JBjuSIsksYnir2qNkMqzJqjlkBFSrpF62nS5B
> FcvU7M%3D=0

Sorry, I had missed ls1012ardb_qspi_SECURE_BOOT_defconfig and this is causing 
the problem.
Working towards fixing this.

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


Re: [U-Boot] [RFC 1/1] dm: video: tegra124: incorrect logical condition

2018-03-06 Thread Heinrich Schuchardt
On 03/06/2018 11:08 AM, Anatolij Gustschin wrote:
> Hi all,
> 
> On Wed, 31 Jan 2018 01:16:07 +0100
> Heinrich Schuchardt xypron.g...@gmx.de wrote:
> 
>> 2 << 24 | A is always true. To use check against a bitmask we need &.
> 
> it is always true, but here we are not checking against a bitmask, so
> the patch is wrong.
> 
> We set or clear register bit (depending on 'is_lvds' value) together
> with another register bits for ROTCLK config.
> 
> So, I think the code should be
> 
> 2 << CSTM_ROTCLK_SHIFT |
> (is_lvds ? CSTM_LVDS_EN_ENABLE : CSTM_LVDS_EN_DISABLE)

Yes, it could be that the author just didn't consider operator
precedence in patch 00f37327524.

tegra_dc_sor_enable_lane_sequencer(), tegra_dc_sor_power_up(), and
tegra_dc_sor_config_panel() are only called with is_lvds = 0.
We might want to eleminate the parameter.

The U-Boot lines in question relate to Linux kernel
drivers/gpu/drm/tegra/hdmi.c:

value = tegra_hdmi_readl(hdmi, HDMI_NV_PDISP_SOR_CSTM);
value &= ~SOR_CSTM_ROTCLK(~0);
value |= SOR_CSTM_ROTCLK(2);
value |= SOR_CSTM_PLLDIV;
value &= ~SOR_CSTM_LVDS_ENABLE;
value &= ~SOR_CSTM_MODE_MASK;
value |= SOR_CSTM_MODE_TMDS;
tegra_hdmi_writel(hdmi, value, HDMI_NV_PDISP_SOR_CSTM);

The kernel code only uses the disabling of LVDS. And yes it is used in
conjunction with the 2 << CSTM_ROTCLK_SHIFT (== SOR_CSTM_ROTCLK(2)) bit.

With the change that you suggested we would flip both bits to the values
used by the kernel.

Patch 00f37327524 was about adding support for eDP LCD panels.
So probably the author wanted to disable LVDS here.

Regards

Heinrich

> 
> But I do not have the hardware to test. Maybe Simon ?
> 
>> Identified with cppcheck.
>>
>> Signed-off-by: Heinrich Schuchardt 
>> ---
>> I do not have the hardware available. But the current coding is fishy.
>>
>> Please, clarify what should be coded here.
>> ---
>>  drivers/video/tegra124/sor.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/video/tegra124/sor.c b/drivers/video/tegra124/sor.c
>> index 700ab25d46..4b3381fae2 100644
>> --- a/drivers/video/tegra124/sor.c
>> +++ b/drivers/video/tegra124/sor.c
>> @@ -669,7 +669,7 @@ static void tegra_dc_sor_config_panel(struct 
>> tegra_dc_sor_data *sor,
>>  tegra_sor_write_field(sor, CSTM,
>>CSTM_ROTCLK_DEFAULT_MASK |
>>CSTM_LVDS_EN_ENABLE,
>> -  2 << CSTM_ROTCLK_SHIFT |
>> +  2 << CSTM_ROTCLK_SHIFT &
>>is_lvds ? CSTM_LVDS_EN_ENABLE :
>>CSTM_LVDS_EN_DISABLE);
>>  
> 
> Thanks,
> 
> Anatolij
> 

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


[U-Boot] [PATCH 2/2] boot: script: The boot.scr file for K+P's boards

2018-03-06 Thread Lukasz Majewski
By using this file one can avoid cluttering .h file with u-boot
HUSH commands necessary for booting target device.

With such approach the commands are stored only in one place and can be
reused if needed.

Signed-off-by: Lukasz Majewski 

---

 board/k+p/bootscripts/tpcboot.cmd | 96 +++
 1 file changed, 96 insertions(+)
 create mode 100644 board/k+p/bootscripts/tpcboot.cmd

diff --git a/board/k+p/bootscripts/tpcboot.cmd 
b/board/k+p/bootscripts/tpcboot.cmd
new file mode 100644
index 00..f6d59a1186
--- /dev/null
+++ b/board/k+p/bootscripts/tpcboot.cmd
@@ -0,0 +1,96 @@
+#
+# Copyright (C) 2018
+# Lukasz Majewski, DENX Software Engineering, lu...@denx.de
+#
+#
+# This is an example file to generate boot.scr - a boot script for U-Boot
+# Generate boot.scr:
+# ./tools/mkimage -c none -A arm -T script -d tpcboot.cmd boot.scr
+#
+# SPDX-License-Identifier: GPL-2.0+
+
+
+# Input envs (to be set in environment)
+# Mandatory:
+# kernel_file = "fitImage"
+# boardname = ""  // set automatically in u-boot
+# boardsoc = "imx6q"  // set automatically in u-boot
+#
+# Optional:
+# bootcmd_force = "nfs" "tftp_kernel"
+# If not set - eMMC/SD boot
+
+# Generic setup
+setenv mmcroot "/dev/mmcblk${devnum}p2 rootwait rw"
+setenv displayargs ""
+setenv mmcargs "setenv bootargs console=${console} ${smp} root=${mmcroot} \
+   ${displayargs}"
+setenv boot_fitImage "
+   setenv fdt_conf 'conf@${boardsoc}-${boardname}.dtb';
+   setenv itbcfg "\"#\${fdt_conf}\"";
+   print itbcfg;
+   bootm '${loadaddr}${itbcfg}';"
+
+#
+#
+# Provide default 'bootcmd' command
+#
+setenv bootcmd "
+if test -e ${devtype} ${devnum}:${distro_bootpart} ${kernel_file}; then
+   echo Found kernel image: ${kernel_file};
+   if load ${devtype} ${devnum}:${distro_bootpart} ${loadaddr} \
+  ${kernel_file}; then
+   run mmcargs;
+   run boot_fitImage;
+   fi;
+fi;"
+
+#
+#
+# Provide 'boot_tftp_kernel' command
+#
+setenv download_kernel "tftpboot ${loadaddr} ${kernel_file}"
+
+setenv boot_tftp_kernel "
+if run download_kernel; then
+   run mmcargs;
+   run boot_fitImage;
+fi"
+
+#
+#
+# Provide 'boot_nfs' command
+#
+setenv rootpath "/srv/tftp/KP/rootfs"
+setenv nfsargs "setenv bootargs root=/dev/nfs rw \
+   nfsroot=${serverip}:${rootpath},nolock,nfsvers=3"
+setenv addip "setenv bootargs ${bootargs} \
+   ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:\
+   ${hostname}:eth0:on"
+
+setenv boot_nfs "
+if run download_kernel; then
+   run nfsargs;
+   run addip;
+   setenv bootargs ${bootargs} console=${console};
+
+   run boot_fitImage;
+fi"
+
+#
+#
+# Set correct boot flow
+#
+
+setenv bcmd "
+if test ! -n ${bootcmd_force}; then
+   run bootcmd;
+fi;
+if test ${bootcmd_force} = nfs; then
+   run boot_nfs;
+else if test ${bootcmd_force} = tftp_kernel; then
+   run boot_tftp_kernel;
+ fi;
+fi"
+
+run bcmd
-- 
2.11.0

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


[U-Boot] [PATCH 1/2] imx: board: Add support for the K+P's kp_imx6q_tpc board

2018-03-06 Thread Lukasz Majewski
This commit provides support for Kieback & Peter GmbH IMX6Q based
TPC board.

Signed-off-by: Lukasz Majewski 

---

 arch/arm/mach-imx/mx6/Kconfig |  11 ++
 board/k+p/kp_imx6q_tpc/Kconfig|  12 ++
 board/k+p/kp_imx6q_tpc/MAINTAINERS|   6 +
 board/k+p/kp_imx6q_tpc/Makefile   |  11 ++
 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c | 302 ++
 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c | 283 
 configs/kp_imx6q_tpc_defconfig|  48 +
 include/configs/kp_imx6q_tpc.h| 133 +
 8 files changed, 806 insertions(+)
 create mode 100644 board/k+p/kp_imx6q_tpc/Kconfig
 create mode 100644 board/k+p/kp_imx6q_tpc/MAINTAINERS
 create mode 100644 board/k+p/kp_imx6q_tpc/Makefile
 create mode 100644 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
 create mode 100644 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c
 create mode 100644 configs/kp_imx6q_tpc_defconfig
 create mode 100644 include/configs/kp_imx6q_tpc.h

diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index 2f3e52d624..8b0e3e78bf 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -388,6 +388,16 @@ config TARGET_TBS2910
 config TARGET_TITANIUM
bool "titanium"
 
+config TARGET_KP_IMX6Q_TPC
+   bool "K+P KP_IMX6Q_TPC i.MX6 Quad"
+   select MX6QDL
+   select BOARD_LATE_INIT
+   select BOARD_EARLY_INIT_F
+   select SUPPORT_SPL
+   select DM
+   select DM_THERMAL
+   imply CMD_SPL
+
 config TARGET_TQMA6
bool "TQ Systems TQMa6 board"
select BOARD_LATE_INIT
@@ -494,6 +504,7 @@ source "board/tbs/tbs2910/Kconfig"
 source "board/tqc/tqma6/Kconfig"
 source "board/toradex/apalis_imx6/Kconfig"
 source "board/toradex/colibri_imx6/Kconfig"
+source "board/k+p/kp_imx6q_tpc/Kconfig"
 source "board/udoo/Kconfig"
 source "board/udoo/neo/Kconfig"
 source "board/wandboard/Kconfig"
diff --git a/board/k+p/kp_imx6q_tpc/Kconfig b/board/k+p/kp_imx6q_tpc/Kconfig
new file mode 100644
index 00..62e34978ec
--- /dev/null
+++ b/board/k+p/kp_imx6q_tpc/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_KP_IMX6Q_TPC
+
+config SYS_BOARD
+   default "kp_imx6q_tpc"
+
+config SYS_VENDOR
+   default "k+p"
+
+config SYS_CONFIG_NAME
+   default "kp_imx6q_tpc"
+
+endif
diff --git a/board/k+p/kp_imx6q_tpc/MAINTAINERS 
b/board/k+p/kp_imx6q_tpc/MAINTAINERS
new file mode 100644
index 00..6c4c8dd28e
--- /dev/null
+++ b/board/k+p/kp_imx6q_tpc/MAINTAINERS
@@ -0,0 +1,6 @@
+KP_IMX6Q_TPC BOARD
+M: Lukasz Majewski 
+S: Maintained
+F: board/k+p/kp_imx6q_tpc/
+F: include/configs/kp_imx6q_tpc.h
+F: configs/kp_imx6q_tpc_defconfig
diff --git a/board/k+p/kp_imx6q_tpc/Makefile b/board/k+p/kp_imx6q_tpc/Makefile
new file mode 100644
index 00..51cbd3e843
--- /dev/null
+++ b/board/k+p/kp_imx6q_tpc/Makefile
@@ -0,0 +1,11 @@
+#
+# Copyright (C) 2018 Lukasz Majewski 
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+ifdef CONFIG_SPL_BUILD
+obj-y  := kp_imx6q_tpc_spl.o
+else
+obj-y  := kp_imx6q_tpc.o
+endif
diff --git a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c 
b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
new file mode 100644
index 00..9a5b88029f
--- /dev/null
+++ b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c
@@ -0,0 +1,302 @@
+/*
+ * K+P iMX6Q KP_IMX6Q_TPC board configuration
+ *
+ * Copyright (C) 2018 Lukasz Majewski 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define ENET_PAD_CTRL  \
+   (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm |  \
+PAD_CTL_HYS)
+
+#define I2C_PAD_CTRL   \
+   (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm |  \
+   PAD_CTL_HYS | PAD_CTL_ODE | PAD_CTL_SRE_FAST)
+
+#define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
+
+static struct i2c_pads_info kp_imx6q_tpc_i2c_pad_info0 = {
+   .scl = {
+   .i2c_mode  = MX6Q_PAD_CSI0_DAT9__I2C1_SCL | PC,
+   .gpio_mode = MX6Q_PAD_CSI0_DAT9__GPIO5_IO27 | PC,
+   .gp = IMX_GPIO_NR(5, 27)
+   },
+   .sda = {
+.i2c_mode = MX6Q_PAD_CSI0_DAT8__I2C1_SDA | PC,
+.gpio_mode = MX6Q_PAD_CSI0_DAT8__GPIO5_IO26 | PC,
+.gp = IMX_GPIO_NR(5, 26)
+   }
+};
+
+static struct i2c_pads_info kp_imx6q_tpc_i2c_pad_info1 = {
+   .scl = {
+   .i2c_mode  = MX6Q_PAD_KEY_COL3__I2C2_SCL | PC,
+   .gpio_mode = MX6Q_PAD_KEY_COL3__GPIO4_IO12 | PC,
+   .gp = IMX_GPIO_NR(4, 12)
+   },
+   .sda = {
+.i2c_mode = 

Re: [U-Boot] [PATCH 2/2][Boards Need to Switch DM] spi: omap3_spi: Full dm conversion

2018-03-06 Thread Adam Ford
On Tue, Mar 6, 2018 at 12:03 PM, Jagan Teki  wrote:
> omap3_spi now support dt along with platform data,
> respective boards need to switch into dm for the same.

I applied both 1/2 and 2/2 patches and tested them together on omap3_logic.

Without any changes to my config, this patch fails to build. That
board has CONFIG_OMAP3_SPI=y by default.

cmd/built-in.o: In function `do_spi_xfer':
/home/aford/src/u-boot/cmd/spi.c:61: undefined reference to `spi_setup_slave'
/home/aford/src/u-boot/cmd/spi.c:68: undefined reference to `spi_claim_bus'
/home/aford/src/u-boot/cmd/spi.c:71: undefined reference to `spi_xfer'
/home/aford/src/u-boot/cmd/spi.c:88: undefined reference to `spi_release_bus'
/home/aford/src/u-boot/cmd/spi.c:90: undefined reference to `spi_free_slave'
common/built-in.o: In function `jumptable_init':
/home/aford/src/u-boot/common/exports.c:30: undefined reference to `spi_init'
/home/aford/src/u-boot/common/exports.c:30: undefined reference to
`spi_setup_slave'
/home/aford/src/u-boot/common/exports.c:30: undefined reference to
`spi_free_slave'
/home/aford/src/u-boot/common/exports.c:30: undefined reference to
`spi_claim_bus'
/home/aford/src/u-boot/common/exports.c:30: undefined reference to
`spi_release_bus'
/home/aford/src/u-boot/common/exports.c:30: undefined reference to `spi_xfer'
arm-linux-ld.bfd: BFD (GNU Binutils) 2.29.1 assertion fail elf32-arm.c:9509
arm-linux-ld.bfd: BFD (GNU Binutils) 2.29.1 assertion fail elf32-arm.c:9509
arm-linux-ld.bfd: BFD (GNU Binutils) 2.29.1 assertion fail elf32-arm.c:9509
arm-linux-ld.bfd: BFD (GNU Binutils) 2.29.1 assertion fail elf32-arm.c:9509
arm-linux-ld.bfd: BFD (GNU Binutils) 2.29.1 assertion fail elf32-arm.c:9509

If seems to me like we at least should keep the non-DM version of the
driver working in addition to the DM version until all the boards are
migrated.


Having said that, When I enabled DM_SPI and McSPI, I got the following errors:


  CC  common/fdt_support.o
drivers/spi/omap3_spi.c: In function ‘omap3_spi_ofdata_to_platdata’:
drivers/spi/omap3_spi.c:537:34: error: ‘blob’ undeclared (first use in
this function); did you mean ‘_log’?
  plat->pin_dir = fdtdec_get_uint(blob, node, "ti,pindir-d0-out-d1-in",
  ^~~~
  _log
drivers/spi/omap3_spi.c:537:34: note: each undeclared identifier is
reported only once for each function it appears in
drivers/spi/omap3_spi.c:537:40: error: ‘node’ undeclared (first use in
this function); did you mean ‘ofnode’?
  plat->pin_dir = fdtdec_get_uint(blob, node, "ti,pindir-d0-out-d1-in",
^~~~
ofnode
scripts/Makefile.build:280: recipe for target 'drivers/spi/omap3_spi.o' failed
make[1]: *** [drivers/spi/omap3_spi.o] Error 1
Makefile:1330: recipe for target 'drivers/spi' failed

Any suggestions on how to proceed?

adam

>
> Signed-off-by: Jagan Teki 
> ---
>  drivers/spi/Kconfig  |  14 +-
>  drivers/spi/omap3_spi.c  | 341 
> +++
>  include/dm/platform_data/spi_omap3.h |  16 ++
>  3 files changed, 124 insertions(+), 247 deletions(-)
>  create mode 100644 include/dm/platform_data/spi_omap3.h
>
> diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
> index fd3f115ccf..56c337f664 100644
> --- a/drivers/spi/Kconfig
> +++ b/drivers/spi/Kconfig
> @@ -99,6 +99,13 @@ config MVEBU_A3700_SPI
>   used to access the SPI NOR flash on platforms embedding this
>   Marvell IP core.
>
> +config OMAP3_SPI
> +   bool "McSPI driver for OMAP"
> +   help
> + SPI master controller for OMAP24XX and later Multichannel SPI
> + (McSPI). This driver be used to access SPI chips on platforms
> + embedding this OMAP3 McSPI IP core.
> +
>  config PIC32_SPI
> bool "Microchip PIC32 SPI driver"
> depends on MACH_PIC32
> @@ -291,11 +298,4 @@ config MXS_SPI
>   Enable the MXS SPI controller driver. This driver can be used
>   on the i.MX23 and i.MX28 SoCs.
>
> -config OMAP3_SPI
> -   bool "McSPI driver for OMAP"
> -   help
> - SPI master controller for OMAP24XX and later Multichannel SPI
> - (McSPI). This driver be used to access SPI chips on platforms
> - embedding this OMAP3 McSPI IP core.
> -
>  endmenu # menu "SPI Support"
> diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c
> index b8a0bf495a..31bd7b7df1 100644
> --- a/drivers/spi/omap3_spi.c
> +++ b/drivers/spi/omap3_spi.c
> @@ -22,6 +22,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> @@ -109,9 +110,6 @@ struct mcspi {
>  };
>
>  struct omap3_spi_priv {
> -#ifndef CONFIG_DM_SPI
> -   struct spi_slave slave;
> -#endif
> struct mcspi *regs;
> unsigned int cs;
> unsigned int freq;
> @@ -312,12 +310,16 @@ static int omap3_spi_txrx(struct omap3_spi_priv 

[U-Boot] [PATCHv2 1/2] dra7xx: Always enable UART1 and UART3 in early_padconf

2018-03-06 Thread Tom Rini
It is safe to always setup the pinmux for UART1 and UART3 to be used in
early_padconf and then if these pins are needed later on, they will be
re-muxed.  This allows us to drop the usage of CONFIG_CONS_INDEX here.

Cc: Lokesh Vutla 
Signed-off-by: Tom Rini 
---
 board/ti/dra7xx/mux_data.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/board/ti/dra7xx/mux_data.h b/board/ti/dra7xx/mux_data.h
index b5dcaa584a24..32c9ecacce2a 100644
--- a/board/ti/dra7xx/mux_data.h
+++ b/board/ti/dra7xx/mux_data.h
@@ -372,13 +372,10 @@ const struct pad_conf_entry dra71x_core_padconf_array[] = 
{
 };
 
 const struct pad_conf_entry early_padconf[] = {
-#if (CONFIG_CONS_INDEX == 1)
{UART1_RXD, (PIN_INPUT_SLEW | M0)}, /* UART1_RXD */
{UART1_TXD, (PIN_INPUT_SLEW | M0)}, /* UART1_TXD */
-#elif (CONFIG_CONS_INDEX == 3)
{UART3_RXD, (PIN_INPUT_SLEW | M0)}, /* UART3_RXD */
{UART3_TXD, (PIN_INPUT_SLEW | M0)}, /* UART3_TXD */
-#endif
{I2C1_SDA, (PIN_INPUT | M0)},   /* I2C1_SDA */
{I2C1_SCL, (PIN_INPUT | M0)},   /* I2C1_SCL */
 };
-- 
2.7.4

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


Re: [U-Boot] [PATCH v3 06/21] efi: Correct header order in efi_memory

2018-03-06 Thread Heinrich Schuchardt
On 02/19/2018 04:48 PM, Simon Glass wrote:
> The headers are not in the correct order. Fix this. Also drop libfdt_env.h
> since it is not needed.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v3: None
> Changes in v2:
> - Update commit message to dropping libfdt_env.h
> 
>  lib/efi_loader/efi_memory.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
> index aaf64421a3..c273a7ba30 100644
> --- a/lib/efi_loader/efi_memory.c
> +++ b/lib/efi_loader/efi_memory.c
> @@ -8,12 +8,11 @@
>  
>  #include 
>  #include 
> +#include 
>  #include 
> +#include 
>  #include 
> -#include 

The patch has to be rebased due to b08c8c48708
libfdt: move headers to  and 

Otherwise

Reviewed-by: Heinrich Schuchardt 

>  #include 
> -#include 
> -#include 
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> 

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


[U-Boot] [PATCH RFC 2/2] ARM: sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

2018-03-06 Thread Tuomas Tynkkynen
In README.sunxi64 we tell the user how to optionally create
u-boot-sunxi-with-spl.bin by manually running cat. Instead, have the
build system create the file automatically just like it does for 32-bit
sunxi boards.

Signed-off-by: Tuomas Tynkkynen 
---
 Makefile   | 5 +
 board/sunxi/README.sunxi64 | 3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 24a79446d8..4b203a0155 100644
--- a/Makefile
+++ b/Makefile
@@ -1191,8 +1191,13 @@ u-boot-x86-16bit.bin: u-boot FORCE
 endif
 
 ifneq ($(CONFIG_ARCH_SUNXI),)
+ifeq ($(CONFIG_ARM64),)
 u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE
$(call if_changed,binman)
+else
+u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE
+   $(call if_changed,cat)
+endif
 endif
 
 ifneq ($(CONFIG_TEGRA),)
diff --git a/board/sunxi/README.sunxi64 b/board/sunxi/README.sunxi64
index c492f749b8..5a363d27b8 100644
--- a/board/sunxi/README.sunxi64
+++ b/board/sunxi/README.sunxi64
@@ -95,9 +95,8 @@ Transfer the SPL and the U-Boot FIT image directly to an uSD 
card:
 (replace /dev/sdx with you SD card device file name, which could be
 /dev/mmcblk[x] as well).
 
-Alternatively you can concatenate the SPL and the U-Boot FIT image into a
+Alternatively you can use the SPL and the U-Boot FIT image combined into a
 single file and transfer that instead:
-$ cat spl/sunxi-spl.bin u-boot.itb > u-boot-sunxi-with-spl.bin
 # dd if=u-boot-sunxi-with-spl.bin of=/dev/sdx bs=8k seek=1
 
 You can partition the microSD card, but leave the first MB unallocated (most
-- 
2.16.1

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


[U-Boot] [PATCH RFC 1/2] ARM: sunxi: Move u-boot-sunxi-with-spl.bin rule to Makefile

2018-03-06 Thread Tuomas Tynkkynen
We're going to need this logic for 64-bit builds as well, so move it
out from under arch/arm/cpu/armv7.

Signed-off-by: Tuomas Tynkkynen 
---
 Makefile   | 5 +
 arch/arm/cpu/armv7/sunxi/config.mk | 6 --
 2 files changed, 5 insertions(+), 6 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/sunxi/config.mk

diff --git a/Makefile b/Makefile
index c6819d5742..24a79446d8 100644
--- a/Makefile
+++ b/Makefile
@@ -800,6 +800,11 @@ ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),)
 ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
 endif
 
+# Build a combined spl + u-boot image for sunxi
+ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy)
+ALL-y += u-boot-sunxi-with-spl.bin
+endif
+
 # enable combined SPL/u-boot/dtb rules for tegra
 ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
 ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin
diff --git a/arch/arm/cpu/armv7/sunxi/config.mk 
b/arch/arm/cpu/armv7/sunxi/config.mk
deleted file mode 100644
index 76ffec9df6..00
--- a/arch/arm/cpu/armv7/sunxi/config.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-# Build a combined spl + u-boot image
-ifdef CONFIG_SPL
-ifndef CONFIG_SPL_BUILD
-ALL-y += u-boot-sunxi-with-spl.bin
-endif
-endif
-- 
2.16.1

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


[U-Boot] [PATCH RFC 0/2] sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

2018-03-06 Thread Tuomas Tynkkynen
For some reason we seem to have documented how to build
u-boot-sunxi-with-spl.bin manually with cat but not have a build system
rule for it. Let's fix this to have the file built by default just like
it is on 32-bit sunxi boards.

Build-tested only.

Tuomas Tynkkynen (2):
  ARM: sunxi: Move u-boot-sunxi-with-spl.bin rule to Makefile
  ARM: sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

 Makefile   | 10 ++
 arch/arm/cpu/armv7/sunxi/config.mk |  6 --
 board/sunxi/README.sunxi64 |  3 +--
 3 files changed, 11 insertions(+), 8 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/sunxi/config.mk

-- 
2.16.1

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


[U-Boot] [PATCH][[Boards Need to Switch DM] spi: davinci: Full dm conversion

2018-03-06 Thread Jagan Teki
davinci_spi now support dt along with platform data,
respective boards need to switch into dm for the same.

Signed-off-by: Jagan Teki 
---
 drivers/spi/Kconfig|  12 +-
 drivers/spi/davinci_spi.c  | 275 +
 include/dm/platform_data/spi_davinci.h |  15 ++
 3 files changed, 90 insertions(+), 212 deletions(-)
 create mode 100644 include/dm/platform_data/spi_davinci.h

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 2f231fc12b..589484fba0 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -70,6 +70,12 @@ config CADENCE_QSPI
  used to access the SPI NOR flash on platforms embedding this
  Cadence IP core.
 
+config DAVINCI_SPI
+   bool "Davinci & Keystone SPI driver"
+   depends on ARCH_DAVINCI || ARCH_KEYSTONE
+   help
+ Enable the Davinci SPI driver
+
 config DESIGNWARE_SPI
bool "Designware SPI driver"
help
@@ -246,12 +252,6 @@ config FSL_QSPI
  used to access the SPI NOR flash on platforms embedding this
  Freescale IP core.
 
-config DAVINCI_SPI
-   bool "Davinci & Keystone SPI driver"
-   depends on ARCH_DAVINCI || ARCH_KEYSTONE
-   help
- Enable the Davinci SPI driver
-
 config SH_SPI
bool "SuperH SPI driver"
help
diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
index eda252d0b3..8fa5a22c78 100644
--- a/drivers/spi/davinci_spi.c
+++ b/drivers/spi/davinci_spi.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /* SPIGCR0 */
 #define SPIGCR0_SPIENA_MASK0x1
@@ -119,9 +120,6 @@ struct davinci_spi_regs {
 
 /* davinci spi slave */
 struct davinci_spi_slave {
-#ifndef CONFIG_DM_SPI
-   struct spi_slave slave;
-#endif
struct davinci_spi_regs *regs;
unsigned int freq; /* current SPI bus frequency */
unsigned int mode; /* current SPI mode used */
@@ -241,11 +239,43 @@ static int davinci_spi_read_write(struct 
davinci_spi_slave *ds, unsigned
return 0;
 }
 
+static int davinci_spi_set_speed(struct udevice *bus, uint max_hz)
+{
+   struct davinci_spi_slave *ds = dev_get_priv(bus);
+
+   debug("%s speed %u\n", __func__, max_hz);
+   if (max_hz > CONFIG_SYS_SPI_CLK / 2)
+   return -EINVAL;
 
-static int __davinci_spi_claim_bus(struct davinci_spi_slave *ds, int cs)
+   ds->freq = max_hz;
+
+   return 0;
+}
+
+static int davinci_spi_set_mode(struct udevice *bus, uint mode)
 {
+   struct davinci_spi_slave *ds = dev_get_priv(bus);
+
+   debug("%s mode %u\n", __func__, mode);
+   ds->mode = mode;
+
+   return 0;
+}
+
+static int davinci_spi_claim_bus(struct udevice *dev)
+{
+   struct dm_spi_slave_platdata *slave_plat =
+   dev_get_parent_platdata(dev);
+   struct udevice *bus = dev->parent;
+   struct davinci_spi_slave *ds = dev_get_priv(bus);
unsigned int mode = 0, scalar;
 
+   if (slave_plat->cs >= ds->num_cs) {
+   printf("Invalid SPI chipselect\n");
+   return -EINVAL;
+   }
+   ds->half_duplex = slave_plat->mode & SPI_PREAMBLE;
+
/* Enable the SPI hardware */
writel(SPIGCR0_SPIRST_MASK, >regs->gcr0);
udelay(1000);
@@ -255,7 +285,7 @@ static int __davinci_spi_claim_bus(struct davinci_spi_slave 
*ds, int cs)
writel(SPIGCR1_MASTER_MASK | SPIGCR1_CLKMOD_MASK, >regs->gcr1);
 
/* CS, CLK, SIMO and SOMI are functional pins */
-   writel(((1 << cs) | SPIPC0_CLKFUN_MASK |
+   writel(((1 << slave_plat->cs) | SPIPC0_CLKFUN_MASK |
SPIPC0_DOFUN_MASK | SPIPC0_DIFUN_MASK), >regs->pc0);
 
/* setup format */
@@ -293,20 +323,32 @@ static int __davinci_spi_claim_bus(struct 
davinci_spi_slave *ds, int cs)
return 0;
 }
 
-static int __davinci_spi_release_bus(struct davinci_spi_slave *ds)
+static int davinci_spi_release_bus(struct udevice *dev)
 {
+   struct davinci_spi_slave *ds = dev_get_priv(dev->parent);
+
/* Disable the SPI hardware */
writel(SPIGCR0_SPIRST_MASK, >regs->gcr0);
 
return 0;
 }
 
-static int __davinci_spi_xfer(struct davinci_spi_slave *ds,
-   unsigned int bitlen,  const void *dout, void *din,
-   unsigned long flags)
+static int davinci_spi_xfer(struct udevice *dev, unsigned int bitlen,
+   const void *dout, void *din,
+   unsigned long flags)
 {
+   struct dm_spi_slave_platdata *slave =
+   dev_get_parent_platdata(dev);
+   struct udevice *bus = dev->parent;
+   struct davinci_spi_slave *ds = dev_get_priv(bus);
unsigned int len;
 
+   if (slave->cs >= ds->num_cs) {
+   printf("Invalid SPI chipselect\n");
+   return -EINVAL;
+   }
+   ds->cur_cs = slave->cs;
+
if (bitlen == 0)
/* Finish any previously submitted transfers */
goto out;

Re: [U-Boot] [PATCH v2 00/10] splash screen on the stm32f769 disco board

2018-03-06 Thread Vikas Manocha
Hi Patrice/Yannick,

On 03/05/2018 11:50 PM, Patrice CHOTARD wrote:
>> There seems to be a dependency on patch for 
>> include/dt-bindings/mfd/stm32f7-rcc.h
>> adding some new macros. Is it also submitted to the list?
> Right, needed patches are already on the list 
> http://patchwork.ozlabs.org/patch/870938/

Great addition !

Few points:
it seems above mentioned patchset also has dependency on another patchset 
http://patchwork.ozlabs.org/patch/870283/
After applying these two dependency patchsets, it creates conflicts with pathch 
"ARM: dts: stm32: Add timer support for STM32F7".
I understand you want to get it reviewed without waiting for other patchset 
acceptance, it would be good to mention all the dependencies.

Also i observe that without applying f769 display patches, f746 display didn't 
work.
And F769 board display is not working, i see one error log: 

Board 1:
stm32_ltdc_probe: decode display timing error -4
& Board 2:
stm32_ltdc_probe: decode display timing error -668998023

Cheers,
Vikas

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


Re: [U-Boot] [PATCH v2 00/10] splash screen on the stm32f769 disco board

2018-03-06 Thread Anatolij Gustschin
Hi Simon,

On Tue, 6 Mar 2018 10:51:29 -0700
Simon Glass s...@chromium.org wrote:
...
> Does this use driver model? I cannot see it.

Panel drivers in patches 4/10 and 7/10 use driver model. MIPI DSI driver
in patch 6/10 uses DM, too.

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


Re: [U-Boot] [PATCH v3 00/13] LS1012A PFE driver patch series

2018-03-06 Thread Joe Hershberger
On Tue, Mar 6, 2018 at 10:28 AM, York Sun  wrote:
> On 03/06/2018 06:28 AM, Calvin Johnson wrote:
>> Hi Joe,
>>
>> Thanks for reviewing all the patches.
>
> Joe,
>
> Do you want to bring them in, or leave them to me?

I'll bring them in through my tree.

Calvin,

It seems we have an issue with the series.  Please have a look:
https://travis-ci.org/jhershbe/u-boot/builds/349955957

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


Re: [U-Boot] spi: Zapping non-dm drivers, deadline: v2018.09

2018-03-06 Thread Jagan Teki
On Wed, Feb 28, 2018 at 3:32 AM, Angelo Dureghello  wrote:
> Hi Jagan,
>
> On Tue, Feb 27, 2018 at 10:36:46PM +0530, Jagan Teki wrote:
>> On Tue, Feb 27, 2018 at 9:28 PM, York Sun  wrote:
>> > On 02/26/2018 09:25 AM, Tom Rini wrote:
>> >> On Mon, Feb 26, 2018 at 08:28:45PM +0530, Jagan Teki wrote:
>> >>
>> >>> Due to adding various new functionalities with SPI and SPI-FLASH
>> >>> subsystems which are rounding in Mailing list for year+ [1] these long
>> >>> term supporting spi driver which never seen any update with
>> >>> driver-model conversion.
>> >>>
>> >>> We support to write another stack code for supporting these legacy
>> >>> stuff, but things become more difficult. So I'm finally giving
>> >>> deadlines for these drivers to respective driver or board developers
>> >>> to convert them as soon as possible.
>> >>>
>> >>> PS: We all agree some special platforms has some difficulties with
>> >>> dm-conversion let's discuss.
>> >>>
>> >>> No dm conversion yet:
>> >>> 
>> >>> drivers/spi/cf_spi.c
>> >>> drivers/spi/fsl_espi.c
>> >>> drivers/spi/lpc32xx_ssp.c
>> >>> drivers/spi/mpc8xx_spi.c
>> >>> drivers/spi/mpc8xxx_spi.c
>> >>> drivers/spi/mxs_spi.c
>> >>> drivers/spi/sh_qspi.c
>> >>> drivers/spi/sh_spi.c
>> >>> drivers/spi/soft_spi_legacy.c
>> >>>
>> >>>
>> >>> Partially converted:
>> >>> -
>> >>> drivers/spi/atcspi200_spi.c
>> >>> drivers/spi/atmel_spi.c
>> >>> drivers/spi/davinci_spi.c
>> >>> drivers/spi/fsl_dspi.c
>> >>> drivers/spi/fsl_qspi.c
>> >>> drivers/spi/kirkwood_spi.c
>> >>> drivers/spi/mxc_spi.c
>> >>> drivers/spi/omap3_spi.c
>> >>> drivers/spi/ti_qspi.cM
>> >>>
>> >>> I would like to see these legacy drivers with full dm-conversion or
>> >>> zapped in v2018.09 version of U-Boot.
>> >>>
>> >>> [1] 
>> >>> http://u-boot.10912.n7.nabble.com/PATCH-v10-00-27-dm-Generic-MTD-Subsystem-with-SPI-NOR-interface-td315694i20.html
>> >>
>> >> I've added a bunch of people to the Cc list.  I am in agreement with
>> >> this idea.  I'd also rather not push the deadline here out further.
>> >> Please, speak out if this is a problem, or if you'd like to drop some
>> >> code / platforms.  Thanks all!
>> >>
>> >
>> > My only concern is for legacy platforms such as mpc8xxx. As long as the
>> > new dm-driver doesn't force to use device tree which mpc8xxx doesn't
>> > have, it should continue to work.
>>
>> dm, will have dependency with dt for node probe or other details, but
>> U_BOOT_DEVICE can use to support like dm(not sure how feasible it to).
>> Seems like Linux has dts for mpc8xxx, please try to sync.
>
> Unfortunately i am experiencing similar issues for ColdFire (m68k)
> achitecture.
>
> Started today with the conversion of cf_spi.c, but i get several
> unresolved externals,
>
> include/dm/read.h:446: undefined reference to `ofnode_read_u32_default'
> include/dm/read.h:446: undefined reference to `ofnode_read_u32_default'
> include/dm/read.h:446: undefined reference to `ofnode_read_u32_default'
> drivers/spi/built-in.o: In function `dev_read_bool':
> include/dm/read.h:457: undefined reference to `ofnode_read_bool'
> include/dm/read.h:457: undefined reference to `ofnode_read_bool'
> include/dm/read.h:457: undefined reference to `ofnode_read_bool'
> include/dm/read.h:457: undefined reference to `ofnode_read_bool'
> include/dm/read.h:457: undefined reference to `ofnode_read_bool'
> drivers/spi/built-in.o: In function `dev_read_u32_default':
> include/dm/read.h:446: undefined reference to `ofnode_read_u32_default'
> include/dm/read.h:446: undefined reference to `ofnode_read_u32_default'
> drivers/spi/built-in.o:(.u_boot_list_2_uclass_2_spi+0x8):
> undefined reference to `dm_scan_fdt_dev'
>
> Issue seems related to spi-uclass.o that calls fdt node read
> functions.
>
> While i.e. serial-uclass.o is not calling node read functions,
> so a DM driver for uart could be implemented.
>
> For ColdFire there is no fdt support, (also in Linux).
> I believe starting dts support for ColdFire may be a bit complex
> and long job.

Then, try to use platform_data, see this patch[2] for sample conversion.

[2] https://patchwork.ozlabs.org/patch/882169/

Jagan.

-- 
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/2][Boards Need to Switch DM] spi: omap3_spi: Full dm conversion

2018-03-06 Thread Jagan Teki
omap3_spi now support dt along with platform data,
respective boards need to switch into dm for the same.

Signed-off-by: Jagan Teki 
---
 drivers/spi/Kconfig  |  14 +-
 drivers/spi/omap3_spi.c  | 341 +++
 include/dm/platform_data/spi_omap3.h |  16 ++
 3 files changed, 124 insertions(+), 247 deletions(-)
 create mode 100644 include/dm/platform_data/spi_omap3.h

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index fd3f115ccf..56c337f664 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -99,6 +99,13 @@ config MVEBU_A3700_SPI
  used to access the SPI NOR flash on platforms embedding this
  Marvell IP core.
 
+config OMAP3_SPI
+   bool "McSPI driver for OMAP"
+   help
+ SPI master controller for OMAP24XX and later Multichannel SPI
+ (McSPI). This driver be used to access SPI chips on platforms
+ embedding this OMAP3 McSPI IP core.
+
 config PIC32_SPI
bool "Microchip PIC32 SPI driver"
depends on MACH_PIC32
@@ -291,11 +298,4 @@ config MXS_SPI
  Enable the MXS SPI controller driver. This driver can be used
  on the i.MX23 and i.MX28 SoCs.
 
-config OMAP3_SPI
-   bool "McSPI driver for OMAP"
-   help
- SPI master controller for OMAP24XX and later Multichannel SPI
- (McSPI). This driver be used to access SPI chips on platforms
- embedding this OMAP3 McSPI IP core.
-
 endmenu # menu "SPI Support"
diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c
index b8a0bf495a..31bd7b7df1 100644
--- a/drivers/spi/omap3_spi.c
+++ b/drivers/spi/omap3_spi.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -109,9 +110,6 @@ struct mcspi {
 };
 
 struct omap3_spi_priv {
-#ifndef CONFIG_DM_SPI
-   struct spi_slave slave;
-#endif
struct mcspi *regs;
unsigned int cs;
unsigned int freq;
@@ -312,12 +310,16 @@ static int omap3_spi_txrx(struct omap3_spi_priv *priv, 
unsigned int len,
return 0;
 }
 
-static int _spi_xfer(struct omap3_spi_priv *priv, unsigned int bitlen,
-const void *dout, void *din, unsigned long flags)
+static int omap3_spi_xfer(struct udevice *dev, unsigned int bitlen,
+ const void *dout, void *din, unsigned long flags)
 {
-   unsigned intlen;
+   struct udevice *bus = dev->parent;
+   struct omap3_spi_priv *priv = dev_get_priv(bus);
+   struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+   unsigned int len;
int ret = -1;
 
+   priv->cs = slave_plat->cs;
if (priv->wordlen < 4 || priv->wordlen > 32) {
printf("omap3_spi: invalid wordlen %d\n", priv->wordlen);
return -1;
@@ -353,78 +355,6 @@ static int _spi_xfer(struct omap3_spi_priv *priv, unsigned 
int bitlen,
return ret;
 }
 
-static void _omap3_spi_set_speed(struct omap3_spi_priv *priv)
-{
-   uint32_t confr, div = 0;
-
-   confr = readl(>regs->channel[priv->cs].chconf);
-
-   /* Calculate clock divisor. Valid range: 0x0 - 0xC ( /1 - /4096 ) */
-   if (priv->freq) {
-   while (div <= 0xC && (OMAP3_MCSPI_MAX_FREQ / (1 << div))
-   > priv->freq)
-   div++;
-   } else {
-div = 0xC;
-   }
-
-   /* set clock divisor */
-   confr &= ~OMAP3_MCSPI_CHCONF_CLKD_MASK;
-   confr |= div << 2;
-
-   omap3_spi_write_chconf(priv, confr);
-}
-
-static void _omap3_spi_set_mode(struct omap3_spi_priv *priv)
-{
-   uint32_t confr;
-
-   confr = readl(>regs->channel[priv->cs].chconf);
-
-   /* standard 4-wire master mode:  SCK, MOSI/out, MISO/in, nCS
-* REVISIT: this controller could support SPI_3WIRE mode.
-*/
-   if (priv->pin_dir == MCSPI_PINDIR_D0_IN_D1_OUT) {
-   confr &= ~(OMAP3_MCSPI_CHCONF_IS|OMAP3_MCSPI_CHCONF_DPE1);
-   confr |= OMAP3_MCSPI_CHCONF_DPE0;
-   } else {
-   confr &= ~OMAP3_MCSPI_CHCONF_DPE0;
-   confr |= OMAP3_MCSPI_CHCONF_IS|OMAP3_MCSPI_CHCONF_DPE1;
-   }
-
-   /* set SPI mode 0..3 */
-   confr &= ~(OMAP3_MCSPI_CHCONF_POL | OMAP3_MCSPI_CHCONF_PHA);
-   if (priv->mode & SPI_CPHA)
-   confr |= OMAP3_MCSPI_CHCONF_PHA;
-   if (priv->mode & SPI_CPOL)
-   confr |= OMAP3_MCSPI_CHCONF_POL;
-
-   /* set chipselect polarity; manage with FORCE */
-   if (!(priv->mode & SPI_CS_HIGH))
-   confr |= OMAP3_MCSPI_CHCONF_EPOL; /* active-low; normal */
-   else
-   confr &= ~OMAP3_MCSPI_CHCONF_EPOL;
-
-   /* Transmit & receive mode */
-   confr &= ~OMAP3_MCSPI_CHCONF_TRM_MASK;
-
-   omap3_spi_write_chconf(priv, confr);
-}
-
-static void _omap3_spi_set_wordlen(struct omap3_spi_priv *priv)
-{
-   unsigned int confr;
-
-   /* McSPI 

[U-Boot] [PATCH 1/2] spi: omap3: Skip set_mode, set_speed from claim

2018-03-06 Thread Jagan Teki
set_mode, set_seed functions has separate function pointers
in dm_spi_ops, so use them in relevent one instead of
calling from claim_bus.

Signed-off-by: Jagan Teki 
---
 drivers/spi/omap3_spi.c | 21 -
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c
index 1da4542af0..b8a0bf495a 100644
--- a/drivers/spi/omap3_spi.c
+++ b/drivers/spi/omap3_spi.c
@@ -456,9 +456,6 @@ static void _omap3_spi_claim_bus(struct omap3_spi_priv 
*priv)
conf |= OMAP3_MCSPI_MODULCTRL_SINGLE;
 
writel(conf, >regs->modulctrl);
-
-   _omap3_spi_set_mode(priv);
-   _omap3_spi_set_speed(priv);
 }
 
 #ifndef CONFIG_DM_SPI
@@ -594,8 +591,6 @@ static int omap3_spi_claim_bus(struct udevice *dev)
struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
 
priv->cs = slave_plat->cs;
-   priv->mode = slave_plat->mode;
-   priv->freq = slave_plat->max_hz;
_omap3_spi_claim_bus(priv);
 
return 0;
@@ -652,11 +647,27 @@ static int omap3_spi_xfer(struct udevice *dev, unsigned 
int bitlen,
 
 static int omap3_spi_set_speed(struct udevice *bus, unsigned int speed)
 {
+   struct udevice *bus = dev->parent;
+   struct omap3_spi_priv *priv = dev_get_priv(bus);
+   struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+
+   priv->cs = slave_plat->cs;
+   priv->freq = slave_plat->max_hz;
+   _omap3_spi_set_speed(priv);
+
return 0;
 }
 
 static int omap3_spi_set_mode(struct udevice *bus, uint mode)
 {
+   struct udevice *bus = dev->parent;
+   struct omap3_spi_priv *priv = dev_get_priv(bus);
+   struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+
+   priv->cs = slave_plat->cs;
+   priv->mode = slave_plat->mode;
+   _omap3_spi_set_mode(priv);
+
return 0;
 }
 
-- 
2.14.3

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


Re: [U-Boot] [PATCH 05/16] dm: gpio: Convert stm32f7 driver to livetree

2018-03-06 Thread Simon Glass
On 5 March 2018 at 07:24, Patrick Delaunay  wrote:
> Update the GPIO driver to support a live device tree.
>
> Signed-off-by: Patrick Delaunay 
> ---
>
>  drivers/gpio/stm32f7_gpio.c | 12 +++-
>  1 file changed, 3 insertions(+), 9 deletions(-)

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


Re: [U-Boot] [PATCH v10 4/4] common: Generic firmware loader for file system

2018-03-06 Thread Simon Glass
Hi,

On 5 March 2018 at 02:43,   wrote:
> From: Tien Fong Chee 
>
> This is file system generic loader which can be used to load
> the file image from the storage into target such as memory.
> The consumer driver would then use this loader to program whatever,
> ie. the FPGA device.
>
> Signed-off-by: Tien Fong Chee 
> Reviewed-by: Lothar Waßmann 
> ---
>  common/Kconfig |  10 ++
>  common/Makefile|   1 +
>  common/fs_loader.c | 353 
> +
>  doc/README.firmware_loader |  86 +++
>  include/fs_loader.h|  28 
>  5 files changed, 478 insertions(+)
>  create mode 100644 common/fs_loader.c
>  create mode 100644 doc/README.firmware_loader
>  create mode 100644 include/fs_loader.h

This looks fine as a concept but I am not keen on the implementation.

1. It should use driver model (only) in U-Boot proper. If there is
some SPL problem then add a specific function or feature for SPL.
2. It should not be necessary ti manually init subsystems - driver
model does this for you
3. You can use the uclass name to find things

Please let me know if you need more info.

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


Re: [U-Boot] [PATCH v2 00/10] splash screen on the stm32f769 disco board

2018-03-06 Thread Simon Glass
On 2 March 2018 at 08:44, yannick fertre  wrote:
>
> Version 2:
> - Replace debug log by pr_error, pr_warn or pr_info.
> - Rework bridge between ltdc & dsi panel
> - Rework backligh management (with or witout gpio)
> - Rework panel otm8009a
> - Add new panel raydium rm68200
>
> Version 1:
> - Initial commit
>
> This serie contains all patchsets needed for displaying a splash screen
> on the stm32f769 disco board.
>
> yannick fertre (10):
>   video: stm32: stm32_ltdc: add bridge to display controller
>   video: stm32: stm32_ltdc: update debug log
>   video: add support of MIPI DSI interface
>   video: add support of panel OTM8009A
>   video: add MIPI DSI host controller bridge
>   video: add support of STM32 MIPI DSI controller driver
>   video: add support of panel rm68200
>   arm: dts: stm32: add dsi for STM32F746
>   arm: dts: stm32: add display for STM32F769 disco board
>   board: Add STM32F769 SoC, discovery board support
>
>  arch/arm/dts/stm32f746.dtsi|  12 +
>  arch/arm/dts/stm32f769-disco.dts   |  71 
>  configs/stm32f769-disco_defconfig  |  63 +++
>  drivers/video/Kconfig  |  32 ++
>  drivers/video/Makefile |   4 +
>  drivers/video/dw_mipi_dsi.c| 822 
> +
>  drivers/video/mipi_display.c   | 807 
>  drivers/video/orisetech_otm8009a.c | 329 +++
>  drivers/video/raydium-rm68200.c| 329 +++
>  drivers/video/stm32/Kconfig|  10 +
>  drivers/video/stm32/Makefile   |   1 +
>  drivers/video/stm32/stm32_dsi.c| 427 +++
>  drivers/video/stm32/stm32_ltdc.c   | 144 ---
>  include/dw_mipi_dsi.h  |  32 ++
>  include/mipi_display.h | 257 +++-
>  15 files changed, 3285 insertions(+), 55 deletions(-)
>  create mode 100644 configs/stm32f769-disco_defconfig
>  create mode 100644 drivers/video/dw_mipi_dsi.c
>  create mode 100644 drivers/video/mipi_display.c
>  create mode 100644 drivers/video/orisetech_otm8009a.c
>  create mode 100644 drivers/video/raydium-rm68200.c
>  create mode 100644 drivers/video/stm32/stm32_dsi.c
>  create mode 100644 include/dw_mipi_dsi.h

Does this use driver model? I cannot see it.

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


Re: [U-Boot] [PATCH 03/16] common: add a prototype for mach_cpu_init()

2018-03-06 Thread Simon Glass
Hi Patrick,

On 5 March 2018 at 07:24, Patrick Delaunay  wrote:
>
> avoid warning: no previous prototype for ‘mach_cpu_init’
>
> Signed-off-by: Patrick Delaunay 
> ---
>
>  include/common.h | 10 ++
>  1 file changed, 10 insertions(+)
>
> diff --git a/include/common.h b/include/common.h
> index 0fe9439..5b6f788 100644
> --- a/include/common.h
> +++ b/include/common.h
> @@ -474,6 +474,16 @@ intis_core_valid (unsigned int);
>   */
>  int arch_cpu_init(void);
>
> +/**
> + * mach_cpu_init() - SoC/machine dependent CPU setup
> + *
> + * This is called after arch_cpu_init(). It should handle any
> + * SoC or machine specific init needed to continue the init sequence. See
> + * board_f.c for where it is called. If this is not provided, a default
> + * version (which does nothing) will be used.

Great, but can you please add @return docs?

> + */
> +int mach_cpu_init(void);
> +
>  void s_init(void);
>
>  intcheckcpu  (void);
> --
> 2.7.4
>

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


Re: [U-Boot] [PATCH] core: ofnode: Fix translation for #size-cells == 0

2018-03-06 Thread Simon Glass
Hi Mario,

On 5 March 2018 at 23:54, Mario Six  wrote:
> Commit 286ede6 ("drivers: core: Add translation in live tree case") made
> dev_get_addr always use proper bus translations for addresses read from
> the device tree. But this leads to problems with certain busses, e.g.
> I2C busses, which run into an error during translation, and hence stop
> working.
>
> It turns out that of_translate_address() and fdt_translate_address()
> stop the address translation with an error when they're asked to
> translate addresses for busses where #size-cells == 0 (comment from
> drivers/core/of_addr.c):
>
>  * Note: We consider that crossing any level with #size-cells == 0 to mean
>  * that translation is impossible (that is we are not dealing with a value
>  * that can be mapped to a cpu physical address). This is not really specified
>  * that way, but this is traditionally the way IBM at least do things
>
> To fix this case, we check in both the live-tree and non-live tree-case,
> whether the bus of the device whose address is about to be translated
> has size-cell size zero. If this is the case, we just read the address
> as a plain integer and return it, and only apply bus translations if the
> size-cell size if greater than zero.
>
> Signed-off-by: Mario Six 
> Signed-off-by: Martin Fuzzey 
> Reported-by: Martin Fuzzey 
> Fixes: 286ede6 ("drivers: core: Add translation in live tree case")
> ---
>  drivers/core/fdtaddr.c | 17 +++--
>  drivers/core/ofnode.c  |  5 -
>  2 files changed, 15 insertions(+), 7 deletions(-)

This looks right to me, but I really think we need to create a simple
test for it. Perhaps call this function in test/dm/test-fdt.c for a
few cases? You can add whatever you like to test.dts.

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


Re: [U-Boot] [PATCH 1/2] mmc: add HS400 support

2018-03-06 Thread Simon Glass
Hi Peng,

On 5 March 2018 at 02:11, Peng Fan  wrote:
> Add HS400 support.
> Selecting HS400 needs first select HS199 according to spec, so use
> a dedicated function for HS400.
> Add HS400 related macros.
> Remove the restriction of only using the low 6 bits of
> EXT_CSD_CARD_TYPE, using all the 8 bits.
>
> Signed-off-by: Peng Fan 
> Cc: Jaehoon Chung 
> Cc: Jean-Jacques Hiblot 
> Cc: Stefano Babic 
> Cc: Simon Glass 
> Cc: Kishon Vijay Abraham I 
> Cc: Bin Meng 
> ---
>  drivers/mmc/Kconfig |   7 +++
>  drivers/mmc/mmc.c   | 133 
> ++--
>  include/mmc.h   |  12 +
>  3 files changed, 127 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
> index 5f67e336db..e9be18b333 100644
> --- a/drivers/mmc/Kconfig
> +++ b/drivers/mmc/Kconfig
> @@ -104,6 +104,13 @@ config SPL_MMC_UHS_SUPPORT
>   cards. The IO voltage must be switchable from 3.3v to 1.8v. The bus
>   frequency can go up to 208MHz (SDR104)
>
> +config MMC_HS400_SUPPORT
> +   bool "enable HS400 support"
> +   select MMC_HS200_SUPPORT
> +   help
> + The HS400 mode is support by some eMMC. The bus frequency is up to
> + 200MHz. This mode requires tuning the IO.
> +
>  config MMC_HS200_SUPPORT
> bool "enable HS200 support"
> help
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 92ea78b8af..eef229c8b4 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -169,6 +169,7 @@ const char *mmc_mode_name(enum bus_mode mode)
>   [MMC_HS_52]   = "MMC High Speed (52MHz)",
>   [MMC_DDR_52]  = "MMC DDR52 (52MHz)",
>   [MMC_HS_200]  = "HS200 (200MHz)",
> + [MMC_HS_400]  = "HS400 (200MHz)",
> };
>
> if (mode >= MMC_MODES_END)
> @@ -193,6 +194,7 @@ static uint mmc_mode2freq(struct mmc *mmc, enum bus_mode 
> mode)
>   [UHS_DDR50]   = 5000,
>   [UHS_SDR104]  = 20800,
>   [MMC_HS_200]  = 2,
> + [MMC_HS_400]  = 2,
> };
>
> if (mode == MMC_LEGACY)
> @@ -790,6 +792,11 @@ static int mmc_set_card_speed(struct mmc *mmc, enum 
> bus_mode mode)
> case MMC_HS_200:
> speed_bits = EXT_CSD_TIMING_HS200;
> break;
> +#endif
> +#if CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)
> +   case MMC_HS_400:
> +   speed_bits = EXT_CSD_TIMING_HS400;
> +   break;
>  #endif
> case MMC_LEGACY:
> speed_bits = EXT_CSD_TIMING_LEGACY;
> @@ -837,7 +844,7 @@ static int mmc_get_capabilities(struct mmc *mmc)
>
> mmc->card_caps |= MMC_MODE_4BIT | MMC_MODE_8BIT;
>
> -   cardtype = ext_csd[EXT_CSD_CARD_TYPE] & 0x3f;
> +   cardtype = ext_csd[EXT_CSD_CARD_TYPE];
> mmc->cardtype = cardtype;
>
>  #if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)
> @@ -845,6 +852,12 @@ static int mmc_get_capabilities(struct mmc *mmc)
> EXT_CSD_CARD_TYPE_HS200_1_8V)) {
> mmc->card_caps |= MMC_MODE_HS200;
> }
> +#endif
> +#if CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)

Is it possible to use if () instead of #if

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


Re: [U-Boot] [ANN] U-Boot v2018.03-rc4 released

2018-03-06 Thread Peter Robinson
On Tue, Mar 6, 2018 at 1:44 PM, Tom Rini  wrote:
> On Tue, Mar 06, 2018 at 12:47:28PM +, Peter Robinson wrote:
>> On Tue, Mar 6, 2018 at 12:29 PM, Jonathan Gray  wrote:
>> > On Tue, Mar 06, 2018 at 11:36:37AM +, Peter Robinson wrote:
>> >> On Tue, Mar 6, 2018 at 1:28 AM, Tom Rini  wrote:
>> >> > Hey all,
>> >> >
>> >> > It's release day and I've released v2018.03-rc4.  I've included a few
>> >> > different regression fixes I've seen along with some fixes and cleanups.
>> >> > I would like to do the release on March 12th, and likely will so long as
>> >> > no big regressions show up.  I am worried about the RPi3 issue I've seen
>> >> > reported.  Are there any other issues people know of currently?
>> >> >
>> >> > And to repeat myself again, boards and SoC families, etc, that have been
>> >> > orphaned for more than a year should probably get dropped.  I've
>> >> > contacted a few people off-list (which is why we've had a few pickups of
>> >> > late) for things, but if you know someone that would be interested in
>> >> > something, please speak up.
>> >>
>> >> Just a heads up that I've seen a regression in building i.MX6
>> >> platforms from rc3 with this:
>> >>
>> >> /builddir/build/BUILD/u-boot-2018.03-rc4/arch/arm/mach-imx/spl.c:160:5:
>> >> error: redefinition of 'spl_boot_mode'
>> >>  u32 spl_boot_mode(const u32 boot_device)
>> >>  ^
>> >> /builddir/build/BUILD/u-boot-2018.03-rc4/arch/arm/mach-imx/spl.c:137:5:
>> >> note: previous definition of 'spl_boot_mode' was here
>> >>  u32 spl_boot_mode(const u32 boot_device)
>> >>  ^
>> >> make[3]: *** 
>> >> [/builddir/build/BUILD/u-boot-2018.03-rc4/scripts/Makefile.build:280:
>> >> spl/arch/arm/mach-imx/spl.o] Error 1
>> >> make[2]: *** 
>> >> [/builddir/build/BUILD/u-boot-2018.03-rc4/scripts/Makefile.spl:351:
>> >> spl/arch/arm/mach-imx] Error 2
>> >> make[2]: *** Waiting for unfinished jobs
>> >>
>> >> I've not had time to dig further just yet, just wanted to give people
>> >> a heads up.
>> >
>> > mx6cuboxi builds/runs fine here with
>> > 5e62f828256d66e2b28def4f9ef20a2a05c2d04f/v2018.03-rc4
>> > and linaro gcc 6.3-2017.02
>>
>> This is Fedora 28 with gcc 8 and possibly some extra hardending flags
>
> Some extra patches?  There's only 1 spl_boot_mode in
> arch/arm/mach-imx/spl.c and line 160 is a comment here.

Yes, I should have had coffee before starting at my computer, I had
pulled in a patch [1] to deal with the previous imx6 not booting and
had forgot, it still applied cleanly though except failed in the build
bits. Panic over, sorry :-/

Tested build and boot on a imx6 device.

Peter

[1] https://lists.denx.de/pipermail/u-boot/2018-February/320614.html
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 00/13] LS1012A PFE driver patch series

2018-03-06 Thread York Sun
On 03/06/2018 06:28 AM, Calvin Johnson wrote:
> Hi Joe,
> 
> Thanks for reviewing all the patches.

Joe,

Do you want to bring them in, or leave them to me?

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


[U-Boot] [U-Boot PATCH v2 2/2] defconfig: k2l_hs_evm: Add k2l_hs_evm_defconfig

2018-03-06 Thread Madan Srinivas
Adds a dedicated defconfig to build TI K2L secure
devices and updates MAINTAINERS.

k2l_hs_evm_defconfig is created from the k2l_evm_defconfig
and removes support for SPL, as SPL is not supported on K2
HS devices. Corrects SYS_TEXT_BASE for HS devices.

Also adds TI_SECURE_DEVICE and FIT_IMAGE_POST_PROCESS to
include support for secure image creation and authentication

Signed-off-by: Madan Srinivas 

---

Changes in v2:
- Updates MAINTAINERS with K2L HS

 MAINTAINERS  |  1 +
 configs/k2l_hs_evm_defconfig | 43 +++
 2 files changed, 44 insertions(+)
 create mode 100644 configs/k2l_hs_evm_defconfig

diff --git a/MAINTAINERS b/MAINTAINERS
index f42cb22..4f29b16 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -486,6 +486,7 @@ F:  configs/dra7xx_hs_evm_defconfig
 F: configs/k2hk_hs_evm_defconfig
 F: configs/k2e_hs_evm_defconfig
 F: configs/k2g_hs_evm_defconfig
+F: configs/k2l_hs_evm_defconfig
 
 TQ GROUP
 #M:Martin Krause 
diff --git a/configs/k2l_hs_evm_defconfig b/configs/k2l_hs_evm_defconfig
new file mode 100644
index 000..cc002d3
--- /dev/null
+++ b/configs/k2l_hs_evm_defconfig
@@ -0,0 +1,43 @@
+CONFIG_ARM=y
+CONFIG_ARCH_KEYSTONE=y
+CONFIG_TI_SECURE_DEVICE=y
+CONFIG_SYS_TEXT_BASE=0xC60
+CONFIG_TI_COMMON_CMD_OPTIONS=y
+CONFIG_TARGET_K2L_EVM=y
+CONFIG_DEFAULT_DEVICE_TREE="keystone-k2l-evm"
+CONFIG_FIT_IMAGE_POST_PROCESS=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_BOARD_EARLY_INIT_F=y
+CONFIG_HUSH_PARSER=y
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_GPIO is not set
+# CONFIG_CMD_GPT is not set
+# CONFIG_CMD_MMC is not set
+CONFIG_CMD_NAND=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_MTDIDS_DEFAULT="nand0=davinci_nand.0"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=davinci_nand.0:1024k(bootloader)ro,512k(params)ro,-(ubifs)"
+CONFIG_CMD_UBI=y
+CONFIG_ISO_PARTITION=y
+CONFIG_EFI_PARTITION=y
+CONFIG_OF_CONTROL=y
+CONFIG_ENV_IS_IN_NAND=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM=y
+CONFIG_TI_AEMIF=y
+# CONFIG_MMC is not set
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_PHYLIB=y
+CONFIG_DM_ETH=y
+CONFIG_DM_SERIAL=y
+CONFIG_SYS_NS16550=y
+CONFIG_DM_SPI=y
+CONFIG_DAVINCI_SPI=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_STORAGE=y
-- 
1.9.1

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


[U-Boot] [U-Boot PATCH v2 1/2] configs: k2l: Updates u-boot env to install secure boot monitor

2018-03-06 Thread Madan Srinivas
This patch updates the default u-boot env for K2L HS devices
to install the secure boot monitor and load the fitImage during
boot.

Signed-off-by: Madan Srinivas 
Acked-by: Andrew F. Davis 

---

Changes in v2: None

 include/configs/k2l_evm.h | 9 +
 1 file changed, 9 insertions(+)

diff --git a/include/configs/k2l_evm.h b/include/configs/k2l_evm.h
index d8bcbde..87639df 100644
--- a/include/configs/k2l_evm.h
+++ b/include/configs/k2l_evm.h
@@ -15,9 +15,18 @@
 /* Platform type */
 #define CONFIG_SOC_K2L
 
+#ifdef CONFIG_TI_SECURE_DEVICE
+#define DEFAULT_SEC_BOOT_ENV   \
+   DEFAULT_FIT_TI_ARGS \
+   "findfdt=setenv fdtfile ${name_fdt}\0"
+#else
+#define DEFAULT_SEC_BOOT_ENV
+#endif
+
 /* U-Boot general configuration */
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS\
DEFAULT_FW_INITRAMFS_BOOT_ENV   \
+   DEFAULT_SEC_BOOT_ENV\
"boot=ubi\0"\
"args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "\
"root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,4096\0"   \
-- 
1.9.1

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


[U-Boot] [U-Boot PATCH v2 0/2] Adds support for secure boot on TCI6630K2L HS devices

2018-03-06 Thread Madan Srinivas

This series adds support for the secure Lammar (K2L) SoC.

It defines a new defconfig file for K2L HS, based on the GP K2L defconfig
and updates the u-boot default env variables to install the secure
boot-monitor on startup.

Changes in v2:
- Updates MAINTAINERS with K2L HS

Madan Srinivas (2):
  configs: k2l: Updates u-boot env to install secure boot monitor
  defconfig: k2l_hs_evm: Add k2l_hs_evm_defconfig

 MAINTAINERS  |  1 +
 configs/k2l_hs_evm_defconfig | 43 +++
 include/configs/k2l_evm.h|  9 +
 3 files changed, 53 insertions(+)
 create mode 100644 configs/k2l_hs_evm_defconfig

-- 
1.9.1

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


Re: [U-Boot] [PATCH] libfdt: move headers to and

2018-03-06 Thread Masahiro Yamada
2018-03-06 17:39 GMT+09:00 Paul Kocialkowski :
> Hi,
>
> On Mon, 2018-03-05 at 01:20 +0900, Masahiro Yamada wrote:
>> Thomas reported U-Boot failed to build host tools if libfdt-devel
>> package is installed because tools include libfdt headers from
>> /usr/include/ instead of using internal ones.
>
> Sorry for being late to the party here, but isn't this issue fixed by
> the patch I sent a few days ago "tools: Include U-Boot libfdt headers
> from their actual path": https://patchwork.ozlabs.org/patch/880924/ ?
>
> I doubt we need to keep both changes here. What do you think?


I noticed your patch just today.
Right, seems your patch fixed the issue.



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


Re: [U-Boot] [PATCH v5 01/15] dma: move dma_ops to dma-uclass.h

2018-03-06 Thread Grygorii Strashko



On 03/05/2018 02:05 PM, Álvaro Fernández Rojas wrote:

Move dma_ops to a separate header file, following other uclass implementations.
While doing so, this patch also improves dma_ops documentation.

Signed-off-by: Álvaro Fernández Rojas 
Reviewed-by: Simon Glass 
---
  v5: fix build of ti-edma3 (reported by Grygorii Strashko) and remove unneeded
  dma.h include
  v4: no changes
  v3: Introduce changes reported by Simon Glass:
   - Improve dma-uclass.h documentation.
   - Switch to live tree API.

  drivers/dma/dma-uclass.c |  2 +-
  drivers/dma/ti-edma3.c   |  2 +-
  include/dma-uclass.h | 39 +++
  include/dma.h| 22 --
  4 files changed, 41 insertions(+), 24 deletions(-)
  create mode 100644 include/dma-uclass.h


Reviewed-by: Grygorii Strashko 

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


Re: [U-Boot] imx6: USB SDP failed for u-boot-dtb.img

2018-03-06 Thread Vincent Prince
I put my log here https://pastebin.com/5aPjntnb , but i use standard
DT-less u-boot.img.

Maybe it could be easier to talk in u-boot IRC?

2018-03-06 15:55 GMT+01:00 Jagan Teki :

> Hi Michael, Vincent,
>
> On Tue, Mar 6, 2018 at 7:57 PM, Vincent Prince
>  wrote:
> > Hi all,
> >
> > Jagan , do you confirm your mx6_usb_sdp_spl.conf contains the 3rd line?
> >
> > mx6_spl_sdp
> > hid,uboot_header,1024,0x91,0x1000,512M,0x0090,0x4
> > u-boot-dtb.img:jump header2
> >
> > 2018-03-06 15:18 GMT+01:00 Michael Nazzareno Trimarchi <
> > mich...@amarulasolutions.com>:
> >
> >> Hi Jagan
> >>
> >> There is a git log for that configuration file. I have the impression
> >> that is done in two steps
>
> Yes, I've verified the single command to download SPL and u-boot-dtb.img
>
> imx_usb.conf
>  0x15a2:0x0054, mx6_usb_rom.conf, 0x0525:0xb4a4, mx6_usb_sdp_spl.conf
>
> mx6_usb_rom.conf
>  mx6_qsb
>  hid,1024,0x91,0x1000,512M,0x0090,0x4
>  SPL:jump header2
>
> mx6_usb_sdp_spl.conf
>  mx6_spl_sdp
>  hid,uboot_header,1024,0x91,0x1000,512M,0x0090,0x4
>  u-boot-dtb.img:jump header2
>
> Here is the download log [1], seems like the load_size and load_addr
> were mismatch or unrecognised
>
> Can anyone send the working download log?
>
> [1] https://paste.ubuntu.com/p/mrSmdPRHb7/
>
> Jagan.
>
> --
> Jagan Teki
> Free Software Engineer | www.openedev.com
> U-Boot, Linux | Upstream Maintainer
> Hyderabad, India.
>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] imx6: USB SDP failed for u-boot-dtb.img

2018-03-06 Thread Jagan Teki
Hi Michael, Vincent,

On Tue, Mar 6, 2018 at 7:57 PM, Vincent Prince
 wrote:
> Hi all,
>
> Jagan , do you confirm your mx6_usb_sdp_spl.conf contains the 3rd line?
>
> mx6_spl_sdp
> hid,uboot_header,1024,0x91,0x1000,512M,0x0090,0x4
> u-boot-dtb.img:jump header2
>
> 2018-03-06 15:18 GMT+01:00 Michael Nazzareno Trimarchi <
> mich...@amarulasolutions.com>:
>
>> Hi Jagan
>>
>> There is a git log for that configuration file. I have the impression
>> that is done in two steps

Yes, I've verified the single command to download SPL and u-boot-dtb.img

imx_usb.conf
 0x15a2:0x0054, mx6_usb_rom.conf, 0x0525:0xb4a4, mx6_usb_sdp_spl.conf

mx6_usb_rom.conf
 mx6_qsb
 hid,1024,0x91,0x1000,512M,0x0090,0x4
 SPL:jump header2

mx6_usb_sdp_spl.conf
 mx6_spl_sdp
 hid,uboot_header,1024,0x91,0x1000,512M,0x0090,0x4
 u-boot-dtb.img:jump header2

Here is the download log [1], seems like the load_size and load_addr
were mismatch or unrecognised

Can anyone send the working download log?

[1] https://paste.ubuntu.com/p/mrSmdPRHb7/

Jagan.

-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/2] imx7: spl: Check for Serial Downloader in spl_boot_device

2018-03-06 Thread Eran Matityahu
Similarly to imx6, before reading the boot device, first check
bmode to see if the serial downloader has been selected
explicitly, then check whether the serial downloader has been
activated due to unbootable primary boot devices (e.g. empty eMMC).

If the serial downloader is activated, return BOOT_DEVICE_BOARD.
This allows SPL with SDP support to wait for the U-Boot image
to be loaded via the serial download protocol using imx_usb_loader.

Signed-off-by: Eran Matityahu 
---
 arch/arm/mach-imx/spl.c | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index b2521b2..6fc2463 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -101,6 +101,29 @@ u32 spl_boot_device(void)
 /* Translate iMX7/MX8M boot device to the SPL boot device enumeration */
 u32 spl_boot_device(void)
 {
+#if defined(CONFIG_MX7)
+   unsigned int bmode = readl(_base->sbmr2);
+
+   /*
+* Check for BMODE if serial downloader is enabled
+* BOOT_MODE - see IMX7DRM Table 6-24
+*/
+   if (((bmode >> 24) & 0x03) == 0x01) /* Serial Downloader */
+   return BOOT_DEVICE_BOARD;
+
+   /*
+* The above method does not detect that the boot ROM used
+* serial downloader in case the boot ROM decided to use the
+* serial downloader as a fall back (primary boot source failed).
+*
+* Infer that the boot ROM used the USB serial downloader by
+* checking whether the USB PHY is currently active... This
+* assumes that SPL did not (yet) initialize the USB PHY...
+*/
+   if (is_boot_from_usb())
+   return BOOT_DEVICE_BOARD;
+#endif
+
enum boot_device boot_device_spl = get_boot_device();
 
switch (boot_device_spl) {
-- 
1.9.1

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


[U-Boot] [PATCH 1/2] imx7: Add src_base structure define macro

2018-03-06 Thread Eran Matityahu
Add src_base structure global define macro, similarly to imx6

Signed-off-by: Eran Matityahu 
---
 arch/arm/include/asm/arch-mx7/imx-regs.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/include/asm/arch-mx7/imx-regs.h 
b/arch/arm/include/asm/arch-mx7/imx-regs.h
index 3726f02..0cdb508 100644
--- a/arch/arm/include/asm/arch-mx7/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx7/imx-regs.h
@@ -264,6 +264,8 @@ struct src {
u32 ddrc_rcr;
 };
 
+#define src_base ((struct src *)SRC_BASE_ADDR)
+
 #define SRC_M4_REG_OFFSET  0xC
 #define SRC_M4C_NON_SCLR_RST_OFFSET0
 #define SRC_M4C_NON_SCLR_RST_MASK  BIT(0)
-- 
1.9.1

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


Re: [U-Boot] [PATCH 1/2] mmc: add HS400 support

2018-03-06 Thread Jean-Jacques Hiblot



On 06/03/2018 02:46, Peng Fan wrote:

Hi,
On Mon, Mar 05, 2018 at 05:29:08PM +0100, Jean-Jacques Hiblot wrote:

Hi Peng,

I'm glad you are adding HS400 support. Thanks.


On 05/03/2018 10:11, Peng Fan wrote:

Add HS400 support.
Selecting HS400 needs first select HS199 according to spec, so use
a dedicated function for HS400.
Add HS400 related macros.
Remove the restriction of only using the low 6 bits of
EXT_CSD_CARD_TYPE, using all the 8 bits.

Signed-off-by: Peng Fan 
Cc: Jaehoon Chung 
Cc: Jean-Jacques Hiblot 
Cc: Stefano Babic 
Cc: Simon Glass 
Cc: Kishon Vijay Abraham I 
Cc: Bin Meng 
---
  drivers/mmc/Kconfig |   7 +++
  drivers/mmc/mmc.c   | 133 ++--
  include/mmc.h   |  12 +
  3 files changed, 127 insertions(+), 25 deletions(-)

diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 5f67e336db..e9be18b333 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -104,6 +104,13 @@ config SPL_MMC_UHS_SUPPORT
  cards. The IO voltage must be switchable from 3.3v to 1.8v. The bus
  frequency can go up to 208MHz (SDR104)
+config MMC_HS400_SUPPORT
+   bool "enable HS400 support"
+   select MMC_HS200_SUPPORT

I'd use "depends on" instead of select or maybe use the same option
for both HS200 and HS400

+   help
+ The HS400 mode is support by some eMMC. The bus frequency is up to
+ 200MHz. This mode requires tuning the IO.
+
  config MMC_HS200_SUPPORT
bool "enable HS200 support"
help
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 92ea78b8af..eef229c8b4 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -169,6 +169,7 @@ const char *mmc_mode_name(enum bus_mode mode)
  [MMC_HS_52]   = "MMC High Speed (52MHz)",
  [MMC_DDR_52]  = "MMC DDR52 (52MHz)",
  [MMC_HS_200]  = "HS200 (200MHz)",
+ [MMC_HS_400]  = "HS400 (200MHz)",
};
if (mode >= MMC_MODES_END)
@@ -193,6 +194,7 @@ static uint mmc_mode2freq(struct mmc *mmc, enum bus_mode 
mode)
  [UHS_DDR50]   = 5000,
  [UHS_SDR104]  = 20800,
  [MMC_HS_200]  = 2,
+ [MMC_HS_400]  = 2,
};
if (mode == MMC_LEGACY)
@@ -790,6 +792,11 @@ static int mmc_set_card_speed(struct mmc *mmc, enum 
bus_mode mode)
case MMC_HS_200:
speed_bits = EXT_CSD_TIMING_HS200;
break;
+#endif
+#if CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)
+   case MMC_HS_400:
+   speed_bits = EXT_CSD_TIMING_HS400;
+   break;
  #endif
case MMC_LEGACY:
speed_bits = EXT_CSD_TIMING_LEGACY;
@@ -837,7 +844,7 @@ static int mmc_get_capabilities(struct mmc *mmc)
mmc->card_caps |= MMC_MODE_4BIT | MMC_MODE_8BIT;
-   cardtype = ext_csd[EXT_CSD_CARD_TYPE] & 0x3f;
+   cardtype = ext_csd[EXT_CSD_CARD_TYPE];
mmc->cardtype = cardtype;
  #if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)
@@ -845,6 +852,12 @@ static int mmc_get_capabilities(struct mmc *mmc)
EXT_CSD_CARD_TYPE_HS200_1_8V)) {
mmc->card_caps |= MMC_MODE_HS200;
}
+#endif
+#if CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)
+   if (cardtype & (EXT_CSD_CARD_TYPE_HS400_1_2V |
+   EXT_CSD_CARD_TYPE_HS400_1_8V)) {
+   mmc->card_caps |= MMC_MODE_HS400;
+   }
  #endif
if (cardtype & EXT_CSD_CARD_TYPE_52) {
if (cardtype & EXT_CSD_CARD_TYPE_DDR_52)
@@ -1748,6 +1761,12 @@ static int mmc_set_lowest_voltage(struct mmc *mmc, enum 
bus_mode mode,
u32 card_mask = 0;
switch (mode) {
+   case MMC_HS_400:
+   if (mmc->cardtype & EXT_CSD_CARD_TYPE_HS400_1_8V)
+   card_mask |= MMC_SIGNAL_VOLTAGE_180;
+   if (mmc->cardtype & EXT_CSD_CARD_TYPE_HS400_1_2V)
+   card_mask |= MMC_SIGNAL_VOLTAGE_120;
+   break;
case MMC_HS_200:
if (mmc->cardtype & EXT_CSD_CARD_TYPE_HS200_1_8V)
card_mask |= MMC_SIGNAL_VOLTAGE_180;
@@ -1787,6 +1806,13 @@ static inline int mmc_set_lowest_voltage(struct mmc 
*mmc, enum bus_mode mode,
  #endif
  static const struct mode_width_tuning mmc_modes_by_pref[] = {
+#if CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)
+   {
+   .mode = MMC_HS_400,
+   .widths = MMC_MODE_8BIT | MMC_MODE_4BIT,
+   .tuning = MMC_CMD_SEND_TUNING_BLOCK_HS200
+   },
+#endif
  #if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)
{
.mode = MMC_HS_200,
@@ -1830,6 +1856,54 @@ static const struct ext_csd_bus_width {
{MMC_MODE_1BIT, false, EXT_CSD_BUS_WIDTH_1},
  };
+#if CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)
+static int mmc_select_hs400(struct mmc *mmc)
+{
+   int err;

Re: [U-Boot] [PATCH v3 00/13] LS1012A PFE driver patch series

2018-03-06 Thread Calvin Johnson
Hi Joe,

Thanks for reviewing all the patches.

> -Original Message-
> From: Calvin Johnson [mailto:calvin.john...@nxp.com]
> Sent: Saturday, March 3, 2018 11:14 PM
> To: u-boot@lists.denx.de; Joe Hershberger 
> Cc: Anji Jagarlmudi ; York Sun ;
> Calvin Johnson ; Prabhakar Kushwaha
> ; Bhaskar Upadhaya
> 
> Subject: [PATCH v3 00/13] LS1012A PFE driver patch series
> 
> 
> This patch series introduces U-Boot support for NXP's LS1012A Packet
> Forwarding Engine (pfe_eth). LS1012A uses hardware packet forwarding
> engine to provide high performance Ethernet interfaces. The device
> includes two Ethernet ports.
 

Regards
Calvin

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


Re: [U-Boot] [PATCH] libfdt: move headers to and

2018-03-06 Thread Tom Rini
On Tue, Mar 06, 2018 at 09:39:55AM +0100, Paul Kocialkowski wrote:
> Hi,
> 
> On Mon, 2018-03-05 at 01:20 +0900, Masahiro Yamada wrote:
> > Thomas reported U-Boot failed to build host tools if libfdt-devel
> > package is installed because tools include libfdt headers from
> > /usr/include/ instead of using internal ones.
> 
> Sorry for being late to the party here, but isn't this issue fixed by
> the patch I sent a few days ago "tools: Include U-Boot libfdt headers
> from their actual path": https://patchwork.ozlabs.org/patch/880924/ ?
> 
> I doubt we need to keep both changes here. What do you think?

I did both, intentionally.  This patch fails for me on host tools,
without your patch.  However, trying harder to match the Linux kernel
structure will be helpful long term I think.

-- 
Tom


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


Re: [U-Boot] imx6: USB SDP failed for u-boot-dtb.img

2018-03-06 Thread Vincent Prince
Hi all,

Jagan , do you confirm your mx6_usb_sdp_spl.conf contains the 3rd line?

mx6_spl_sdp
hid,uboot_header,1024,0x91,0x1000,512M,0x0090,0x4
u-boot-dtb.img:jump header2

BR,
Vincent

2018-03-06 15:18 GMT+01:00 Michael Nazzareno Trimarchi <
mich...@amarulasolutions.com>:

> Hi Jagan
>
> There is a git log for that configuration file. I have the impression
> that is done in two steps
>
> Michael
>
> On Tue, Mar 6, 2018 at 3:16 PM, Stefano Babic  wrote:
> > On 06/03/2018 15:12, Jagan Teki wrote:
> >> On Tue, Mar 6, 2018 at 6:46 PM, Fabio Estevam 
> wrote:
> >>> Hi Jagan,
> >>>
> >>> On Tue, Mar 6, 2018 at 9:25 AM, Jagan Teki 
> wrote:
>  Hi,
> 
>  U-Boot SPL 2018.03-rc3-00111-g0cb2734156-dirty (Mar 06 2018 -
> 17:19:36 +0530)
>  Trying to boot from USB SDP
>  SDP: initialize...
>  SDP: handle requests...
> 
>  and SPL reenumerated USB VID/PID as
>  [24774.255201] usb 1-2: new high-speed USB device number 101 using
> xhci_hcd
>  [24774.425174] usb 1-2: New USB device found, idVendor=0525,
> idProduct=b4a4
>  [24774.425181] usb 1-2: New USB device strings: Mfr=1, Product=2,
> SerialNumber=0
>  [24774.425185] usb 1-2: Product: USB download gadget
>  [24774.425189] usb 1-2: Manufacturer: FSL
>  [24774.433598] hid-generic 0003:0525:B4A4.005C: hiddev97,hidraw2: USB
>  HID v1.10 Device [FSL USB download gadget]
> 
>  Now I've launched u-boot-dtb.img
> 
>  $ imx_usb u-boot-dtb.img
>  ...
>  vid=0x0525 pid=0xb4a4 file_name=mx6_usb_sdp_spl.conf
>  config file <.//mx6_usb_sdp_spl.conf>
>  parse .//mx6_usb_sdp_spl.conf
>  Trying to open device vid=0x0525 pid=0xb4a4
>  Interface 0 claimed
>  HAB security state: development mode (0x56787856)
>  == work item
>  filename /work/code/u-boot/u-boot-dtb.img
>  load_size 0 bytes
>  load_addr 0x
>  dcd 1
>  clear_dcd 0
>  plug 1
>  jump_mode 2
>  jump_addr 0x
>  == end work item
> 
>  unknown load address
>  DoIRomDownload failed, err=-3
>  HAB security state: development mode (0x56787856)
> 
>  Here is mx6_usb_sdp_spl.conf file
> mx6_spl_sdp
> hid,uboot_header,1024,0x91,0x1000,512M,0x0090,0x4
> 
>  Look like the u-boot-dtb.img has FIT header and imx_usb can't process
>  the same, any help?
> >>>
> >>> Is this a regression? If so, are you able to run a 'git bisect'?
> >>
> >> I don't think it's regression, I'm guessing this is first test with
> >> u-boot-dtb.img or did you tested the similar image type?
> >>
> >
> > Never tested with u-boot-dtb.img, it worked fine with u-boot.img
> >
> > Best regards,
> > Stefano
> >
> > --
> > =
> > DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
> > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> > Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
> > =
> > ___
> > U-Boot mailing list
> > U-Boot@lists.denx.de
> > https://lists.denx.de/listinfo/u-boot
>
>
>
> --
> | Michael Nazzareno Trimarchi Amarula Solutions BV |
> | COO  -  Founder  Cruquiuskade 47 |
> | +31(0)851119172 Amsterdam 1018 AM NL |
> |  [`as] http://www.amarulasolutions.com   |
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 00/16] arm: stm32mp1: add initial support for STM32MP157

2018-03-06 Thread Patrick DELAUNAY
Hi Vikas

> From: Vikas MANOCHA
> 
> Hi Patrick,
> 
> On 03/05/2018 06:24 AM, Patrick Delaunay wrote:
> >
> > This patch-set adds initial support of STMicroelectronics STM32MP157
> I see patches for ram driver, armv7 generic, stm32f7  etc. in this patchset.
> Please split the stuff other than STM32MP1 support in separate patch/patchset.

Yes I push all the needed patches for the new arch in one Thread as it was done 
for other platform,

It is to explain why I modify each part and follow the dependency.

But I can split the patches in several patchset if it is more clear, if it is 
request requested by Tom Rini or by other reviewer.

1/ generic support update => separate patch for each impact

> >   spl: add SPL_RESET_SUPPORT
> >   common: add a prototype for mach_cpu_init()
> >   arm: armv7: solve issue for timer_rate_hz in arch timer

2/ stm32 driver update => on patch for each impact

> >   dm: gpio: Convert stm32f7 driver to livetree
> >   gpio: stm32f7_gpio: handle node ngpios
> >   stm32mp: stm32f7_i2c: use calloc instead of kmalloc

3/ on thread only for STM32MP157 support (arch, driver and board)
 
> >   tools/mkimage: add support for STM32 image format
> >   arm: stm32: add new architecture for STM32MP family
> >   ram: stm32mp1: add driver
> >   pmic: add stpmu1 support
> >   pinctrl: stm32: update pincontrol for stmp32mp157
> >   reset: stm32: adapt driver for stm32mp1
> >   clk: add driver for stm32mp1
> >   clk: stm32mp1: add clock tree initialization
> >   dts: add device tree for STM32MP157C-ED1 board
> >   board: st: add generic board for STM32MP1 family

> Cheers,
> Vikas

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


Re: [U-Boot] imx6: USB SDP failed for u-boot-dtb.img

2018-03-06 Thread Michael Nazzareno Trimarchi
Hi Jagan

There is a git log for that configuration file. I have the impression
that is done in two steps

Michael

On Tue, Mar 6, 2018 at 3:16 PM, Stefano Babic  wrote:
> On 06/03/2018 15:12, Jagan Teki wrote:
>> On Tue, Mar 6, 2018 at 6:46 PM, Fabio Estevam  wrote:
>>> Hi Jagan,
>>>
>>> On Tue, Mar 6, 2018 at 9:25 AM, Jagan Teki  wrote:
 Hi,

 U-Boot SPL 2018.03-rc3-00111-g0cb2734156-dirty (Mar 06 2018 - 17:19:36 
 +0530)
 Trying to boot from USB SDP
 SDP: initialize...
 SDP: handle requests...

 and SPL reenumerated USB VID/PID as
 [24774.255201] usb 1-2: new high-speed USB device number 101 using xhci_hcd
 [24774.425174] usb 1-2: New USB device found, idVendor=0525, idProduct=b4a4
 [24774.425181] usb 1-2: New USB device strings: Mfr=1, Product=2, 
 SerialNumber=0
 [24774.425185] usb 1-2: Product: USB download gadget
 [24774.425189] usb 1-2: Manufacturer: FSL
 [24774.433598] hid-generic 0003:0525:B4A4.005C: hiddev97,hidraw2: USB
 HID v1.10 Device [FSL USB download gadget]

 Now I've launched u-boot-dtb.img

 $ imx_usb u-boot-dtb.img
 ...
 vid=0x0525 pid=0xb4a4 file_name=mx6_usb_sdp_spl.conf
 config file <.//mx6_usb_sdp_spl.conf>
 parse .//mx6_usb_sdp_spl.conf
 Trying to open device vid=0x0525 pid=0xb4a4
 Interface 0 claimed
 HAB security state: development mode (0x56787856)
 == work item
 filename /work/code/u-boot/u-boot-dtb.img
 load_size 0 bytes
 load_addr 0x
 dcd 1
 clear_dcd 0
 plug 1
 jump_mode 2
 jump_addr 0x
 == end work item

 unknown load address
 DoIRomDownload failed, err=-3
 HAB security state: development mode (0x56787856)

 Here is mx6_usb_sdp_spl.conf file
mx6_spl_sdp
hid,uboot_header,1024,0x91,0x1000,512M,0x0090,0x4

 Look like the u-boot-dtb.img has FIT header and imx_usb can't process
 the same, any help?
>>>
>>> Is this a regression? If so, are you able to run a 'git bisect'?
>>
>> I don't think it's regression, I'm guessing this is first test with
>> u-boot-dtb.img or did you tested the similar image type?
>>
>
> Never tested with u-boot-dtb.img, it worked fine with u-boot.img
>
> Best regards,
> Stefano
>
> --
> =
> DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
> =
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot



-- 
| Michael Nazzareno Trimarchi Amarula Solutions BV |
| COO  -  Founder  Cruquiuskade 47 |
| +31(0)851119172 Amsterdam 1018 AM NL |
|  [`as] http://www.amarulasolutions.com   |
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] imx6: USB SDP failed for u-boot-dtb.img

2018-03-06 Thread Stefano Babic
On 06/03/2018 15:12, Jagan Teki wrote:
> On Tue, Mar 6, 2018 at 6:46 PM, Fabio Estevam  wrote:
>> Hi Jagan,
>>
>> On Tue, Mar 6, 2018 at 9:25 AM, Jagan Teki  wrote:
>>> Hi,
>>>
>>> U-Boot SPL 2018.03-rc3-00111-g0cb2734156-dirty (Mar 06 2018 - 17:19:36 
>>> +0530)
>>> Trying to boot from USB SDP
>>> SDP: initialize...
>>> SDP: handle requests...
>>>
>>> and SPL reenumerated USB VID/PID as
>>> [24774.255201] usb 1-2: new high-speed USB device number 101 using xhci_hcd
>>> [24774.425174] usb 1-2: New USB device found, idVendor=0525, idProduct=b4a4
>>> [24774.425181] usb 1-2: New USB device strings: Mfr=1, Product=2, 
>>> SerialNumber=0
>>> [24774.425185] usb 1-2: Product: USB download gadget
>>> [24774.425189] usb 1-2: Manufacturer: FSL
>>> [24774.433598] hid-generic 0003:0525:B4A4.005C: hiddev97,hidraw2: USB
>>> HID v1.10 Device [FSL USB download gadget]
>>>
>>> Now I've launched u-boot-dtb.img
>>>
>>> $ imx_usb u-boot-dtb.img
>>> ...
>>> vid=0x0525 pid=0xb4a4 file_name=mx6_usb_sdp_spl.conf
>>> config file <.//mx6_usb_sdp_spl.conf>
>>> parse .//mx6_usb_sdp_spl.conf
>>> Trying to open device vid=0x0525 pid=0xb4a4
>>> Interface 0 claimed
>>> HAB security state: development mode (0x56787856)
>>> == work item
>>> filename /work/code/u-boot/u-boot-dtb.img
>>> load_size 0 bytes
>>> load_addr 0x
>>> dcd 1
>>> clear_dcd 0
>>> plug 1
>>> jump_mode 2
>>> jump_addr 0x
>>> == end work item
>>>
>>> unknown load address
>>> DoIRomDownload failed, err=-3
>>> HAB security state: development mode (0x56787856)
>>>
>>> Here is mx6_usb_sdp_spl.conf file
>>>mx6_spl_sdp
>>>hid,uboot_header,1024,0x91,0x1000,512M,0x0090,0x4
>>>
>>> Look like the u-boot-dtb.img has FIT header and imx_usb can't process
>>> the same, any help?
>>
>> Is this a regression? If so, are you able to run a 'git bisect'?
> 
> I don't think it's regression, I'm guessing this is first test with
> u-boot-dtb.img or did you tested the similar image type?
> 

Never tested with u-boot-dtb.img, it worked fine with u-boot.img

Best regards,
Stefano

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] imx6: USB SDP failed for u-boot-dtb.img

2018-03-06 Thread Fabio Estevam
On Tue, Mar 6, 2018 at 11:12 AM, Jagan Teki  wrote:

> I don't think it's regression, I'm guessing this is first test with
> u-boot-dtb.img or did you tested the similar image type?

I have only used u-boot.img on my tests with SDP.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] imx6: USB SDP failed for u-boot-dtb.img

2018-03-06 Thread Jagan Teki
On Tue, Mar 6, 2018 at 6:46 PM, Fabio Estevam  wrote:
> Hi Jagan,
>
> On Tue, Mar 6, 2018 at 9:25 AM, Jagan Teki  wrote:
>> Hi,
>>
>> U-Boot SPL 2018.03-rc3-00111-g0cb2734156-dirty (Mar 06 2018 - 17:19:36 +0530)
>> Trying to boot from USB SDP
>> SDP: initialize...
>> SDP: handle requests...
>>
>> and SPL reenumerated USB VID/PID as
>> [24774.255201] usb 1-2: new high-speed USB device number 101 using xhci_hcd
>> [24774.425174] usb 1-2: New USB device found, idVendor=0525, idProduct=b4a4
>> [24774.425181] usb 1-2: New USB device strings: Mfr=1, Product=2, 
>> SerialNumber=0
>> [24774.425185] usb 1-2: Product: USB download gadget
>> [24774.425189] usb 1-2: Manufacturer: FSL
>> [24774.433598] hid-generic 0003:0525:B4A4.005C: hiddev97,hidraw2: USB
>> HID v1.10 Device [FSL USB download gadget]
>>
>> Now I've launched u-boot-dtb.img
>>
>> $ imx_usb u-boot-dtb.img
>> ...
>> vid=0x0525 pid=0xb4a4 file_name=mx6_usb_sdp_spl.conf
>> config file <.//mx6_usb_sdp_spl.conf>
>> parse .//mx6_usb_sdp_spl.conf
>> Trying to open device vid=0x0525 pid=0xb4a4
>> Interface 0 claimed
>> HAB security state: development mode (0x56787856)
>> == work item
>> filename /work/code/u-boot/u-boot-dtb.img
>> load_size 0 bytes
>> load_addr 0x
>> dcd 1
>> clear_dcd 0
>> plug 1
>> jump_mode 2
>> jump_addr 0x
>> == end work item
>>
>> unknown load address
>> DoIRomDownload failed, err=-3
>> HAB security state: development mode (0x56787856)
>>
>> Here is mx6_usb_sdp_spl.conf file
>>mx6_spl_sdp
>>hid,uboot_header,1024,0x91,0x1000,512M,0x0090,0x4
>>
>> Look like the u-boot-dtb.img has FIT header and imx_usb can't process
>> the same, any help?
>
> Is this a regression? If so, are you able to run a 'git bisect'?

I don't think it's regression, I'm guessing this is first test with
u-boot-dtb.img or did you tested the similar image type?
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] RPi3 Not autobooting from SD-card. {Scanned}

2018-03-06 Thread Göran Lundberg
Can anyone share their working u-boot configuration for RPi3? With a 
working graphics mode and device tree overlay. config.txt boot.scr and 
any other config files you might have.

I'm running a normal Raspbian Stretch lite image with stock 32bit kernel.
I compiled u-boot with |rpi_3_32b_defconfig|

/Göran Lundberg

On 2018-03-06 14:42, Göran Lundberg wrote:


I got it autobooting by adding enable_uart=1 to /boot/config.txt

But it seems like a bug that could be fixed, since it was booting, but
only manually.
Anyone got an idea what might cause this?

But the graphics mode is all wrong. The four raspberrys are purple and
the resolution is extremely low.
In u-boot, the graphics is ok in high resolution, but when booting the
kernel it all changes.
I'm guessing it's got something to do with the device tree not loading
properly.

I finally got a serial console working. Here's the output:

U-Boot 2018.03-rc3-00090-g3990c9d627 (Mar 01 2018 - 15:51:26 +0100)

DRAM:  998 MiB
RPI 3 Model B (0xa02082)
MMC:   mmc@7e202000: 0, sdhci@7e30: 1
Loading Environment from FAT... *** Warning - bad CRC, using default 
environment


Failed (-5)
In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
starting USB...
USB0:   Core Release: 2.80a
scanning bus 0 for devices... 4 USB Device(s) found
   scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
915 bytes read in 4 ms (222.7 KiB/s)
## Executing script at 0200
switch to partitions #0, OK
mmc0 is current device
4579632 bytes read in 198 ms (22.1 MiB/s)
17794 bytes read in 3 ms (5.7 MiB/s)
Kernel image @ 0x100 [ 0x00 - 0x45e130 ]
## Flattened Device Tree blob at 2effb600
   Booting using the fdt blob at 0x2effb600
   reserving fdt memory region: addr=0 size=1000
   Using Device Tree in place at 2effb600, end 2f002b81

Starting kernel ...

Any idea what is wrong here:

  Loading Environment from FAT... *** Warning - bad CRC, using default 
environment


I don't have an env file on the SD-card. So how can it give a CRC error?
I tried to use saveenv at the u-boot prompt but i got an infinite
repeating error.
  fsm 1, hsts 0001

And this line:

  reserving fdt memory region: addr=0 size=1000

Why is addr=0? And size=1000 seems low?
But on the next line the size seems right.

Here's my boot.scr:

setenv fdtfile bcm2710-rpi-3-b.dtb
mmc dev 0
fatload mmc 0:1 ${kernel_addr_r} kernel7.img
fatload mmc 0:1 ${fdt_addr} ${fdtfile}
setenv bootargs earlyprintk console=tty0 root=/dev/mmcblk0p2
rootfstype=ext4 noinitrd rootwait dwc_otg.lpm_enable=0 elevator=deadline
bootz ${kernel_addr_r} - ${fdt_addr}

Any help appreciated!

On 2018-03-02 20:55, Peter Robinson wrote:
On Fri, Mar 2, 2018 at 10:47 AM, Göran Lundberg 
 wrote:

Hi!
I'm trying to boot from u-boot on a Raspberry Pi 3. But for some 
reason it

isn't autobooting on the SD-card.

Is it possible to get more debug output on the screen console? I 
don't have

a serial console at the moment.
The output on the screen is:

Net:   No ehternet found.
starting USB...
USB:    Core Release 2.80a
scanning bus 0 for devices... 4 USB Devices found
    scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:   0
U-Boot>

Shouldn't it mention mmc somewhere in the boot message?

The first command I type on the prompt is always failing, it's not
outputting anything. Just a new prompt on the next line. The next 
commands i

type in are working. Which seems strange.
I got boot.scr set up right, except graphic settings which are 
wrong. It is

booting the kernel when I type 'run bootcmd'. But only after I type in
another command before it.
It seems like it's not detecting the SD-card (mmc0) until I have typed
anything into the prompt.

Do I have to set any other env variable for it to autoboot? I would 
have

printed the output of printenv here, but since I don't have a serial
console, retyping everything is very time consuming.
printenv seems to have the right settings. It's basically a full 
console

screen of variables. It just doesn't seem to load them until I type in
another command before it.

boot_targets=mmc0 usb0 pxe dhcp
Which seems right to me.

I compiled the latest u-boot from github.

If you need more info please let me know and I'll post it.

Hope that anyone can point me in the right direction here. Would really
appreciate it.

I'm seeing the same issues with 2018.03 rc3.

I'm not sure what the issue is and I've not had time to investigate it
further yet, but if you type "boot" and hit enter it should boot,
sometimes you actually have to type it twice. It will boot but I'm not
sure which bits here have causes this regression.

Peter




On 2018-03-02 20:55, Peter Robinson wrote:
On Fri, Mar 2, 2018 at 10:47 AM, Göran Lundberg 
 wrote:

Hi!
I'm trying to boot from u-boot on 

Re: [U-Boot] [ANN] U-Boot v2018.03-rc4 released

2018-03-06 Thread Tom Rini
On Tue, Mar 06, 2018 at 12:47:28PM +, Peter Robinson wrote:
> On Tue, Mar 6, 2018 at 12:29 PM, Jonathan Gray  wrote:
> > On Tue, Mar 06, 2018 at 11:36:37AM +, Peter Robinson wrote:
> >> On Tue, Mar 6, 2018 at 1:28 AM, Tom Rini  wrote:
> >> > Hey all,
> >> >
> >> > It's release day and I've released v2018.03-rc4.  I've included a few
> >> > different regression fixes I've seen along with some fixes and cleanups.
> >> > I would like to do the release on March 12th, and likely will so long as
> >> > no big regressions show up.  I am worried about the RPi3 issue I've seen
> >> > reported.  Are there any other issues people know of currently?
> >> >
> >> > And to repeat myself again, boards and SoC families, etc, that have been
> >> > orphaned for more than a year should probably get dropped.  I've
> >> > contacted a few people off-list (which is why we've had a few pickups of
> >> > late) for things, but if you know someone that would be interested in
> >> > something, please speak up.
> >>
> >> Just a heads up that I've seen a regression in building i.MX6
> >> platforms from rc3 with this:
> >>
> >> /builddir/build/BUILD/u-boot-2018.03-rc4/arch/arm/mach-imx/spl.c:160:5:
> >> error: redefinition of 'spl_boot_mode'
> >>  u32 spl_boot_mode(const u32 boot_device)
> >>  ^
> >> /builddir/build/BUILD/u-boot-2018.03-rc4/arch/arm/mach-imx/spl.c:137:5:
> >> note: previous definition of 'spl_boot_mode' was here
> >>  u32 spl_boot_mode(const u32 boot_device)
> >>  ^
> >> make[3]: *** 
> >> [/builddir/build/BUILD/u-boot-2018.03-rc4/scripts/Makefile.build:280:
> >> spl/arch/arm/mach-imx/spl.o] Error 1
> >> make[2]: *** 
> >> [/builddir/build/BUILD/u-boot-2018.03-rc4/scripts/Makefile.spl:351:
> >> spl/arch/arm/mach-imx] Error 2
> >> make[2]: *** Waiting for unfinished jobs
> >>
> >> I've not had time to dig further just yet, just wanted to give people
> >> a heads up.
> >
> > mx6cuboxi builds/runs fine here with
> > 5e62f828256d66e2b28def4f9ef20a2a05c2d04f/v2018.03-rc4
> > and linaro gcc 6.3-2017.02
> 
> This is Fedora 28 with gcc 8 and possibly some extra hardending flags

Some extra patches?  There's only 1 spl_boot_mode in
arch/arm/mach-imx/spl.c and line 160 is a comment here.

-- 
Tom


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


Re: [U-Boot] RPi3 Not autobooting from SD-card. {Scanned}

2018-03-06 Thread Göran Lundberg

Yes i did that as I explained in my last message. And now it autoboots.

But why doesn't it autoboot without it?  Why is UART required to autoboot?

If I don't have that line in confg.txt I can manually boot with 'boot' 
'run boot_cmd' without a problem.
So it's not really problem with the boot itself. Just the automatic 
boot. And why doesn't the u-boot command prompt interpret the first 
command that is issued when enable_uart is disabled?


This seems like an issue that could be fixed.

/Göran Lundberg


On 2018-03-06 14:12, Alexander Graf wrote:

On 03/06/2018 01:55 PM, Jonathan Gray wrote:

On Mon, Mar 05, 2018 at 06:18:59PM +, Peter Robinson wrote:

Hi!
I'm trying to boot from u-boot on a Raspberry Pi 3. But for some 
reason

it
isn't autobooting on the SD-card.

Is it possible to get more debug output on the screen console? I 
don't

have
a serial console at the moment.
The output on the screen is:

Net:   No ehternet found.
starting USB...
USB:    Core Release 2.80a
scanning bus 0 for devices... 4 USB Devices found
 scanning usb for storage devices... 0 Storage Device(s) 
found

Hit any key to stop autoboot:   0
U-Boot>

Shouldn't it mention mmc somewhere in the boot message?

The first command I type on the prompt is always failing, it's not
outputting anything. Just a new prompt on the next line. The next
commands i
type in are working. Which seems strange.
I got boot.scr set up right, except graphic settings which are 
wrong. It

is
booting the kernel when I type 'run bootcmd'. But only after I 
type in

another command before it.
It seems like it's not detecting the SD-card (mmc0) until I have 
typed

anything into the prompt.

Do I have to set any other env variable for it to autoboot? I 
would have

printed the output of printenv here, but since I don't have a serial
console, retyping everything is very time consuming.
printenv seems to have the right settings. It's basically a full 
console
screen of variables. It just doesn't seem to load them until I 
type in

another command before it.

boot_targets=mmc0 usb0 pxe dhcp
Which seems right to me.

I compiled the latest u-boot from github.

If you need more info please let me know and I'll post it.

Hope that anyone can point me in the right direction here. Would 
really

appreciate it.

I'm seeing the same issues with 2018.03 rc3.

I'm not sure what the issue is and I've not had time to 
investigate it

further yet, but if you type "boot" and hit enter it should boot,
sometimes you actually have to type it twice. It will boot but I'm 
not

sure which bits here have causes this regression.


I do not see this at all on my RPi3. Maybe it's firmware version 
dependent?

Do you happen to have an image that always fails for you?

2018.03 rc3 with "2018-02-09" firmware (so fairly recent) fails for me.

2018.03 rc4 works fine on rpi_3 here with


Do you have enable_uart=1 in your config.txt? If you do, it works. If 
you don't, it fails :)



Alex

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




--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: [U-Boot] RPi3 Not autobooting from SD-card. {Scanned}

2018-03-06 Thread Göran Lundberg


I got it autobooting by adding enable_uart=1 to /boot/config.txt

But it seems like a bug that could be fixed, since it was booting, but
only manually.
Anyone got an idea what might cause this?

But the graphics mode is all wrong. The four raspberrys are purple and
the resolution is extremely low.
In u-boot, the graphics is ok in high resolution, but when booting the
kernel it all changes.
I'm guessing it's got something to do with the device tree not loading
properly.

I finally got a serial console working. Here's the output:

U-Boot 2018.03-rc3-00090-g3990c9d627 (Mar 01 2018 - 15:51:26 +0100)

DRAM:  998 MiB
RPI 3 Model B (0xa02082)
MMC:   mmc@7e202000: 0, sdhci@7e30: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

Failed (-5)
In:serial
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
starting USB...
USB0:   Core Release: 2.80a
scanning bus 0 for devices... 4 USB Device(s) found
   scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
915 bytes read in 4 ms (222.7 KiB/s)
## Executing script at 0200
switch to partitions #0, OK
mmc0 is current device
4579632 bytes read in 198 ms (22.1 MiB/s)
17794 bytes read in 3 ms (5.7 MiB/s)
Kernel image @ 0x100 [ 0x00 - 0x45e130 ]
## Flattened Device Tree blob at 2effb600
   Booting using the fdt blob at 0x2effb600
   reserving fdt memory region: addr=0 size=1000
   Using Device Tree in place at 2effb600, end 2f002b81

Starting kernel ...

Any idea what is wrong here:

  Loading Environment from FAT... *** Warning - bad CRC, using default 
environment

I don't have an env file on the SD-card. So how can it give a CRC error?
I tried to use saveenv at the u-boot prompt but i got an infinite
repeating error.
  fsm 1, hsts 0001

And this line:

  reserving fdt memory region: addr=0 size=1000

Why is addr=0? And size=1000 seems low?
But on the next line the size seems right.

Here's my boot.scr:

setenv fdtfile bcm2710-rpi-3-b.dtb
mmc dev 0
fatload mmc 0:1 ${kernel_addr_r} kernel7.img
fatload mmc 0:1 ${fdt_addr} ${fdtfile}
setenv bootargs earlyprintk console=tty0 root=/dev/mmcblk0p2
rootfstype=ext4 noinitrd rootwait dwc_otg.lpm_enable=0 elevator=deadline
bootz ${kernel_addr_r} - ${fdt_addr}

Any help appreciated!

On 2018-03-02 20:55, Peter Robinson wrote:

On Fri, Mar 2, 2018 at 10:47 AM, Göran Lundberg  wrote:

Hi!
I'm trying to boot from u-boot on a Raspberry Pi 3. But for some reason it
isn't autobooting on the SD-card.

Is it possible to get more debug output on the screen console? I don't have
a serial console at the moment.
The output on the screen is:

Net:   No ehternet found.
starting USB...
USB:Core Release 2.80a
scanning bus 0 for devices... 4 USB Devices found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:   0
U-Boot>

Shouldn't it mention mmc somewhere in the boot message?

The first command I type on the prompt is always failing, it's not
outputting anything. Just a new prompt on the next line. The next commands i
type in are working. Which seems strange.
I got boot.scr set up right, except graphic settings which are wrong. It is
booting the kernel when I type 'run bootcmd'. But only after I type in
another command before it.
It seems like it's not detecting the SD-card (mmc0) until I have typed
anything into the prompt.

Do I have to set any other env variable for it to autoboot? I would have
printed the output of printenv here, but since I don't have a serial
console, retyping everything is very time consuming.
printenv seems to have the right settings. It's basically a full console
screen of variables. It just doesn't seem to load them until I type in
another command before it.

boot_targets=mmc0 usb0 pxe dhcp
Which seems right to me.

I compiled the latest u-boot from github.

If you need more info please let me know and I'll post it.

Hope that anyone can point me in the right direction here. Would really
appreciate it.

I'm seeing the same issues with 2018.03 rc3.

I'm not sure what the issue is and I've not had time to investigate it
further yet, but if you type "boot" and hit enter it should boot,
sometimes you actually have to type it twice. It will boot but I'm not
sure which bits here have causes this regression.

Peter




On 2018-03-02 20:55, Peter Robinson wrote:

On Fri, Mar 2, 2018 at 10:47 AM, Göran Lundberg  wrote:

Hi!
I'm trying to boot from u-boot on a Raspberry Pi 3. But for some reason it
isn't autobooting on the SD-card.

Is it possible to get more debug output on the screen console? I don't have
a serial console at the moment.
The output on the screen is:

Net:   No ehternet found.
starting USB...
USB:Core Release 2.80a
scanning bus 0 for devices... 4 USB Devices found
scanning usb for storage devices... 

Re: [U-Boot] [UBOOT PATCH v2 1/2] eeprom: Enabled eeprom u-boot headers in defconfig

2018-03-06 Thread Michal Simek
On 1.3.2018 16:37, Michal Simek wrote:
> On 28.2.2018 10:30, Vipul Kumar wrote:
>> This patch enabled eeprom related u-boot headers in
>> the respective defconfig and removed CONFIG_ZYNQ_EEPROM.
>>
>> Signed-off-by: Vipul Kumar 
>> Signed-off-by: Siva Durga Prasad Paladugu 
>> ---
>> - Changes in v2:
>> - Removed CONFIG_ZYNQ_EEPROM for zynqmp.
>> - Enabled configs defined under CONFIG_ZYNQ_EEPROM for zynq
>>   in defconfig and removed CONFIG_ZYNQ_EEPROM.
>> - Branch: u-boot-microblaze/kconfig
>> ---
>>  configs/zynq_zc702_defconfig   | 6 ++
>>  configs/zynq_zc706_defconfig   | 6 ++
>>  include/configs/xilinx_zynqmp_ep.h | 1 -
>>  include/configs/zynq-common.h  | 9 -
>>  include/configs/zynq_zc70x.h   | 2 --
>>  5 files changed, 12 insertions(+), 12 deletions(-)
>>
>> diff --git a/configs/zynq_zc702_defconfig b/configs/zynq_zc702_defconfig
>> index 8e8b800..2970ef8 100644
>> --- a/configs/zynq_zc702_defconfig
>> +++ b/configs/zynq_zc702_defconfig
>> @@ -43,6 +43,12 @@ CONFIG_FPGA_ZYNQPL=y
>>  CONFIG_DM_GPIO=y
>>  CONFIG_SYS_I2C_ZYNQ=y
>>  CONFIG_ZYNQ_I2C0=y
>> +CONFIG_MISC=y
>> +CONFIG_I2C_EEPROM=y
>> +CONFIG_SYS_I2C_EEPROM_ADDR=0x54
>> +CONFIG_SYS_EEPROM_SIZE=1024
>> +CONFIG_SYS_EEPROM_PAGE_WRITE_BITS=4
>> +CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=5
>>  CONFIG_MMC_SDHCI=y
>>  CONFIG_MMC_SDHCI_ZYNQ=y
>>  CONFIG_SPI_FLASH=y
>> diff --git a/configs/zynq_zc706_defconfig b/configs/zynq_zc706_defconfig
>> index 8f83d17..b51567c 100644
>> --- a/configs/zynq_zc706_defconfig
>> +++ b/configs/zynq_zc706_defconfig
>> @@ -43,6 +43,12 @@ CONFIG_FPGA_ZYNQPL=y
>>  CONFIG_DM_GPIO=y
>>  CONFIG_SYS_I2C_ZYNQ=y
>>  CONFIG_ZYNQ_I2C0=y
>> +CONFIG_MISC=y
>> +CONFIG_I2C_EEPROM=y
>> +CONFIG_SYS_I2C_EEPROM_ADDR=0x54
>> +CONFIG_SYS_EEPROM_SIZE=1024
>> +CONFIG_SYS_EEPROM_PAGE_WRITE_BITS=4
>> +CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=5
>>  CONFIG_MMC_SDHCI=y
>>  CONFIG_MMC_SDHCI_ZYNQ=y
>>  CONFIG_SPI_FLASH=y
>> diff --git a/include/configs/xilinx_zynqmp_ep.h 
>> b/include/configs/xilinx_zynqmp_ep.h
>> index 3a572b7..6c48e15 100644
>> --- a/include/configs/xilinx_zynqmp_ep.h
>> +++ b/include/configs/xilinx_zynqmp_ep.h
>> @@ -15,7 +15,6 @@
>>  
>>  #define CONFIG_ZYNQ_SDHCI_MAX_FREQ  5200
>>  #define CONFIG_ZYNQ_SDHCI_MIN_FREQ  (CONFIG_ZYNQ_SDHCI_MAX_FREQ >> 9)
>> -#define CONFIG_ZYNQ_EEPROM
>>  #define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \
>>   ZYNQMP_USB1_XHCI_BASEADDR}
>>  
>> diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
>> index 0ebb66b..4622d39 100644
>> --- a/include/configs/zynq-common.h
>> +++ b/include/configs/zynq-common.h
>> @@ -122,15 +122,6 @@
>>  # define CONFIG_SYS_I2C
>>  #endif
>>  
>> -/* EEPROM */
>> -#ifdef CONFIG_ZYNQ_EEPROM
>> -# define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
>> -# define CONFIG_SYS_I2C_EEPROM_ADDR 0x54
>> -# define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS  4
>> -# define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  5
>> -# define CONFIG_SYS_EEPROM_SIZE 1024 /* Bytes */
>> -#endif
>> -
>>  /* Total Size of Environment Sector */
>>  #define CONFIG_ENV_SIZE (128 << 10)
>>  
>> diff --git a/include/configs/zynq_zc70x.h b/include/configs/zynq_zc70x.h
>> index 720f953..715ea80 100644
>> --- a/include/configs/zynq_zc70x.h
>> +++ b/include/configs/zynq_zc70x.h
>> @@ -10,8 +10,6 @@
>>  #ifndef __CONFIG_ZYNQ_ZC70X_H
>>  #define __CONFIG_ZYNQ_ZC70X_H
>>  
>> -#define CONFIG_ZYNQ_EEPROM
>> -
>>  #include 
>>  
>>  #endif /* __CONFIG_ZYNQ_ZC70X_H */
>>
> 
> Please take a look at this again. I can compile it on zc706.

This should be I can't compile it.

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


Re: [U-Boot] RPi3 Not autobooting from SD-card. {Scanned}

2018-03-06 Thread Jonathan Gray
On Tue, Mar 06, 2018 at 02:12:23PM +0100, Alexander Graf wrote:
> On 03/06/2018 01:55 PM, Jonathan Gray wrote:
> > On Mon, Mar 05, 2018 at 06:18:59PM +, Peter Robinson wrote:
> > > > > > Hi!
> > > > > > I'm trying to boot from u-boot on a Raspberry Pi 3. But for some 
> > > > > > reason
> > > > > > it
> > > > > > isn't autobooting on the SD-card.
> > > > > > 
> > > > > > Is it possible to get more debug output on the screen console? I 
> > > > > > don't
> > > > > > have
> > > > > > a serial console at the moment.
> > > > > > The output on the screen is:
> > > > > > 
> > > > > > Net:   No ehternet found.
> > > > > > starting USB...
> > > > > > USB:Core Release 2.80a
> > > > > > scanning bus 0 for devices... 4 USB Devices found
> > > > > >  scanning usb for storage devices... 0 Storage Device(s) 
> > > > > > found
> > > > > > Hit any key to stop autoboot:   0
> > > > > > U-Boot>
> > > > > > 
> > > > > > Shouldn't it mention mmc somewhere in the boot message?
> > > > > > 
> > > > > > The first command I type on the prompt is always failing, it's not
> > > > > > outputting anything. Just a new prompt on the next line. The next
> > > > > > commands i
> > > > > > type in are working. Which seems strange.
> > > > > > I got boot.scr set up right, except graphic settings which are 
> > > > > > wrong. It
> > > > > > is
> > > > > > booting the kernel when I type 'run bootcmd'. But only after I type 
> > > > > > in
> > > > > > another command before it.
> > > > > > It seems like it's not detecting the SD-card (mmc0) until I have 
> > > > > > typed
> > > > > > anything into the prompt.
> > > > > > 
> > > > > > Do I have to set any other env variable for it to autoboot? I would 
> > > > > > have
> > > > > > printed the output of printenv here, but since I don't have a serial
> > > > > > console, retyping everything is very time consuming.
> > > > > > printenv seems to have the right settings. It's basically a full 
> > > > > > console
> > > > > > screen of variables. It just doesn't seem to load them until I type 
> > > > > > in
> > > > > > another command before it.
> > > > > > 
> > > > > > boot_targets=mmc0 usb0 pxe dhcp
> > > > > > Which seems right to me.
> > > > > > 
> > > > > > I compiled the latest u-boot from github.
> > > > > > 
> > > > > > If you need more info please let me know and I'll post it.
> > > > > > 
> > > > > > Hope that anyone can point me in the right direction here. Would 
> > > > > > really
> > > > > > appreciate it.
> > > > > I'm seeing the same issues with 2018.03 rc3.
> > > > > 
> > > > > I'm not sure what the issue is and I've not had time to investigate it
> > > > > further yet, but if you type "boot" and hit enter it should boot,
> > > > > sometimes you actually have to type it twice. It will boot but I'm not
> > > > > sure which bits here have causes this regression.
> > > > 
> > > > I do not see this at all on my RPi3. Maybe it's firmware version 
> > > > dependent?
> > > > Do you happen to have an image that always fails for you?
> > > 2018.03 rc3 with "2018-02-09" firmware (so fairly recent) fails for me.
> > 2018.03 rc4 works fine on rpi_3 here with
> 
> Do you have enable_uart=1 in your config.txt? If you do, it works. If you
> don't, it fails :)

yes, config.txt:

arm_control=0x200
enable_uart=1
device_tree_address=0x100
kernel=u-boot.bin
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] imx6: USB SDP failed for u-boot-dtb.img

2018-03-06 Thread Fabio Estevam
Hi Jagan,

On Tue, Mar 6, 2018 at 9:25 AM, Jagan Teki  wrote:
> Hi,
>
> U-Boot SPL 2018.03-rc3-00111-g0cb2734156-dirty (Mar 06 2018 - 17:19:36 +0530)
> Trying to boot from USB SDP
> SDP: initialize...
> SDP: handle requests...
>
> and SPL reenumerated USB VID/PID as
> [24774.255201] usb 1-2: new high-speed USB device number 101 using xhci_hcd
> [24774.425174] usb 1-2: New USB device found, idVendor=0525, idProduct=b4a4
> [24774.425181] usb 1-2: New USB device strings: Mfr=1, Product=2, 
> SerialNumber=0
> [24774.425185] usb 1-2: Product: USB download gadget
> [24774.425189] usb 1-2: Manufacturer: FSL
> [24774.433598] hid-generic 0003:0525:B4A4.005C: hiddev97,hidraw2: USB
> HID v1.10 Device [FSL USB download gadget]
>
> Now I've launched u-boot-dtb.img
>
> $ imx_usb u-boot-dtb.img
> ...
> vid=0x0525 pid=0xb4a4 file_name=mx6_usb_sdp_spl.conf
> config file <.//mx6_usb_sdp_spl.conf>
> parse .//mx6_usb_sdp_spl.conf
> Trying to open device vid=0x0525 pid=0xb4a4
> Interface 0 claimed
> HAB security state: development mode (0x56787856)
> == work item
> filename /work/code/u-boot/u-boot-dtb.img
> load_size 0 bytes
> load_addr 0x
> dcd 1
> clear_dcd 0
> plug 1
> jump_mode 2
> jump_addr 0x
> == end work item
>
> unknown load address
> DoIRomDownload failed, err=-3
> HAB security state: development mode (0x56787856)
>
> Here is mx6_usb_sdp_spl.conf file
>mx6_spl_sdp
>hid,uboot_header,1024,0x91,0x1000,512M,0x0090,0x4
>
> Look like the u-boot-dtb.img has FIT header and imx_usb can't process
> the same, any help?

Is this a regression? If so, are you able to run a 'git bisect'?
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] [for v2018.03] ARM: dts: imx6dl-icore-rqs: Fix to include correct dtsi

2018-03-06 Thread Fabio Estevam
On Tue, Mar 6, 2018 at 8:45 AM, Jagan Teki  wrote:
> This patch fixes the wrongly included dtsi file which was
> breaking mainline support for Engicam i.CoreM6 DualLite/Solo RQS.
>
> Linux commit details for the same change as
> "ARM: dts: imx6dl: Include correct dtsi file for Engicam i.CoreM6
> DualLite/Solo RQS"
> (sha1: c0c6bb2322964bd264b4ddedaa5776f40c709f0c)
>
> Signed-off-by: Jagan Teki 

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


Re: [U-Boot] [PATCH 1/2] [for v2018.03] ARM: dts: imx6qdl-icore-rqs: Sync usdhc4 node from Linux

2018-03-06 Thread Fabio Estevam
On Tue, Mar 6, 2018 at 8:45 AM, Jagan Teki  wrote:
> usdhc4 node need to update pinctrl, bus-width and non-removable
> properties, sync the same from Linux.
>
> Signed-off-by: Jagan Teki 

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


[U-Boot] [PATCH 0/2] [for 2018.03] RPi: Drain RX queue on setbrg

2018-03-06 Thread Alexander Graf
We had a few reports coming in from people that had their autoboot chain
aborted after pinmuxing support was added for the RPi.

The culprit is easy: The UARTs may have been enabled before, but muxed
to an incorrect pin. That pin may have pulled the RX line down which again
lead to lots of zero bytes gathered in the RX buffer.

The easy fix for that is to drain the RX queue every time we set the baud
rate.

This patch set is the minimally intrusive fix for the RPi. We may want to
do that generically for all serial devices later.

Alexander Graf (2):
  serial_bcm283x_mu: Flush RX queue after setting baud rate
  bcm283x_pl011: Flush RX queue after setting baud rate

 drivers/serial/serial_bcm283x_mu.c |  8 +++-
 drivers/serial/serial_bcm283x_pl011.c  | 25 -
 drivers/serial/serial_pl01x.c  | 10 +-
 drivers/serial/serial_pl01x_internal.h |  7 ++-
 4 files changed, 42 insertions(+), 8 deletions(-)

-- 
2.12.3

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


[U-Boot] [PATCH 2/2] bcm283x_pl011: Flush RX queue after setting baud rate

2018-03-06 Thread Alexander Graf
After the UART was initialized, we may still have bogus data in the
RX queue if it was enabled with incorrect pin muxing before.

So let's flush the RX queue whenever we initialize baud rates.

This fixes a regression with the dynamic pinmuxing code when enable_uart=1
is not set in config.txt on Raspberry Pis that use pl011 for serial.

Fixes: caf2233b28 ("bcm283x: Add pinctrl driver")
Reported-by: Göran Lundberg 
Reported-by: Peter Robinson 
Signed-off-by: Alexander Graf 
---
 drivers/serial/serial_bcm283x_pl011.c  | 25 -
 drivers/serial/serial_pl01x.c  | 10 +-
 drivers/serial/serial_pl01x_internal.h |  7 ++-
 3 files changed, 35 insertions(+), 7 deletions(-)

diff --git a/drivers/serial/serial_bcm283x_pl011.c 
b/drivers/serial/serial_bcm283x_pl011.c
index bfd39f84f3..2c6fb267ff 100644
--- a/drivers/serial/serial_bcm283x_pl011.c
+++ b/drivers/serial/serial_bcm283x_pl011.c
@@ -9,6 +9,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "serial_pl01x_internal.h"
 
 /*
@@ -55,6 +56,28 @@ static int bcm283x_pl011_serial_ofdata_to_platdata(struct 
udevice *dev)
return 0;
 }
 
+static int bcm283x_pl011_serial_setbrg(struct udevice *dev, int baudrate)
+{
+   int r;
+
+   r = pl01x_serial_setbrg(dev, baudrate);
+
+   /*
+* We may have been muxed to a bogus line before. Drain the RX
+* queue so we start at a clean slate.
+*/
+   while (pl01x_serial_getc(dev) == -EAGAIN) ;
+
+   return r;
+}
+
+static const struct dm_serial_ops bcm283x_pl011_serial_ops = {
+   .putc = pl01x_serial_putc,
+   .pending = pl01x_serial_pending,
+   .getc = pl01x_serial_getc,
+   .setbrg = bcm283x_pl011_serial_setbrg,
+};
+
 static const struct udevice_id bcm283x_pl011_serial_id[] = {
{.compatible = "brcm,bcm2835-pl011", .data = TYPE_PL011},
{}
@@ -67,7 +90,7 @@ U_BOOT_DRIVER(bcm283x_pl011_uart) = {
.ofdata_to_platdata = 
of_match_ptr(bcm283x_pl011_serial_ofdata_to_platdata),
.platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata),
.probe  = pl01x_serial_probe,
-   .ops= _serial_ops,
+   .ops= _pl011_serial_ops,
.flags  = DM_FLAG_PRE_RELOC,
.priv_auto_alloc_size = sizeof(struct pl01x_priv),
 };
diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index 23d9d839cb..45f1282770 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -273,7 +273,7 @@ __weak struct serial_device *default_serial_console(void)
 
 #ifdef CONFIG_DM_SERIAL
 
-static int pl01x_serial_setbrg(struct udevice *dev, int baudrate)
+int pl01x_serial_setbrg(struct udevice *dev, int baudrate)
 {
struct pl01x_serial_platdata *plat = dev_get_platdata(dev);
struct pl01x_priv *priv = dev_get_priv(dev);
@@ -299,21 +299,21 @@ int pl01x_serial_probe(struct udevice *dev)
return 0;
 }
 
-static int pl01x_serial_getc(struct udevice *dev)
+int pl01x_serial_getc(struct udevice *dev)
 {
struct pl01x_priv *priv = dev_get_priv(dev);
 
return pl01x_getc(priv->regs);
 }
 
-static int pl01x_serial_putc(struct udevice *dev, const char ch)
+int pl01x_serial_putc(struct udevice *dev, const char ch)
 {
struct pl01x_priv *priv = dev_get_priv(dev);
 
return pl01x_putc(priv->regs, ch);
 }
 
-static int pl01x_serial_pending(struct udevice *dev, bool input)
+int pl01x_serial_pending(struct udevice *dev, bool input)
 {
struct pl01x_priv *priv = dev_get_priv(dev);
unsigned int fr = readl(>regs->fr);
@@ -324,7 +324,7 @@ static int pl01x_serial_pending(struct udevice *dev, bool 
input)
return fr & UART_PL01x_FR_TXFF ? 0 : 1;
 }
 
-const struct dm_serial_ops pl01x_serial_ops = {
+static const struct dm_serial_ops pl01x_serial_ops = {
.putc = pl01x_serial_putc,
.pending = pl01x_serial_pending,
.getc = pl01x_serial_getc,
diff --git a/drivers/serial/serial_pl01x_internal.h 
b/drivers/serial/serial_pl01x_internal.h
index c56dd54c7b..d4605f24a3 100644
--- a/drivers/serial/serial_pl01x_internal.h
+++ b/drivers/serial/serial_pl01x_internal.h
@@ -43,7 +43,12 @@ struct pl01x_regs {
 
 int pl01x_serial_ofdata_to_platdata(struct udevice *dev);
 int pl01x_serial_probe(struct udevice *dev);
-extern const struct dm_serial_ops pl01x_serial_ops;
+
+/* Needed for external pl01x_serial_ops drivers */
+int pl01x_serial_putc(struct udevice *dev, const char ch);
+int pl01x_serial_pending(struct udevice *dev, bool input);
+int pl01x_serial_getc(struct udevice *dev);
+int pl01x_serial_setbrg(struct udevice *dev, int baudrate);
 
 struct pl01x_priv {
struct pl01x_regs *regs;
-- 
2.12.3

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


[U-Boot] [PATCH 1/2] serial_bcm283x_mu: Flush RX queue after setting baud rate

2018-03-06 Thread Alexander Graf
After the UART was initialized, we may still have bogus data in the
RX queue if it was enabled with incorrect pin muxing before.

So let's flush the RX queue whenever we initialize baud rates.

This fixes a regression with the dynamic pinmuxing code when enable_uart=1
is not set in config.txt.

Fixes: caf2233b28 ("bcm283x: Add pinctrl driver")
Reported-by: Göran Lundberg 
Reported-by: Peter Robinson 
Signed-off-by: Alexander Graf 
---
 drivers/serial/serial_bcm283x_mu.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/serial/serial_bcm283x_mu.c 
b/drivers/serial/serial_bcm283x_mu.c
index 40029fadbc..d87b44e902 100644
--- a/drivers/serial/serial_bcm283x_mu.c
+++ b/drivers/serial/serial_bcm283x_mu.c
@@ -51,6 +51,8 @@ struct bcm283x_mu_priv {
struct bcm283x_mu_regs *regs;
 };
 
+static int bcm283x_mu_serial_getc(struct udevice *dev);
+
 static int bcm283x_mu_serial_setbrg(struct udevice *dev, int baudrate)
 {
struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
@@ -59,13 +61,17 @@ static int bcm283x_mu_serial_setbrg(struct udevice *dev, 
int baudrate)
u32 divider;
 
if (plat->skip_init)
-   return 0;
+   goto out;
 
divider = plat->clock / (baudrate * 8);
 
writel(BCM283X_MU_LCR_DATA_SIZE_8, >lcr);
writel(divider - 1, >baud);
 
+out:
+   /* Flush the RX queue - all data in there is bogus */
+   while (bcm283x_mu_serial_getc(dev) != -EAGAIN) ;
+
return 0;
 }
 
-- 
2.12.3

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


Re: [U-Boot] RPi3 Not autobooting from SD-card. {Scanned}

2018-03-06 Thread Alexander Graf

On 03/06/2018 01:55 PM, Jonathan Gray wrote:

On Mon, Mar 05, 2018 at 06:18:59PM +, Peter Robinson wrote:

Hi!
I'm trying to boot from u-boot on a Raspberry Pi 3. But for some reason
it
isn't autobooting on the SD-card.

Is it possible to get more debug output on the screen console? I don't
have
a serial console at the moment.
The output on the screen is:

Net:   No ehternet found.
starting USB...
USB:Core Release 2.80a
scanning bus 0 for devices... 4 USB Devices found
 scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:   0
U-Boot>

Shouldn't it mention mmc somewhere in the boot message?

The first command I type on the prompt is always failing, it's not
outputting anything. Just a new prompt on the next line. The next
commands i
type in are working. Which seems strange.
I got boot.scr set up right, except graphic settings which are wrong. It
is
booting the kernel when I type 'run bootcmd'. But only after I type in
another command before it.
It seems like it's not detecting the SD-card (mmc0) until I have typed
anything into the prompt.

Do I have to set any other env variable for it to autoboot? I would have
printed the output of printenv here, but since I don't have a serial
console, retyping everything is very time consuming.
printenv seems to have the right settings. It's basically a full console
screen of variables. It just doesn't seem to load them until I type in
another command before it.

boot_targets=mmc0 usb0 pxe dhcp
Which seems right to me.

I compiled the latest u-boot from github.

If you need more info please let me know and I'll post it.

Hope that anyone can point me in the right direction here. Would really
appreciate it.

I'm seeing the same issues with 2018.03 rc3.

I'm not sure what the issue is and I've not had time to investigate it
further yet, but if you type "boot" and hit enter it should boot,
sometimes you actually have to type it twice. It will boot but I'm not
sure which bits here have causes this regression.


I do not see this at all on my RPi3. Maybe it's firmware version dependent?
Do you happen to have an image that always fails for you?

2018.03 rc3 with "2018-02-09" firmware (so fairly recent) fails for me.

2018.03 rc4 works fine on rpi_3 here with


Do you have enable_uart=1 in your config.txt? If you do, it works. If 
you don't, it fails :)



Alex

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


Re: [U-Boot] imx: get_ticks in syscounter.c get miscompiled by GCC 6

2018-03-06 Thread Fabio Estevam
On Tue, Mar 6, 2018 at 9:31 AM, Lothar Waßmann  wrote:

> Without the 'volatile' attribute the compiler is entitled to move the
> asm code around or optimize it out.
> So, your patch is the correct fix independent from the gcc version
> used.

Yes, but then it would be better to fix all the places where asm is
used without volatile.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [ANN] U-Boot v2018.03-rc4 released

2018-03-06 Thread Fabio Estevam
Hi Peter,

On Tue, Mar 6, 2018 at 8:36 AM, Peter Robinson  wrote:

> Just a heads up that I've seen a regression in building i.MX6
> platforms from rc3 with this:
>
> /builddir/build/BUILD/u-boot-2018.03-rc4/arch/arm/mach-imx/spl.c:160:5:
> error: redefinition of 'spl_boot_mode'
>  u32 spl_boot_mode(const u32 boot_device)

Are you sure you are building a vanilla 2018.03-rc4?

There is no ''spl_boot_mode' at line 160.

>  ^
> /builddir/build/BUILD/u-boot-2018.03-rc4/arch/arm/mach-imx/spl.c:137:5:
> note: previous definition of 'spl_boot_mode' was here
>  u32 spl_boot_mode(const u32 boot_device)

Nor at line 137.

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


Re: [U-Boot] RPi3 Not autobooting from SD-card. {Scanned}

2018-03-06 Thread Jonathan Gray
On Mon, Mar 05, 2018 at 06:18:59PM +, Peter Robinson wrote:
> >>> Hi!
> >>> I'm trying to boot from u-boot on a Raspberry Pi 3. But for some reason
> >>> it
> >>> isn't autobooting on the SD-card.
> >>>
> >>> Is it possible to get more debug output on the screen console? I don't
> >>> have
> >>> a serial console at the moment.
> >>> The output on the screen is:
> >>>
> >>> Net:   No ehternet found.
> >>> starting USB...
> >>> USB:Core Release 2.80a
> >>> scanning bus 0 for devices... 4 USB Devices found
> >>> scanning usb for storage devices... 0 Storage Device(s) found
> >>> Hit any key to stop autoboot:   0
> >>> U-Boot>
> >>>
> >>> Shouldn't it mention mmc somewhere in the boot message?
> >>>
> >>> The first command I type on the prompt is always failing, it's not
> >>> outputting anything. Just a new prompt on the next line. The next
> >>> commands i
> >>> type in are working. Which seems strange.
> >>> I got boot.scr set up right, except graphic settings which are wrong. It
> >>> is
> >>> booting the kernel when I type 'run bootcmd'. But only after I type in
> >>> another command before it.
> >>> It seems like it's not detecting the SD-card (mmc0) until I have typed
> >>> anything into the prompt.
> >>>
> >>> Do I have to set any other env variable for it to autoboot? I would have
> >>> printed the output of printenv here, but since I don't have a serial
> >>> console, retyping everything is very time consuming.
> >>> printenv seems to have the right settings. It's basically a full console
> >>> screen of variables. It just doesn't seem to load them until I type in
> >>> another command before it.
> >>>
> >>> boot_targets=mmc0 usb0 pxe dhcp
> >>> Which seems right to me.
> >>>
> >>> I compiled the latest u-boot from github.
> >>>
> >>> If you need more info please let me know and I'll post it.
> >>>
> >>> Hope that anyone can point me in the right direction here. Would really
> >>> appreciate it.
> >>
> >> I'm seeing the same issues with 2018.03 rc3.
> >>
> >> I'm not sure what the issue is and I've not had time to investigate it
> >> further yet, but if you type "boot" and hit enter it should boot,
> >> sometimes you actually have to type it twice. It will boot but I'm not
> >> sure which bits here have causes this regression.
> >
> >
> > I do not see this at all on my RPi3. Maybe it's firmware version dependent?
> > Do you happen to have an image that always fails for you?
> 
> 2018.03 rc3 with "2018-02-09" firmware (so fairly recent) fails for me.

2018.03 rc4 works fine on rpi_3 here with

raspberrypi-firmware
20180221 / 9ab68bf218ffc84423a2591658260676d373259a

MD5 (bcm2710-rpi-3-b.dtb) = e5ee32f0c14cd23c327f1615df5d6bb4
MD5 (bootcode.bin) = 17efaf1c1ef89289168d71cdc8194982
MD5 (fixup.dat) = fe33157cedaf8130fa4587341553b26b
MD5 (start.elf) = 9c98e338a47e242f1726c508e60c4cc7

with 'boot_targets=usb0 mmc0 pxe dhcp' as root is on usb.

U-Boot 2018.03-rc4-1-gc06b786faf (Mar 06 2018 - 23:30:47 +1100)

DRAM:  948 MiB
RPI 3 Model B (0xa02082)
MMC:   mmc@7e202000: 0, sdhci@7e30: 1
Loading Environment from FAT... OK
In:serial
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
starting USB...
USB0:   Core Release: 2.80a
scanning bus 0 for devices... 4 USB Device(s) found
   scanning usb for storage devices... 1 Storage Device(s) found
Hit any key to stop autoboot:  0 

Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra
Type: Removable Hard Disk
Capacity: 29327.3 MB = 28.6 GB (60062500 x 512)
... is now current device
Scanning usb 0:1...
Found EFI removable media binary efi/boot/bootaa64.efi
82812 bytes read in 90 ms (898.4 KiB/s)
## Starting EFI application at 0100 ...
Scanning disk m...@7e202000.blk...
Card did not respond to voltage select!
Scanning disk sd...@7e30.blk...
Disk sd...@7e30.blk not ready
Scanning disk usb_mass_storage.lun0...
Found 6 disks
>> OpenBSD/arm64 BOOTAA64 0.11
boot> 
booting sd0a:/bsd: 3990100+592528+580128+806208 
[282379+96+463896+246895]=0x845298
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [ANN] U-Boot v2018.03-rc4 released

2018-03-06 Thread Peter Robinson
On Tue, Mar 6, 2018 at 12:29 PM, Jonathan Gray  wrote:
> On Tue, Mar 06, 2018 at 11:36:37AM +, Peter Robinson wrote:
>> On Tue, Mar 6, 2018 at 1:28 AM, Tom Rini  wrote:
>> > Hey all,
>> >
>> > It's release day and I've released v2018.03-rc4.  I've included a few
>> > different regression fixes I've seen along with some fixes and cleanups.
>> > I would like to do the release on March 12th, and likely will so long as
>> > no big regressions show up.  I am worried about the RPi3 issue I've seen
>> > reported.  Are there any other issues people know of currently?
>> >
>> > And to repeat myself again, boards and SoC families, etc, that have been
>> > orphaned for more than a year should probably get dropped.  I've
>> > contacted a few people off-list (which is why we've had a few pickups of
>> > late) for things, but if you know someone that would be interested in
>> > something, please speak up.
>>
>> Just a heads up that I've seen a regression in building i.MX6
>> platforms from rc3 with this:
>>
>> /builddir/build/BUILD/u-boot-2018.03-rc4/arch/arm/mach-imx/spl.c:160:5:
>> error: redefinition of 'spl_boot_mode'
>>  u32 spl_boot_mode(const u32 boot_device)
>>  ^
>> /builddir/build/BUILD/u-boot-2018.03-rc4/arch/arm/mach-imx/spl.c:137:5:
>> note: previous definition of 'spl_boot_mode' was here
>>  u32 spl_boot_mode(const u32 boot_device)
>>  ^
>> make[3]: *** 
>> [/builddir/build/BUILD/u-boot-2018.03-rc4/scripts/Makefile.build:280:
>> spl/arch/arm/mach-imx/spl.o] Error 1
>> make[2]: *** 
>> [/builddir/build/BUILD/u-boot-2018.03-rc4/scripts/Makefile.spl:351:
>> spl/arch/arm/mach-imx] Error 2
>> make[2]: *** Waiting for unfinished jobs
>>
>> I've not had time to dig further just yet, just wanted to give people
>> a heads up.
>
> mx6cuboxi builds/runs fine here with
> 5e62f828256d66e2b28def4f9ef20a2a05c2d04f/v2018.03-rc4
> and linaro gcc 6.3-2017.02

This is Fedora 28 with gcc 8 and possibly some extra hardending flags
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3b 15/15] board: MCR3000: Use smaller flash sector for environment

2018-03-06 Thread Christophe LEROY



Le 06/03/2018 à 13:33, Christophe Leroy a écrit :

The MCR3000 board is equipped with an AM29LV160DB boot flash which
is organised as follows:
- One 16kb block
- Two 8kb block
- One 32kb block
- Thirty one 64kb blocks

At the time being, u-boot is a single piece occupying the 320 first kbytes, 
then the environment is stored in the following 64kb block

The environment being quite tiny, we save one 64kb block by embedding
the environment in the first 8kb block.

Signed-off-by: Christophe Leroy 


Note that it superceeds https://patchwork.ozlabs.org/patch/882041/

Sorry for the mistake :(

Christophe


---
  board/cssi/MCR3000/u-boot.lds | 6 +++---
  include/configs/MCR3000.h | 8 
  2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/board/cssi/MCR3000/u-boot.lds b/board/cssi/MCR3000/u-boot.lds
index cd042ca0ce4..990cca4ebb6 100644
--- a/board/cssi/MCR3000/u-boot.lds
+++ b/board/cssi/MCR3000/u-boot.lds
@@ -18,14 +18,14 @@ SECTIONS
.text  :
{
arch/powerpc/cpu/mpc8xx/start.o (.text)
-   arch/powerpc/cpu/mpc8xx/start.o (.text*)
arch/powerpc/cpu/mpc8xx/traps.o (.text*)
-   arch/powerpc/cpu/mpc8xx/built-in.o  (.text*)
arch/powerpc/lib/built-in.o (.text*)
board/cssi/MCR3000/built-in.o   (.text*)
-   disk/built-in.o (.text*)
drivers/net/built-in.o  (.text*)
  
+		. = DEFINED(env_offset) ? env_offset : .;

+   env/embedded.o  (.text.environment)
+
*(.text)
}
_etext = .;
diff --git a/include/configs/MCR3000.h b/include/configs/MCR3000.h
index ada009e5da4..2b49f97e091 100644
--- a/include/configs/MCR3000.h
+++ b/include/configs/MCR3000.h
@@ -24,7 +24,7 @@
"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"   \
"mcr3k:eth0:off;" \
"${ofl_args}; "   \
-   "bootm 0x0407 - 0x0406\0" \
+   "bootm 0x0406 - 0x0405\0" \
"tftpboot=setenv bootargs "   \
"${console_args} "\
"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"   \
@@ -45,7 +45,7 @@
"${console_args} "\
"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"   \
"mcr3k:eth0:off;" \
-   "bootm 0x0407 - 0x0406\0" \
+   "bootm 0x0406 - 0x0405\0" \
"dhcpboot=dhcp ${loadaddr} ${filename};"  \
"tftp 0xf0 mcr3000.dtb;"  \
"setenv bootargs "\
@@ -102,8 +102,8 @@
  /* Environment Configuration */
  
  /* environment is in FLASH */

-#define CONFIG_ENV_SECT_SIZE   (64 * 1024)
-#define CONFIG_ENV_OFFSET  CONFIG_SYS_MONITOR_LEN
+#define CONFIG_ENV_SECT_SIZE   0x2000
+#define CONFIG_ENV_OFFSET  0x4000
  #define CONFIG_ENV_OVERWRITE  1
  
  /* Ethernet configuration part */



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


[U-Boot] [PATCH v3b 15/15] board: MCR3000: Use smaller flash sector for environment

2018-03-06 Thread Christophe Leroy
The MCR3000 board is equipped with an AM29LV160DB boot flash which
is organised as follows:
- One 16kb block
- Two 8kb block
- One 32kb block
- Thirty one 64kb blocks

At the time being, u-boot is a single piece occupying the 320 first kbytes, 
then the environment is stored in the following 64kb block

The environment being quite tiny, we save one 64kb block by embedding
the environment in the first 8kb block.

Signed-off-by: Christophe Leroy 
---
 board/cssi/MCR3000/u-boot.lds | 6 +++---
 include/configs/MCR3000.h | 8 
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/board/cssi/MCR3000/u-boot.lds b/board/cssi/MCR3000/u-boot.lds
index cd042ca0ce4..990cca4ebb6 100644
--- a/board/cssi/MCR3000/u-boot.lds
+++ b/board/cssi/MCR3000/u-boot.lds
@@ -18,14 +18,14 @@ SECTIONS
.text  :
{
arch/powerpc/cpu/mpc8xx/start.o (.text)
-   arch/powerpc/cpu/mpc8xx/start.o (.text*)
arch/powerpc/cpu/mpc8xx/traps.o (.text*)
-   arch/powerpc/cpu/mpc8xx/built-in.o  (.text*)
arch/powerpc/lib/built-in.o (.text*)
board/cssi/MCR3000/built-in.o   (.text*)
-   disk/built-in.o (.text*)
drivers/net/built-in.o  (.text*)
 
+   . = DEFINED(env_offset) ? env_offset : .;
+   env/embedded.o  (.text.environment)
+
*(.text)
}
_etext = .;
diff --git a/include/configs/MCR3000.h b/include/configs/MCR3000.h
index ada009e5da4..2b49f97e091 100644
--- a/include/configs/MCR3000.h
+++ b/include/configs/MCR3000.h
@@ -24,7 +24,7 @@
"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \
"mcr3k:eth0:off;"   \
"${ofl_args}; " \
-   "bootm 0x0407 - 0x0406\0"   \
+   "bootm 0x0406 - 0x0405\0"   \
"tftpboot=setenv bootargs " \
"${console_args} "  \
"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \
@@ -45,7 +45,7 @@
"${console_args} "  \
"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \
"mcr3k:eth0:off;"   \
-   "bootm 0x0407 - 0x0406\0"   \
+   "bootm 0x0406 - 0x0405\0"   \
"dhcpboot=dhcp ${loadaddr} ${filename};"\
"tftp 0xf0 mcr3000.dtb;"\
"setenv bootargs "  \
@@ -102,8 +102,8 @@
 /* Environment Configuration */
 
 /* environment is in FLASH */
-#define CONFIG_ENV_SECT_SIZE   (64 * 1024)
-#define CONFIG_ENV_OFFSET  CONFIG_SYS_MONITOR_LEN
+#define CONFIG_ENV_SECT_SIZE   0x2000
+#define CONFIG_ENV_OFFSET  0x4000
 #define CONFIG_ENV_OVERWRITE   1
 
 /* Ethernet configuration part */
-- 
2.13.3

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


Re: [U-Boot] imx: get_ticks in syscounter.c get miscompiled by GCC 6

2018-03-06 Thread Lothar Waßmann
Hi,

On Tue, 6 Mar 2018 15:06:08 +0900 Yasushi SHOJI wrote:
> Hi,
> 
> It seems to me that both GCC 6.3 and 6.4 mis-compiles
>
s/mis-compiles/optimizes/

Without the 'volatile' attribute the compiler is entitled to move the
asm code around or optimize it out.
So, your patch is the correct fix independent from the gcc version
used.

> arch/arm/mach-imx/syscounter.c.
> 
> I'm attaching two files, bad.txt is the original syscounter.c and
> good.txt is the one
> with the following patch.
> 
> diff --git a/arch/arm/mach-imx/syscounter.c b/arch/arm/mach-imx/syscounter.c
> index 9290918dca..30ed0109a2 100644
> --- a/arch/arm/mach-imx/syscounter.c
> +++ b/arch/arm/mach-imx/syscounter.c
> @@ -82,7 +82,7 @@ unsigned long long get_ticks(void)
>  {
> unsigned long long now;
> 
> -   asm("mrrc p15, 0, %Q0, %R0, c14" : "=r" (now));
> +   asm volatile("mrrc p15, 0, %Q0, %R0, c14" : "=r" (now));
> 
> gd->arch.tbl = (unsigned long)(now & 0x);
> gd->arch.tbu = (unsigned long)(now >> 32);
> 


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


Re: [U-Boot] [ANN] U-Boot v2018.03-rc4 released

2018-03-06 Thread Jonathan Gray
On Tue, Mar 06, 2018 at 11:36:37AM +, Peter Robinson wrote:
> On Tue, Mar 6, 2018 at 1:28 AM, Tom Rini  wrote:
> > Hey all,
> >
> > It's release day and I've released v2018.03-rc4.  I've included a few
> > different regression fixes I've seen along with some fixes and cleanups.
> > I would like to do the release on March 12th, and likely will so long as
> > no big regressions show up.  I am worried about the RPi3 issue I've seen
> > reported.  Are there any other issues people know of currently?
> >
> > And to repeat myself again, boards and SoC families, etc, that have been
> > orphaned for more than a year should probably get dropped.  I've
> > contacted a few people off-list (which is why we've had a few pickups of
> > late) for things, but if you know someone that would be interested in
> > something, please speak up.
> 
> Just a heads up that I've seen a regression in building i.MX6
> platforms from rc3 with this:
> 
> /builddir/build/BUILD/u-boot-2018.03-rc4/arch/arm/mach-imx/spl.c:160:5:
> error: redefinition of 'spl_boot_mode'
>  u32 spl_boot_mode(const u32 boot_device)
>  ^
> /builddir/build/BUILD/u-boot-2018.03-rc4/arch/arm/mach-imx/spl.c:137:5:
> note: previous definition of 'spl_boot_mode' was here
>  u32 spl_boot_mode(const u32 boot_device)
>  ^
> make[3]: *** 
> [/builddir/build/BUILD/u-boot-2018.03-rc4/scripts/Makefile.build:280:
> spl/arch/arm/mach-imx/spl.o] Error 1
> make[2]: *** 
> [/builddir/build/BUILD/u-boot-2018.03-rc4/scripts/Makefile.spl:351:
> spl/arch/arm/mach-imx] Error 2
> make[2]: *** Waiting for unfinished jobs
> 
> I've not had time to dig further just yet, just wanted to give people
> a heads up.

mx6cuboxi builds/runs fine here with
5e62f828256d66e2b28def4f9ef20a2a05c2d04f/v2018.03-rc4
and linaro gcc 6.3-2017.02
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] imx6: USB SDP failed for u-boot-dtb.img

2018-03-06 Thread Jagan Teki
Hi,

U-Boot SPL 2018.03-rc3-00111-g0cb2734156-dirty (Mar 06 2018 - 17:19:36 +0530)
Trying to boot from USB SDP
SDP: initialize...
SDP: handle requests...

and SPL reenumerated USB VID/PID as
[24774.255201] usb 1-2: new high-speed USB device number 101 using xhci_hcd
[24774.425174] usb 1-2: New USB device found, idVendor=0525, idProduct=b4a4
[24774.425181] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[24774.425185] usb 1-2: Product: USB download gadget
[24774.425189] usb 1-2: Manufacturer: FSL
[24774.433598] hid-generic 0003:0525:B4A4.005C: hiddev97,hidraw2: USB
HID v1.10 Device [FSL USB download gadget]

Now I've launched u-boot-dtb.img

$ imx_usb u-boot-dtb.img
...
vid=0x0525 pid=0xb4a4 file_name=mx6_usb_sdp_spl.conf
config file <.//mx6_usb_sdp_spl.conf>
parse .//mx6_usb_sdp_spl.conf
Trying to open device vid=0x0525 pid=0xb4a4
Interface 0 claimed
HAB security state: development mode (0x56787856)
== work item
filename /work/code/u-boot/u-boot-dtb.img
load_size 0 bytes
load_addr 0x
dcd 1
clear_dcd 0
plug 1
jump_mode 2
jump_addr 0x
== end work item

unknown load address
DoIRomDownload failed, err=-3
HAB security state: development mode (0x56787856)

Here is mx6_usb_sdp_spl.conf file
   mx6_spl_sdp
   hid,uboot_header,1024,0x91,0x1000,512M,0x0090,0x4

Look like the u-boot-dtb.img has FIT header and imx_usb can't process
the same, any help?

Jagan.

-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 09/15] powerpc: 8xx: get rid of the multiple PVR_ values

2018-03-06 Thread Christophe Leroy
None of those values are used at the time being.
Just keep one and call it PVR_8xx

Signed-off-by: Christophe Leroy 
---
 arch/powerpc/include/asm/processor.h | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/include/asm/processor.h 
b/arch/powerpc/include/asm/processor.h
index 57b11b83657..6fbe8c46b31 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -973,10 +973,8 @@
  * differentiated by the version number in the Communication Processor
  * Module (CPM).
  */
-#define PVR_8210x0050
-#define PVR_823PVR_821
-#define PVR_850PVR_821
-#define PVR_860PVR_821
+#define PVR_8xx0x0050
+
 #define PVR_7400   0x000C
 
 /*
-- 
2.13.3

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


[U-Boot] [PATCH v3 15/15] board: MCR3000: Use smaller flash sector for environment

2018-03-06 Thread Christophe Leroy
The MCR3000 board is equipped with an AM29LV160DB boot flash which
is organised as follows:
- One 16kb block
- Two 8kb block
- One 32kb block
- Thirty one 64kb blocks

At the time being, u-boot is a single piece occupying the 320 first kbytes, 
then the environment is stored in the following 64kb block

The environment being quite tiny, we save one 64kb block by embedding
the environment in the first 8kb block.

Signed-off-by: Christophe Leroy 
---
 board/cssi/MCR3000/u-boot.lds | 6 +++---
 include/configs/MCR3000.h | 8 
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/board/cssi/MCR3000/u-boot.lds b/board/cssi/MCR3000/u-boot.lds
index cd042ca0ce4..990cca4ebb6 100644
--- a/board/cssi/MCR3000/u-boot.lds
+++ b/board/cssi/MCR3000/u-boot.lds
@@ -18,14 +18,14 @@ SECTIONS
.text  :
{
arch/powerpc/cpu/mpc8xx/start.o (.text)
-   arch/powerpc/cpu/mpc8xx/start.o (.text*)
arch/powerpc/cpu/mpc8xx/traps.o (.text*)
-   arch/powerpc/cpu/mpc8xx/built-in.o  (.text*)
arch/powerpc/lib/built-in.o (.text*)
board/cssi/MCR3000/built-in.o   (.text*)
-   disk/built-in.o (.text*)
drivers/net/built-in.o  (.text*)
 
+   . = DEFINED(env_offset) ? env_offset : .;
+   env/embedded.o  (.text.environment)
+
*(.text)
}
_etext = .;
diff --git a/include/configs/MCR3000.h b/include/configs/MCR3000.h
index ada009e5da4..134db34a05c 100644
--- a/include/configs/MCR3000.h
+++ b/include/configs/MCR3000.h
@@ -24,7 +24,7 @@
"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \
"mcr3k:eth0:off;"   \
"${ofl_args}; " \
-   "bootm 0x0407 - 0x0406\0"   \
+   "bootm 0x0406 - 0x04004000\0"   \
"tftpboot=setenv bootargs " \
"${console_args} "  \
"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \
@@ -45,7 +45,7 @@
"${console_args} "  \
"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \
"mcr3k:eth0:off;"   \
-   "bootm 0x0407 - 0x0406\0"   \
+   "bootm 0x0406 - 0x04004000\0"   \
"dhcpboot=dhcp ${loadaddr} ${filename};"\
"tftp 0xf0 mcr3000.dtb;"\
"setenv bootargs "  \
@@ -102,8 +102,8 @@
 /* Environment Configuration */
 
 /* environment is in FLASH */
-#define CONFIG_ENV_SECT_SIZE   (64 * 1024)
-#define CONFIG_ENV_OFFSET  CONFIG_SYS_MONITOR_LEN
+#define CONFIG_ENV_SECT_SIZE   0x2000
+#define CONFIG_ENV_OFFSET  0x4000
 #define CONFIG_ENV_OVERWRITE   1
 
 /* Ethernet configuration part */
-- 
2.13.3

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


[U-Boot] [PATCH v3 11/15] powerpc: mpc8xx: harmonise initialisation of the immap local pointer

2018-03-06 Thread Christophe Leroy
In most places, immap local pointer is defined as
immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
In a few places, it is defined as
immap_t __iomem *immap = (immap_t __iomem *)(immr & 0x);

This patch replaces the few of the latest form by the other one.

The two are fully equivalent since SPRN_IMMR is set with CONFIG_SYS_IMMR
very early in start.S

Signed-off-by: Christophe Leroy 
---
 arch/powerpc/cpu/mpc8xx/cpu.c   | 5 ++---
 arch/powerpc/cpu/mpc8xx/speed.c | 3 +--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c
index 1883440db34..20d042d3a19 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu.c
@@ -36,7 +36,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static int check_CPU(long clock, uint pvr, uint immr)
 {
-   immap_t __iomem *immap = (immap_t __iomem *)(immr & 0x);
+   immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
uint k;
char buf[32];
 
@@ -237,8 +237,7 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
  */
 unsigned long get_tbclk(void)
 {
-   uint immr = get_immr(0);/* Return full IMMR contents */
-   immap_t __iomem *immap = (immap_t __iomem *)(immr & 0x);
+   immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
ulong oscclk, factor, pll;
 
if (in_be32(>im_clkrst.car_sccr) & SCCR_TBS)
diff --git a/arch/powerpc/cpu/mpc8xx/speed.c b/arch/powerpc/cpu/mpc8xx/speed.c
index fa8f87cbc5e..f8eb4a13eaf 100644
--- a/arch/powerpc/cpu/mpc8xx/speed.c
+++ b/arch/powerpc/cpu/mpc8xx/speed.c
@@ -17,8 +17,7 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 int get_clocks(void)
 {
-   uint immr = get_immr(0);/* Return full IMMR contents */
-   immap_t __iomem *immap = (immap_t __iomem *)(immr & 0x);
+   immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
uint sccr = in_be32(>im_clkrst.car_sccr);
uint divider = 1 << (((sccr & SCCR_DFBRG11) >> 11) * 2);
 
-- 
2.13.3

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


[U-Boot] [PATCH v3 05/15] boards: MCR3000: cleanup config

2018-03-06 Thread Christophe Leroy
Some config is redundant with Kconfig. Fix it.
Also remove unused configs
Move SDRAM_MAX_SIZE in the only place it is used

include/environment.h already defines CONFIG_ENV_SIZE
from CONFIG_ENV_SECT_SIZE and defines CONFIG_ENV_ADDR as
(CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET)

Signed-off-by: Christophe Leroy 
---
 arch/powerpc/Kconfig |  1 +
 board/cssi/MCR3000/MCR3000.c |  2 ++
 configs/MCR3000_defconfig|  2 ++
 include/configs/MCR3000.h| 26 +-
 4 files changed, 6 insertions(+), 25 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index e4b3043fa22..3a2653ff0d3 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -32,6 +32,7 @@ config MPC86xx
 
 config 8xx
bool "MPC8xx"
+   select BOARD_EARLY_INIT_F
imply CMD_REGINFO
 
 endchoice
diff --git a/board/cssi/MCR3000/MCR3000.c b/board/cssi/MCR3000/MCR3000.c
index c9288818049..6939a2cf617 100644
--- a/board/cssi/MCR3000/MCR3000.c
+++ b/board/cssi/MCR3000/MCR3000.c
@@ -16,6 +16,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define SDRAM_MAX_SIZE (32 * 1024 * 1024)
+
 static const uint cs1_dram_table_66[] = {
/* DRAM - single read. (offset 0 in upm RAM) */
0x0F3DFC04, 0x0FEFBC04, 0x00BE7804, 0x0FFDF400,
diff --git a/configs/MCR3000_defconfig b/configs/MCR3000_defconfig
index 108cf00154a..6a29f9de1ef 100644
--- a/configs/MCR3000_defconfig
+++ b/configs/MCR3000_defconfig
@@ -71,3 +71,5 @@ CONFIG_MPC8XX_FEC=y
 CONFIG_SHA256=y
 CONFIG_LZMA=y
 CONFIG_OF_LIBFDT=y
+CONFIG_USE_BOOTCOMMAND=y
+CONFIG_BOOTCOMMAND="run flashboot"
diff --git a/include/configs/MCR3000.h b/include/configs/MCR3000.h
index 29e61c7c222..43bbacfd9e6 100644
--- a/include/configs/MCR3000.h
+++ b/include/configs/MCR3000.h
@@ -9,7 +9,6 @@
 #define __CONFIG_H
 
 /* High Level Configuration Options */
-#define CONFIG_BOARD_EARLY_INIT_F  1   /* Call board_early_init_f */
 #define CONFIG_MISC_INIT_R 1   /* Call misc_init_r */
 
 #define CONFIG_EXTRA_ENV_SETTINGS  \
@@ -55,25 +54,16 @@
"${ofl_args}; " \
"bootm ${loadaddr} - 0xf0\0"
 
-#define CONFIG_BOOTDELAY   5
-
 #define CONFIG_IPADDR  192.168.0.3
 #define CONFIG_SERVERIP192.168.0.1
 #define CONFIG_NETMASK 255.0.0.0
 
-#define CONFIG_BOOTCOMMAND "run flashboot"
-
 #define CONFIG_LOADS_ECHO  1   /* echo on for serial download  */
-#undef CONFIG_LOADS_BAUD_CHANGE/* don't allow baudrate change  */
 
 #define CONFIG_WATCHDOG1   /* watchdog enabled */
 
 /* Miscellaneous configurable options */
 
-#ifdef CONFIG_HUSH_PARSER
-#defineCONFIG_SYS_PROMPT_HUSH_PS2  "S3K> "
-#endif
-
 #define CONFIG_SYS_MEMTEST_START   0x2000
 #define CONFIG_SYS_MEMTEST_END 0x0080
 
@@ -91,7 +81,6 @@
 
 /* RAM configuration (note that CONFIG_SYS_SDRAM_BASE must be zero) */
 #defineCONFIG_SYS_SDRAM_BASE   0x
-#define SDRAM_MAX_SIZE (32 * 1024 * 1024)
 
 /* FLASH organization */
 #define CONFIG_SYS_FLASH_BASE  CONFIG_SYS_TEXT_BASE
@@ -116,29 +105,16 @@
 
 /* environment is in FLASH */
 #define CONFIG_ENV_SECT_SIZE   (64 * 1024)
-#define CONFIG_ENV_SIZECONFIG_ENV_SECT_SIZE
-#define CONFIG_ENV_ADDR(CONFIG_SYS_FLASH_BASE + 
CONFIG_SYS_MONITOR_LEN)
-#define CONFIG_ENV_OFFSET  (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE)
+#define CONFIG_ENV_OFFSET  CONFIG_SYS_MONITOR_LEN
 #define CONFIG_ENV_OVERWRITE   1
 
-/* Cache Configuration */
-#define CONFIG_SYS_CACHELINE_SIZE  16
-
 /* Ethernet configuration part */
 #define CONFIG_SYS_DISCOVER_PHY1
-#ifdef CONFIG_MPC8XX_FEC
 #define CONFIG_MII_INIT1
-#endif
 
 /* NAND configuration part */
 #define CONFIG_SYS_MAX_NAND_DEVICE 1
 #define CONFIG_SYS_NAND_MAX_CHIPS  1
 #define CONFIG_SYS_NAND_BASE   0x0C00
 
-/* Internal Definitions */
-
-/* Boot Flags*/
-#defineBOOTFLAG_COLD   0x01
-#define BOOTFLAG_WARM  0x02
-
 #endif /* __CONFIG_H */
-- 
2.13.3

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


[U-Boot] [PATCH v3 10/15] powerpc: mpc8xx: refactorise reginfo

2018-03-06 Thread Christophe Leroy
reginfo is redundant with some of the commands in immap.c, so
move reginfo into that file and remove duplicated info.

Signed-off-by: Christophe Leroy 
---
 arch/powerpc/cpu/mpc8xx/Makefile  |  1 -
 arch/powerpc/cpu/mpc8xx/immap.c   | 20 +++
 arch/powerpc/cpu/mpc8xx/reginfo.c | 71 ---
 3 files changed, 20 insertions(+), 72 deletions(-)
 delete mode 100644 arch/powerpc/cpu/mpc8xx/reginfo.c

diff --git a/arch/powerpc/cpu/mpc8xx/Makefile b/arch/powerpc/cpu/mpc8xx/Makefile
index 40f38923ece..35ff18a7b3b 100644
--- a/arch/powerpc/cpu/mpc8xx/Makefile
+++ b/arch/powerpc/cpu/mpc8xx/Makefile
@@ -12,6 +12,5 @@ obj-y += cpu_init.o
 obj-$(CONFIG_OF_LIBFDT) += fdt.o
 obj-$(CONFIG_CMD_IMMAP) += immap.o
 obj-y  += interrupts.o
-obj-$(CONFIG_CMD_REGINFO) += reginfo.o
 obj-y  += speed.o
 obj-y  += cache.o
diff --git a/arch/powerpc/cpu/mpc8xx/immap.c b/arch/powerpc/cpu/mpc8xx/immap.c
index dfe5dc21251..7ef486053c2 100644
--- a/arch/powerpc/cpu/mpc8xx/immap.c
+++ b/arch/powerpc/cpu/mpc8xx/immap.c
@@ -342,6 +342,26 @@ static int do_brginfo(cmd_tbl_t *cmdtp, int flag, int 
argc, char * const argv[])
return 0;
 }
 
+#ifdef CONFIG_CMD_REGINFO
+void print_reginfo(void)
+{
+   immap_t __iomem *immap  = (immap_t __iomem *)CONFIG_SYS_IMMR;
+   sit8xx_t __iomem *timers = >im_sit;
+
+   printf("\nSystem Configuration registers\n"
+   "\tIMMR\t0x%08X\n", get_immr(0));
+   do_siuinfo(NULL, 0, 0, NULL);
+
+   printf("Memory Controller Registers\n");
+   do_memcinfo(NULL, 0, 0, NULL);
+
+   printf("\nSystem Integration Timers\n");
+   printf("\tTBSCR\t0x%04X\tRTCSC\t0x%04X\n",
+  in_be16(>sit_tbscr), in_be16(>sit_rtcsc));
+   printf("\tPISCR\t0x%04X\n", in_be16(>sit_piscr));
+}
+#endif
+
 /***/
 
 U_BOOT_CMD(
diff --git a/arch/powerpc/cpu/mpc8xx/reginfo.c 
b/arch/powerpc/cpu/mpc8xx/reginfo.c
deleted file mode 100644
index 277d2753b25..000
--- a/arch/powerpc/cpu/mpc8xx/reginfo.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * (C) Copyright 2000
- * Subodh Nijsure, SkyStream Networks, snijs...@skystream.com
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-#include 
-#include 
-
-void print_reginfo(void)
-{
-   immap_t __iomem *immap  = (immap_t __iomem *)CONFIG_SYS_IMMR;
-   memctl8xx_t __iomem *memctl = >im_memctl;
-   sysconf8xx_t __iomem *sysconf = >im_siu_conf;
-   sit8xx_t __iomem *timers = >im_sit;
-
-   /* Hopefully more PowerPC  knowledgable people will add code to display
-* other useful registers
-*/
-
-   printf("\nSystem Configuration registers\n"
-   "\tIMMR\t0x%08X\n", get_immr(0));
-
-   printf("\tSIUMCR\t0x%08X", in_be32(>sc_siumcr));
-   printf("\tSYPCR\t0x%08X\n", in_be32(>sc_sypcr));
-
-   printf("\tSWT\t0x%08X", in_be32(>sc_swt));
-   printf("\tSWSR\t0x%04X\n", in_be16(>sc_swsr));
-
-   printf("\tSIPEND\t0x%08X\tSIMASK\t0x%08X\n",
-  in_be32(>sc_sipend), in_be32(>sc_simask));
-   printf("\tSIEL\t0x%08X\tSIVEC\t0x%08X\n",
-  in_be32(>sc_siel), in_be32(>sc_sivec));
-   printf("\tTESR\t0x%08X\tSDCR\t0x%08X\n",
-  in_be32(>sc_tesr), in_be32(>sc_sdcr));
-
-   printf("Memory Controller Registers\n");
-   printf("\tBR0\t0x%08X\tOR0\t0x%08X\n", in_be32(>memc_br0),
-  in_be32(>memc_or0));
-   printf("\tBR1\t0x%08X\tOR1\t0x%08X\n", in_be32(>memc_br1),
-  in_be32(>memc_or1));
-   printf("\tBR2\t0x%08X\tOR2\t0x%08X\n", in_be32(>memc_br2),
-  in_be32(>memc_or2));
-   printf("\tBR3\t0x%08X\tOR3\t0x%08X\n", in_be32(>memc_br3),
-  in_be32(>memc_or3));
-   printf("\tBR4\t0x%08X\tOR4\t0x%08X\n", in_be32(>memc_br4),
-  in_be32(>memc_or4));
-   printf("\tBR5\t0x%08X\tOR5\t0x%08X\n", in_be32(>memc_br5),
-  in_be32(>memc_or5));
-   printf("\tBR6\t0x%08X\tOR6\t0x%08X\n", in_be32(>memc_br6),
-  in_be32(>memc_or6));
-   printf("\tBR7\t0x%08X\tOR7\t0x%08X\n", in_be32(>memc_br7),
-  in_be32(>memc_or7));
-   printf("\n\tmamr\t0x%08X\tmbmr\t0x%08X\n", in_be32(>memc_mamr),
-  in_be32(>memc_mbmr));
-   printf("\tmstat\t0x%04X\tmptpr\t0x%04X\n", in_be16(>memc_mstat),
-  in_be16(>memc_mptpr));
-   printf("\tmdr\t0x%08X\n", in_be32(>memc_mdr));
-
-   printf("\nSystem Integration Timers\n");
-   printf("\tTBSCR\t0x%04X\tRTCSC\t0x%04X\n",
-  in_be16(>sit_tbscr), in_be16(>sit_rtcsc));
-   printf("\tPISCR\t0x%04X\n", in_be16(>sit_piscr));
-
-   /*
-* May be some CPM info here?
-*/
-}
-- 
2.13.3

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


[U-Boot] [PATCH v3 08/15] powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

2018-03-06 Thread Christophe Leroy
CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy 
---
 api/api_platform-powerpc.c| 2 +-
 arch/powerpc/Kconfig  | 2 +-
 arch/powerpc/cpu/mpc8xx/Kconfig   | 2 +-
 arch/powerpc/cpu/mpc8xx/immap.c   | 2 +-
 arch/powerpc/include/asm/cache.h  | 6 +++---
 arch/powerpc/include/asm/global_data.h| 2 +-
 arch/powerpc/include/asm/{8xx_immap.h => immap_8xx.h} | 0
 arch/powerpc/include/asm/iopin_8xx.h  | 2 +-
 arch/powerpc/include/asm/ppc.h| 4 ++--
 cmd/bdinfo.c  | 2 +-
 configs/MCR3000_defconfig | 2 +-
 drivers/net/Kconfig   | 2 +-
 drivers/serial/Kconfig| 2 +-
 drivers/spi/Kconfig   | 2 +-
 include/asm-generic/u-boot.h  | 2 +-
 include/commproc.h| 2 +-
 include/mpc8xx.h  | 4 ++--
 include/ppc_asm.tmpl  | 6 +++---
 18 files changed, 23 insertions(+), 23 deletions(-)
 rename arch/powerpc/include/asm/{8xx_immap.h => immap_8xx.h} (100%)

diff --git a/api/api_platform-powerpc.c b/api/api_platform-powerpc.c
index 9e9bc63b2f5..aae7ddee959 100644
--- a/api/api_platform-powerpc.c
+++ b/api/api_platform-powerpc.c
@@ -30,7 +30,7 @@ int platform_sys_info(struct sys_info *si)
si->clk_bus = gd->bus_clk;
si->clk_cpu = gd->cpu_clk;
 
-#if defined(CONFIG_8xx) || defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
+#if defined(CONFIG_MPC8xx) || defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
 #define bi_bar bi_immr_base
 #elif defined(CONFIG_MPC83xx)
 #define bi_bar bi_immrbar
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index b20837b473f..af45cfe8498 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -30,7 +30,7 @@ config MPC86xx
select SYS_FSL_DDR_BE
imply CMD_REGINFO
 
-config 8xx
+config MPC8xx
bool "MPC8xx"
select BOARD_EARLY_INIT_F
imply CMD_REGINFO
diff --git a/arch/powerpc/cpu/mpc8xx/Kconfig b/arch/powerpc/cpu/mpc8xx/Kconfig
index 5a7db335ed2..f1123173765 100644
--- a/arch/powerpc/cpu/mpc8xx/Kconfig
+++ b/arch/powerpc/cpu/mpc8xx/Kconfig
@@ -1,5 +1,5 @@
 menu "mpc8xx CPU"
-   depends on 8xx
+   depends on MPC8xx
 
 config SYS_CPU
default "mpc8xx"
diff --git a/arch/powerpc/cpu/mpc8xx/immap.c b/arch/powerpc/cpu/mpc8xx/immap.c
index 2284979dd65..dfe5dc21251 100644
--- a/arch/powerpc/cpu/mpc8xx/immap.c
+++ b/arch/powerpc/cpu/mpc8xx/immap.c
@@ -12,7 +12,7 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h
index 0801d2c3677..445a366807d 100644
--- a/arch/powerpc/include/asm/cache.h
+++ b/arch/powerpc/include/asm/cache.h
@@ -7,7 +7,7 @@
 #include 
 
 /* bytes per L1 cache line */
-#if defined(CONFIG_8xx)
+#if defined(CONFIG_MPC8xx)
 #defineL1_CACHE_SHIFT  4
 #elif defined(CONFIG_PPC64BRIDGE)
 #define L1_CACHE_SHIFT 7
@@ -72,7 +72,7 @@ void disable_cpc_sram(void);
 #define L2CACHE_NONE   0x03/* NONE */
 #define L2CACHE_PARITY  0x08/* Mask for L2 Cache Parity Protected bit */
 
-#ifdef CONFIG_8xx
+#ifdef CONFIG_MPC8xx
 /* Cache control on the MPC8xx is provided through some additional
  * special purpose registers.
  */
@@ -139,6 +139,6 @@ static inline void wr_dc_adr(uint val)
mtspr(DC_ADR, val);
 }
 #endif
-#endif /* CONFIG_8xx */
+#endif /* CONFIG_MPC8xx */
 
 #endif
diff --git a/arch/powerpc/include/asm/global_data.h 
b/arch/powerpc/include/asm/global_data.h
index 35a02b61a44..016dc19cb4c 100644
--- a/arch/powerpc/include/asm/global_data.h
+++ b/arch/powerpc/include/asm/global_data.h
@@ -19,7 +19,7 @@ struct arch_global_data {
u8 sdhc_adapter;
 #endif
 #endif
-#if defined(CONFIG_8xx)
+#if defined(CONFIG_MPC8xx)
unsigned long brg_clk;
 #endif
 #if defined(CONFIG_CPM2)
diff --git a/arch/powerpc/include/asm/8xx_immap.h 
b/arch/powerpc/include/asm/immap_8xx.h
similarity index 100%
rename from arch/powerpc/include/asm/8xx_immap.h
rename to arch/powerpc/include/asm/immap_8xx.h
diff --git a/arch/powerpc/include/asm/iopin_8xx.h 
b/arch/powerpc/include/asm/iopin_8xx.h
index 15679a2db55..3b4e1b64a41 100644
--- a/arch/powerpc/include/asm/iopin_8xx.h
+++ b/arch/powerpc/include/asm/iopin_8xx.h
@@ -11,7 +11,7 @@
 #define _ASM_IOPIN_8XX_H_
 
 #include 
-#include 
+#include 
 #include 
 
 #ifdef __KERNEL__
diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h
index 6ba10974b6d..c8d87a91b40 100644
--- 

[U-Boot] [PATCH v3 12/15] powerpc: mpc8xx: remove get_immr() argument

2018-03-06 Thread Christophe Leroy
get_immr() is always called with 0 as an argument, so it is useless.

Signed-off-by: Christophe Leroy 
---
 arch/powerpc/cpu/mpc8xx/cpu.c   | 2 +-
 arch/powerpc/cpu/mpc8xx/immap.c | 2 +-
 arch/powerpc/include/asm/ppc.h  | 6 ++
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c
index 20d042d3a19..c5669e6a8e0 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu.c
@@ -90,7 +90,7 @@ static int check_CPU(long clock, uint pvr, uint immr)
 int checkcpu(void)
 {
ulong clock = gd->cpu_clk;
-   uint immr = get_immr(0);/* Return full IMMR contents */
+   uint immr = get_immr(); /* Return full IMMR contents */
uint pvr = get_pvr();
 
puts("CPU:   ");
diff --git a/arch/powerpc/cpu/mpc8xx/immap.c b/arch/powerpc/cpu/mpc8xx/immap.c
index 7ef486053c2..0cbfe900771 100644
--- a/arch/powerpc/cpu/mpc8xx/immap.c
+++ b/arch/powerpc/cpu/mpc8xx/immap.c
@@ -349,7 +349,7 @@ void print_reginfo(void)
sit8xx_t __iomem *timers = >im_sit;
 
printf("\nSystem Configuration registers\n"
-   "\tIMMR\t0x%08X\n", get_immr(0));
+   "\tIMMR\t0x%08X\n", get_immr());
do_siuinfo(NULL, 0, 0, NULL);
 
printf("Memory Controller Registers\n");
diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h
index c8d87a91b40..8e76c38ea39 100644
--- a/arch/powerpc/include/asm/ppc.h
+++ b/arch/powerpc/include/asm/ppc.h
@@ -40,11 +40,9 @@
 
 #include 
 
-static inline uint get_immr(uint mask)
+static inline uint get_immr(void)
 {
-   uint immr = mfspr(SPRN_IMMR);
-
-   return mask ? (immr & mask) : immr;
+   return mfspr(SPRN_IMMR);
 }
 
 static inline uint get_pvr(void)
-- 
2.13.3

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


[U-Boot] [PATCH v3 14/15] common/env_embedded: allow fine placement of environment object

2018-03-06 Thread Christophe Leroy
Commit 7653942b10e9e ("common/env_embedded.c: drop support for
CONFIG_SYS_USE_PPCENV") dropped the .ppcenv section which was
used in linking scripts to allow fine placement of embedded
environment sections.

This implies that GCC randomly places objects from env/embedded.o
and environment is not guaranteed to be located at the correct address:

04003df8 g F .text  0038 mii_init
04004000 g O .text  0004 env_size
04004004 g O .text  2000 environment
04006004 g F .text  0040 .hidden __lshrdi3

This patch restores this capability by allocating each object marked
with __UBOOT_ENV_SECTION__ into a different section. Hence
'environment' will be alone in .text.environment, allowing a
fine placement in u-boot.lds with:

. = DEFINED(env_offset) ? env_offset : .;
env/embedded.o  (.text.environment)

Fixes 7653942b10e9e ("common/env_embedded.c: drop support for 
CONFIG_SYS_USE_PPCENV")
Cc: Thomas Petazzoni 

Signed-off-by: Christophe Leroy 
---
 env/embedded.c| 8 
 include/env_default.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/env/embedded.c b/env/embedded.c
index 43694db70fe..9b0a6a3c3da 100644
--- a/env/embedded.c
+++ b/env/embedded.c
@@ -35,11 +35,11 @@
  * a seperate section.
  */
 #if defined(USE_HOSTCC) /* Native for 'tools/envcrc' */
-#  define __UBOOT_ENV_SECTION__/*XXX DO_NOT_DEL_THIS_COMMENT*/
+#  define __UBOOT_ENV_SECTION__(name)  /*XXX DO_NOT_DEL_THIS_COMMENT*/
 
 #else /* Environment is embedded in U-Boot's .text section */
 /* XXX - This only works with GNU C */
-#  define __UBOOT_ENV_SECTION____attribute__ ((section(".text")))
+#  define __UBOOT_ENV_SECTION__(name)  __attribute__ ((section(".text."#name)))
 #endif
 
 /*
@@ -70,7 +70,7 @@
 #include 
 
 #ifdef CONFIG_ENV_ADDR_REDUND
-env_t redundand_environment __UBOOT_ENV_SECTION__ = {
+env_t redundand_environment __UBOOT_ENV_SECTION__(redundand_environment) = {
0,  /* CRC Sum: invalid */
0,  /* Flags:   invalid */
{
@@ -87,7 +87,7 @@ env_t redundand_environment __UBOOT_ENV_SECTION__ = {
  * .data/.sdata section.
  *
  */
-unsigned long env_size __UBOOT_ENV_SECTION__ = sizeof(env_t);
+unsigned long env_size __UBOOT_ENV_SECTION__(env_size) = sizeof(env_t);
 
 /*
  * Add in absolutes.
diff --git a/include/env_default.h b/include/env_default.h
index b574345af25..dd741315ba4 100644
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -11,7 +11,7 @@
 #include 
 
 #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED
-env_t environment __UBOOT_ENV_SECTION__ = {
+env_t environment __UBOOT_ENV_SECTION__(environment) = {
ENV_CRC,/* CRC Sum */
 #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
1,  /* Flags: valid */
-- 
2.13.3

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


[U-Boot] [PATCH v3 02/15] board, MCR3000: replace mtd->priv by mtd_to_nand()

2018-03-06 Thread Christophe Leroy
Since commit 17cb4b8f327eb ("mtd: nand: Add+use mtd_to/from_nand and
nand_get/set_controller_data"), mtd_to_nand() has to be used instead
of mtd->priv

Signed-off-by: Christophe Leroy 
---
 board/cssi/MCR3000/nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/cssi/MCR3000/nand.c b/board/cssi/MCR3000/nand.c
index 8e5b0d0618f..4c6fc865f23 100644
--- a/board/cssi/MCR3000/nand.c
+++ b/board/cssi/MCR3000/nand.c
@@ -17,7 +17,7 @@
 
 static void nand_hwcontrol(struct mtd_info *mtdinfo, int cmd, unsigned int 
ctrl)
 {
-   struct nand_chip *this  = mtdinfo->priv;
+   struct nand_chip *this  = mtd_to_nand(mtdinfo);
immap_t __iomem *immr   = (immap_t __iomem *)CONFIG_SYS_IMMR;
unsigned short pddat= 0;
 
-- 
2.13.3

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


[U-Boot] [PATCH v3 13/15] powerpc: mpc8xx: use PVR related defines and macros

2018-03-06 Thread Christophe Leroy
Avoid hardcoding the PVR values in C since they are defined
in processor.h

Signed-off-by: Christophe Leroy 
---
 arch/powerpc/cpu/mpc8xx/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c
index c5669e6a8e0..07139544156 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu.c
@@ -42,7 +42,7 @@ static int check_CPU(long clock, uint pvr, uint immr)
 
/* the highest 16 bits should be 0x0050 for a 860 */
 
-   if ((pvr >> 16) != 0x0050)
+   if (PVR_VER(pvr) != PVR_VER(PVR_8xx))
return -1;
 
k = (immr << 16) |
-- 
2.13.3

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


[U-Boot] [PATCH v3 06/15] powerpc: mpc8xx: cleaning up watchdog

2018-03-06 Thread Christophe Leroy
In preparation of migration to DM watchdog, clean up a bit.

The 8xx watchdog really is a HW watchdog, so declare it as is
then it goes through Kconfig

Signed-off-by: Christophe Leroy 
---
 arch/powerpc/Kconfig   |  1 +
 arch/powerpc/cpu/mpc8xx/cpu.c  | 20 +---
 arch/powerpc/cpu/mpc8xx/cpu_init.c |  4 +---
 include/configs/MCR3000.h  |  2 --
 include/watchdog.h |  5 -
 5 files changed, 7 insertions(+), 25 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 3a2653ff0d3..b20837b473f 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -34,6 +34,7 @@ config 8xx
bool "MPC8xx"
select BOARD_EARLY_INIT_F
imply CMD_REGINFO
+   imply HW_WATCHDOG
 
 endchoice
 
diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c
index 1e0ea28a918..1883440db34 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu.c
@@ -273,26 +273,16 @@ unsigned long get_tbclk(void)
 
 /* - */
 
-#if defined(CONFIG_WATCHDOG)
-void watchdog_reset(void)
+#if defined(CONFIG_HW_WATCHDOG)
+void hw_watchdog_reset(void)
 {
+   immap_t __iomem *immr = (immap_t __iomem *)CONFIG_SYS_IMMR;
int re_enable = disable_interrupts();
 
-   reset_8xx_watchdog((immap_t __iomem *)CONFIG_SYS_IMMR);
-   if (re_enable)
-   enable_interrupts();
-}
-#endif /* CONFIG_WATCHDOG */
-
-#if defined(CONFIG_WATCHDOG)
-
-void reset_8xx_watchdog(immap_t __iomem *immr)
-{
-   /*
-* All other boards use the MPC8xx Internal Watchdog
-*/
out_be16(>im_siu_conf.sc_swsr, 0x556c);   /* write magic1 */
out_be16(>im_siu_conf.sc_swsr, 0xaa39);   /* write magic2 */
+   if (re_enable)
+   enable_interrupts();
 }
 #endif /* CONFIG_WATCHDOG */
 
diff --git a/arch/powerpc/cpu/mpc8xx/cpu_init.c 
b/arch/powerpc/cpu/mpc8xx/cpu_init.c
index 3c9c4b19753..654d559eeb8 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu_init.c
@@ -34,9 +34,7 @@ void cpu_init_f(immap_t __iomem *immr)
 
out_be32(>im_siu_conf.sc_sypcr, CONFIG_SYS_SYPCR);
 
-#if defined(CONFIG_WATCHDOG)
-   reset_8xx_watchdog(immr);
-#endif /* CONFIG_WATCHDOG */
+   WATCHDOG_RESET();
 
/* SIUMCR - contains debug pin configuration (11-6) */
setbits_be32(>im_siu_conf.sc_siumcr, CONFIG_SYS_SIUMCR);
diff --git a/include/configs/MCR3000.h b/include/configs/MCR3000.h
index 43bbacfd9e6..ada009e5da4 100644
--- a/include/configs/MCR3000.h
+++ b/include/configs/MCR3000.h
@@ -60,8 +60,6 @@
 
 #define CONFIG_LOADS_ECHO  1   /* echo on for serial download  */
 
-#define CONFIG_WATCHDOG1   /* watchdog enabled */
-
 /* Miscellaneous configurable options */
 
 #define CONFIG_SYS_MEMTEST_START   0x2000
diff --git a/include/watchdog.h b/include/watchdog.h
index 64b59f107ad..52f4c506b04 100644
--- a/include/watchdog.h
+++ b/include/watchdog.h
@@ -72,11 +72,6 @@ int init_func_watchdog_reset(void);
  * Prototypes from $(CPU)/cpu.c.
  */
 
-/* MPC 8xx */
-#if defined(CONFIG_8xx) && !defined(__ASSEMBLY__)
-   void reset_8xx_watchdog(immap_t __iomem *immr);
-#endif
-
 #if defined(CONFIG_HW_WATCHDOG) && !defined(__ASSEMBLY__)
void hw_watchdog_init(void);
 #endif
-- 
2.13.3

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


[U-Boot] [PATCH v3 07/15] powerpc: mpc8xx: make get_immr() independent of CONFIG_8xx

2018-03-06 Thread Christophe Leroy
SPRN_IMMR is defined regardless of the CPU. Therefore, there
is no point in enclosing get_immr() inside a #ifdef CONFIG_8xx

As it a static inline function, it will in any case only be
compiled in functons using it.

Signed-off-by: Christophe Leroy 
---
 arch/powerpc/include/asm/ppc.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h
index 5e0aa08be93..6ba10974b6d 100644
--- a/arch/powerpc/include/asm/ppc.h
+++ b/arch/powerpc/include/asm/ppc.h
@@ -40,14 +40,13 @@
 
 #include 
 
-#if defined(CONFIG_8xx)
 static inline uint get_immr(uint mask)
 {
uint immr = mfspr(SPRN_IMMR);
 
return mask ? (immr & mask) : immr;
 }
-#endif
+
 static inline uint get_pvr(void)
 {
return mfspr(PVR);
-- 
2.13.3

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


[U-Boot] [PATCH v3 04/15] soft_i2c: cleanup - no mpc8xx support

2018-03-06 Thread Christophe Leroy
commit 907208c452999 ("powerpc: Partialy restore core of mpc8xx")
didn't bring back support for I2C on the mpc8xx

Signed-off-by: Christophe Leroy 
---
 drivers/i2c/soft_i2c.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
index 4fd5551a228..cc9c5ef356f 100644
--- a/drivers/i2c/soft_i2c.c
+++ b/drivers/i2c/soft_i2c.c
@@ -25,9 +25,6 @@
 #include 
 #endif
 #endif
-#if defined(CONFIG_8xx)
-#include 
-#endif
 #include 
 
 #if defined(CONFIG_SOFT_I2C_GPIO_SCL)
-- 
2.13.3

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


  1   2   >