[U-Boot] [PATCH V4 12/19] i2c: lpi2c: add lpi2c driver for i.MX7ULP

2017-02-23 Thread Peng Fan
Add lpi2c driver for i.MX7ULP.
Need to enable the two options to use this driver:
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_IMX_LPI2C=y

Signed-off-by: Peng Fan 
Acked-by: Heiko Schocher 
Cc: Stefano Babic 
---

I do not repost the whole patch set, only post the single lpi2c patch
in V4. Other patches are still valid in V3.

V4:
 Use SYS_I2C_IMX_LPI2C as the Kconfig entry
 Add Ack tag
V3:
 none
V2:
 none

 arch/arm/include/asm/arch-mx7ulp/imx_lpi2c.h | 520 +++
 drivers/i2c/Kconfig  |   6 +
 drivers/i2c/Makefile |   1 +
 drivers/i2c/imx_lpi2c.c  | 462 
 4 files changed, 989 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-mx7ulp/imx_lpi2c.h
 create mode 100644 drivers/i2c/imx_lpi2c.c

diff --git a/arch/arm/include/asm/arch-mx7ulp/imx_lpi2c.h 
b/arch/arm/include/asm/arch-mx7ulp/imx_lpi2c.h
new file mode 100644
index 000..f1b3113
--- /dev/null
+++ b/arch/arm/include/asm/arch-mx7ulp/imx_lpi2c.h
@@ -0,0 +1,520 @@
+/*
+ * Copyright 2016 Freescale Semiconductors, Inc.
+ *
+ * I2CLP driver for i.MX
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ *
+ */
+#ifndef __IMX_LPI2C_H__
+#define __IMX_LPI2C_H__
+
+struct imx_lpi2c_bus {
+   int index;
+   ulong base;
+   ulong driver_data;
+   int speed;
+   struct i2c_pads_info *pads_info;
+   struct udevice *bus;
+};
+
+struct imx_lpi2c_reg {
+   u32 verid;
+   u32 param;
+   u8  reserved_0[8];
+   u32 mcr;
+   u32 msr;
+   u32 mier;
+   u32 mder;
+   u32 mcfgr0;
+   u32 mcfgr1;
+   u32 mcfgr2;
+   u32 mcfgr3;
+   u8  reserved_1[16];
+   u32 mdmr;
+   u8  reserved_2[4];
+   u32 mccr0;
+   u8  reserved_3[4];
+   u32 mccr1;
+   u8  reserved_4[4];
+   u32 mfcr;
+   u32 mfsr;
+   u32 mtdr;
+   u8  reserved_5[12];
+   u32 mrdr;
+   u8  reserved_6[156];
+   u32 scr;
+   u32 ssr;
+   u32 sier;
+   u32 sder;
+   u8  reserved_7[4];
+   u32 scfgr1;
+   u32 scfgr2;
+   u8  reserved_8[20];
+   u32 samr;
+   u8  reserved_9[12];
+   u32 sasr;
+   u32 star;
+   u8  reserved_10[8];
+   u32 stdr;
+   u8  reserved_11[12];
+   u32 srdr;
+};
+
+typedef enum lpi2c_status {
+   LPI2C_SUCESS = 0,
+   LPI2C_END_PACKET_ERR,
+   LPI2C_STOP_ERR,
+   LPI2C_NAK_ERR,
+   LPI2C_ARB_LOST_ERR,
+   LPI2C_FIFO_ERR,
+   LPI2C_PIN_LOW_TIMEOUT_ERR,
+   LPI2C_DATA_MATCH_ERR,
+   LPI2C_BUSY,
+   LPI2C_IDLE,
+   LPI2C_BIT_ERR,
+   LPI2C_NO_TRANS_PROG,
+   LPI2C_DMA_REQ_FAIL,
+} lpi2c_status_t;
+
+/* 
+   -- LPI2C Register Masks
+   
 */
+
+/*!
+ * @addtogroup LPI2C_Register_Masks LPI2C Register Masks
+ * @{
+ */
+
+/*! @name VERID - Version ID Register */
+#define LPI2C_VERID_FEATURE_MASK (0xU)
+#define LPI2C_VERID_FEATURE_SHIFT(0U)
+#define LPI2C_VERID_FEATURE(x)   (((uint32_t)(((uint32_t)(x)) 
<< LPI2C_VERID_FEATURE_SHIFT)) & LPI2C_VERID_FEATURE_MASK)
+#define LPI2C_VERID_MINOR_MASK   (0xFFU)
+#define LPI2C_VERID_MINOR_SHIFT  (16U)
+#define LPI2C_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) 
<< LPI2C_VERID_MINOR_SHIFT)) & LPI2C_VERID_MINOR_MASK)
+#define LPI2C_VERID_MAJOR_MASK   (0xFF00U)
+#define LPI2C_VERID_MAJOR_SHIFT  (24U)
+#define LPI2C_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) 
<< LPI2C_VERID_MAJOR_SHIFT)) & LPI2C_VERID_MAJOR_MASK)
+
+/*! @name PARAM - Parameter Register */
+#define LPI2C_PARAM_MTXFIFO_MASK (0xFU)
+#define LPI2C_PARAM_MTXFIFO_SHIFT(0U)
+#define LPI2C_PARAM_MTXFIFO(x)   (((uint32_t)(((uint32_t)(x)) 
<< LPI2C_PARAM_MTXFIFO_SHIFT)) & LPI2C_PARAM_MTXFIFO_MASK)
+#define LPI2C_PARAM_MRXFIFO_MASK (0xF00U)
+#define LPI2C_PARAM_MRXFIFO_SHIFT(8U)
+#define LPI2C_PARAM_MRXFIFO(x)   (((uint32_t)(((uint32_t)(x)) 
<< LPI2C_PARAM_MRXFIFO_SHIFT)) & LPI2C_PARAM_MRXFIFO_MASK)
+
+/*! @name MCR - Master Control Register */
+#define LPI2C_MCR_MEN_MASK   (0x1U)
+#define LPI2C_MCR_MEN_SHIFT  (0U)
+#define LPI2C_MCR_MEN(x) (((uint32_t)(((uint32_t)(x)) 
<< LPI2C_MCR_MEN_SHIFT)) & LPI2C_MCR_MEN_MASK)
+#define LPI2C_MCR_RST_MASK   (0x2U)
+#define LPI2C_MCR_RST_SHIFT  (1U)
+#define LPI2C_MCR_RST(x) (((uint32_t)(((uint32_t)(x)) 
<< LPI2C_MCR_RST_SHIFT)) & LPI2C_MCR_RST_MASK)
+#define LPI2C_MCR_DOZEN_MASK (0x4U)
+#define LPI2C_MCR_DOZEN_SHIFT(2U)

Re: [U-Boot] [PATCH v3 7/7] rockchip: rk3288: add defconfig for evb-rk3328

2017-02-23 Thread Kever Yang

Hi Simon,

There is a typo on the subject of this patch, it should be rk3328 
instead

of rk3288 :(
Sorry for that, are you able to fix it in your tree?

Thanks,
- Kever
On 02/24/2017 12:20 AM, Simon Glass wrote:

On 23 February 2017 at 00:37, Kever Yang  wrote:

Enable board config for evb-rk3328.
SDcard and eMMC boot is OK in this initial version,
USB and EMAC function is not available now, will comes later.

Signed-off-by: William Zhang 
Signed-off-by: Kever Yang 
Acked-by: Simon Glass 
---

Changes in v3: None
Changes in v2: None

  configs/evb-rk3328_defconfig | 36 
  1 file changed, 36 insertions(+)
  create mode 100644 configs/evb-rk3328_defconfig

Applied to u-boot-rockchip, thanks!






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


Re: [U-Boot] [PATCH] rockchip: video: fix mpixelclock in rockchip HDMI

2017-02-23 Thread Simon Glass
Hi Nickey,

On 22 February 2017 at 23:56, Nickey.Yang  wrote:
> Hi Simon,
>
>
>
> 在 2017年02月23日 11:52, Simon Glass 写道:
>>
>> Hi,
>>
>> On 11 January 2017 at 22:08, Simon Glass  wrote:
>>>
>>> On 28 December 2016 at 23:01, Nickey Yang 
>>> wrote:

 Correct mpixelclock errors in rockchip_phy_config[] and
 rockchip_mpll_cfg[].

 Signed-off-by: Nickey Yang 
 ---
   drivers/video/rockchip/rk_hdmi.c | 20 ++--
   1 file changed, 10 insertions(+), 10 deletions(-)
>>>
>>> Applied to u-boot-rockchip, thanks!
>>
>> I only just noticed, but this patch breaks HDMI output on firefly. Can
>> you please take a look? What does this patch actually fix?
>>
>> Regards,
>> Simon
>>
>  You can add
>
> printf("---YYS  mpll.cpce = %x \n",rockchip_mpll_cfg[i].cpce);
> printf("---YYS  mpll.gmp = %x \n",rockchip_mpll_cfg[i].gmp);
> printf("---YYS  mpll.curr = %x \n",rockchip_mpll_cfg[i].curr);
>
> in  hdmi_phy_configure(rk_hdmi.c   line 409), all of those value will be 0
> without this patch.
> We want to get those different value by near clock settings between
> rockchip_mpll_cfg[] in fact.

Yes it makes sense

>
> by the way,HDMI output on firefly will work well when reset this patch?

Yes it works when I revert.

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


Re: [U-Boot] [PATCH v3 2/4] dts: rk3399: update for spl require driver

2017-02-23 Thread Simon Glass
On 22 February 2017 at 01:56, Kever Yang  wrote:
> Add syscon and dmc node, and 'u-boot,dm-pre-reloc' option for
> required driver.
>
> Signed-off-by: Kever Yang 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v3: None
> Changes in v2: None
> Changes in v1: None
>
>  arch/arm/dts/rk3399-evb.dts |  2 ++
>  arch/arm/dts/rk3399.dtsi| 44 
>  2 files changed, 46 insertions(+)

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] rockchip: arm64: rk3399: add SPL support

2017-02-23 Thread Simon Glass
On 23 February 2017 at 01:09, Kever Yang  wrote:
> Add SPL support for rk3399, default with of-platdata enabled.
>
> Signed-off-by: Kever Yang 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v4:
> - move SPL_SEPARATE_BSS to RK3399
>
> Changes in v2:
> - split SPL patch into 4 patches
>
>  arch/arm/mach-rockchip/Kconfig|   3 +
>  arch/arm/mach-rockchip/Makefile   |   1 +
>  arch/arm/mach-rockchip/rk3399-board-spl.c | 158 
> ++
>  include/configs/rk3399_common.h   |   6 ++
>  4 files changed, 168 insertions(+)
>  create mode 100644 arch/arm/mach-rockchip/rk3399-board-spl.c

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 3/4] arm64: rk3399: add SPL support

2017-02-23 Thread Simon Glass
On 22 February 2017 at 01:56, Kever Yang  wrote:
> Add SPL support for rk3399, default with of-platdata enabled.
>
> Signed-off-by: Kever Yang 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v3: None
> Changes in v2:
> - split SPL patch into 4 patches
>
> Changes in v1: None
>
>  arch/arm/Kconfig  |   1 +
>  arch/arm/mach-rockchip/Kconfig|   2 +
>  arch/arm/mach-rockchip/Makefile   |   1 +
>  arch/arm/mach-rockchip/rk3399-board-spl.c | 158 
> ++
>  include/configs/rk3399_common.h   |   6 ++
>  5 files changed, 168 insertions(+)
>  create mode 100644 arch/arm/mach-rockchip/rk3399-board-spl.c

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/4] arm64: rk3399: add ddr controller driver

2017-02-23 Thread Simon Glass
On 22 February 2017 at 20:35, Simon Glass  wrote:
> On 22 February 2017 at 01:56, Kever Yang  wrote:
>> RK3399 support DDR3, LPDDR3, DDR4 sdram, this patch is porting from
>> coreboot, support 4GB lpddr3 in this version.
>>
>> Signed-off-by: Kever Yang 
>> ---
>>
>> Changes in v3:
>> - enable driver without of-platdata
>> - add binding file for sdram driver
>> - some fix base on Simon's comment.
>>
>> Changes in v2:
>> - use lower-case hex for input dts data
>> - using rk3288 like style to encode/decode sys_reg
>> - gather some parameters as base params in rk3399_sdram_params
>> - add some missing comment
>>
>> Changes in v1:
>> - use dts for parameter
>> - get all controller base address from dts instead of hard code
>> - gather all controller into dram_info instead of separate global
>>   variables.
>> - add return value for error case
>>
>>  arch/arm/dts/rk3399-sdram-lpddr3-4GB-1600.dtsi | 1536 
>> 
>>  arch/arm/include/asm/arch-rockchip/sdram_rk3399.h  |  119 ++
>>  arch/arm/mach-rockchip/rk3399/Makefile |1 +
>>  arch/arm/mach-rockchip/rk3399/rk3399.c |1 +
>>  arch/arm/mach-rockchip/rk3399/sdram_rk3399.c   | 1321 +
>>  .../clock/rockchip,rk3399-dmc.txt  |   42 +
>>  6 files changed, 3020 insertions(+)
>>  create mode 100644 arch/arm/dts/rk3399-sdram-lpddr3-4GB-1600.dtsi
>>  create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_rk3399.h
>>  create mode 100644 arch/arm/mach-rockchip/rk3399/sdram_rk3399.c
>>  create mode 100644 doc/device-tree-bindings/clock/rockchip,rk3399-dmc.txt
>
> Acked-by: Simon Glass 

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] rockchip: firefly: configs: add a new config to keep non-of-platdata

2017-02-23 Thread Simon Glass
Hi Jacob,

On 22 February 2017 at 23:36, Jacob Chen  wrote:
> Hi Simon,
>
>
> 2017-02-22 11:59 GMT+08:00 Simon Glass :
>> Hi Jacob,
>>
>> On 20 February 2017 at 03:26, Jacob Chen  wrote:
>>> The firefly config have been changed to use SPL_BACK_TO_BROM, but we also 
>>> want keep
>>> CONFIG_SPL_OF_PLATDATA as an example.
>>>
>>> So add this separate defconfig to show how both way works.
>>>
>>> Signed-off-by: Jacob Chen 
>>> ---
>>>
>>>  configs/firefly-nodtb-rk3288_defconfig | 78 
>>> ++
>>>  1 file changed, 78 insertions(+)
>>>  create mode 100644 configs/firefly-nodtb-rk3288_defconfig
>>
>> Thanks for this - can you also please add a MAINTAINERS file?
>>
>> Regards,
>> Simon
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>
> Could i just append a line to "board/firefly/firefly-rk3288/MAINTAINERS"?

Yes that should work. The objective is to not get an error from
buildman about a missing maintainer.

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


Re: [U-Boot] [PATCH] rockchip: firefly: configs: remove config_spl_of_platdata

2017-02-23 Thread Simon Glass
On 22 February 2017 at 20:35, Simon Glass  wrote:
> On 20 February 2017 at 03:28, Jacob Chen  wrote:
>> Hi,
>>
>> 2017-02-17 4:44 GMT+08:00 Simon Glass :
>>> Hi,
>>>
>>> On 14 February 2017 at 23:41, Jacob Chen  wrote:
 Hi Kever,


 Kever Yang wrote on 2017年02月15日 14:13:
>
> Hi Jacob,
>
> On 02/15/2017 11:06 AM, Jacob Chen wrote:
>>
>> We should remove config_spl_of_platdata to build u-boot-spl-dtb.bin
>> rather than u-boot-spl-nodtb.bin
>> since we use spl_back_to_brom.
>
>
> Have you try with CONFIG_SPL_OF_PLATDATA on and without SPL_BACK_TO_BROM?
>
> If this works on firefly, then we can still leave it as an example to show
> how both way works.
>

 Firefly had been using CONFIG_SPL_OF_PLATDATA and it works well.
 Just it will make trouble for other things to generate the u-boot blob,
 like yocto, sdk build scripts, guides...

 At first, I also want to keep  CONFIG_SPL_OF_PLATDATA in firefly, but later
 I find that i have to do a lot of unnecessary work to deal with it,
 so now I would like one chip use one way to generate the u-boot blob.
>>>
>>> How about having a separate board config like firefly-rk3288-dt so
>>> that we keep the non-of-platdata alive? It only needs a separate
>>> defconfig, which is pretty esay.
>>>
>>> Regards,
>>> Simon
>>> ___
>>> U-Boot mailing list
>>> U-Boot@lists.denx.de
>>> http://lists.denx.de/mailman/listinfo/u-boot
>>
>>
>> I send a  patch "rockchip: firefly: configs: add a new config to keep
>> non-of-platdata" to save old config.
>
> OK thanks.
>
> Acked-by: Simon Glass 

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 00/20] rk3188 uboot support

2017-02-23 Thread Simon Glass
Hi Heiko,

On 22 February 2017 at 20:59, Heiko Stuebner  wrote:
> Am Mittwoch, 22. Februar 2017, 20:26:18 CET schrieb Simon Glass:
>> Hi Heiko,
>>
>> On 18 February 2017 at 11:46, Heiko Stuebner  wrote:
>> > Hi,
>> >
>> > thanks to Kever finding the needle in the haystack (wrong resets
>> > in sdram driver actually resetting the sdmmc controller) the rk3188
>> > can now actually load uboot into memory from spl ... yay .
>> >
>> > So this v4 does hopefully addresses all last review comments from
>> > Simon and includes of course the newly received tags so far.
>> >
>> >
>> > Heiko
>> >
>> > Heiko Stuebner (21):
>> >   dm: allow limiting pre-reloc markings to spl or tpl
>> >   clk: rk3288: limit gpll and cpll init to SPL build
>> >   rockchip: rk3288: sdram: use constants in ddrconf table
>> >   rockchip: rk3288: sdram: style fixes from rk3188 sdram review
>> >   rockchip: Move bootrom helper compilation to a hidden option
>> >   rockchip: Move bootrom-related declarations to a header
>> >   rockchip: mkimage: Allow encoding of loader code in spl images
>> >   rockchip: mkimage: Add support rk3188 serial
>> >   rockchip: serial: Adapt rockchip of-platdata driver for rk3188
>> >   rockchip: rk3188: Add header files for PMU and GRF
>> >   rockchip: rk3188: Add pinctrl driver
>> >   rockchip: rk3188: Add sysreset driver
>> >   rockchip: rk3188: Add rk3066/rk3188 clock bindings
>> >   rockchip: rk3188: Add clock driver
>> >   rockchip: rk3188: Add core devicetree files
>> >   rockchip: rk3188: Add core support
>> >   rockchip: rk3188: Add sdram driver
>> >   rockchip: rk3188: Add main, spl and tpl boards
>> >   rockchip: rk3188: Add Radxa Rock board
>> >   rockchip: rk3188: add README.rockchip paragraph describing sd boot
>> >   Add a temporary script that can create a bootimage for rk3188
>> >
>> >  arch/arm/dts/Makefile   |   1 +
>> >  arch/arm/dts/rk3188-radxarock.dts   | 382 +
>> >  arch/arm/dts/rk3188.dtsi| 601 ++
>> >  arch/arm/dts/rk3xxx.dtsi| 417 ++
>> >  arch/arm/include/asm/arch-rockchip/bootrom.h|  22 +
>> >  arch/arm/include/asm/arch-rockchip/cru_rk3188.h | 191 +
>> >  arch/arm/include/asm/arch-rockchip/ddr_rk3188.h |  25 +
>> >  arch/arm/include/asm/arch-rockchip/ddr_rk3288.h |   8 +
>> >  arch/arm/include/asm/arch-rockchip/grf_rk3188.h | 589 ++
>> >  arch/arm/include/asm/arch-rockchip/pmu_rk3188.h |  36 +
>> >  arch/arm/mach-rockchip/Kconfig  |  20 +
>> >  arch/arm/mach-rockchip/Makefile |  14 +-
>> >  arch/arm/mach-rockchip/rk3036-board-spl.c   |   3 +-
>> >  arch/arm/mach-rockchip/rk3188-board-spl.c   | 218 ++
>> >  arch/arm/mach-rockchip/rk3188-board-tpl.c   |  86 ++
>> >  arch/arm/mach-rockchip/rk3188-board.c   |  71 ++
>> >  arch/arm/mach-rockchip/rk3188/Kconfig   |  35 +
>> >  arch/arm/mach-rockchip/rk3188/Makefile  |  11 +
>> >  arch/arm/mach-rockchip/rk3188/clk_rk3188.c  |  33 +
>> >  arch/arm/mach-rockchip/rk3188/sdram_rk3188.c| 995
>> >   arch/arm/mach-rockchip/rk3188/syscon_rk3188.c
>> >  |  55 ++
>> >  arch/arm/mach-rockchip/rk3288-board-spl.c   |   3 +-
>> >  arch/arm/mach-rockchip/rk3288/sdram_rk3288.c|  59 +-
>> >  board/radxa/rock/Kconfig|  15 +
>> >  board/radxa/rock/MAINTAINERS|   6 +
>> >  board/radxa/rock/Makefile   |   7 +
>> >  board/radxa/rock/rock.c |   7 +
>> >  configs/rock_defconfig  |  56 ++
>> >  doc/README.rockchip |  26 +
>> >  doc/driver-model/README.txt |   4 +
>> >  drivers/clk/at91/pmc.c  |   3 +-
>> >  drivers/clk/rockchip/Makefile   |   1 +
>> >  drivers/clk/rockchip/clk_rk3188.c   | 527 +
>> >  drivers/clk/rockchip/clk_rk3288.c   |   2 +
>> >  drivers/core/root.c |   2 +-
>> >  drivers/core/util.c |  25 +
>> >  drivers/pinctrl/Kconfig |   9 +
>> >  drivers/pinctrl/pinctrl-uclass.c|   3 +-
>> >  drivers/pinctrl/rockchip/Makefile   |   1 +
>> >  drivers/pinctrl/rockchip/pinctrl_rk3188.c   | 611 +++
>> >  drivers/serial/serial_rockchip.c|  19 +-
>> >  drivers/sysreset/Makefile   |   1 +
>> >  drivers/sysreset/sysreset_rk3188.c  |  47 ++
>> >  include/configs/rk3188_common.h | 125 +++
>> >  include/configs/rock.h  |  30 +
>> >  include/dm/util.h   |  26 +
>> >  include/dt-bindings/clock/rk3066a-cru.h |  32 +
>> >  include/dt-bindings/clock/rk3188-cru-common.h   | 256 ++
>> >  

[U-Boot] [PATCH 10/10] sunxi: Convert CONS_INDEX to Kconfig

2017-02-23 Thread Mylène Josserand
Convert the CONS_INDEX configuration to Kconfig.
Update sunxi's defconfigs to remove SYS_EXTRA_OPTIONS variable not
needed anymore.
Default value is 1 except for sun5i (equals 2) and sun8i (equals 5).

Signed-off-by: Mylène Josserand 
---
 board/sunxi/Kconfig  | 9 +
 configs/A13-OLinuXinoM_defconfig | 1 -
 configs/A13-OLinuXino_defconfig  | 1 -
 configs/Ampe_A76_defconfig   | 1 -
 configs/CHIP_defconfig   | 1 -
 configs/Empire_electronix_d709_defconfig | 1 -
 configs/Empire_electronix_m712_defconfig | 1 -
 configs/difrnce_dit4350_defconfig| 1 -
 configs/ga10h_v1_1_defconfig | 1 -
 configs/gt90h_v4_defconfig   | 1 -
 configs/iNet_D978_rev2_defconfig | 1 -
 configs/inet86dz_defconfig   | 1 -
 configs/inet98v_rev2_defconfig   | 1 -
 configs/polaroid_mid2407pxe03_defconfig  | 1 -
 configs/polaroid_mid2809pxe04_defconfig  | 1 -
 configs/q8_a13_tablet_defconfig  | 1 -
 configs/q8_a23_tablet_800x480_defconfig  | 1 -
 configs/q8_a33_tablet_1024x600_defconfig | 1 -
 configs/q8_a33_tablet_800x480_defconfig  | 1 -
 19 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 492bf14ae1..6a70ee26b3 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -157,6 +157,15 @@ config ARM_BOOT_HOOK_RMR
This allows both the SPL and the U-Boot proper to be entered in
either mode and switch to AArch64 if needed.
 
+config CONS_INDEX
+   int "UART used for console"
+   default 2 if MACH_SUN5I
+   default 5 if MACH_SUN8I
+   default 1
+   ---help---
+   Configures the console index for Allwinner SoC. 2 for SUN5I, 5 for SUN8I
+   and 1 otherwise.
+
 config DRAM_TYPE
int "sunxi dram type"
depends on MACH_SUN8I_A83T
diff --git a/configs/A13-OLinuXinoM_defconfig b/configs/A13-OLinuXinoM_defconfig
index 361d90a701..1dbd671d01 100644
--- a/configs/A13-OLinuXinoM_defconfig
+++ b/configs/A13-OLinuXinoM_defconfig
@@ -12,7 +12,6 @@ CONFIG_VIDEO_LCD_POWER="PB10"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
 CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-olinuxino-micro"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/A13-OLinuXino_defconfig b/configs/A13-OLinuXino_defconfig
index 3191098bf1..6aec11d594 100644
--- a/configs/A13-OLinuXino_defconfig
+++ b/configs/A13-OLinuXino_defconfig
@@ -15,7 +15,6 @@ CONFIG_VIDEO_LCD_POWER="AXP0-0"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
 CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-olinuxino"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/Ampe_A76_defconfig b/configs/Ampe_A76_defconfig
index 5020724aa8..59a66c1b9d 100644
--- a/configs/Ampe_A76_defconfig
+++ b/configs/Ampe_A76_defconfig
@@ -15,7 +15,6 @@ CONFIG_VIDEO_LCD_BL_EN="AXP0-1"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
 CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-ampe-a76"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/CHIP_defconfig b/configs/CHIP_defconfig
index 65d0c9847a..080f4718b2 100644
--- a/configs/CHIP_defconfig
+++ b/configs/CHIP_defconfig
@@ -8,7 +8,6 @@ CONFIG_DRAM_TIMINGS_DDR3_800E_1066G_1333J=y
 CONFIG_USB0_VBUS_PIN="PB10"
 CONFIG_VIDEO_COMPOSITE=y
 CONFIG_DEFAULT_DEVICE_TREE="sun5i-r8-chip"
-CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
diff --git a/configs/Empire_electronix_d709_defconfig 
b/configs/Empire_electronix_d709_defconfig
index 831949a08b..756636d41e 100644
--- a/configs/Empire_electronix_d709_defconfig
+++ b/configs/Empire_electronix_d709_defconfig
@@ -16,7 +16,6 @@ CONFIG_VIDEO_LCD_BL_EN="AXP0-1"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
 CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-empire-electronix-d709"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/Empire_electronix_m712_defconfig 
b/configs/Empire_electronix_m712_defconfig
index 4b51380fc0..22d43785be 100644
--- a/configs/Empire_electronix_m712_defconfig
+++ b/configs/Empire_electronix_m712_defconfig
@@ -15,7 +15,6 @@ CONFIG_VIDEO_LCD_BL_EN="AXP0-1"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
 CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-empire-electronix-m712"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/difrnce_dit4350_defconfig 
b/configs/difrnce_dit4350_defconfig
index 6149c94ff4..a04b876266 100644
--- a/configs/difrnce_dit4350_defconfig

[U-Boot] [PATCH 3/3] ARM: sun9i: Add defconfig for Sunchip CX-A99

2017-02-23 Thread Rask Ingemann Lambertsen
This patch adds a defconfig for the board. The DRAM settings are as found
in the vendor sys_config.fex file.

Signed-off-by: Rask Ingemann Lambertsen 
---
 configs/Sunchip_CX-A99_defconfig | 22 ++
 1 file changed, 22 insertions(+)
 create mode 100644 configs/Sunchip_CX-A99_defconfig

diff --git a/configs/Sunchip_CX-A99_defconfig b/configs/Sunchip_CX-A99_defconfig
new file mode 100644
index 000..7530d7d
--- /dev/null
+++ b/configs/Sunchip_CX-A99_defconfig
@@ -0,0 +1,22 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN9I=y
+CONFIG_DRAM_CLK=600
+CONFIG_DRAM_ZQ=3881915
+CONFIG_DRAM_ODT_EN=y
+CONFIG_MMC0_CD_PIN="PH17"
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
+CONFIG_USB0_VBUS_PIN="PH15"
+CONFIG_USB0_VBUS_DET=""
+CONFIG_USB0_ID_DET=""
+CONFIG_USB1_VBUS_PIN="PL7"
+CONFIG_USB3_VBUS_PIN="PL8"
+CONFIG_DEFAULT_DEVICE_TREE="sun9i-a80-cx-a99"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPL=y
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_FPGA is not set
+# CONFIG_SPL_DOS_PARTITION is not set
+# CONFIG_SPL_ISO_PARTITION is not set
+# CONFIG_SPL_EFI_PARTITION is not set
-- 
2.10.2

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


[U-Boot] [PATCH 2/3] ARM: dts: sun9i: Add device tree for Sunchip CX-A99

2017-02-23 Thread Rask Ingemann Lambertsen
The Sunchip CX-A99 is a board used in some media players. It features:

An Allwinner A80 ARM SoC (4 * Cortex-A7 + 4 * Cortex-A15 cores)
2 GiB or 4 GiB DDR3 DRAM
AXP808 PMIC
16 GB or 32 GB eMMC
SDIO Wifi/Bluetooth/FM module
SD card slot
1 USB 3.0 connector
2 USB 2.0 connectors
SATA connector
UART connector (internally) for serial console
Ethernet connector (10/100/1000 Mbit/s)
HDMI connector
Composite video and analog audio connector
S/PDIF connector
IR remote control receiver

This is a preliminary device tree for use until a device tree is accepted
upstream, after which it can be replaced by the upstream version.

Signed-off-by: Rask Ingemann Lambertsen 
---
 arch/arm/dts/Makefile |   3 +-
 arch/arm/dts/sun9i-a80-cx-a99.dts | 380 ++
 2 files changed, 382 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/sun9i-a80-cx-a99.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 66ea0b3..fd86794 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -286,7 +286,8 @@ dtb-$(CONFIG_MACH_SUN50I) += \
sun50i-a64-pine64.dtb
 dtb-$(CONFIG_MACH_SUN9I) += \
sun9i-a80-optimus.dtb \
-   sun9i-a80-cubieboard4.dtb
+   sun9i-a80-cubieboard4.dtb \
+   sun9i-a80-cx-a99.dtb
 
 dtb-$(CONFIG_VF610) += vf500-colibri.dtb \
