[U-Boot] SPI NAND Support

2017-09-06 Thread Suresh Gupta
Hi Jagan,

Do we have NAND support in our SPI framework of u-boot. Please provide me some 
pointers if any so that I incorporate our controller with that driver.

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


Re: [U-Boot] [Patch v2] configs: SECURE_BOOT: Enable CONFIG_CMD_EXT4_WRITE

2017-09-06 Thread Sumit Garg
> -Original Message-
> From: York Sun
> Sent: Wednesday, September 06, 2017 9:47 PM
> To: Sumit Garg ; u-boot@lists.denx.de
> Cc: Ruchika Gupta ; Prabhakar Kushwaha
> ; tr...@konsulko.com
> Subject: Re: [Patch v2] configs: SECURE_BOOT: Enable
> CONFIG_CMD_EXT4_WRITE
> 
> On 08/25/2017 03:03 AM, Sumit Garg wrote:
> > As part of chain of trust with confidentiality along with distro boot,
> > linux kernel image needs to be stored in encrypted form on
> > ext4 boot partition. So enable CONFIG_CMD_EXT4_WRITE in case of Secure
> > boot.
> >
> > Signed-off-by: Sumit Garg 
> > ---
> >
> > Changes in v2:
> > Instead of adding CMD_EXT4_WRITE option in each defconfig, added this
> > option in Kconfig.
> >
> >   board/freescale/common/Kconfig | 2 ++
> >   1 file changed, 2 insertions(+)
> >
> > diff --git a/board/freescale/common/Kconfig
> > b/board/freescale/common/Kconfig index 53b606e..3496eed 100644
> > --- a/board/freescale/common/Kconfig
> > +++ b/board/freescale/common/Kconfig
> > @@ -6,6 +6,8 @@ config CHAIN_OF_TRUST
> > select SPL_BOARD_INIT if (ARM && SPL)
> > select SHA_HW_ACCEL
> > select SHA_PROG_HW_ACCEL
> > +   select CMD_EXT4
> > +   select CMD_EXT4_WRITE
> > bool
> > default y
> 
> Are you going to need this for all PowerPC platforms? This changes increases 
> 3K
> in text section.
> 
> Will Ruchika confirm?
> 
> York

We don't need this option on PowerPC platforms as we currently don't support 
distro
boot on PowerPC platforms. So we can enable this option for ARM platforms only.

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


Re: [U-Boot] Starting u-boot in USB otg mode

2017-09-06 Thread Kever Yang

Hi Michael,

There is no 'otg_mode' in U-Boot, the driver framework is different 
with kernel.


If you want to use usb device, you can use cmd like this:

ums 0 mmc 0

If you want to use usb host, you can use:

usb start

this command will enumerate all the device connect to the host port.


But there no support for work as host or device which depends on what's 
the usb id

pin in the cable.

Thanks,
- Kever
On 09/06/2017 05:56 PM, rivael_il wrote:

Hello u-booters!

I want to load u-boot-sunxi-with-spl.bin and make it operate the USB in otg 
mode.
(Where the host can still be connected to the board).

How can I achieve this?

(I have attempted to use: "usb0:dr_mode=otg,phy_type=utmi\0" without success).

Thank you,

Michael

___
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


[U-Boot] [PATCH] rockchip: firefly-rk3399: enable SPL_SYSRESET config

2017-09-06 Thread Kever Yang
After the patch below, we need to add SPL_SYSRESET for do_reset()
in SPL:
87c16d4 drivers: spl: consistently use the $(SPL_TPL_) macro

Signed-off-by: Kever Yang 
---

 configs/firefly-rk3399_defconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/firefly-rk3399_defconfig b/configs/firefly-rk3399_defconfig
index d8ea4cb..eead166 100644
--- a/configs/firefly-rk3399_defconfig
+++ b/configs/firefly-rk3399_defconfig
@@ -9,7 +9,6 @@ CONFIG_DEFAULT_DEVICE_TREE="rk3399-firefly"
 CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SPL_FIT_GENERATOR="board/rockchip/evb_rk3399/mk_fit_atf.sh"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
@@ -36,6 +35,7 @@ CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_TIME=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names 
interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_ENV_IS_IN_MMC=y
 CONFIG_REGMAP=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SYSCON=y
@@ -70,6 +70,7 @@ CONFIG_DEBUG_UART_CLOCK=2400
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550=y
 CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
-- 
1.9.1

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


[U-Boot] [PATCH 2/2] rockchip: ram: rk3399: update reg map for of-platdata

2017-09-06 Thread Kever Yang
After Simon's patch, the dtoc can work with 64bit address,
so we need to fix reg number for it.
Depend on Simon's patch set:
https://patchwork.ozlabs.org/cover/807266/

Signed-off-by: Kever Yang 
---

 drivers/ram/rockchip/sdram_rk3399.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ram/rockchip/sdram_rk3399.c 
b/drivers/ram/rockchip/sdram_rk3399.c
index 63342ab..5ed4b03 100644
--- a/drivers/ram/rockchip/sdram_rk3399.c
+++ b/drivers/ram/rockchip/sdram_rk3399.c
@@ -1115,7 +1115,7 @@ static int conv_of_platdata(struct udevice *dev)
int ret;
 
ret = regmap_init_mem_platdata(dev, dtplat->reg,
-   ARRAY_SIZE(dtplat->reg) / 4,
+   ARRAY_SIZE(dtplat->reg) / 2,
>map);
if (ret)
return ret;
-- 
1.9.1

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


[U-Boot] [PATCH 1/2] rockchip: sdhci: update reg map for of-platdata

2017-09-06 Thread Kever Yang
After Simon's patch, the dtoc can work with 64bit address,
so we need to fix reg number for it.
Depend on Simon's patch set:
https://patchwork.ozlabs.org/cover/807266/

Signed-off-by: Kever Yang 
---

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

diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c
index fd3bb10..a05a422 100644
--- a/drivers/mmc/rockchip_sdhci.c
+++ b/drivers/mmc/rockchip_sdhci.c
@@ -187,7 +187,7 @@ static int arasan_sdhci_probe(struct udevice *dev)
struct dtd_rockchip_rk3399_sdhci_5_1 *dtplat = >dtplat;
 
host->name = dev->name;
-   host->ioaddr = map_sysmem(dtplat->reg[1], dtplat->reg[3]);
+   host->ioaddr = map_sysmem(dtplat->reg[0], dtplat->reg[1]);
host->host_caps |= MMC_MODE_8BIT;
max_frequency = dtplat->max_frequency;
ret = clk_get_by_index_platdata(dev, 0, dtplat->clocks, );
-- 
1.9.1

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


Re: [U-Boot] [PATCH v2 00/16] dtoc: Add support for 64-bit addresses

2017-09-06 Thread Kever Yang

Hi Simon,

Thanks for your patches, It works very good. I have test the patch 
set on firefly-rk3399,


and the SPL works with OF_PLATDATA after I fix issue in clk(Philipp has 
point out) driver,


sdram driver and sdhci driver, I will send out my fix later.


Pls add my test tag for this patch set.
Tested-by: Kever Yang 

Thanks,
- Kever
On 08/30/2017 04:15 AM, Simon Glass wrote:

This series updates dtoc to support 64-bit addresses automatically. These
appear in C code as fdt64_t arrays:

struct dtd_test1 {
fdt64_t reg[2];

};

static struct dtd_test1 dtv_test1 = {
.reg= {0x1234, 0x5678},
};

C code can then process these address and size parents easily. This
feature is controlled by the #address-cells and #size-cells values of the
parent.

The v2 series also enhances phandle support so that it is now possible to
support phandles with different number of arguments. Several clean-up
patches are included also.

Changes in v2:
- Support 'reg' properties with a single cell (e.g. #size-cells = 0)
- Introduce an fdt_val_t type which is either 32- or 64-bits long
- Update rk3368 and rk3399 uses
- Drop review tags since there are significant changes in this patch

Simon Glass (16):
   fdt: Sync libfdt up to upstream
   dtoc: Adjust Node to record its parent
   dtoc: Add a 64-bit type and a way to convert cells into 64 bits
   dtoc: Avoid very long lines in output
   dtoc: Add support for 32 or 64-bit addresses
   dtoc: Handle 'reg' properties with unusual sizes
   dtoc: Update the Fdt class to record phandles
   dtoc: Use the Fdt's class's phandle map
   dtoc: Make is_phandle() a member function
   dtoc: Rename is_phandle() and adjust it to return more detail
   dtoc: Rename the phandle struct
   dtoc: Put each phandle on a separate line
   dtoc: Put phandle args in an array
   dtoc: Support properties containing multiple phandle values
   dtoc: Rename the auto-generated dt-structs.h file
   dtoc: Add a header to the generated files

  doc/driver-model/of-plat.txt   |   2 +-
  drivers/clk/clk-uclass.c   |   4 +-
  drivers/clk/rockchip/clk_rk3368.c  |   2 +-
  drivers/clk/rockchip/clk_rk3399.c  |   4 +-
  drivers/core/regmap.c  |   2 +-
  include/clk.h  |   4 +-
  include/dt-structs.h   |  16 ++-
  include/fdtdec.h   |   2 +
  include/regmap.h   |   2 +-
  include/syscon.h   |   6 +-
  lib/libfdt/fdt_rw.c|  20 ++-
  lib/libfdt/libfdt.h|  31 +
  lib/libfdt/pylibfdt/libfdt.i   |  58 
  scripts/Makefile.spl   |   5 +-
  tools/dtoc/dtb_platdata.py | 204 ++--
  tools/dtoc/dtoc_test_addr32.dts|  27 
  tools/dtoc/dtoc_test_addr32_64.dts |  33 +
  tools/dtoc/dtoc_test_addr64.dts|  33 +
  tools/dtoc/dtoc_test_addr64_32.dts |  33 +
  tools/dtoc/dtoc_test_phandle.dts   |  16 ++-
  tools/dtoc/dtoc_test_simple.dts|  14 ++
  tools/dtoc/fdt.py  |  19 ++-
  tools/dtoc/fdt_util.py |  16 +++
  tools/dtoc/test_dtoc.py| 270 -
  24 files changed, 748 insertions(+), 75 deletions(-)
  create mode 100644 tools/dtoc/dtoc_test_addr32.dts
  create mode 100644 tools/dtoc/dtoc_test_addr32_64.dts
  create mode 100644 tools/dtoc/dtoc_test_addr64.dts
  create mode 100644 tools/dtoc/dtoc_test_addr64_32.dts




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


[U-Boot] [PATCH 1/1] linker_lists: remove incorrect comment

2017-09-06 Thread Heinrich Schuchardt
Remove a comment line refering to a non-existent file.

Signed-off-by: Heinrich Schuchardt 
---
 include/linker_lists.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/linker_lists.h b/include/linker_lists.h
index 76898ab702..6ef89a2090 100644
--- a/include/linker_lists.h
+++ b/include/linker_lists.h
@@ -14,8 +14,7 @@
 #include 
 
 /*
- * There is no use in including this from ASM files, but that happens
- * anyway, e.g. PPC kgdb.S includes command.h which incluse us.
+ * There is no use in including this from ASM files.
  * So just don't define anything when included from ASM.
  */
 
-- 
2.11.0

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


[U-Boot] [PATCH V3 5/5] ARM: da850-evm: Enable DM_I2C

2017-09-06 Thread Adam Ford
With DM now enabled with the device tree pulled from Linux, we can
enable DM_I2C in U-Boot.

Reviewed-by: Jagan Teki 
Signed-off-by: Adam Ford 
---
V3: No Change
V2: New to series
 arch/arm/dts/da850-evm-u-boot.dtsi | 1 +
 configs/da850evm_defconfig | 3 +++
 include/configs/da850evm.h | 5 +++--
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/da850-evm-u-boot.dtsi 
b/arch/arm/dts/da850-evm-u-boot.dtsi
index 516bc1d..2041cde 100644
--- a/arch/arm/dts/da850-evm-u-boot.dtsi
+++ b/arch/arm/dts/da850-evm-u-boot.dtsi
@@ -13,6 +13,7 @@
};

aliases {
+   i2c0 = 
spi0 = 
};
 };
diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig
index 08cc2e8..d6cd1fa 100644
--- a/configs/da850evm_defconfig
+++ b/configs/da850evm_defconfig
@@ -24,6 +24,7 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
@@ -38,6 +39,8 @@ CONFIG_CMD_DIAG=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index a47ba96..38798b0 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -28,6 +28,7 @@
 #undef CONFIG_DM_SPI
 #undef CONFIG_DM_SPI_FLASH
 #undef CONFIG_DM_I2C
+#undef CONFIG_DM_I2C_COMPAT
 #endif
 /*
  * SoC Configuration
@@ -178,10 +179,10 @@
 /*
  * I2C Configuration
  */
+#ifndef CONFIG_SPL_BUILD
 #define CONFIG_SYS_I2C_DAVINCI
-#define CONFIG_SYS_DAVINCI_I2C_SPEED   25000
-#define CONFIG_SYS_DAVINCI_I2C_SLAVE   10 /* Bogus, master-only in U-Boot */
 #define CONFIG_SYS_I2C_EXPANDER_ADDR   0x20
+#endif
 
 /*
  * Flash & Environment
-- 
2.7.4

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


[U-Boot] [PATCH V3 3/5] arm: da850-evm: Enable DM and device tree support for da850-evm

2017-09-06 Thread Adam Ford
With the device tree ported and DM compatible drivers, enable:
OF_CONTROL, DM_SPI, DM_SPI_FLASH and DM_SERIAL

Reviewed-by: Jagan Teki 
Signed-off-by: Adam Ford 
---
V3: No Change

 configs/da850evm_defconfig |  9 +++--
 include/configs/da850evm.h | 17 +++--
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig
index 0135e7d..652da01 100644
--- a/configs/da850evm_defconfig
+++ b/configs/da850evm_defconfig
@@ -6,8 +6,8 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="da850-evm"
 CONFIG_SYS_EXTRA_OPTIONS="MAC_ADDR_IN_SPIFLASH"
-CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="mem=32M console=ttyS2,115200n8 root=/dev/mtdblock2 rw 
noinitrd ip=dhcp"
@@ -34,8 +34,13 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_DIAG=y
+CONFIG_OF_CONTROL=y
+CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_DM=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
-CONFIG_OF_LIBFDT=y
+CONFIG_DM_SPI=y
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 0736b39..b147bc5 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -21,6 +21,15 @@
 #endif
 
 /*
+* Disable DM_* for SPL build and can be re-enabled after adding
+* DM support in SPL
+*/
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_DM_SPI
+#undef CONFIG_DM_SPI_FLASH
+#undef CONFIG_DM_I2C
+#endif
+/*
  * SoC Configuration
  */
 #define CONFIG_MACH_DAVINCI_DA850_EVM
@@ -130,18 +139,23 @@
 /*
  * Serial Driver info
  */
+
+#ifdef CONFIG_SPL_BUILD
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size */
 #define CONFIG_SYS_NS16550_COM1DAVINCI_UART2_BASE /* Base address of 
UART2 */
+#endif
 #define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
 #define CONFIG_CONS_INDEX  1   /* use UART0 for console */
 
 #define CONFIG_SPI
 #define CONFIG_DAVINCI_SPI
-#define CONFIG_SYS_SPI_BASEDAVINCI_SPI1_BASE
 #define CONFIG_SYS_SPI_CLK clk_get(DAVINCI_SPI1_CLKID)
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SYS_SPI_BASEDAVINCI_SPI1_BASE
 #define CONFIG_SF_DEFAULT_SPEED3000
 #define CONFIG_ENV_SPI_MAX_HZ  CONFIG_SF_DEFAULT_SPEED
+#endif
 
 #ifdef CONFIG_USE_SPIFLASH
 #define CONFIG_SPL_SPI_LOAD
@@ -152,7 +166,6 @@
 /*
  * I2C Configuration
  */
-#define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_DAVINCI
 #define CONFIG_SYS_DAVINCI_I2C_SPEED   25000
 #define CONFIG_SYS_DAVINCI_I2C_SLAVE   10 /* Bogus, master-only in U-Boot */
-- 
2.7.4

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


[U-Boot] [PATCH V3 4/5] arm: da850-evm: Enable MTD Parts

2017-09-06 Thread Adam Ford
There is a discrepency between U-Boot and Linux on the partition map.
This enabes the MTD parts to pass MTD partition information from U-Boot to
Linux.  Linux already has a pending patch to enable MTD PARTS in
davinci_all_defconfig

Reviewed-by: Jagan Teki 
Signed-off-by: Adam Ford 
---
V3:  No Change
V2:  This patch is new to the series

 configs/da850evm_defconfig |  2 ++
 include/configs/da850evm.h | 16 ++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig
index 652da01..08cc2e8 100644
--- a/configs/da850evm_defconfig
+++ b/configs/da850evm_defconfig
@@ -33,6 +33,7 @@ CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
+CONFIG_CMD_MTDPARTS=y
 CONFIG_CMD_DIAG=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
@@ -41,6 +42,7 @@ CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI_FLASH_MTD=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
 CONFIG_DM_SPI=y
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index b147bc5..a47ba96 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -139,7 +139,6 @@
 /*
  * Serial Driver info
  */
-
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size */
@@ -148,6 +147,9 @@
 #define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
 #define CONFIG_CONS_INDEX  1   /* use UART0 for console */
 
+/*
+ * SPI Driver Info
+ */
 #define CONFIG_SPI
 #define CONFIG_DAVINCI_SPI
 #define CONFIG_SYS_SPI_CLK clk_get(DAVINCI_SPI1_CLKID)
@@ -156,11 +158,21 @@
 #define CONFIG_SF_DEFAULT_SPEED3000
 #define CONFIG_ENV_SPI_MAX_HZ  CONFIG_SF_DEFAULT_SPEED
 #endif