vf610-colibri.dtb \
diff --git a/arch/arm/dts/sun9i-a80-cx-a99.dts 
b/arch/arm/dts/sun9i-a80-cx-a99.dts
new file mode 100644
index 000..a30b6fe
--- /dev/null
+++ b/arch/arm/dts/sun9i-a80-cx-a99.dts
@@ -0,0 +1,380 @@
+/*
+ * sun9i-a80-cx-a99.dts - Device Tree file for the Sunchip CX-A99 board.
+ *
+ * Copyright (C) 2017 Rask Ingemann Lambertsen 
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * The Sunchip CX-A99 board is found in several similar Android media
+ * players, such as:
+ *
+ * Instabox Fantasy A8 (no external antenna)
+ * Jesurun CS-Q8 (ships with larger remote control)
+ * Jesurun Maxone
+ * Rikomagic (RKM) MK80/MK80LE
+ * Tronsmart Draco AW80 Meta/Telos
+ *
+ * See the Sunchip CX-A99 page on the Linux-sunxi wiki for more information.
+ */
+
+/dts-v1/;
+#include "sun9i-a80.dtsi"
+
+#include 
+
+/ {
+   model = "Sunchip CX-A99";
+   compatible = "sunchip,cx-a99", "allwinner,sun9i-a80";
+
+   aliases {
+   serial0 = 
+   };
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   blue {
+   gpios = < 6 10 GPIO_ACTIVE_HIGH>;   /* PG10 */
+   label = "cx-a99:blue:status";
+   };
+
+   red {
+   gpios = < 6 11 GPIO_ACTIVE_HIGH>;   /* PG11 */
+   label = "cx-a99:red:status";
+   };
+   };
+
+   powerseq_wifi: powerseq-wifi {
+   compatible = "mmc-pwrseq-simple";
+   clocks = <_rtc 1>;
+   clock-names = "ext_clock";
+   reset-gpios = <_pio 1 0 

[U-Boot] [PATCH 1/3] ARM: dts: at91: add dts files for at91sam9m10g45ek

2017-02-23 Thread Wenyou Yang
The device tree source files of at91sam9m10g45ek boards are copied
from the Linux v4.10, do the changes as below.
 - Add the reg property for the pinctrl node.
 - Move the gpio (pioA, pioB, pioC, pioD, pioE) nodes as the pinctrl's
   slibling nodes, instead of the child nodes.
 - Fix the compilation warnings.

Signed-off-by: Wenyou Yang 
---

 arch/arm/dts/Makefile |   2 +
 arch/arm/dts/at91sam9g45.dtsi | 212 +++---
 arch/arm/dts/at91sam9m10g45ek.dts | 357 ++
 3 files changed, 466 insertions(+), 105 deletions(-)
 create mode 100644 arch/arm/dts/at91sam9m10g45ek.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 76dc6562ed..0403a389a9 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -330,6 +330,8 @@ dtb-$(CONFIG_TARGET_AT91SAM9260EK) += \
at91sam9g20ek.dtb   \
at91sam9g20ek_2mmc.dtb
 
+dtb-$(CONFIG_TARGET_AT91SAM9M10G45EK) += at91sam9m10g45ek.dtb
+
 dtb-$(CONFIG_TARGET_AT91SAM9X5EK) += \
at91sam9g15ek.dtb   \
at91sam9g25ek.dtb   \
diff --git a/arch/arm/dts/at91sam9g45.dtsi b/arch/arm/dts/at91sam9g45.dtsi
index af8b708ac3..f203886ec1 100644
--- a/arch/arm/dts/at91sam9g45.dtsi
+++ b/arch/arm/dts/at91sam9g45.dtsi
@@ -135,7 +135,7 @@
clocks = <_osc>;
};
 
-   plla: pllack {
+   plla: pllack@0 {
compatible = "atmel,at91rm9200-clk-pll";
#clock-cells = <0>;
interrupts-extended = < 
AT91_PMC_LOCKA>;
@@ -188,13 +188,13 @@
interrupt-parent = <>;
clocks = <>, <>, 
<>, <>, <>;
 
-   prog0: prog0 {
+   prog0: prog@0 {
#clock-cells = <0>;
reg = <0>;
interrupts = 
;
};
 
-   prog1: prog1 {
+   prog1: prog@1 {
#clock-cells = <0>;
reg = <1>;
interrupts = 
;
@@ -206,25 +206,25 @@
#address-cells = <1>;
#size-cells = <0>;
 
-   ddrck: ddrck {
+   ddrck: ddrck@2 {
#clock-cells = <0>;
reg = <2>;
clocks = <>;
};
 
-   uhpck: uhpck {
+   uhpck: uhpck@6 {
#clock-cells = <0>;
reg = <6>;
clocks = <>;
};
 
-   pck0: pck0 {
+   pck0: pck0@8 {
#clock-cells = <0>;
reg = <8>;
clocks = <>;
};
 
-   pck1: pck1 {
+   pck1: pck1@9 {
#clock-cells = <0>;
reg = <9>;
clocks = <>;
@@ -237,147 +237,147 @@
#size-cells = <0>;
clocks = <>;
 
-   pioA_clk: pioA_clk {
+   pioA_clk: pioA_clk@2 {
#clock-cells = <0>;
reg = <2>;
};
 
-   pioB_clk: pioB_clk {
+   pioB_clk: pioB_clk@3 {
#clock-cells = <0>;
reg = <3>;
};
 
-   pioC_clk: pioC_clk {
+   pioC_clk: pioC_clk@4 {
#clock-cells = <0>;

[U-Boot] [PATCH 0/3] board: at91sam9m10g45ek: convert to support DM and DT

2017-02-23 Thread Wenyou Yang
The purpose of the patch set is to convert the board to support
the Driver Model and the Device Tree.


Wenyou Yang (3):
  ARM: dts: at91: add dts files for at91sam9m10g45ek
  board: at91sam9m10g45ek: move config options to defconfig
  board: at91sam9m10g45ek: clean up code

 arch/arm/dts/Makefile   |   2 +
 arch/arm/dts/at91sam9g45.dtsi   | 212 +++---
 arch/arm/dts/at91sam9m10g45ek.dts   | 357 
 board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c |  59 
 configs/at91sam9m10g45ek_mmc_defconfig  |  21 +-
 configs/at91sam9m10g45ek_nandflash_defconfig|  18 +-
 include/configs/at91sam9m10g45ek.h  |  16 --
 7 files changed, 503 insertions(+), 182 deletions(-)
 create mode 100644 arch/arm/dts/at91sam9m10g45ek.dts

-- 
2.11.0

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


[U-Boot] [PATCH V4 12/19] i2c: lpi2c: add lpi2c driver for i.MX7ULP

2017-02-23 Thread Peng Fan
Add lpi2c driver for i.MX7ULP.
Need to enable the two options to use this driver:
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_IMX_LPI2C=y

Signed-off-by: Peng Fan 
Acked-by: Heiko Schocher 
Cc: Stefano Babic 
---

I do not repost the whole patch set, only post the single lpi2c patch
in V4. Other patches are still valid in V3.

V4:
 Use SYS_I2C_IMX_LPI2C as the Kconfig entry
 Add Ack tag
V3:
 none
V2:
 none

 arch/arm/include/asm/arch-mx7ulp/imx_lpi2c.h | 520 +++
 drivers/i2c/Kconfig  |   6 +
 drivers/i2c/Makefile |   1 +
 drivers/i2c/imx_lpi2c.c  | 462 
 4 files changed, 989 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-mx7ulp/imx_lpi2c.h
 create mode 100644 drivers/i2c/imx_lpi2c.c

diff --git a/arch/arm/include/asm/arch-mx7ulp/imx_lpi2c.h 
b/arch/arm/include/asm/arch-mx7ulp/imx_lpi2c.h
new file mode 100644
index 000..f1b3113
--- /dev/null
+++ b/arch/arm/include/asm/arch-mx7ulp/imx_lpi2c.h
@@ -0,0 +1,520 @@
+/*
+ * Copyright 2016 Freescale Semiconductors, Inc.
+ *
+ * I2CLP driver for i.MX
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ *
+ */
+#ifndef __IMX_LPI2C_H__
+#define __IMX_LPI2C_H__
+
+struct imx_lpi2c_bus {
+   int index;
+   ulong base;
+   ulong driver_data;
+   int speed;
+   struct i2c_pads_info *pads_info;
+   struct udevice *bus;
+};
+
+struct imx_lpi2c_reg {
+   u32 verid;
+   u32 param;
+   u8  reserved_0[8];
+   u32 mcr;
+   u32 msr;
+   u32 mier;
+   u32 mder;
+   u32 mcfgr0;
+   u32 mcfgr1;
+   u32 mcfgr2;
+   u32 mcfgr3;
+   u8  reserved_1[16];
+   u32 mdmr;
+   u8  reserved_2[4];
+   u32 mccr0;
+   u8  reserved_3[4];
+   u32 mccr1;
+   u8  reserved_4[4];
+   u32 mfcr;
+   u32 mfsr;
+   u32 mtdr;
+   u8  reserved_5[12];
+   u32 mrdr;
+   u8  reserved_6[156];
+   u32 scr;
+   u32 ssr;
+   u32 sier;
+   u32 sder;
+   u8  reserved_7[4];
+   u32 scfgr1;
+   u32 scfgr2;
+   u8  reserved_8[20];
+   u32 samr;
+   u8  reserved_9[12];
+   u32 sasr;
+   u32 star;
+   u8  reserved_10[8];
+   u32 stdr;
+   u8  reserved_11[12];
+   u32 srdr;
+};
+
+typedef enum lpi2c_status {
+   LPI2C_SUCESS = 0,
+   LPI2C_END_PACKET_ERR,
+   LPI2C_STOP_ERR,
+   LPI2C_NAK_ERR,
+   LPI2C_ARB_LOST_ERR,
+   LPI2C_FIFO_ERR,
+   LPI2C_PIN_LOW_TIMEOUT_ERR,
+   LPI2C_DATA_MATCH_ERR,
+   LPI2C_BUSY,
+   LPI2C_IDLE,
+   LPI2C_BIT_ERR,
+   LPI2C_NO_TRANS_PROG,
+   LPI2C_DMA_REQ_FAIL,
+} lpi2c_status_t;
+
+/* 
+   -- LPI2C Register Masks
+   
 */
+
+/*!
+ * @addtogroup LPI2C_Register_Masks LPI2C Register Masks
+ * @{
+ */
+
+/*! @name VERID - Version ID Register */
+#define LPI2C_VERID_FEATURE_MASK (0xU)
+#define LPI2C_VERID_FEATURE_SHIFT(0U)
+#define LPI2C_VERID_FEATURE(x)   (((uint32_t)(((uint32_t)(x)) 
<< LPI2C_VERID_FEATURE_SHIFT)) & LPI2C_VERID_FEATURE_MASK)
+#define LPI2C_VERID_MINOR_MASK   (0xFFU)
+#define LPI2C_VERID_MINOR_SHIFT  (16U)
+#define LPI2C_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) 
<< LPI2C_VERID_MINOR_SHIFT)) & LPI2C_VERID_MINOR_MASK)
+#define LPI2C_VERID_MAJOR_MASK   (0xFF00U)
+#define LPI2C_VERID_MAJOR_SHIFT  (24U)
+#define LPI2C_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) 
<< LPI2C_VERID_MAJOR_SHIFT)) & LPI2C_VERID_MAJOR_MASK)
+
+/*! @name PARAM - Parameter Register */
+#define LPI2C_PARAM_MTXFIFO_MASK (0xFU)
+#define LPI2C_PARAM_MTXFIFO_SHIFT(0U)
+#define LPI2C_PARAM_MTXFIFO(x)   (((uint32_t)(((uint32_t)(x)) 
<< LPI2C_PARAM_MTXFIFO_SHIFT)) & LPI2C_PARAM_MTXFIFO_MASK)
+#define LPI2C_PARAM_MRXFIFO_MASK (0xF00U)
+#define LPI2C_PARAM_MRXFIFO_SHIFT(8U)
+#define LPI2C_PARAM_MRXFIFO(x)   (((uint32_t)(((uint32_t)(x)) 
<< LPI2C_PARAM_MRXFIFO_SHIFT)) & LPI2C_PARAM_MRXFIFO_MASK)
+
+/*! @name MCR - Master Control Register */
+#define LPI2C_MCR_MEN_MASK   (0x1U)
+#define LPI2C_MCR_MEN_SHIFT  (0U)
+#define LPI2C_MCR_MEN(x) (((uint32_t)(((uint32_t)(x)) 
<< LPI2C_MCR_MEN_SHIFT)) & LPI2C_MCR_MEN_MASK)
+#define LPI2C_MCR_RST_MASK   (0x2U)
+#define LPI2C_MCR_RST_SHIFT  (1U)
+#define LPI2C_MCR_RST(x) (((uint32_t)(((uint32_t)(x)) 
<< LPI2C_MCR_RST_SHIFT)) & LPI2C_MCR_RST_MASK)
+#define LPI2C_MCR_DOZEN_MASK (0x4U)
+#define LPI2C_MCR_DOZEN_SHIFT(2U)

[U-Boot] How to validate ext4load file size (not null)?

2017-02-23 Thread brendan

I have stored multiple device trees in my emmc (ext4 formatted) partition
and I want to load a certain device tree file from emmc, but if this fails
(i.e. the device tree file doesn't exist) it should default to a device tree
that is stored in memory. 

For example if I run this: 

I get a return of: if test  != null; then run ; else run ; fi

I have seen the 
 command however using the example above, if I did 
 it does not set the filename environment variable therefore I cannot check
the size as  always returns true.  

I have tried other if statements such as:
 and they have not given me the true/false check that I am after.  

Does uBoot offer functionality for what I am after?  or should I be
approaching it with a different method. 

Thanks 




--
View this message in context: 
http://u-boot.10912.n7.nabble.com/How-to-validate-ext4load-file-size-not-null-tp282782.html
Sent from the U-Boot mailing list archive at Nabble.com.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] How to validate ext4load file size (not null)?

2017-02-23 Thread brendan
I have stored multiple device trees in my emmc (ext4 formatted) partition and
I want to load a certain device tree file from emmc, but if this fails (i.e.
the device tree file doesn't exist) it should default to a device tree that
is stored in memory. 

For example if I run this: 


I get a return of:


Is there a way I can parse this return from ext4load to check if the size is
null or not null?

The aim (in pseudo code) is 

Does uBoot offer functionality for what I am after?  or should I be
approaching it with a different method. 

Thanks





--
View this message in context: 
http://u-boot.10912.n7.nabble.com/How-to-validate-ext4load-file-size-not-null-tp282781.html
Sent from the U-Boot mailing list archive at Nabble.com.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 05/10] sunxi: mk802_defconfig: Remove SYS_EXTRA_OPTIONS

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 04:44:14PM +0100, Mylène Josserand wrote:
> The USB_EHCI configuration is already set in this defconfig
> using kconfig's config. This configuration in SYS_EXTRA_OPTIONS
> must be removed and so the SYS_EXTRA_OPTIONS.
> 
> Signed-off-by: Mylène Josserand 

Acked-by: Maxime Ripard 
Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] [PATCH 03/10] sunxi: icnova-a20-swac_defconfig: Remove CMD_BMP from SYS_EXTRA_OPTIONS

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 04:44:12PM +0100, Mylène Josserand wrote:
> This configuration is not necessary in a defconfig file so
> it is removed from the SYS_EXTRA_OPTIONS.
> 
> Signed-off-by: Mylène Josserand 

Acked-by: Maxime Ripard 

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] [PATCH 02/10] sunxi: icnova-a20-swac_defconfig: Remove AXP209_POWER from SYS_EXTRA_OPTIONS

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 04:44:11PM +0100, Mylène Josserand wrote:
> Remove the AXP209_POWER option from SYS_EXTRA_OPTIONS.
> As this configuration already exists on Kconfig, we just need
> to remove it from defconfig.
> 
> Signed-off-by: Mylène Josserand 

Acked-by: Maxime Ripard 
Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] [PATCH 04/10] sunxi: icnova-a20-swac_defconfig: Remove CMD_UNZIP and SYS_EXTRA_OPTIONS

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 04:44:13PM +0100, Mylène Josserand wrote:
> Remove this command as it is not necessary in defconfig file.
> As there is no more command/option in SYS_EXTRA_OPTIONS, it
> can be removed from this defconfig file.
> 
> Signed-off-by: Mylène Josserand 

Acked-by: Maxime Ripard 

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] [PATCH 01/10] sunxi: Convert SUNXI_GMAC to Kconfig

2017-02-23 Thread Maxime Ripard
Hi,

On Thu, Feb 23, 2017 at 04:44:10PM +0100, Mylène Josserand wrote:
> Move the SUNXI_GMAC config option to Kconfig and remove it
> from SYS_EXTRA_OPTIONS.
> 
> Signed-off-by: Mylène Josserand 
> ---
>  board/sunxi/Kconfig| 5 +
>  configs/A20-OLinuXino-Lime2_defconfig  | 3 ++-
>  configs/A20-OLinuXino-Lime_defconfig   | 3 ++-
>  configs/A20-OLinuXino_MICRO_defconfig  | 3 ++-
>  configs/A20-Olimex-SOM-EVB_defconfig   | 3 ++-
>  configs/Bananapi_defconfig | 3 ++-
>  configs/Bananapro_defconfig| 3 ++-
>  configs/CSQ_CS908_defconfig| 2 +-
>  configs/Colombus_defconfig | 3 ++-
>  configs/Cubieboard2_defconfig  | 3 ++-
>  configs/Cubietruck_defconfig   | 3 ++-
>  configs/Hummingbird_A31_defconfig  | 3 ++-
>  configs/Itead_Ibox_A20_defconfig   | 3 ++-
>  configs/Lamobo_R1_defconfig| 3 ++-
>  configs/Linksprite_pcDuino3_Nano_defconfig | 3 ++-
>  configs/Linksprite_pcDuino3_defconfig  | 3 ++-
>  configs/Mele_A1000G_quad_defconfig | 2 +-
>  configs/Mele_I7_defconfig  | 2 +-
>  configs/Mele_M3_defconfig  | 2 +-
>  configs/Mele_M5_defconfig  | 2 +-
>  configs/Mele_M9_defconfig  | 2 +-
>  configs/Orangepi_defconfig | 3 ++-
>  configs/Orangepi_mini_defconfig| 3 ++-
>  configs/Sinlinx_SinA31s_defconfig  | 2 +-
>  configs/Sinovoip_BPI_M2_defconfig  | 3 ++-
>  configs/Wits_Pro_A20_DKT_defconfig | 3 ++-
>  configs/i12-tvbox_defconfig| 3 ++-
>  configs/icnova-a20-swac_defconfig  | 3 ++-
>  configs/mixtile_loftq_defconfig| 3 ++-
>  29 files changed, 54 insertions(+), 28 deletions(-)
> 
> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
> index 00011331b9..ff11b98ddb 100644
> --- a/board/sunxi/Kconfig
> +++ b/board/sunxi/Kconfig
> @@ -683,6 +683,11 @@ config VIDEO_LCD_TL059WV5C0
>  
>  endchoice
>  
> +config SUNXI_GMAC

This would be better in drivers/net. And it would be great if you
could also rename it in the process for SUN7I_GMAC, to be able to
distinguish the various generations of ethernet controller we had.

Looks good otherwise
Thanks!

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] [PATCH v2 1/6] sunxi: add pinctrl (UCLASS_PINCTRL) support for sunxi

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 11:54:15AM +0800, Chen-Yu Tsai wrote:
> On Thu, Feb 23, 2017 at 7:18 AM, Maxime Ripard
>  wrote:
> > On Wed, Feb 22, 2017 at 09:47:27PM +0100, Philipp Tomsich wrote:
> >> This change adds a full device-model pinctrl driver for sunxi (tested with
> >> sun50iw1p1) based on the support available in Linux.
> >>
> >> Details are:
> >>  * implements a driver for pinctrl devices and assigns sun50i-a64-pinctrl
> >>and sun50i-a64-r-pinctrl to it
> >>  * dynamically creates the driver_data for a sunxi_gpio (see sunxi_gpio.c)
> >>driver and binds it to the same device-tree node
> >>  * lifts and reuses the pinctrl-sunxi.h and pinctrl-sun50i-a64.c files from
> >>Linux (thanks to Maxime and Andre) and adds a pinctrl-sun50i-a64-r.c (to
> >>be picked up for inclusion into Linux again)
> >>
> >> Signed-off-by: Philipp Tomsich 
> >> ---
> >>  arch/arm/include/asm/arch-sunxi/gpio-internal.h|  19 +
> >>  .../pinctrl/allwinner,pinctrl.txt  |  65 +++
> >>  drivers/gpio/sunxi_gpio.c  |  15 +-
> >>  drivers/pinctrl/Kconfig|  10 +
> >>  drivers/pinctrl/Makefile   |   2 +
> >>  drivers/pinctrl/sunxi/Makefile |  10 +
> >>  drivers/pinctrl/sunxi/pinctrl-sun50i-a64-r.c   |  92 
> >>  drivers/pinctrl/sunxi/pinctrl-sun50i-a64.c | 577 
> >> +
> >>  drivers/pinctrl/sunxi/pinctrl-sunxi.c  | 317 +++
> >>  drivers/pinctrl/sunxi/pinctrl-sunxi.h  | 311 +++
> >>  10 files changed, 1411 insertions(+), 7 deletions(-)
> >>  create mode 100644 arch/arm/include/asm/arch-sunxi/gpio-internal.h
> >>  create mode 100644 doc/device-tree-bindings/pinctrl/allwinner,pinctrl.txt
> >>  create mode 100644 drivers/pinctrl/sunxi/Makefile
> >>  create mode 100644 drivers/pinctrl/sunxi/pinctrl-sun50i-a64-r.c
> >>  create mode 100644 drivers/pinctrl/sunxi/pinctrl-sun50i-a64.c
> >>  create mode 100644 drivers/pinctrl/sunxi/pinctrl-sunxi.c
> >>  create mode 100644 drivers/pinctrl/sunxi/pinctrl-sunxi.h
> >>
> >> diff --git a/arch/arm/include/asm/arch-sunxi/gpio-internal.h 
> >> b/arch/arm/include/asm/arch-sunxi/gpio-internal.h
> >> new file mode 100644
> >> index 000..4dcdd34
> >> --- /dev/null
> >> +++ b/arch/arm/include/asm/arch-sunxi/gpio-internal.h
> >> @@ -0,0 +1,19 @@
> >> +/*
> >> + * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
> >> + *
> >> + * SPDX-License-Identifier:  GPL-2.0+
> >> + */
> >> +
> >> +
> >> +#ifndef _SUNXI_GPIO_INTERNAL_H
> >> +#define _SUNXI_GPIO_INTERNAL_H
> >> +
> >> +/* This data structure is shared between the sunxi_gpio driver and
> >> + * the sunxi_pinctrl driver.
> >> + */
> >> +struct sunxi_gpio_soc_data {
> >> + int start;
> >> + int no_banks;
> >> +};
> >> +
> >> +#endif
> >> diff --git a/doc/device-tree-bindings/pinctrl/allwinner,pinctrl.txt 
> >> b/doc/device-tree-bindings/pinctrl/allwinner,pinctrl.txt
> >> new file mode 100644
> >> index 000..946831f
> >> --- /dev/null
> >> +++ b/doc/device-tree-bindings/pinctrl/allwinner,pinctrl.txt
> >> @@ -0,0 +1,65 @@
> >> +* Allwinner Pinmux Controller
> >> +
> >> +Allwinner integrates multiple banks (of 32 pins each) of pin-muxing,
> >> +GPIO functionality and (optional) external interrupt functionality
> >> +into a single controller.
> >> +
> >> +For each configurable pad (certain driver-cells, such as the IO from
> >> +integrated USB PHYs or DRAM, have a fixed function and can not be
> >> +configured), the muxing options (input, output or one of the several
> >> +functions) can be selected.
> >> +
> >> +Properties for the pinctrl node:
> >> + - compatible: should be "allwinner,sun50i-pinctrl"
> >
> > There's a typo here, the compatible is sun50i-a64-pinctrl
> >
> >> + - reg: address and length of the register set for the device.
> >> + - interrupts: interrupt for the device
> >> + - clocks: A phandle to the reference clock for this device
> >
> > (and ideally, this would take three clocks: the bus gate + the two
> > oscillators).
> >
> >> +
> >> +Properties for the pinconfig sub-nodes:
> >> + - allwinner,pins: a list of pins (e.g. "PH2", "PH3") to configure
> >> + - allwinner,function: the name of pinmux function (e.g. "mmc2")
> >
> > allwinner,pins and allwinner,function are also deprecated in favour of
> > pins and function.
> >
> >> + - drive-strength: a drive-stength setting of 10, 20, 30 or 40 mA
> >> + - bias-pull-up
> >> + - bias-pull-down
> >> + - bias-disable (default)
> >
> > The default is not bias-disable, but to keep the current configuration
> 
> Shouldn't we just copy the binding docs from the Linux kernel?
> Afterall they are supposed to be the same.

Yep, that would probably be the easiest.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


signature.asc
Description: PGP 

Re: [U-Boot] [PATCH v3 4/8] armv8: Add workaround for USB erratum A-009007

2017-02-23 Thread york sun
On 02/16/2017 01:12 PM, york@nxp.com wrote:
> On 02/03/2017 06:08 AM, Suresh Gupta wrote:



>> +static void erratum_a009007(void)
>> +{
>> +/* TODO:implement the out_be16 instead of writew which is taking
>> +little endian style */
>
> Did you mean to remind yourself to finish this before sending this
> patch? You know we already have out_be16(), don't you?
>

Suresh,

Are you going to send an update?

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


Re: [U-Boot] [PATCH v2 04/10] efi: Add a hook to allow adding memory mapping

2017-02-23 Thread york sun
On 02/15/2017 03:18 PM, York Sun wrote:
> Instead of adding all memory banks, add a hook so individual SoC/board
> can has its own implementation.
>
> Signed-off-by: York Sun 
> CC: Alexander Graf 
>
> ---
>
> Changes in v2:
>   Add change to efi mapping
>

Alex,

Are you OK with this change?

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


[U-Boot] [PATCH 4/9] arm: mach-omap2: Add secure image name common to OMAP and keystone

2017-02-23 Thread Andrew F. Davis
As K2 can directly boot U-Boot, add u-boot_HS_MLO as the secure image
name for secure K2 devices, for all boot modes other than SPI flash.

Signed-off-by: Madan Srinivas 
Signed-off-by: Andrew F. Davis 
---
 arch/arm/mach-omap2/config_secure.mk | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-omap2/config_secure.mk 
b/arch/arm/mach-omap2/config_secure.mk
index 0c843338d7..0346cb93ab 100644
--- a/arch/arm/mach-omap2/config_secure.mk
+++ b/arch/arm/mach-omap2/config_secure.mk
@@ -77,6 +77,12 @@ u-boot-spl_HS_ISSW: $(obj)/u-boot-spl.bin FORCE
 u-boot-spl_HS_SPI_X-LOADER: $(obj)/u-boot-spl.bin FORCE
$(call if_changed,mkomapsecimg)
 
+# For supporting single stage boot on keystone, the image is a full u-boot
+# file, not an SPL. This will work for all boot devices, other than SPI
+# flash
+u-boot_HS_MLO: $(obj)/u-boot.bin
+   $(call if_changed,mkomapsecimg)
+
 # For supporting single stage XiP QSPI on AM43xx, the image is a full u-boot
 # file, not an SPL. In this case the mkomapsecimg command looks for a
 # u-boot-HS_* prefix
-- 
2.11.0

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


[U-Boot] [PATCH 2/9] arm: mach-keystone: Implements FIT post-processing call for keystone SoCs

2017-02-23 Thread Andrew F. Davis
This commit implements the board_fit_image_post_process() function for
the keystone architecture. This function calls into the secure boot
monitor for secure authentication/decryption of the image. All needed
work is handled by the boot monitor and, depending on the keystone
platform, the security functions may be offloaded to other secure
processing elements in the SoC.

The boot monitor acts as the gateway to these secure functions and the
boot monitor for secure devices is available as part of the SECDEV
package for KS2. For more details refer doc/README.ti-secure

Signed-off-by: Vitaly Andrianov 
Signed-off-by: Madan Srinivas 
Signed-off-by: Andrew F. Davis 
---
 arch/arm/mach-keystone/mon.c | 73 
 1 file changed, 73 insertions(+)

diff --git a/arch/arm/mach-keystone/mon.c b/arch/arm/mach-keystone/mon.c
index 256f6300ed..81009848d0 100644
--- a/arch/arm/mach-keystone/mon.c
+++ b/arch/arm/mach-keystone/mon.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 asm(".arch_extension sec\n\t");
 
 int mon_install(u32 addr, u32 dpsc, u32 freq)
@@ -61,3 +62,75 @@ int mon_power_off(int core_id)
: "cc", "r0", "r1", "memory");
return  result;
 }
+
+#ifdef CONFIG_TI_SECURE_DEVICE
+#define KS2_HS_SEC_HEADER_LEN  0x60
+#define KS2_HS_SEC_TAG_OFFSET  0x34
+#define KS2_AUTH_CMD   130
+
+/**
+ * k2_hs_bm_auth() - Invokes security functions using a
+ * proprietary TI interface. This binary and source for
+ * this is available in the secure development package or
+ * SECDEV. For details on how to access this please refer
+ * doc/README.ti-secure
+ *
+ * @cmd: Secure monitor command
+ * @arg1: Argument for command
+ *
+ * returns non-zero value on success, zero on error
+ */
+static int k2_hs_bm_auth(int cmd, void *arg1)
+{
+   int result;
+
+   asm volatile (
+   "stmfd  r13!, {r4-r12, lr}\n"
+   "mov r0, %1\n"
+   "mov r1, %2\n"
+   "smc #2\n"
+   "ldmfd r13!, {r4-r12, lr}\n"
+   : "=" (result)
+   : "r" (cmd), "r" (arg1)
+   : "cc", "r0", "r1", "memory");
+
+   return  result;
+}
+
+void board_fit_image_post_process(void **p_image, size_t *p_size)
+{
+   int result = 0;
+   void *image = *p_image;
+
+   if (strncmp(image + KS2_HS_SEC_TAG_OFFSET, "KEYS", 4)) {
+   printf("No signature found in image!\n");
+   hang();
+   }
+
+   result = k2_hs_bm_auth(KS2_AUTH_CMD, image);
+   if (result == 0) {
+   printf("Authentication failed!\n");
+   hang();
+   }
+
+   /*
+   * Overwrite the image headers after authentication
+   * and decryption. Update size to reflect removal
+   * of header.
+   */
+   memcpy(image, image + KS2_HS_SEC_HEADER_LEN, *p_size);
+   *p_size -= KS2_HS_SEC_HEADER_LEN;
+
+   /*
+* Output notification of successful authentication to re-assure the
+* user that the secure code is being processed as expected. However
+* suppress any such log output in case of building for SPL and booting
+* via YMODEM. This is done to avoid disturbing the YMODEM serial
+* protocol transactions.
+*/
+   if (!(IS_ENABLED(CONFIG_SPL_BUILD) &&
+ IS_ENABLED(CONFIG_SPL_YMODEM_SUPPORT) &&
+ spl_boot_device() == BOOT_DEVICE_UART))
+   printf("Authentication passed\n");
+}
+#endif
-- 
2.11.0

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


[U-Boot] [PATCH 0/9] Add support for secure boot on Keystone2 SoCs

2017-02-23 Thread Andrew F. Davis
Hello all,

This series adds support for secure Keystone2 K2E and K2HK devices,
much of the work is borrowed from the OMAP style devices as the
secure workings are very similar, allowing minimal changes for
this support addition.

Thanks,
Andrew

Andrew F. Davis (9):
  image: Fixes build warning with CONFIG_FIT_IMAGE_POST_PROCESS
  arm: mach-keystone: Implements FIT post-processing call for keystone
SoCs
  arm: mach-omap2: Enable Kconfig support for K2 HS devices
  arm: mach-omap2: Add secure image name common to OMAP and keystone
  ARM: Keystone2: Build secure images for K2
  doc: Updates info on using Keystone2 secure devices
  Kconfig: Adds SYS_TEXT_BASE config option for Keystone2
  defconfig: k2e_hs_evm: Add k2e_hs_evm_defconfig
  defconfig: k2hk_hs_evm: Add k2hk_hs_evm_defconfig

 Kconfig|  2 +-
 arch/arm/mach-keystone/config.mk   |  6 ++
 arch/arm/mach-keystone/mon.c   | 73 ++
 arch/arm/mach-omap2/Kconfig|  2 +-
 arch/arm/mach-omap2/config_secure.mk   |  6 ++
 configs/k2e_evm_defconfig  |  1 +
 .../{k2e_evm_defconfig => k2e_hs_evm_defconfig}| 15 ++---
 configs/k2g_evm_defconfig  |  1 +
 configs/k2hk_evm_defconfig |  1 +
 .../{k2hk_evm_defconfig => k2hk_hs_evm_defconfig}  | 13 ++--
 configs/k2l_evm_defconfig  |  1 +
 doc/README.ti-secure   | 20 ++
 include/image.h|  3 +-
 13 files changed, 122 insertions(+), 22 deletions(-)
 copy configs/{k2e_evm_defconfig => k2e_hs_evm_defconfig} (78%)
 copy configs/{k2hk_evm_defconfig => k2hk_hs_evm_defconfig} (80%)

-- 
2.11.0

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


[U-Boot] [PATCH 1/9] image: Fixes build warning with CONFIG_FIT_IMAGE_POST_PROCESS

2017-02-23 Thread Andrew F. Davis
The function 'board_fit_image_post_process' is defined only when the
config option CONFIG_FIT_IMAGE_POST_PROCESS is enabled. For secure
systems that do not use SPL but do use FIT kernel images, only
CONFIG_FIT_IMAGE_POST_PROCESS will be defined, which will result in an
implicit declaration of function 'board_fit_image_post_process' warning
while building u-boot. Fix this warning.

Signed-off-by: Madan Srinivas 
Signed-off-by: Andrew F. Davis 
Reviewed-by: Tom Rini 
---
 include/image.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/image.h b/include/image.h
index 1e686b76d3..24cdd8cd14 100644
--- a/include/image.h
+++ b/include/image.h
@@ -1257,7 +1257,8 @@ void android_print_contents(const struct andr_img_hdr 
*hdr);
  */
 int board_fit_config_name_match(const char *name);
 
-#ifdef CONFIG_SPL_FIT_IMAGE_POST_PROCESS
+#if defined(CONFIG_SPL_FIT_IMAGE_POST_PROCESS) || \
+   defined(CONFIG_FIT_IMAGE_POST_PROCESS)
 /**
  * board_fit_image_post_process() - Do any post-process on FIT binary data
  *
-- 
2.11.0

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


[U-Boot] [PATCH 5/9] ARM: Keystone2: Build secure images for K2

2017-02-23 Thread Andrew F. Davis
Adds an additional image type needed for supporting secure keystone
devices. The build generates u-boot_HS_MLO which can be used to boot
from all media on secure keystone devices.

Signed-off-by: Madan Srinivas 
Signed-off-by: Andrew F. Davis 
---
 arch/arm/mach-keystone/config.mk | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-keystone/config.mk b/arch/arm/mach-keystone/config.mk
index 9ae1e9ac91..db556ea0a8 100644
--- a/arch/arm/mach-keystone/config.mk
+++ b/arch/arm/mach-keystone/config.mk
@@ -5,9 +5,15 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+include  $(srctree)/arch/arm/mach-omap2/config_secure.mk
+
 ifndef CONFIG_SPL_BUILD
+ifeq ($(CONFIG_TI_SECURE_DEVICE),y)
+ALL-y += u-boot_HS_MLO
+else
 ALL-y += MLO
 endif
+endif
 
 MKIMAGEFLAGS_u-boot-spl.gph = -A $(ARCH) -T gpimage -C none \
-a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n SPL
-- 
2.11.0

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


[U-Boot] [PATCH 7/9] Kconfig: Adds SYS_TEXT_BASE config option for Keystone2

2017-02-23 Thread Andrew F. Davis
This patch makes SYS_TEXT_BASE a config option for Keystone2
so that it can be used to load u-boot at different addresses
on secure and non-secure Keystone2 devices.

Signed-off-by: Madan Srinivas 
Signed-off-by: Andrew F. Davis 
---
 Kconfig| 2 +-
 configs/k2e_evm_defconfig  | 1 +
 configs/k2g_evm_defconfig  | 1 +
 configs/k2hk_evm_defconfig | 1 +
 configs/k2l_evm_defconfig  | 1 +
 5 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Kconfig b/Kconfig
index 81b4226463..1a5b105daa 100644
--- a/Kconfig
+++ b/Kconfig
@@ -285,7 +285,7 @@ config SYS_EXTRA_OPTIONS
 config SYS_TEXT_BASE
depends on SPARC || ARC || X86 || ARCH_UNIPHIER || ARCH_ZYNQMP || \
(M68K && !TARGET_ASTRO_MCF5373L) || MICROBLAZE || MIPS || \
-   ARCH_ZYNQ
+   ARCH_ZYNQ || ARCH_KEYSTONE
depends on !EFI_APP
hex "Text Base"
help
diff --git a/configs/k2e_evm_defconfig b/configs/k2e_evm_defconfig
index a42a485e2b..95259661c9 100644
--- a/configs/k2e_evm_defconfig
+++ b/configs/k2e_evm_defconfig
@@ -8,6 +8,7 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_SYS_TEXT_BASE=0x0c00
 CONFIG_DEFAULT_DEVICE_TREE="keystone-k2e-evm"
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
diff --git a/configs/k2g_evm_defconfig b/configs/k2g_evm_defconfig
index f3ee01afb1..84b5152e80 100644
--- a/configs/k2g_evm_defconfig
+++ b/configs/k2g_evm_defconfig
@@ -8,6 +8,7 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_SYS_TEXT_BASE=0x0c00
 CONFIG_DEFAULT_DEVICE_TREE="keystone-k2g-evm"
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
diff --git a/configs/k2hk_evm_defconfig b/configs/k2hk_evm_defconfig
index d924796627..87fe2f437a 100644
--- a/configs/k2hk_evm_defconfig
+++ b/configs/k2hk_evm_defconfig
@@ -8,6 +8,7 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_SYS_TEXT_BASE=0x0c00
 CONFIG_DEFAULT_DEVICE_TREE="keystone-k2hk-evm"
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
diff --git a/configs/k2l_evm_defconfig b/configs/k2l_evm_defconfig
index c81758571c..9226488409 100644
--- a/configs/k2l_evm_defconfig
+++ b/configs/k2l_evm_defconfig
@@ -8,6 +8,7 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_SYS_TEXT_BASE=0x0c00
 CONFIG_DEFAULT_DEVICE_TREE="keystone-k2l-evm"
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
-- 
2.11.0

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


[U-Boot] [PATCH 3/9] arm: mach-omap2: Enable Kconfig support for K2 HS devices

2017-02-23 Thread Andrew F. Davis
Like the OMAP54xx, AM43xx, & AM33xx family SoCs, the keystone family
of SoCs also have high security enabled models. Allow K2E devices to
be built with HS Device Type Support.

Signed-off-by: Vitaly Andrianov 
Signed-off-by: Madan Srinivas 
Signed-off-by: Andrew F. Davis 
---
 arch/arm/mach-omap2/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 24bc485195..d74b068abc 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -1,6 +1,6 @@
 config TI_SECURE_DEVICE
bool "HS Device Type Support"
-   depends on OMAP54XX || AM43XX || AM33XX
+   depends on OMAP54XX || AM43XX || AM33XX || ARCH_KEYSTONE
help
  If a high secure (HS) device type is being used, this config
  must be set. This option impacts various aspects of the
-- 
2.11.0

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


[U-Boot] [PATCH 9/9] defconfig: k2hk_hs_evm: Add k2hk_hs_evm_defconfig

2017-02-23 Thread Andrew F. Davis
TI K2HK secure devices have to be built with TI_SECURE_DEVICE, FIT, and
FIT_IMAGE_POST_PROCESS enabled. Add a dedicated defconfig for this.

Signed-off-by: Andrew F. Davis 
---
 configs/k2hk_hs_evm_defconfig | 51 +++
 1 file changed, 51 insertions(+)
 create mode 100644 configs/k2hk_hs_evm_defconfig

diff --git a/configs/k2hk_hs_evm_defconfig b/configs/k2hk_hs_evm_defconfig
new file mode 100644
index 00..9fe91ea19c
--- /dev/null
+++ b/configs/k2hk_hs_evm_defconfig
@@ -0,0 +1,51 @@
+CONFIG_ARM=y
+CONFIG_ARCH_KEYSTONE=y
+CONFIG_SYS_TEXT_BASE=0x0c60
+CONFIG_TARGET_K2HK_EVM=y
+CONFIG_TI_SECURE_DEVICE=y
+CONFIG_DEFAULT_DEVICE_TREE="keystone-k2hk-evm"
+CONFIG_FIT=y
+CONFIG_FIT_IMAGE_POST_PROCESS=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="K2HK EVM # "
+CONFIG_CMD_BOOTZ=y
+# CONFIG_CMD_IMLS is not set
+CONFIG_CMD_ASKENV=y
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_NAND=y
+CONFIG_CMD_PART=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_SPI=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_USB=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_UBI=y
+CONFIG_ISO_PARTITION=y
+CONFIG_EFI_PARTITION=y
+CONFIG_OF_CONTROL=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM=y
+CONFIG_TI_AEMIF=y
+# CONFIG_MMC is not set
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_DM_ETH=y
+CONFIG_DM_SERIAL=y
+CONFIG_SYS_NS16550=y
+CONFIG_DM_SPI=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_STORAGE=y
-- 
2.11.0

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


[U-Boot] [PATCH 6/9] doc: Updates info on using Keystone2 secure devices

2017-02-23 Thread Andrew F. Davis
Add a section describing the secure boot image used on
Keystone2 secure devices.

Signed-off-by: Madan Srinivas 
Signed-off-by: Andrew F. Davis 
---
 doc/README.ti-secure | 20 
 1 file changed, 20 insertions(+)

diff --git a/doc/README.ti-secure b/doc/README.ti-secure
index 9b0fbf9732..4b5380c0f3 100644
--- a/doc/README.ti-secure
+++ b/doc/README.ti-secure
@@ -133,6 +133,26 @@ Booting of U-Boot SPL
u-boot-spl_HS_X-LOADER - boot image for all other flash memories
including QSPI and NOR flash
 
+   Invoking the script for Keystone2 Secure Devices
+   =
+
+   create-boot-image.sh \
+  
+
+is currently ignored and reserved for future use.
+
+is the full path and filename of the public world boot
+   loader binary file (only u-boot.bin is currently supported on
+   Keystone2 devices, u-boot-spl.bin is not currently supported).
+
+is the full path and filename of the final secure image.
+   The output binary images should be used in place of the standard
+   non-secure binary images (see the platform-specific user's guides
+   and releases notes for how the non-secure images are typically used)
+   u-boot_HS_MLO - signed and encrypted boot image that can be used to
+   boot from all media. Secure boot from SPI NOR flash is not
+   currently supported.
+
 Booting of Primary U-Boot (u-boot.img)
 ==
 
-- 
2.11.0

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


Re: [U-Boot] [PATCH v3] armv8: spl: Call spl_relocate_stack_gd for ARMv8

2017-02-23 Thread Simon Glass
Hi,

On 23 February 2017 at 02:25, Dr. Philipp Tomsich
 wrote:
> Simon,
>
> On 23 Feb 2017, at 03:23, Simon Glass  wrote:
>
> On 22 February 2017 at 11:01, Philipp Tomsich
>  wrote:
>
> As part of the startup process for boards using the SPL, we need to
> call spl_relocate_stack_gd. This is needed to set up malloc with its
> DRAM buffer.
>
> Signed-off-by: Philipp Tomsich 
> Reviewed-by: Andre Przywara 
> Reviewed-by: Simon Glass 
> ---
> arch/arm/lib/crt0_64.S | 13 +++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/lib/crt0_64.S b/arch/arm/lib/crt0_64.S
> index 19c6a98..a7cead5 100644
> --- a/arch/arm/lib/crt0_64.S
> +++ b/arch/arm/lib/crt0_64.S
> @@ -109,8 +109,17 @@ relocation_return:
>  */
>bl  c_runtime_cpu_setup /* still call old routine */
> #endif /* !CONFIG_SPL_BUILD */
> -
> -/* TODO: For SPL, call spl_relocate_stack_gd() to alloc stack relocation */
> +#if defined(CONFIG_SPL_BUILD)
> +   bl  spl_relocate_stack_gd   /* may return NULL */
> +   /* Perform 'sp = (x0 != NULL) ? x0 : sp' while working
> +* around the constraint that conditional moves can not
> +* have 'sp' as an operand
> +*/
>
>
> nit: Comment style again
>
>
> I thought is was the missing asterisks at the beginning of the line…
> What am I missing? Is it the indentation of the comment block?

It's just that you should now have any text on the /* line or the */ line, so:

   /*
* Perform 'sp = (x0 != NULL) ? x0 : sp' while working
* around the constraint that conditional moves can not
* have 'sp' as an operand
*/

That's the style of the U-Boot code base.

>
> +   mov x1, sp
> +   cmp x0, #0
> +   cselx0, x0, x1, ne
> +   mov sp, x0
> +#endif
>
> /*
>  * Clear BSS section
> --
> 1.9.1
>
>

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


[U-Boot] [PATCH 2/3] rockchip: rk3188: enable TPL_LIBGENERIC for generic memset

2017-02-23 Thread Heiko Stuebner
Commit c67c8c604b6c ("board_init.c: Always use memset()") dropped the naive
memset alternative from board_init_f_init_reserve.
So activate CONFIG_TPL_LIBGENERIC for that common memset implementation.
We cannot use the ARCH-specific memset, as that would incur 200bytes of
additional TPL size, space we do not have.

Signed-off-by: Heiko Stuebner 
---
 arch/arm/mach-rockchip/rk3188/Kconfig | 3 +++
 configs/rock_defconfig| 2 ++
 2 files changed, 5 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3188/Kconfig 
b/arch/arm/mach-rockchip/rk3188/Kconfig
index 5afc23ad2f..d129fcda99 100644
--- a/arch/arm/mach-rockchip/rk3188/Kconfig
+++ b/arch/arm/mach-rockchip/rk3188/Kconfig
@@ -27,6 +27,9 @@ config SPL_SERIAL_SUPPORT
 config TPL_LIBCOMMON_SUPPORT
default y
 
+config TPL_LIBGENERIC_SUPPORT
+   default y
+
 config TPL_SERIAL_SUPPORT
default y
 
diff --git a/configs/rock_defconfig b/configs/rock_defconfig
index 2705909e6c..86048c8fd7 100644
--- a/configs/rock_defconfig
+++ b/configs/rock_defconfig
@@ -34,6 +34,8 @@ CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 # CONFIG_SPL_SIMPLE_BUS is not set
 # CONFIG_SPL_MMC_SUPPORT is not set
+# CONFIG_SPL_USE_ARCH_MEMSET is not set
+# CONFIG_SPL_USE_ARCH_MEMCPY is not set
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_CLK=y
-- 
2.11.0

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


[U-Boot] [PATCH 3/3] rockchip: rk3188: drop CONFIG_SYS_NO_FLASH

2017-02-23 Thread Heiko Stuebner
Commit e856bdcfb492 ("flash: complete CONFIG_SYS_NO_FLASH move with renaming")
obsoleted the CONFIG_SYS_NO_FLASH option, which still is in our
rk3188_common.h header, resulting in warnings like
The following new ad-hoc CONFIG options were detected:
CONFIG_SYS_NO_FLASH

So also drop it from the rk3188 header.

Signed-off-by: Heiko Stuebner 
---
 include/configs/rk3188_common.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/configs/rk3188_common.h b/include/configs/rk3188_common.h
index 445b2da496..2ff7cd7b70 100644
--- a/include/configs/rk3188_common.h
+++ b/include/configs/rk3188_common.h
@@ -13,7 +13,6 @@
 #include "rockchip-common.h"
 
 #define CONFIG_SKIP_LOWLEVEL_INIT_ONLY
-#define CONFIG_SYS_NO_FLASH
 #define CONFIG_NR_DRAM_BANKS   1
 #define CONFIG_ENV_SIZE0x2000
 #define CONFIG_SYS_MAXARGS 16
-- 
2.11.0

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


[U-Boot] [PATCH 1/3] dm: Return actual bools in dm_fdt_pre_reloc

2017-02-23 Thread Heiko Stuebner
Documentation says that we're returning true/false, not 1/0 so adapt
the function to return actual booleans.

Signed-off-by: Heiko Stuebner 
---
 drivers/core/util.c | 12 ++--
 include/dm/util.h   |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/core/util.c b/drivers/core/util.c
index bd4de7acd6..5ceac8bbb1 100644
--- a/drivers/core/util.c
+++ b/drivers/core/util.c
@@ -37,17 +37,17 @@ int list_count_items(struct list_head *head)
return count;
 }
 
-int dm_fdt_pre_reloc(const void *blob, int offset)
+bool dm_fdt_pre_reloc(const void *blob, int offset)
 {
if (fdt_getprop(blob, offset, "u-boot,dm-pre-reloc", NULL))
-   return 1;
+   return true;
 
 #ifdef CONFIG_TPL_BUILD
if (fdt_getprop(blob, offset, "u-boot,dm-tpl", NULL))
-   return 1;
+   return true;
 #elif defined(CONFIG_SPL_BUILD)
if (fdt_getprop(blob, offset, "u-boot,dm-spl", NULL))
-   return 1;
+   return true;
 #else
/*
 * In regular builds individual spl and tpl handling both
@@ -55,8 +55,8 @@ int dm_fdt_pre_reloc(const void *blob, int offset)
 */
if (fdt_getprop(blob, offset, "u-boot,dm-spl", NULL) ||
fdt_getprop(blob, offset, "u-boot,dm-tpl", NULL))
-   return 1;
+   return true;
 #endif
 
-   return 0;
+   return false;
 }
diff --git a/include/dm/util.h b/include/dm/util.h
index 32060ab30e..45529ce0e6 100644
--- a/include/dm/util.h
+++ b/include/dm/util.h
@@ -72,6 +72,6 @@ static inline void dm_dump_devres(void)
  *
  * Returns true if node is needed in SPL/TL, false otherwise.
  */
-int dm_fdt_pre_reloc(const void *blob, int offset);
+bool dm_fdt_pre_reloc(const void *blob, int offset);
 
 #endif
-- 
2.11.0

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


Re: [U-Boot] [PATCH v3 4/7] rockchip: rk3328: add pinctrl driver

2017-02-23 Thread Simon Glass
On 23 February 2017 at 00:37, Kever Yang  wrote:
> Add rk3328 pinctrl driver and grf/iomux structure definition.
>
> Signed-off-by: William Zhang 
> Signed-off-by: Kever Yang 
> Acked-by: Simon Glass 
> ---
>
> Changes in v3: None
> Changes in v2:
> - fix include header file order
> - add space around operators in header file
>
>  arch/arm/include/asm/arch-rockchip/grf_rk3328.h | 134 
>  drivers/pinctrl/Kconfig |   9 +
>  drivers/pinctrl/rockchip/Makefile   |   1 +
>  drivers/pinctrl/rockchip/pinctrl_rk3328.c   | 419 
> 
>  4 files changed, 563 insertions(+)
>  create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3328.h
>  create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3328.c

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 00/20] rk3188 uboot support

2017-02-23 Thread Heiko Stuebner
Am Donnerstag, 23. Februar 2017, 09:19:20 CET schrieb Simon Glass:
> Hi Heiko,
> 
> On 22 February 2017 at 20:59, Heiko Stuebner  wrote:
> > Am Mittwoch, 22. Februar 2017, 20:26:18 CET schrieb Simon Glass:
> >> Hi Heiko,
> >> 
> >> On 18 February 2017 at 11:46, Heiko Stuebner  wrote:
> >> > Hi,
> >> > 
> >> > thanks to Kever finding the needle in the haystack (wrong resets
> >> > in sdram driver actually resetting the sdmmc controller) the rk3188
> >> > can now actually load uboot into memory from spl ... yay .
> >> > 
> >> > So this v4 does hopefully addresses all last review comments from
> >> > Simon and includes of course the newly received tags so far.
> >> > 
> >> > 
> >> > Heiko
> >> > 
> >> > Heiko Stuebner (21):
> >> >   dm: allow limiting pre-reloc markings to spl or tpl
> >> >   clk: rk3288: limit gpll and cpll init to SPL build
> >> >   rockchip: rk3288: sdram: use constants in ddrconf table
> >> >   rockchip: rk3288: sdram: style fixes from rk3188 sdram review
> >> >   rockchip: Move bootrom helper compilation to a hidden option
> >> >   rockchip: Move bootrom-related declarations to a header
> >> >   rockchip: mkimage: Allow encoding of loader code in spl images
> >> >   rockchip: mkimage: Add support rk3188 serial
> >> >   rockchip: serial: Adapt rockchip of-platdata driver for rk3188
> >> >   rockchip: rk3188: Add header files for PMU and GRF
> >> >   rockchip: rk3188: Add pinctrl driver
> >> >   rockchip: rk3188: Add sysreset driver
> >> >   rockchip: rk3188: Add rk3066/rk3188 clock bindings
> >> >   rockchip: rk3188: Add clock driver
> >> >   rockchip: rk3188: Add core devicetree files
> >> >   rockchip: rk3188: Add core support
> >> >   rockchip: rk3188: Add sdram driver
> >> >   rockchip: rk3188: Add main, spl and tpl boards
> >> >   rockchip: rk3188: Add Radxa Rock board
> >> >   rockchip: rk3188: add README.rockchip paragraph describing sd boot
> >> >   Add a temporary script that can create a bootimage for rk3188
> >> >  
> >> >  arch/arm/dts/Makefile   |   1 +
> >> >  arch/arm/dts/rk3188-radxarock.dts   | 382 +
> >> >  arch/arm/dts/rk3188.dtsi| 601 ++
> >> >  arch/arm/dts/rk3xxx.dtsi| 417 ++
> >> >  arch/arm/include/asm/arch-rockchip/bootrom.h|  22 +
> >> >  arch/arm/include/asm/arch-rockchip/cru_rk3188.h | 191 +
> >> >  arch/arm/include/asm/arch-rockchip/ddr_rk3188.h |  25 +
> >> >  arch/arm/include/asm/arch-rockchip/ddr_rk3288.h |   8 +
> >> >  arch/arm/include/asm/arch-rockchip/grf_rk3188.h | 589 ++
> >> >  arch/arm/include/asm/arch-rockchip/pmu_rk3188.h |  36 +
> >> >  arch/arm/mach-rockchip/Kconfig  |  20 +
> >> >  arch/arm/mach-rockchip/Makefile |  14 +-
> >> >  arch/arm/mach-rockchip/rk3036-board-spl.c   |   3 +-
> >> >  arch/arm/mach-rockchip/rk3188-board-spl.c   | 218 ++
> >> >  arch/arm/mach-rockchip/rk3188-board-tpl.c   |  86 ++
> >> >  arch/arm/mach-rockchip/rk3188-board.c   |  71 ++
> >> >  arch/arm/mach-rockchip/rk3188/Kconfig   |  35 +
> >> >  arch/arm/mach-rockchip/rk3188/Makefile  |  11 +
> >> >  arch/arm/mach-rockchip/rk3188/clk_rk3188.c  |  33 +
> >> >  arch/arm/mach-rockchip/rk3188/sdram_rk3188.c| 995
> >> >   arch/arm/mach-rockchip/rk3188/syscon_rk3188.c
> >> >  
> >> >  |  55 ++
> >> >  
> >> >  arch/arm/mach-rockchip/rk3288-board-spl.c   |   3 +-
> >> >  arch/arm/mach-rockchip/rk3288/sdram_rk3288.c|  59 +-
> >> >  board/radxa/rock/Kconfig|  15 +
> >> >  board/radxa/rock/MAINTAINERS|   6 +
> >> >  board/radxa/rock/Makefile   |   7 +
> >> >  board/radxa/rock/rock.c |   7 +
> >> >  configs/rock_defconfig  |  56 ++
> >> >  doc/README.rockchip |  26 +
> >> >  doc/driver-model/README.txt |   4 +
> >> >  drivers/clk/at91/pmc.c  |   3 +-
> >> >  drivers/clk/rockchip/Makefile   |   1 +
> >> >  drivers/clk/rockchip/clk_rk3188.c   | 527 +
> >> >  drivers/clk/rockchip/clk_rk3288.c   |   2 +
> >> >  drivers/core/root.c |   2 +-
> >> >  drivers/core/util.c |  25 +
> >> >  drivers/pinctrl/Kconfig |   9 +
> >> >  drivers/pinctrl/pinctrl-uclass.c|   3 +-
> >> >  drivers/pinctrl/rockchip/Makefile   |   1 +
> >> >  drivers/pinctrl/rockchip/pinctrl_rk3188.c   | 611 +++
> >> >  drivers/serial/serial_rockchip.c|  19 +-
> >> >  drivers/sysreset/Makefile   |   1 +
> >> >  drivers/sysreset/sysreset_rk3188.c  |  47 ++
> >> >  include/configs/rk3188_common.h | 125 +++
> >> >  

Re: [U-Boot] [PATCH v3 7/7] rockchip: rk3288: add defconfig for evb-rk3328

2017-02-23 Thread Simon Glass
On 23 February 2017 at 00:37, Kever Yang  wrote:
> Enable board config for evb-rk3328.
> SDcard and eMMC boot is OK in this initial version,
> USB and EMAC function is not available now, will comes later.
>
> Signed-off-by: William Zhang 
> Signed-off-by: Kever Yang 
> Acked-by: Simon Glass 
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  configs/evb-rk3328_defconfig | 36 
>  1 file changed, 36 insertions(+)
>  create mode 100644 configs/evb-rk3328_defconfig

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/7] rockchip: rk3328: add soc basic support

2017-02-23 Thread Simon Glass
On 23 February 2017 at 00:37, Kever Yang  wrote:
> RK3328 is a SoC from Rockchip with quad-core Cortex-A53 CPU.
> It supports two USB2.0 EHCI ports. Other interfaces are very
> much like RK3288, the DRAM are 32bit width address and support
> address from 0 to 4GB-16MB range.
>
> Signed-off-by: William Zhang 
> Signed-off-by: Kever Yang 
> Acked-by: Simon Glass 
> ---
>
> Changes in v3:
> - Removed contents of rk3328/Kconfig to avoid build error
>
> Changes in v2: None
>
>  arch/arm/mach-rockchip/Kconfig| 11 +
>  arch/arm/mach-rockchip/Makefile   |  1 +
>  arch/arm/mach-rockchip/rk3328/Makefile|  8 
>  arch/arm/mach-rockchip/rk3328/rk3328.c| 39 
>  arch/arm/mach-rockchip/rk3328/syscon_rk3328.c | 20 +
>  include/configs/rk3328_common.h   | 65 
> +++
>  6 files changed, 144 insertions(+)
>  create mode 100644 arch/arm/mach-rockchip/rk3328/Makefile
>  create mode 100644 arch/arm/mach-rockchip/rk3328/rk3328.c
>  create mode 100644 arch/arm/mach-rockchip/rk3328/syscon_rk3328.c
>  create mode 100644 include/configs/rk3328_common.h

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/7] rockchip: rk3328: add device tree file

2017-02-23 Thread Simon Glass
On 23 February 2017 at 00:37, Kever Yang  wrote:
> Add dts binding header for rk3328, files origin from kernel.
>
> Signed-off-by: William Zhang 
> Signed-off-by: Kever Yang 
> Acked-by: Simon Glass 
> ---
>
> Changes in v3:
> - Moved new binding #defines into this patch to avoid build error
>
> Changes in v2: None
>
>  arch/arm/dts/Makefile  |1 +
>  arch/arm/dts/rk3328-evb.dts|   45 +
>  arch/arm/dts/rk3328.dtsi   | 1477 
> 
>  include/dt-bindings/clock/rk3328-cru.h |  394 +
>  include/dt-bindings/pinctrl/rockchip.h |2 +
>  5 files changed, 1919 insertions(+)
>  create mode 100644 arch/arm/dts/rk3328-evb.dts
>  create mode 100644 arch/arm/dts/rk3328.dtsi
>  create mode 100644 include/dt-bindings/clock/rk3328-cru.h

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] rockchip: tinker: configs: use correct mmc instance as boot target device