-
 #ifdef CONFIG_USE_SPIFLASH
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000
 #define CONFIG_SYS_SPI_U_BOOT_SIZE 0x4
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_SPI_FLASH_MTD
+#endif
+#define CONFIG_MTD_DEVICE  /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS  /* required for UBI partition support */
+#define MTDIDS_DEFAULT "nor0=spi0.0"
+#define MTDPARTS_DEFAULT   "mtdparts=spi0.0:"\
+   "512k(u-boot.ais),"\
+   "64k(u-boot-env),"\
+   "7552k(kernel-spare),"\
+   "64k(MAC-Address)"
 #endif
 
 /*
-- 
2.7.4

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


[U-Boot] [PATCH V3 2/5] spi: davinci_spi: Add da830-spi support for DM

2017-09-06 Thread Adam Ford
The DM support is already in the driver, so add
da830-spi to the compatible list.

Reviewed-by: Jagan Teki 
Signed-off-by: Adam Ford 
---
V3:  No Change
V2:  This patch is new to the series

 drivers/spi/davinci_spi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
index 291ef95..eda252d 100644
--- a/drivers/spi/davinci_spi.c
+++ b/drivers/spi/davinci_spi.c
@@ -563,6 +563,7 @@ static const struct dm_spi_ops davinci_spi_ops = {
 static const struct udevice_id davinci_spi_ids[] = {
{ .compatible = "ti,keystone-spi" },
{ .compatible = "ti,dm6441-spi" },
+   { .compatible = "ti,da830-spi" },
{ }
 };
 
-- 
2.7.4

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


[U-Boot] [PATCH V3 1/5] arm: dts: da850: Migrate da850-evm DTS files from Linux 4.13-RC5

2017-09-06 Thread Adam Ford
A few small additional items are needed to support DM_SPI and
DM_SERIAL, so those were added to da850-evm-u-boot.dtsi

Signed-off-by: Adam Ford 
---
V3:  New to series.  I forgot to generate this before. This is required before
 The rest of the files in the series.

 arch/arm/dts/da850-evm-u-boot.dtsi |  22 ++
 arch/arm/dts/da850-evm.dts | 304 +++
 arch/arm/dts/da850.dtsi| 581 +
 arch/arm/dts/tps6507x.dtsi |  47 +++
 4 files changed, 954 insertions(+)

diff --git a/arch/arm/dts/da850-evm-u-boot.dtsi 
b/arch/arm/dts/da850-evm-u-boot.dtsi
new file mode 100644
index 000..516bc1d
--- /dev/null
+++ b/arch/arm/dts/da850-evm-u-boot.dtsi
@@ -0,0 +1,22 @@
+/*
+ * da850-evm U-Boot Additions
+ *
+ * Copyright (C) 2017 Logic PD, Inc.
+ * Copyright (C) Adam Ford 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/ {
+   chosen {
+   stdout-path = 
+   };
+   
+   aliases {
+   spi0 = 
+   };
+};
+
+ {
+   compatible = "m25p64", "spi-flash";
+};
diff --git a/arch/arm/dts/da850-evm.dts b/arch/arm/dts/da850-evm.dts
new file mode 100644
index 000..67e72bc
--- /dev/null
+++ b/arch/arm/dts/da850-evm.dts
@@ -0,0 +1,304 @@
+/*
+ * Device Tree for DA850 EVM board
+ *
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation, version 2.
+ */
+/dts-v1/;
+#include "da850.dtsi"
+#include 
+
+/ {
+   compatible = "ti,da850-evm", "ti,da850";
+   model = "DA850/AM1808/OMAP-L138 EVM";
+
+   soc@1c0 {
+   pmx_core: pinmux@14120 {
+   status = "okay";
+
+   mcasp0_pins: pinmux_mcasp0_pins {
+   pinctrl-single,bits = <
+   /*
+* AHCLKX, ACLKX, AFSX, AHCLKR, ACLKR,
+* AFSR, AMUTE
+*/
+   0x00 0x 0x
+   /* AXR11, AXR12 */
+   0x04 0x00011000 0x000ff000
+   >;
+   };
+   nand_pins: nand_pins {
+   pinctrl-single,bits = <
+   /* EMA_WAIT[0], EMA_OE, EMA_WE, 
EMA_CS[4], EMA_CS[3] */
+   0x1c 0x10110110  0xf0ff0ff0
+   /*
+* EMA_D[0], EMA_D[1], EMA_D[2],
+* EMA_D[3], EMA_D[4], EMA_D[5],
+* EMA_D[6], EMA_D[7]
+*/
+   0x24 0x  0x
+   /* EMA_A[1], EMA_A[2] */
+   0x30 0x0110  0x0ff0
+   >;
+   };
+   };
+   serial0: serial@42000 {
+   status = "okay";
+   };
+   serial1: serial@10c000 {
+   status = "okay";
+   };
+   serial2: serial@10d000 {
+   status = "okay";
+   };
+   rtc0: rtc@23000 {
+   status = "okay";
+   };
+   i2c0: i2c@22000 {
+   status = "okay";
+   clock-frequency = <10>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+
+   tps: tps@48 {
+   reg = <0x48>;
+   };
+   tlv320aic3106: tlv320aic3106@18 {
+   #sound-dai-cells = <0>;
+   compatible = "ti,tlv320aic3106";
+   reg = <0x18>;
+   status = "okay";
+
+   /* Regulators */
+   IOVDD-supply = <_reg>;
+   /* Derived from VBAT: Baseboard 3.3V / 1.8V */
+   AVDD-supply = <>;
+   DRVDD-supply = <>;
+   DVDD-supply = <>;
+   };
+   tca6416: gpio@20 {
+   compatible = "ti,tca6416";
+   reg = <0x20>;
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+   };
+   wdt: wdt@21000 {
+  

Re: [U-Boot] [PATCH v3 10/14] doc: overlays: Tweak documentation regarding overlays

2017-09-06 Thread Łukasz Majewski

On 09/04/2017 10:12 PM, Pantelis Antoniou wrote:

From: Franklin S Cooper Jr 

Pull some information regarding overlays from commit messages and
put them directly within the documentation. Also add some information
regarding required dtc version to properly use overlays.

Signed-off-by: Franklin S Cooper Jr 
---
  doc/README.fdt-overlays | 85 +++--
  doc/uImage.FIT/overlay-fdt-boot.txt |  8 +++-
  2 files changed, 87 insertions(+), 6 deletions(-)

diff --git a/doc/README.fdt-overlays b/doc/README.fdt-overlays
index ee868ec..39139cb 100644
--- a/doc/README.fdt-overlays
+++ b/doc/README.fdt-overlays
@@ -1,9 +1,76 @@
-U-Boot FDT Overlay usage (without FIT images)
+U-Boot FDT Overlay usage
  =
  
-FDT overlays are now available for use even without FIT images.

-It is not as automagic as with FIT images though and require a few
-manual steps.
+Overlays Syntax
+---
+
+Overlays require slightly different syntax compared to traditional overlays.
+Please refer to dt-object-internal.txt in the dtc sources for information
+regarding the internal format of overlays:
+https://git.kernel.org/pub/scm/utils/dtc/dtc.git/tree/Documentation/dt-object-internal.txt
+
+Building Overlays
+-
+
+In a nutshell overlays provides a means to manipulate a symbol a previous dtb
+or overlay has defined. It requires both the base and all the overlays
+to be compiled with the -@ command line switch so that symbol information is
+included.
+
+Note support for -@ option can only be found in dtc version 1.4.4 or newer.
+Only version 4.14 or higher of the Linux kernel includes a built in version
+of dtc that meets this requirement.
+
+Building an overlay follows the same process as building a traditional dtb.
+
+For example:
+
+base.dts
+
+
+   /dts-v1/;
+   / {
+   foo: foonode {
+   foo-property;
+   };
+   };
+
+   $ dtc -@ -I dts -O dtb -o base.dtb base.dts
+
+bar.dts
+---
+
+   /dts-v1/;
+   /plugin/;
+   / {
+   fragment@1 {
+   target = <>;
+   __overlay__ {
+   overlay-1-property;
+   bar: barnode {
+   bar-property;
+   };
+   };
+   };
+   };
+
+   $ dtc -@ -I dts -O dtb -o bar.dtb bar.dts
+
+Ways to Utilize Overlays in U-boot
+--
+
+There are two ways to apply overlays in U-boot.
+1. Include and define overlays within a FIT image and have overlays
+   automatically applied.
+
+2. Manually load and apply overlays
+
+The remainder of this document will discuss using overlays via the manual
+approach. For information on using overlays as part of a FIT image please see:
+doc/uImage.FIT/overlay-fdt-boot.txt
+
+Manually Loading and Applying Overlays
+--
  
  1. Figure out where to place both the base device tree blob and the

  overlay. Make sure you have enough space to grow the base tree without
@@ -29,6 +96,16 @@ overlapping anything.
  
  => fdt apply $fdtovaddr
  
+6. Boot system like you would do with a traditional dtb.

+
+For bootm:
+
+=> bootm ${kerneladdr} - ${fdtaddr}
+
+For bootz:
+
+=> bootz ${kerneladdr} - ${fdtaddr}
+
  Please note that in case of an error, both the base and overlays are going
  to be invalidated, so keep copies to avoid reloading.
  
diff --git a/doc/uImage.FIT/overlay-fdt-boot.txt b/doc/uImage.FIT/overlay-fdt-boot.txt

index dbdf2a1..63e47da 100644
--- a/doc/uImage.FIT/overlay-fdt-boot.txt
+++ b/doc/uImage.FIT/overlay-fdt-boot.txt
@@ -1,5 +1,5 @@
-U-Boot FDT Overlay usage
-
+U-Boot FDT Overlay FIT usage
+
  
  Introduction

  
@@ -8,6 +8,10 @@ of similar boards and their expansion options. The same kernel 
on DT enabled
  platforms can support this easily enough by providing a DT blob upon boot
  that matches the desired configuration.
  
+This document focuses on specifically using overlays as part of a FIT image.

+General information regarding overlays including its syntax and building it
+can be found in doc/README.fdt-overlays
+
  Configuration without overlays
  --
  



Reviwed-by: Łukasz Majewski

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v3 09/14] doc: Document how to apply fdt overlays

2017-09-06 Thread Łukasz Majewski

On 09/04/2017 10:12 PM, Pantelis Antoniou wrote:

We have the capability to apply overlays on the command line but
we didn't have a document explaining how.

Signed-off-by: Pantelis Antoniou 
---
  doc/README.fdt-overlays | 37 +
  1 file changed, 37 insertions(+)
  create mode 100644 doc/README.fdt-overlays

diff --git a/doc/README.fdt-overlays b/doc/README.fdt-overlays
new file mode 100644
index 000..ee868ec
--- /dev/null
+++ b/doc/README.fdt-overlays
@@ -0,0 +1,37 @@
+U-Boot FDT Overlay usage (without FIT images)
+=
+
+FDT overlays are now available for use even without FIT images.
+It is not as automagic as with FIT images though and require a few
+manual steps.
+
+1. Figure out where to place both the base device tree blob and the
+overlay. Make sure you have enough space to grow the base tree without
+overlapping anything.
+
+=> setenv fdtaddr 0x87f0
+=> setenv fdtovaddr 0x87fc
+
+2. Load the base blob and overlay blobs
+
+=> load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/base.dtb
+=> load ${devtype} ${bootpart} ${fdtovaddr} ${bootdir}/overlay.dtb
+
+3. Set it as the working fdt tree.
+
+=> fdtaddr $fdtaddr
+
+4. Grow it enough so it can 'fit' all the applied overlays
+
+=> fdt resize 8192
+
+5. You are now ready to apply the overlay.
+
+=> fdt apply $fdtovaddr
+
+Please note that in case of an error, both the base and overlays are going
+to be invalidated, so keep copies to avoid reloading.
+
+Pantelis Antoniou
+pantelis.anton...@konsulko.com
+11/7/2017



Reviewed-by: Łukasz Majewski

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v3 08/14] fit: fdt overlays doc

2017-09-06 Thread Łukasz Majewski

On 09/04/2017 10:12 PM, Pantelis Antoniou wrote:

Signed-off-by: Pantelis Antoniou 
---
  doc/uImage.FIT/command_syntax_extensions.txt |  12 +-
  doc/uImage.FIT/overlay-fdt-boot.txt  | 221 +++
  doc/uImage.FIT/source_file_format.txt|   6 +-
  3 files changed, 236 insertions(+), 3 deletions(-)
  create mode 100644 doc/uImage.FIT/overlay-fdt-boot.txt

diff --git a/doc/uImage.FIT/command_syntax_extensions.txt 
b/doc/uImage.FIT/command_syntax_extensions.txt
index 6c99b1c..676f992 100644
--- a/doc/uImage.FIT/command_syntax_extensions.txt
+++ b/doc/uImage.FIT/command_syntax_extensions.txt
@@ -36,7 +36,7 @@ Old uImage:
  New uImage:
  8.  bootm 
  9.  bootm []:
-10. bootm []#
+10. bootm []#[#;
+   entry = <0x8200>;
+   };
+   fdt@1 {
+   data = /incbin/("./foo-reva.dtb");
+   type = "flat_dt";
+   arch = "arm";
+   };
+   fdt@2 {
+   data = /incbin/("./foo-revb.dtb");
+   type = "flat_dt";
+   arch = "arm";
+   };
+   fdt@3 {
+   data = /incbin/("./foo-reva-bar.dtb");
+   type = "flat_dt";
+   arch = "arm";
+   };
+   fdt@4 {
+   data = /incbin/("./foo-revb-bar.dtb");
+   type = "flat_dt";
+   arch = "arm";
+   };
+   fdt@5 {
+   data = /incbin/("./foo-revb-baz.dtb");
+   type = "flat_dt";
+   arch = "arm";
+   };
+   fdt@6 {
+   data = /incbin/("./foo-revb-bar-baz.dtb");
+   type = "flat_dt";
+   arch = "arm";
+   };
+   };
+
+   configurations {
+   default = "foo-reva.dtb;
+   foo-reva.dtb {
+   kernel = "kernel@1";
+   fdt = "fdt@1";
+   };
+   foo-revb.dtb {
+   kernel = "kernel@1";
+   fdt = "fdt@2";
+   };
+   foo-reva-bar.dtb {
+   kernel = "kernel@1";
+   fdt = "fdt@3";
+   };
+   

Re: [U-Boot] [PATCH 0/5] vsprintf and short-wchar for EFI_LOADER

2017-09-06 Thread Tom Rini
On Wed, Sep 06, 2017 at 02:14:21PM -0400, Rob Clark wrote:
> On Wed, Sep 6, 2017 at 12:45 PM, Tom Rini  wrote:
> > On Wed, Sep 06, 2017 at 05:31:52PM +0200, Heinrich Schuchardt wrote:
> >> On 08/10/2017 01:14 AM, Rob Clark wrote:
> >> > As requested, I've split this out of the larger EFI_LOADER patchset.
> >> >
> >> > This adds two things that the later EFI_LOADER patchset depends on:
> >> >
> >> > 1) UUID/GUID support
> >> > 2) %ls UTF string support, in particular UTF-16.  In the UEFI API,
> >> >all strings are UTF-16
> >> >
> >> > I had started converting this over to using c11 + u"string" literals,
> >> > instead of using -fshort-wchar + L"string" literals and %ls, but I
> >> > ran into two problems:
> >> >
> >> > 1) we lose out on the printf (and friends) va_arg type checking if we
> >> >roll our own custom printf fmt modifier for UTF-16 strings
> >> > 2) and worse than that, we have to disable -Wformat warnings
> >> >
> >> > So given that we have a significant downside for not just using
> >> > -fshort-wchar, and I don't think any really strong argument against,
> >> > I am back to thinking that we should just go with -fshort-wchar.
> >> >
> >> > The current patchset has a Kconfig option to opt-in to -fshort-wchar,
> >> > which EFI_LOADER selects.  If the consensus is to enable -fshort-wchar
> >> > for everything, I'll drop the kconfig part and make it unconditional.
> >> >
> >> > The current version of this patchset and efi-loader patchset are at
> >> >
> >> >   https://github.com/robclark/u-boot.git  vsprintf
> >> >
> >> > and
> >> >
> >> >   https://github.com/robclark/u-boot.git enough-uefi-for-shim-2
> >> >
> >> > I'll resend the enought-uefi-for-shim-2 patchset after I have a
> >> > chance to figure out fs-test.sh and add tests for fs_readdir().
> >> >
> >> > Rob Clark (5):
> >> >   Kconfig: add option to build with -fshort-wchar
> >> >   lib: add some utf16 handling helpers
> >> >   vsprintf.c: add UTF-16 string (%ls) support
> >> >   vsprintf.c: add GUID printing
> >> >   examples: add fallback memcpy
> >> >
> >> >  Kconfig  |  8 +
> >> >  Makefile |  4 +++
> >> >  examples/api/Makefile|  2 ++
> >> >  examples/api/glue.c  | 12 +++
> >> >  include/charset.h| 55 ++
> >> >  include/config_fallbacks.h   |  1 +
> >> >  lib/Makefile |  1 +
> >> >  lib/charset.c| 81 
> >> > 
> >> >  lib/efi_loader/Kconfig   |  1 +
> >> >  lib/efi_loader/efi_console.c | 17 ++
> >> >  lib/vsprintf.c   | 77 
> >> > ++---
> >> >  11 files changed, 241 insertions(+), 18 deletions(-)
> >> >  create mode 100644 include/charset.h
> >> >  create mode 100644 lib/charset.c
> >> >
> >>
> >> Hello Tom,
> >>
> >> what is happening with this patch series?
> >>
> >> [U-Boot,5/5] examples: add fallback memcpy
> >> https://patchwork.ozlabs.org/patch/800030/
> >> [U-Boot,4/5] vsprintf.c: add GUID printing
> >> https://patchwork.ozlabs.org/patch/800029/
> >> [U-Boot,3/5] vsprintf.c: add UTF-16 string (%ls) support
> >> https://patchwork.ozlabs.org/patch/800027/
> >> [U-Boot,2/5] lib: add some utf16 handling helpers
> >> https://patchwork.ozlabs.org/patch/800028/
> >> [U-Boot,1/5] Kconfig: add option to build with -fshort-wchar
> >> https://patchwork.ozlabs.org/patch/800026/
> >>
> >> Was it too late for 2017.09 and will be merged with 2017.11?
> >
> > I replied to the first patch saying that we should always -fshort-wchar
> > and enforce stdc-2011 as the default.  That would be good to open
> > 2017.11 with as well.  Thanks!
> >
> 
> Oh, I guess I should resend that.  Probably c11 should be a different
> patch (although I am in favour of switching)..
> 
> When does the merge window open for 2017.11?  It would be good to land
> this and the fs/fat patches early so we could start merging the pile
> of efi_loader patches that depend on these.

v2017.09 will be released on the 11th, if things are going well,
sometime more morning than not, eastern time.  Then I'll start grabbing
stuff and testing.  If you would like to suggest orders of things to
pull in, pointers to bundles in patchwork would be great.  Otherwise
I'll be assembling them myself as always.  Thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 0/5] vsprintf and short-wchar for EFI_LOADER

2017-09-06 Thread Rob Clark
On Wed, Sep 6, 2017 at 12:45 PM, Tom Rini  wrote:
> On Wed, Sep 06, 2017 at 05:31:52PM +0200, Heinrich Schuchardt wrote:
>> On 08/10/2017 01:14 AM, Rob Clark wrote:
>> > As requested, I've split this out of the larger EFI_LOADER patchset.
>> >
>> > This adds two things that the later EFI_LOADER patchset depends on:
>> >
>> > 1) UUID/GUID support
>> > 2) %ls UTF string support, in particular UTF-16.  In the UEFI API,
>> >all strings are UTF-16
>> >
>> > I had started converting this over to using c11 + u"string" literals,
>> > instead of using -fshort-wchar + L"string" literals and %ls, but I
>> > ran into two problems:
>> >
>> > 1) we lose out on the printf (and friends) va_arg type checking if we
>> >roll our own custom printf fmt modifier for UTF-16 strings
>> > 2) and worse than that, we have to disable -Wformat warnings
>> >
>> > So given that we have a significant downside for not just using
>> > -fshort-wchar, and I don't think any really strong argument against,
>> > I am back to thinking that we should just go with -fshort-wchar.
>> >
>> > The current patchset has a Kconfig option to opt-in to -fshort-wchar,
>> > which EFI_LOADER selects.  If the consensus is to enable -fshort-wchar
>> > for everything, I'll drop the kconfig part and make it unconditional.
>> >
>> > The current version of this patchset and efi-loader patchset are at
>> >
>> >   https://github.com/robclark/u-boot.git  vsprintf
>> >
>> > and
>> >
>> >   https://github.com/robclark/u-boot.git enough-uefi-for-shim-2
>> >
>> > I'll resend the enought-uefi-for-shim-2 patchset after I have a
>> > chance to figure out fs-test.sh and add tests for fs_readdir().
>> >
>> > Rob Clark (5):
>> >   Kconfig: add option to build with -fshort-wchar
>> >   lib: add some utf16 handling helpers
>> >   vsprintf.c: add UTF-16 string (%ls) support
>> >   vsprintf.c: add GUID printing
>> >   examples: add fallback memcpy
>> >
>> >  Kconfig  |  8 +
>> >  Makefile |  4 +++
>> >  examples/api/Makefile|  2 ++
>> >  examples/api/glue.c  | 12 +++
>> >  include/charset.h| 55 ++
>> >  include/config_fallbacks.h   |  1 +
>> >  lib/Makefile |  1 +
>> >  lib/charset.c| 81 
>> > 
>> >  lib/efi_loader/Kconfig   |  1 +
>> >  lib/efi_loader/efi_console.c | 17 ++
>> >  lib/vsprintf.c   | 77 
>> > ++---
>> >  11 files changed, 241 insertions(+), 18 deletions(-)
>> >  create mode 100644 include/charset.h
>> >  create mode 100644 lib/charset.c
>> >
>>
>> Hello Tom,
>>
>> what is happening with this patch series?
>>
>> [U-Boot,5/5] examples: add fallback memcpy
>> https://patchwork.ozlabs.org/patch/800030/
>> [U-Boot,4/5] vsprintf.c: add GUID printing
>> https://patchwork.ozlabs.org/patch/800029/
>> [U-Boot,3/5] vsprintf.c: add UTF-16 string (%ls) support
>> https://patchwork.ozlabs.org/patch/800027/
>> [U-Boot,2/5] lib: add some utf16 handling helpers
>> https://patchwork.ozlabs.org/patch/800028/
>> [U-Boot,1/5] Kconfig: add option to build with -fshort-wchar
>> https://patchwork.ozlabs.org/patch/800026/
>>
>> Was it too late for 2017.09 and will be merged with 2017.11?
>
> I replied to the first patch saying that we should always -fshort-wchar
> and enforce stdc-2011 as the default.  That would be good to open
> 2017.11 with as well.  Thanks!
>

Oh, I guess I should resend that.  Probably c11 should be a different
patch (although I am in favour of switching)..

When does the merge window open for 2017.11?  It would be good to land
this and the fs/fat patches early so we could start merging the pile
of efi_loader patches that depend on these.

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


Re: [U-Boot] [PATCH] ipu_common: Let the MX6 IPU clock be calculated in run-time

2017-09-06 Thread Eric Nelson

Thanks Fabio,

On 09/06/2017 09:49 AM, Fabio Estevam wrote:

From: Fabio Estevam 

MX6Q/QP IPU operates at 264MHz and MX6DL IPU at 198MHz.

When running a SPL target, which supports multiple MX6 variants we cannot
properly setup the IPU clock frequency via CONFIG_IPUV3_CLK option as
such decision is done in build-time currently.

Remove the CONFIG_IPUV3_CLK option and let the IPU clock frequency be
configured in run-time on mx6.

Reported-by: Eric Nelson 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Improve the mx6 detection logic (Troy)

  drivers/video/ipu_common.c| 14 +-
  include/configs/advantech_dms-ba16.h  |  1 -
  include/configs/apalis_imx6.h |  1 -
  include/configs/aristainetos-common.h |  1 -
  include/configs/cgtqmx6eval.h |  4 
  include/configs/cm_fx6.h  |  1 -
  include/configs/colibri_imx6.h|  1 -
  include/configs/embestmx6boards.h |  1 -
  include/configs/ge_bx50v3.h   |  1 -
  include/configs/gw_ventana.h  |  1 -
  include/configs/imx6-engicam.h|  1 -
  include/configs/m53evk.h  |  1 -
  include/configs/mx51evk.h |  1 -
  include/configs/mx53cx9020.h  |  1 -
  include/configs/mx53loco.h|  1 -
  include/configs/mx6cuboxi.h   |  1 -
  include/configs/mx6sabre_common.h |  5 -
  include/configs/nitrogen6x.h  |  1 -
  include/configs/novena.h  |  1 -
  include/configs/tbs2910.h |  1 -
  include/configs/wandboard.h   |  1 -
  scripts/config_whitelist.txt  |  1 -
  22 files changed, 13 insertions(+), 29 deletions(-)

diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c
index f8d4488..a9584b8 100644
--- a/drivers/video/ipu_common.c
+++ b/drivers/video/ipu_common.c
@@ -19,6 +19,7 @@
  #include 
  #include 
  #include 
+#include 
  #include 
  #include "ipu.h"
  #include "ipu_regs.h"