2017-02-23 Thread Simon Glass
On 21 February 2017 at 20:59, Simon Glass  wrote:
> On 19 February 2017 at 20:08, Eddie Cai  wrote:
>> We are using wrong mmc instance as boot target device now. below Jaehoon 
>> Chung's
>> patch use mmc alias which correct it. That make tinker board can not find mmc
>> device. So give it correct mmc device instance.
>>
>> commit 02ad33aa3a84821c8d9a6c4f167f143f6248b084
>> Author: Jaehoon Chung 
>> Date:   Thu Feb 2 13:41:14 2017 +0900
>>
>> mmc: mmc-uclass: use the fixed devnum with alias node
>>
>> Signed-off-by: Eddie Cai 
>> ---
>>  include/configs/tinker_rk3288.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Acked-by: Simon Glass 

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 4/4] config: rk3399: enable SPL config for evb-rk3399

2017-02-23 Thread Simon Glass
On 22 February 2017 at 01:56, Kever Yang  wrote:
> Enable all the CONFIGs which need by SPL.
>
> Signed-off-by: Kever Yang 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v3: None
> Changes in v2: None
> Changes in v1: None
>
>  configs/evb-rk3399_defconfig| 18 ++
>  include/configs/rk3399_common.h |  5 +
>  2 files changed, 23 insertions(+)

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 02/10] sunxi: icnova-a20-swac_defconfig: Remove AXP209_POWER from SYS_EXTRA_OPTIONS

2017-02-23 Thread Mylène Josserand
Remove the AXP209_POWER option from SYS_EXTRA_OPTIONS.
As this configuration already exists on Kconfig, we just need
to remove it from defconfig.

Signed-off-by: Mylène Josserand 
---
 configs/icnova-a20-swac_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/icnova-a20-swac_defconfig 
b/configs/icnova-a20-swac_defconfig
index 85c4806a87..84ca843f1f 100644
--- a/configs/icnova-a20-swac_defconfig
+++ b/configs/icnova-a20-swac_defconfig
@@ -14,7 +14,7 @@ CONFIG_VIDEO_LCD_PANEL_LVDS=y
 CONFIG_SUNXI_GMAC=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-icnova-swac"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,CMD_BMP,CMD_UNZIP"
+CONFIG_SYS_EXTRA_OPTIONS="CMD_BMP,CMD_UNZIP"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
-- 
2.11.0

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


[U-Boot] [PATCH 09/10] sunxi: Convert CONFIG_MACPWR to Kconfig

2017-02-23 Thread Mylène Josserand
Convert the CONFIG_MACPWR to Kconfig and update all the sunxi defconfigs
that used it in SYS_EXTRA_OPTIONS.

Signed-off-by: Mylène Josserand 
---
 board/sunxi/Kconfig   | 7 +++
 board/sunxi/board.c   | 7 ---
 configs/Bananapi_defconfig| 2 +-
 configs/Bananapro_defconfig   | 2 +-
 configs/Lamobo_R1_defconfig   | 2 +-
 configs/Mele_A1000_defconfig  | 2 +-
 configs/Orangepi_defconfig| 2 +-
 configs/Orangepi_mini_defconfig   | 2 +-
 configs/i12-tvbox_defconfig   | 2 +-
 configs/jesurun_q5_defconfig  | 2 +-
 configs/mixtile_loftq_defconfig   | 2 +-
 configs/orangepi_plus2e_defconfig | 2 +-
 configs/orangepi_plus_defconfig   | 2 +-
 13 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 0ba8e86f05..492bf14ae1 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -318,6 +318,13 @@ config OLD_SUNXI_KERNEL_COMPAT
Set this to enable various workarounds for old kernels, this results in
sub-optimal settings for newer kernels, only enable if needed.
 
+config MACPWR
+   string "MAC power pin"
+   default ""
+   ---help---
+   Set the pin used to power the MAC. This takes a string in the format
+   understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
+
 config MMC
depends on !UART0_PORT_F
default y if ARCH_SUNXI
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 131986bd17..906a06d0d9 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -80,7 +80,7 @@ DECLARE_GLOBAL_DATA_PTR;
 /* add board specific code here */
 int board_init(void)
 {
-   __maybe_unused int id_pfr1, ret, satapwr_pin;
+   __maybe_unused int id_pfr1, ret, satapwr_pin, macpwr_pin;
 
gd->bd->bi_boot_params = (PHYS_SDRAM_0 + 0x100);
 
@@ -123,8 +123,9 @@ int board_init(void)
gpio_direction_output(satapwr_pin, 1);
 #endif
 #ifdef CONFIG_MACPWR
-   gpio_request(CONFIG_MACPWR, "macpwr");
-   gpio_direction_output(CONFIG_MACPWR, 1);
+   macpwr_pin = sunxi_name_to_gpio(CONFIG_MACPWR);
+   gpio_request(macpwr_pin, "macpwr");
+   gpio_direction_output(macpwr_pin, 1);
 #endif
 
/* Uses dm gpio code so do this here and not in i2c_init_board() */
diff --git a/configs/Bananapi_defconfig b/configs/Bananapi_defconfig
index 8751875d03..311cfdc2df 100644
--- a/configs/Bananapi_defconfig
+++ b/configs/Bananapi_defconfig
@@ -3,6 +3,7 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=432
+CONFIG_MACPWR="PH23"
 CONFIG_RGMII=y
 CONFIG_VIDEO_COMPOSITE=y
 CONFIG_SUNXI_GMAC=y
@@ -10,7 +11,6 @@ CONFIG_GMAC_TX_DELAY=3
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-bananapi"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="MACPWR=SUNXI_GPH(23)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/Bananapro_defconfig b/configs/Bananapro_defconfig
index e70dbb8730..26f920c86a 100644
--- a/configs/Bananapro_defconfig
+++ b/configs/Bananapro_defconfig
@@ -3,6 +3,7 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=432
+CONFIG_MACPWR="PH23"
 CONFIG_RGMII=y
 CONFIG_USB1_VBUS_PIN="PH0"
 CONFIG_USB2_VBUS_PIN="PH1"
@@ -12,7 +13,6 @@ CONFIG_GMAC_TX_DELAY=3
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-bananapro"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="MACPWR=SUNXI_GPH(23)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/Lamobo_R1_defconfig b/configs/Lamobo_R1_defconfig
index 3029dc0ee0..c79b5c9d6d 100644
--- a/configs/Lamobo_R1_defconfig
+++ b/configs/Lamobo_R1_defconfig
@@ -3,6 +3,7 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=432
+CONFIG_MACPWR="PH23"
 CONFIG_MMC0_CD_PIN="PH10"
 CONFIG_RGMII=y
 CONFIG_SATAPWR="PB3"
@@ -11,7 +12,6 @@ CONFIG_GMAC_TX_DELAY=4
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-lamobo-r1"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="MACPWR=SUNXI_GPH(23)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/Mele_A1000_defconfig b/configs/Mele_A1000_defconfig
index 1ff4364cd5..cde760051e 100644
--- a/configs/Mele_A1000_defconfig
+++ b/configs/Mele_A1000_defconfig
@@ -2,12 +2,12 @@ CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_MACH_SUN4I=y
+CONFIG_MACPWR="PH15"
 CONFIG_VIDEO_VGA=y
 CONFIG_VIDEO_COMPOSITE=y
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-a1000"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="MACPWR=SUNXI_GPH(15)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/Orangepi_defconfig b/configs/Orangepi_defconfig
index 195d451c57..44e2c0867d 100644
--- a/configs/Orangepi_defconfig
+++ 

[U-Boot] [PATCH 01/10] sunxi: Convert SUNXI_GMAC to Kconfig

2017-02-23 Thread Mylène Josserand
Move the SUNXI_GMAC config option to Kconfig and remove it
from SYS_EXTRA_OPTIONS.

Signed-off-by: Mylène Josserand 
---
 board/sunxi/Kconfig| 5 +
 configs/A20-OLinuXino-Lime2_defconfig  | 3 ++-
 configs/A20-OLinuXino-Lime_defconfig   | 3 ++-
 configs/A20-OLinuXino_MICRO_defconfig  | 3 ++-
 configs/A20-Olimex-SOM-EVB_defconfig   | 3 ++-
 configs/Bananapi_defconfig | 3 ++-
 configs/Bananapro_defconfig| 3 ++-
 configs/CSQ_CS908_defconfig| 2 +-
 configs/Colombus_defconfig | 3 ++-
 configs/Cubieboard2_defconfig  | 3 ++-
 configs/Cubietruck_defconfig   | 3 ++-
 configs/Hummingbird_A31_defconfig  | 3 ++-
 configs/Itead_Ibox_A20_defconfig   | 3 ++-
 configs/Lamobo_R1_defconfig| 3 ++-
 configs/Linksprite_pcDuino3_Nano_defconfig | 3 ++-
 configs/Linksprite_pcDuino3_defconfig  | 3 ++-
 configs/Mele_A1000G_quad_defconfig | 2 +-
 configs/Mele_I7_defconfig  | 2 +-
 configs/Mele_M3_defconfig  | 2 +-
 configs/Mele_M5_defconfig  | 2 +-
 configs/Mele_M9_defconfig  | 2 +-
 configs/Orangepi_defconfig | 3 ++-
 configs/Orangepi_mini_defconfig| 3 ++-
 configs/Sinlinx_SinA31s_defconfig  | 2 +-
 configs/Sinovoip_BPI_M2_defconfig  | 3 ++-
 configs/Wits_Pro_A20_DKT_defconfig | 3 ++-
 configs/i12-tvbox_defconfig| 3 ++-
 configs/icnova-a20-swac_defconfig  | 3 ++-
 configs/mixtile_loftq_defconfig| 3 ++-
 29 files changed, 54 insertions(+), 28 deletions(-)

diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 00011331b9..ff11b98ddb 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -683,6 +683,11 @@ config VIDEO_LCD_TL059WV5C0
 
 endchoice
 
+config SUNXI_GMAC
+   bool "Enable GMAC Ethernet support"
+   default n
+   ---help---
+   Enable the support for the GMAC Ethernet controller
 
 config GMAC_TX_DELAY
int "GMAC Transmit Clock Delay Chain"
diff --git a/configs/A20-OLinuXino-Lime2_defconfig 
b/configs/A20-OLinuXino-Lime2_defconfig
index 8fd7c64e77..47a876082a 100644
--- a/configs/A20-OLinuXino-Lime2_defconfig
+++ b/configs/A20-OLinuXino-Lime2_defconfig
@@ -6,10 +6,11 @@ CONFIG_DRAM_CLK=384
 CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_USB0_VBUS_PIN="PC17"
 CONFIG_USB0_VBUS_DET="PH5"
+CONFIG_SUNXI_GMAC=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime2"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,SATAPWR=SUNXI_GPC(3)"
+CONFIG_SYS_EXTRA_OPTIONS="RGMII,SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/A20-OLinuXino-Lime_defconfig 
b/configs/A20-OLinuXino-Lime_defconfig
index 26e6ace103..e84f1c760a 100644
--- a/configs/A20-OLinuXino-Lime_defconfig
+++ b/configs/A20-OLinuXino-Lime_defconfig
@@ -4,10 +4,11 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=384
 CONFIG_MMC0_CD_PIN="PH1"
+CONFIG_SUNXI_GMAC=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,SATAPWR=SUNXI_GPC(3)"
+CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/A20-OLinuXino_MICRO_defconfig 
b/configs/A20-OLinuXino_MICRO_defconfig
index d629eb1b36..b08708a9b9 100644
--- a/configs/A20-OLinuXino_MICRO_defconfig
+++ b/configs/A20-OLinuXino_MICRO_defconfig
@@ -7,10 +7,11 @@ CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_MMC3_CD_PIN="PH11"
 CONFIG_MMC_SUNXI_SLOT_EXTRA=3
 CONFIG_VIDEO_VGA=y
+CONFIG_SUNXI_GMAC=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-micro"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,SATAPWR=SUNXI_GPB(8)"
+CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPB(8)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/A20-Olimex-SOM-EVB_defconfig 
b/configs/A20-Olimex-SOM-EVB_defconfig
index b5d52dba24..dd7b1ac3e9 100644
--- a/configs/A20-Olimex-SOM-EVB_defconfig
+++ b/configs/A20-Olimex-SOM-EVB_defconfig
@@ -9,10 +9,11 @@ CONFIG_MMC3_PINS="PH"
 CONFIG_MMC_SUNXI_SLOT_EXTRA=3
 CONFIG_USB0_VBUS_PIN="PB9"
 CONFIG_USB0_VBUS_DET="PH5"
+CONFIG_SUNXI_GMAC=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olimex-som-evb"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,SATAPWR=SUNXI_GPC(3)"
+CONFIG_SYS_EXTRA_OPTIONS="RGMII,SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/Bananapi_defconfig b/configs/Bananapi_defconfig
index 0f2ef1b7ed..c6a9e88351 100644
--- a/configs/Bananapi_defconfig
+++ b/configs/Bananapi_defconfig
@@ -4,11 +4,12 @@ 

[U-Boot] [PATCH 04/10] sunxi: icnova-a20-swac_defconfig: Remove CMD_UNZIP and SYS_EXTRA_OPTIONS

2017-02-23 Thread Mylène Josserand
Remove this command as it is not necessary in defconfig file.
As there is no more command/option in SYS_EXTRA_OPTIONS, it
can be removed from this defconfig file.

Signed-off-by: Mylène Josserand 
---
 configs/icnova-a20-swac_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configs/icnova-a20-swac_defconfig 
b/configs/icnova-a20-swac_defconfig
index ccd4429d35..0bc2fbecfd 100644
--- a/configs/icnova-a20-swac_defconfig
+++ b/configs/icnova-a20-swac_defconfig
@@ -14,7 +14,6 @@ CONFIG_VIDEO_LCD_PANEL_LVDS=y
 CONFIG_SUNXI_GMAC=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-icnova-swac"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="CMD_UNZIP"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
-- 
2.11.0

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


[U-Boot] [PATCH 06/10] sunxi: Convert SUNXI_EMAC to Kconfig

2017-02-23 Thread Mylène Josserand
Convert the SUNXI_EMAC config to Kconfig. Remove it from SYS_EXTRA_OPTIONS
from many sunxi defconfig.

Signed-off-by: Mylène Josserand 
---
 configs/A10-OLinuXino-Lime_defconfig | 3 ++-
 configs/A10s-OLinuXino-M_defconfig   | 2 +-
 configs/Cubieboard_defconfig | 3 ++-
 configs/Linksprite_pcDuino_defconfig | 2 +-
 configs/Marsboard_A10_defconfig  | 2 +-
 configs/Mele_A1000_defconfig | 3 ++-
 configs/ba10_tv_box_defconfig| 2 +-
 configs/jesurun_q5_defconfig | 3 ++-
 drivers/net/Kconfig  | 6 ++
 9 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/configs/A10-OLinuXino-Lime_defconfig 
b/configs/A10-OLinuXino-Lime_defconfig
index 50436a7a52..74f6fc2d76 100644
--- a/configs/A10-OLinuXino-Lime_defconfig
+++ b/configs/A10-OLinuXino-Lime_defconfig
@@ -9,11 +9,12 @@ CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-olinuxino-lime"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC,SATAPWR=SUNXI_GPC(3)"
+CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_SUNXI_EMAC=y
 CONFIG_AXP_ALDO3_VOLT=2800
 CONFIG_AXP_ALDO4_VOLT=2800
 CONFIG_USB_EHCI_HCD=y
diff --git a/configs/A10s-OLinuXino-M_defconfig 
b/configs/A10s-OLinuXino-M_defconfig
index e2bebf827c..3f766244ee 100644
--- a/configs/A10s-OLinuXino-M_defconfig
+++ b/configs/A10s-OLinuXino-M_defconfig
@@ -9,10 +9,10 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=1
 CONFIG_USB1_VBUS_PIN="PB10"
 CONFIG_DEFAULT_DEVICE_TREE="sun5i-a10s-olinuxino-micro"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_SUNXI_EMAC=y
 CONFIG_AXP152_POWER=y
 CONFIG_USB_EHCI_HCD=y
diff --git a/configs/Cubieboard_defconfig b/configs/Cubieboard_defconfig
index 64aebed2f1..2c16b0fc72 100644
--- a/configs/Cubieboard_defconfig
+++ b/configs/Cubieboard_defconfig
@@ -7,9 +7,10 @@ CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-cubieboard"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC,SATAPWR=SUNXI_GPB(8)"
+CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPB(8)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_SUNXI_EMAC=y
 CONFIG_USB_EHCI_HCD=y
diff --git a/configs/Linksprite_pcDuino_defconfig 
b/configs/Linksprite_pcDuino_defconfig
index ab094a6553..93a99af917 100644
--- a/configs/Linksprite_pcDuino_defconfig
+++ b/configs/Linksprite_pcDuino_defconfig
@@ -6,9 +6,9 @@ CONFIG_USB1_VBUS_PIN=""
 CONFIG_USB2_VBUS_PIN=""
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-pcduino"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_SUNXI_EMAC=y
 CONFIG_USB_EHCI_HCD=y
diff --git a/configs/Marsboard_A10_defconfig b/configs/Marsboard_A10_defconfig
index 0d381ff1b8..a1ddae76e0 100644
--- a/configs/Marsboard_A10_defconfig
+++ b/configs/Marsboard_A10_defconfig
@@ -4,10 +4,10 @@ CONFIG_MACH_SUN4I=y
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-marsboard"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_SUNXI_EMAC=y
 CONFIG_SUNXI_NO_PMIC=y
 CONFIG_USB_EHCI_HCD=y
diff --git a/configs/Mele_A1000_defconfig b/configs/Mele_A1000_defconfig
index 820d5ed98e..1ff4364cd5 100644
--- a/configs/Mele_A1000_defconfig
+++ b/configs/Mele_A1000_defconfig
@@ -7,9 +7,10 @@ CONFIG_VIDEO_COMPOSITE=y
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-a1000"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC,MACPWR=SUNXI_GPH(15)"
+CONFIG_SYS_EXTRA_OPTIONS="MACPWR=SUNXI_GPH(15)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_SUNXI_EMAC=y
 CONFIG_USB_EHCI_HCD=y
diff --git a/configs/ba10_tv_box_defconfig b/configs/ba10_tv_box_defconfig
index c60766ce3c..7570cf3457 100644
--- a/configs/ba10_tv_box_defconfig
+++ b/configs/ba10_tv_box_defconfig
@@ -9,10 +9,10 @@ CONFIG_USB2_VBUS_PIN="PH12"
 CONFIG_VIDEO_COMPOSITE=y
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-ba10-tvbox"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_SUNXI_EMAC=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_HOST=y
diff --git a/configs/jesurun_q5_defconfig b/configs/jesurun_q5_defconfig
index 6e4e6ca235..988a15f348 100644
--- a/configs/jesurun_q5_defconfig
+++ b/configs/jesurun_q5_defconfig
@@ -7,10 +7,11 @@ CONFIG_USB0_VBUS_PIN="PB9"
 

[U-Boot] [PATCH 08/10] sunxi: Convert CONFIG_SATAPWR to Kconfig

2017-02-23 Thread Mylène Josserand
Convert the CONFIG_SATAPWR into kconfig.
Thanks to that, many SYS_EXTRA_OPTIONS can be removed from some
defconfigs.

Signed-off-by: Mylène Josserand 
---
 board/sunxi/Kconfig| 8 
 board/sunxi/board.c| 7 ---
 configs/A10-OLinuXino-Lime_defconfig   | 2 +-
 configs/A20-OLinuXino-Lime2_defconfig  | 2 +-
 configs/A20-OLinuXino-Lime_defconfig   | 2 +-
 configs/A20-OLinuXino_MICRO_defconfig  | 2 +-
 configs/A20-Olimex-SOM-EVB_defconfig   | 2 +-
 configs/Cubieboard2_defconfig  | 2 +-
 configs/Cubieboard_defconfig   | 2 +-
 configs/Cubietruck_defconfig   | 2 +-
 configs/Itead_Ibox_A20_defconfig   | 2 +-
 configs/Lamobo_R1_defconfig| 3 ++-
 configs/Linksprite_pcDuino3_Nano_defconfig | 2 +-
 configs/Linksprite_pcDuino3_defconfig  | 2 +-
 configs/Sinovoip_BPI_M3_defconfig  | 2 +-
 configs/orangepi_plus_defconfig| 3 ++-
 16 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index a51066f7c6..0ba8e86f05 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -690,6 +690,14 @@ config VIDEO_LCD_TL059WV5C0
 
 endchoice
 
+config SATAPWR
+   string "SATA power pin"
+   default ""
+   ---help---
+   Set the pins used to power the SATA. This takes a string in the
+   format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of
+   port H.
+
 config SUNXI_GMAC
bool "Enable GMAC Ethernet support"
default n
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 53656383d5..131986bd17 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -80,7 +80,7 @@ DECLARE_GLOBAL_DATA_PTR;
 /* add board specific code here */
 int board_init(void)
 {
-   __maybe_unused int id_pfr1, ret;
+   __maybe_unused int id_pfr1, ret, satapwr_pin;
 
gd->bd->bi_boot_params = (PHYS_SDRAM_0 + 0x100);
 
@@ -118,8 +118,9 @@ int board_init(void)
return ret;
 
 #ifdef CONFIG_SATAPWR
-   gpio_request(CONFIG_SATAPWR, "satapwr");
-   gpio_direction_output(CONFIG_SATAPWR, 1);
+   satapwr_pin = sunxi_name_to_gpio(CONFIG_SATAPWR);
+   gpio_request(satapwr_pin, "satapwr");
+   gpio_direction_output(satapwr_pin, 1);
 #endif
 #ifdef CONFIG_MACPWR
gpio_request(CONFIG_MACPWR, "macpwr");
diff --git a/configs/A10-OLinuXino-Lime_defconfig 
b/configs/A10-OLinuXino-Lime_defconfig
index 74f6fc2d76..8404d0f3dd 100644
--- a/configs/A10-OLinuXino-Lime_defconfig
+++ b/configs/A10-OLinuXino-Lime_defconfig
@@ -6,10 +6,10 @@ CONFIG_DRAM_CLK=480
 CONFIG_DRAM_EMR1=4
 CONFIG_SYS_CLK_FREQ=91200
 CONFIG_MMC0_CD_PIN="PH1"
+CONFIG_SATAPWR="PC3"
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-olinuxino-lime"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/A20-OLinuXino-Lime2_defconfig 
b/configs/A20-OLinuXino-Lime2_defconfig
index 40468f1394..92d15f7a35 100644
--- a/configs/A20-OLinuXino-Lime2_defconfig
+++ b/configs/A20-OLinuXino-Lime2_defconfig
@@ -7,11 +7,11 @@ CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_RGMII=y
 CONFIG_USB0_VBUS_PIN="PC17"
 CONFIG_USB0_VBUS_DET="PH5"
+CONFIG_SATAPWR="PC3"
 CONFIG_SUNXI_GMAC=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime2"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/A20-OLinuXino-Lime_defconfig 
b/configs/A20-OLinuXino-Lime_defconfig
index e84f1c760a..aa14c7232b 100644
--- a/configs/A20-OLinuXino-Lime_defconfig
+++ b/configs/A20-OLinuXino-Lime_defconfig
@@ -4,11 +4,11 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=384
 CONFIG_MMC0_CD_PIN="PH1"
+CONFIG_SATAPWR="PC3"
 CONFIG_SUNXI_GMAC=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/A20-OLinuXino_MICRO_defconfig 
b/configs/A20-OLinuXino_MICRO_defconfig
index b08708a9b9..7f78a3f625 100644
--- a/configs/A20-OLinuXino_MICRO_defconfig
+++ b/configs/A20-OLinuXino_MICRO_defconfig
@@ -7,11 +7,11 @@ CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_MMC3_CD_PIN="PH11"
 CONFIG_MMC_SUNXI_SLOT_EXTRA=3
 CONFIG_VIDEO_VGA=y
+CONFIG_SATAPWR="PC3"
 CONFIG_SUNXI_GMAC=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-micro"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPB(8)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/A20-Olimex-SOM-EVB_defconfig 
b/configs/A20-Olimex-SOM-EVB_defconfig
index 03f99809ef..4524959320 100644
--- 

[U-Boot] [PATCH 03/10] sunxi: icnova-a20-swac_defconfig: Remove CMD_BMP from SYS_EXTRA_OPTIONS

2017-02-23 Thread Mylène Josserand
This configuration is not necessary in a defconfig file so
it is removed from the SYS_EXTRA_OPTIONS.

Signed-off-by: Mylène Josserand 
---
 configs/icnova-a20-swac_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/icnova-a20-swac_defconfig 
b/configs/icnova-a20-swac_defconfig
index 84ca843f1f..ccd4429d35 100644
--- a/configs/icnova-a20-swac_defconfig
+++ b/configs/icnova-a20-swac_defconfig
@@ -14,7 +14,7 @@ CONFIG_VIDEO_LCD_PANEL_LVDS=y
 CONFIG_SUNXI_GMAC=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-icnova-swac"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="CMD_BMP,CMD_UNZIP"
+CONFIG_SYS_EXTRA_OPTIONS="CMD_UNZIP"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
-- 
2.11.0

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


[U-Boot] [PATCH 00/10] sunxi: Remove SYS_EXTRA_OPTIONS

2017-02-23 Thread Mylène Josserand
Hello everyone,

This patchset removes the SYS_EXTRA_OPTIONS from all sunxi defconfigs.
The values in this variable are converted to Kconfig or simply removed.

Based on u-boot sunxi repository: git://git.denx.de/u-boot-sunxi.git
from last commit: 002d907da51fdf10a03d389852645675529c78e6

Patch 1: Convert SUNXI_GMAC config to Kconfig and remove it from
all defconfig.
Patch 2: Remove AXP209_POWER configuration as this config is already
converted in Kconfig (drivers/power). It is automatically chosen when
the SoC is sun4i, sun5i or sun7i.
Patch 3 and 4: Remove CMD_BMP and CMD_ZIP configs from SYS_EXTRA_OPTIONS.
Patch 5: Remove SYS_EXTRA_OPTIONS from mk802_defconfig as it contains
only USB_EHCI which is already converted to Kconfig.
Patch 6, 7: Convert SUNXI_EMAC and CONFIG_RGMII to Kconfig and remove it
from all SYS_EXTRA_OPTIONS entries.
Patch 8 and 9: Convert CONFIG_SATAPWR and CONFIG_MACPWR to Kconfig. It becomes
a string instead of the gpio number so the function sunxi_name_to_gpio
is used to do the conversion from string to int.
Patch 10: Convert console index (CONS_INDEX) to Kconfig. The default value is 1
except for sun5i which is 2 and sun8i which is 5.

Thank you in advance!
Best regards,

Mylène Josserand (10):
  sunxi: Convert SUNXI_GMAC to Kconfig
  sunxi: icnova-a20-swac_defconfig: Remove AXP209_POWER from
SYS_EXTRA_OPTIONS
  sunxi: icnova-a20-swac_defconfig: Remove CMD_BMP from
SYS_EXTRA_OPTIONS
  sunxi: icnova-a20-swac_defconfig: Remove CMD_UNZIP and
SYS_EXTRA_OPTIONS
  sunxi: mk802_defconfig: Remove SYS_EXTRA_OPTIONS
  sunxi: Convert SUNXI_EMAC to Kconfig
  sunxi: Convert CONFIG_RGMII to Kconfig
  sunxi: Convert CONFIG_SATAPWR to Kconfig
  sunxi: Convert CONFIG_MACPWR to Kconfig
  sunxi: Convert CONS_INDEX to Kconfig

 board/sunxi/Kconfig| 36 ++
 board/sunxi/board.c| 12 +-
 configs/A10-OLinuXino-Lime_defconfig   |  3 ++-
 configs/A10s-OLinuXino-M_defconfig |  2 +-
 configs/A13-OLinuXinoM_defconfig   |  1 -
 configs/A13-OLinuXino_defconfig|  1 -
 configs/A20-OLinuXino-Lime2_defconfig  |  4 +++-
 configs/A20-OLinuXino-Lime_defconfig   |  3 ++-
 configs/A20-OLinuXino_MICRO_defconfig  |  3 ++-
 configs/A20-Olimex-SOM-EVB_defconfig   |  4 +++-
 configs/Ampe_A76_defconfig |  1 -
 configs/Bananapi_defconfig |  4 +++-
 configs/Bananapro_defconfig|  4 +++-
 configs/CHIP_defconfig |  1 -
 configs/CSQ_CS908_defconfig|  2 +-
 configs/Colombus_defconfig |  3 ++-
 configs/Cubieboard2_defconfig  |  3 ++-
 configs/Cubieboard_defconfig   |  3 ++-
 configs/Cubietruck_defconfig   |  4 +++-
 configs/Empire_electronix_d709_defconfig   |  1 -
 configs/Empire_electronix_m712_defconfig   |  1 -
 configs/Hummingbird_A31_defconfig  |  3 ++-
 configs/Itead_Ibox_A20_defconfig   |  3 ++-
 configs/Lamobo_R1_defconfig|  5 -
 configs/Linksprite_pcDuino3_Nano_defconfig |  4 +++-
 configs/Linksprite_pcDuino3_defconfig  |  3 ++-
 configs/Linksprite_pcDuino_defconfig   |  2 +-
 configs/Marsboard_A10_defconfig|  2 +-
 configs/Mele_A1000G_quad_defconfig |  2 +-
 configs/Mele_A1000_defconfig   |  3 ++-
 configs/Mele_I7_defconfig  |  2 +-
 configs/Mele_M3_defconfig  |  2 +-
 configs/Mele_M5_defconfig  |  2 +-
 configs/Mele_M9_defconfig  |  2 +-
 configs/Orangepi_defconfig |  4 +++-
 configs/Orangepi_mini_defconfig|  4 +++-
 configs/Sinlinx_SinA31s_defconfig  |  2 +-
 configs/Sinovoip_BPI_M2_defconfig  |  3 ++-
 configs/Sinovoip_BPI_M3_defconfig  |  2 +-
 configs/Wits_Pro_A20_DKT_defconfig |  3 ++-
 configs/ba10_tv_box_defconfig  |  2 +-
 configs/difrnce_dit4350_defconfig  |  1 -
 configs/ga10h_v1_1_defconfig   |  1 -
 configs/gt90h_v4_defconfig |  1 -
 configs/i12-tvbox_defconfig|  3 ++-
 configs/iNet_D978_rev2_defconfig   |  1 -
 configs/icnova-a20-swac_defconfig  |  2 +-
 configs/inet86dz_defconfig |  1 -
 configs/inet98v_rev2_defconfig |  1 -
 configs/jesurun_q5_defconfig   |  3 ++-
 configs/mixtile_loftq_defconfig|  4 +++-
 configs/mk802_defconfig|  1 -
 configs/orangepi_plus2e_defconfig  |  2 +-
 configs/orangepi_plus_defconfig|  3 ++-
 configs/polaroid_mid2407pxe03_defconfig|  1 -
 configs/polaroid_mid2809pxe04_defconfig|  1 -
 configs/q8_a13_tablet_defconfig|  1 -
 configs/q8_a23_tablet_800x480_defconfig|  1 -
 configs/q8_a33_tablet_1024x600_defconfig   |  1 -
 configs/q8_a33_tablet_800x480_defconfig|  1 -
 drivers/net/Kconfig|  6 

[U-Boot] [PATCH 05/10] sunxi: mk802_defconfig: Remove SYS_EXTRA_OPTIONS

2017-02-23 Thread Mylène Josserand
The USB_EHCI configuration is already set in this defconfig
using kconfig's config. This configuration in SYS_EXTRA_OPTIONS
must be removed and so the SYS_EXTRA_OPTIONS.

Signed-off-by: Mylène Josserand 
---
 configs/mk802_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configs/mk802_defconfig b/configs/mk802_defconfig
index 47bbf62274..2f63320fb9 100644
--- a/configs/mk802_defconfig
+++ b/configs/mk802_defconfig
@@ -4,7 +4,6 @@ CONFIG_MACH_SUN4I=y
 CONFIG_USB2_VBUS_PIN="PH12"
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-mk802"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="USB_EHCI"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
-- 
2.11.0

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


[U-Boot] [PATCH 07/10] sunxi: Convert CONFIG_RGMII to Kconfig

2017-02-23 Thread Mylène Josserand
Convert CONFIG_RGMII to Kconfig. Thanks to that, it is possible to
update defconfig files of SYS_EXTRA_OPTIONS accordingly and
remove it when it is possible.

Signed-off-by: Mylène Josserand 
---
 board/sunxi/Kconfig| 7 +++
 configs/A20-OLinuXino-Lime2_defconfig  | 3 ++-
 configs/A20-Olimex-SOM-EVB_defconfig   | 3 ++-
 configs/Bananapi_defconfig | 3 ++-
 configs/Bananapro_defconfig| 3 ++-
 configs/Colombus_defconfig | 2 +-
 configs/Cubietruck_defconfig   | 3 ++-
 configs/Hummingbird_A31_defconfig  | 2 +-
 configs/Lamobo_R1_defconfig| 3 ++-
 configs/Linksprite_pcDuino3_Nano_defconfig | 3 ++-
 configs/Orangepi_defconfig | 3 ++-
 configs/Orangepi_mini_defconfig| 3 ++-
 configs/Sinovoip_BPI_M2_defconfig  | 2 +-
 configs/Wits_Pro_A20_DKT_defconfig | 2 +-
 configs/mixtile_loftq_defconfig| 3 ++-
 15 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index ff11b98ddb..a51066f7c6 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -385,6 +385,13 @@ config INITIAL_USB_SCAN_DELAY
option to a non 0 value to add an extra delay before the first usb
bus scan.
 
+config RGMII
+   bool "Enable RGMII"
+   default n
+   ---help---
+   Enable the support of the Reduced Gigabit Media-Independent
+   Interface (RGMII).
+
 config USB0_VBUS_PIN
string "Vbus enable pin for usb0 (otg)"
default ""
diff --git a/configs/A20-OLinuXino-Lime2_defconfig 
b/configs/A20-OLinuXino-Lime2_defconfig
index 47a876082a..40468f1394 100644
--- a/configs/A20-OLinuXino-Lime2_defconfig
+++ b/configs/A20-OLinuXino-Lime2_defconfig
@@ -4,13 +4,14 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=384
 CONFIG_MMC0_CD_PIN="PH1"
+CONFIG_RGMII=y
 CONFIG_USB0_VBUS_PIN="PC17"
 CONFIG_USB0_VBUS_DET="PH5"
 CONFIG_SUNXI_GMAC=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime2"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="RGMII,SATAPWR=SUNXI_GPC(3)"
+CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/A20-Olimex-SOM-EVB_defconfig 
b/configs/A20-Olimex-SOM-EVB_defconfig
index dd7b1ac3e9..03f99809ef 100644
--- a/configs/A20-Olimex-SOM-EVB_defconfig
+++ b/configs/A20-Olimex-SOM-EVB_defconfig
@@ -7,13 +7,14 @@ CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_MMC3_CD_PIN="PH0"
 CONFIG_MMC3_PINS="PH"
 CONFIG_MMC_SUNXI_SLOT_EXTRA=3
+CONFIG_RGMII=y
 CONFIG_USB0_VBUS_PIN="PB9"
 CONFIG_USB0_VBUS_DET="PH5"
 CONFIG_SUNXI_GMAC=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olimex-som-evb"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="RGMII,SATAPWR=SUNXI_GPC(3)"
+CONFIG_SYS_EXTRA_OPTIONS="SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/Bananapi_defconfig b/configs/Bananapi_defconfig
index c6a9e88351..8751875d03 100644
--- a/configs/Bananapi_defconfig
+++ b/configs/Bananapi_defconfig
@@ -3,13 +3,14 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=432
+CONFIG_RGMII=y
 CONFIG_VIDEO_COMPOSITE=y
 CONFIG_SUNXI_GMAC=y
 CONFIG_GMAC_TX_DELAY=3
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-bananapi"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="RGMII,MACPWR=SUNXI_GPH(23)"
+CONFIG_SYS_EXTRA_OPTIONS="MACPWR=SUNXI_GPH(23)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/Bananapro_defconfig b/configs/Bananapro_defconfig
index 596eb2dd7a..e70dbb8730 100644
--- a/configs/Bananapro_defconfig
+++ b/configs/Bananapro_defconfig
@@ -3,6 +3,7 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=432
+CONFIG_RGMII=y
 CONFIG_USB1_VBUS_PIN="PH0"
 CONFIG_USB2_VBUS_PIN="PH1"
 CONFIG_VIDEO_COMPOSITE=y
@@ -11,7 +12,7 @@ CONFIG_GMAC_TX_DELAY=3
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-bananapro"
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="RGMII,MACPWR=SUNXI_GPH(23)"
+CONFIG_SYS_EXTRA_OPTIONS="MACPWR=SUNXI_GPH(23)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/Colombus_defconfig b/configs/Colombus_defconfig
index f9919558d4..6055a0d319 100644
--- a/configs/Colombus_defconfig
+++ b/configs/Colombus_defconfig
@@ -3,6 +3,7 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN6I=y
 CONFIG_DRAM_CLK=240
 CONFIG_DRAM_ZQ=251
+CONFIG_RGMII=y
 CONFIG_USB1_VBUS_PIN=""
 CONFIG_I2C0_ENABLE=y
 CONFIG_AXP_GPIO=y
@@ -17,7 +18,6 @@ CONFIG_VIDEO_LCD_PANEL_EDP_4_LANE_1620M_VIA_ANX9804=y
 CONFIG_SUNXI_GMAC=y
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31-colombus"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="RGMII"
 

Re: [U-Boot] [PATCH 2/2] arm64: booti: allow to place kernel image anywhere in physical memory

2017-02-23 Thread Tom Rini
On Thu, Feb 23, 2017 at 06:17:38PM +0900, Masahiro Yamada wrote:
> Hi Tom,
> 
> 
> 2017-02-23 1:19 GMT+09:00 Tom Rini :
> > On Wed, Feb 22, 2017 at 11:34:26AM +0900, Masahiro Yamada wrote:
> >
> >> At first, the ARM64 Linux booting requirement recommended that the
> >> kernel image be placed text_offset bytes from 2MB aligned base near
> >> the start of usable system RAM because memory below that base address
> >> was unusable at that time.
> >>
> >> This requirement was relaxed by Linux commit a7f8de168ace ("arm64:
> >> allow kernel Image to be loaded anywhere in physical memory").
> >> Since then, the bit 3 of the flags field indicates the tolerance
> >> of the kernel physical placement.  If this bit is set, the 2MB
> >> aligned base may be anywhere in physical memory.  For details, see
> >> Documentation/arm64/booting.txt of Linux.
> >>
> >> The booti command should be also relaxed to not expect the kernel
> >> image at the start of the system RAM.  Even when booting older
> >> kernel versions, it still makes sense to have some space below the
> >> kernel.  For example, some firmware may sit at the start of the
> >> system RAM.
> >>
> >> After all, the most flexible way for booting the kernel is to respect
> >> the original images->ep instead of gd->bd->bi_dram[0].start.  If
> >> image->ep (which is the address given to the booti command) already
> >> meets the address requirement, just use it.  If not, relocate the
> >> kernel to the next 2MB aligned address.
> >>
> >> Signed-off-by: Masahiro Yamada 
> >> ---
> >>
> >>  cmd/booti.c | 6 +-
> >>  1 file changed, 5 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/cmd/booti.c b/cmd/booti.c
> >> index f65f0e7..9408c34 100644
> >> --- a/cmd/booti.c
> >> +++ b/cmd/booti.c
> >> @@ -11,6 +11,8 @@
> >>  #include 
> >>  #include 
> >>  #include 
> >> +#include 
> >> +#include 
> >>
> >>  DECLARE_GLOBAL_DATA_PTR;
> >>
> >> @@ -54,7 +56,9 @@ static int booti_setup(bootm_headers_t *images)
> >>* If we are not at the correct run-time location, set the new
> >>* correct location and then move the image there.
> >>*/
> >> - dst = gd->bd->bi_dram[0].start + le64_to_cpu(ih->text_offset);
> >> + dst = images->ep - ih->text_offset;
> >> + dst = ALIGN(dst, SZ_2M);
> >> + dst += ih->text_offset;
> >
> > I think the code will be slightly more complex here but I would rather
> > see us check for the presence of the flag which allows for us to
> > relocate things rather than assume that we can always use the address
> > provided, or round it up.  The 'contract' wwith the kernel previously
> > said it must be from start of memory and I'd rather not change that.
> 
> 
> At first, I tried this approach.
> 
> The problem (at least for me) is
> commit a7f8de168ace is quite new; this is only included in Linux 4.5 and 
> later.
> Linux 4.4 LTS will be used on Socionext's products for a while.
> However, I need to avoid the relocation of the kernel image.
> 
> The gd->bd->bi_dram[0].start points to the start of the DRAM.
> Here, some firmware is sitting at the start of the DRAM.
> To hide the head of the memory from Linux,
> the memory node in the device tree is carved out.
> 
> If CONFIG_ARCH_FIXUP_FDT_MEMORY is not set,
> U-Boot passes the memory node as-is to Linux.
> As a result, the Image is placed out of the available memory region
> specified by DT,
> then Linux fails to boot.
> 
> 
> Somehow I want to achieve,
> "Even when booting older kernel versions, it still makes sense to have
> some space below the
> kernel.  For example, some firmware may sit at the start of the system RAM."
> 
> 
> Perhaps, can we introduce a CONFIG
> to enable/disable the relocation?
> Or, any other good idea?

I guess the answer is that I need to find some time to re-read the
history on Documentation/arm64/booting.txt to see when various
restrictions changed / were introduced.  I'm also willing to say that
perhaps my initial implementation (or the follow up when text_offset was
introduced) was incorrectly too strict.

-- 
Tom


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


Re: [U-Boot] [PATCH] Makefile: print warning if CONFIG_SYS_EXTRA_OPTIONS is used

2017-02-23 Thread Tom Rini
On Wed, Feb 22, 2017 at 03:26:01PM -0800, Maxime Ripard wrote:
> On Tue, Feb 21, 2017 at 08:58:55PM -0700, Simon Glass wrote:
> > Hi,
> > 
> > On 21 February 2017 at 16:16, Maxime Ripard
> >  wrote:
> > > On Sat, Feb 18, 2017 at 03:24:53PM +0900, Masahiro Yamada wrote:
> > >> The prompt of this option is marked "DEPRECATED" in capital letters,
> > >> and its help clearly says:
> > >>   This option was prepared for the smooth migration from the old
> > >>   configuration to Kconfig. Since this option will be removed sometime,
> > >>   new boards should not use this option.
> > >>
> > >> However, we have had almost no progress on this.  In fact, this
> > >> option is often abused for fresh porting, and more and more new
> > >> defconfigs with it are coming in (for example, SUNXI boards).
> > >
> > > That's not entirely true. We've added more defconfig, but with the
> > > same set of options we've always had, and are shared by everyone
> > > (CONS_INDEX, RGMII).
> > >
> > > So this patch, in effect, gives the signal that it's better to have a
> > > proliferation of board-specific headers in include/configs, over using
> > > SYS_EXTRA until most of the generic functions are merged?
> > 
> > I suppose whoever adds the next board gets to do the conversion?
> 
> That seems a bit unfair to ask someone that barely got into U-Boot to
> enable his new shiny sunxi board to convert the old Freescale's PPC
> defconfig in the process.

Well, yes and no.  Some of the options that need migrating (say
CONFIG_NAND) are a PITA, and no, we aren't asking for that.

Drilling down to the sunxi case for a moment, the SYS_EXTRA_OPTIONS that
get set are almost entirely sunxi centric (CONFIG_RGMII is used in some
atmel cases) so converting those is I feel an appropriate ask.

Getting back up to the high level question, if someone makes an effort
to write the Kconfig logic for an option and tries to get the depends
logic correct (after looking at how all the various cases of it go), I'm
happy to pick it up and do the last part of migrating all of the configs
and size-checking for correctness.

-- 
Tom


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


[U-Boot] [PATCH 1/3] ARM: dts: sun9i: Add mmc1 pinmux setting

2017-02-23 Thread Chen-Yu Tsai
commit 56b0730157f70dc23d6caff9e7ceb8b377b96b9f upstream.

On the A80, mmc1 is available on pingroup G. Designs mostly use this
to connect to an SDIO WiFi chip.

Signed-off-by: Chen-Yu Tsai 
---
 arch/arm/dts/sun9i-a80.dtsi | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/dts/sun9i-a80.dtsi b/arch/arm/dts/sun9i-a80.dtsi
index f68b324..92412b2 100644
--- a/arch/arm/dts/sun9i-a80.dtsi
+++ b/arch/arm/dts/sun9i-a80.dtsi
@@ -701,6 +701,14 @@
allwinner,pull = ;
};
 
+   mmc1_pins: mmc1 {
+   allwinner,pins = "PG0", "PG1" ,"PG2", "PG3",
+"PG4", "PG5";
+   allwinner,function = "mmc1";
+   allwinner,drive = ;
+   allwinner,pull = ;
+   };
+
mmc2_8bit_pins: mmc2_8bit {
allwinner,pins = "PC6", "PC7", "PC8", "PC9",
 "PC10", "PC11", "PC12",
-- 
2.10.2

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


[U-Boot] [PATCH 0/3] ARM: sun9i: Device tree and defconfig for Sunchip CX-A99

2017-02-23 Thread Rask Ingemann Lambertsen
The Sunchip CX-A99 board is used in some media players running Android. It
uses the Allwinner A80 ARM SoC and is similar to the Merrii A80 Optimus and
Cubietech Cubieboard4, but targets consumer devices instead of being a
developer board. Patch 2 includes an overview of what's on the board. See the
wiki page at https://linux-sunxi.org/Sunchip_CX-A99 for more details.

Patch 1 is an update from upstream (Linux kernel 4.10) to the A80 dtsi
adding the mmc1 pinmux node. U-Boot itself does not use it, but without it,
newer device trees for A80 boards won't compile.

Patch 2 adds the device tree itself. The existing bindings aren't sufficient to
accurately describe the board, so this is only an interim version while work is
done upstream on the bindings. It will however get U-Boot going and can be used
for kernel 4.9.9 (or later) and kernel 4.10-rc7 (or later).

Patch 3 add the defconfig. There is nothing special about it.

A follow-up patch will add support for the AXP808 PMIC (including the
AXP809+AXP806 pair used on the two other A80 boards mentioned above).

Chen-Yu Tsai (1):
  ARM: dts: sun9i: Add mmc1 pinmux setting

Rask Ingemann Lambertsen (2):
  ARM: dts: sun9i: Add device tree for Sunchip CX-A99
  ARM: sun9i: Add defconfig for Sunchip CX-A99

 arch/arm/dts/Makefile |   3 +-
 arch/arm/dts/sun9i-a80-cx-a99.dts | 380 ++
 arch/arm/dts/sun9i-a80.dtsi   |   8 +
 configs/Sunchip_CX-A99_defconfig  |  22 +++
 4 files changed, 412 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/sun9i-a80-cx-a99.dts
 create mode 100644 configs/Sunchip_CX-A99_defconfig

-- 
2.10.2

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


Re: [U-Boot] [PATCH V3 13/19] serial: lpuart: restructure lpuart driver

2017-02-23 Thread Alison Wang

> -Original Message-
> From: Peng Fan [mailto:peng@nxp.com]
> Sent: Wednesday, February 22, 2017 4:22 PM
> To: sba...@denx.de
> Cc: u-boot@lists.denx.de; Peng Fan ; Bhuvanchandra DV
> ; york sun ; Shaohui
> Xie ; Alison Wang 
> Subject: [PATCH V3 13/19] serial: lpuart: restructure lpuart driver
> 
> Drop CONFIG_LPUART_32B_REG.
> Move the register structure to a common file include/fsl_lpuart.h
> Define lpuart_serial_platdata structure which includes the reg base and
> flags.
> For 32Bit register access, use lpuart_read32/lpuart_write32 which
> handles big/little endian.
> For 8Bit register access, still use the orignal code.
> 
> Signed-off-by: Peng Fan  Reviewed-by : Stefano Babic
> 
> Cc: Bhuvanchandra DV 
> Cc: York Sun 
> Cc: Shaohui Xie 
> Cc: Alison Wang 
> ---
> V3:
>  add review tag
> V2:
>  New. I do not have vf610 and LSx board, please help test if you have
> the board.
> 
>  arch/arm/cpu/armv7/vf610/generic.c |   5 +
>  .../arm/include/asm/arch-fsl-layerscape/imx-regs.h |  42 
>  arch/arm/include/asm/arch-ls102xa/imx-regs.h   |  40 ---
>  arch/arm/include/asm/arch-vf610/clock.h|   1 +
>  arch/arm/include/asm/arch-vf610/imx-regs.h |  28 ---
>  drivers/serial/serial_lpuart.c | 267 +++--
> 
>  6 files changed, 148 insertions(+), 235 deletions(-)
> 
[Alison Wang] Reviewed-by: Alison Wang 


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


[U-Boot] [PATCH 2/3] board: at91sam9m10g45ek: move config options to defconfig

2017-02-23 Thread Wenyou Yang
Support the device tree and enable CONFIG_CLK and CONFIG_PINCTRL
to support at91 clock driver and at91 pinctrl driver.

Move some config options to configs/*_defconfig, and make
the drivers, emac, gpio and mci to support the driver model.

Signed-off-by: Wenyou Yang 
---

 configs/at91sam9m10g45ek_mmc_defconfig   | 21 -
 configs/at91sam9m10g45ek_nandflash_defconfig | 18 +-
 include/configs/at91sam9m10g45ek.h   | 16 
 3 files changed, 37 insertions(+), 18 deletions(-)

diff --git a/configs/at91sam9m10g45ek_mmc_defconfig 
b/configs/at91sam9m10g45ek_mmc_defconfig
index 7a18ef89ed..ee12ae7949 100644
--- a/configs/at91sam9m10g45ek_mmc_defconfig
+++ b/configs/at91sam9m10g45ek_mmc_defconfig
@@ -8,6 +8,8 @@ CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91sam9m10g45ek"
+# CONFIG_SYS_MALLOC_F is not set
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9M10G45,SYS_USE_MMC"
 CONFIG_BOOTDELAY=3
 # CONFIG_CONSOLE_MUX is not set
@@ -29,7 +31,24 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_ETH=y
+CONFIG_MACB=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_LCD=y
-CONFIG_OF_LIBFDT=y
diff --git a/configs/at91sam9m10g45ek_nandflash_defconfig 
b/configs/at91sam9m10g45ek_nandflash_defconfig
index 819fe1020e..52543e11d0 100644
--- a/configs/at91sam9m10g45ek_nandflash_defconfig
+++ b/configs/at91sam9m10g45ek_nandflash_defconfig
@@ -6,6 +6,8 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="at91sam9m10g45ek"
+# CONFIG_SYS_MALLOC_F is not set
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9M10G45,SYS_USE_NANDFLASH"
 CONFIG_BOOTDELAY=3
 # CONFIG_CONSOLE_MUX is not set
@@ -27,7 +29,21 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_AT91_UTMI=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_ETH=y
+CONFIG_MACB=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_LCD=y
-CONFIG_OF_LIBFDT=y
diff --git a/include/configs/at91sam9m10g45ek.h 
b/include/configs/at91sam9m10g45ek.h
index 8577a11f7c..6788e73b0c 100644
--- a/include/configs/at91sam9m10g45ek.h
+++ b/include/configs/at91sam9m10g45ek.h
@@ -30,8 +30,6 @@
 
 /* general purpose I/O */
 #define CONFIG_ATMEL_LEGACY/* required until (g)pio is fixed */
-#define CONFIG_AT91_GPIO
-#define CONFIG_AT91_GPIO_PULLUP1   /* keep pullups on peripheral 
pins */
 
 /* serial console */
 #define CONFIG_ATMEL_USART
@@ -95,24 +93,10 @@
 
 #endif
 
-/* MMC */
-
-#ifdef CONFIG_CMD_MMC
-#define CONFIG_GENERIC_ATMEL_MCI
-#endif
-
 /* Ethernet */
-#define CONFIG_MACB
-#define CONFIG_RMII
-#define CONFIG_NET_RETRY_COUNT 20
 #define CONFIG_RESET_PHY_R
 #define CONFIG_AT91_WANTS_COMMON_PHY
 
-/* USB */
-#define CONFIG_USB_EHCI
-#define CONFIG_USB_EHCI_ATMEL
-#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 2
-
 #define CONFIG_SYS_LOAD_ADDR   0x2200  /* load address */
 
 #define CONFIG_SYS_MEMTEST_START   CONFIG_SYS_SDRAM_BASE
-- 
2.11.0

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


Re: [U-Boot] [PATCH v2 09/10] armv8: mmu: Add a function to change mapping attributes

2017-02-23 Thread york sun
On 02/15/2017 03:18 PM, York Sun wrote:
> Function mmu_change_region_attr() is added to change existing mapping
> with updated PXN, UXN and memory type. This is a break-before-make
> process during which the mapping becomes fault (invalid) before final
> attributres are set.
>
> Signed-off-by: York Sun 
> ---
>
> Changes in v2: None
>
>  arch/arm/cpu/armv8/cache_v8.c| 72 
> +---
>  arch/arm/include/asm/armv8/mmu.h |  5 +++
>  arch/arm/include/asm/system.h|  1 +
>  3 files changed, 74 insertions(+), 4 deletions(-)

Guys,

Are you OK with this change?

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


[U-Boot] [PATCH 3/3] board: at91sam9m10g45ek: clean up code

2017-02-23 Thread Wenyou Yang
Since the introduction of the pinctrl and clk drivers and the
device tree files, remove unneeded hard coded related code from
the board file.

Signed-off-by: Wenyou Yang 
---

 board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c | 59 -
 1 file changed, 59 deletions(-)

diff --git a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c 
b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
index 6871916865..dbc25e96ca 100644
--- a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
+++ b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
@@ -17,11 +17,6 @@
 #include 
 #include 
 #include 
-#include 
-#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
-#include 
-#endif
-#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -149,39 +144,6 @@ static void at91sam9m10g45ek_usb_hw_init(void)
 }
 #endif
 
-#ifdef CONFIG_MACB
-static void at91sam9m10g45ek_macb_hw_init(void)
-{
-   struct at91_port *pioa = (struct at91_port *)ATMEL_BASE_PIOA;
-
-   at91_periph_clk_enable(ATMEL_ID_EMAC);
-
-   /*
-* Disable pull-up on:
-*  RXDV (PA15) => PHY normal mode (not Test mode)
-*  ERX0 (PA12) => PHY ADDR0
-*  ERX1 (PA13) => PHY ADDR1 => PHYADDR = 0x0
-*
-* PHY has internal pull-down
-*/
-   writel(pin_to_mask(AT91_PIN_PA15) |
-  pin_to_mask(AT91_PIN_PA12) |
-  pin_to_mask(AT91_PIN_PA13),
-  >pudr);
-
-   at91_phy_reset();
-
-   /* Re-enable pull-up */
-   writel(pin_to_mask(AT91_PIN_PA15) |
-  pin_to_mask(AT91_PIN_PA12) |
-  pin_to_mask(AT91_PIN_PA13),
-  >puer);
-
-   /* And the pins. */
-   at91_macb_hw_init();
-}
-#endif
-
 #ifdef CONFIG_LCD
 
 vidinfo_t panel_info = {
@@ -280,15 +242,6 @@ void lcd_show_board_info(void)
 #endif /* CONFIG_LCD_INFO */
 #endif
 
-#ifdef CONFIG_GENERIC_ATMEL_MCI
-int board_mmc_init(bd_t *bis)
-{
-   at91_mci_hw_init();
-
-   return atmel_mci_init((void *)ATMEL_BASE_MCI0);
-}
-#endif
-
 int board_early_init_f(void)
 {
at91_seriald_hw_init();
@@ -319,9 +272,6 @@ int board_init(void)
 #ifdef CONFIG_ATMEL_SPI
at91_spi0_hw_init(1 << 4);
 #endif
-#ifdef CONFIG_MACB
-   at91sam9m10g45ek_macb_hw_init();
-#endif
 #ifdef CONFIG_LCD
at91sam9m10g45ek_lcd_hw_init();
 #endif
@@ -341,15 +291,6 @@ void reset_phy(void)
 }
 #endif
 
-int board_eth_init(bd_t *bis)
-{
-   int rc = 0;
-#ifdef CONFIG_MACB
-   rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC, 0x00);
-#endif
-   return rc;
-}
-
 /* SPI chip select control */
 #ifdef CONFIG_ATMEL_SPI
 #include 
-- 
2.11.0

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


Re: [U-Boot] [PATCH] spi: cadence_qspi_apb: Add trigger-base DT bindings from Linux

2017-02-23 Thread Marek Vasut
On 02/23/2017 08:22 PM, Rush, Jason A. wrote:
> Marek Vasut wrote:
>> On 02/22/2017 06:37 PM, Rush, Jason A. wrote:
>>> Marek Vasut wrote:
 On 02/21/2017 05:50 PM, Rush, Jason A. wrote:
> The socfpga arch uses a different value for the indaddrtrig reg than
> the ahbbase address. Adopting the Linux DT bindings separates the
> ahbbase and trigger-base addresses, allowing the trigger-base to be+
> set correctly on the socfpga arch.
>
> Tested on Terasic SoCkit dev board (Altera Cyclone V)
>
> Signed-off-by: Jason A. Rush 
> ---
>  arch/arm/dts/socfpga.dtsi  | 1 +
>  drivers/spi/cadence_qspi.c | 2 ++
>  drivers/spi/cadence_qspi.h | 1 +
>  drivers/spi/cadence_qspi_apb.c | 4 ++--
>  4 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
> index 8588221e57..2aff0c2419 100644
> --- a/arch/arm/dts/socfpga.dtsi
> +++ b/arch/arm/dts/socfpga.dtsi
> @@ -644,6 +644,7 @@
>   clocks = <_clk>;
>   ext-decoder = <0>;  /* external decoder */
>   num-cs = <4>;
> + trigger-base = <0x>;

 Can you separate the DT patch from the driver patch ? Also, can you check 
 the other users of the CQSPI driver to see if they define the
 trigger base ?

>>>
>>> Yes, I will separate into two patches.
>>
>> Thanks
>>
>>> I default the trigger_base to the same value as the ahbbase if the 
>>> trigger-base
>>> was not defined in the DT.  That way, the driver code works as before for
>>> architectures that expect the trigger_base to equal the value of the 
>>> ahbbase.
>>>  (e.g. TI K2G SoC).  I updated only the Altera SoC dtsi file since that 
>>> architecture
>>> needs a different value for the trigger_base.
>>
>> In fact, the Linux DT bindings have the following and no AHB base, so
>> please stick to that:
>>
>> - cdns,trigger-address : 32-bit indirect AHB trigger address.
>>
>> For details, see
>> Documentation/devicetree/bindings/mtd/cadence-quadspi.txt in Linux 4.8
>> or so and newer.
>>
>>> Should I change this behavior to default the value to 0x0, and patch the 3 
>>> dts/dtsi
>>> files that use the cadence driver to explicitly include the trigger-base?
>>
>> Yeah, looks sensible.
>>

>   fifo-depth = <128>;
>   sram-size = <128>;
>   bus-num = <2>;
> diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
> index 9a6e41f330..a18b331f6c 100644
> --- a/drivers/spi/cadence_qspi.c
> +++ b/drivers/spi/cadence_qspi.c
> @@ -296,6 +296,8 @@ static int cadence_spi_ofdata_to_platdata(struct
> udevice *bus)
>
>   plat->regbase = (void *)data[0];
>   plat->ahbbase = (void *)data[2];
> + plat->trigger_base = (void *)fdtdec_get_int(blob, node, "trigger-base",
> + (int)plat->ahbbase);

 Probably get u32 , but what about 64-bit systems ? Don't we have some 
 fdtdec_get.*addr ?
>>>
>>> You're right, this should be a u32.  I don't think I should have made 
>>> trigger_base
>>> a void* in the first place, but instead it should be a u32.  Looking at the 
>>> Linux
>>> kernel, which I just realized they call it trigger_address not 
>>> trigger_base, it is just
>>> a 32-bit value that is written into a 32-bit wide register, not an iomem 
>>> memory
>>> mapped pointer.
>>
>> Ah right, the reg is 32bit . Is it possible that on aargh64, someone
>> will pass 64bit trigger base in ?
>>
>>> What if I change it to a u32 and rename it to trigger_address (which I 
>>> should
>>> have done the first time)?  That would align us correctly with the Linux 
>>> kernel.
>>
>> See above /wrt the naming. void __iomem * works on both 32 and 64bit
>> systems, so I'd prefer to see that.
>>

>   plat->sram_size = fdtdec_get_int(blob, node, "sram-size", 128);
>
>   /* All other paramters are embedded in the child node */ diff --git
> a/drivers/spi/cadence_qspi.h b/drivers/spi/cadence_qspi.h index
> d1927a4003..394820f308 100644
> --- a/drivers/spi/cadence_qspi.h
> +++ b/drivers/spi/cadence_qspi.h
> @@ -18,6 +18,7 @@ struct cadence_spi_platdata {
>   unsigned intmax_hz;
>   void*regbase;
>   void*ahbbase;

 Can you remove the AHB base ? I think it's no longer used.
>>>
>>> ahbbase is still used in cadence_qspi_apb.c, it's the register that the 
>>> QSPI data
>>> is read from, so it's still needed.
>>
>> Aaaah, and looking at the Linux bindings, there it comes from the reg
>> property. OK, so much for the bloody confusing naming. If you feel like
>> cleaning this up, separate patch is welcome, if not ... oh well.
>>
 Also, I think this should be void __iomem * here , also for regbase .

>>>
>>> This is probably true, regbase and 

Re: [U-Boot] [PATCH] ARM: ti: Update layout for MMC and eMMC (env and dfu)

2017-02-23 Thread Sam Protsenko
On Thu, Feb 23, 2017 at 5:14 PM, Jean-Jacques Hiblot  wrote:
>
>
> On 23/02/2017 14:46, Sam Protsenko wrote:
>>
>> On Wed, Feb 22, 2017 at 10:27 AM, Jean-Jacques Hiblot 
>> wrote:
>>>
>>> The problems with the current DFU layout are:
>>> MMC: The space allocated for u-boot is too small for the latest u-boot
>>>   (>750KB). We need to increase it. eMMC uses a much bigger area
>>> (2MB).
>>> eMMC: region "u-boot.img.raw" overlaps the environment area and the
>>> region
>>>"spl-os-image.raw".
>>> both: region "spl-os-image.raw" is quite small and can't handle android
>>>kernels
>>>
>>> Fixing this requires growing some regions and moving others.
>>> Care has been taken to leave some room for further growth of
>>> "spl-os-args.raw".
>>> Also the "env" now appears in the dfu so that it's apparent that the
>>> region is not free space that can be used to grow "u-boot.img.raw".
>>> The total space allocated for those raw binaries is 16MB, of which 13+MB
>>> are reserved for the kernel image.
>>>
>>> Signed-off-by: Jean-Jacques Hiblot 
>>> ---
>>>
>>> Sam,
>>>
>>> This patch goes a bit further in changing the layout of the MMC than
>>> yours. However
>>> it doesn't update the GPT partitioning. This would still be needed.
>>>
>> Hi Jean-Jacques,
>>
>> Got a couple of questions about this change and my patch (changing
>> eMMC partitions table), about how to make them play nice together.
>>
>> 1. How DFU table is connected to eMMC partition table? And why my
>> patch was interfering with DFU table?
>
> AFAIK DFU is not related to GPT. I never used the GPT so I can't for sure
> how it fits together.
> My guess is that env_mmc.c has no idea that GPT even exists and uses raw
> access to the eMMC. In this case CONFIG_ENV_OFFSET must be defined to point
> at the beginning of your env partition and must be adapted when the GPT is
> updated. The same goes for the DFU. Ideally GPT and DFU should use the same
> layout (at least for MLO, u-boot, kernel and args).
>
>> 2. Can I change CONFIG_ENV_OFFSET? Because my changes is going to move
>> "reserved" partition on eMMC, where U-Boot environment is stored. Or
>> it should be in sync with DFU table somehow? If yes -- we should work
>> together to find solution that works best for both cases.
>
> CONFIG_ENV_OFFSET is loosely related to DFU: we don't update the environment
> through DFU. However we must make sure that the area used to store the env
> doesn't overlap a another region (MLO, u-boot, kernel, args). The dfu
> doesn't define those regions, it's done with #defines like
> CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR. But DFU exposes them for "remote"
> upgrade.
>

So if I change eMMC GPT partition table, it's ok for me to update
CONFIG_ENV_OFFSET as well, right? Because in my case CONFIG_ENV_OFFSET
is going to be different from the value your patch sets. In case of
eMMC table, we're using "reserved" partition to store U-Boot
environment, and I want it to be at 1664 KiB, which gives us
CONFIG_ENV_OFFSET=0x1A. Is it ok if I change it to that value? Or
something else must be changed along with it? If yes, then what
exactly?

Thanks.

>> 3. What about my similar patch for AM57x EVM (see [1])? Is it fine, or
>> it affects DFU table as well?
>
> I guess it's OK because the env is stored in a FAT partition:
> CONFIG_ENV_OFFSET is not used
>
>
>>
>> Thanks.
>>
>> [1] https://patchwork.ozlabs.org/patch/730736/
>>
>>> tested on DRA7. DFU updates ok for MMC and eMMC
>>>
>>> Jean-Jacques
>>>
>>>   include/configs/dra7xx_evm.h  |  2 +-
>>>   include/configs/omap5_uevm.h  |  2 +-
>>>   include/configs/ti_armv7_common.h |  7 ---
>>>   include/environment/ti/dfu.h  | 14 --
>>>   4 files changed, 14 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
>>> index bce2816..a56c224 100644
>>> --- a/include/configs/dra7xx_evm.h
>>> +++ b/include/configs/dra7xx_evm.h
>>> @@ -28,7 +28,7 @@
>>>   #define CONFIG_ENV_IS_IN_MMC
>>>   #define CONFIG_SYS_MMC_ENV_DEV 1   /* SLOT2: eMMC(1) */
>>>   #define CONFIG_ENV_SIZE(128 << 10)
>>> -#define CONFIG_ENV_OFFSET  0xE
>>> +#define CONFIG_ENV_OFFSET  0x22
>>>   #define CONFIG_ENV_OFFSET_REDUND   (CONFIG_ENV_OFFSET +
>>> CONFIG_ENV_SIZE)
>>>   #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
>>>   #endif
>>> diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h
>>> index 736d804..127776e 100644
>>> --- a/include/configs/omap5_uevm.h
>>> +++ b/include/configs/omap5_uevm.h
>>> @@ -38,7 +38,7 @@
>>>   #define CONFIG_ENV_IS_IN_MMC
>>>   #define CONFIG_SYS_MMC_ENV_DEV 1   /* SLOT2: eMMC(1) */
>>>   #define CONFIG_ENV_SIZE(128 << 10)
>>> -#define CONFIG_ENV_OFFSET  0xE
>>> +#define CONFIG_ENV_OFFSET  0x22
>>>   #define CONFIG_ENV_OFFSET_REDUND   

Re: [U-Boot] mlo and u-boot

2017-02-23 Thread Andrew F. Davis
On 02/22/2017 12:23 PM, Ryan wrote:
> Hello,
> 
> I am using AM43XX based board. The bootloader is divided into spl
> u-boot (MLO) and u-boot.bin
> 
> I wanted to check what variables are shared between them. How does MLO
> a seperate binary
> share the boot mode and mmcdev to u-boot so that it can use the
> appropriate mmcdev to find the
> kernel.
> 

These are passed using a shared SRAM space, grep for
SRAM_SCRATCH_SPACE_ADDR, and you can follow the rabbit hole from there.

Andrew

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


Re: [U-Boot] [PATCH] spi: cadence_qspi_apb: Add trigger-base DT bindings from Linux

2017-02-23 Thread Rush, Jason A.
Marek Vasut wrote:
> On 02/22/2017 06:37 PM, Rush, Jason A. wrote:
>> Marek Vasut wrote:
>>> On 02/21/2017 05:50 PM, Rush, Jason A. wrote:
 The socfpga arch uses a different value for the indaddrtrig reg than
 the ahbbase address. Adopting the Linux DT bindings separates the
 ahbbase and trigger-base addresses, allowing the trigger-base to be+
 set correctly on the socfpga arch.

 Tested on Terasic SoCkit dev board (Altera Cyclone V)

 Signed-off-by: Jason A. Rush 
 ---
  arch/arm/dts/socfpga.dtsi  | 1 +
  drivers/spi/cadence_qspi.c | 2 ++
  drivers/spi/cadence_qspi.h | 1 +
  drivers/spi/cadence_qspi_apb.c | 4 ++--
  4 files changed, 6 insertions(+), 2 deletions(-)

 diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
 index 8588221e57..2aff0c2419 100644
 --- a/arch/arm/dts/socfpga.dtsi
 +++ b/arch/arm/dts/socfpga.dtsi
 @@ -644,6 +644,7 @@
clocks = <_clk>;
ext-decoder = <0>;  /* external decoder */
num-cs = <4>;
 +  trigger-base = <0x>;
>>>
>>> Can you separate the DT patch from the driver patch ? Also, can you check 
>>> the other users of the CQSPI driver to see if they define the
>>> trigger base ?
>>>
>>
>> Yes, I will separate into two patches.
> 
> Thanks
> 
>> I default the trigger_base to the same value as the ahbbase if the 
>> trigger-base
>> was not defined in the DT.  That way, the driver code works as before for
>> architectures that expect the trigger_base to equal the value of the ahbbase.
>>  (e.g. TI K2G SoC).  I updated only the Altera SoC dtsi file since that 
>> architecture
>> needs a different value for the trigger_base.
> 
> In fact, the Linux DT bindings have the following and no AHB base, so
> please stick to that:
> 
> - cdns,trigger-address : 32-bit indirect AHB trigger address.
> 
> For details, see
> Documentation/devicetree/bindings/mtd/cadence-quadspi.txt in Linux 4.8
> or so and newer.
> 
>> Should I change this behavior to default the value to 0x0, and patch the 3 
>> dts/dtsi
>> files that use the cadence driver to explicitly include the trigger-base?
> 
> Yeah, looks sensible.
> 
>>>
fifo-depth = <128>;
sram-size = <128>;
bus-num = <2>;
 diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
 index 9a6e41f330..a18b331f6c 100644
 --- a/drivers/spi/cadence_qspi.c
 +++ b/drivers/spi/cadence_qspi.c
 @@ -296,6 +296,8 @@ static int cadence_spi_ofdata_to_platdata(struct
 udevice *bus)

plat->regbase = (void *)data[0];
plat->ahbbase = (void *)data[2];
 +  plat->trigger_base = (void *)fdtdec_get_int(blob, node, "trigger-base",
 +  (int)plat->ahbbase);
>>>
>>> Probably get u32 , but what about 64-bit systems ? Don't we have some 
>>> fdtdec_get.*addr ?
>>
>> You're right, this should be a u32.  I don't think I should have made 
>> trigger_base
>> a void* in the first place, but instead it should be a u32.  Looking at the 
>> Linux
>> kernel, which I just realized they call it trigger_address not trigger_base, 
>> it is just
>> a 32-bit value that is written into a 32-bit wide register, not an iomem 
>> memory
>> mapped pointer.
> 
> Ah right, the reg is 32bit . Is it possible that on aargh64, someone
> will pass 64bit trigger base in ?
> 
>> What if I change it to a u32 and rename it to trigger_address (which I should
>> have done the first time)?  That would align us correctly with the Linux 
>> kernel.
> 
> See above /wrt the naming. void __iomem * works on both 32 and 64bit
> systems, so I'd prefer to see that.
> 
>>>
plat->sram_size = fdtdec_get_int(blob, node, "sram-size", 128);

/* All other paramters are embedded in the child node */ diff --git
 a/drivers/spi/cadence_qspi.h b/drivers/spi/cadence_qspi.h index
 d1927a4003..394820f308 100644
 --- a/drivers/spi/cadence_qspi.h
 +++ b/drivers/spi/cadence_qspi.h
 @@ -18,6 +18,7 @@ struct cadence_spi_platdata {
unsigned intmax_hz;
void*regbase;
void*ahbbase;
>>>
>>> Can you remove the AHB base ? I think it's no longer used.
>>
>> ahbbase is still used in cadence_qspi_apb.c, it's the register that the QSPI 
>> data
>> is read from, so it's still needed.
> 
> Aaaah, and looking at the Linux bindings, there it comes from the reg
> property. OK, so much for the bloody confusing naming. If you feel like
> cleaning this up, separate patch is welcome, if not ... oh well.
> 
>>> Also, I think this should be void __iomem * here , also for regbase .
>>>
>>
>> This is probably true, regbase and ahbbase should both be __iomem *, but
>> that feels like a different clean-up patch.  If you'd like me to, I could 
>> update
>> both of these as part of 

Re: [U-Boot] [PATCH 10/10] sunxi: Convert CONS_INDEX to Kconfig

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 04:44:19PM +0100, Mylène Josserand wrote:
> Convert the CONS_INDEX configuration to Kconfig.
> Update sunxi's defconfigs to remove SYS_EXTRA_OPTIONS variable not
> needed anymore.
> Default value is 1 except for sun5i (equals 2) and sun8i (equals 5).
> 
> Signed-off-by: Mylène Josserand 
> ---
>  board/sunxi/Kconfig  | 9 +
>  configs/A13-OLinuXinoM_defconfig | 1 -
>  configs/A13-OLinuXino_defconfig  | 1 -
>  configs/Ampe_A76_defconfig   | 1 -
>  configs/CHIP_defconfig   | 1 -
>  configs/Empire_electronix_d709_defconfig | 1 -
>  configs/Empire_electronix_m712_defconfig | 1 -
>  configs/difrnce_dit4350_defconfig| 1 -
>  configs/ga10h_v1_1_defconfig | 1 -
>  configs/gt90h_v4_defconfig   | 1 -
>  configs/iNet_D978_rev2_defconfig | 1 -
>  configs/inet86dz_defconfig   | 1 -
>  configs/inet98v_rev2_defconfig   | 1 -
>  configs/polaroid_mid2407pxe03_defconfig  | 1 -
>  configs/polaroid_mid2809pxe04_defconfig  | 1 -
>  configs/q8_a13_tablet_defconfig  | 1 -
>  configs/q8_a23_tablet_800x480_defconfig  | 1 -
>  configs/q8_a33_tablet_1024x600_defconfig | 1 -
>  configs/q8_a33_tablet_800x480_defconfig  | 1 -
>  19 files changed, 9 insertions(+), 18 deletions(-)
> 
> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
> index 492bf14ae1..6a70ee26b3 100644
> --- a/board/sunxi/Kconfig
> +++ b/board/sunxi/Kconfig
> @@ -157,6 +157,15 @@ config ARM_BOOT_HOOK_RMR
>   This allows both the SPL and the U-Boot proper to be entered in
>   either mode and switch to AArch64 if needed.
>  
> +config CONS_INDEX
> + int "UART used for console"
> + default 2 if MACH_SUN5I
> + default 5 if MACH_SUN8I
> + default 1
> + ---help---
> + Configures the console index for Allwinner SoC. 2 for SUN5I, 5 for SUN8I
> + and 1 otherwise.
> +

There's still a definition in sunxi-common.h that would be worth removing.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] [PATCH 09/10] sunxi: Convert CONFIG_MACPWR to Kconfig

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 04:44:18PM +0100, Mylène Josserand wrote:
> Convert the CONFIG_MACPWR to Kconfig and update all the sunxi defconfigs
> that used it in SYS_EXTRA_OPTIONS.
> 
> Signed-off-by: Mylène Josserand 

Acked-by: Maxime Ripard 

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] [PATCH 08/10] sunxi: Convert CONFIG_SATAPWR to Kconfig

2017-02-23 Thread Maxime Ripard
Hi,

On Thu, Feb 23, 2017 at 04:44:17PM +0100, Mylène Josserand wrote:
> Convert the CONFIG_SATAPWR into kconfig.
> Thanks to that, many SYS_EXTRA_OPTIONS can be removed from some
> defconfigs.
> 
> Signed-off-by: Mylène Josserand 

Acked-by: Maxime Ripard 
Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] [PATCH 07/10] sunxi: Convert CONFIG_RGMII to Kconfig

2017-02-23 Thread Maxime Ripard
Hi,

On Thu, Feb 23, 2017 at 04:44:16PM +0100, Mylène Josserand wrote:
> Convert CONFIG_RGMII to Kconfig. Thanks to that, it is possible to
> update defconfig files of SYS_EXTRA_OPTIONS accordingly and
> remove it when it is possible.
> 
> Signed-off-by: Mylène Josserand 
> ---
>  board/sunxi/Kconfig| 7 +++
>  configs/A20-OLinuXino-Lime2_defconfig  | 3 ++-
>  configs/A20-Olimex-SOM-EVB_defconfig   | 3 ++-
>  configs/Bananapi_defconfig | 3 ++-
>  configs/Bananapro_defconfig| 3 ++-
>  configs/Colombus_defconfig | 2 +-
>  configs/Cubietruck_defconfig   | 3 ++-
>  configs/Hummingbird_A31_defconfig  | 2 +-
>  configs/Lamobo_R1_defconfig| 3 ++-
>  configs/Linksprite_pcDuino3_Nano_defconfig | 3 ++-
>  configs/Orangepi_defconfig | 3 ++-
>  configs/Orangepi_mini_defconfig| 3 ++-
>  configs/Sinovoip_BPI_M2_defconfig  | 2 +-
>  configs/Wits_Pro_A20_DKT_defconfig | 2 +-
>  configs/mixtile_loftq_defconfig| 3 ++-
>  15 files changed, 31 insertions(+), 14 deletions(-)
> 
> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
> index ff11b98ddb..a51066f7c6 100644
> --- a/board/sunxi/Kconfig
> +++ b/board/sunxi/Kconfig
> @@ -385,6 +385,13 @@ config INITIAL_USB_SCAN_DELAY
>   option to a non 0 value to add an extra delay before the first usb
>   bus scan.
>  
> +config RGMII
> + bool "Enable RGMII"

This should be in drivers/net too

> + default n

And this is already the default.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] [PATCH 06/10] sunxi: Convert SUNXI_EMAC to Kconfig

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 04:44:15PM +0100, Mylène Josserand wrote:
> +config SUNXI_EMAC
> +bool "Allwinner Ethernet MAC support"
> +depends on DM_ETH
> +help
> +  This driver supports the general Allwinner Ethernet MAC.
> +