@@ -81,6 +82,11 @@ struct ipu_ch_param {
  
  #define IPU_SW_RST_TOUT_USEC	(1)
  
+#define IPUV3_CLK_MX51		13300

+#define IPUV3_CLK_MX53 2
+#define IPUV3_CLK_MX6Q 26400
+#define IPUV3_CLK_MX6DL19800
+
  void clk_enable(struct clk *clk)
  {
if (clk) {
@@ -196,7 +202,6 @@ static void clk_ipu_disable(struct clk *clk)
  
  static struct clk ipu_clk = {

.name = "ipu_clk",
-   .rate = CONFIG_IPUV3_CLK,
  #if defined(CONFIG_MX51) || defined(CONFIG_MX53)
.enable_reg = (u32 *)(CCM_BASE_ADDR +
offsetof(struct mxc_ccm_reg, CCGR5)),
@@ -476,6 +481,13 @@ int ipu_probe(void)
g_pixel_clk[1] = _clk[1];
  
  	g_ipu_clk = _clk;

+#if defined(CONFIG_MX51)
+   g_ipu_clk->rate = IPUV3_CLK_MX51;
+#elif defined(CONFIG_MX53)
+   g_ipu_clk->rate = IPUV3_CLK_MX53;
+#else
+   g_ipu_clk->rate = is_mx6sdl() ? IPUV3_CLK_MX6DL : IPUV3_CLK_MX6Q;
+#endif
debug("ipu_clk = %u\n", clk_get_rate(g_ipu_clk));
g_ldb_clk = _clk;
debug("ldb_clk = %u\n", clk_get_rate(g_ldb_clk));
diff --git a/include/configs/advantech_dms-ba16.h 
b/include/configs/advantech_dms-ba16.h
index 6329bf6..6e380d0 100644
--- a/include/configs/advantech_dms-ba16.h
+++ b/include/configs/advantech_dms-ba16.h
@@ -260,7 +260,6 @@
  #define CONFIG_BMP_16BPP
  #define CONFIG_VIDEO_LOGO
  #define CONFIG_VIDEO_BMP_LOGO
-#define CONFIG_IPUV3_CLK26000
  #define CONFIG_IMX_HDMI
  #define CONFIG_IMX_VIDEO_SKIP
  #endif
diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h
index 16af141..f10ce6d 100644
--- a/include/configs/apalis_imx6.h
+++ b/include/configs/apalis_imx6.h
@@ -124,7 +124,6 @@
  #define CONFIG_BMP_16BPP
  #define CONFIG_VIDEO_LOGO
  #define CONFIG_VIDEO_BMP_LOGO
-#define CONFIG_IPUV3_CLK   26000
  #define CONFIG_CONSOLE_MUX
  #define CONFIG_IMX_HDMI
  #define CONFIG_IMX_VIDEO_SKIP
diff --git a/include/configs/aristainetos-common.h 
b/include/configs/aristainetos-common.h
index 1c28fcf..3afc7a6 100644
--- a/include/configs/aristainetos-common.h
+++ b/include/configs/aristainetos-common.h
@@ -217,7 +217,6 @@
  #define CONFIG_BMP_16BPP
  #define CONFIG_VIDEO_LOGO
  #define CONFIG_VIDEO_BMP_LOGO
-#define CONFIG_IPUV3_CLK 19800
  #define CONFIG_IMX_VIDEO_SKIP
  
  #define CONFIG_PWM_IMX

diff --git a/include/configs/cgtqmx6eval.h b/include/configs/cgtqmx6eval.h
index 4996a89..6a6c063 100644
--- a/include/configs/cgtqmx6eval.h
+++ b/include/configs/cgtqmx6eval.h
@@ -87,10 +87,6 @@
  #define CONFIG_BMP_16BPP
  #define CONFIG_VIDEO_LOGO
  #define CONFIG_VIDEO_BMP_LOGO
-#ifdef CONFIG_MX6DL
-#define CONFIG_IPUV3_CLK 19800
-#else
-#define CONFIG_IPUV3_CLK 26400
  #endif
  #define CONFIG_IMX_HDMI
  
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h

index 4f45be1..5d4b670 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -240,7 +240,6 @@
  
  /* Display */

  

Re: [U-Boot] [U-Boot,2/3] imx: mx6: correct IPU clock

2017-09-06 Thread Eric Nelson

Thanks Ye (and Peng).

On 09/06/2017 02:37 AM, Ye Li wrote:

On 9/5/2017 6:33 PM, Eric Nelson wrote:

Hi Peng,

Pardon the reference to an old update, but do you have a description
of the symptoms that brought about this patch?

On 03/09/2016 01:07 AM, Peng Fan wrote:

The CONFIG_IPUV3_CLK should be 26400, to i.MX6DL, it should be
19800.

Signed-off-by: Peng Fan 
Signed-off-by: Sandor Yu 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Peter Robinson 
---
include/configs/mx6sabre_common.h | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/configs/mx6sabre_common.h 
b/include/configs/mx6sabre_common.h
index 29d1f91..a6d821b 100644
--- a/include/configs/mx6sabre_common.h
+++ b/include/configs/mx6sabre_common.h
@@ -225,7 +225,11 @@
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
-#define CONFIG_IPUV3_CLK 26000
+#ifdef CONFIG_MX6DL
+#define CONFIG_IPUV3_CLK 19800
+#else
+#define CONFIG_IPUV3_CLK 26400
+#endif



Note that this should probably be applied for other boards
which are compiled for multiple CPU types.

At least the Boundary Nitrogen boards, but probably others
like Wand have ordering options for DL or Solo processors
and may need the reduced clock rate.



#define CONFIG_IMX_HDMI
#define CONFIG_IMX_VIDEO_SKIP



Please advise,


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



CONFIG_IPUV3_CLK is used to indicate the default rate for IPU HSP clock.
The IPU driver in u-boot won't calculate the HSP clock rate according to
CCM registers, it needs this setting to know current rate. 198Mhz is the
correct value on DL not the 264Mhz.

If you select IPU DI clock (pixel clock) derived from HSP clock not the
external clock like LDB DI clock, I believe the 264Mhz will cause problem.



Do you know what sort of problem was seen (if any)?

Please advise,


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


Re: [U-Boot] video: ipu_common: fix build error

2017-09-06 Thread Eric Nelson

Thanks Peng.

On 09/05/2017 06:16 PM, Peng Fan wrote:

On Mon, Sep 04, 2017 at 07:48:56PM -0700, Eric Nelson wrote:

Hi Peng,

Can you tell that I'm hunting a bug in an old version?

I'm seeing a **very** intermittent regression between U-Boot
versions 2015.07 and 2016.05 and happened to spot something
in this patch.

On 04/27/2016 07:07 PM, Peng Fan wrote:

Some toolchains fail to build
"clk->rate = (u64)(clk->parent->rate * 16) / div;"
And the cast usage is wrong.

Use the following code to fix the issue,
"
   do_div(parent_rate, div);
   clk->rate = parent_rate;
"

Reported-by: Peter Robinson 
Signed-off-by: Peng Fan 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Tom Rini 
Cc: Anatolij Gustschin 
Cc: Peter Robinson 
Reviewed-by: Tom Rini 
Tested-by: Peter Robinson 
---

Hi Peter,

  Please help test this patch to see whether this fix your issue or not.
  Thanks for pointing out this issue.

Thanks,
Peng.

  drivers/video/ipu_common.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c
index 36d4b23..5676a0f 100644
--- a/drivers/video/ipu_common.c
+++ b/drivers/video/ipu_common.c
@@ -352,7 +352,9 @@ static int ipu_pixel_clk_set_rate(struct clk *clk, unsigned 
long rate)
 */
__raw_writel((div / 16) << 16, DI_BS_CLKGEN1(clk->id));


Did we lose a multiply by 16 in this change?


We already have "parent_rate = (unsigned long long)clk->parent->rate * 16;"
in this function.



Hmmm. So this patch also fixed a bug, since we previously had
**two** multiply-by-16's:

http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/video/ipu_common.c;hb=3cb4f25cc702db17455583599d0940c81337a17a

Regards,


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


[U-Boot] [PATCH v1] cmd: usb: add blk devices to ignore list in tree graph

2017-09-06 Thread Suneel Garapati
add blk child devices to ignore list while displaying
usb tree graph, otherwise usb tree and info commands
may cause crash treating blk as usb device.

Signed-off-by: Suneel Garapati 
---

Changes v1:
 - add separate check on blk uclass
 - modify description
 - add separate check on parent uclass as usb

 cmd/usb.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/cmd/usb.c b/cmd/usb.c
index d95bcf5..cb0e183 100644
--- a/cmd/usb.c
+++ b/cmd/usb.c
@@ -414,8 +414,13 @@ static void usb_show_tree_graph(struct usb_device *dev, 
char *pre)
 
udev = dev_get_parent_priv(child);
 
-   /* Ignore emulators, we only want real devices */
-   if (device_get_uclass_id(child) != UCLASS_USB_EMUL) {
+   /*
+* Ignore emulators and block child devices, with check on
+* parent uclass as usb, we only want real devices
+*/
+   if ((device_get_uclass_id(child) != UCLASS_USB_EMUL) &&
+   (device_get_uclass_id(child) != UCLASS_BLK) &&
+   (device_get_uclass_id(child->parent) == UCLASS_USB)) {
usb_show_tree_graph(udev, pre);
pre[index] = 0;
}
@@ -605,7 +610,8 @@ static void usb_show_info(struct usb_device *udev)
for (device_find_first_child(udev->dev, );
 child;
 device_find_next_child()) {
-   if (device_active(child)) {
+   if (device_active(child) &&
+   (device_get_uclass_id(child) != UCLASS_BLK)) {
udev = dev_get_parent_priv(child);
usb_show_info(udev);
}
-- 
2.7.4

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


[U-Boot] [PATCH v1] drivers: ahci: write upper 32 bits for clb and fis registers

2017-09-06 Thread Suneel Garapati
If 64-bit capability is supported, commandlistbase and fis base
should be split as lower32 and upper32. upper32 should be
written to PORT_(LST/FIS)_ADDR_HI.

Signed-off-by: Suneel Garapati 
---

Changes v1:
 - add macro definitions for LOWER32, UPPER32


 drivers/ata/ahci.c | 14 --
 include/ahci.h |  1 +
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 5e4df19..178d9a7 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -27,6 +27,9 @@
 #include 
 #include 
 
+#define LOWER32(val)   (u32)((u64)(val) & 0x)
+#define UPPER32(val)   (u32)(((u64)(val) & 0xULL) >> 32)
+
 static int ata_io_flush(struct ahci_uc_priv *uc_priv, u8 port);
 
 #ifndef CONFIG_DM_SCSI
@@ -607,10 +610,17 @@ static int ahci_port_start(struct ahci_uc_priv *uc_priv, 
u8 port)
pp->cmd_tbl_sg =
(struct ahci_sg *)(uintptr_t)virt_to_phys((void *)mem);
 
-   writel_with_flush((unsigned long)pp->cmd_slot,
+   if (uc_priv->cap & HOST_CAP_64)
+   writel_with_flush(cpu_to_le32(UPPER32(pp->cmd_slot)),
+ port_mmio + PORT_LST_ADDR_HI);
+   writel_with_flush(cpu_to_le32(LOWER32(pp->cmd_slot)),
  port_mmio + PORT_LST_ADDR);
 
-   writel_with_flush(pp->rx_fis, port_mmio + PORT_FIS_ADDR);
+   if (uc_priv->cap & HOST_CAP_64)
+   writel_with_flush(cpu_to_le32(UPPER32(pp->rx_fis)),
+ port_mmio + PORT_FIS_ADDR_HI);
+   writel_with_flush(cpu_to_le32(LOWER32(pp->rx_fis)),
+ port_mmio + PORT_FIS_ADDR);
 
 #ifdef CONFIG_SUNXI_AHCI
sunxi_dma_init(port_mmio);
diff --git a/include/ahci.h b/include/ahci.h
index 33171b7..80e7f13 100644
--- a/include/ahci.h
+++ b/include/ahci.h
@@ -40,6 +40,7 @@
 #define HOST_RESET (1 << 0)  /* reset controller; self-clear */
 #define HOST_IRQ_EN(1 << 1)  /* global IRQ enable */
 #define HOST_AHCI_EN   (1 << 31) /* AHCI enabled */
+#define HOST_CAP_64(1 << 31) /* 64bit addressing capability */
 
 /* Registers for each SATA port */
 #define PORT_LST_ADDR  0x00 /* command list DMA addr */
-- 
2.7.4

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


[U-Boot] [PATCH] ipu_common: Let the MX6 IPU clock be calculated in run-time

2017-09-06 Thread Fabio Estevam
From: Fabio Estevam 

MX6Q/QP IPU operates at 264MHz and MX6DL IPU at 198MHz.

When running a SPL target, which supports multiple MX6 variants we cannot
properly setup the IPU clock frequency via CONFIG_IPUV3_CLK option as
such decision is done in build-time currently.

Remove the CONFIG_IPUV3_CLK option and let the IPU clock frequency be
configured in run-time on mx6.

Reported-by: Eric Nelson 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Improve the mx6 detection logic (Troy)

 drivers/video/ipu_common.c| 14 +-
 include/configs/advantech_dms-ba16.h  |  1 -
 include/configs/apalis_imx6.h |  1 -
 include/configs/aristainetos-common.h |  1 -
 include/configs/cgtqmx6eval.h |  4 
 include/configs/cm_fx6.h  |  1 -
 include/configs/colibri_imx6.h|  1 -
 include/configs/embestmx6boards.h |  1 -
 include/configs/ge_bx50v3.h   |  1 -
 include/configs/gw_ventana.h  |  1 -
 include/configs/imx6-engicam.h|  1 -
 include/configs/m53evk.h  |  1 -
 include/configs/mx51evk.h |  1 -
 include/configs/mx53cx9020.h  |  1 -
 include/configs/mx53loco.h|  1 -
 include/configs/mx6cuboxi.h   |  1 -
 include/configs/mx6sabre_common.h |  5 -
 include/configs/nitrogen6x.h  |  1 -
 include/configs/novena.h  |  1 -
 include/configs/tbs2910.h |  1 -
 include/configs/wandboard.h   |  1 -
 scripts/config_whitelist.txt  |  1 -
 22 files changed, 13 insertions(+), 29 deletions(-)

diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c
index f8d4488..a9584b8 100644
--- a/drivers/video/ipu_common.c
+++ b/drivers/video/ipu_common.c
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "ipu.h"
 #include "ipu_regs.h"
@@ -81,6 +82,11 @@ struct ipu_ch_param {
 
 #define IPU_SW_RST_TOUT_USEC   (1)
 
+#define IPUV3_CLK_MX51 13300
+#define IPUV3_CLK_MX53 2
+#define IPUV3_CLK_MX6Q 26400
+#define IPUV3_CLK_MX6DL19800
+
 void clk_enable(struct clk *clk)
 {
if (clk) {
@@ -196,7 +202,6 @@ static void clk_ipu_disable(struct clk *clk)
 
 static struct clk ipu_clk = {
.name = "ipu_clk",
-   .rate = CONFIG_IPUV3_CLK,
 #if defined(CONFIG_MX51) || defined(CONFIG_MX53)
.enable_reg = (u32 *)(CCM_BASE_ADDR +
offsetof(struct mxc_ccm_reg, CCGR5)),
@@ -476,6 +481,13 @@ int ipu_probe(void)
g_pixel_clk[1] = _clk[1];
 
g_ipu_clk = _clk;
+#if defined(CONFIG_MX51)
+   g_ipu_clk->rate = IPUV3_CLK_MX51;
+#elif defined(CONFIG_MX53)
+   g_ipu_clk->rate = IPUV3_CLK_MX53;
+#else
+   g_ipu_clk->rate = is_mx6sdl() ? IPUV3_CLK_MX6DL : IPUV3_CLK_MX6Q;
+#endif
debug("ipu_clk = %u\n", clk_get_rate(g_ipu_clk));
g_ldb_clk = _clk;
debug("ldb_clk = %u\n", clk_get_rate(g_ldb_clk));
diff --git a/include/configs/advantech_dms-ba16.h 
b/include/configs/advantech_dms-ba16.h
index 6329bf6..6e380d0 100644
--- a/include/configs/advantech_dms-ba16.h
+++ b/include/configs/advantech_dms-ba16.h
@@ -260,7 +260,6 @@
 #define CONFIG_BMP_16BPP
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
-#define CONFIG_IPUV3_CLK26000
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
 #endif
diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h
index 16af141..f10ce6d 100644
--- a/include/configs/apalis_imx6.h
+++ b/include/configs/apalis_imx6.h
@@ -124,7 +124,6 @@
 #define CONFIG_BMP_16BPP
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
-#define CONFIG_IPUV3_CLK   26000
 #define CONFIG_CONSOLE_MUX
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
diff --git a/include/configs/aristainetos-common.h 
b/include/configs/aristainetos-common.h
index 1c28fcf..3afc7a6 100644
--- a/include/configs/aristainetos-common.h
+++ b/include/configs/aristainetos-common.h
@@ -217,7 +217,6 @@
 #define CONFIG_BMP_16BPP
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
-#define CONFIG_IPUV3_CLK 19800
 #define CONFIG_IMX_VIDEO_SKIP
 
 #define CONFIG_PWM_IMX
diff --git a/include/configs/cgtqmx6eval.h b/include/configs/cgtqmx6eval.h
index 4996a89..6a6c063 100644
--- a/include/configs/cgtqmx6eval.h
+++ b/include/configs/cgtqmx6eval.h
@@ -87,10 +87,6 @@
 #define CONFIG_BMP_16BPP
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
-#ifdef CONFIG_MX6DL
-#define CONFIG_IPUV3_CLK 19800
-#else
-#define CONFIG_IPUV3_CLK 26400
 #endif
 #define CONFIG_IMX_HDMI
 
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index 4f45be1..5d4b670 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -240,7 +240,6 @@
 
 /* Display */
 #define CONFIG_VIDEO_IPUV3
-#define CONFIG_IPUV3_CLK  26000
 #define CONFIG_IMX_HDMI
 
 #define 

Re: [U-Boot] [PATCH 0/5] vsprintf and short-wchar for EFI_LOADER

2017-09-06 Thread Tom Rini
On Wed, Sep 06, 2017 at 05:31:52PM +0200, Heinrich Schuchardt wrote:
> On 08/10/2017 01:14 AM, Rob Clark wrote:
> > As requested, I've split this out of the larger EFI_LOADER patchset.
> > 
> > This adds two things that the later EFI_LOADER patchset depends on:
> > 
> > 1) UUID/GUID support
> > 2) %ls UTF string support, in particular UTF-16.  In the UEFI API,
> >all strings are UTF-16
> > 
> > I had started converting this over to using c11 + u"string" literals,
> > instead of using -fshort-wchar + L"string" literals and %ls, but I
> > ran into two problems:
> > 
> > 1) we lose out on the printf (and friends) va_arg type checking if we
> >roll our own custom printf fmt modifier for UTF-16 strings
> > 2) and worse than that, we have to disable -Wformat warnings
> > 
> > So given that we have a significant downside for not just using
> > -fshort-wchar, and I don't think any really strong argument against,
> > I am back to thinking that we should just go with -fshort-wchar.
> > 
> > The current patchset has a Kconfig option to opt-in to -fshort-wchar,
> > which EFI_LOADER selects.  If the consensus is to enable -fshort-wchar
> > for everything, I'll drop the kconfig part and make it unconditional.
> > 
> > The current version of this patchset and efi-loader patchset are at
> > 
> >   https://github.com/robclark/u-boot.git  vsprintf
> > 
> > and
> > 
> >   https://github.com/robclark/u-boot.git enough-uefi-for-shim-2
> > 
> > I'll resend the enought-uefi-for-shim-2 patchset after I have a
> > chance to figure out fs-test.sh and add tests for fs_readdir().
> > 
> > Rob Clark (5):
> >   Kconfig: add option to build with -fshort-wchar
> >   lib: add some utf16 handling helpers
> >   vsprintf.c: add UTF-16 string (%ls) support
> >   vsprintf.c: add GUID printing
> >   examples: add fallback memcpy
> > 
> >  Kconfig  |  8 +
> >  Makefile |  4 +++
> >  examples/api/Makefile|  2 ++
> >  examples/api/glue.c  | 12 +++
> >  include/charset.h| 55 ++
> >  include/config_fallbacks.h   |  1 +
> >  lib/Makefile |  1 +
> >  lib/charset.c| 81 
> > 
> >  lib/efi_loader/Kconfig   |  1 +
> >  lib/efi_loader/efi_console.c | 17 ++
> >  lib/vsprintf.c   | 77 ++---
> >  11 files changed, 241 insertions(+), 18 deletions(-)
> >  create mode 100644 include/charset.h
> >  create mode 100644 lib/charset.c
> > 
> 
> Hello Tom,
> 
> what is happening with this patch series?
> 
> [U-Boot,5/5] examples: add fallback memcpy
> https://patchwork.ozlabs.org/patch/800030/
> [U-Boot,4/5] vsprintf.c: add GUID printing
> https://patchwork.ozlabs.org/patch/800029/
> [U-Boot,3/5] vsprintf.c: add UTF-16 string (%ls) support
> https://patchwork.ozlabs.org/patch/800027/
> [U-Boot,2/5] lib: add some utf16 handling helpers
> https://patchwork.ozlabs.org/patch/800028/
> [U-Boot,1/5] Kconfig: add option to build with -fshort-wchar
> https://patchwork.ozlabs.org/patch/800026/
> 
> Was it too late for 2017.09 and will be merged with 2017.11?

I replied to the first patch saying that we should always -fshort-wchar
and enforce stdc-2011 as the default.  That would be good to open
2017.11 with as well.  Thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 1/1] armv8: ls1012a: Memory Map modification of kernel, env

2017-09-06 Thread York Sun
On 09/01/2017 02:54 AM, Bhaskar Upadhaya wrote:
> This patch adjusts memory map for images on LS1012A
>  as per below memory map:
>  Image   Flash Offset
>  RCW+PBI 0x
>  Boot firmware (U-Boot)  0x0010

You are changing "kernel_addr" below.


> @@ -97,7 +97,7 @@
>   "kernel_addr=0x10\0"\
>   "fdt_high=0x\0" \
>   "initrd_high=0x\0"  \
> - "kernel_start=0xa0\0"   \
> + "kernel_start=0x100\0"  \
>   "kernel_load=0xa000\0"  \
>   "kernel_size=0x280\0"   \

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


Re: [U-Boot] [Patch v2] configs: SECURE_BOOT: Enable CONFIG_CMD_EXT4_WRITE

2017-09-06 Thread York Sun
On 08/25/2017 03:03 AM, Sumit Garg wrote:
> As part of chain of trust with confidentiality along with distro
> boot, linux kernel image needs to be stored in encrypted form on
> ext4 boot partition. So enable CONFIG_CMD_EXT4_WRITE in case of
> Secure boot.
> 
> Signed-off-by: Sumit Garg 
> ---
> 
> Changes in v2:
> Instead of adding CMD_EXT4_WRITE option in each defconfig, added this
> option in Kconfig.
> 
>   board/freescale/common/Kconfig | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/board/freescale/common/Kconfig b/board/freescale/common/Kconfig
> index 53b606e..3496eed 100644
> --- a/board/freescale/common/Kconfig
> +++ b/board/freescale/common/Kconfig
> @@ -6,6 +6,8 @@ config CHAIN_OF_TRUST
>   select SPL_BOARD_INIT if (ARM && SPL)
>   select SHA_HW_ACCEL
>   select SHA_PROG_HW_ACCEL
> + select CMD_EXT4
> + select CMD_EXT4_WRITE
>   bool
>   default y

Are you going to need this for all PowerPC platforms? This changes 
increases 3K in text section.

Will Ruchika confirm?

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


[U-Boot] [PATCH 1/1] vsprintf: vsprintf does not have parameter size

2017-09-06 Thread Heinrich Schuchardt
The inline documentation of vsprintf mentions a parameter size
which does not exist in the function declaration.

int vsprintf(char *buf, const char *fmt, va_list args);

Signed-off-by: Heinrich Schuchardt 
---
 include/vsprintf.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/vsprintf.h b/include/vsprintf.h
index e38076d22d..490c96ca6d 100644
--- a/include/vsprintf.h
+++ b/include/vsprintf.h
@@ -112,12 +112,10 @@ int sprintf(char *buf, const char *fmt, ...)
  * Format a string and place it in a buffer (va_list version)
  *
  * @param buf  The buffer to place the result into
- * @param size The size of the buffer, including the trailing null space
  * @param fmt  The format string to use
  * @param args Arguments for the format string
  * @return the number of characters which have been written into
- * the @buf not including the trailing '\0'. If @size is == 0 the function
- * returns 0.
+ * the @buf not including the trailing '\0'.
  *
  * If you're not already dealing with a va_list consider using scnprintf().
  *
-- 
2.11.0

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


Re: [U-Boot] [PATCH 1/1] efi_loader: move efi_guid_t typedef to efi.h

2017-09-06 Thread Heinrich Schuchardt
On 09/06/2017 05:22 PM, Alexander Graf wrote:
> 
> 
> On 06.09.17 16:49, Heinrich Schuchardt wrote:
>> efi_guid_t is used both in efi_api.h and in part_efi.h.
>> Both include efi.h. So we should move the typedef to
>> the common include. This saves us from including
>> part_efi.h in places where we don't need it.
>>
>> Signed-off-by: Heinrich Schuchardt 
> 
> Won't that break the case where GUID partition table support is enabled,
> but efi is not?
> 
> 
> Alex
>

I moved the definition of efi_guid_t from part_efi.h to efi.h.
The definition is placed in a part of efi.h that is not enclosed in any
#if*.
include/part_efi.h has this line:
#include 
So any program including part_efi.h will still see the definition.

Best regards

Heinrich

>> ---
>> download.suse.org seems to be down.
>> So I was no able to test on Travis CI.
>> I just built for vexpress and x86.
>> ---
>>   include/efi.h  | 3 +++
>>   include/part_efi.h | 4 
>>   2 files changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/include/efi.h b/include/efi.h
>> index 02b78b31b1..6cb7db1ea5 100644
>> --- a/include/efi.h
>> +++ b/include/efi.h
>> @@ -81,6 +81,9 @@ typedef unsigned long efi_status_t;
>>   typedef u64 efi_physical_addr_t;
>>   typedef u64 efi_virtual_addr_t;
>>   typedef void *efi_handle_t;
>> +typedef struct {
>> +u8 b[16];
>> +} efi_guid_t;
>> #define EFI_GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
>>   ((efi_guid_t) \
>> diff --git a/include/part_efi.h b/include/part_efi.h
>> index 317c044795..31e6bc6e14 100644
>> --- a/include/part_efi.h
>> +++ b/include/part_efi.h
>> @@ -58,10 +58,6 @@
>>   /* linux/include/efi.h */
>>   typedef u16 efi_char16_t;
>>   -typedef struct {
>> -u8 b[16];
>> -} efi_guid_t;
>> -
>>   /* based on linux/include/genhd.h */
>>   struct partition {
>>   u8 boot_ind;/* 0x80 - active */
>>
> 

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


Re: [U-Boot] FSL PCIe LTSSM >= PCI_LTSSM_L0 equals link up

2017-09-06 Thread York Sun
On 09/05/2017 04:08 AM, Joakim Tjernlund wrote:
> On Mon, 2017-08-28 at 17:14 +, York Sun wrote:
>> +Xiaowei
>>
>> On 08/28/2017 10:09 AM, Joakim Tjernlund wrote:
>>> On Mon, 2017-08-28 at 16:55 +, York Sun wrote:
 On 08/28/2017 09:48 AM, Joakim Tjernlund wrote:
> FSL PCIe controller drivers before REV 3 has this test for link up:
>  enabled = ltssm >= PCI_LTSSM_L0;
>
> We have a PCIe dev. that stays in LTSSM=0x51 (Polling Compliance) when 
> non ready
> for PCI transaktions. When FSL PCIe controller tries to access this 
> device, it
> hangs forever.
>
> Is LTSSM=0x51 really a "legal" state for link up?
> If not, what is a suitable range(maybe LO <= ltssm <= L0s(0x27)) ?
>
> Jocke
>
> BTW, the same test is valid in Linux too.
>

 Jocke,

 I am not an expert on PCIe. Please if this thread is helpful,
>>>
>>> Me neither .. :)

 https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatchwork.ozlabs.org%2Fpatch%2F801519%2F=01%7C01%7Cyork.sun%40nxp.com%7Cf46ff5111ba04e631a9b08d4ee377ecc%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0=n9%2B2NIjEvsMBCljRLHS6NVVN4ANa3nBGpwUjI4Od%2Bhs%3D=0.
>>>
>>> It mentions polling compliance but this driver already tests for:
>>> if (ltssm < LTSSM_PCIE_L0)
>>> return 0;
>>> return 1;
>>>
>>> It just adds some delay if the device is in Polling Compliance to see if 
>>> that
>>> changes to L0.
>>> Since both layerscape and fsl >= rev 3 already require ltssm to be == L0, I 
>>> suspect
>>> the ltssm >= L0 is bogus.
>>>
>>
>> Xiaowei, can you comment?
>>
>> York
> 
> Ping?
> Should I just send a patch ?
> 

+Mingkai

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


Re: [U-Boot] [PATCH 0/5] vsprintf and short-wchar for EFI_LOADER

2017-09-06 Thread Heinrich Schuchardt
On 08/10/2017 01:14 AM, Rob Clark wrote:
> As requested, I've split this out of the larger EFI_LOADER patchset.
> 
> This adds two things that the later EFI_LOADER patchset depends on:
> 
> 1) UUID/GUID support
> 2) %ls UTF string support, in particular UTF-16.  In the UEFI API,
>all strings are UTF-16
> 
> I had started converting this over to using c11 + u"string" literals,
> instead of using -fshort-wchar + L"string" literals and %ls, but I
> ran into two problems:
> 
> 1) we lose out on the printf (and friends) va_arg type checking if we
>roll our own custom printf fmt modifier for UTF-16 strings
> 2) and worse than that, we have to disable -Wformat warnings
> 
> So given that we have a significant downside for not just using
> -fshort-wchar, and I don't think any really strong argument against,
> I am back to thinking that we should just go with -fshort-wchar.
> 
> The current patchset has a Kconfig option to opt-in to -fshort-wchar,
> which EFI_LOADER selects.  If the consensus is to enable -fshort-wchar
> for everything, I'll drop the kconfig part and make it unconditional.
> 
> The current version of this patchset and efi-loader patchset are at
> 
>   https://github.com/robclark/u-boot.git  vsprintf
> 
> and
> 
>   https://github.com/robclark/u-boot.git enough-uefi-for-shim-2
> 
> I'll resend the enought-uefi-for-shim-2 patchset after I have a
> chance to figure out fs-test.sh and add tests for fs_readdir().
> 
> Rob Clark (5):
>   Kconfig: add option to build with -fshort-wchar
>   lib: add some utf16 handling helpers
>   vsprintf.c: add UTF-16 string (%ls) support
>   vsprintf.c: add GUID printing
>   examples: add fallback memcpy
> 
>  Kconfig  |  8 +
>  Makefile |  4 +++
>  examples/api/Makefile|  2 ++
>  examples/api/glue.c  | 12 +++
>  include/charset.h| 55 ++
>  include/config_fallbacks.h   |  1 +
>  lib/Makefile |  1 +
>  lib/charset.c| 81 
> 
>  lib/efi_loader/Kconfig   |  1 +
>  lib/efi_loader/efi_console.c | 17 ++
>  lib/vsprintf.c   | 77 ++---
>  11 files changed, 241 insertions(+), 18 deletions(-)
>  create mode 100644 include/charset.h
>  create mode 100644 lib/charset.c
> 

Hello Tom,

what is happening with this patch series?

[U-Boot,5/5] examples: add fallback memcpy
https://patchwork.ozlabs.org/patch/800030/
[U-Boot,4/5] vsprintf.c: add GUID printing
https://patchwork.ozlabs.org/patch/800029/
[U-Boot,3/5] vsprintf.c: add UTF-16 string (%ls) support
https://patchwork.ozlabs.org/patch/800027/
[U-Boot,2/5] lib: add some utf16 handling helpers
https://patchwork.ozlabs.org/patch/800028/
[U-Boot,1/5] Kconfig: add option to build with -fshort-wchar
https://patchwork.ozlabs.org/patch/800026/

Was it too late for 2017.09 and will be merged with 2017.11?

Best regards

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


Re: [U-Boot] [PATCH 1/1] efi_loader: move efi_guid_t typedef to efi.h

2017-09-06 Thread Alexander Graf



On 06.09.17 16:49, Heinrich Schuchardt wrote:

efi_guid_t is used both in efi_api.h and in part_efi.h.
Both include efi.h. So we should move the typedef to
the common include. This saves us from including
part_efi.h in places where we don't need it.

Signed-off-by: Heinrich Schuchardt 


Won't that break the case where GUID partition table support is enabled, 
but efi is not?



Alex


---
download.suse.org seems to be down.
So I was no able to test on Travis CI.
I just built for vexpress and x86.
---
  include/efi.h  | 3 +++
  include/part_efi.h | 4 
  2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/include/efi.h b/include/efi.h
index 02b78b31b1..6cb7db1ea5 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -81,6 +81,9 @@ typedef unsigned long efi_status_t;
  typedef u64 efi_physical_addr_t;
  typedef u64 efi_virtual_addr_t;
  typedef void *efi_handle_t;
+typedef struct {
+   u8 b[16];
+} efi_guid_t;
  
  #define EFI_GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \

((efi_guid_t) \
diff --git a/include/part_efi.h b/include/part_efi.h
index 317c044795..31e6bc6e14 100644
--- a/include/part_efi.h
+++ b/include/part_efi.h
@@ -58,10 +58,6 @@
  /* linux/include/efi.h */
  typedef u16 efi_char16_t;
  
-typedef struct {

-   u8 b[16];
-} efi_guid_t;
-
  /* based on linux/include/genhd.h */
  struct partition {
u8 boot_ind;/* 0x80 - active */


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


Re: [U-Boot] [PATCH] arm: am33xx: Make pin multiplexing functions optional

2017-09-06 Thread Felix Brack
On 01.09.2017 17:21, Tom Rini wrote:
> On Thu, Aug 31, 2017 at 03:16:17PM +0200, Felix Brack wrote:
> 
>> Boards using the single-register-pin-controller can  configure all
>> pins by means of the device tree. This renders the implementation of
>> the two functions set_uart_mux_conf and set_mux_conf_regs obsolete.
>> Using the weak attribute for these two function declarations allows
>> the omission of the respective definitions.
>>
>> Signed-off-by: Felix Brack 
>> ---
>>
>>  arch/arm/include/asm/arch-am33xx/sys_proto.h | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h 
>> b/arch/arm/include/asm/arch-am33xx/sys_proto.h
>> index 4e78aaf..e31c25c 100644
>> --- a/arch/arm/include/asm/arch-am33xx/sys_proto.h
>> +++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h
>> @@ -31,8 +31,8 @@ void enable_gpmc_cs_config(const u32 *gpmc_config, const 
>> struct gpmc_cs *cs, u32
>>  u32 size);
>>  int omap_nand_switch_ecc(uint32_t, uint32_t);
>>  
>> -void set_uart_mux_conf(void);
>> -void set_mux_conf_regs(void);
>> +__weak void set_uart_mux_conf(void);
>> +__weak void set_mux_conf_regs(void);
>>  void sdram_init(void);
>>  u32 wait_on_value(u32, u32, void *, u32);
>>  #ifdef CONFIG_NOR_BOOT
> 
> This seems wrong in a few ways.  First, this (and the matching ones for
> omap3, etc) should be full of externs instead and in that case __weak
> makes no sense.  Then, on the technical side, what you're describing
> isn't quite true in that you're likely relying on having the ROM to have
> setup the 'normal' UART still for you, as it so often does, I believe.
> Or in the case I'm wrong, then yes, you do get UART to work once we have
> parsed the DT, but the "usual" case is that we want UART and thus
> printf/etc to be available asap in case of errors, so it's still not a
> recommended way to go.  Thanks!
> 

Hi Tom,

Could you please explain what you mean by "... should be full of externs
instead and in that case __weak makes no sense"?
The pins of the UART I use are not configured by the ROM, it is the pin
controller driver configuring them.
You are of course right in that UART output is not available before the
pin controller driver has executed correctly. In my case the UART is
available in 'spl_board_init()'. I know that many things can go wrong
before this and therefore configuring UART pins in 'set_uart_mux_conf()'
while using 'CONFIG_DEBUG_UART' is fine. In this context the word
'obsolete' may be wrong. The idea behind the patch is to not force the
implementation of those two (potentially empty) functions.

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


[U-Boot] [PATCH 1/1] efi_loader: move efi_guid_t typedef to efi.h

2017-09-06 Thread Heinrich Schuchardt
efi_guid_t is used both in efi_api.h and in part_efi.h.
Both include efi.h. So we should move the typedef to
the common include. This saves us from including
part_efi.h in places where we don't need it.

Signed-off-by: Heinrich Schuchardt 
---
download.suse.org seems to be down.
So I was no able to test on Travis CI.
I just built for vexpress and x86.
---
 include/efi.h  | 3 +++
 include/part_efi.h | 4 
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/include/efi.h b/include/efi.h
index 02b78b31b1..6cb7db1ea5 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -81,6 +81,9 @@ typedef unsigned long efi_status_t;
 typedef u64 efi_physical_addr_t;
 typedef u64 efi_virtual_addr_t;
 typedef void *efi_handle_t;
+typedef struct {
+   u8 b[16];
+} efi_guid_t;
 
 #define EFI_GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
((efi_guid_t) \
diff --git a/include/part_efi.h b/include/part_efi.h
index 317c044795..31e6bc6e14 100644
--- a/include/part_efi.h
+++ b/include/part_efi.h
@@ -58,10 +58,6 @@
 /* linux/include/efi.h */
 typedef u16 efi_char16_t;
 
-typedef struct {
-   u8 b[16];
-} efi_guid_t;
-
 /* based on linux/include/genhd.h */
 struct partition {
u8 boot_ind;/* 0x80 - active */
-- 
2.11.0

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


Re: [U-Boot] [U-Boot,2/3] imx: mx6: correct IPU clock

2017-09-06 Thread Fabio Estevam
Hi Eric/Stefano,

On Tue, Sep 5, 2017 at 10:41 AM, Eric Nelson  wrote:

>
> I don't think it should be reverted until we have a run-time decision
> in place, or we'll re-introduce whatever problem the higher rate
> caused, at least on SABRE boards with Solo or Dual-Lite processors.

I have just sent  a RFC patch that introduces the IPU clock setting in
run-time on mx6.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 13/19] ARM: dts: rockchip: prefer u-boot, dm-pre-reloc rather than u-boot, dm-spl

2017-09-06 Thread Heiko Stübner
Hi Pawel,

Am Freitag, 11. August 2017, 22:57:29 CEST schrieb Paweł Jarosz:
> rk3xxx.dtsi is used by rk3188 and rk3066. rk3188 uses alocated data in spl
> but rk3066 needs it in tpl.
> 
> Signed-off-by: Paweł Jarosz 
> ---
> Changes since v1:
> - none
> 
>  arch/arm/dts/rk3xxx.dtsi | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/dts/rk3xxx.dtsi b/arch/arm/dts/rk3xxx.dtsi
> index 6d9e36d..d1c205b 100644
> --- a/arch/arm/dts/rk3xxx.dtsi
> +++ b/arch/arm/dts/rk3xxx.dtsi
> @@ -135,7 +135,7 @@
>   };
> 
>   noc: syscon@10128000 {
> - u-boot,dm-spl;
> + u-boot,dm-pre-reloc;

That probably won't work on rk3188. I haven't looked to closely
on the rk3188 support for a while, but there we used the TPL for
the single jump back to the bootloader after reading the 1KB
of initial code.

So with the code as is, this would make the rk3188 TPL most likely to big.

As both the rk3066 and rk3188 are very similar, I'd guess the best
option would be to just adapt the rk3188 to you newer rk3066
approach, so that they don't diverge to much. Especially as the
rk3188 has the same nand controller and people may want to
boot of on-chip nand on the rk3188 in the future as well.


Heiko

>   compatible = "rockchip,rk3188-noc", "syscon";
>   reg = <0x10128000 0x2000>;
>   };
> @@ -218,13 +218,13 @@
>   pmu: pmu@20004000 {
>   compatible = "rockchip,rk3066-pmu", "syscon";
>   reg = <0x20004000 0x100>;
> - u-boot,dm-spl;
> + u-boot,dm-pre-reloc;
>   };
> 
>   grf: grf@20008000 {
>   compatible = "syscon";
>   reg = <0x20008000 0x200>;
> - u-boot,dm-spl;
> + u-boot,dm-pre-reloc;
>   };
> 
>   dmc: dmc@2002 {
> @@ -238,7 +238,7 @@
>  0x2004 0x294>;
>   clocks = < PCLK_DDRUPCTL>, < PCLK_PUBL>;
>   clock-names = "pclk_ddrupctl", "pclk_publ";
> - u-boot,dm-spl;
> + u-boot,dm-pre-reloc;
>   };
> 
>   i2c0: i2c@2002d000 {


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


[U-Boot] [RFC] ipu_common: Let the MX6 IPU clock be calculated in run-time

2017-09-06 Thread Fabio Estevam
From: Fabio Estevam 

MX6Q/QP IPU operates at 264MHz and MX6DL IPU at 198MHz.

When running a SPL target, which supports multiple MX6 variants we cannot
properly setup the IPU clock frequency via CONFIG_IPUV3_CLK option as
such decision is done in build-time currently.

Remove the CONFIG_IPUV3_CLK option and let the IPU clock frequency be
detected in run-time on mx6.

Reported-by: Eric Nelson 
Signed-off-by: Fabio Estevam 
---
 drivers/video/ipu_common.c| 17 -
 include/configs/advantech_dms-ba16.h  |  1 -
 include/configs/apalis_imx6.h |  1 -
 include/configs/aristainetos-common.h |  1 -
 include/configs/cgtqmx6eval.h |  4 
 include/configs/cm_fx6.h  |  1 -
 include/configs/colibri_imx6.h|  1 -
 include/configs/embestmx6boards.h |  1 -
 include/configs/ge_bx50v3.h   |  1 -
 include/configs/gw_ventana.h  |  1 -
 include/configs/imx6-engicam.h|  1 -
 include/configs/m53evk.h  |  1 -
 include/configs/mx51evk.h |  1 -
 include/configs/mx53cx9020.h  |  1 -
 include/configs/mx53loco.h|  1 -
 include/configs/mx6cuboxi.h   |  1 -
 include/configs/mx6sabre_common.h |  5 -
 include/configs/nitrogen6x.h  |  1 -
 include/configs/novena.h  |  1 -
 include/configs/tbs2910.h |  1 -
 include/configs/wandboard.h   |  1 -
 scripts/config_whitelist.txt  |  1 -
 22 files changed, 16 insertions(+), 29 deletions(-)

diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c
index f8d4488..9fce4dd 100644
--- a/drivers/video/ipu_common.c
+++ b/drivers/video/ipu_common.c
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "ipu.h"
 #include "ipu_regs.h"
@@ -81,6 +82,11 @@ struct ipu_ch_param {
 
 #define IPU_SW_RST_TOUT_USEC   (1)
 
+#define IPUV3_CLK_MX51 13300
+#define IPUV3_CLK_MX53 2
+#define IPUV3_CLK_MX6Q 26400
+#define IPUV3_CLK_MX6DL19800
+
 void clk_enable(struct clk *clk)
 {
if (clk) {
@@ -196,7 +202,6 @@ static void clk_ipu_disable(struct clk *clk)
 
 static struct clk ipu_clk = {
.name = "ipu_clk",
-   .rate = CONFIG_IPUV3_CLK,
 #if defined(CONFIG_MX51) || defined(CONFIG_MX53)
.enable_reg = (u32 *)(CCM_BASE_ADDR +
offsetof(struct mxc_ccm_reg, CCGR5)),
@@ -476,6 +481,16 @@ int ipu_probe(void)
g_pixel_clk[1] = _clk[1];
 
g_ipu_clk = _clk;
+#if defined(CONFIG_MX51)
+   g_ipu_clk->rate = IPUV3_CLK_MX51;
+#elif defined(CONFIG_MX53)
+   g_ipu_clk->rate = IPUV3_CLK_MX53;
+#else
+   if (is_mx6dqp() || is_mx6dq())
+   g_ipu_clk->rate = IPUV3_CLK_MX6Q;
+   else if (is_mx6dl())
+   g_ipu_clk->rate = IPUV3_CLK_MX6DL;
+#endif
debug("ipu_clk = %u\n", clk_get_rate(g_ipu_clk));
g_ldb_clk = _clk;
debug("ldb_clk = %u\n", clk_get_rate(g_ldb_clk));
diff --git a/include/configs/advantech_dms-ba16.h 
b/include/configs/advantech_dms-ba16.h
index 6329bf6..6e380d0 100644
--- a/include/configs/advantech_dms-ba16.h
+++ b/include/configs/advantech_dms-ba16.h
@@ -260,7 +260,6 @@
 #define CONFIG_BMP_16BPP
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
-#define CONFIG_IPUV3_CLK26000
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
 #endif
diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h
index 16af141..f10ce6d 100644
--- a/include/configs/apalis_imx6.h
+++ b/include/configs/apalis_imx6.h
@@ -124,7 +124,6 @@
 #define CONFIG_BMP_16BPP
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
-#define CONFIG_IPUV3_CLK   26000
 #define CONFIG_CONSOLE_MUX
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
diff --git a/include/configs/aristainetos-common.h 
b/include/configs/aristainetos-common.h
index 1c28fcf..3afc7a6 100644
--- a/include/configs/aristainetos-common.h
+++ b/include/configs/aristainetos-common.h
@@ -217,7 +217,6 @@
 #define CONFIG_BMP_16BPP
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
-#define CONFIG_IPUV3_CLK 19800
 #define CONFIG_IMX_VIDEO_SKIP
 
 #define CONFIG_PWM_IMX
diff --git a/include/configs/cgtqmx6eval.h b/include/configs/cgtqmx6eval.h
index 4996a89..6a6c063 100644
--- a/include/configs/cgtqmx6eval.h
+++ b/include/configs/cgtqmx6eval.h
@@ -87,10 +87,6 @@
 #define CONFIG_BMP_16BPP
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
-#ifdef CONFIG_MX6DL
-#define CONFIG_IPUV3_CLK 19800
-#else
-#define CONFIG_IPUV3_CLK 26400
 #endif
 #define CONFIG_IMX_HDMI
 
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index 4f45be1..5d4b670 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -240,7 +240,6 @@
 
 /* Display */
 #define CONFIG_VIDEO_IPUV3
-#define CONFIG_IPUV3_CLK  26000
 #define 

Re: [U-Boot] [PATCH] Revert "dm: arm: rpi: Drop CONFIG_OF_EMBED"

2017-09-06 Thread Simon Glass
+Tom

On 6 September 2017 at 01:35, Paul Barker  wrote:
> This reverts commit 25877d4e4c45451c5398aec3de50e0d5befe0e9f.
>
> This is a workaround for Raspberry Pi boot failures seen when passing on
> the device tree provided by the Raspberry Pi firmware at boot. Without
> CONFIG_OF_EMBED, we just get stuck at "Starting kernel ..." when we try
> to boot Linux with this device tree.
>
> Signed-off-by: Paul Barker 
> Cc: Simon Glass 
> ---
>  configs/rpi_2_defconfig | 1 +
>  configs/rpi_3_32b_defconfig | 1 +
>  configs/rpi_3_defconfig | 1 +
>  configs/rpi_defconfig   | 1 +
>  4 files changed, 4 insertions(+)

We should apply this fix for the release in the meantime while we wait
for a root cause.

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


Re: [U-Boot] [PATCH] Revert "dm: arm: rpi: Drop CONFIG_OF_EMBED"

2017-09-06 Thread Jonathan Gray
On Wed, Sep 06, 2017 at 08:35:19AM +0100, Paul Barker wrote:
> This reverts commit 25877d4e4c45451c5398aec3de50e0d5befe0e9f.
> 
> This is a workaround for Raspberry Pi boot failures seen when passing on
> the device tree provided by the Raspberry Pi firmware at boot. Without
> CONFIG_OF_EMBED, we just get stuck at "Starting kernel ..." when we try
> to boot Linux with this device tree.
> 
> Signed-off-by: Paul Barker 
> Cc: Simon Glass 

Same problem booting OpenBSD since 2017.07.  We've been building U-Boot
with CONFIG_OF_EMBED=y on rpi* since Mark Kettenis tracked it down
to that commit.

Tested-by: Jonathan Gray 

> ---
>  configs/rpi_2_defconfig | 1 +
>  configs/rpi_3_32b_defconfig | 1 +
>  configs/rpi_3_defconfig | 1 +
>  configs/rpi_defconfig   | 1 +
>  4 files changed, 4 insertions(+)
> 
> diff --git a/configs/rpi_2_defconfig b/configs/rpi_2_defconfig
> index 10e83186c1..848aeb73aa 100644
> --- a/configs/rpi_2_defconfig
> +++ b/configs/rpi_2_defconfig
> @@ -16,6 +16,7 @@ CONFIG_CMD_USB=y
>  CONFIG_ENV_FAT_INTERFACE="mmc"
>  CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
>  CONFIG_DM_KEYBOARD=y
> +CONFIG_OF_EMBED=y
>  CONFIG_DM_MMC=y
>  CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_BCM2835=y
> diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig
> index d35a639630..196b619bb7 100644
> --- a/configs/rpi_3_32b_defconfig
> +++ b/configs/rpi_3_32b_defconfig
> @@ -17,6 +17,7 @@ CONFIG_CMD_USB=y
>  CONFIG_ENV_FAT_INTERFACE="mmc"
>  CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
>  CONFIG_DM_KEYBOARD=y
> +CONFIG_OF_EMBED=y
>  CONFIG_DM_MMC=y
>  CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_BCM2835=y
> diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig
> index 095a076249..f23c1e7b18 100644
> --- a/configs/rpi_3_defconfig
> +++ b/configs/rpi_3_defconfig
> @@ -17,6 +17,7 @@ CONFIG_CMD_USB=y
>  CONFIG_ENV_FAT_INTERFACE="mmc"
>  CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
>  CONFIG_DM_KEYBOARD=y
> +CONFIG_OF_EMBED=y
>  CONFIG_DM_MMC=y
>  CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_BCM2835=y
> diff --git a/configs/rpi_defconfig b/configs/rpi_defconfig
> index 9dfdad5c1d..939870637a 100644
> --- a/configs/rpi_defconfig
> +++ b/configs/rpi_defconfig
> @@ -16,6 +16,7 @@ CONFIG_CMD_USB=y
>  CONFIG_ENV_FAT_INTERFACE="mmc"
>  CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
>  CONFIG_DM_KEYBOARD=y
> +CONFIG_OF_EMBED=y
>  CONFIG_DM_MMC=y
>  CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_BCM2835=y
> -- 
> 2.11.0
> 
> ___
> 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] setup of PEX_GCLK_RATIO in E500 CPUs(P2010) missing ?

2017-09-06 Thread Joakim Tjernlund
On Wed, 2017-09-06 at 09:36 +, Mingkai Hu wrote:
> > -Original Message-
> > From: Joakim Tjernlund [mailto:joakim.tjernl...@infinera.com]
> > Sent: Tuesday, September 05, 2017 8:45 PM
> > To: Mingkai Hu ; Roy Zang ;
> > York Sun 
> > Cc: u-boot@lists.denx.de
> > Subject: Re: setup of PEX_GCLK_RATIO in E500 CPUs(P2010) missing ?
> > 
> > On Wed, 2017-08-30 at 15:25 +, York Sun wrote:
> > > On 08/30/2017 06:05 AM, Joakim Tjernlund wrote:
> > > > On Tue, 2017-08-29 at 17:33 +, York Sun wrote:
> > > > > +Roy Zang to comment on PCIe clock source
> > > > > 
> > > > > On 08/29/2017 10:06 AM, Joakim Tjernlund wrote:
> > > > > > On Tue, 2017-08-29 at 15:43 +, York Sun wrote:
> > > > > > > On 08/29/2017 06:21 AM, Joakim Tjernlund wrote:
> > > > > > > > On Tue, 2017-08-29 at 12:47 +0200, Joakim Tjernlund wrote:
> > > > > > > > > As we are looking at PCI stuff ATM I would like to ask
> > > > > > > > > about PEX_GCLK_RATIO in E500 CPUs. I cannot find this is
> > > > > > > > > setup at all for E500 but I THINK this is required.
> > > > > > > > > 
> > > > > > > > > In 83xx one do:
> > > > > > > > > get_clocks();
> > > > > > > > > /* Configure the PCIE controller core clock ratio */
> > > > > > > > > out_le32(hose_cfg_base + PEX_GCLK_RATIO,
> > > > > > > > 
> > > > > > > > A bit strange with out_le32 instead of out_be32 ?
> > > > > > > > 
> > > > > > > > > (((bus ? gd->arch.pciexp2_clk : gd->arch.pciexp1_clk) /
> > > > > > > > > 100) * 16) / 333); udelay(100);
> > > > > > > > > 
> > > > > > > > > Any clues?
> > > > > > > > > 
> > > > > > > > > Jocke
> > > > > > > > 
> > > > > > > > Seems like only 83xx is setting this parameter.
> > > > > > > > 
> > > > > > > > Anyhow, I put together this patch:
> > > > > > > > 
> > > > > > > > --- a/drivers/pci/fsl_pci_init.c
> > > > > > > > +++ b/drivers/pci/fsl_pci_init.c
> > > > > > > > @@ -322,6 +322,10 @@ void fsl_pci_init(struct pci_controller
> > > > > > > > *hose, struct fsl_pci_info *pci_info)
> > > > > > > > 
> > > > > > > >pci_setup_indirect(hose, cfg_addr, cfg_data);
> > > > > > > > 
> > > > > > > > +   /* Configure the PCIE controller core clock ratio */
> > > > > > > > +   pci_hose_write_config_dword(hose, dev, 0x440, (gd-
> > > 
> > > bus_clk / 3) * 16);
> > > > > > > > +   /* udelay(100) needed here ?*/
> > > > > > > > +
> > > > > > > >block_rev = in_be32(>block_rev1);
> > > > > > > >if (PEX_IP_BLK_REV_2_2 <= block_rev) {
> > > > > > > >pi = >pit[2];  /* 0xDC0 */
> > > > > > > > 
> > > > > > > > Any chance this will work for all supported FSL PCIe 
> > > > > > > > controllers?
> > > > > > > > 
> > > > > > > 
> > > > > > > Jocke,
> > > > > > > 
> > > > > > > You don't need to program this register if the actual PCIe
> > > > > > > clock is the same as default. Since SerDes reference clock has
> > > > > > > to be 100MHz for PCIe protocol, my guess is the PCIe clock is
> > > > > > > always correct. The bus_clk you are referring is not the PCIe
> > > > > > > clock. Again, I am not a PCIe expert, I could be wrong. Since
> > > > > > > PCIe (SerDes) has been working on multiple platforms, I guess the
> > 
> > clock is correct.
> > > > > > 
> > > > > > I don't think so. Here is what T1042 says about this:
> > > > > > 
> > > > > > The PCI Express controller clock frequency is one-half the platform
> > 
> > clock frequency.
> > > > > > 
> > > > > > The PCI Express controller core clock ratio register is used to
> > > > > > program the ratio of the actual PCI Express controller clock
> > > > > > frequency to the default controller core frequency ( 333 MHz ).
> > > > > > This is required only when a PCI Express controller clock frequency
> > 
> > other than the default 333 MHz has to be used.
> > > > > > As an example of programming PEX_GCLK_RATIO, consider the case
> > > > > > where the actual PCI Express controller clock is 250 MHz, the
> > > > > > ratio of the actual clock to the default clock ( 333 MHz) is
> > > > > > 3:4. that is, the default core clock has to be multiplied by the
> > > > > > ratio (3/4, which is equivalent to 12/16). So the register has to be
> > 
> > programmed with the decimal numerator value 12 or 0x_000C.
> > > > > > 
> > > > > > Our CCB is 250 MHz so this should be set to 0xc.
> > > > > > 
> > > > > > I found this on Google too:
> > > > > > The PEX controller hardware requires for timing tuning in order
> > > > > > to operate properly at given CCB/2 clock frequency.
> > > > > > PEX_GCLK_RATIO register controls this tuning with 333MHz/16
> > > > > > granularities. So for given CCB frequency Fccb [MHz] we must write 
> > > > > > to
> > 
> > PEX_GCLK_RATIO nearest integer of ((Fccb/2)/(333/16)). So for Fccb=375 we
> > have to write 18.
> > > > > 
> > > > > Jocke,
> > > > > 
> > > > > Basically I agree with you, if the clock is different from
> > > > > default, you need to set the 

Re: [U-Boot] [PATCH 00/23] efi_loader implement missing functions

2017-09-06 Thread Rob Clark
On Wed, Sep 6, 2017 at 12:18 AM, Heinrich Schuchardt  wrote:
> On 09/06/2017 01:48 AM, Rob Clark wrote:
>> On Tue, Sep 5, 2017 at 4:55 AM, Simon Glass  wrote:
>>> Hi,
>>>
>>> On 1 September 2017 at 22:45, Tom Rini  wrote:
 On Wed, Aug 30, 2017 at 04:16:34AM +0800, Simon Glass wrote:
> Hi,
>
> On 29 August 2017 at 22:16, Rob Clark  wrote:
>> On Tue, Aug 29, 2017 at 8:57 AM, Leif Lindholm 
>>  wrote:
>>> On Tue, Aug 29, 2017 at 02:26:48PM +0200, Alexander Graf wrote:
>>> I would add command
>>> bootefi selftest.efi
>>> to run the tests and provide the python wrapper code to add it to 
>>> the
>>> test suite.
>>
>> I think that's a great idea, yes.
> I wonder how far we are from running UEFI tests (either the official
> ones, or I seem to remember hearing about some other test suite which
> didn't require UEFI shell)?

 Let's ask Leif, Ard and Dong.

 The official test suite definitely needs the UEFI Shell. Is the suite
 publicly available by now?
>>>
>>> In binary form, you can access it already from the links on
>>> http://uefi.org/testtools
>>>
>>> Yes, 2.5 is latest release. No this is not a restriction ... the SCT
>>> releases have been lagging the specification releases a fair bit.
>>>
>>> The 2.5a package contains AARCH64, IA32 and X64 support (not ARM).
>>> Not that it couldn't contain ARM, it just hasn't been packaged.
>>>
> That seems more useful long term than re-inventing comprehensive UEFI
> test suite.  (Also, beyond just running shim/fallback/grub, I don't
> really have time to invent new tests for the stack of efi_loader
> patches I have.)

 Yes and no - it depends on the availability of the official suite :/.
>>>
>>> UEFI SCT is not yet open source/free software. Obviously, this is
>>> something Linaro has been lobbying for since day one of our
>>> involvement. There used to be little understanding for this, but that
>>> attitude has shifted substantially.
>>
>> So, if/until UEFI SCT is not an option, what about:
>>
>>   https://01.org/linux-uefi-validation
>>
>> (thx to pjones for pointing that out to me)
>
> Well in any case I'm not looking for a large functional test suite at
> this stage. It certainly could be useful, but not as a replacement for
> unit tests. The latter is for fast verification (so that everyone can
> run it as part of 'make tests') and easy identification of the
> location of bugs.

 I want to chime in here.  Unless we're talking hours of time, if "make
 tests" takes 5 minutes to run, but that includes doing some sort of full
 validation suite to the relevant EFI code, that seems like a win to me.
 And if someone else is responsible for the contents of the tests and we
 just have to confirm our expected results, that's an even bigger win.
>>>
>>> Yes it certainly is a win. But I'm already upset with how long the
>>> tests take to run so I would not be keen on anything that increases it
>>> much. How long does this test suite take to run normally?
>>>
>>
>> I'm not sure how long SCT would take to run until we get it working (I
>> have a growing stack of patches on my wip-enough-uefi-for-shell
>> branch, and have Shell.efi running but still debugging sct.efi)..
>> maybe someone who has run SCT on a real UEFI implementation knows..
>> But that said, there seems to be some potential to run a subset of the
>> tests.  Either way, it seems like most of the time that travis runs
>> take is building a million variants of u-boot.  I'm not sure the time
>> spent running tests is really the issue.
>>
>> BR,
>> -R
>>
> You could reduce the number of variants in .travis.yml by deleting
> entries from env:.

yeah, this is something I've done before to try to debug issues that
only show up in travis and that I could not reproduce locally

> With EFI the once that showed up my errors were:
>
> qemu-x86
> vexpress_ca15_tc2
> vexpress_ca9x4

imho, we need something aarch64 and using DM in the mix.. and so far
I've only seem the same issues on both vexpress platforms, so I'm not
sure how useful it is to test both (at least for a quick test run)

BR,
-R

> So maybe for a quick test (10 min) of your patches you can reduce to
> these and do a full test before submitting.
>
> Regards
>
> Heinrich
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] Starting u-boot in USB otg mode

2017-09-06 Thread rivael_il

Hello u-booters!

I want to load u-boot-sunxi-with-spl.bin and make it operate the USB in otg 
mode.
(Where the host can still be connected to the board).

How can I achieve this?

(I have attempted to use: "usb0:dr_mode=otg,phy_type=utmi\0" without success).

Thank you,

Michael

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


Re: [U-Boot] [PATCH v2 1/5] rockchip: rk322x: update dram bank size

2017-09-06 Thread Dr. Philipp Tomsich
Kever,

I don’t have a problem with the below patch, but the entire series is held
up by patch #2 (adding the SDRAM driver):
https://patchwork.ozlabs.org/patch/802385/

I generally don’t attempt to apply parts of a series (and always apply the
entire series), as this just increases the risk of things getting out of sync
and I often don’t have a way to test whether things will still work with just
a part of a series applied.

Regarding patch #2 of this series:
My concern is with the duplication of code between individual SDRAM drivers
and I want to make sure that we reduce the amount of clutter (i.e. do a bit of
clean-up and de-duplication every time we touch code in this area) as we add
new drivers instead of increasing the code-duplication every time.

Regards,
Philipp.

> On 6 Sep 2017, at 11:39, Kever Yang  wrote:
> 
> Hi Philipp,
> 
>This patch is a bug fix for rk3229 ram size, and not relate to the dram 
> driver,
> 
> could you share why you still not take this patch?
> 
> 
> Thanks,
> - Kever
> On 08/17/2017 03:17 PM, Kever Yang wrote:
>> The DRAM start address is not 0, so need to update the last bank size
>> as:
>> DRAM start addr + DRAM_SIZE - last bank start addr
>> 
>> Signed-off-by: Kever Yang 
>> Acked-by: Philipp Tomsich 
>> Reviewed-by: Philipp Tomsich 
>> Reviewed-by: Simon Glass 
>> ---
>> 
>> Changes in v2: None
>> 
>>  arch/arm/mach-rockchip/rk322x-board.c | 10 ++
>>  1 file changed, 6 insertions(+), 4 deletions(-)
>> 
>> diff --git a/arch/arm/mach-rockchip/rk322x-board.c 
>> b/arch/arm/mach-rockchip/rk322x-board.c
>> index b6543a5..f93bd33 100644
>> --- a/arch/arm/mach-rockchip/rk322x-board.c
>> +++ b/arch/arm/mach-rockchip/rk322x-board.c
>> @@ -72,11 +72,13 @@ int board_init(void)
>>int dram_init_banksize(void)
>>  {
>> -/* Reserve 0x20 for OPTEE */
>> -gd->bd->bi_dram[0].start = 0x6000;
>> +gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
>>  gd->bd->bi_dram[0].size = 0x840;
>> -gd->bd->bi_dram[1].start = 0x6a40;
>> -gd->bd->bi_dram[1].size = gd->ram_size - gd->bd->bi_dram[1].start;
>> +/* Reserve 14M for OPTEE and TA */
>> +gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE
>> ++ gd->bd->bi_dram[0].size + 0xe0;
>> +gd->bd->bi_dram[1].size = gd->bd->bi_dram[0].start
>> ++ gd->ram_size - gd->bd->bi_dram[1].start;
>>  return 0;
>>  }
> 
> 

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


[U-Boot] [PATCH 4/4] rockchip: rk3328: move sdram driver to driver/ram

2017-09-06 Thread Kever Yang
Since we have CONFIG_RAM framwork and its driver folder, move the driver
into it.

Signed-off-by: Kever Yang 
---

 arch/arm/mach-rockchip/rk3328/Makefile | 1 -
 drivers/ram/rockchip/Makefile  | 1 +
 {arch/arm/mach-rockchip/rk3328 => drivers/ram/rockchip}/sdram_rk3328.c | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename {arch/arm/mach-rockchip/rk3328 => drivers/ram/rockchip}/sdram_rk3328.c 
(100%)

diff --git a/arch/arm/mach-rockchip/rk3328/Makefile 
b/arch/arm/mach-rockchip/rk3328/Makefile
index 72873e2..bbab036 100644
--- a/arch/arm/mach-rockchip/rk3328/Makefile
+++ b/arch/arm/mach-rockchip/rk3328/Makefile
@@ -6,5 +6,4 @@
 
 obj-y += clk_rk3328.o
 obj-y += rk3328.o
-obj-y += sdram_rk3328.o
 obj-y += syscon_rk3328.o
diff --git a/drivers/ram/rockchip/Makefile b/drivers/ram/rockchip/Makefile
index bc76a20..45b5fe7 100644
--- a/drivers/ram/rockchip/Makefile
+++ b/drivers/ram/rockchip/Makefile
@@ -8,4 +8,5 @@ obj-$(CONFIG_ROCKCHIP_RK3368) = dmc-rk3368.o
 obj-$(CONFIG_ROCKCHIP_RK3188) = sdram_rk3188.o
 obj-$(CONFIG_ROCKCHIP_RK322X) = sdram_rk322x.o
 obj-$(CONFIG_ROCKCHIP_RK3288) = sdram_rk3288.o
+obj-$(CONFIG_ROCKCHIP_RK3328) = sdram_rk3328.o
 obj-$(CONFIG_ROCKCHIP_RK3399) = sdram_rk3399.o
diff --git a/arch/arm/mach-rockchip/rk3328/sdram_rk3328.c 
b/drivers/ram/rockchip/sdram_rk3328.c
similarity index 100%
rename from arch/arm/mach-rockchip/rk3328/sdram_rk3328.c
rename to drivers/ram/rockchip/sdram_rk3328.c
-- 
1.9.1

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


[U-Boot] [PATCH 2/4] rockchip: rk3188: move sdram driver to driver/ram

2017-09-06 Thread Kever Yang
Since we have CONFIG_RAM framwork and its driver folder, move the driver
into it.

Signed-off-by: Kever Yang 
---

 arch/arm/mach-rockchip/rk3188/Makefile | 1 -
 drivers/ram/rockchip/Makefile  | 1 +
 {arch/arm/mach-rockchip/rk3188 => drivers/ram/rockchip}/sdram_rk3188.c | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename {arch/arm/mach-rockchip/rk3188 => drivers/ram/rockchip}/sdram_rk3188.c 
(100%)

diff --git a/arch/arm/mach-rockchip/rk3188/Makefile 
b/arch/arm/mach-rockchip/rk3188/Makefile
index 2dc9511..7fa0104 100644
--- a/arch/arm/mach-rockchip/rk3188/Makefile
+++ b/arch/arm/mach-rockchip/rk3188/Makefile
@@ -6,6 +6,5 @@
 
 ifndef CONFIG_TPL_BUILD
 obj-y += clk_rk3188.o
-obj-y += sdram_rk3188.o
 obj-y += syscon_rk3188.o
 endif
diff --git a/drivers/ram/rockchip/Makefile b/drivers/ram/rockchip/Makefile
index 52cc809..3553849 100644
--- a/drivers/ram/rockchip/Makefile
+++ b/drivers/ram/rockchip/Makefile
@@ -5,5 +5,6 @@
 #
 
 obj-$(CONFIG_ROCKCHIP_RK3368) = dmc-rk3368.o
+obj-$(CONFIG_ROCKCHIP_RK3188) = sdram_rk3188.o
 obj-$(CONFIG_ROCKCHIP_RK322X) = sdram_rk322x.o
 obj-$(CONFIG_ROCKCHIP_RK3399) = sdram_rk3399.o
diff --git a/arch/arm/mach-rockchip/rk3188/sdram_rk3188.c 
b/drivers/ram/rockchip/sdram_rk3188.c
similarity index 100%
rename from arch/arm/mach-rockchip/rk3188/sdram_rk3188.c
rename to drivers/ram/rockchip/sdram_rk3188.c
-- 
1.9.1

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


[U-Boot] [PATCH 3/4] rockchip: rk3288: move sdram driver to driver/ram

2017-09-06 Thread Kever Yang
Since we have CONFIG_RAM framwork and its driver folder, move the driver
into it.

Signed-off-by: Kever Yang 
---

 arch/arm/mach-rockchip/rk3288/Makefile | 1 -
 drivers/ram/rockchip/Makefile  | 1 +
 {arch/arm/mach-rockchip/rk3288 => drivers/ram/rockchip}/sdram_rk3288.c | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename {arch/arm/mach-rockchip/rk3288 => drivers/ram/rockchip}/sdram_rk3288.c 
(100%)

diff --git a/arch/arm/mach-rockchip/rk3288/Makefile 
b/arch/arm/mach-rockchip/rk3288/Makefile
index b5b28ef..a0033a0 100644
--- a/arch/arm/mach-rockchip/rk3288/Makefile
+++ b/arch/arm/mach-rockchip/rk3288/Makefile
@@ -6,5 +6,4 @@
 
 obj-y += clk_rk3288.o
 obj-y += rk3288.o
-obj-y += sdram_rk3288.o
 obj-y += syscon_rk3288.o
diff --git a/drivers/ram/rockchip/Makefile b/drivers/ram/rockchip/Makefile
index 3553849..bc76a20 100644
--- a/drivers/ram/rockchip/Makefile
+++ b/drivers/ram/rockchip/Makefile
@@ -7,4 +7,5 @@
 obj-$(CONFIG_ROCKCHIP_RK3368) = dmc-rk3368.o
 obj-$(CONFIG_ROCKCHIP_RK3188) = sdram_rk3188.o
 obj-$(CONFIG_ROCKCHIP_RK322X) = sdram_rk322x.o
+obj-$(CONFIG_ROCKCHIP_RK3288) = sdram_rk3288.o
 obj-$(CONFIG_ROCKCHIP_RK3399) = sdram_rk3399.o
diff --git a/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c 
b/drivers/ram/rockchip/sdram_rk3288.c
similarity index 100%
rename from arch/arm/mach-rockchip/rk3288/sdram_rk3288.c
rename to drivers/ram/rockchip/sdram_rk3288.c
-- 
1.9.1

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


[U-Boot] [PATCH 1/4] rockchip: rk3399: move sdram driver to driver/ram

2017-09-06 Thread Kever Yang
Since we have CONFIG_RAM framwork and its driver folder, move the driver
into it.

Signed-off-by: Kever Yang 
---

 arch/arm/mach-rockchip/rk3399/Makefile | 1 -
 drivers/ram/rockchip/Makefile  | 1 +
 {arch/arm/mach-rockchip/rk3399 => drivers/ram/rockchip}/sdram_rk3399.c | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename {arch/arm/mach-rockchip/rk3399 => drivers/ram/rockchip}/sdram_rk3399.c 
(100%)

diff --git a/arch/arm/mach-rockchip/rk3399/Makefile 
b/arch/arm/mach-rockchip/rk3399/Makefile
index 793ce31..98ebeac 100644
--- a/arch/arm/mach-rockchip/rk3399/Makefile
+++ b/arch/arm/mach-rockchip/rk3399/Makefile
@@ -6,5 +6,4 @@
 
 obj-y += clk_rk3399.o
 obj-y += rk3399.o
-obj-y += sdram_rk3399.o
 obj-y += syscon_rk3399.o
diff --git a/drivers/ram/rockchip/Makefile b/drivers/ram/rockchip/Makefile
index 06ab2fd..52cc809 100644
--- a/drivers/ram/rockchip/Makefile
+++ b/drivers/ram/rockchip/Makefile
@@ -6,3 +6,4 @@
 
 obj-$(CONFIG_ROCKCHIP_RK3368) = dmc-rk3368.o
 obj-$(CONFIG_ROCKCHIP_RK322X) = sdram_rk322x.o
+obj-$(CONFIG_ROCKCHIP_RK3399) = sdram_rk3399.o
diff --git a/arch/arm/mach-rockchip/rk3399/sdram_rk3399.c 
b/drivers/ram/rockchip/sdram_rk3399.c
similarity index 100%
rename from arch/arm/mach-rockchip/rk3399/sdram_rk3399.c
rename to drivers/ram/rockchip/sdram_rk3399.c
-- 
1.9.1

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


[U-Boot] [PATCH 0/4] move rockchip sdram driver to driver/ram

2017-09-06 Thread Kever Yang

move all the Rockchip sdram driver which support CONFIG_RAM into
driver/ram folder


Kever Yang (4):
  rockchip: rk3399: move sdram driver to driver/ram
  rockchip: rk3188: move sdram driver to driver/ram
  rockchip: rk3288: move sdram driver to driver/ram
  rockchip: rk3328: move sdram driver to driver/ram

 arch/arm/mach-rockchip/rk3188/Makefile| 1 -
 arch/arm/mach-rockchip/rk3288/Makefile| 1 -
 arch/arm/mach-rockchip/rk3328/Makefile| 1 -
 arch/arm/mach-rockchip/rk3399/Makefile| 1 -
 drivers/ram/rockchip/Makefile | 4 
 .../arm/mach-rockchip/rk3188 => drivers/ram/rockchip}/sdram_rk3188.c  | 0
 .../arm/mach-rockchip/rk3288 => drivers/ram/rockchip}/sdram_rk3288.c  | 0
 .../arm/mach-rockchip/rk3328 => drivers/ram/rockchip}/sdram_rk3328.c  | 0
 .../arm/mach-rockchip/rk3399 => drivers/ram/rockchip}/sdram_rk3399.c  | 0
 9 files changed, 4 insertions(+), 4 deletions(-)
 rename {arch/arm/mach-rockchip/rk3188 => drivers/ram/rockchip}/sdram_rk3188.c 
(100%)
 rename {arch/arm/mach-rockchip/rk3288 => drivers/ram/rockchip}/sdram_rk3288.c 
(100%)
 rename {arch/arm/mach-rockchip/rk3328 => drivers/ram/rockchip}/sdram_rk3328.c 
(100%)
 rename {arch/arm/mach-rockchip/rk3399 => drivers/ram/rockchip}/sdram_rk3399.c 
(100%)

-- 
1.9.1

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


[U-Boot] [PATCH v2 5/5] configs: at91: Remove CONFIG_SYS_EXTRA_OPTIONS assignment

2017-09-06 Thread Wenyou Yang
To remove the assignment of CONFIG_SYS_EXTRA_OPTIONS option,
which is deprecated, use the CONFIG__BOOT options to
indicate the boot media, and the SoC is selected by the board.

Signed-off-by: Wenyou Yang 
---

Changes in v2:
 - Rebase the uboot/master (84a42069f253).

 board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c |  4 ++--
 board/atmel/at91sam9n12ek/at91sam9n12ek.c   |  6 +++---
 board/atmel/at91sam9x5ek/at91sam9x5ek.c |  4 ++--
 board/atmel/sama5d2_ptc/sama5d2_ptc.c   |  4 ++--
 board/atmel/sama5d3_xplained/sama5d3_xplained.c |  4 ++--
 board/atmel/sama5d3xek/sama5d3xek.c |  2 +-
 board/atmel/sama5d4_xplained/sama5d4_xplained.c |  2 +-
 board/atmel/sama5d4ek/sama5d4ek.c   |  2 +-
 configs/at91sam9m10g45ek_mmc_defconfig  |  2 +-
 configs/at91sam9m10g45ek_nandflash_defconfig|  2 +-
 configs/at91sam9n12ek_mmc_defconfig |  2 +-
 configs/at91sam9n12ek_nandflash_defconfig   |  2 +-
 configs/at91sam9n12ek_spiflash_defconfig|  2 +-
 configs/at91sam9x5ek_dataflash_defconfig|  2 +-
 configs/at91sam9x5ek_mmc_defconfig  |  2 +-
 configs/at91sam9x5ek_nandflash_defconfig|  2 +-
 configs/at91sam9x5ek_spiflash_defconfig |  2 +-
 configs/ma5d4evk_defconfig  |  2 +-
 configs/sama5d2_ptc_nandflash_defconfig |  2 +-
 configs/sama5d2_ptc_spiflash_defconfig  |  2 +-
 configs/sama5d2_xplained_mmc_defconfig  |  1 +
 configs/sama5d2_xplained_spiflash_defconfig |  2 +-
 configs/sama5d36ek_cmp_mmc_defconfig|  2 +-
 configs/sama5d36ek_cmp_nandflash_defconfig  |  2 +-
 configs/sama5d36ek_cmp_spiflash_defconfig   |  2 +-
 configs/sama5d3_xplained_mmc_defconfig  |  2 +-
 configs/sama5d3_xplained_nandflash_defconfig|  2 +-
 configs/sama5d3xek_mmc_defconfig|  2 +-
 configs/sama5d3xek_nandflash_defconfig  |  2 +-
 configs/sama5d3xek_spiflash_defconfig   |  2 +-
 configs/sama5d4_xplained_mmc_defconfig  |  2 +-
 configs/sama5d4_xplained_nandflash_defconfig|  2 +-
 configs/sama5d4_xplained_spiflash_defconfig |  2 +-
 configs/sama5d4ek_mmc_defconfig |  2 +-
 configs/sama5d4ek_nandflash_defconfig   |  2 +-
 configs/sama5d4ek_spiflash_defconfig|  2 +-
 configs/vinco_defconfig |  2 +-
 include/configs/at91-sama5_common.h |  6 +++---
 include/configs/at91sam9m10g45ek.h  |  8 
 include/configs/at91sam9n12ek.h | 20 ++--
 include/configs/at91sam9x5ek.h  | 23 ++-
 include/configs/sama5d2_ptc.h   |  8 
 include/configs/sama5d2_xplained.h  |  6 +++---
 include/configs/sama5d3_xplained.h  | 13 +++--
 include/configs/sama5d3xek.h| 23 +++
 include/configs/sama5d4_xplained.h  | 21 +++--
 include/configs/sama5d4ek.h | 22 +++---
 include/configs/vinco.h |  2 +-
 48 files changed, 102 insertions(+), 135 deletions(-)

diff --git a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c 
b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
index 903732b23b..98430c4246 100644
--- a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
+++ b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
@@ -84,9 +84,9 @@ void at91_spl_board_init(void)
at91_set_pio_pullup(AT91_PIO_PORTD, 7, 1);
at91_set_pio_pullup(AT91_PIO_PORTD, 8, 1);
 
-#ifdef CONFIG_SYS_USE_MMC
+#ifdef CONFIG_SD_BOOT
at91_mci_hw_init();
-#elif CONFIG_SYS_USE_NANDFLASH
+#elif CONFIG_NAND_BOOT
at91sam9m10g45ek_nand_hw_init();
 #endif
 }
diff --git a/board/atmel/at91sam9n12ek/at91sam9n12ek.c 
b/board/atmel/at91sam9n12ek/at91sam9n12ek.c
index fec93165c1..540adf55b6 100644
--- a/board/atmel/at91sam9n12ek/at91sam9n12ek.c
+++ b/board/atmel/at91sam9n12ek/at91sam9n12ek.c
@@ -224,11 +224,11 @@ int dram_init(void)
 
 void at91_spl_board_init(void)
 {
-#ifdef CONFIG_SYS_USE_MMC
+#ifdef CONFIG_SD_BOOT
at91_mci_hw_init();
-#elif CONFIG_SYS_USE_NANDFLASH
+#elif CONFIG_NAND_BOOT
at91sam9n12ek_nand_hw_init();
-#elif CONFIG_SYS_USE_SPIFLASH
+#elif CONFIG_SPI_BOOT
at91_spi0_hw_init(1 << 4);
 #endif
 }
diff --git a/board/atmel/at91sam9x5ek/at91sam9x5ek.c 
b/board/atmel/at91sam9x5ek/at91sam9x5ek.c
index 2452e63881..be6dd4a6d3 100644
--- a/board/atmel/at91sam9x5ek/at91sam9x5ek.c
+++ b/board/atmel/at91sam9x5ek/at91sam9x5ek.c
@@ -235,9 +235,9 @@ int dram_init(void)
 
 void at91_spl_board_init(void)
 {
-#ifdef CONFIG_SYS_USE_MMC
+#ifdef CONFIG_SD_BOOT
at91_mci_hw_init();
-#elif CONFIG_SYS_USE_NANDFLASH
+#elif CONFIG_NAND_BOOT
at91sam9x5ek_nand_hw_init();
 #endif
 }
diff --git a/board/atmel/sama5d2_ptc/sama5d2_ptc.c 
b/board/atmel/sama5d2_ptc/sama5d2_ptc.c
index 

[U-Boot] [PATCH v2 3/5] ARM: at91: Remove hardware.h included in configs

2017-09-06 Thread Wenyou Yang
From: Wenyou Yang 

As said in READRE.kconfig, include/configs/*.h will be removed
after all options are switched to Kconfig. As the first step,
remove the follow line from include/configs/*.h.

 #include 

Signed-off-by: Wenyou Yang 
---

Changes in v2: None

 arch/arm/mach-at91/atmel_sfr.c  |  1 +
 arch/arm/mach-at91/matrix.c |  1 +
 arch/arm/mach-at91/phy.c|  1 +
 drivers/pinctrl/pinctrl-at91.c  |  1 +
 include/configs/at91-sama5_common.h |  2 --
 include/configs/at91sam9m10g45ek.h  |  4 +---
 include/configs/at91sam9n12ek.h |  8 +---
 include/configs/at91sam9x5ek.h  |  2 --
 include/configs/ma5d4evk.h  |  9 ++---
 include/configs/sama5d2_ptc.h   | 10 ++
 include/configs/sama5d2_xplained.h  |  2 +-
 include/configs/sama5d3_xplained.h  | 10 +-
 include/configs/sama5d3xek.h|  8 
 include/configs/sama5d4_xplained.h  |  4 ++--
 include/configs/sama5d4ek.h |  4 ++--
 include/configs/vinco.h | 11 +++
 16 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/arch/arm/mach-at91/atmel_sfr.c b/arch/arm/mach-at91/atmel_sfr.c
index adf44c6a94..d595ba8836 100644
--- a/arch/arm/mach-at91/atmel_sfr.c
+++ b/arch/arm/mach-at91/atmel_sfr.c
@@ -6,6 +6,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/arch/arm/mach-at91/matrix.c b/arch/arm/mach-at91/matrix.c
index 57d72700d3..08659c87d4 100644
--- a/arch/arm/mach-at91/matrix.c
+++ b/arch/arm/mach-at91/matrix.c
@@ -6,6 +6,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/arch/arm/mach-at91/phy.c b/arch/arm/mach-at91/phy.c
index ddd70f5ff0..adb761e1ac 100644
--- a/arch/arm/mach-at91/phy.c
+++ b/arch/arm/mach-at91/phy.c
@@ -13,6 +13,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 38c435e37a..81f30eabe9 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/configs/at91-sama5_common.h 
b/include/configs/at91-sama5_common.h
index ff17b4eb4b..435c7dfa8e 100644
--- a/include/configs/at91-sama5_common.h
+++ b/include/configs/at91-sama5_common.h
@@ -10,8 +10,6 @@
 #ifndef __AT91_SAMA5_COMMON_H
 #define __AT91_SAMA5_COMMON_H
 
-#include 
-
 #define CONFIG_SYS_TEXT_BASE   0x26f0
 
 /* ARM asynchronous clock */
diff --git a/include/configs/at91sam9m10g45ek.h 
b/include/configs/at91sam9m10g45ek.h
index 22db94772d..36acaa5506 100644
--- a/include/configs/at91sam9m10g45ek.h
+++ b/include/configs/at91sam9m10g45ek.h
@@ -11,8 +11,6 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#include 
-
 #define CONFIG_SYS_TEXT_BASE   0x73f0
 
 #define CONFIG_ATMEL_LEGACY/* required until (g)pio is fixed */
@@ -52,7 +50,7 @@
 
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS   1
-#define CONFIG_SYS_SDRAM_BASE   ATMEL_BASE_CS6
+#define CONFIG_SYS_SDRAM_BASE   0x7000
 #define CONFIG_SYS_SDRAM_SIZE  0x0800
 
 #define CONFIG_SYS_INIT_SP_ADDR \
diff --git a/include/configs/at91sam9n12ek.h b/include/configs/at91sam9n12ek.h
index 7d70d8892a..c9adcf9754 100644
--- a/include/configs/at91sam9n12ek.h
+++ b/include/configs/at91sam9n12ek.h
@@ -10,12 +10,6 @@
 #ifndef __AT91SAM9N12_CONFIG_H_
 #define __AT91SAM9N12_CONFIG_H_
 
-/*
- * SoC must be defined first, before hardware.h is included.
- * In this case SoC is defined in boards.cfg.
- */
-#include 
-
 #define CONFIG_SYS_TEXT_BASE   0x26f0
 
 /* ARM asynchronous clock */
@@ -55,7 +49,7 @@
  * that address while providing maximum stack area below.
  */
 # define CONFIG_SYS_INIT_SP_ADDR \
-   (ATMEL_BASE_SRAM + 16 * 1024 - GENERATED_GBL_DATA_SIZE)
+   (0x0030 + 16 * 1024 - GENERATED_GBL_DATA_SIZE)
 
 /* DataFlash */
 #ifdef CONFIG_CMD_SF
diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
index c50e0b816f..eb798442ca 100644
--- a/include/configs/at91sam9x5ek.h
+++ b/include/configs/at91sam9x5ek.h
@@ -9,8 +9,6 @@
 #ifndef __CONFIG_H__
 #define __CONFIG_H__
 
-#include 
-
 #define CONFIG_SYS_TEXT_BASE   0x26f0
 
 /* ARM asynchronous clock */
diff --git a/include/configs/ma5d4evk.h b/include/configs/ma5d4evk.h
index 50b21c9d97..0fe1bc1c1d 100644
--- a/include/configs/ma5d4evk.h
+++ b/include/configs/ma5d4evk.h
@@ -14,11 +14,14 @@
 #define CONFIG_SYS_USE_SERIALFLASH 1
 #define CONFIG_BOARD_LATE_INIT
 
+/* Timer */
+#define CONFIG_SYS_TIMER_COUNTER   0xfc06863c
+
 /*
  * Memory configurations
  */
 #define CONFIG_NR_DRAM_BANKS   1
-#define CONFIG_SYS_SDRAM_BASE   ATMEL_BASE_DDRCS
+#define CONFIG_SYS_SDRAM_BASE  0x2000
 #define CONFIG_SYS_SDRAM_SIZE  0x1000
 
 #ifdef CONFIG_SPL_BUILD
@@ -45,8 +48,8 @@
  * Serial Driver
  */
 #define 

[U-Boot] [PATCH v2 2/5] ARM: at91: Add the SoC options to Kconfig

2017-09-06 Thread Wenyou Yang
From: Wenyou Yang 

To prepare to remove the SoCs options such as SAMA5D2, SAMA5D3
and SAMA5D4 from the CONFIG_SYS_EXTRA_OPTIONS option which is
deprecated, add the SoC options to Kconfig.

Signed-off-by: Wenyou Yang 
---

Changes in v2: None

 arch/arm/mach-at91/Kconfig | 106 +
 1 file changed, 79 insertions(+), 27 deletions(-)

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 2ca551044b..5dc4dcc4fe 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -3,6 +3,58 @@ if ARCH_AT91
 config AT91FAMILY
def_bool y
 
+config AT91SAM9260
+   bool
+   select CPU_ARM926EJS
+
+config AT91SAM9G20
+   bool
+   select CPU_ARM926EJS
+
+config AT91SAM9XE
+   bool
+   select CPU_ARM926EJS
+
+config AT91SAM9261
+   bool
+   select CPU_ARM926EJS
+
+config AT91SAM9263
+   bool
+   select CPU_ARM926EJS
+
+config AT91SAM9G45
+   bool
+   select CPU_ARM926EJS
+
+config AT91SAM9M10G45
+   bool
+   select CPU_ARM926EJS
+
+config AT91SAM9N12
+   bool
+   select CPU_ARM926EJS
+
+config AT91SAM9RL
+   bool
+   select CPU_ARM926EJS
+
+config AT91SAM9X5
+   bool
+   select CPU_ARM926EJS
+
+config SAMA5D2
+   bool
+   select CPU_V7
+
+config SAMA5D3
+   bool
+   select CPU_V7
+
+config SAMA5D4
+   bool
+   select CPU_V7
+
 choice
prompt "Atmel AT91 board select"
optional
@@ -13,24 +65,24 @@ config TARGET_AT91RM9200EK
 
 config TARGET_AT91SAM9260EK
bool "Atmel at91sam9260 reference board"
-   select CPU_ARM926EJS
+   select AT91SAM9260
select BOARD_EARLY_INIT_F
 
 config TARGET_ETHERNUT5
bool "Ethernut5 board"
-   select CPU_ARM926EJS
+   select AT91SAM9XE
 
 config TARGET_SNAPPER9260
bool "Support snapper9260"
-   select CPU_ARM926EJS
+   select AT91SAM9260
select DM
select DM_SERIAL
select DM_GPIO
 
 config TARGET_GURNARD
bool "Support gurnard"
+   select AT91SAM9G45
select BOARD_LATE_INIT
-   select CPU_ARM926EJS
select DM
select DM_SERIAL
select DM_GPIO
@@ -38,107 +90,107 @@ config TARGET_GURNARD
 
 config TARGET_AT91SAM9261EK
bool "Atmel at91sam9261 reference board"
-   select CPU_ARM926EJS
+   select AT91SAM9261
select BOARD_EARLY_INIT_F
 
 config TARGET_PM9261
bool "Ronetix pm9261 board"
-   select CPU_ARM926EJS
+   select AT91SAM9261
 
 config TARGET_AT91SAM9263EK
bool "Atmel at91sam9263 reference board"
-   select CPU_ARM926EJS
+   select AT91SAM9263
select BOARD_EARLY_INIT_F
 
 config TARGET_USB_A9263
bool "Caloa USB A9260 board"
-   select CPU_ARM926EJS
+   select AT91SAM9263
 
 config TARGET_PM9263
bool "Ronetix pm9263 board"
-   select CPU_ARM926EJS
+   select AT91SAM9263
 
 config TARGET_AT91SAM9M10G45EK
bool "Atmel AT91SAM9M10G45-EK board"
-   select CPU_ARM926EJS
+   select AT91SAM9M10G45
select SUPPORT_SPL
select BOARD_EARLY_INIT_F
 
 config TARGET_PM9G45
bool "Ronetix pm9g45 board"
-   select CPU_ARM926EJS
+   select AT91SAM9G45
 
 config TARGET_PICOSAM9G45
bool "Mini-box picosam9g45 board"
-   select CPU_ARM926EJS
+   select AT91SAM9M10G45
select SUPPORT_SPL
 
 config TARGET_AT91SAM9N12EK
bool "Atmel AT91SAM9N12-EK board"
-   select CPU_ARM926EJS
+   select AT91SAM9N12
select SUPPORT_SPL
select BOARD_EARLY_INIT_F
 
 config TARGET_AT91SAM9RLEK
bool "Atmel at91sam9rl reference board"
-   select CPU_ARM926EJS
+   select AT91SAM9RL
select BOARD_EARLY_INIT_F
 
 config TARGET_AT91SAM9X5EK
bool "Atmel AT91SAM9X5-EK board"
-   select CPU_ARM926EJS
+   select AT91SAM9X5
select SUPPORT_SPL
select BOARD_EARLY_INIT_F
 
 config TARGET_SAMA5D2_PTC
bool "SAMA5D2 PTC board"
-   select CPU_V7
+   select SAMA5D2
select SUPPORT_SPL
select BOARD_EARLY_INIT_F
 
 config TARGET_SAMA5D2_XPLAINED
bool "SAMA5D2 Xplained board"
-   select CPU_V7
+   select SAMA5D2
select SUPPORT_SPL
select BOARD_EARLY_INIT_F
 
 config TARGET_SAMA5D3_XPLAINED
bool "SAMA5D3 Xplained board"
-   select CPU_V7
+   select SAMA5D3
select SUPPORT_SPL
select BOARD_EARLY_INIT_F
 
 config TARGET_SAMA5D3XEK
bool "SAMA5D3X-EK board"
+   select SAMA5D3
select BOARD_LATE_INIT
-   select CPU_V7
select SUPPORT_SPL
select BOARD_EARLY_INIT_F
 
 config TARGET_SAMA5D4_XPLAINED
bool "SAMA5D4 Xplained board"
-   select CPU_V7
+   select SAMA5D4
select SUPPORT_SPL
select BOARD_EARLY_INIT_F
 
 config TARGET_SAMA5D4EK
bool "SAMA5D4 Evaluation Kit"
-   select CPU_V7
+  

[U-Boot] [PATCH v2 4/5] ARM: at91: spl: Add macro CONFIG_XXXX_BOOT support

2017-09-06 Thread Wenyou Yang
Use the CONFIG__BOOT to indicate the boot media, instead of
the CONFIG_SYS_USE_ option, which is declared by
CONFIG_SYS_EXTRA_OPTIONS option.

Signed-off-by: Wenyou Yang 
---

Changes in v2: None

 arch/arm/mach-at91/spl.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-at91/spl.c b/arch/arm/mach-at91/spl.c
index e113336b7b..c2e2d90a89 100644
--- a/arch/arm/mach-at91/spl.c
+++ b/arch/arm/mach-at91/spl.c
@@ -37,7 +37,7 @@ u32 spl_boot_device(void)
u32 off = (bootrom_stash.r4 >> ATMEL_SAMA5_BOOT_DEV_ID_OFF) &
  ATMEL_SAMA5_BOOT_DEV_ID_MASK;
 
-#if defined(CONFIG_SYS_USE_MMC)
+#if defined(CONFIG_SYS_USE_MMC) || defined(CONFIG_SD_BOOT)
if (dev == ATMEL_SAMA5_BOOT_FROM_MCI) {
 #if defined(CONFIG_SPL_OF_CONTROL)
return BOOT_DEVICE_MMC1;
@@ -52,7 +52,9 @@ u32 spl_boot_device(void)
}
 #endif
 
-#if defined(CONFIG_SYS_USE_SERIALFLASH) || defined(CONFIG_SYS_USE_SPIFLASH)
+#if defined(CONFIG_SYS_USE_SERIALFLASH) || \
+   defined(CONFIG_SYS_USE_SPIFLASH) || \
+   defined(CONFIG_SPI_BOOT)
if (dev == ATMEL_SAMA5_BOOT_FROM_SPI)
return BOOT_DEVICE_SPI;
 #endif
@@ -71,11 +73,13 @@ u32 spl_boot_device(void)
 #else
 u32 spl_boot_device(void)
 {
-#ifdef CONFIG_SYS_USE_MMC
+#if defined(CONFIG_SYS_USE_MMC) || defined(CONFIG_SD_BOOT)
return BOOT_DEVICE_MMC1;
-#elif CONFIG_SYS_USE_NANDFLASH
+#elif defined(CONFIG_SYS_USE_NANDFLASH) || defined(CONFIG_NAND_BOOT)
return BOOT_DEVICE_NAND;
-#elif CONFIG_SYS_USE_SERIALFLASH || CONFIG_SYS_USE_SPIFLASH
+#elif defined(CONFIG_SYS_USE_SERIALFLASH) || \
+   defined(CONFIG_SYS_USE_SPIFLASH) || \
+   defined(CONFIG_SPI_BOOT)
return BOOT_DEVICE_SPI;
 #endif
return BOOT_DEVICE_NONE;
@@ -85,7 +89,7 @@ u32 spl_boot_device(void)
 u32 spl_boot_mode(const u32 boot_device)
 {
switch (boot_device) {
-#ifdef CONFIG_SYS_USE_MMC
+#if defined(CONFIG_SYS_USE_MMC) || defined(CONFIG_SD_BOOT)
case BOOT_DEVICE_MMC1:
case BOOT_DEVICE_MMC2:
return MMCSD_MODE_FS;
-- 
2.13.0

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


[U-Boot] [PATCH v2 1/5] ARM: at91: Move CONFIG_AT91FAMILY option to Kconfig

2017-09-06 Thread Wenyou Yang
From: Wenyou Yang 

Move the CONFIG_AT91FAMILY option from include/mach/.h header
file to Kconfig.

Signed-off-by: Wenyou Yang 
---

Changes in v2: None

 arch/arm/mach-at91/Kconfig| 3 +++
 arch/arm/mach-at91/include/mach/at91rm9200.h  | 1 -
 arch/arm/mach-at91/include/mach/at91sam9260.h | 5 -
 arch/arm/mach-at91/include/mach/at91sam9261.h | 5 -
 arch/arm/mach-at91/include/mach/at91sam9263.h | 5 -
 arch/arm/mach-at91/include/mach/at91sam9g45.h | 5 -
 arch/arm/mach-at91/include/mach/at91sam9rl.h  | 5 -
 arch/arm/mach-at91/include/mach/at91sam9x5.h  | 2 --
 arch/arm/mach-at91/include/mach/sama5d2.h | 5 -
 arch/arm/mach-at91/include/mach/sama5d3.h | 5 -
 arch/arm/mach-at91/include/mach/sama5d4.h | 5 -
 11 files changed, 3 insertions(+), 43 deletions(-)

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 20f7eeaf09..2ca551044b 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -1,5 +1,8 @@
 if ARCH_AT91
 
+config AT91FAMILY
+   def_bool y
+
 choice
prompt "Atmel AT91 board select"
optional
diff --git a/arch/arm/mach-at91/include/mach/at91rm9200.h 
b/arch/arm/mach-at91/include/mach/at91rm9200.h
index d177bdcae5..d15fb7a292 100644
--- a/arch/arm/mach-at91/include/mach/at91rm9200.h
+++ b/arch/arm/mach-at91/include/mach/at91rm9200.h
@@ -6,7 +6,6 @@
 #ifndef __AT91RM9200_H__
 #define __AT91RM9200_H__
 
-#define CONFIG_AT91FAMILY  /* it's a member of AT91 family */
 #define CONFIG_ARCH_CPU_INIT   /* we need arch_cpu_init() for hw timers */
 #define CONFIG_AT91_GPIO   /* and require always gpio features */
 
diff --git a/arch/arm/mach-at91/include/mach/at91sam9260.h 
b/arch/arm/mach-at91/include/mach/at91sam9260.h
index 1a4e84b050..24d5dbd68a 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9260.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9260.h
@@ -19,11 +19,6 @@
 #define AT91SAM9260_H
 
 /*
- * defines to be used in other places
- */
-#define CONFIG_AT91FAMILY  /* it's a member of AT91 */
-
-/*
  * Peripheral identifiers/interrupts.
  */
 #define ATMEL_ID_FIQ   0   /* Advanced Interrupt Controller (FIQ) */
diff --git a/arch/arm/mach-at91/include/mach/at91sam9261.h 
b/arch/arm/mach-at91/include/mach/at91sam9261.h
index 914a3b0460..06403ce225 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9261.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9261.h
@@ -19,11 +19,6 @@
 #define AT91SAM9261_H
 
 /*
- * defines to be used in other places
- */
-#define CONFIG_AT91FAMILY  /* it's a member of AT91 */
-
-/*
  * Peripheral identifiers/interrupts.
  */
 #define ATMEL_ID_FIQ   0   /* Advanced Interrupt Controller (FIQ) */
diff --git a/arch/arm/mach-at91/include/mach/at91sam9263.h 
b/arch/arm/mach-at91/include/mach/at91sam9263.h
index 71675abf82..be9a665db5 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9263.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9263.h
@@ -15,11 +15,6 @@
 #define AT91SAM9263_H
 
 /*
- * defines to be used in other places
- */
-#define CONFIG_AT91FAMILY  /* it's a member of AT91 */
-
-/*
  * Peripheral identifiers/interrupts.
  */
 #define ATMEL_ID_FIQ   0   /* Advanced Interrupt Controller (FIQ) */
diff --git a/arch/arm/mach-at91/include/mach/at91sam9g45.h 
b/arch/arm/mach-at91/include/mach/at91sam9g45.h
index 5c32e24ed0..96922c4e6b 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9g45.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9g45.h
@@ -13,11 +13,6 @@
 #define AT91SAM9G45_H
 
 /*
- * defines to be used in other places
- */
-#define CONFIG_AT91FAMILY  /* it's a member of AT91 */
-
-/*
  * Peripheral identifiers/interrupts.
  */
 #define ATMEL_ID_FIQ   0   /* Advanced Interrupt Controller (FIQ) */
diff --git a/arch/arm/mach-at91/include/mach/at91sam9rl.h 
b/arch/arm/mach-at91/include/mach/at91sam9rl.h
index 70bbf4edaa..8f9155c9ea 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9rl.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9rl.h
@@ -15,11 +15,6 @@
 #define AT91SAM9RL_H
 
 /*
- * defines to be used in other places
- */
-#define CONFIG_AT91FAMILY  /* it's a member of AT91 */
-
-/*
  * Peripheral identifiers/interrupts.
  */
 #define ATMEL_ID_FIQ   0   /* Advanced Interrupt Controller (FIQ) */
diff --git a/arch/arm/mach-at91/include/mach/at91sam9x5.h 
b/arch/arm/mach-at91/include/mach/at91sam9x5.h
index e7224e432d..f9710a172f 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9x5.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9x5.h
@@ -12,8 +12,6 @@
 #ifndef __AT91SAM9X5_H__
 #define __AT91SAM9X5_H__
 
-#define CONFIG_AT91FAMILY  /* it's a member of AT91 family */
-
 /*
  * Peripheral identifiers/interrupts.
  */
diff --git a/arch/arm/mach-at91/include/mach/sama5d2.h 
b/arch/arm/mach-at91/include/mach/sama5d2.h
index 25c85411e5..2ee3d68db3 100644
--- a/arch/arm/mach-at91/include/mach/sama5d2.h
+++ b/arch/arm/mach-at91/include/mach/sama5d2.h
@@ 

[U-Boot] [PATCH v2 0/5] configs: at91: Remove value of CONFIG_SYS_EXTRA_OPTIONS option

2017-09-06 Thread Wenyou Yang
The CONFIG_SYS_EXTRA_OPTIONS option is deprecated, remove the value
of this option from the board default config files.

Changes in v2:
 - Rebase the uboot/master (84a42069f253).

Wenyou Yang (5):
  ARM: at91: Move CONFIG_AT91FAMILY option to Kconfig
  ARM: at91: Add the SoC options to Kconfig
  ARM: at91: Remove hardware.h included in configs
  ARM: at91: spl: Add macro CONFIG__BOOT support
  configs: at91: Remove CONFIG_SYS_EXTRA_OPTIONS assignment

 arch/arm/mach-at91/Kconfig  | 109 ++--
 arch/arm/mach-at91/atmel_sfr.c  |   1 +
 arch/arm/mach-at91/include/mach/at91rm9200.h|   1 -
 arch/arm/mach-at91/include/mach/at91sam9260.h   |   5 --
 arch/arm/mach-at91/include/mach/at91sam9261.h   |   5 --
 arch/arm/mach-at91/include/mach/at91sam9263.h   |   5 --
 arch/arm/mach-at91/include/mach/at91sam9g45.h   |   5 --
 arch/arm/mach-at91/include/mach/at91sam9rl.h|   5 --
 arch/arm/mach-at91/include/mach/at91sam9x5.h|   2 -
 arch/arm/mach-at91/include/mach/sama5d2.h   |   5 --
 arch/arm/mach-at91/include/mach/sama5d3.h   |   5 --
 arch/arm/mach-at91/include/mach/sama5d4.h   |   5 --
 arch/arm/mach-at91/matrix.c |   1 +
 arch/arm/mach-at91/phy.c|   1 +
 arch/arm/mach-at91/spl.c|  16 ++--
 board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c |   4 +-
 board/atmel/at91sam9n12ek/at91sam9n12ek.c   |   6 +-
 board/atmel/at91sam9x5ek/at91sam9x5ek.c |   4 +-
 board/atmel/sama5d2_ptc/sama5d2_ptc.c   |   4 +-
 board/atmel/sama5d3_xplained/sama5d3_xplained.c |   4 +-
 board/atmel/sama5d3xek/sama5d3xek.c |   2 +-
 board/atmel/sama5d4_xplained/sama5d4_xplained.c |   2 +-
 board/atmel/sama5d4ek/sama5d4ek.c   |   2 +-
 configs/at91sam9m10g45ek_mmc_defconfig  |   2 +-
 configs/at91sam9m10g45ek_nandflash_defconfig|   2 +-
 configs/at91sam9n12ek_mmc_defconfig |   2 +-
 configs/at91sam9n12ek_nandflash_defconfig   |   2 +-
 configs/at91sam9n12ek_spiflash_defconfig|   2 +-
 configs/at91sam9x5ek_dataflash_defconfig|   2 +-
 configs/at91sam9x5ek_mmc_defconfig  |   2 +-
 configs/at91sam9x5ek_nandflash_defconfig|   2 +-
 configs/at91sam9x5ek_spiflash_defconfig |   2 +-
 configs/ma5d4evk_defconfig  |   2 +-
 configs/sama5d2_ptc_nandflash_defconfig |   2 +-
 configs/sama5d2_ptc_spiflash_defconfig  |   2 +-
 configs/sama5d2_xplained_mmc_defconfig  |   1 +
 configs/sama5d2_xplained_spiflash_defconfig |   2 +-
 configs/sama5d36ek_cmp_mmc_defconfig|   2 +-
 configs/sama5d36ek_cmp_nandflash_defconfig  |   2 +-
 configs/sama5d36ek_cmp_spiflash_defconfig   |   2 +-
 configs/sama5d3_xplained_mmc_defconfig  |   2 +-
 configs/sama5d3_xplained_nandflash_defconfig|   2 +-
 configs/sama5d3xek_mmc_defconfig|   2 +-
 configs/sama5d3xek_nandflash_defconfig  |   2 +-
 configs/sama5d3xek_spiflash_defconfig   |   2 +-
 configs/sama5d4_xplained_mmc_defconfig  |   2 +-
 configs/sama5d4_xplained_nandflash_defconfig|   2 +-
 configs/sama5d4_xplained_spiflash_defconfig |   2 +-
 configs/sama5d4ek_mmc_defconfig |   2 +-
 configs/sama5d4ek_nandflash_defconfig   |   2 +-
 configs/sama5d4ek_spiflash_defconfig|   2 +-
 configs/vinco_defconfig |   2 +-
 drivers/pinctrl/pinctrl-at91.c  |   1 +
 include/configs/at91-sama5_common.h |   8 +-
 include/configs/at91sam9m10g45ek.h  |  12 ++-
 include/configs/at91sam9n12ek.h |  28 +++---
 include/configs/at91sam9x5ek.h  |  25 +++---
 include/configs/ma5d4evk.h  |   9 +-
 include/configs/sama5d2_ptc.h   |  18 ++--
 include/configs/sama5d2_xplained.h  |   8 +-
 include/configs/sama5d3_xplained.h  |  23 ++---
 include/configs/sama5d3xek.h|  31 +++
 include/configs/sama5d4_xplained.h  |  25 ++
 include/configs/sama5d4ek.h |  26 ++
 include/configs/vinco.h |  13 +--
 65 files changed, 233 insertions(+), 250 deletions(-)

-- 
2.13.0

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


Re: [U-Boot] [PATCH v2 1/5] rockchip: rk322x: update dram bank size

2017-09-06 Thread Kever Yang

Hi Philipp,

This patch is a bug fix for rk3229 ram size, and not relate to the 
dram driver,


could you share why you still not take this patch?


Thanks,
- Kever
On 08/17/2017 03:17 PM, Kever Yang wrote:

The DRAM start address is not 0, so need to update the last bank size
as:
DRAM start addr + DRAM_SIZE - last bank start addr

Signed-off-by: Kever Yang 
Acked-by: Philipp Tomsich 
Reviewed-by: Philipp Tomsich 
Reviewed-by: Simon Glass 
---

Changes in v2: None

  arch/arm/mach-rockchip/rk322x-board.c | 10 ++
  1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk322x-board.c 
b/arch/arm/mach-rockchip/rk322x-board.c
index b6543a5..f93bd33 100644
--- a/arch/arm/mach-rockchip/rk322x-board.c
+++ b/arch/arm/mach-rockchip/rk322x-board.c
@@ -72,11 +72,13 @@ int board_init(void)
  
  int dram_init_banksize(void)

  {
-   /* Reserve 0x20 for OPTEE */
-   gd->bd->bi_dram[0].start = 0x6000;
+   gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
gd->bd->bi_dram[0].size = 0x840;
-   gd->bd->bi_dram[1].start = 0x6a40;
-   gd->bd->bi_dram[1].size = gd->ram_size - gd->bd->bi_dram[1].start;
+   /* Reserve 14M for OPTEE and TA */
+   gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE
+   + gd->bd->bi_dram[0].size + 0xe0;
+   gd->bd->bi_dram[1].size = gd->bd->bi_dram[0].start
+   + gd->ram_size - gd->bd->bi_dram[1].start;
  
  	return 0;

  }



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


Re: [U-Boot] [U-Boot,2/3] imx: mx6: correct IPU clock

2017-09-06 Thread Ye Li
On 9/5/2017 6:33 PM, Eric Nelson wrote:
> Hi Peng,
>
> Pardon the reference to an old update, but do you have a description
> of the symptoms that brought about this patch?
>
> On 03/09/2016 01:07 AM, Peng Fan wrote:
>> The CONFIG_IPUV3_CLK should be 26400, to i.MX6DL, it should be
>> 19800.
>>
>> Signed-off-by: Peng Fan 
>> Signed-off-by: Sandor Yu 
>> Cc: Stefano Babic 
>> Cc: Fabio Estevam 
>> Cc: Peter Robinson 
>> ---
>>include/configs/mx6sabre_common.h | 6 +-
>>1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/configs/mx6sabre_common.h 
>> b/include/configs/mx6sabre_common.h
>> index 29d1f91..a6d821b 100644
>> --- a/include/configs/mx6sabre_common.h
>> +++ b/include/configs/mx6sabre_common.h
>> @@ -225,7 +225,11 @@
>>#define CONFIG_BMP_16BPP
>>#define CONFIG_VIDEO_LOGO
>>#define CONFIG_VIDEO_BMP_LOGO
>> -#define CONFIG_IPUV3_CLK 26000
>> +#ifdef CONFIG_MX6DL
>> +#define CONFIG_IPUV3_CLK 19800
>> +#else
>> +#define CONFIG_IPUV3_CLK 26400
>> +#endif
>
>
> Note that this should probably be applied for other boards
> which are compiled for multiple CPU types.
>
> At least the Boundary Nitrogen boards, but probably others
> like Wand have ordering options for DL or Solo processors
> and may need the reduced clock rate.
>
>
>>#define CONFIG_IMX_HDMI
>>#define CONFIG_IMX_VIDEO_SKIP
>>
>
> Please advise,
>
>
> Eric
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
>

CONFIG_IPUV3_CLK is used to indicate the default rate for IPU HSP clock. 
The IPU driver in u-boot won't calculate the HSP clock rate according to 
CCM registers, it needs this setting to know current rate. 198Mhz is the 
correct value on DL not the 264Mhz.

If you select IPU DI clock (pixel clock) derived from HSP clock not the 
external clock like LDB DI clock, I believe the 264Mhz will cause problem.

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


[U-Boot] [PATCH v3 2/2] rockchip: dts: rk3229: remove dram channel info

2017-09-06 Thread Kever Yang
The dram channel info will be auto detect by the driver,
we do not need it.

Signed-off-by: Kever Yang 
---

Changes in v3: None

 arch/arm/dts/rk3229-evb.dts | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/dts/rk3229-evb.dts b/arch/arm/dts/rk3229-evb.dts
index e66d6bf..fe4abe9 100644
--- a/arch/arm/dts/rk3229-evb.dts
+++ b/arch/arm/dts/rk3229-evb.dts
@@ -40,7 +40,6 @@
 };
 
  {
-   rockchip,sdram-channel = /bits/ 8 <1 10 3 2 1 0 15 15>;
rockchip,pctl-timing = <0x96 0xC8 0x1F3 0xF 0x804D 0x4 0x4E 0x6 0x3
0x0 0x6 0x5 0xC 0x10 0x6 0x4 0x4
0x5 0x4 0x200 0x3 0xA 0x40 0x0 0x1
-- 
1.9.1

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


Re: [U-Boot] setup of PEX_GCLK_RATIO in E500 CPUs(P2010) missing ?

2017-09-06 Thread Mingkai Hu


> -Original Message-
> From: Joakim Tjernlund [mailto:joakim.tjernl...@infinera.com]
> Sent: Tuesday, September 05, 2017 8:45 PM
> To: Mingkai Hu ; Roy Zang ;
> York Sun 
> Cc: u-boot@lists.denx.de
> Subject: Re: setup of PEX_GCLK_RATIO in E500 CPUs(P2010) missing ?
> 
> On Wed, 2017-08-30 at 15:25 +, York Sun wrote:
> > On 08/30/2017 06:05 AM, Joakim Tjernlund wrote:
> > > On Tue, 2017-08-29 at 17:33 +, York Sun wrote:
> > > > +Roy Zang to comment on PCIe clock source
> > > >
> > > > On 08/29/2017 10:06 AM, Joakim Tjernlund wrote:
> > > > > On Tue, 2017-08-29 at 15:43 +, York Sun wrote:
> > > > > > On 08/29/2017 06:21 AM, Joakim Tjernlund wrote:
> > > > > > > On Tue, 2017-08-29 at 12:47 +0200, Joakim Tjernlund wrote:
> > > > > > > > As we are looking at PCI stuff ATM I would like to ask
> > > > > > > > about PEX_GCLK_RATIO in E500 CPUs. I cannot find this is
> > > > > > > > setup at all for E500 but I THINK this is required.
> > > > > > > >
> > > > > > > > In 83xx one do:
> > > > > > > > get_clocks();
> > > > > > > > /* Configure the PCIE controller core clock ratio */
> > > > > > > > out_le32(hose_cfg_base + PEX_GCLK_RATIO,
> > > > > > >
> > > > > > > A bit strange with out_le32 instead of out_be32 ?
> > > > > > >
> > > > > > > > (((bus ? gd->arch.pciexp2_clk : gd->arch.pciexp1_clk) /
> > > > > > > > 100) * 16) / 333); udelay(100);
> > > > > > > >
> > > > > > > > Any clues?
> > > > > > > >
> > > > > > > > Jocke
> > > > > > >
> > > > > > > Seems like only 83xx is setting this parameter.
> > > > > > >
> > > > > > > Anyhow, I put together this patch:
> > > > > > >
> > > > > > > --- a/drivers/pci/fsl_pci_init.c
> > > > > > > +++ b/drivers/pci/fsl_pci_init.c
> > > > > > > @@ -322,6 +322,10 @@ void fsl_pci_init(struct pci_controller
> > > > > > > *hose, struct fsl_pci_info *pci_info)
> > > > > > >
> > > > > > >pci_setup_indirect(hose, cfg_addr, cfg_data);
> > > > > > >
> > > > > > > +   /* Configure the PCIE controller core clock ratio */
> > > > > > > +   pci_hose_write_config_dword(hose, dev, 0x440, (gd-
> >bus_clk / 3) * 16);
> > > > > > > +   /* udelay(100) needed here ?*/
> > > > > > > +
> > > > > > >block_rev = in_be32(>block_rev1);
> > > > > > >if (PEX_IP_BLK_REV_2_2 <= block_rev) {
> > > > > > >pi = >pit[2];  /* 0xDC0 */
> > > > > > >
> > > > > > > Any chance this will work for all supported FSL PCIe controllers?
> > > > > > >
> > > > > >
> > > > > > Jocke,
> > > > > >
> > > > > > You don't need to program this register if the actual PCIe
> > > > > > clock is the same as default. Since SerDes reference clock has
> > > > > > to be 100MHz for PCIe protocol, my guess is the PCIe clock is
> > > > > > always correct. The bus_clk you are referring is not the PCIe
> > > > > > clock. Again, I am not a PCIe expert, I could be wrong. Since
> > > > > > PCIe (SerDes) has been working on multiple platforms, I guess the
> clock is correct.
> > > > >
> > > > > I don't think so. Here is what T1042 says about this:
> > > > >
> > > > > The PCI Express controller clock frequency is one-half the platform
> clock frequency.
> > > > >
> > > > > The PCI Express controller core clock ratio register is used to
> > > > > program the ratio of the actual PCI Express controller clock
> > > > > frequency to the default controller core frequency ( 333 MHz ).
> > > > > This is required only when a PCI Express controller clock frequency
> other than the default 333 MHz has to be used.
> > > > > As an example of programming PEX_GCLK_RATIO, consider the case
> > > > > where the actual PCI Express controller clock is 250 MHz, the
> > > > > ratio of the actual clock to the default clock ( 333 MHz) is
> > > > > 3:4. that is, the default core clock has to be multiplied by the
> > > > > ratio (3/4, which is equivalent to 12/16). So the register has to be
> programmed with the decimal numerator value 12 or 0x_000C.
> > > > >
> > > > > Our CCB is 250 MHz so this should be set to 0xc.
> > > > >
> > > > > I found this on Google too:
> > > > > The PEX controller hardware requires for timing tuning in order
> > > > > to operate properly at given CCB/2 clock frequency.
> > > > > PEX_GCLK_RATIO register controls this tuning with 333MHz/16
> > > > > granularities. So for given CCB frequency Fccb [MHz] we must write to
> PEX_GCLK_RATIO nearest integer of ((Fccb/2)/(333/16)). So for Fccb=375 we
> have to write 18.
> > > >
> > > > Jocke,
> > > >
> > > > Basically I agree with you, if the clock is different from
> > > > default, you need to set the ratio. T104x indeed uses 1/2 platform
> > > > clock as PCIe clock. I am not sure if P2010 uses the same way. Let
> > > > me add Roy to this thread.
> > > >
> > > > Roy, how do we get PCIe clock for P1/T1 (and other mpc85xx) SoCs?
> > > > Don't we need to set PEX_GCLK_RATIO register? It is not even in the
> header file.
> > >
> > > 

[U-Boot] [PATCH v3 0/2] rockchip: rk3229: add sdram support

2017-09-06 Thread Kever Yang

Add sdram driver for rk3229


Changes in v3:
- move rk332x sdram driver to driver/ram
- do the ram init in TPL instad of SPL

Kever Yang (2):
  rockchip: rk322x: add sdram driver
  rockchip: dts: rk3229: remove dram channel info

 arch/arm/dts/rk3229-evb.dts   |   1 -
 arch/arm/include/asm/arch-rockchip/sdram_rk322x.h | 581 +++
 drivers/ram/rockchip/Makefile |   1 +
 drivers/ram/rockchip/sdram_rk322x.c   | 855 ++
 4 files changed, 1437 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_rk322x.h
 create mode 100644 drivers/ram/rockchip/sdram_rk322x.c

-- 
1.9.1

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


[U-Boot] [PATCH v3 1/2] rockchip: rk322x: add sdram driver

2017-09-06 Thread Kever Yang
Add driver for rk322x to support sdram initialize in SPL.

Signed-off-by: Kever Yang 
---

Changes in v3:
- move rk332x sdram driver to driver/ram
- do the ram init in TPL instad of SPL

 arch/arm/include/asm/arch-rockchip/sdram_rk322x.h | 581 +++
 drivers/ram/rockchip/Makefile |   1 +
 drivers/ram/rockchip/sdram_rk322x.c   | 855 ++
 3 files changed, 1437 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_rk322x.h
 create mode 100644 drivers/ram/rockchip/sdram_rk322x.c

diff --git a/arch/arm/include/asm/arch-rockchip/sdram_rk322x.h 
b/arch/arm/include/asm/arch-rockchip/sdram_rk322x.h
new file mode 100644
index 000..b10de76
--- /dev/null
+++ b/arch/arm/include/asm/arch-rockchip/sdram_rk322x.h
@@ -0,0 +1,581 @@
+/*
+ * (C) Copyright 2017 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+#ifndef _ASM_ARCH_SDRAM_RK322X_H
+#define _ASM_ARCH_SDRAM_RK322X_H
+
+#include 
+
+enum {
+   DDR3= 3,
+   LPDDR2  = 5,
+   LPDDR3  = 6,
+   UNUSED  = 0xFF,
+};
+
+struct rk322x_sdram_channel {
+   /*
+* bit width in address, eg:
+* 8 banks using 3 bit to address,
+* 2 cs using 1 bit to address.
+*/
+   u8 rank;
+   u8 col;
+   u8 bk;
+   u8 bw;
+   u8 dbw;
+   u8 row_3_4;
+   u8 cs0_row;
+   u8 cs1_row;
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+   /*
+* For of-platdata, which would otherwise convert this into two
+* byte-swapped integers. With a size of 9 bytes, this struct will
+* appear in of-platdata as a byte array.
+*
+* If OF_PLATDATA enabled, need to add a dummy byte in dts.(i.e 0xff)
+*/
+   u8 dummy;
+#endif
+};
+
+struct rk322x_ddr_pctl {
+   u32 scfg;
+   u32 sctl;
+   u32 stat;
+   u32 intrstat;
+   u32 reserved0[(0x40 - 0x10) / 4];
+   u32 mcmd;
+   u32 powctl;
+   u32 powstat;
+   u32 cmdtstat;
+   u32 cmdtstaten;
+   u32 reserved1[(0x60 - 0x54) / 4];
+   u32 mrrcfg0;
+   u32 mrrstat0;
+   u32 mrrstat1;
+   u32 reserved2[(0x7c - 0x6c) / 4];
+
+   u32 mcfg1;
+   u32 mcfg;
+   u32 ppcfg;
+   u32 mstat;
+   u32 lpddr2zqcfg;
+   u32 reserved3;
+
+   u32 dtupdes;
+   u32 dtuna;
+   u32 dtune;
+   u32 dtuprd0;
+   u32 dtuprd1;
+   u32 dtuprd2;
+   u32 dtuprd3;
+   u32 dtuawdt;
+   u32 reserved4[(0xc0 - 0xb4) / 4];
+
+   u32 togcnt1u;
+   u32 tinit;
+   u32 trsth;
+   u32 togcnt100n;
+   u32 trefi;
+   u32 tmrd;
+   u32 trfc;
+   u32 trp;
+   u32 trtw;
+   u32 tal;
+   u32 tcl;
+   u32 tcwl;
+   u32 tras;
+   u32 trc;
+   u32 trcd;
+   u32 trrd;
+   u32 trtp;
+   u32 twr;
+   u32 twtr;
+   u32 texsr;
+   u32 txp;
+   u32 txpdll;
+   u32 tzqcs;
+   u32 tzqcsi;
+   u32 tdqs;
+   u32 tcksre;
+   u32 tcksrx;
+   u32 tcke;
+   u32 tmod;
+   u32 trstl;
+   u32 tzqcl;
+   u32 tmrr;
+   u32 tckesr;
+   u32 tdpd;
+   u32 tref_mem_ddr3;
+   u32 reserved5[(0x180 - 0x14c) / 4];
+   u32 ecccfg;
+   u32 ecctst;
+   u32 eccclr;
+   u32 ecclog;
+   u32 reserved6[(0x200 - 0x190) / 4];
+   u32 dtuwactl;
+   u32 dturactl;
+   u32 dtucfg;
+   u32 dtuectl;
+   u32 dtuwd0;
+   u32 dtuwd1;
+   u32 dtuwd2;
+   u32 dtuwd3;
+   u32 dtuwdm;
+   u32 dturd0;
+   u32 dturd1;
+   u32 dturd2;
+   u32 dturd3;
+   u32 dtulfsrwd;
+   u32 dtulfsrrd;
+   u32 dtueaf;
+   /* dfi control registers */
+   u32 dfitctrldelay;
+   u32 dfiodtcfg;
+   u32 dfiodtcfg1;
+   u32 dfiodtrankmap;
+   /* dfi write data registers */
+   u32 dfitphywrdata;
+   u32 dfitphywrlat;
+   u32 reserved7[(0x260 - 0x258) / 4];
+   u32 dfitrddataen;
+   u32 dfitphyrdlat;
+   u32 reserved8[(0x270 - 0x268) / 4];
+   u32 dfitphyupdtype0;
+   u32 dfitphyupdtype1;
+   u32 dfitphyupdtype2;
+   u32 dfitphyupdtype3;
+   u32 dfitctrlupdmin;
+   u32 dfitctrlupdmax;
+   u32 dfitctrlupddly;
+   u32 reserved9;
+   u32 dfiupdcfg;
+   u32 dfitrefmski;
+   u32 dfitctrlupdi;
+   u32 reserved10[(0x2ac - 0x29c) / 4];
+   u32 dfitrcfg0;
+   u32 dfitrstat0;
+   u32 dfitrwrlvlen;
+   u32 dfitrrdlvlen;
+   u32 dfitrrdlvlgateen;
+   u32 dfiststat0;
+   u32 dfistcfg0;
+   u32 dfistcfg1;
+   u32 reserved11;
+   u32 dfitdramclken;
+   u32 dfitdramclkdis;
+   u32 dfistcfg2;
+   u32 dfistparclr;
+   u32 dfistparlog;
+   u32 reserved12[(0x2f0 - 0x2e4) / 4];
+
+   u32 dfilpcfg0;
+   u32 reserved13[(0x300 - 0x2f4) / 4];
+   u32 dfitrwrlvlresp0;
+   u32 dfitrwrlvlresp1;
+   u32 

Re: [U-Boot] [PATCH] rockchip: pinctrl: use fdtdec_get_int_array() to get interrupt

2017-09-06 Thread Dr. Philipp Tomsich

> On 6 Sep 2017, at 10:36, Kever Yang  wrote:
> 
> Not all the udevice have a available DT node, eg. rksd...@ff50.blk
> which add by mmc_bind(), if we use dev_read_u32_array(), the interface
> will use the ofnode directly and end with:
>   assert(ofnode_valid(node));
> 
> Use fdtdec_get_int_array() instead.

Changing this will affect livetree (at least it broke livetree support for me 
in my testing).
Looks like we will need to address the underlying issue of dynamically added 
nodes with the dev_* functions.

> 
> Signed-off-by: Kever Yang 
> ---
> 
> drivers/pinctrl/rockchip/pinctrl_rk3036.c | 3 ++-
> drivers/pinctrl/rockchip/pinctrl_rk3188.c | 3 ++-
> drivers/pinctrl/rockchip/pinctrl_rk3288.c | 3 ++-
> drivers/pinctrl/rockchip/pinctrl_rk3328.c | 3 ++-
> drivers/pinctrl/rockchip/pinctrl_rk3399.c | 3 ++-
> drivers/pinctrl/rockchip/pinctrl_rv1108.c | 3 ++-
> 6 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3036.c 
> b/drivers/pinctrl/rockchip/pinctrl_rk3036.c
> index 94f6d7a..9215d6c 100644
> --- a/drivers/pinctrl/rockchip/pinctrl_rk3036.c
> +++ b/drivers/pinctrl/rockchip/pinctrl_rk3036.c
> @@ -193,7 +193,8 @@ static int rk3036_pinctrl_get_periph_id(struct udevice 
> *dev,
>   u32 cell[3];
>   int ret;
> 
> - ret = dev_read_u32_array(periph, "interrupts", cell, ARRAY_SIZE(cell));
> + ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph),
> +"interrupts", cell, ARRAY_SIZE(cell));
>   if (ret < 0)
>   return -EINVAL;
> 
> diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3188.c 
> b/drivers/pinctrl/rockchip/pinctrl_rk3188.c
> index 692d8e2..65c1f66 100644
> --- a/drivers/pinctrl/rockchip/pinctrl_rk3188.c
> +++ b/drivers/pinctrl/rockchip/pinctrl_rk3188.c
> @@ -370,7 +370,8 @@ static int rk3188_pinctrl_get_periph_id(struct udevice 
> *dev,
>   u32 cell[3];
>   int ret;
> 
> - ret = dev_read_u32_array(periph, "interrupts", cell, ARRAY_SIZE(cell));
> + ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph),
> +"interrupts", cell, ARRAY_SIZE(cell));
>   if (ret < 0)
>   return -EINVAL;
> 
> diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3288.c 
> b/drivers/pinctrl/rockchip/pinctrl_rk3288.c
> index 3c9ae97..ab64056 100644
> --- a/drivers/pinctrl/rockchip/pinctrl_rk3288.c
> +++ b/drivers/pinctrl/rockchip/pinctrl_rk3288.c
> @@ -595,7 +595,8 @@ static int rk3288_pinctrl_get_periph_id(struct udevice 
> *dev,
>   u32 cell[3];
>   int ret;
> 
> - ret = dev_read_u32_array(periph, "interrupts", cell, ARRAY_SIZE(cell));
> + ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph),
> +"interrupts", cell, ARRAY_SIZE(cell));
>   if (ret < 0)
>   return -EINVAL;
> 
> diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3328.c 
> b/drivers/pinctrl/rockchip/pinctrl_rk3328.c
> index c74163e..f3e7eec 100644
> --- a/drivers/pinctrl/rockchip/pinctrl_rk3328.c
> +++ b/drivers/pinctrl/rockchip/pinctrl_rk3328.c
> @@ -249,7 +249,8 @@ static int rk3328_pinctrl_get_periph_id(struct udevice 
> *dev,
>   u32 cell[3];
>   int ret;
> 
> - ret = dev_read_u32_array(periph, "interrupts", cell, ARRAY_SIZE(cell));
> + ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph),
> +"interrupts", cell, ARRAY_SIZE(cell));
>   if (ret < 0)
>   return -EINVAL;
> 
> diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3399.c 
> b/drivers/pinctrl/rockchip/pinctrl_rk3399.c
> index cab268c..d93b903 100644
> --- a/drivers/pinctrl/rockchip/pinctrl_rk3399.c
> +++ b/drivers/pinctrl/rockchip/pinctrl_rk3399.c
> @@ -350,7 +350,8 @@ static int rk3399_pinctrl_get_periph_id(struct udevice 
> *dev,
>   u32 cell[3];
>   int ret;
> 
> - ret = dev_read_u32_array(periph, "interrupts", cell, ARRAY_SIZE(cell));
> + ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph),
> +"interrupts", cell, ARRAY_SIZE(cell));
>   if (ret < 0)
>   return -EINVAL;
> 
> diff --git a/drivers/pinctrl/rockchip/pinctrl_rv1108.c 
> b/drivers/pinctrl/rockchip/pinctrl_rv1108.c
> index cda94f4..bdf3910 100644
> --- a/drivers/pinctrl/rockchip/pinctrl_rv1108.c
> +++ b/drivers/pinctrl/rockchip/pinctrl_rv1108.c
> @@ -108,7 +108,8 @@ static int rv1108_pinctrl_get_periph_id(struct udevice 
> *dev,
>   u32 cell[3];
>   int ret;
> 
> - ret = dev_read_u32_array(periph, "interrupts", cell, ARRAY_SIZE(cell));
> + ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph),
> +"interrupts", cell, ARRAY_SIZE(cell));
>   if (ret < 0)
>   return -EINVAL;
> 
> -- 
> 1.9.1
> 

___
U-Boot mailing list
U-Boot@lists.denx.de

[U-Boot] [PATCH] rockchip: pinctrl: use fdtdec_get_int_array() to get interrupt

2017-09-06 Thread Kever Yang
Not all the udevice have a available DT node, eg. rksd...@ff50.blk
which add by mmc_bind(), if we use dev_read_u32_array(), the interface
will use the ofnode directly and end with:
assert(ofnode_valid(node));

Use fdtdec_get_int_array() instead.

Signed-off-by: Kever Yang 
---

 drivers/pinctrl/rockchip/pinctrl_rk3036.c | 3 ++-
 drivers/pinctrl/rockchip/pinctrl_rk3188.c | 3 ++-
 drivers/pinctrl/rockchip/pinctrl_rk3288.c | 3 ++-
 drivers/pinctrl/rockchip/pinctrl_rk3328.c | 3 ++-
 drivers/pinctrl/rockchip/pinctrl_rk3399.c | 3 ++-
 drivers/pinctrl/rockchip/pinctrl_rv1108.c | 3 ++-
 6 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3036.c 
b/drivers/pinctrl/rockchip/pinctrl_rk3036.c
index 94f6d7a..9215d6c 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rk3036.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rk3036.c
@@ -193,7 +193,8 @@ static int rk3036_pinctrl_get_periph_id(struct udevice *dev,
u32 cell[3];
int ret;
 
-   ret = dev_read_u32_array(periph, "interrupts", cell, ARRAY_SIZE(cell));
+   ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph),
+  "interrupts", cell, ARRAY_SIZE(cell));
if (ret < 0)
return -EINVAL;
 
diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3188.c 
b/drivers/pinctrl/rockchip/pinctrl_rk3188.c
index 692d8e2..65c1f66 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rk3188.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rk3188.c
@@ -370,7 +370,8 @@ static int rk3188_pinctrl_get_periph_id(struct udevice *dev,
u32 cell[3];
int ret;
 
-   ret = dev_read_u32_array(periph, "interrupts", cell, ARRAY_SIZE(cell));
+   ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph),
+  "interrupts", cell, ARRAY_SIZE(cell));
if (ret < 0)
return -EINVAL;
 
diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3288.c 
b/drivers/pinctrl/rockchip/pinctrl_rk3288.c
index 3c9ae97..ab64056 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rk3288.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rk3288.c
@@ -595,7 +595,8 @@ static int rk3288_pinctrl_get_periph_id(struct udevice *dev,
u32 cell[3];
int ret;
 
-   ret = dev_read_u32_array(periph, "interrupts", cell, ARRAY_SIZE(cell));
+   ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph),
+  "interrupts", cell, ARRAY_SIZE(cell));
if (ret < 0)
return -EINVAL;
 
diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3328.c 
b/drivers/pinctrl/rockchip/pinctrl_rk3328.c
index c74163e..f3e7eec 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rk3328.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rk3328.c
@@ -249,7 +249,8 @@ static int rk3328_pinctrl_get_periph_id(struct udevice *dev,
u32 cell[3];
int ret;
 
-   ret = dev_read_u32_array(periph, "interrupts", cell, ARRAY_SIZE(cell));
+   ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph),
+  "interrupts", cell, ARRAY_SIZE(cell));
if (ret < 0)
return -EINVAL;
 
diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3399.c 
b/drivers/pinctrl/rockchip/pinctrl_rk3399.c
index cab268c..d93b903 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rk3399.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rk3399.c
@@ -350,7 +350,8 @@ static int rk3399_pinctrl_get_periph_id(struct udevice *dev,
u32 cell[3];
int ret;
 
-   ret = dev_read_u32_array(periph, "interrupts", cell, ARRAY_SIZE(cell));
+   ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph),
+  "interrupts", cell, ARRAY_SIZE(cell));
if (ret < 0)
return -EINVAL;
 
diff --git a/drivers/pinctrl/rockchip/pinctrl_rv1108.c 
b/drivers/pinctrl/rockchip/pinctrl_rv1108.c
index cda94f4..bdf3910 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rv1108.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rv1108.c
@@ -108,7 +108,8 @@ static int rv1108_pinctrl_get_periph_id(struct udevice *dev,
u32 cell[3];
int ret;
 
-   ret = dev_read_u32_array(periph, "interrupts", cell, ARRAY_SIZE(cell));
+   ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph),
+  "interrupts", cell, ARRAY_SIZE(cell));
if (ret < 0)
return -EINVAL;
 