This would be great to rename it as well to SUN4I_EMAC to avoid
introducing confusion with SUN8I_EMAC

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


[U-Boot] [PATCH 8/9] defconfig: k2e_hs_evm: Add k2e_hs_evm_defconfig

2017-02-23 Thread Andrew F. Davis
TI K2E secure devices have to be built with TI_SECURE_DEVICE, FIT, and
FIT_IMAGE_POST_PROCESS enabled. Add a dedicated defconfig for this.

Signed-off-by: Vitaly Andrianov 
Signed-off-by: Madan Srinivas 
Signed-off-by: Andrew F. Davis 
---
 configs/k2e_hs_evm_defconfig | 51 
 1 file changed, 51 insertions(+)
 create mode 100644 configs/k2e_hs_evm_defconfig

diff --git a/configs/k2e_hs_evm_defconfig b/configs/k2e_hs_evm_defconfig
new file mode 100644
index 00..d515cedaca
--- /dev/null
+++ b/configs/k2e_hs_evm_defconfig
@@ -0,0 +1,51 @@
+CONFIG_ARM=y
+CONFIG_ARCH_KEYSTONE=y
+CONFIG_SYS_TEXT_BASE=0x0c60
+CONFIG_TARGET_K2E_EVM=y
+CONFIG_TI_SECURE_DEVICE=y
+CONFIG_DEFAULT_DEVICE_TREE="keystone-k2e-evm"
+CONFIG_FIT=y
+CONFIG_FIT_IMAGE_POST_PROCESS=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="K2E HS EVM # "
+CONFIG_CMD_BOOTZ=y
+# CONFIG_CMD_IMLS is not set
+CONFIG_CMD_ASKENV=y
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_NAND=y
+CONFIG_CMD_PART=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_SPI=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_USB=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_UBI=y
+CONFIG_ISO_PARTITION=y
+CONFIG_EFI_PARTITION=y
+CONFIG_OF_CONTROL=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM=y
+CONFIG_TI_AEMIF=y
+# CONFIG_MMC is not set
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_DM_ETH=y
+CONFIG_DM_SERIAL=y
+CONFIG_SYS_NS16550=y
+CONFIG_DM_SPI=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_STORAGE=y
-- 
2.11.0

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


[U-Boot] Please pull u-boot-rockchip

2017-02-23 Thread Simon Glass
Hi Tom,

This includes support for two SoCs that have been in the works for a while:
rk3188 from Heiko Stübner and and SPL for rk3399 from Kever Yang. For the
former there are a few more patches to come but I'll apply them in a few
days once I've had time to test. In addition this includes rk3328 also from
Kever which is based on the rk3399 work. I've decided to bring this in also
as the impact is minimal.

There are a few bugs in mainline affecting rockchip which I'd like to fix
for the release also. But I want to take a bit more time to really
understand the problem before applying anything. Hopefully I will have
those early next week. I'm sending this pull request now as I feel
uncomfortable having so many pending patches.


The following changes since commit b24cf8540a85a9bf97975aadd6a7542f166c78a3:

  video: mxsfb: Fix reset hang when videomode variable is not present
(2017-02-22 21:47:59 +0100)

are available in the git repository at:

  git://git.denx.de/u-boot-rockchip.git

for you to fetch changes up to 984fe3b08c8fcc61253965c88f882411ad8c78ec:

  rockchip: rk3288: add defconfig for evb-rk3328 (2017-02-23 09:17:59 -0700)


Eddie Cai (1):
  rockchip: tinker: configs: use correct mmc instance as boot target
device

Heiko Stübner (18):
  dm: allow limiting pre-reloc markings to spl or tpl
  rockchip: clk: rk3288: limit gpll and cpll init to SPL build
  rockchip: rk3288: sdram: use constants in ddrconf table
  rockchip: rk3288: sdram: style fixes from rk3188 sdram review
  rockchip: Move bootrom helper compilation to a hidden option
  rockchip: Move bootrom-related declarations to a header
  rockchip: mkimage: Allow encoding of loader code in spl images
  rockchip: mkimage: Add support rk3188 serial
  rockchip: serial: Adapt rockchip of-platdata driver for rk3188
  rockchip: rk3188: Add header files for PMU and GRF
  rockchip: rk3188: Add pinctrl driver
  rockchip: rk3188: Add sysreset driver
  rockchip: rk3188: Add rk3066/rk3188 clock bindings
  rockchip: rk3188: Add clock driver
  rockchip: rk3188: Add core devicetree files
  rockchip: rk3188: Add core support
  rockchip: rk3188: Add sdram driver
  rockchip: rk3188: Add main, spl and tpl boards

Jacob Chen (1):
  rockchip: firefly: configs: remove config_spl_of_platdata

Kever Yang (16):
  rockchip: arm64: rk3399: move grf register definitions to grf_rk3399.h
  rockchip: clk: rk3399: update driver for spl
  rockchip: sdhci: rk3399: update driver to support of-platdata
  rockchip: pinctrl: rk3399: add the of-platdata support
  rockchip: arm64: rk3399: syscon addition for rk3399
  rockchip: arm64: rk3399: add ddr controller driver
  rockchip: dts: rk3399: update for spl require driver
  rockchip: arm64: rk3399: add SPL support
  rockchip: config: rk3399: enable SPL config for evb-rk3399
  rockchip: rk3328: add device tree file
  rockchip: rk3328: add soc basic support
  rockchip: rk3328: add clock driver
  rockchip: rk3328: add pinctrl driver
  rockchip: rk3328: add sysreset driver
  rockchip: rk3328: add evb-rk3328 support
  rockchip: rk3288: add defconfig for evb-rk3328

 arch/arm/dts/Makefile  |1 +
 arch/arm/dts/rk3188.dtsi   |  601
++
 arch/arm/dts/rk3328-evb.dts|   45 +
 arch/arm/dts/rk3328.dtsi   | 1477
+
 arch/arm/dts/rk3399-evb.dts|2 +
 arch/arm/dts/rk3399-sdram-lpddr3-4GB-1600.dtsi | 1536
+++
 arch/arm/dts/rk3399.dtsi   |   44 +
 arch/arm/dts/rk3xxx.dtsi   |  417 ++
 arch/arm/include/asm/arch-rockchip/bootrom.h   |   22 +
 arch/arm/include/asm/arch-rockchip/clock.h |9 +
 arch/arm/include/asm/arch-rockchip/cru_rk3188.h|  191 +
 arch/arm/include/asm/arch-rockchip/cru_rk3328.h|   70 ++
 arch/arm/include/asm/arch-rockchip/cru_rk3399.h|5 +
 arch/arm/include/asm/arch-rockchip/ddr_rk3188.h|   25 +
 arch/arm/include/asm/arch-rockchip/ddr_rk3288.h|8 +
 arch/arm/include/asm/arch-rockchip/grf_rk3188.h|  589
++
 arch/arm/include/asm/arch-rockchip/grf_rk3328.h|  134 +++
 arch/arm/include/asm/arch-rockchip/grf_rk3399.h|  118 +++
 arch/arm/include/asm/arch-rockchip/pmu_rk3188.h|   36 +
 arch/arm/include/asm/arch-rockchip/sdram_rk3399.h  |  119 +++
 arch/arm/mach-rockchip/Kconfig |   34 +
 arch/arm/mach-rockchip/Makefile|   16 +-
 arch/arm/mach-rockchip/rk3036-board-spl.c  |3 +-
 arch/arm/mach-rockchip/rk3188-board-spl.c  |  218 +
 

Re: [U-Boot] [PATCH v3 5/7] rockchip: rk3328: add sysreset driver

2017-02-23 Thread Simon Glass
On 23 February 2017 at 00:37, Kever Yang  wrote:
> Add rk3328 sysreset driver.
>
> Signed-off-by: William Zhang 
> Signed-off-by: Kever Yang 
> Acked-by: Simon Glass 
> ---
>
> Changes in v3: None
> Changes in v2:
> - fix include header file order
>
>  drivers/sysreset/Makefile  |  1 +
>  drivers/sysreset/sysreset_rk3328.c | 45 
> ++
>  2 files changed, 46 insertions(+)
>  create mode 100644 drivers/sysreset/sysreset_rk3328.c

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 3/7] rockchip: rk3328: add clock driver

2017-02-23 Thread Simon Glass
On 23 February 2017 at 00:37, Kever Yang  wrote:
> Add rk3328 clock driver and cru structure definition.
>
> Signed-off-by: William Zhang 
> Signed-off-by: Kever Yang 
> ---
>
> Changes in v3:
> - remove I2C reg value MACRO definition
>
> Changes in v2:
> - split rockchip_get_cru into arch/arm/mach-rockchip
> - fix include header file order
> - drop MACRO for I2C reg access
> - use OSC_HZ for 24*1024*1024
>
>  arch/arm/include/asm/arch-rockchip/cru_rk3328.h |  70 +++
>  arch/arm/mach-rockchip/rk3328/Makefile  |   1 +
>  arch/arm/mach-rockchip/rk3328/clk_rk3328.c  |  31 ++
>  drivers/clk/rockchip/Makefile   |   1 +
>  drivers/clk/rockchip/clk_rk3328.c   | 581 
> 
>  5 files changed, 684 insertions(+)
>  create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3328.h
>  create mode 100644 arch/arm/mach-rockchip/rk3328/clk_rk3328.c
>  create mode 100644 drivers/clk/rockchip/clk_rk3328.c

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 6/7] rockchip: rk3328: add evb-rk3328 support

2017-02-23 Thread Simon Glass
On 23 February 2017 at 00:37, Kever Yang  wrote:
> evb-rk3328 is an evb from Rockchip based on rk3328 SoC:
> - 2 USB2.0 Host port;
> - 1 USB3.0 Host port;
> - 1 HDMI port;
> - 2 10/100M eth port;
> - 2GB ddr;
> - 16GB eMMC;
> - UART to USB debug port;
>
> Signed-off-by: William Zhang 
> Signed-off-by: Kever Yang 
> Acked-by: Simon Glass 
> ---
>
> Changes in v3:
> - Moved changes to arch/arm/mach-rockchip/rk3328/Kconfig into this patch
>
> Changes in v2:
> - README file fix
>
>  arch/arm/mach-rockchip/rk3328/Kconfig  | 23 +++
>  board/rockchip/evb_rk3328/Kconfig  | 15 
>  board/rockchip/evb_rk3328/MAINTAINERS  |  6 +++
>  board/rockchip/evb_rk3328/Makefile |  7 
>  board/rockchip/evb_rk3328/README   | 70 
> ++
>  board/rockchip/evb_rk3328/evb-rk3328.c | 40 +++
>  include/configs/evb_rk3328.h   | 26 +
>  7 files changed, 187 insertions(+)
>  create mode 100644 arch/arm/mach-rockchip/rk3328/Kconfig
>  create mode 100644 board/rockchip/evb_rk3328/Kconfig
>  create mode 100644 board/rockchip/evb_rk3328/MAINTAINERS
>  create mode 100644 board/rockchip/evb_rk3328/Makefile
>  create mode 100644 board/rockchip/evb_rk3328/README
>  create mode 100644 board/rockchip/evb_rk3328/evb-rk3328.c
>  create mode 100644 include/configs/evb_rk3328.h

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/3] Sync HS and non-HS defconfigs

2017-02-23 Thread Tom Rini
On Wed, Feb 22, 2017 at 05:22:17PM -0600, Andrew F. Davis wrote:

> Hi all,
> 
> The HS and non-HS versions of TI boards are very similar but
> currently need separate defconfigs, these should be almost
> identical outside of the security additions. When they
> track out of sync it is normally not a problem, but a couple
> of these changes are now important and so lets sync them up.
> 
> Thanks,
> Andrew
> 
> Andrew F. Davis (3):
>   defconfigs: am43xx_hs_evm: Sync HS and non-HS defconfigs
>   defconfigs: am57xx_hs_evm: Sync HS and non-HS defconfigs
>   defconfigs: dra7xx_hs_evm: Sync HS and non-HS defconfigs
> 
>  configs/am43xx_hs_evm_defconfig | 4 +++-
>  configs/am57xx_hs_evm_defconfig | 7 +++
>  configs/dra7xx_hs_evm_defconfig | 1 +
>  3 files changed, 11 insertions(+), 1 deletion(-)

This feels like another area where we need to be implying things in
arch/arm/mach-omap2/am33xx/Kconfig or arch/arm/Kconfig, depending on if
it's board feature or SoC feature.  And some of the DM_xxx we should be
select'ing as it then comes down to imply'ing the driver that makes use
of the framework as we should be discarding the unused framework at link
time if there's no driver to it.  Thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] ARM: ti: Update layout for MMC and eMMC (env and dfu)

2017-02-23 Thread Jean-Jacques Hiblot



On 23/02/2017 14:46, Sam Protsenko wrote:

On Wed, Feb 22, 2017 at 10:27 AM, Jean-Jacques Hiblot  wrote:

The problems with the current DFU layout are:
MMC: The space allocated for u-boot is too small for the latest u-boot
  (>750KB). We need to increase it. eMMC uses a much bigger area (2MB).
eMMC: region "u-boot.img.raw" overlaps the environment area and the region
   "spl-os-image.raw".
both: region "spl-os-image.raw" is quite small and can't handle android
   kernels

Fixing this requires growing some regions and moving others.
Care has been taken to leave some room for further growth of
"spl-os-args.raw".
Also the "env" now appears in the dfu so that it's apparent that the
region is not free space that can be used to grow "u-boot.img.raw".
The total space allocated for those raw binaries is 16MB, of which 13+MB
are reserved for the kernel image.

Signed-off-by: Jean-Jacques Hiblot 
---

Sam,

This patch goes a bit further in changing the layout of the MMC than yours. 
However
it doesn't update the GPT partitioning. This would still be needed.


Hi Jean-Jacques,

Got a couple of questions about this change and my patch (changing
eMMC partitions table), about how to make them play nice together.

1. How DFU table is connected to eMMC partition table? And why my
patch was interfering with DFU table?
AFAIK DFU is not related to GPT. I never used the GPT so I can't for 
sure how it fits together.
My guess is that env_mmc.c has no idea that GPT even exists and uses raw 
access to the eMMC. In this case CONFIG_ENV_OFFSET must be defined to 
point at the beginning of your env partition and must be adapted when 
the GPT is updated. The same goes for the DFU. Ideally GPT and DFU 
should use the same layout (at least for MLO, u-boot, kernel and args).



2. Can I change CONFIG_ENV_OFFSET? Because my changes is going to move
"reserved" partition on eMMC, where U-Boot environment is stored. Or
it should be in sync with DFU table somehow? If yes -- we should work
together to find solution that works best for both cases.
CONFIG_ENV_OFFSET is loosely related to DFU: we don't update the 
environment through DFU. However we must make sure that the area used to 
store the env doesn't overlap a another region (MLO, u-boot, kernel, 
args). The dfu doesn't define those regions, it's done with #defines 
like CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR. But DFU exposes them for 
"remote" upgrade.



3. What about my similar patch for AM57x EVM (see [1])? Is it fine, or
it affects DFU table as well?
I guess it's OK because the env is stored in a FAT partition: 
CONFIG_ENV_OFFSET is not used




Thanks.

[1] https://patchwork.ozlabs.org/patch/730736/


tested on DRA7. DFU updates ok for MMC and eMMC

Jean-Jacques

  include/configs/dra7xx_evm.h  |  2 +-
  include/configs/omap5_uevm.h  |  2 +-
  include/configs/ti_armv7_common.h |  7 ---
  include/environment/ti/dfu.h  | 14 --
  4 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index bce2816..a56c224 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -28,7 +28,7 @@
  #define CONFIG_ENV_IS_IN_MMC
  #define CONFIG_SYS_MMC_ENV_DEV 1   /* SLOT2: eMMC(1) */
  #define CONFIG_ENV_SIZE(128 << 10)
-#define CONFIG_ENV_OFFSET  0xE
+#define CONFIG_ENV_OFFSET  0x22
  #define CONFIG_ENV_OFFSET_REDUND   (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
  #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
  #endif
diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h
index 736d804..127776e 100644
--- a/include/configs/omap5_uevm.h
+++ b/include/configs/omap5_uevm.h
@@ -38,7 +38,7 @@
  #define CONFIG_ENV_IS_IN_MMC
  #define CONFIG_SYS_MMC_ENV_DEV 1   /* SLOT2: eMMC(1) */
  #define CONFIG_ENV_SIZE(128 << 10)
-#define CONFIG_ENV_OFFSET  0xE
+#define CONFIG_ENV_OFFSET  0x22
  #define CONFIG_ENV_OFFSET_REDUND   (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
  #define CONFIG_SYS_REDUNDAND_ENVIRONMENT

diff --git a/include/configs/ti_armv7_common.h 
b/include/configs/ti_armv7_common.h
index 905e1ef..4cfa134 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -282,9 +282,10 @@
  #define CONFIG_SPL_FS_LOAD_ARGS_NAME   "args"

  /* RAW SD card / eMMC */
-#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR0x900   /* address 
0x12 */
-#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0x80/* address 0x1 */
-#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0x80/* 64KiB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR0x1500  /* address 
0x2A */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0x1300  /* address 0x26 */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0x100   /* 128KiB */
+

  /* spl export command */
  #define 

Re: [U-Boot] [PATCH] ARM: ti: Update layout for MMC and eMMC (env and dfu)

2017-02-23 Thread Sam Protsenko
On Wed, Feb 22, 2017 at 10:27 AM, Jean-Jacques Hiblot  wrote:
> The problems with the current DFU layout are:
> MMC: The space allocated for u-boot is too small for the latest u-boot
>  (>750KB). We need to increase it. eMMC uses a much bigger area (2MB).
> eMMC: region "u-boot.img.raw" overlaps the environment area and the region
>   "spl-os-image.raw".
> both: region "spl-os-image.raw" is quite small and can't handle android
>   kernels
>
> Fixing this requires growing some regions and moving others.
> Care has been taken to leave some room for further growth of
> "spl-os-args.raw".
> Also the "env" now appears in the dfu so that it's apparent that the
> region is not free space that can be used to grow "u-boot.img.raw".
> The total space allocated for those raw binaries is 16MB, of which 13+MB
> are reserved for the kernel image.
>
> Signed-off-by: Jean-Jacques Hiblot 
> ---
>
> Sam,
>
> This patch goes a bit further in changing the layout of the MMC than yours. 
> However
> it doesn't update the GPT partitioning. This would still be needed.
>

Hi Jean-Jacques,

Got a couple of questions about this change and my patch (changing
eMMC partitions table), about how to make them play nice together.

1. How DFU table is connected to eMMC partition table? And why my
patch was interfering with DFU table?
2. Can I change CONFIG_ENV_OFFSET? Because my changes is going to move
"reserved" partition on eMMC, where U-Boot environment is stored. Or
it should be in sync with DFU table somehow? If yes -- we should work
together to find solution that works best for both cases.
3. What about my similar patch for AM57x EVM (see [1])? Is it fine, or
it affects DFU table as well?

Thanks.

[1] https://patchwork.ozlabs.org/patch/730736/

> tested on DRA7. DFU updates ok for MMC and eMMC
>
> Jean-Jacques
>
>  include/configs/dra7xx_evm.h  |  2 +-
>  include/configs/omap5_uevm.h  |  2 +-
>  include/configs/ti_armv7_common.h |  7 ---
>  include/environment/ti/dfu.h  | 14 --
>  4 files changed, 14 insertions(+), 11 deletions(-)
>
> diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
> index bce2816..a56c224 100644
> --- a/include/configs/dra7xx_evm.h
> +++ b/include/configs/dra7xx_evm.h
> @@ -28,7 +28,7 @@
>  #define CONFIG_ENV_IS_IN_MMC
>  #define CONFIG_SYS_MMC_ENV_DEV 1   /* SLOT2: eMMC(1) */
>  #define CONFIG_ENV_SIZE(128 << 10)
> -#define CONFIG_ENV_OFFSET  0xE
> +#define CONFIG_ENV_OFFSET  0x22
>  #define CONFIG_ENV_OFFSET_REDUND   (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
>  #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
>  #endif
> diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h
> index 736d804..127776e 100644
> --- a/include/configs/omap5_uevm.h
> +++ b/include/configs/omap5_uevm.h
> @@ -38,7 +38,7 @@
>  #define CONFIG_ENV_IS_IN_MMC
>  #define CONFIG_SYS_MMC_ENV_DEV 1   /* SLOT2: eMMC(1) */
>  #define CONFIG_ENV_SIZE(128 << 10)
> -#define CONFIG_ENV_OFFSET  0xE
> +#define CONFIG_ENV_OFFSET  0x22
>  #define CONFIG_ENV_OFFSET_REDUND   (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
>  #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
>
> diff --git a/include/configs/ti_armv7_common.h 
> b/include/configs/ti_armv7_common.h
> index 905e1ef..4cfa134 100644
> --- a/include/configs/ti_armv7_common.h
> +++ b/include/configs/ti_armv7_common.h
> @@ -282,9 +282,10 @@
>  #define CONFIG_SPL_FS_LOAD_ARGS_NAME   "args"
>
>  /* RAW SD card / eMMC */
> -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR0x900   /* address 
> 0x12 */
> -#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0x80/* address 0x1 */
> -#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0x80/* 64KiB */
> +#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR0x1500  /* address 
> 0x2A */
> +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0x1300  /* address 0x26 */
> +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0x100   /* 128KiB */
> +
>
>  /* spl export command */
>  #define CONFIG_CMD_SPL
> diff --git a/include/environment/ti/dfu.h b/include/environment/ti/dfu.h
> index caf71a3..63e0ab8 100644
> --- a/include/environment/ti/dfu.h
> +++ b/include/environment/ti/dfu.h
> @@ -12,9 +12,10 @@
> "rootfs part 0 2;" \
> "MLO fat 0 1;" \
> "MLO.raw raw 0x100 0x100;" \
> -   "u-boot.img.raw raw 0x300 0x400;" \
> -   "spl-os-args.raw raw 0x80 0x80;" \
> -   "spl-os-image.raw raw 0x900 0x2000;" \
> +   "u-boot.img.raw raw 0x300 0xE00;" \
> +   "u-env.raw raw 0x1100 0x200;" \
> +   "spl-os-args.raw raw 0x1300 0x100;" \
> +   "spl-os-image.raw raw 0x1500 0x6B00;" \
> "spl-os-args fat 0 1;" \
> "spl-os-image fat 0 1;" \
> "u-boot.img fat 0 1;" \
> @@ -27,9 +28,10 @@
> "rootfs part 1 2;" \
> "MLO fat 1 1;" \
> "MLO.raw 

[U-Boot] [PATCH v4 6/7] arm: am57xx: cl-som-am57x: enable USB storage

2017-02-23 Thread Uri Mashiach
Add CONFIG_USB_STORAGE to the defconfig file.

Signed-off-by: Uri Mashiach 
Reviewed-by: Tom Rini 
---
V1 -> V4: none

 configs/cl-som-am57x_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/cl-som-am57x_defconfig b/configs/cl-som-am57x_defconfig
index 916b836..1831f45 100644
--- a/configs/cl-som-am57x_defconfig
+++ b/configs/cl-som-am57x_defconfig
@@ -47,4 +47,5 @@ CONFIG_TI_QSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_STORAGE=y
 CONFIG_OF_LIBFDT=y
-- 
2.7.4

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


[U-Boot] [PATCH v4 7/7] arm: am57xx: cl-som-am57x: enable USB commands

2017-02-23 Thread Uri Mashiach
Add CONFIG_CMD_USB to the defconfig file.

Signed-off-by: Uri Mashiach 
Reviewed-by: Tom Rini 
---
V1 -> V4: none

 configs/cl-som-am57x_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/cl-som-am57x_defconfig b/configs/cl-som-am57x_defconfig
index 1831f45..83d7bd0 100644
--- a/configs/cl-som-am57x_defconfig
+++ b/configs/cl-som-am57x_defconfig
@@ -15,6 +15,7 @@ CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_I2C=y
+CONFIG_CMD_USB=y
 CONFIG_CMD_GPIO=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
-- 
2.7.4

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


[U-Boot] [PATCH v4 5/7] arm: am57xx: cl-som-am57x: fix USB scan

2017-02-23 Thread Uri Mashiach
USB bus scan attempt:
--cut--
=> usb start
starting USB...
USB0:   Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... data abort
pc : []  lr : []
reloc pc : [<8081b40e>]lr : [<8081b3b3>]
sp : fdf42930  ip : fdf42960 fp : 
r10: 0001  r9 : fdf42ef0 r8 : 48890020
r7 : 0002  r6 : fffa5840 r5 : fff8b140  r4 : fdf429c0
r3 :   r2 : 0004 r1 :   r0 : 
Flags: nZcv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...
--cut--

Fix by enabling USB configuration in the SPL.

Signed-off-by: Uri Mashiach 
Reviewed-by: Tom Rini 
Reviewed-by: Igor Grinberg 
---
V1 -> V4: none

 include/configs/cl-som-am57x.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/configs/cl-som-am57x.h b/include/configs/cl-som-am57x.h
index c5f39ff..3418005 100644
--- a/include/configs/cl-som-am57x.h
+++ b/include/configs/cl-som-am57x.h
@@ -83,6 +83,8 @@
 #define CONFIG_SYS_I2C_PCA953X_ADDR 0x20
 #define CONFIG_SYS_I2C_PCA953X_WIDTH{ {0x20, 16} }
 
+#endif /* !CONFIG_SPL_BUILD */
+
 /* USB xHCI HOST */
 #define CONFIG_USB_XHCI_OMAP
 #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2
@@ -97,8 +99,6 @@
 #define CONFIG_USB_ETHER_ASIX
 #define CONFIG_USB_ETHER_MCS7830
 
-#endif /* !CONFIG_SPL_BUILD */
-
 /* CPSW Ethernet */
 #define CONFIG_DRIVER_TI_CPSW
 #define CONFIG_MII
-- 
2.7.4

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


[U-Boot] [PATCH v4 2/7] arm: usb: dra7xx: xHCI registers based on USB port index

2017-02-23 Thread Uri Mashiach
Modify the determination of the base address of xHCI registers of DRA7XX
targets.
Before the commit: by the target.
After the commit: by the USB port index.

Cc: Lokesh Vutla 
Cc: Marek Vasut 
Cc: Roger Quadros 
Signed-off-by: Uri Mashiach 
---
V1 -> V2: Replace the commit "fix XHCI registers base address".
V2 -> V3: Replace the commit "reintroduce the CONFIG_AM57XX symbol"
V3 -> V4: Replace boolean symbols USB_XHCI_DRA7XX_INDEX0 and 
USB_XHCI_DRA7XX_INDEX1 with
  integer symbol USB_XHCI_DRA7XX_INDEX.

 configs/dra7xx_evm_defconfig| 1 +
 configs/dra7xx_hs_evm_defconfig | 1 +
 drivers/usb/host/Kconfig| 9 +
 include/linux/usb/xhci-omap.h   | 6 --
 4 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/configs/dra7xx_evm_defconfig b/configs/dra7xx_evm_defconfig
index 26b26cc..05f7778 100644
--- a/configs/dra7xx_evm_defconfig
+++ b/configs/dra7xx_evm_defconfig
@@ -86,6 +86,7 @@ CONFIG_OMAP_TIMER=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_XHCI_DRA7XX_INDEX=1
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_OMAP=y
diff --git a/configs/dra7xx_hs_evm_defconfig b/configs/dra7xx_hs_evm_defconfig
index 244940c..23ae2c7 100644
--- a/configs/dra7xx_hs_evm_defconfig
+++ b/configs/dra7xx_hs_evm_defconfig
@@ -91,6 +91,7 @@ CONFIG_OMAP_TIMER=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_XHCI_DRA7XX_INDEX=1
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_OMAP=y
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 5129a57..3ff79fc 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -43,6 +43,15 @@ config USB_XHCI_ZYNQMP
help
  Enables support for the on-chip xHCI controller on Xilinx ZynqMP SoCs.
 
+config USB_XHCI_DRA7XX_INDEX
+   int "DRA7XX xHCI USB index"
+   range 0 1
+   default 0
+   depends on DRA7XX
+   help
+ Select the DRA7XX xHCI USB index.
+ Current supported values: 0, 1.
+
 endif # USB_XHCI_HCD
 
 config USB_EHCI_HCD
diff --git a/include/linux/usb/xhci-omap.h b/include/linux/usb/xhci-omap.h
index 9de80d7..f038ddb 100644
--- a/include/linux/usb/xhci-omap.h
+++ b/include/linux/usb/xhci-omap.h
@@ -10,14 +10,16 @@
 #ifndef _ASM_ARCH_XHCI_OMAP_H_
 #define _ASM_ARCH_XHCI_OMAP_H_
 
-#ifdef CONFIG_TARGET_DRA7XX_EVM
+#ifdef CONFIG_DRA7XX
+#if CONFIG_USB_XHCI_DRA7XX_INDEX == 1
 #define OMAP_XHCI_BASE 0x488d
 #define OMAP_OCP1_SCP_BASE 0x4A081000
 #define OMAP_OTG_WRAPPER_BASE 0x488c
-#elif defined CONFIG_TARGET_AM57XX_EVM
+#elif CONFIG_USB_XHCI_DRA7XX_INDEX == 0
 #define OMAP_XHCI_BASE 0x4889
 #define OMAP_OCP1_SCP_BASE 0x4A084c00
 #define OMAP_OTG_WRAPPER_BASE 0x4888
+#endif /* CONFIG_USB_XHCI_DRA7XX_INDEX == 1 */
 #elif defined CONFIG_AM43XX
 #define OMAP_XHCI_BASE 0x483d
 #define OMAP_OCP1_SCP_BASE 0x483E8000
-- 
2.7.4

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


[U-Boot] [PATCH v4 1/7] arm: dra7xx: move CONFIG_DRA7XX to Kconfig

2017-02-23 Thread Uri Mashiach
The symbol CONFIG_DRA7XX is needed for Kconfig conditions.

Cc: Lokesh Vutla 
Signed-off-by: Uri Mashiach 
---
V2 -> V3: new commit
V3 -> V4: move the DRA7XX symbol introduction to 
arch/arm/mach-omap2/omap5/Kconfig

 arch/arm/mach-omap2/omap5/Kconfig | 8 
 include/configs/am57xx_evm.h  | 2 --
 include/configs/cl-som-am57x.h| 2 --
 include/configs/dra7xx_evm.h  | 2 --
 scripts/config_whitelist.txt  | 1 -
 5 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/omap5/Kconfig 
b/arch/arm/mach-omap2/omap5/Kconfig
index c5edc7c..179e2b7 100644
--- a/arch/arm/mach-omap2/omap5/Kconfig
+++ b/arch/arm/mach-omap2/omap5/Kconfig
@@ -36,12 +36,18 @@ config SPL_SERIAL_SUPPORT
 config SPL_DISPLAY_PRINT
default y
 
+config DRA7XX
+   bool
+   help
+ DRA7xx is an OMAP based SOC with Dual Core A-15s.
+
 choice
prompt "OMAP5 board select"
optional
 
 config TARGET_CL_SOM_AM57X
bool "CompuLab CL-SOM-AM57x"
+   select DRA7XX
 
 config TARGET_CM_T54
bool "CompuLab CM-T54"
@@ -54,11 +60,13 @@ config TARGET_DRA7XX_EVM
select BOARD_LATE_INIT
select TI_I2C_BOARD_DETECT
select PHYS_64BIT
+   select DRA7XX
 
 config TARGET_AM57XX_EVM
bool "AM57XX"
select BOARD_LATE_INIT
select TI_I2C_BOARD_DETECT
+   select DRA7XX
 
 endchoice
 
diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
index 3d8b996..42cd434 100644
--- a/include/configs/am57xx_evm.h
+++ b/include/configs/am57xx_evm.h
@@ -14,8 +14,6 @@
 
 #include 
 
-#define CONFIG_DRA7XX
-
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_IODELAY_RECALIBRATION
 #endif
diff --git a/include/configs/cl-som-am57x.h b/include/configs/cl-som-am57x.h
index e1f724b..c5f39ff 100644
--- a/include/configs/cl-som-am57x.h
+++ b/include/configs/cl-som-am57x.h
@@ -11,8 +11,6 @@
 #ifndef __CONFIG_CL_SOM_AM57X_H
 #define __CONFIG_CL_SOM_AM57X_H
 
-#define CONFIG_DRA7XX
-
 #define CONFIG_NR_DRAM_BANKS   2
 
 #define CONSOLEDEV "ttyO2"
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index 549439e..beba851 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -14,8 +14,6 @@
 
 #include 
 
-#define CONFIG_DRA7XX
-
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_IODELAY_RECALIBRATION
 #endif
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index f6c9101..bbcdc41 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -805,7 +805,6 @@ CONFIG_DNP5370_EXT_WD_DISABLE
 CONFIG_DP_DDR_CTRL
 CONFIG_DP_DDR_DIMM_SLOTS_PER_CTLR
 CONFIG_DP_DDR_NUM_CTRLS
-CONFIG_DRA7XX
 CONFIG_DRAM_2G
 CONFIG_DRAM_TIMINGS_
 CONFIG_DRIVER_AT91EMAC
-- 
2.7.4

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


[U-Boot] [PATCH v4 3/7] usb: host: xhci-omap: fix double weak board_usb_init functions

2017-02-23 Thread Uri Mashiach
A weak version of the function board_usb_init is implemented in:
common/usb.c
drivers/usb/host/xhci-omap.c

To fix the double implementations:
* Convert the board_usb_init function in drivers/usb/host/xhci-omap.c
  normal (not weak).
* The function board_usb_init in drivers/usb/host/xhci-omap.c calls to
  the weak function omap_xhci_board_usb_init.
* Rename board version of the function board_usb_init to
  omap_xhci_board_usb_init.
  Done only for boards that defines CONFIG_USB_XHCI_OMAP.

To achieve the same flexibility with the function board_usb_cleanup:
* Add a normal (not weak) implementation of the function
  board_usb_cleanup in drivers/usb/host/xhci-omap.c
* The function board_usb_cleanup in drivers/usb/host/xhci-omap.c calls
  to the weak function omap_xhci_board_usb_cleanup.
* Rename board version of the function board_usb_cleanup to
  omap_xhci_board_usb_cleanup.
  Done only for boards that defines CONFIG_USB_XHCI_OMAP.

Cc: Lokesh Vutla 
Signed-off-by: Uri Mashiach 
Acked-by: Marek Vasut 
Reviewed-by: Tom Rini 
---
V1 -> V2: Use __weak instead of attribute block
V2 -> V4: none

 board/compulab/cl-som-am57x/cl-som-am57x.c |  2 +-
 board/ti/am43xx/board.c|  4 ++--
 board/ti/am57xx/board.c|  4 ++--
 board/ti/dra7xx/evm.c  |  4 ++--
 drivers/usb/host/xhci-omap.c   | 17 +++--
 5 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/board/compulab/cl-som-am57x/cl-som-am57x.c 
b/board/compulab/cl-som-am57x/cl-som-am57x.c
index bdd0a2b..fe1468f 100644
--- a/board/compulab/cl-som-am57x/cl-som-am57x.c
+++ b/board/compulab/cl-som-am57x/cl-som-am57x.c
@@ -54,7 +54,7 @@ int board_mmc_init(bd_t *bis)
 #endif /* CONFIG_GENERIC_MMC */
 
 #ifdef CONFIG_USB_XHCI_OMAP