-- 
1.9.1

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


[U-Boot] [PATCH] rockchip: rk3328: fix syscon id table

2017-09-06 Thread Kever Yang
syscon id table need a dummy member as NULL ending, or else system
will panic while try to match a compatible in this table as a list.

Signed-off-by: Kever Yang 
---

 arch/arm/mach-rockchip/rk3328/syscon_rk3328.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-rockchip/rk3328/syscon_rk3328.c 
b/arch/arm/mach-rockchip/rk3328/syscon_rk3328.c
index a1a368f..9a2c88d 100644
--- a/arch/arm/mach-rockchip/rk3328/syscon_rk3328.c
+++ b/arch/arm/mach-rockchip/rk3328/syscon_rk3328.c
@@ -11,6 +11,7 @@
 
 static const struct udevice_id rk3328_syscon_ids[] = {
{ .compatible = "rockchip,rk3328-grf", .data = ROCKCHIP_SYSCON_GRF },
+   { }
 };
 
 U_BOOT_DRIVER(syscon_rk3328) = {
-- 
1.9.1

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


[U-Boot] [PATCH] Revert "dm: arm: rpi: Drop CONFIG_OF_EMBED"

2017-09-06 Thread Paul Barker
This reverts commit 25877d4e4c45451c5398aec3de50e0d5befe0e9f.

This is a workaround for Raspberry Pi boot failures seen when passing on
the device tree provided by the Raspberry Pi firmware at boot. Without
CONFIG_OF_EMBED, we just get stuck at "Starting kernel ..." when we try
to boot Linux with this device tree.

Signed-off-by: Paul Barker 
Cc: Simon Glass 
---
 configs/rpi_2_defconfig | 1 +
 configs/rpi_3_32b_defconfig | 1 +
 configs/rpi_3_defconfig | 1 +
 configs/rpi_defconfig   | 1 +
 4 files changed, 4 insertions(+)

diff --git a/configs/rpi_2_defconfig b/configs/rpi_2_defconfig
index 10e83186c1..848aeb73aa 100644
--- a/configs/rpi_2_defconfig
+++ b/configs/rpi_2_defconfig
@@ -16,6 +16,7 @@ CONFIG_CMD_USB=y
 CONFIG_ENV_FAT_INTERFACE="mmc"
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_DM_KEYBOARD=y
+CONFIG_OF_EMBED=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_BCM2835=y
diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig
index d35a639630..196b619bb7 100644
--- a/configs/rpi_3_32b_defconfig
+++ b/configs/rpi_3_32b_defconfig
@@ -17,6 +17,7 @@ CONFIG_CMD_USB=y
 CONFIG_ENV_FAT_INTERFACE="mmc"
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_DM_KEYBOARD=y
+CONFIG_OF_EMBED=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_BCM2835=y
diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig
index 095a076249..f23c1e7b18 100644
--- a/configs/rpi_3_defconfig
+++ b/configs/rpi_3_defconfig
@@ -17,6 +17,7 @@ CONFIG_CMD_USB=y
 CONFIG_ENV_FAT_INTERFACE="mmc"
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_DM_KEYBOARD=y
+CONFIG_OF_EMBED=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_BCM2835=y
diff --git a/configs/rpi_defconfig b/configs/rpi_defconfig
index 9dfdad5c1d..939870637a 100644
--- a/configs/rpi_defconfig
+++ b/configs/rpi_defconfig
@@ -16,6 +16,7 @@ CONFIG_CMD_USB=y
 CONFIG_ENV_FAT_INTERFACE="mmc"
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_DM_KEYBOARD=y
+CONFIG_OF_EMBED=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_BCM2835=y
-- 
2.11.0

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


[U-Boot] [PATCH v3 4/4] cmd: ide: Make the first device the default one

2017-09-06 Thread Bin Meng
At present the IDE device number is initialized to -1, which means
we cannot type "ide read" command before setting the device number
via "ide device #".

For convenience, let's set the first device as the default one.

Signed-off-by: Bin Meng 
Reviewed-by: Simon Glass 

---

Changes in v3: None
Changes in v2: None

 cmd/ide.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/ide.c b/cmd/ide.c
index e3c3242..bdb5980 100644
--- a/cmd/ide.c
+++ b/cmd/ide.c
@@ -30,7 +30,7 @@
 #endif
 
 /* Current I/O Device  */
-static int curr_device = -1;
+static int curr_device;
 
 int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
-- 
2.9.2

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


[U-Boot] [PATCH v3 3/4] block: ide: Don't bother to create BLK device if no CDROM inserted

2017-09-06 Thread Bin Meng
When there is no CDROM inserted, the block size is zero hence there
is no need to create a BLK device for it.

Signed-off-by: Bin Meng 
Reviewed-by: Simon Glass 
---

Changes in v3: None
Changes in v2: None

 drivers/block/ide.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/block/ide.c b/drivers/block/ide.c
index 1b5476e..0631fae 100644
--- a/drivers/block/ide.c
+++ b/drivers/block/ide.c
@@ -1199,6 +1199,13 @@ static int ide_probe(struct udevice *udev)
 
blksz = ide_dev_desc[i].blksz;
size = blksz * ide_dev_desc[i].lba;
+
+   /*
+* With CDROM, if there is no CD inserted, blksz will
+* be zero, don't bother to create IDE block device.
+*/
+   if (!blksz)
+   continue;
ret = blk_create_devicef(udev, "ide_blk", name,
 IF_TYPE_IDE, i,
 blksz, size, _dev);
-- 
2.9.2

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


[U-Boot] [PATCH v3 2/4] block: ide: Fix block read/write with driver model

2017-09-06 Thread Bin Meng
This converts the IDE driver to driver model so that block read and
write are fully functional.

Fixes: b7c6baef ("x86: Convert MMC to driver model")
Reported-by: Heinrich Schuchardt 
Signed-off-by: Bin Meng 

Reviewed-by: Simon Glass 
Tested-by: Heinrich Schuchardt 
---

Changes in v3:
- Updated BLK_XXX_SIZE usage

Changes in v2:
- Fixed 'fatls ide 0' issue

 drivers/block/blk-uclass.c |  2 +-
 drivers/block/ide.c| 70 ++
 include/dm/uclass-id.h |  1 +
 3 files changed, 72 insertions(+), 1 deletion(-)

diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c
index e5f00dc..8e58580 100644
--- a/drivers/block/blk-uclass.c
+++ b/drivers/block/blk-uclass.c
@@ -26,7 +26,7 @@ static const char *if_typename_str[IF_TYPE_COUNT] = {
 };
 
 static enum uclass_id if_type_uclass_id[IF_TYPE_COUNT] = {
-   [IF_TYPE_IDE]   = UCLASS_INVALID,
+   [IF_TYPE_IDE]   = UCLASS_IDE,
[IF_TYPE_SCSI]  = UCLASS_SCSI,
[IF_TYPE_ATAPI] = UCLASS_INVALID,
[IF_TYPE_USB]   = UCLASS_MASS_STORAGE,
diff --git a/drivers/block/ide.c b/drivers/block/ide.c
index ce51153..1b5476e 100644
--- a/drivers/block/ide.c
+++ b/drivers/block/ide.c
@@ -827,12 +827,20 @@ void ide_init(void)
ide_ident(_dev_desc[i]);
dev_print(_dev_desc[i]);
 
+#ifndef CONFIG_BLK
if ((ide_dev_desc[i].lba > 0) && (ide_dev_desc[i].blksz > 0)) {
/* initialize partition type */
part_init(_dev_desc[i]);
}
+#endif
}
WATCHDOG_RESET();
+
+#ifdef CONFIG_BLK
+   struct udevice *dev;
+
+   uclass_first_device(UCLASS_IDE, );
+#endif
 }
 
 /* We only need to swap data if we are running on a big endian cpu. */