-int board_usb_init(int index, enum usb_init_type init)
+int omap_xhci_board_usb_init(int index, enum usb_init_type init)
 {
setbits_le32((*prcm)->cm_l3init_usb_otg_ss1_clkctrl,
 OTG_SS_CLKCTRL_MODULEMODE_HW | OPTFCLKEN_REFCLK960M);
diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
index 390cc16..2572029 100644
--- a/board/ti/am43xx/board.c
+++ b/board/ti/am43xx/board.c
@@ -694,7 +694,7 @@ int usb_gadget_handle_interrupts(int index)
 #endif /* CONFIG_USB_DWC3 */
 
 #if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP)
-int board_usb_init(int index, enum usb_init_type init)
+int omap_xhci_board_usb_init(int index, enum usb_init_type init)
 {
enable_usb_clocks(index);
 #ifdef CONFIG_USB_DWC3
@@ -725,7 +725,7 @@ int board_usb_init(int index, enum usb_init_type init)
return 0;
 }
 
-int board_usb_cleanup(int index, enum usb_init_type init)
+int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
 {
 #ifdef CONFIG_USB_DWC3
switch (index) {
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index 1611514..4afa914 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -618,7 +618,7 @@ int usb_gadget_handle_interrupts(int index)
 #endif /* CONFIG_USB_DWC3 */
 
 #if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP)
-int board_usb_init(int index, enum usb_init_type init)
+int omap_xhci_board_usb_init(int index, enum usb_init_type init)
 {
enable_usb_clocks(index);
switch (index) {
@@ -652,7 +652,7 @@ int board_usb_init(int index, enum usb_init_type init)
return 0;
 }
 
-int board_usb_cleanup(int index, enum usb_init_type init)
+int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
 {
 #ifdef CONFIG_USB_DWC3
switch (index) {
diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index bd1c809..65bce93 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -727,7 +727,7 @@ static struct ti_usb_phy_device usb_phy2_device = {
.index = 1,
 };
 
-int board_usb_init(int index, enum usb_init_type init)
+int omap_xhci_board_usb_init(int index, enum usb_init_type init)
 {
enable_usb_clocks(index);
switch (index) {
@@ -764,7 +764,7 @@ int board_usb_init(int index, enum usb_init_type init)
return 0;
 }
 
-int board_usb_cleanup(int index, enum usb_init_type init)
+int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
 {
switch (index) {
case 0:
diff --git a/drivers/usb/host/xhci-omap.c b/drivers/usb/host/xhci-omap.c
index b881b19..a1b4f2f 100644
--- a/drivers/usb/host/xhci-omap.c
+++ b/drivers/usb/host/xhci-omap.c
@@ -27,12 +27,25 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static struct omap_xhci omap;
 
-__weak int __board_usb_init(int index, enum usb_init_type init)
+__weak int omap_xhci_board_usb_init(int index, enum usb_init_type init)
 {
return 0;
 }
+
 int board_usb_init(int index, enum usb_init_type init)
-   __attribute__((weak, alias("__board_usb_init")));
+{
+   return omap_xhci_board_usb_init(index, init);
+}
+
+__weak int 

[U-Boot] [PATCH v4 4/7] arm: am57xx: cl-som-am57x: invoke clock API to enable/disable clocks

2017-02-23 Thread Uri Mashiach
Invoke enable_usb_clocks during board_usb_init and disable_usb_clocks
during board_usb_exit to enable and disable clocks respectively.

Modifications:
* Enable USB clocks in the OMAP version of the function
  board_usb_init.
* Disable USB clocks in the OMAP version of the function
  board_usb_cleanup.

Cc: Marek Vasut 
Signed-off-by: Uri Mashiach 
Reviewed-by: Marek Vasut 
Reviewed-by: Tom Rini 
---
V1 -> V4: none

 board/compulab/cl-som-am57x/cl-som-am57x.c | 10 --
 drivers/usb/host/xhci-omap.c   |  2 ++
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/board/compulab/cl-som-am57x/cl-som-am57x.c 
b/board/compulab/cl-som-am57x/cl-som-am57x.c
index fe1468f..4701b71 100644
--- a/board/compulab/cl-som-am57x/cl-som-am57x.c
+++ b/board/compulab/cl-som-am57x/cl-som-am57x.c
@@ -53,16 +53,6 @@ int board_mmc_init(bd_t *bis)
 }
 #endif /* CONFIG_GENERIC_MMC */
 
-#ifdef CONFIG_USB_XHCI_OMAP
-int omap_xhci_board_usb_init(int index, enum usb_init_type init)
-{
-   setbits_le32((*prcm)->cm_l3init_usb_otg_ss1_clkctrl,
-OTG_SS_CLKCTRL_MODULEMODE_HW | OPTFCLKEN_REFCLK960M);
-
-   return 0;
-}
-#endif /* CONFIG_USB_XHCI_OMAP */
-
 int misc_init_r(void)
 {
cl_print_pcb_info();
diff --git a/drivers/usb/host/xhci-omap.c b/drivers/usb/host/xhci-omap.c
index a1b4f2f..d6c5744 100644
--- a/drivers/usb/host/xhci-omap.c
+++ b/drivers/usb/host/xhci-omap.c
@@ -29,6 +29,7 @@ static struct omap_xhci omap;
 
 __weak int omap_xhci_board_usb_init(int index, enum usb_init_type init)
 {
+   enable_usb_clocks(index);
return 0;
 }
 
@@ -39,6 +40,7 @@ int board_usb_init(int index, enum usb_init_type init)
 
 __weak int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
 {
+   disable_usb_clocks(index);
return 0;
 }
 
-- 
2.7.4

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


[U-Boot] [PATCH v4 0/7] am57xx: cl-som-am57x: fix usb

2017-02-23 Thread Uri Mashiach
Various USB related comits for the CL-SOM-AM57x module.

---
V1 -> V2: Replace commit "fix XHCI registers base address" with "reintroduce 
the CONFIG_AM57XX symbol".
V2 -> V3: * New commit "move CONFIG_DRA7XX to Kconfig"
  * Replace commit "reintroduce the CONFIG_AM57XX symbol" with "xHCI 
registers based on USB port index"
V3 -> V4: Update commit "move CONFIG_DRA7XX to Kconfig"
  Update commit "xHCI registers based on USB port index"

Uri Mashiach (7):
  arm: dra7xx: move CONFIG_DRA7XX to Kconfig
  arm: usb: dra7xx: xHCI registers based on USB port index
  usb: host: xhci-omap: fix double weak board_usb_init functions
  arm: am57xx: cl-som-am57x: invoke clock API to enable/disable clocks
  arm: am57xx: cl-som-am57x: fix USB scan
  arm: am57xx: cl-som-am57x: enable USB storage
  arm: am57xx: cl-som-am57x: enable USB commands

 arch/arm/mach-omap2/omap5/Kconfig  |  8 
 board/compulab/cl-som-am57x/cl-som-am57x.c | 10 --
 board/ti/am43xx/board.c|  4 ++--
 board/ti/am57xx/board.c|  4 ++--
 board/ti/dra7xx/evm.c  |  4 ++--
 configs/cl-som-am57x_defconfig |  2 ++
 configs/dra7xx_evm_defconfig   |  1 +
 configs/dra7xx_hs_evm_defconfig|  1 +
 drivers/usb/host/Kconfig   |  9 +
 drivers/usb/host/xhci-omap.c   | 19 +--
 include/configs/am57xx_evm.h   |  2 --
 include/configs/cl-som-am57x.h |  6 ++
 include/configs/dra7xx_evm.h   |  2 --
 include/linux/usb/xhci-omap.h  |  6 --
 scripts/config_whitelist.txt   |  1 -
 15 files changed, 50 insertions(+), 29 deletions(-)

-- 
2.7.4

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


[U-Boot] [PATCH v2] armv8: fsl-lsch3: Instantiate TZASC configuration in 2 groups

2017-02-23 Thread Ashish Kumar
 Number of TZASC instances may vary across NXP SoCs.
 So put TZASC configuration under instance specific defines.

Signed-off-by: Prabhakar Kushwaha 
Signed-off-by: Ashish Kumar 
---
v2:
 Change description to make it more appropriate

 arch/arm/cpu/armv8/fsl-layerscape/Kconfig|  8 
 arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S | 24 +---
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig 
b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
index 29bc756..9eaafba 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
+++ b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
@@ -62,6 +62,8 @@ config ARCH_LS2080A
select SYS_FSL_SEC_COMPAT_5
select SYS_FSL_SEC_LE
select SYS_FSL_SRDS_2
+   select FSL_TZASC_1
+   select FSL_TZASC_2
select SYS_FSL_ERRATUM_A008336
select SYS_FSL_ERRATUM_A008511
select SYS_FSL_ERRATUM_A008514
@@ -201,6 +203,12 @@ config SYS_FSL_SRDS_2
 config SYS_HAS_SERDES
bool
 
+config FSL_TZASC_1
+   bool
+
+config FSL_TZASC_2
+   bool
+
 endmenu
 
 menu "Layerscape clock tree configuration"
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S 
b/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S
index a2185f2..79d1637 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S
+++ b/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S
@@ -229,38 +229,40 @@ ENTRY(lowlevel_init)
 * NOTE: As per the CCSR map doc, TZASC 3 and TZASC 4 are just
 *   placeholders.
 */
+#ifdef CONFIG_FSL_TZASC_1
ldr x1, =TZASC_GATE_KEEPER(0)
ldr w0, [x1]/* Filter 0 Gate Keeper Register */
orr w0, w0, #1 << 0 /* Set open_request for Filter 0 */
str w0, [x1]
 
-   ldr x1, =TZASC_GATE_KEEPER(1)
-   ldr w0, [x1]/* Filter 0 Gate Keeper Register */
-   orr w0, w0, #1 << 0 /* Set open_request for Filter 0 */
-   str w0, [x1]
-
ldr x1, =TZASC_REGION_ATTRIBUTES_0(0)
ldr w0, [x1]/* Region-0 Attributes Register */
orr w0, w0, #1 << 31/* Set Sec global write en, Bit[31] */
orr w0, w0, #1 << 30/* Set Sec global read en, Bit[30] */
str w0, [x1]
 
+   ldr x1, =TZASC_REGION_ID_ACCESS_0(0)
+   ldr w0, [x1]/* Region-0 Access Register */
+   mov w0, #0x /* Set nsaid_wr_en and nsaid_rd_en */
+   str w0, [x1]
+#endif
+#ifdef CONFIG_FSL_TZASC_2
+   ldr x1, =TZASC_GATE_KEEPER(1)
+   ldr w0, [x1]/* Filter 0 Gate Keeper Register */
+   orr w0, w0, #1 << 0 /* Set open_request for Filter 0 */
+   str w0, [x1]
+
ldr x1, =TZASC_REGION_ATTRIBUTES_0(1)
ldr w0, [x1]/* Region-1 Attributes Register */
orr w0, w0, #1 << 31/* Set Sec global write en, Bit[31] */
orr w0, w0, #1 << 30/* Set Sec global read en, Bit[30] */
str w0, [x1]
 
-   ldr x1, =TZASC_REGION_ID_ACCESS_0(0)
-   ldr w0, [x1]/* Region-0 Access Register */
-   mov w0, #0x /* Set nsaid_wr_en and nsaid_rd_en */
-   str w0, [x1]
-
ldr x1, =TZASC_REGION_ID_ACCESS_0(1)
ldr w0, [x1]/* Region-1 Attributes Register */
mov w0, #0x /* Set nsaid_wr_en and nsaid_rd_en */
str w0, [x1]
-
+#endif
isb
dsb sy
 #endif
-- 
1.9.1

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


[U-Boot] [PATCH v2] armv8:fsl-layerscape: Add registers space defination for CCI-400 bus

2017-02-23 Thread Ashish Kumar
 CoreLink Cache Coherent Interconnect (CCI) is ARM BUS which
 provides full cache coherency between two clusters of multi-core
 CPUs and I/O coherency for devices and I/O masters.

 This patch add new CONFIG defination and move existing register
 space definaton of CCI-400 bus from from immap_lsch2 to fsl_immap,
 so that it can be used for both chasis 2 and chasis 3.

Signed-off-by: Prabhakar Kushwaha 
Signed-off-by: Ashish Kumar 
---
v2:
 Add new Kconfig in alphabetic order

 README |  9 
 arch/arm/cpu/armv8/fsl-layerscape/Kconfig  |  6 +++
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|  1 +
 arch/arm/cpu/armv8/fsl-layerscape/soc.c|  1 +
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  | 48 
 .../include/asm/arch-fsl-layerscape/immap_lsch3.h  |  1 +
 include/fsl_immap.h| 51 ++
 7 files changed, 69 insertions(+), 48 deletions(-)

diff --git a/README b/README
index 4f0dbd4..34f5bd3 100644
--- a/README
+++ b/README
@@ -315,6 +315,15 @@ Many of the options are named exactly as the corresponding 
Linux
 kernel configuration options. The intention is to make it easier to
 build a config tool - later.
 
+- ARM Platform Bus Type(CCI):
+   CoreLink Cache Coherent Interconnect (CCI) is ARM BUS which
+   provides full cache coherency between two clusters of multi-core
+   CPUs and I/O coherency for devices and I/O masters
+
+   CONFIG_SYS_FSL_HAS_CCI400
+
+   Defined For SoC that has cache coherent interconnect
+   CCN-400
 
 The following options need to be configured:
 
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig 
b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
index adccdf1..64fae17 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
+++ b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
@@ -7,6 +7,7 @@ config ARCH_LS1012A
select SYS_FSL_ERRATUM_A010315
select ARCH_EARLY_INIT_R
select BOARD_EARLY_INIT_F
+   select SYS_FSL_HAS_CCI400
 
 config ARCH_LS1043A
bool
@@ -26,6 +27,7 @@ config ARCH_LS1043A
select SYS_FSL_HAS_DDR4
select ARCH_EARLY_INIT_R
select BOARD_EARLY_INIT_F
+   select SYS_FSL_HAS_CCI400
 
 config ARCH_LS1046A
bool
@@ -45,6 +47,7 @@ config ARCH_LS1046A
select SYS_FSL_SRDS_2
select ARCH_EARLY_INIT_R
select BOARD_EARLY_INIT_F
+   select SYS_FSL_HAS_CCI400
 
 config ARCH_LS2080A
bool
@@ -182,6 +185,9 @@ config SYS_FSL_IFC_BANK_COUNT
default 4 if ARCH_LS1046A
default 8 if ARCH_LS2080A
 
+config SYS_FSL_HAS_CCI400
+   bool
+
 config SYS_FSL_HAS_DP_DDR
bool
 
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index 335f225..a1ac4a0 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -29,6 +29,7 @@
 #ifdef CONFIG_SYS_FSL_DDR
 #include 
 #endif
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c 
b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
index 9489f85..d64fe7b 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h 
b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
index 8ad199f..5210b8c 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
@@ -543,54 +543,6 @@ struct ccsr_serdes {
u8  res_19a0[0x2000-0x19a0];/* from 0x19a0 to 0x1fff */
 };
 
-#define CCI400_CTRLORD_TERM_BARRIER0x0008
-#define CCI400_CTRLORD_EN_BARRIER  0
-#define CCI400_SHAORD_NON_SHAREABLE0x0002
-#define CCI400_DVM_MESSAGE_REQ_EN  0x0002
-#define CCI400_SNOOP_REQ_EN0x0001
-
-/* CCI-400 registers */
-struct ccsr_cci400 {
-   u32 ctrl_ord;   /* Control Override */
-   u32 spec_ctrl;  /* Speculation Control */
-   u32 secure_access;  /* Secure Access */
-   u32 status; /* Status */
-   u32 impr_err;   /* Imprecise Error */
-   u8 res_14[0x100 - 0x14];
-   u32 pmcr;   /* Performance Monitor Control */
-   u8 res_104[0xfd0 - 0x104];
-   u32 pid[8]; /* Peripheral ID */
-   u32 cid[4]; /* Component ID */
-   struct {
-   u32 snoop_ctrl; /* Snoop Control */
-   u32 sha_ord;/* Shareable Override */
-   u8 res_1008[0x1100 - 0x1008];
-   u32 rc_qos_ord; /* read channel QoS Value Override */
-   u32 wc_qos_ord;

[U-Boot] [PATCH v2] armv8: fsl-lsch3: Conditionally Remove errata a0009203 from lsch3 init

2017-02-23 Thread Ashish Kumar
 This i2c errata is only valid for LS2080A and its variants,
 namely LS2080A, LS2085A and LS2088A

Signed-off-by: Ashish Kumar 
---
v2:
 Change Descristion to make it more specific about impacted SoC

 arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 4 
 arch/arm/cpu/armv8/fsl-layerscape/soc.c   | 4 
 2 files changed, 8 insertions(+)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig 
b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
index 64fae17..29bc756 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
+++ b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
@@ -72,6 +72,7 @@ config ARCH_LS2080A
select SYS_FSL_ERRATUM_A009803
select SYS_FSL_ERRATUM_A009942
select SYS_FSL_ERRATUM_A010165
+   select SYS_FSL_ERRATUM_A009203
select ARCH_EARLY_INIT_R
select BOARD_EARLY_INIT_F
 
@@ -279,6 +280,9 @@ config SYS_FSL_SDHC_CLK_DIV
  clock, in another word SDHC_clk = Platform_clk / this_divider.
 endmenu
 
+config SYS_FSL_ERRATUM_A009203
+   bool
+
 config SYS_FSL_ERRATUM_A008336
bool
 
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c 
b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
index d64fe7b..1e95540 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
@@ -153,6 +153,7 @@ static void erratum_rcw_src(void)
  * This erratum requires setting glitch_en bit to enable
  * digital glitch filter to improve clock stability.
  */
+#ifdef CONFIG_SYS_FSL_ERRATUM_A009203
 static void erratum_a009203(void)
 {
u8 __iomem *ptr;
@@ -179,6 +180,7 @@ static void erratum_a009203(void)
 #endif
 #endif
 }
+#endif
 
 void bypass_smmu(void)
 {
@@ -192,7 +194,9 @@ void fsl_lsch3_early_init_f(void)
 {
erratum_rcw_src();
init_early_memctl_regs();   /* tighten IFC timing */
+#ifdef CONFIG_SYS_FSL_ERRATUM_A009203
erratum_a009203();
+#endif
erratum_a008514();
erratum_a008336();
 #ifdef CONFIG_CHAIN_OF_TRUST
-- 
1.9.1

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


Re: [U-Boot] mlo and u-boot

2017-02-23 Thread Lukasz Majewski
On Wed, 22 Feb 2017 23:53:32 +0530
Ryan  wrote:

> Hello,
> 
> I am using AM43XX based board. The bootloader is divided into spl
> u-boot (MLO) and u-boot.bin
> 
> I wanted to check what variables are shared between them. How does MLO
> a seperate binary
> share the boot mode and mmcdev to u-boot so that it can use the
> appropriate mmcdev to find the
> kernel.

In u-boot, there is the concept of "environment variables", which are
stored in a separate non-persistent memory (like eMMC, NAND,) or file
system.

For example BBB uses eMMC to store envs.

It is possible to read envs in MLO and u-boot.

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


Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v3] armv8: spl: Call spl_relocate_stack_gd for ARMv8

2017-02-23 Thread Dr. Philipp Tomsich
Simon,

> On 23 Feb 2017, at 03:23, Simon Glass  wrote:
> 
> On 22 February 2017 at 11:01, Philipp Tomsich
>  > wrote:
>> As part of the startup process for boards using the SPL, we need to
>> call spl_relocate_stack_gd. This is needed to set up malloc with its
>> DRAM buffer.
>> 
>> Signed-off-by: Philipp Tomsich 
>> Reviewed-by: Andre Przywara 
>> Reviewed-by: Simon Glass 
>> ---
>> arch/arm/lib/crt0_64.S | 13 +++--
>> 1 file changed, 11 insertions(+), 2 deletions(-)
>> 
>> diff --git a/arch/arm/lib/crt0_64.S b/arch/arm/lib/crt0_64.S
>> index 19c6a98..a7cead5 100644
>> --- a/arch/arm/lib/crt0_64.S
>> +++ b/arch/arm/lib/crt0_64.S
>> @@ -109,8 +109,17 @@ relocation_return:
>>  */
>>bl  c_runtime_cpu_setup /* still call old routine */
>> #endif /* !CONFIG_SPL_BUILD */
>> -
>> -/* TODO: For SPL, call spl_relocate_stack_gd() to alloc stack relocation */
>> +#if defined(CONFIG_SPL_BUILD)
>> +   bl  spl_relocate_stack_gd   /* may return NULL */
>> +   /* Perform 'sp = (x0 != NULL) ? x0 : sp' while working
>> +* around the constraint that conditional moves can not
>> +* have 'sp' as an operand
>> +*/
> 
> nit: Comment style again

I thought is was the missing asterisks at the beginning of the line…
What am I missing? Is it the indentation of the comment block?

>> +   mov x1, sp
>> +   cmp x0, #0
>> +   cselx0, x0, x1, ne
>> +   mov sp, x0
>> +#endif
>> 
>> /*
>>  * Clear BSS section
>> --
>> 1.9.1

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


Re: [U-Boot] [PATCH 2/2] arm64: booti: allow to place kernel image anywhere in physical memory

2017-02-23 Thread Masahiro Yamada
Hi Tom,


2017-02-23 1:19 GMT+09:00 Tom Rini :
> On Wed, Feb 22, 2017 at 11:34:26AM +0900, Masahiro Yamada wrote:
>
>> At first, the ARM64 Linux booting requirement recommended that the
>> kernel image be placed text_offset bytes from 2MB aligned base near
>> the start of usable system RAM because memory below that base address
>> was unusable at that time.
>>
>> This requirement was relaxed by Linux commit a7f8de168ace ("arm64:
>> allow kernel Image to be loaded anywhere in physical memory").
>> Since then, the bit 3 of the flags field indicates the tolerance
>> of the kernel physical placement.  If this bit is set, the 2MB
>> aligned base may be anywhere in physical memory.  For details, see
>> Documentation/arm64/booting.txt of Linux.
>>
>> The booti command should be also relaxed to not expect the kernel
>> image at the start of the system RAM.  Even when booting older
>> kernel versions, it still makes sense to have some space below the
>> kernel.  For example, some firmware may sit at the start of the
>> system RAM.
>>
>> After all, the most flexible way for booting the kernel is to respect
>> the original images->ep instead of gd->bd->bi_dram[0].start.  If
>> image->ep (which is the address given to the booti command) already
>> meets the address requirement, just use it.  If not, relocate the
>> kernel to the next 2MB aligned address.
>>
>> Signed-off-by: Masahiro Yamada 
>> ---
>>
>>  cmd/booti.c | 6 +-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/cmd/booti.c b/cmd/booti.c
>> index f65f0e7..9408c34 100644
>> --- a/cmd/booti.c
>> +++ b/cmd/booti.c
>> @@ -11,6 +11,8 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>> +#include 
>>
>>  DECLARE_GLOBAL_DATA_PTR;
>>
>> @@ -54,7 +56,9 @@ static int booti_setup(bootm_headers_t *images)
>>* If we are not at the correct run-time location, set the new
>>* correct location and then move the image there.
>>*/
>> - dst = gd->bd->bi_dram[0].start + le64_to_cpu(ih->text_offset);
>> + dst = images->ep - ih->text_offset;
>> + dst = ALIGN(dst, SZ_2M);
>> + dst += ih->text_offset;
>
> I think the code will be slightly more complex here but I would rather
> see us check for the presence of the flag which allows for us to
> relocate things rather than assume that we can always use the address
> provided, or round it up.  The 'contract' wwith the kernel previously
> said it must be from start of memory and I'd rather not change that.


At first, I tried this approach.

The problem (at least for me) is
commit a7f8de168ace is quite new; this is only included in Linux 4.5 and later.
Linux 4.4 LTS will be used on Socionext's products for a while.
However, I need to avoid the relocation of the kernel image.

The gd->bd->bi_dram[0].start points to the start of the DRAM.
Here, some firmware is sitting at the start of the DRAM.
To hide the head of the memory from Linux,
the memory node in the device tree is carved out.

If CONFIG_ARCH_FIXUP_FDT_MEMORY is not set,
U-Boot passes the memory node as-is to Linux.
As a result, the Image is placed out of the available memory region
specified by DT,
then Linux fails to boot.


Somehow I want to achieve,
"Even when booting older kernel versions, it still makes sense to have
some space below the
kernel.  For example, some firmware may sit at the start of the system RAM."


Perhaps, can we introduce a CONFIG
to enable/disable the relocation?
Or, any other good idea?



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


[U-Boot] [PATCH v3 0/7] add support for rk3328 SoC

2017-02-23 Thread Kever Yang

This patchset is to support rk3328 Soc, including some basic
driver like clock, pinctrl, sysreset and etc. This version
enables eMMC and sd-card boot, USB and MAC driver is not ready.

RK3328 is a quad-core cortex-A53 SoC, it needs ATF support,
so I would like to send the U-Boot driver without SPL in this
version, for the ATF patches is still under discussion, we'd
better have a version which able to work.


Changes in v3:
- Moved new binding #defines into this patch to avoid build error
- Removed contents of rk3328/Kconfig to avoid build error
- remove I2C reg value MACRO definition
- Moved changes to arch/arm/mach-rockchip/rk3328/Kconfig into this patch

Changes in v2:
- split rockchip_get_cru into arch/arm/mach-rockchip
- fix include header file order
- drop MACRO for I2C reg access
- use OSC_HZ for 24*1024*1024
- fix include header file order
- add space around operators in header file
- fix include header file order
- README file fix

Kever Yang (7):
  rockchip: rk3328: add device tree file
  rockchip: rk3328: add soc basic support
  rockchip: rk3328: add clock driver
  rockchip: rk3328:  add pinctrl driver
  rockchip: rk3328: add sysreset driver
  rockchip: rk3328: add evb-rk3328 support
  rockchip: rk3288: add defconfig for evb-rk3328

 arch/arm/dts/Makefile   |1 +
 arch/arm/dts/rk3328-evb.dts |   45 +
 arch/arm/dts/rk3328.dtsi| 1477 +++
 arch/arm/include/asm/arch-rockchip/cru_rk3328.h |   70 ++
 arch/arm/include/asm/arch-rockchip/grf_rk3328.h |  134 ++
 arch/arm/mach-rockchip/Kconfig  |   11 +
 arch/arm/mach-rockchip/Makefile |1 +
 arch/arm/mach-rockchip/rk3328/Kconfig   |   23 +
 arch/arm/mach-rockchip/rk3328/Makefile  |9 +
 arch/arm/mach-rockchip/rk3328/clk_rk3328.c  |   31 +
 arch/arm/mach-rockchip/rk3328/rk3328.c  |   39 +
 arch/arm/mach-rockchip/rk3328/syscon_rk3328.c   |   20 +
 board/rockchip/evb_rk3328/Kconfig   |   15 +
 board/rockchip/evb_rk3328/MAINTAINERS   |6 +
 board/rockchip/evb_rk3328/Makefile  |7 +
 board/rockchip/evb_rk3328/README|   70 ++
 board/rockchip/evb_rk3328/evb-rk3328.c  |   40 +
 configs/evb-rk3328_defconfig|   36 +
 drivers/clk/rockchip/Makefile   |1 +
 drivers/clk/rockchip/clk_rk3328.c   |  581 +
 drivers/pinctrl/Kconfig |9 +
 drivers/pinctrl/rockchip/Makefile   |1 +
 drivers/pinctrl/rockchip/pinctrl_rk3328.c   |  419 +++
 drivers/sysreset/Makefile   |1 +
 drivers/sysreset/sysreset_rk3328.c  |   45 +
 include/configs/evb_rk3328.h|   26 +
 include/configs/rk3328_common.h |   65 +
 include/dt-bindings/clock/rk3328-cru.h  |  394 ++
 include/dt-bindings/pinctrl/rockchip.h  |2 +
 29 files changed, 3579 insertions(+)
 create mode 100644 arch/arm/dts/rk3328-evb.dts
 create mode 100644 arch/arm/dts/rk3328.dtsi
 create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3328.h
 create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3328.h
 create mode 100644 arch/arm/mach-rockchip/rk3328/Kconfig
 create mode 100644 arch/arm/mach-rockchip/rk3328/Makefile
 create mode 100644 arch/arm/mach-rockchip/rk3328/clk_rk3328.c
 create mode 100644 arch/arm/mach-rockchip/rk3328/rk3328.c
 create mode 100644 arch/arm/mach-rockchip/rk3328/syscon_rk3328.c
 create mode 100644 board/rockchip/evb_rk3328/Kconfig
 create mode 100644 board/rockchip/evb_rk3328/MAINTAINERS
 create mode 100644 board/rockchip/evb_rk3328/Makefile
 create mode 100644 board/rockchip/evb_rk3328/README
 create mode 100644 board/rockchip/evb_rk3328/evb-rk3328.c
 create mode 100644 configs/evb-rk3328_defconfig
 create mode 100644 drivers/clk/rockchip/clk_rk3328.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3328.c
 create mode 100644 drivers/sysreset/sysreset_rk3328.c
 create mode 100644 include/configs/evb_rk3328.h
 create mode 100644 include/configs/rk3328_common.h
 create mode 100644 include/dt-bindings/clock/rk3328-cru.h

-- 
1.9.1

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


Re: [U-Boot] [PATCH v2 0/7] add support for rk3328 SoC

2017-02-23 Thread Simon Glass
Hi Kever,

On 22 February 2017 at 03:13, Kever Yang  wrote:
>
> This patchset is to support rk3328 Soc, including some basic
> driver like clock, pinctrl, sysreset and etc. This version
> enables eMMC and sd-card boot, USB and MAC driver is not ready.
>
> RK3328 is a quad-core cortex-A53 SoC, it needs ATF support,
> so I would like to send the U-Boot driver without SPL in this
> version, for the ATF patches is still under discussion, we'd
> better have a version which able to work.
>
>
> Changes in v2:
> - split rockchip_get_cru into arch/arm/mach-rockchip
> - fix include header file order
> - drop MACRO for I2C reg access
> - use OSC_HZ for 24*1024*1024
> - fix include header file order
> - add space around operators in header file
> - fix include header file order
> - README file fix
>
> Kever Yang (7):
>   rockchip: rk3328: add device tree file
>   rockchip: rk3328: add soc basic support
>   rockchip: rk3288: add clock driver
>   rockchip: rk3328:  add pinctrl driver
>   rockchip: rk3328: add sysreset driver
>   rockchip: rk3328: add evb-rk3328 support
>   rockchip: rk3288: add defconfig for evb-rk3328
>
>  arch/arm/dts/Makefile   |1 +
>  arch/arm/dts/rk3328-evb.dts |   45 +
>  arch/arm/dts/rk3328.dtsi| 1477 
> +++
>  arch/arm/include/asm/arch-rockchip/cru_rk3328.h |   70 ++
>  arch/arm/include/asm/arch-rockchip/grf_rk3328.h |  134 ++
>  arch/arm/mach-rockchip/Kconfig  |   11 +
>  arch/arm/mach-rockchip/Makefile |1 +
>  arch/arm/mach-rockchip/rk3328/Kconfig   |   23 +
>  arch/arm/mach-rockchip/rk3328/Makefile  |9 +
>  arch/arm/mach-rockchip/rk3328/clk_rk3328.c  |   31 +
>  arch/arm/mach-rockchip/rk3328/rk3328.c  |   39 +
>  arch/arm/mach-rockchip/rk3328/syscon_rk3328.c   |   20 +
>  board/rockchip/evb_rk3328/Kconfig   |   15 +
>  board/rockchip/evb_rk3328/MAINTAINERS   |6 +
>  board/rockchip/evb_rk3328/Makefile  |7 +
>  board/rockchip/evb_rk3328/README|   70 ++
>  board/rockchip/evb_rk3328/evb-rk3328.c  |   40 +
>  configs/evb-rk3328_defconfig|   36 +
>  drivers/clk/rockchip/Makefile   |1 +
>  drivers/clk/rockchip/clk_rk3328.c   |  597 +
>  drivers/pinctrl/Kconfig |9 +
>  drivers/pinctrl/rockchip/Makefile   |1 +
>  drivers/pinctrl/rockchip/pinctrl_rk3328.c   |  419 +++
>  drivers/sysreset/Makefile   |1 +
>  drivers/sysreset/sysreset_rk3328.c  |   45 +
>  include/configs/evb_rk3328.h|   26 +
>  include/configs/rk3328_common.h |   65 +
>  include/dt-bindings/clock/rk3328-cru.h  |  394 ++
>  include/dt-bindings/pinctrl/rockchip.h  |2 +
>  29 files changed, 3595 insertions(+)
>  create mode 100644 arch/arm/dts/rk3328-evb.dts
>  create mode 100644 arch/arm/dts/rk3328.dtsi
>  create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3328.h
>  create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3328.h
>  create mode 100644 arch/arm/mach-rockchip/rk3328/Kconfig
>  create mode 100644 arch/arm/mach-rockchip/rk3328/Makefile
>  create mode 100644 arch/arm/mach-rockchip/rk3328/clk_rk3328.c
>  create mode 100644 arch/arm/mach-rockchip/rk3328/rk3328.c
>  create mode 100644 arch/arm/mach-rockchip/rk3328/syscon_rk3328.c
>  create mode 100644 board/rockchip/evb_rk3328/Kconfig
>  create mode 100644 board/rockchip/evb_rk3328/MAINTAINERS
>  create mode 100644 board/rockchip/evb_rk3328/Makefile
>  create mode 100644 board/rockchip/evb_rk3328/README
>  create mode 100644 board/rockchip/evb_rk3328/evb-rk3328.c
>  create mode 100644 configs/evb-rk3328_defconfig
>  create mode 100644 drivers/clk/rockchip/clk_rk3328.c
>  create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3328.c
>  create mode 100644 drivers/sysreset/sysreset_rk3328.c
>  create mode 100644 include/configs/evb_rk3328.h
>  create mode 100644 include/configs/rk3328_common.h
>  create mode 100644 include/dt-bindings/clock/rk3328-cru.h
>
> --
> 1.9.1
>

I had various bisect problems with this series. I have pushed it to
u-boot-rockchip/testing. Can you please check it? Also please can you
take another look at the clock driver per my comment?

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


Re: [U-Boot] [PATCH] board: ns2: Add support for Broadcom Northstar 2

2017-02-23 Thread Jon Mason
On Wed, Feb 22, 2017 at 11:10 AM, Tom Rini  wrote:
> On Fri, Feb 17, 2017 at 04:17:10PM -0500, Jon Mason wrote:
>
>> Add support for the Broadcom Northstar2 SoC and SVK (bcm958712k).  The
>> BCM5871X is a series of quad-core 64-bit 2GHz ARMv8 Cortex-A57
>> processors targeting a broad range of networking applications.
>>
>> Signed-off-by: Jon Mason 
>> ---
>>  arch/arm/Kconfig  |  9 ++
>>  board/broadcom/bcm958712k/MAINTAINERS |  6 
>>  board/broadcom/bcmns2/Kconfig | 15 +
>>  board/broadcom/bcmns2/Makefile|  7 +
>>  board/broadcom/bcmns2/northstar2.c| 57 
>> +++
>>  configs/bcm958712k_defconfig  |  9 ++
>>  include/configs/bcm_northstar2.h  | 55 +
>>  7 files changed, 158 insertions(+)
>>  create mode 100644 board/broadcom/bcm958712k/MAINTAINERS
>>  create mode 100644 board/broadcom/bcmns2/Kconfig
>>  create mode 100644 board/broadcom/bcmns2/Makefile
>>  create mode 100644 board/broadcom/bcmns2/northstar2.c
>>  create mode 100644 configs/bcm958712k_defconfig
>>  create mode 100644 include/configs/bcm_northstar2.h
>
> I assume you have some follow up patches to add some code under
> arch/arm/mach- ?  Or is there just a whole bunch of stuff that's
> done in ATF or similar instead?  Also:

Most/all of the ugliness is being hidden by ATF.  So, I believe there
is no need for arch/arm/mach-iproc for NS2.

I will have more patches coming to add drivers for boot devices.
However, I was going to add those serially.  The side benefit

>> +int dram_init(void)
>> +{
>> + gd->ram_size = PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE;
>> + return 0;
>> +}
>
> You should be using get_ram_size() here.

Will do

> [snip]
>> +CONFIG_BOOTDELAY=30
>
> Having 30 seconds here is huge.  I know in your talk you were mentioning
> how to interrupt boot but I'd really rather not see this exceed 10 and 5
> is usually sufficient.

5 secs is fine

Also, Alexander Graf mentioned needing to add DISTRO_DEFAULTS (IIRC).

I'll make those changes and push a v2.  Thanks for the reviews!

Thanks,
Jon



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


[U-Boot] mlo and u-boot

2017-02-23 Thread Ryan
Hello,

I am using AM43XX based board. The bootloader is divided into spl
u-boot (MLO) and u-boot.bin

I wanted to check what variables are shared between them. How does MLO
a seperate binary
share the boot mode and mmcdev to u-boot so that it can use the
appropriate mmcdev to find the
kernel.

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


Re: [U-Boot] [Patch v6 8/9] armv8: ls1046ardb: Add LS1046ARDB board support

2017-02-23 Thread chris warth
I don't know the protocol for revisiting broken patches that have
already been integrated, but the patched offered by NXP for their
ls1046a RDB is wrong.

original patch:
http://lists.denx.de/pipermail/u-boot/2016-September/265974.html

The main error is this patch defines CONFIG_SPI_FLASH_BAR which
enables use of a bank address register to access flash addresses
beyond 16M.

+/* QSPI device */
+#ifdef CONFIG_FSL_QSPI
+#define CONFIG_SPI_FLASH_SPANSION
+#define FSL_QSPI_FLASH_SIZE (1 << 26)
+#define FSL_QSPI_FLASH_NUM 2
+#define CONFIG_SPI_FLASH_BAR
+#endif

However the Cypress S25FS512S part used on the LS1046A RDB does not
implement any bank address related commands.
See section 1.2.2.9 of http://www.cypress.com/file/216376/download

This configuration error means that any attempt to access beyond the
first 16MB of flash will silently wrap around to the beginning of the
flash.
This is in addition to the bugs in flash erase on this platform
previously noted -
http://lists.denx.de/pipermail/u-boot/2016-December/276032.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   >