@@ -1147,6 +1155,23 @@ int ide_device_present(int dev)
 #endif
 
 #ifdef CONFIG_BLK
+static int ide_blk_probe(struct udevice *udev)
+{
+   struct blk_desc *desc = dev_get_uclass_platdata(udev);
+
+   /* fill in device vendor/product/rev strings */
+   strncpy(desc->vendor, ide_dev_desc[desc->devnum].vendor,
+   BLK_VEN_SIZE + 1);
+   strncpy(desc->product, ide_dev_desc[desc->devnum].product,
+   BLK_PRD_SIZE + 1);
+   strncpy(desc->revision, ide_dev_desc[desc->devnum].revision,
+   BLK_REV_SIZE + 1);
+
+   part_init(desc);
+
+   return 0;
+}
+
 static const struct blk_ops ide_blk_ops = {
.read   = ide_read,
.write  = ide_write,
@@ -1156,6 +1181,51 @@ U_BOOT_DRIVER(ide_blk) = {
.name   = "ide_blk",
.id = UCLASS_BLK,
.ops= _blk_ops,
+   .probe  = ide_blk_probe,
+};
+
+static int ide_probe(struct udevice *udev)
+{
+   struct udevice *blk_dev;
+   char name[20];
+   int blksz;
+   lbaint_t size;
+   int i;
+   int ret;
+
+   for (i = 0; i < CONFIG_SYS_IDE_MAXDEVICE; i++) {
+   if (ide_dev_desc[i].type != DEV_TYPE_UNKNOWN) {
+   sprintf(name, "blk#%d", i);
+
+   blksz = ide_dev_desc[i].blksz;
+   size = blksz * ide_dev_desc[i].lba;
+   ret = blk_create_devicef(udev, "ide_blk", name,
+IF_TYPE_IDE, i,
+blksz, size, _dev);
+   if (ret)
+   return ret;
+   }
+   }
+
+   return 0;
+}
+
+U_BOOT_DRIVER(ide) = {
+   .name   = "ide",
+   .id = UCLASS_IDE,
+   .probe  = ide_probe,
+};
+
+struct pci_device_id ide_supported[] = {
+   { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_IDE << 8, 0x00) },
+   { }
+};
+
+U_BOOT_PCI_DEVICE(ide, ide_supported);
+
+UCLASS_DRIVER(ide) = {
+   .name   = "ide",
+   .id = UCLASS_IDE,
 };
 #else
 U_BOOT_LEGACY_BLK(ide) = {
diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h
index 1a50199..3fc2083 100644
--- a/include/dm/uclass-id.h
+++ b/include/dm/uclass-id.h
@@ -41,6 +41,7 @@ enum uclass_id {
UCLASS_I2C_EEPROM,  /* I2C EEPROM device */
UCLASS_I2C_GENERIC, /* Generic I2C device */
UCLASS_I2C_MUX, /* I2C multiplexer */
+   UCLASS_IDE, /* IDE device */
UCLASS_IRQ, /* Interrupt controller */
UCLASS_KEYBOARD,/* Keyboard input device */
UCLASS_LED, /* Light-emitting diode (LED) */
-- 
2.9.2

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


[U-Boot] [PATCH v3 1/4] blk: Use macros for block device vendor/product/rev string size

2017-09-06 Thread Bin Meng
So far these are using magic numbers. Replace them with macros.

Signed-off-by: Bin Meng 
Reviewed-by: Simon Glass 

---

Changes in v3:
- Change BLK_XXX_SIZE to not count the ending NULL

Changes in v2: None

 include/blk.h | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/include/blk.h b/include/blk.h
index a106f9c..27abfdd 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -36,6 +36,10 @@ enum if_type {
IF_TYPE_COUNT,  /* Number of interface types */
 };
 
+#define BLK_VEN_SIZE   40
+#define BLK_PRD_SIZE   20
+#define BLK_REV_SIZE   8
+
 /*
  * With driver model (CONFIG_BLK) this is uclass platform data, accessible
  * with dev_get_uclass_platdata(dev)
@@ -60,9 +64,9 @@ struct blk_desc {
lbaint_tlba;/* number of blocks */
unsigned long   blksz;  /* block size */
int log2blksz;  /* for convenience: log2(blksz) */
-   charvendor[40+1];   /* IDE model, SCSI Vendor */
-   charproduct[20+1];  /* IDE Serial no, SCSI product */
-   charrevision[8+1];  /* firmware revision */
+   charvendor[BLK_VEN_SIZE + 1]; /* device vendor string */
+   charproduct[BLK_PRD_SIZE + 1]; /* device product number */
+   charrevision[BLK_REV_SIZE + 1]; /* firmware revision */
 #if CONFIG_IS_ENABLED(BLK)
/*
 * For now we have a few functions which take struct blk_desc as a
-- 
2.9.2

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


Re: [U-Boot] [PATCH 03/19] arm: socfpga: Add driver for flash to program FPGA

2017-09-06 Thread Chee, Tien Fong
On Rab, 2017-09-06 at 09:10 +0200, Marek Vasut wrote:
> On 09/06/2017 07:06 AM, Chee, Tien Fong wrote:
> [...]
> > 
> > > 
> > > > 
> > > > > 
> > > > > > 
> > > > > > The BSP tool is used to describe internal FPGA in SOCFPGA.
> > > > > > Other
> > > > > > external FPGAs other than SOCFPGA itself, it can be
> > > > > > programmed
> > > > > > through
> > > > > > U-boot.
> > > > > The BSP tool is broken if it generates broken DT, do I have
> > > > > to
> > > > > repeat
> > > > > myself ?
> > > > > 
> > > > BSP tool is only generate the RBF filename for FPGA inside
> > > > SOCFPGA.
> > > > Multiple external FPGA are configured through U-boot.
> > > What happens if you have FPGA connector over SPI ?
> > > 
> > I assume you are saying FPGA connected to EPCQ
> No, I mean FPGA connected over SPI bus.
> 
> > 
> > , and this is one of the
> > external FPGA configuration, like PCIE. For any external FPGA
> > configuration, FPGA itself/external HOST would get the FPGA data
> > from
> > storage such as EPCQ and configuring the FPGA without
> > HPS/Bootloader
> > intervine. SPL/U-boot would skip the FPGA configuration process
> > when
> > they see the mode is set to external FPGA configuration.
> > 
> > I know you want a DT to describe all FPGAs with FPGA node and their
> > own
> > data filename in every node. But, at this moment, all external
> > FPGAs
> > chip other than SOCFPGA itself are configured through U-boot(script 
> > &
> > env variable), or external FPGA configuration method.
> I want DT which describes hardware and is not misdesigned crap.
> Just because the BSP tool is broken does not mean I can allow
> upstream
> to accept that, no way.
> 
> > 
> > How about i just create a FPGA node for SOCFPGA, with FPGA data
> > filename within the node?
> Isn't that what the FPGA manager in mainline Linux does already ?
> 
Yeah, i will port from Linux DTS, and filenames added into the node.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 03/19] arm: socfpga: Add driver for flash to program FPGA

2017-09-06 Thread Marek Vasut
On 09/06/2017 07:06 AM, Chee, Tien Fong wrote:
[...]
> The BSP tool is used to describe internal FPGA in SOCFPGA.
> Other
> external FPGAs other than SOCFPGA itself, it can be programmed
> through
> U-boot.
 The BSP tool is broken if it generates broken DT, do I have to
 repeat
 myself ?

>>> BSP tool is only generate the RBF filename for FPGA inside SOCFPGA.
>>> Multiple external FPGA are configured through U-boot.
>> What happens if you have FPGA connector over SPI ?
>>
> I assume you are saying FPGA connected to EPCQ

No, I mean FPGA connected over SPI bus.

>, and this is one of the
> external FPGA configuration, like PCIE. For any external FPGA
> configuration, FPGA itself/external HOST would get the FPGA data from
> storage such as EPCQ and configuring the FPGA without HPS/Bootloader
> intervine. SPL/U-boot would skip the FPGA configuration process when
> they see the mode is set to external FPGA configuration.
> 
> I know you want a DT to describe all FPGAs with FPGA node and their own
> data filename in every node. But, at this moment, all external FPGAs
> chip other than SOCFPGA itself are configured through U-boot(script &
> env variable), or external FPGA configuration method.

I want DT which describes hardware and is not misdesigned crap.
Just because the BSP tool is broken does not mean I can allow upstream
to accept that, no way.

> How about i just create a FPGA node for SOCFPGA, with FPGA data
> filename within the node?

Isn't that what the FPGA manager in mainline Linux does already ?

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


Re: [U-Boot] [ANN] U-Boot v2017.09-rc4 released

2017-09-06 Thread Paul Barker
On Tue, Sep 5, 2017 at 11:11 PM, Tuomas Tynkkynen
 wrote:
> Hi,
>
> On 09/04/2017 10:55 PM, Paul Barker wrote:
>>
>>
>> I looks like u-boot v2017.09-rc4 is still unable to boot Linux on
>> Raspberry Pi devices. I've just tested this now on a Raspberry Pi
>> (original Model B) and confirmed that it gets stuck at "Starting
>> kernel ...".
>
>
> FWIW, works for me. I think you need to be more specific since there are
> huge number of variables related to running Linux on the RPi. My
> configuration is:
>
> - Device is Raspberry Pi Model B (512M RAM)
> - Firmware is tagged 1.20170811
> - U-Boot v2017.09-rc4
> - The Foundation/Raspbian kernel tagged 1.20170811, based on 4.9.41. The
> kernel is self-built. Or well, built by the package manager in NixOS but I
> am the maintainer of the RPi kernel package there.
> - As for the device tree, I am letting U-Boot load bcm2708-rpi-b.dtb built
> by the Foundation/Raspbian kernel from disk (i.e. firmware is not
> involved with the device tree at all)

I think this is the difference. We're passing $fdt_addr through to
Linux. This is set to the saved fw_dtb_pointer which is the address
the firmware passed into u-boot at start up by the code in
board/raspberrypi/rpi/.

> - The framebuffer, USB, keyboard & Ethernet work in Linux. I have never
> tested the other peripherals (or GPU acceleration).
>
> My setup has been unchanged (except for routine package upgrades of the
> firmware, kernel & U-Boot obviously) since July 2016. That's when the
> Foundation/Raspbian kernel started requiring a device tree.

Thanks,

-- 
Paul Barker
Togán Labs Ltd
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] Antwort: Re: QSPI "sf probe ...", "sf read ..." on Altera SoC FPGA

2017-09-06 Thread Hannes Schmelzer

Hi Jagan,


On 09/04/2017 08:22 AM, Hannes Schmelzer wrote:

"U-Boot"  schrieb am 01.09.2017 16:39:03:
 wrote:

Hi Eldor,

just found your post in the mailinglist.

https://lists.denx.de/pipermail/u-boot/2016-December/276491.html

Reason why i'm searched there is, that i've now excactly same problem

as

you.

Can you give some details, issue came-up while 'sf probe' or 'sf read' ?

Hi Jagan,
please have a look into the weblink to the denx mailing list server.
I have basically same trouble as eldor reported the days ago.

A simple 'sf probe' ends up in a
### ERROR ### Please RESET the board ###
Interesting detail is, that the information about the flash (type, size,
...) is printed out quite before the "hang".

On wednesday i have the next time-slot to access the socfpga devkit board.
So i could bring in more details if necessary.

as told few days ago, i've now again access to my socfpga devkit board.
Here comes the console output:

---
U-Boot SPL 2017.09-rc4-00023-g84a4206 (Sep 06 2017 - 08:02:35)
/home/schmelzerh/work/u-boot/drivers/ddr/altera/sequencer.c: Preparing 
to start memory calibration
/home/schmelzerh/work/u-boot/drivers/ddr/altera/sequencer.c: CALIBRATION 
PASSED
/home/schmelzerh/work/u-boot/drivers/ddr/altera/sequencer.c: Calibration 
complete

Trying to boot from MMC1
spl: partition error


U-Boot 2017.09-rc4-00023-g84a4206 (Sep 06 2017 - 08:02:35 +0200)

CPU:   Altera SoCFPGA Platform
FPGA:  Altera Cyclone V, SE/A6 or SX/C6 or ST/D6, version 0x0
BOOT:  SD/MMC Internal Transceiver (3.0V)
   Watchdog enabled
I2C:   ready
DRAM:  1 GiB
MMC:   dwmmc0@ff704000: 0
*** Warning - bad CRC, using default environment

In:serial
Out:   serial
Err:   serial
Model: Altera SOCFPGA Cyclone V SoC Development Kit
Net:
Error: ethernet@ff702000 address not set.
No ethernet found.
Hit any key to stop autoboot:  0
=> sf probe
SF: Detected n25q512 with page size 256 Bytes, erase size 64 KiB, total 
64 MiB

### ERROR ### Please RESET the board ###


Afterwards the board does some reset (about 20sec. later).

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