Re: [U-Boot] [PATCH v2] Add support for eMMC environment in boot partition

2016-10-09 Thread Jaehoon Chung
Hi Sergey,

On 10/09/2016 01:49 PM, Sergey Kubushyn wrote:
> This allows to place U-Boot environment into eMMC boot partition thus
> saving space on user partition for the OS (or whatever.) When booting
> off of eMMC many (all?) MCUs can use dedicated boot0/boot1 partitions
> to boot so U-Boot (or SPL) is written to one (or both) such partitions.
> When such boot configuration is used it makes sense to place environment
> in the same partition where the U-Boot itself is so the entire user
> partition is available for the OS.

I didn't read the entire comments of previous version. (Will read)
And this patch should be dead code..there is no case with using patch.
Do you have a plan to add other patch?

i don't know what makes sense for this..

And this concept should be dangerous...If overwrite to wrong location. it can 
be bricked.

Well, i need to consider it's really useful to locate the environment into boot 
partition.
So I didn't add the comment about code side.

Best Regards,
Jaehoon Chung

> 
> It might be not well polished yet but it is a simple patch that can be
> reworked later.
> 
> It uses 4 Kconfig variables right now which probably belong to the board
> Kconfig. Those are:
> 
> CONFIG_ENV_IN_EMMC_BOOT -- tells that environment is in eMMC boot
>  partition if defined
> 
> CONFIG_EMMC_ENV_PART -- tells which boot partition environment should be
>  stored in (either 1 or 2)
> 
> CONFIG_EMMC_BOOT_PART -- which boot partition will be used by eMMC to
>  read U-Boot/SPL binary for boot protocol (either 1 or 2.) That can be
>  different from the environment partition
> 
> CONFIG_EMMC_BOOT_ACK -- tells that eMMC should provide boot ACKs if
>  defined
> 
> Here is an excerpt from actual board Kconfig:
> 
> === Cut ===
> config ENV_IN_EMMC_BOOT
> bool "Environment is in eMMC boot partition"
> default y
> 
> config EMMC_ENV_PART
> hex "eMMC boot partition used for environment (1 or 2)"
> default 1
> 
> config EMMC_BOOT_PART
> hex "eMMC boot partition the board boots off of (1 or 2)"
> default 1
> 
> config EMMC_BOOT_ACK
> bool "Enable ACKs from eMMC when booting off of boot partition"
> default n
> === Cut ===
> 
> Signed-off-by: Sergey Kubushyn 
> Cc: Tom Rini 
> Cc: Pantelis Antoniou 
> ---
>  common/env_mmc.c | 50 ++
>  1 file changed, 50 insertions(+)
> 
> diff --git a/common/env_mmc.c b/common/env_mmc.c
> index 16f6a17..3b2477c 100644
> --- a/common/env_mmc.c
> +++ b/common/env_mmc.c
> @@ -68,6 +68,45 @@ int env_init(void)
>   return 0;
>  }
>  
> +#ifdef CONFIG_ENV_IN_EMMC_BOOT
> +__weak u8 mmc_get_env_part(struct mmc *mmc)
> +{
> + return CONFIG_EMMC_ENV_PART;
> +}
> +
> +__weak u8 mmc_get_boot_part(struct mmc *mmc)
> +{
> + return CONFIG_EMMC_BOOT_PART;
> +}
> +
> +__weak u8 mmc_get_boot_ack(struct mmc *mmc)
> +{
> +#ifdef CONFIG_EMMC_BOOT_ACK
> + return 1;
> +#else
> + return 0;
> +#endif
> +}
> +
> +static int mmc_set_env_part(struct mmc *mmc)
> +{
> + int ret = 0;
> + u8 boot_part = 0;
> + u8 boot_ack = 0;
> + u8 env_part = 0;
> +
> + boot_part = mmc_get_boot_part(mmc);
> + boot_ack = mmc_get_boot_ack(mmc);
> + env_part = mmc_get_env_part(mmc);
> +
> + ret = mmc_set_part_conf(mmc, boot_ack, boot_part, env_part);
> +
> + if (ret)
> + puts("MMC switch to boot partition failed\n");
> +
> + return ret;
> +}
> +#else
>  #ifdef CONFIG_SYS_MMC_ENV_PART
>  __weak uint mmc_get_env_part(struct mmc *mmc)
>  {
> @@ -96,6 +135,7 @@ static int mmc_set_env_part(struct mmc *mmc)
>  #else
>  static inline int mmc_set_env_part(struct mmc *mmc) {return 0; };
>  #endif
> +#endif
>  
>  static const char *init_mmc_for_env(struct mmc *mmc)
>  {
> @@ -113,6 +153,15 @@ static const char *init_mmc_for_env(struct mmc *mmc)
>  
>  static void fini_mmc_for_env(struct mmc *mmc)
>  {
> +#ifdef CONFIG_ENV_IN_EMMC_BOOT
> + u8 boot_part = 0;
> + u8 boot_ack = 0;
> +
> + boot_part = mmc_get_boot_part(mmc);
> + boot_ack = mmc_get_boot_ack(mmc);
> +
> + mmc_set_part_conf(mmc, boot_ack, boot_part, 0);
> +#else
>  #ifdef CONFIG_SYS_MMC_ENV_PART
>   int dev = mmc_get_env_dev();
>  
> @@ -121,6 +170,7 @@ static void fini_mmc_for_env(struct mmc *mmc)
>  #endif
>   blk_select_hwpart_devnum(IF_TYPE_MMC, dev, env_mmc_orig_hwpart);
>  #endif
> +#endif
>  }
>  
>  #ifdef CONFIG_CMD_SAVEENV
> 

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


Re: [U-Boot] [PATCH] mmc: introduce mmc_power_init

2016-10-09 Thread Jaehoon Chung
Hi Peng,

On 10/08/2016 07:07 PM, Peng Fan wrote:
> In device tree, there is vmmc-supply property for SD/MMC.
> Introduce mmc_power_init function to handle vmmc-supply.

As i know, vqmmc-supply should be optional. Do you have a plan to add this?

> 
> mmc_power_init will first invoke board_mmc_power_init to
> avoid break boards which already implement board_mmc_power_init.
> 
> If DM_MMC and DM_REGULATOR is defined, the regulator
> will be enabled to power up the device.
> 
> Signed-off-by: Peng Fan 
> Cc: Jaehoon Chung 
> ---
> 
> The RFC patset thread: 
> http://lists.denx.de/pipermail/u-boot/2016-April/251019.html
> V1: Use a generic way to handle vmmc supply, but not let vendor driver
> to handle it.
> 
>  drivers/mmc/mmc.c | 30 +-
>  1 file changed, 29 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 0312da9..c361098 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -15,6 +15,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -1582,6 +1583,31 @@ __weak void board_mmc_power_init(void)
>  {
>  }
>  
> +int mmc_power_init(struct mmc *mmc)

Can be static?

> +{
> + board_mmc_power_init();
> +
> +#if defined(CONFIG_DM_MMC) && defined(CONFIG_DM_REGULATOR) && \
> + !defined(CONFIG_SPL_BUILD)
> + struct udevice *vmmc_supply;
> + int ret;
> +
> + ret = device_get_supply_regulator(mmc->dev, "vmmc-supply",
> +   _supply);
> + if (ret) {
> + debug("No vmmc supply\n");
> + return 0;

"return 0" is Right? Doesn't need to return error?

> + }
> +
> + ret = regulator_set_enable(vmmc_supply, true);
> + if (ret) {
> + puts("Error enabling VMMC supply\n");
> + return ret;
> + }
> +#endif
> + return 0;
> +}
> +
>  int mmc_start_init(struct mmc *mmc)
>  {
>   bool no_card;
> @@ -1606,7 +1632,9 @@ int mmc_start_init(struct mmc *mmc)
>  #ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT
>   mmc_adapter_card_type_ident();
>  #endif
> - board_mmc_power_init();
> + err = mmc_power_init(mmc);
> + if (err)
> + return err;
>  
>  #ifdef CONFIG_DM_MMC_OPS
>   /* The device has already been probed ready for use */
> 

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


Re: [U-Boot] [PATCH v2 02/12] x86: Add an accelerated memmove() function

2016-10-09 Thread Bin Meng
On Sat, Oct 8, 2016 at 1:53 PM, Bin Meng  wrote:
> Hi Simon,
>
> On Sat, Oct 8, 2016 at 10:25 AM, Bin Meng  wrote:
>> Hi Simon,
>>
>> On Thu, Oct 6, 2016 at 10:42 AM, Simon Glass  wrote:
>>> Bring in a faster memmove() from Linux 4.7. This speeds up scrolling on the
>>> display.
>>>
>>> Signed-off-by: Simon Glass 
>>> ---
>>>
>>> Changes in v2:
>>> - Move the code into string.c
>>> - Fix multi-line comments that should not be
>>>
>>>  arch/x86/include/asm/string.h |   2 +-
>>>  arch/x86/lib/string.c | 161 
>>> ++
>>>  2 files changed, 162 insertions(+), 1 deletion(-)
>>>
>>
>> Reviewed-by: Bin Meng 
>>
>> Tested on Crown Bay with an external PCIe graphics card
>> Tested-by: Bin Meng 
>>
>> However, I did not see significant speed up on screen scrolling...
>>
>
> Crown Bay is still using cfb_console.c, which is the legacy driver
> that does not use memmove(). Looks the new console_xxx driver is using
> memmove(). I guess I will need convert Crown Bay to use DM video.
>

Testing shows that on Crown Bay, the DM driver with the optimized
memmove() does not improve the performance compared to legacy
cfb_console driver. But on Bayleybay, memmove() indeed helps the
screen scrolling.

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


[U-Boot] pull request: u-boot-uniphier/master

2016-10-09 Thread Masahiro Yamada
Hi Tom.

Please pull some more UniPhier updates:

 - Various SoC specpfic updates (DRAM, PLL, errata)
 - Minor cleanups
 - Add UniPhier reset controller driver

Note:
I am touching include/reset-uclass.h by
"reset: declare fdtdec_phandle_args as struct to fix warning".
I included it in this pull-request because
I need it to suppress warnings for my new reset driver.
I believe it is OK since the patch is trivial enough.




The following changes since commit f5fd45ff64e28a73499548358e3d1ceda0de7daf:

  Merge branch 'master' of git://www.denx.de/git/u-boot-imx
(2016-10-08 09:33:37 -0400)

are available in the git repository at:


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

for you to fetch changes up to 4fb96c48c183128c00b21c7858bb05897a1b80de:

  reset: uniphier: add reset controller driver for UniPhier SoCs
(2016-10-10 10:03:23 +0900)


Masahiro Yamada (10):
  ARM: uniphier: do not setup pins for System Bus on NAND boot mode
  ARM: uniphier: enable SSC for DPLL (DRAM PLL) on LD11 SoC
  ARM: uniphier: update DRAM init code for LD20 SoC (2nd)
  ARM: uniphier: add work-around for VBO noise problem
  ARM: uniphier: fix typos in a comment block
  ARM: uniphier: enable CONFIG_SYS_NO_FLASH if no CONFIG_MICRO_SUPPORT_CARD
  ARM: uniphier: define CONFIG_SMC911X along with CONFIG_MICRO_SUPPORT_CARD
  ARM: uniphier: insert udelay() just before support_card_reset_deassert()
  reset: declare fdtdec_phandle_args as struct to fix warning
  reset: uniphier: add reset controller driver for UniPhier SoCs

 arch/arm/Kconfig   |   1 +
 arch/arm/mach-uniphier/board_init.c|   7 +
 arch/arm/mach-uniphier/clk/pll-ld11.c  |   1 +
 arch/arm/mach-uniphier/dram/ddrphy-ld20-regs.h |  37 +-
 arch/arm/mach-uniphier/dram/umc-ld20.c | 652 -
 arch/arm/mach-uniphier/init/init-ld11.c|   4 +-
 arch/arm/mach-uniphier/init/init-ld20.c|   4 +-
 arch/arm/mach-uniphier/micro-support-card.c|   3 +-
 drivers/reset/Kconfig  |   9 +
 drivers/reset/Makefile |   1 +
 drivers/reset/reset-uniphier.c | 376 ++
 include/configs/uniphier.h |  21 +-
 include/reset-uclass.h |   1 +
 13 files changed, 769 insertions(+), 348 deletions(-)
 create mode 100644 drivers/reset/reset-uniphier.c
[4]+  Doneemacs drivers/reset/Kconfig


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


Re: [U-Boot] [PATCH 0/9] ARM: uniphier: UniPhier updates for v2016.11-rc2

2016-10-09 Thread Masahiro Yamada
2016-10-08 13:25 GMT+09:00 Masahiro Yamada :
>
>  - Various SoC specpfic updates (DRAM, PLL, errata)
>  - Minor cleanups
>  - Add UniPhier reset controller driver
>
>
>
> Masahiro Yamada (9):
>   ARM: uniphier: enable SSC for DPLL (DRAM PLL) on LD11 SoC
>   ARM: uniphier: update DRAM init code for LD20 SoC (2nd)
>   ARM: uniphier: add work-around for VBO noise problem
>   ARM: uniphier: fix typos in a comment block
>   ARM: uniphier: enable CONFIG_SYS_NO_FLASH if no
> CONFIG_MICRO_SUPPORT_CARD
>   ARM: uniphier: define CONFIG_SMC911X along with
> CONFIG_MICRO_SUPPORT_CARD
>   ARM: uniphier: insert udelay() just before
> support_card_reset_deassert()
>   reset: declare fdtdec_phandle_args as struct to fix warning
>   reset: uniphier: add reset controller driver for UniPhier SoCs
>
>  arch/arm/Kconfig   |   1 +
>  arch/arm/mach-uniphier/board_init.c|   7 +
>  arch/arm/mach-uniphier/clk/pll-ld11.c  |   1 +
>  arch/arm/mach-uniphier/dram/ddrphy-ld20-regs.h |  37 +-
>  arch/arm/mach-uniphier/dram/umc-ld20.c | 652 
> -
>  arch/arm/mach-uniphier/micro-support-card.c|   3 +-
>  drivers/reset/Kconfig  |   9 +
>  drivers/reset/Makefile |   1 +
>  drivers/reset/reset-uniphier.c | 376 ++
>  include/configs/uniphier.h |  21 +-
>  include/reset-uclass.h |   1 +
>  11 files changed, 763 insertions(+), 346 deletions(-)
>  create mode 100644 drivers/reset/reset-uniphier.c


Series, applied to u-boot-uniphier/master.





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


Re: [U-Boot] [RFC PATCH] bootm: fix ramdisk relocation

2016-10-09 Thread Cédric Le Goater
Hello,

On 10/08/2016 03:44 PM, Tom Rini wrote:
> On Thu, Oct 06, 2016 at 11:08:55PM +0200, Cédric Le Goater wrote:
> 
>> We are working on bringing to mainline a set of changes adding support
>> for the Aspeed SoC and we have a couple of work around we are trying
>> to elimitate first. This is one of them. The ramdisk is not relocated
>> and Linux fails to boot. The current port does not use a device tree
>> (yet) so that might be the most obvious culprit.
>>
>> Thanks
>>
>> Signed-off-by: Cédric Le Goater 
> 
> I suspect that you want to have bootm_size set in your environment so
> that all relocations happen within that value and will remain visible to
> the kernel.

Well, I am discovering the code so I might be wrong in the way it should 
be used. 

boot_ramdisk_high() does the copy to ram and relocation but it is not 
called as we are booting using ATAGS and a legacy image. This patch 
enables the copy but even in that case the load address of the image is 
not used, which can be a problem for the linux memblocks after boot. 

So I am wondering if we should put some effort to fix this scenario. 
Or is it totally wrong and in that case, should we be using some other 
mechanism ?

Thanks,

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


Re: [U-Boot] [PATCH] mmc: rockchip_sdhci: add clock init for mmc

2016-10-09 Thread Jaehoon Chung
On 10/07/2016 06:23 PM, Kever Yang wrote:
> Init the clock rate to CONFIG_ROCKCHIP_SDHCI_MAX_FREQ with clock driver
> api.
> 
> Signed-off-by: Kever Yang 
> ---
> 
>  drivers/mmc/rockchip_sdhci.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c
> index c56e1a3..e787343 100644
> --- a/drivers/mmc/rockchip_sdhci.c
> +++ b/drivers/mmc/rockchip_sdhci.c
> @@ -12,6 +12,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  /* 400KHz is max freq for card ID etc. Use that as min */
>  #define EMMC_MIN_FREQ40
> @@ -33,7 +34,10 @@ static int arasan_sdhci_probe(struct udevice *dev)
>   struct rockchip_sdhc *prv = dev_get_priv(dev);
>   struct sdhci_host *host = >host;
>   int ret;
> + struct clk clk;
>  
> + ret = clk_get_by_index(dev, 0, );

What purpose do you use "ret" value?

Best Regards,
Jaehoon Chung

> + clk_set_rate(, CONFIG_ROCKCHIP_SDHCI_MAX_FREQ);
>   host->quirks = SDHCI_QUIRK_WAIT_SEND_CMD;
>  
>   ret = sdhci_setup_cfg(>cfg, host, CONFIG_ROCKCHIP_SDHCI_MAX_FREQ,
> 

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


Re: [U-Boot] [PATCH v4 0/2] ARM: add support for Bananapi BPI-R1

2016-10-09 Thread Stephen Arnold
Please ignore the crufty v4 cover; the following v5 is correct (a
single patch) as requested by Jagan.

Thanks, Steve

On Sun, Oct 9, 2016 at 2:04 PM, Stephen Arnold
 wrote:
> From: Steve Arnold 
>
> * changes from lamobo-r1 required include:
>   - unset ahci power pin
>   - usbvbus gpio pin change
>   - mmc cd gpio pin change
>   - enable uart2, set default LED trigger
>   - CONFIG_GMAC_TX_DELAY change
>
> Changes for v2:
>   - incorprated feedback for config options (remove 3, add 1)
> Changes for v3/v4:
>   - re-submit (no change to patch payload) with cover
>
> Steve Arnold (2):
>   ARM: sun7i: config: add config for Sinovoip/Bananapi BPI-R1
>   ARM: sun7i: dts: add support for Sinovoip/Bananapi BPI-R1
>
>  arch/arm/dts/Makefile  |   1 +
>  arch/arm/dts/sun7i-a20-bananapi-r1.dts | 376 
> +
>  configs/Bananapi_R1_defconfig  |  16 ++
>  3 files changed, 393 insertions(+)
>  create mode 100644 arch/arm/dts/sun7i-a20-bananapi-r1.dts
>  create mode 100644 configs/Bananapi_R1_defconfig
>
> Signed-off-by: Steve Arnold 
> Cc: Ian Campbell 
> Cc: Hans De Goede 
>
> --
> 2.9.3
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] spi: fsl_qspi: Preserve endianness of QSPI MCR

2016-10-09 Thread york sun
On 10/09/2016 12:53 AM, Jagan Teki wrote:
> On Sat, Oct 8, 2016 at 10:51 PM, york sun  wrote:
>> On 10/06/2016 02:38 PM, York Sun wrote:
>>> The endianness can be changed by RCW + PBI sequence. It may have
>>> other than power on reset value.
>>>
>>> Signed-off-by: York Sun 
>>> CC: Yuan Yao 
>>> CC: Peng Fan 
>>> CC: Alison Wang 
>>> ---
>>> Change log
>>>  v2: Fix variable name in spi_setup_slave
>>>
>>
>>
>> Applied to fsl-qoriq master, awaiting upstream.
>
> Some how my reviewed-by tag on previous version missed here :)

I sent out v2 after finding an error. I thought it would be wrong to 
manually add your signature. When I picked up the v2 patch from 
patchwork, it didn't carry your signature.

York

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


[U-Boot] [PATCH v5] ARM: sun71: dts: add support for Bananapi BPI-R1

2016-10-09 Thread Stephen Arnold
From: Steve Arnold 

* changes from lamobo-r1 required include:
  - unset ahci power pin
  - usbvbus gpio pin change
  - mmc cd gpio pin change
  - enable uart2, set default LED trigger
  - CONFIG_GMAC_TX_DELAY change

Changes for v2:
  - incorprated feedback for config options (remove 3, add 1)
Changes for v3/v4:
  - re-submit (no change to patch payload) with cover
Changes for v5:
  - re-submit as one patch (no change to patch payload)

Signed-off-by: Steve Arnold 
Cc: Ian Campbell 
Cc: Hans De Goede 

 arch/arm/dts/Makefile  |   1 +
 arch/arm/dts/sun7i-a20-bananapi-r1.dts | 376 +
 configs/Bananapi_R1_defconfig  |  16 ++
 3 files changed, 393 insertions(+)
 create mode 100644 arch/arm/dts/sun7i-a20-bananapi-r1.dts
 create mode 100644 configs/Bananapi_R1_defconfig

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 8458f6b..8aa8646 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -217,6 +217,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
sun7i-a20-ainol-aw1.dtb \
sun7i-a20-bananapi.dtb \
sun7i-a20-bananapi-m1-plus.dtb \
+   sun7i-a20-bananapi-r1.dtb \
sun7i-a20-bananapro.dtb \
sun7i-a20-cubieboard2.dtb \
sun7i-a20-cubietruck.dtb \
diff --git a/arch/arm/dts/sun7i-a20-bananapi-r1.dts 
b/arch/arm/dts/sun7i-a20-bananapi-r1.dts
new file mode 100644
index 000..1a550f9
--- /dev/null
+++ b/arch/arm/dts/sun7i-a20-bananapi-r1.dts
@@ -0,0 +1,376 @@
+/*
+ * Copyright 2015 Hans de Goede 
+ * Changes copyright 2016 Stephen Arnold 
+ *
+ * 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.
+ */
+
+/dts-v1/;
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include 
+#include 
+#include 
+
+/ {
+   model = "Banana Pi BPI-R1";
+   compatible = "sinovoip,bpi-r1", "allwinner,sun7i-a20";
+
+   aliases {
+   serial0 = 
+   serial1 = 
+   serial2 = 
+   serial3 = 
+   };
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+
+   leds {
+   compatible = "gpio-leds";
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_bpi_r1>;
+
+   green {
+   label = "bpi-r1:green:usr";
+   gpios = < 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
+   linux,default-trigger = "heartbeat";
+   };
+   };
+
+   reg_gmac_3v3: gmac-3v3 {
+   compatible = "regulator-fixed";
+   pinctrl-names = "default";
+   pinctrl-0 = <_power_pin_bpi_r1>;
+   regulator-name = "gmac-3v3";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   startup-delay-us = <10>;
+   enable-active-high;
+   gpio = < 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
+   };
+
+};
+
+ {

[U-Boot] [PATCH v4 0/2] ARM: add support for Bananapi BPI-R1

2016-10-09 Thread Stephen Arnold
From: Steve Arnold 

* changes from lamobo-r1 required include:
  - unset ahci power pin
  - usbvbus gpio pin change
  - mmc cd gpio pin change
  - enable uart2, set default LED trigger
  - CONFIG_GMAC_TX_DELAY change

Changes for v2:
  - incorprated feedback for config options (remove 3, add 1)
Changes for v3/v4:
  - re-submit (no change to patch payload) with cover

Steve Arnold (2):
  ARM: sun7i: config: add config for Sinovoip/Bananapi BPI-R1
  ARM: sun7i: dts: add support for Sinovoip/Bananapi BPI-R1

 arch/arm/dts/Makefile  |   1 +
 arch/arm/dts/sun7i-a20-bananapi-r1.dts | 376 +
 configs/Bananapi_R1_defconfig  |  16 ++
 3 files changed, 393 insertions(+)
 create mode 100644 arch/arm/dts/sun7i-a20-bananapi-r1.dts
 create mode 100644 configs/Bananapi_R1_defconfig

Signed-off-by: Steve Arnold 
Cc: Ian Campbell 
Cc: Hans De Goede 

-- 
2.9.3

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


[U-Boot] [PATCH v4 2/7] efi_loader: Fix memory map size check to avoid out-of-bounds access

2016-10-09 Thread Stefan Brüns
The current efi_get_memory_map() function overwrites the map_size
property before reading its value. That way the sanity check whether our
memory map fits into the given array always succeeds, potentially
overwriting arbitrary payload memory.

This patch moves the property update write after its sanity check, so
that the check actually verifies the correct value.

So far this has not triggered any known bugs, but we're better off safe
than sorry.

If the buffer is to small, the returned memory_map_size indicates the
required size to the caller.

Signed-off-by: Stefan Brüns 
---
 lib/efi_loader/efi_memory.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index ebe8e94..1d23783 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -336,6 +336,7 @@ efi_status_t efi_get_memory_map(unsigned long 
*memory_map_size,
ulong map_size = 0;
int map_entries = 0;
struct list_head *lhandle;
+   unsigned long provided_map_size = *memory_map_size;
 
list_for_each(lhandle, _mem)
map_entries++;
@@ -350,7 +351,7 @@ efi_status_t efi_get_memory_map(unsigned long 
*memory_map_size,
if (descriptor_version)
*descriptor_version = EFI_MEMORY_DESCRIPTOR_VERSION;
 
-   if (*memory_map_size < map_size)
+   if (provided_map_size < map_size)
return EFI_BUFFER_TOO_SMALL;
 
/* Copy list into array */
-- 
2.10.0

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


[U-Boot] [PATCH v4 4/7] efi_loader: Track size of pool allocations to allow freeing

2016-10-09 Thread Stefan Brüns
We need a functional free_pool implementation, as otherwise each
allocate_pool causes growth of the memory descriptor table.

Different to free_pages, free_pool does not provide the size for the
to be freed allocation, thus we have to track the size ourselves.

As the only EFI requirement for pool allocation is an alignment of
8 bytes, we can keep allocating a range using the page allocator,
reserve the first 8 bytes for our bookkeeping and hand out the
remainder to the caller. This saves us from having to use any
independent data structures for tracking.

To simplify the conversion between pool allocations and the corresponding
page allocation, we create an auxiliary struct efi_pool_allocation.

Given the allocation size free_pool size can handoff freeing the page
range, which was indirectly allocated by a call to allocate_pool,
to free_pages.

Signed-off-by: Stefan Brüns 
---
 include/efi_loader.h  |  2 ++
 lib/efi_loader/efi_boottime.c |  6 +++---
 lib/efi_loader/efi_memory.c   | 42 +++---
 3 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/include/efi_loader.h b/include/efi_loader.h
index f0473ab..3dad24e 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -122,6 +122,8 @@ efi_status_t efi_free_pages(uint64_t memory, unsigned long 
pages);
 /* EFI memory allocator for small allocations */
 efi_status_t efi_allocate_pool(int pool_type, unsigned long size,
   void **buffer);
+/* EFI pool memory free function. */
+efi_status_t efi_free_pool(void *buffer);
 /* Returns the EFI memory map */
 efi_status_t efi_get_memory_map(unsigned long *memory_map_size,
struct efi_mem_desc *memory_map,
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index eb74cb0..8274d8e 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -141,12 +141,12 @@ static efi_status_t EFIAPI efi_allocate_pool_ext(int 
pool_type,
return EFI_EXIT(r);
 }
 
-static efi_status_t EFIAPI efi_free_pool(void *buffer)
+static efi_status_t EFIAPI efi_free_pool_ext(void *buffer)
 {
efi_status_t r;
 
EFI_ENTRY("%p", buffer);
-   r = efi_free_pages((ulong)buffer, 0);
+   r = efi_free_pool(buffer);
return EFI_EXIT(r);
 }
 
@@ -736,7 +736,7 @@ static const struct efi_boot_services efi_boot_services = {
.free_pages = efi_free_pages_ext,
.get_memory_map = efi_get_memory_map_ext,
.allocate_pool = efi_allocate_pool_ext,
-   .free_pool = efi_free_pool,
+   .free_pool = efi_free_pool_ext,
.create_event = efi_create_event,
.set_timer = efi_set_timer,
.wait_for_event = efi_wait_for_event,
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index be642f1..de28db6 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -34,6 +34,19 @@ void *efi_bounce_buffer;
 #endif
 
 /*
+ * U-Boot services each EFI AllocatePool request as a separate
+ * (multiple) page allocation.  We have to track the number of pages
+ * to be able to free the correct amount later.
+ * EFI requires 8 byte alignment for pool allocations, so we can
+ * prepend each allocation with an 64 bit header tracking the
+ * allocation size, and hand out the remainder to the caller.
+ */
+struct efi_pool_allocation {
+   u64 num_pages;
+   char data[];
+};
+
+/*
  * Sorts the memory list from highest address to lowest address
  *
  * When allocating memory we should always start from the highest
@@ -332,11 +345,34 @@ efi_status_t efi_allocate_pool(int pool_type, unsigned 
long size,
 {
efi_status_t r;
efi_physical_addr_t t;
-   u64 num_pages = (size + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
+   u64 num_pages = (size + sizeof(u64) + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
+
+   if (size == 0) {
+   *buffer = NULL;
+   return EFI_SUCCESS;
+   }
 
r = efi_allocate_pages(0, pool_type, num_pages, );
-   if (r == EFI_SUCCESS)
-   *buffer = (void *)(uintptr_t)t;
+
+   if (r == EFI_SUCCESS) {
+   struct efi_pool_allocation *alloc = (void *)(uintptr_t)t;
+   alloc->num_pages = num_pages;
+   *buffer = alloc->data;
+   }
+
+   return r;
+}
+
+efi_status_t efi_free_pool(void *buffer)
+{
+   efi_status_t r;
+   struct efi_pool_allocation *alloc;
+
+   alloc = container_of(buffer, struct efi_pool_allocation, data);
+   /* Sanity check, was the supplied address returned by allocate_pool */
+   assert(((uintptr_t)alloc & EFI_PAGE_MASK) == 0);
+
+   r = efi_free_pages((uintptr_t)alloc, alloc->num_pages);
 
return r;
 }
-- 
2.10.0

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


[U-Boot] [PATCH v4 3/7] efi_loader: Move efi_allocate_pool implementation to efi_memory.c

2016-10-09 Thread Stefan Brüns
We currently handle efi_allocate_pool() in our boot time service
file. In the following patch, pool allocation will receive additional
internal semantics that we should preserve inside efi_memory.c instead.

As foundation for those changes, split the function into an externally
facing efi_allocate_pool_ext() for use by payloads and an internal helper
efi_allocate_pool() in efi_memory.c that handles the actual allocation.

While at it, change the magic 0xfff / 12 constants to the more obvious
EFI_PAGE_MASK/SHIFT defines.

Signed-off-by: Stefan Brüns 
---
 include/efi_loader.h  |  3 +++
 lib/efi_loader/efi_boottime.c | 11 +--
 lib/efi_loader/efi_memory.c   | 14 ++
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/include/efi_loader.h b/include/efi_loader.h
index 9738835..f0473ab 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -119,6 +119,9 @@ efi_status_t efi_allocate_pages(int type, int memory_type, 
unsigned long pages,
uint64_t *memory);
 /* EFI memory free function. Not implemented today */
 efi_status_t efi_free_pages(uint64_t memory, unsigned long pages);
+/* EFI memory allocator for small allocations */
+efi_status_t efi_allocate_pool(int pool_type, unsigned long size,
+  void **buffer);
 /* Returns the EFI memory map */
 efi_status_t efi_get_memory_map(unsigned long *memory_map_size,
struct efi_mem_desc *memory_map,
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 784891b..eb74cb0 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -130,15 +130,14 @@ efi_status_t EFIAPI efi_get_memory_map_ext(unsigned long 
*memory_map_size,
return EFI_EXIT(r);
 }
 
-static efi_status_t EFIAPI efi_allocate_pool(int pool_type, unsigned long size,
-void **buffer)
+static efi_status_t EFIAPI efi_allocate_pool_ext(int pool_type,
+unsigned long size,
+void **buffer)
 {
efi_status_t r;
-   efi_physical_addr_t t;
 
EFI_ENTRY("%d, %ld, %p", pool_type, size, buffer);
-   r = efi_allocate_pages(0, pool_type, (size + 0xfff) >> 12, );
-   *buffer = (void *)(uintptr_t)t;
+   r = efi_allocate_pool(pool_type, size, buffer);
return EFI_EXIT(r);
 }
 
@@ -736,7 +735,7 @@ static const struct efi_boot_services efi_boot_services = {
.allocate_pages = efi_allocate_pages_ext,
.free_pages = efi_free_pages_ext,
.get_memory_map = efi_get_memory_map_ext,
-   .allocate_pool = efi_allocate_pool,
+   .allocate_pool = efi_allocate_pool_ext,
.free_pool = efi_free_pool,
.create_event = efi_create_event,
.set_timer = efi_set_timer,
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index 1d23783..be642f1 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -327,6 +327,20 @@ efi_status_t efi_free_pages(uint64_t memory, unsigned long 
pages)
return EFI_SUCCESS;
 }
 
+efi_status_t efi_allocate_pool(int pool_type, unsigned long size,
+  void **buffer)
+{
+   efi_status_t r;
+   efi_physical_addr_t t;
+   u64 num_pages = (size + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
+
+   r = efi_allocate_pages(0, pool_type, num_pages, );
+   if (r == EFI_SUCCESS)
+   *buffer = (void *)(uintptr_t)t;
+
+   return r;
+}
+
 efi_status_t efi_get_memory_map(unsigned long *memory_map_size,
   struct efi_mem_desc *memory_map,
   unsigned long *map_key,
-- 
2.10.0

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


[U-Boot] [PATCH 1/3] ext4: cleanup unlink_filename function

2016-10-09 Thread Stefan Brüns
Use the same variable names as in search_dir, to make purpose of variables
more obvious.

Signed-off-by: Stefan Brüns 
---
 fs/ext4/ext4_common.c | 29 +++--
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index e78185b..699a640 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -854,34 +854,35 @@ fail:
 
 static int unlink_filename(char *filename, unsigned int blknr)
 {
-   int totalbytes = 0;
int templength = 0;
int status, inodeno;
int found = 0;
-   char *root_first_block_buffer = NULL;
+   int offset;
+   char *block_buffer = NULL;
struct ext2_dirent *dir = NULL;
struct ext2_dirent *previous_dir = NULL;
char *ptr = NULL;
struct ext_filesystem *fs = get_fs();
int ret = -1;
 
-   /* get the first block of root */
-   root_first_block_buffer = zalloc(fs->blksz);
-   if (!root_first_block_buffer)
+   block_buffer = zalloc(fs->blksz);
+   if (!block_buffer)
return -ENOMEM;
+
+   /* read the directory block */
status = ext4fs_devread((lbaint_t)blknr * fs->sect_perblk, 0,
-   fs->blksz, root_first_block_buffer);
+   fs->blksz, block_buffer);
if (status == 0)
goto fail;
 
-   if (ext4fs_log_journal(root_first_block_buffer, blknr))
+   if (ext4fs_log_journal(block_buffer, blknr))
goto fail;
-   dir = (struct ext2_dirent *)root_first_block_buffer;
+   dir = (struct ext2_dirent *)block_buffer;
ptr = (char *)dir;
-   totalbytes = 0;
+   offset = 0;
while (le16_to_cpu(dir->direntlen) >= 0) {
/*
-* blocksize-totalbytes because last
+* blocksize-offset because last
 * directory length i.e., *dir->direntlen
 * is free availble space in the block that
 * means it is a last entry of directory entry
@@ -903,12 +904,12 @@ static int unlink_filename(char *filename, unsigned int 
blknr)
break;
}
 
-   if (fs->blksz - totalbytes == le16_to_cpu(dir->direntlen))
+   if (fs->blksz - offset == le16_to_cpu(dir->direntlen))
break;
 
/* traversing the each directory entry */
templength = le16_to_cpu(dir->direntlen);
-   totalbytes = totalbytes + templength;
+   offset = offset + templength;
previous_dir = dir;
dir = (struct ext2_dirent *)((char *)dir + templength);
ptr = (char *)dir;
@@ -916,12 +917,12 @@ static int unlink_filename(char *filename, unsigned int 
blknr)
 
 
if (found == 1) {
-   if (ext4fs_put_metadata(root_first_block_buffer, blknr))
+   if (ext4fs_put_metadata(block_buffer, blknr))
goto fail;
ret = inodeno;
}
 fail:
-   free(root_first_block_buffer);
+   free(block_buffer);
 
return ret;
 }
-- 
2.10.0

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


[U-Boot] [PATCH 2/3] ext4: Fix handling of direntlen in unlink_filename

2016-10-09 Thread Stefan Brüns
The direntlen checks were quite bogus, i.e. the loop termination used
"len + offset == blocksize" (exact match only), and checked for a
direntlen less than 0. The latter can never happen as the len is
unsigned, this has been reported by Coverity, CID 153384.

Use the same code as in search_dir for directory traversal. This code
has the correct checks for direntlen >= sizeof(struct dirent), and
offset < blocksize.

Signed-off-by: Stefan Brüns 
---
 fs/ext4/ext4_common.c | 45 +
 1 file changed, 17 insertions(+), 28 deletions(-)

diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 699a640..11be0b7 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -854,16 +854,15 @@ fail:
 
 static int unlink_filename(char *filename, unsigned int blknr)
 {
-   int templength = 0;
-   int status, inodeno;
-   int found = 0;
+   int status;
+   int inodeno = 0;
int offset;
char *block_buffer = NULL;
struct ext2_dirent *dir = NULL;
-   struct ext2_dirent *previous_dir = NULL;
-   char *ptr = NULL;
+   struct ext2_dirent *previous_dir;
struct ext_filesystem *fs = get_fs();
int ret = -1;
+   char *direntname;
 
block_buffer = zalloc(fs->blksz);
if (!block_buffer)
@@ -877,20 +876,18 @@ static int unlink_filename(char *filename, unsigned int 
blknr)
 
if (ext4fs_log_journal(block_buffer, blknr))
goto fail;
-   dir = (struct ext2_dirent *)block_buffer;
-   ptr = (char *)dir;
offset = 0;
-   while (le16_to_cpu(dir->direntlen) >= 0) {
-   /*
-* blocksize-offset because last
-* directory length i.e., *dir->direntlen
-* is free availble space in the block that
-* means it is a last entry of directory entry
-*/
+   do {
+   previous_dir = dir;
+   dir = (struct ext2_dirent *)(block_buffer + offset);
+   direntname = (char *)(dir) + sizeof(struct ext2_dirent);
+
+   int direntlen = le16_to_cpu(dir->direntlen);
+   if (direntlen < sizeof(struct ext2_dirent))
+   break;
+
if (dir->inode && (strlen(filename) == dir->namelen) &&
-   (strncmp(ptr + sizeof(struct ext2_dirent),
-filename, dir->namelen) == 0)) {
-   printf("file found, deleting\n");
+   (strncmp(direntname, filename, dir->namelen) == 0)) {
inodeno = le32_to_cpu(dir->inode);
if (previous_dir) {
uint16_t new_len;
@@ -900,23 +897,15 @@ static int unlink_filename(char *filename, unsigned int 
blknr)
} else {
dir->inode = 0;
}
-   found = 1;
break;
}
 
-   if (fs->blksz - offset == le16_to_cpu(dir->direntlen))
-   break;
+   offset += direntlen;
 
-   /* traversing the each directory entry */
-   templength = le16_to_cpu(dir->direntlen);
-   offset = offset + templength;
-   previous_dir = dir;
-   dir = (struct ext2_dirent *)((char *)dir + templength);
-   ptr = (char *)dir;
-   }
+   } while (offset < fs->blksz);
 
+   if (inodeno > 0) {
 
-   if (found == 1) {
if (ext4fs_put_metadata(block_buffer, blknr))
goto fail;
ret = inodeno;
-- 
2.10.0

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


[U-Boot] [PATCH 0/3] ext4: cleanup/fix unlink_filename function

2016-10-09 Thread Stefan Brüns
This patch series addresses Coverity defects CID 153383/153384.
The first patch is a preparation patch, the second addresses the
actual issue.
The last patch corrects the journal handling in the same function.

Stefan Brüns (3):
  ext4: cleanup unlink_filename function
  ext4: Fix handling of direntlen in unlink_filename
  ext4: Only write journal entries for modified blocks in
unlink_filename

 fs/ext4/ext4_common.c | 87 +++
 1 file changed, 40 insertions(+), 47 deletions(-)

-- 
2.10.0

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


[U-Boot] [PATCH 3/3] ext4: Only write journal entries for modified blocks in unlink_filename

2016-10-09 Thread Stefan Brüns
Instead of creating a journal entry for each directory block, even
if the block is unmodified, only log the modified block.

Signed-off-by: Stefan Brüns 
---
 fs/ext4/ext4_common.c | 23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 11be0b7..ec02eec 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -874,8 +874,6 @@ static int unlink_filename(char *filename, unsigned int 
blknr)
if (status == 0)
goto fail;
 
-   if (ext4fs_log_journal(block_buffer, blknr))
-   goto fail;
offset = 0;
do {
previous_dir = dir;
@@ -889,14 +887,6 @@ static int unlink_filename(char *filename, unsigned int 
blknr)
if (dir->inode && (strlen(filename) == dir->namelen) &&
(strncmp(direntname, filename, dir->namelen) == 0)) {
inodeno = le32_to_cpu(dir->inode);
-   if (previous_dir) {
-   uint16_t new_len;
-   new_len = le16_to_cpu(previous_dir->direntlen);
-   new_len += le16_to_cpu(dir->direntlen);
-   previous_dir->direntlen = cpu_to_le16(new_len);
-   } else {
-   dir->inode = 0;
-   }
break;
}
 
@@ -905,7 +895,20 @@ static int unlink_filename(char *filename, unsigned int 
blknr)
} while (offset < fs->blksz);
 
if (inodeno > 0) {
+   printf("file found, deleting\n");
+   if (ext4fs_log_journal(block_buffer, blknr))
+   goto fail;
 
+   if (previous_dir) {
+   /* merge dir entry with predecessor */
+   uint16_t new_len;
+   new_len = le16_to_cpu(previous_dir->direntlen);
+   new_len += le16_to_cpu(dir->direntlen);
+   previous_dir->direntlen = cpu_to_le16(new_len);
+   } else {
+   /* invalidate dir entry */
+   dir->inode = 0;
+   }
if (ext4fs_put_metadata(block_buffer, blknr))
goto fail;
ret = inodeno;
-- 
2.10.0

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


Re: [U-Boot] [PATCH V3 1/8] tools: imximage: add plugin support

2016-10-09 Thread Eric Nelson
Hi Peng,

On 10/09/2016 06:48 PM, Eric Nelson wrote:
> On 10/09/2016 08:12 AM, Peng Fan wrote:
>>> On 10/09/2016 04:20 AM, Peng Fan wrote:
 On Sat, Oct 08, 2016 at 05:26:18PM +0200, Eric Nelson wrote:
> On 10/08/2016 08:58 AM, Peng Fan wrote:



>>> If we get SPL-as-plugin working, then this would form a
>>> dividing line where you need to get rid of the DCD altogether.
>>>
>>> What about the CSF test? Your patches say that CSF and plugins
>>> are also not supported.
>>
>> CSF is supported  and code in nxp community. But that piece code is not 
>> included
>> in the nxp released uboot.
>>
> 
> Cool. Otherwise
> 

Sorry. I fat-fingered the  key while I went in search for a
link.

What I meant to say was

"Otherwise, we couldn't use HAB and LPSR mode on i.MX7", which
is another reason for getting plugins to work."

https://community.nxp.com/thread/434057?sr=inbox=206296

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


Re: [U-Boot] [PATCH V3 1/8] tools: imximage: add plugin support

2016-10-09 Thread Eric Nelson
Hi Peng,

On 10/09/2016 08:12 AM, Peng Fan wrote:
>> On 10/09/2016 04:20 AM, Peng Fan wrote:
>>> On Sat, Oct 08, 2016 at 05:26:18PM +0200, Eric Nelson wrote:
 On 10/08/2016 08:58 AM, Peng Fan wrote:




 I also don't understand why the choice to make the union
 with either a DCD table or a plugin.
>>>
>>> Confirmed with ROM team. DCD and plugin are exclusive,
>>>
>>> You can not have both at the same time.
>>>
>>
>> That's too bad, since porting from DCD-style to SPL can be
>> useful (as Fabio has seen trying to keep some boards up-to-date).
> 
> I saw the patches.
> If using plugin, there is no need to use DCD.
> 
> all the things in DCD can be done in plugin code.
> 
>>
>> If we get SPL-as-plugin working, then this would form a
>> dividing line where you need to get rid of the DCD altogether.
>>
>> What about the CSF test? Your patches say that CSF and plugins
>> are also not supported.
> 
> CSF is supported  and code in nxp community. But that piece code is not 
> included
> in the nxp released uboot.
> 

Cool. Otherwise

> https://community.nxp.com/docs/DOC-332725
> 

This page is telling me that "Access is restricted".

>>




 Where is the 16k limit coming from? I don't think this is necessary,
 and if it is, we won't be able to load SPL using a plugin.
>>>
>>> Confirmed with ROM team, there is no limitation. But SPL code needs to be 
>>> small
>>> to be in OCRAM.
>>>
>>
>> Whew! This would have killed the idea of SPL-as-plugin.
> 
> SPL is designed to run in OCRAM for i.MX6, so it's still ok to let SPL as 
> plugin image.
> 

Cool.

I'll take a stab at instrumenting the startup code and let you know
what I find.

Regards,


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


Re: [U-Boot] [PATCH] fsl_sec_mon: Update driver for Security Monitor

2016-10-09 Thread york sun
On 08/30/2016 11:34 PM, Sumit Garg wrote:
> Update the API's for transition of Security Monitor states. Instead
> of providing both initial and final states for transition, just provide
> final state for transition as Security Monitor driver will take care
> of it internally.
>
> Signed-off-by: Sumit Garg 
> ---


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH v3 2/3] dm: blk: Enable CONFIG_BLK if DM_MMC is enabled

2016-10-09 Thread Simon Glass
On 1 October 2016 at 14:43, Simon Glass  wrote:
> To speed up conversion to CONFIG_BLK, enable it by default when DM_MMC is
> enabled.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v3: None
>
>  configs/am335x_boneblack_vboot_defconfig  | 1 +
>  configs/am335x_evm_defconfig  | 1 +
>  configs/am43xx_evm_defconfig  | 1 +
>  configs/am43xx_evm_usbhost_boot_defconfig | 1 +
>  configs/am43xx_hs_evm_defconfig   | 1 +
>  configs/am57xx_evm_defconfig  | 1 +
>  configs/am57xx_hs_evm_defconfig   | 1 +
>  configs/apalis_t30_defconfig  | 1 +
>  configs/beaver_defconfig  | 1 +
>  configs/cardhu_defconfig  | 1 +
>  configs/cei-tk1-som_defconfig | 1 +
>  configs/colibri_t20_defconfig | 1 +
>  configs/colibri_t30_defconfig | 1 +
>  configs/dalmore_defconfig | 1 +
>  configs/dra7xx_evm_defconfig  | 1 +
>  configs/dra7xx_hs_evm_defconfig   | 1 +
>  configs/e2220-1170_defconfig  | 1 +
>  configs/harmony_defconfig | 1 +
>  configs/jetson-tk1_defconfig  | 1 +
>  configs/k2g_evm_defconfig | 1 +
>  configs/medcom-wide_defconfig | 1 +
>  configs/nyan-big_defconfig| 1 +
>  configs/p2371-_defconfig  | 1 +
>  configs/p2371-2180_defconfig  | 1 +
>  configs/p2571_defconfig   | 1 +
>  configs/p2771--000_defconfig  | 1 +
>  configs/p2771--500_defconfig  | 1 +
>  configs/paz00_defconfig   | 1 +
>  configs/pic32mzdask_defconfig | 1 +
>  configs/plutux_defconfig  | 1 +
>  configs/sandbox_noblk_defconfig   | 1 +
>  configs/seaboard_defconfig| 1 +
>  configs/tec-ng_defconfig  | 1 +
>  configs/tec_defconfig | 1 +
>  configs/trimslice_defconfig   | 1 +
>  configs/venice2_defconfig | 1 +
>  configs/ventana_defconfig | 1 +
>  configs/whistler_defconfig| 1 +
>  drivers/block/Kconfig | 1 +
>  39 files changed, 39 insertions(+)

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


Re: [U-Boot] [PATCH v3 3/3] dm: mmc: Enable DM_MMC_OPS by default with DM_MMC

2016-10-09 Thread Simon Glass
On 1 October 2016 at 14:43, Simon Glass  wrote:
> These two options go together and it is best to do the conversion in one
> step. So enable DM_MMC_OPS by default if DM_MMC is enabled.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v3:
> - Updates to remove build errors from tegra and other boards
>
>  configs/am335x_boneblack_vboot_defconfig  | 1 +
>  configs/am335x_evm_defconfig  | 1 +
>  configs/am43xx_evm_defconfig  | 1 +
>  configs/am43xx_evm_usbhost_boot_defconfig | 1 +
>  configs/am43xx_hs_evm_defconfig   | 1 +
>  configs/am57xx_evm_defconfig  | 1 +
>  configs/am57xx_hs_evm_defconfig   | 1 +
>  configs/apalis_t30_defconfig  | 1 +
>  configs/beaver_defconfig  | 1 +
>  configs/cardhu_defconfig  | 1 +
>  configs/cei-tk1-som_defconfig | 1 +
>  configs/colibri_t20_defconfig | 1 +
>  configs/colibri_t30_defconfig | 1 +
>  configs/dalmore_defconfig | 1 +
>  configs/dra7xx_evm_defconfig  | 1 +
>  configs/dra7xx_hs_evm_defconfig   | 1 +
>  configs/e2220-1170_defconfig  | 1 +
>  configs/harmony_defconfig | 1 +
>  configs/jetson-tk1_defconfig  | 1 +
>  configs/k2g_evm_defconfig | 1 +
>  configs/medcom-wide_defconfig | 1 +
>  configs/nyan-big_defconfig| 1 +
>  configs/p2371-_defconfig  | 1 +
>  configs/p2371-2180_defconfig  | 1 +
>  configs/p2571_defconfig   | 1 +
>  configs/p2771--000_defconfig  | 1 +
>  configs/p2771--500_defconfig  | 1 +
>  configs/paz00_defconfig   | 1 +
>  configs/plutux_defconfig  | 1 +
>  configs/seaboard_defconfig| 1 +
>  configs/tec-ng_defconfig  | 1 +
>  configs/tec_defconfig | 1 +
>  configs/trimslice_defconfig   | 1 +
>  configs/venice2_defconfig | 1 +
>  configs/ventana_defconfig | 1 +
>  configs/whistler_defconfig| 1 +
>  drivers/mmc/Kconfig   | 1 +
>  37 files changed, 37 insertions(+)

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


Re: [U-Boot] [PATCH v3 1/3] dm: mmc: Support erase

2016-10-09 Thread Simon Glass
On 1 October 2016 at 14:43, Simon Glass  wrote:
>
> At present erase is not suported with CONFIG_DM_OPS. Add it so that MMC
> devices can be erased.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v3: None
>
>  drivers/mmc/mmc-uclass.c  |  1 +
>  drivers/mmc/mmc_private.h |  5 ++---
>  drivers/mmc/mmc_write.c   | 10 --
>  3 files changed, 11 insertions(+), 5 deletions(-)


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


[U-Boot] [PATCH] pinctrl: uniphier: fix unused-const-variable warnings for GCC 6.x

2016-10-09 Thread Masahiro Yamada
Marek reports warnings in UniPhier pinctrl drivers when compiled by
GCC 6.x, like:

  drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c:58:18: warning:
  'usb3_muxvals' defined but not used [-Wunused-const-variable=]
   static const int usb3_muxvals[] = {0, 0};
^~~~

My intention here is to compile minimum set of pin data for SPL to
save memory footprint, but GCC these days is clever enough to notice
unused data arrays.

We can fix it by sprinkling around __maybe_unused on those arrays,
but I did not do that because they are counterparts of the pinctrl
drivers in Linux.  All the pin data were just copy-pasted from Linux
and are kept in sync for maintainability.

I chose a bit tricky way to fix the issue; calculate ARRAY_SIZE of
*_pins and *_muxvals and set their sum to an unused struct member.
This trick will satisfy GCC because the data arrays are used anyway,
but such data arrays will be dropped from the final binary because
the pointers to them are not used.

Signed-off-by: Masahiro Yamada 
Reported-by: Marek Vasut 
---

 drivers/pinctrl/uniphier/pinctrl-uniphier.h | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier.h 
b/drivers/pinctrl/uniphier/pinctrl-uniphier.h
index 5c3db2a..21e2d37 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier.h
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier.h
@@ -91,7 +91,12 @@ struct uniphier_pinctrl_socdata {
 #define __UNIPHIER_PINMUX_FUNCTION(func)   #func
 
 #ifdef CONFIG_SPL_BUILD
-#define UNIPHIER_PINCTRL_GROUP(grp){ .name = NULL }
+   /*
+* a tricky way to drop unneeded *_pins and *_muxvals arrays from SPL,
+* suppressing "defined but not used" warnings.
+*/
+#define UNIPHIER_PINCTRL_GROUP(grp)\
+   { .num_pins = ARRAY_SIZE(grp##_pins) + ARRAY_SIZE(grp##_muxvals) }
 #define UNIPHIER_PINMUX_FUNCTION(func) NULL
 #else
 #define UNIPHIER_PINCTRL_GROUP(grp)__UNIPHIER_PINCTRL_GROUP(grp)
-- 
1.9.1

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


Re: [U-Boot] [PATCH v5 2/5] net: fec_mxc: Convert into driver model

2016-10-09 Thread Jagan Teki
Hi Simon,

On Thu, Oct 6, 2016 at 4:25 PM, Jagan Teki  wrote:
> From: Jagan Teki 
>
> This patch add driver model support for fec_mxc driver.
>
> Cc: Simon Glass 
> Cc: Joe Hershberger 
> Cc: Peng Fan 
> Cc: Stefano Babic 
> Cc: Michael Trimarchi 
> Signed-off-by: Jagan Teki 
> ---
>  drivers/net/fec_mxc.c | 314 
> ++
>  drivers/net/fec_mxc.h |   4 +
>  2 files changed, 271 insertions(+), 47 deletions(-)
>
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index 0838d58..c0ec976 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -9,6 +9,7 @@
>   */
>
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -368,11 +369,8 @@ static int fec_get_hwaddr(int dev_id, unsigned char *mac)
> return !is_valid_ethaddr(mac);
>  }
>
> -static int fec_set_hwaddr(struct eth_device *dev)
> +static int _fec_set_hwaddr(struct fec_priv *fec, uchar *mac)
>  {
> -   uchar *mac = dev->enetaddr;
> -   struct fec_priv *fec = (struct fec_priv *)dev->priv;
> -
> writel(0, >eth->iaddr1);
> writel(0, >eth->iaddr2);
> writel(0, >eth->gaddr1);
> @@ -426,9 +424,8 @@ static void fec_reg_setup(struct fec_priv *fec)
>   * Start the FEC engine
>   * @param[in] dev Our device to handle
>   */
> -static int fec_open(struct eth_device *edev)
> +static int fec_open(struct fec_priv *fec)
>  {
> -   struct fec_priv *fec = (struct fec_priv *)edev->priv;
> int speed;
> uint32_t addr, size;
> int i;
> @@ -534,14 +531,13 @@ static int fec_open(struct eth_device *edev)
> return 0;
>  }
>
> -static int fec_init(struct eth_device *dev, bd_t* bd)
> +static int _fec_init(struct fec_priv *fec, uchar *mac)
>  {
> -   struct fec_priv *fec = (struct fec_priv *)dev->priv;
> uint32_t mib_ptr = (uint32_t)>eth->rmon_t_drop;
> int i;
>
> /* Initialize MAC address */
> -   fec_set_hwaddr(dev);
> +   _fec_set_hwaddr(fec, mac);
>
> /*
>  * Setup transmit descriptors, there are two in total.
> @@ -587,7 +583,7 @@ static int fec_init(struct eth_device *dev, bd_t* bd)
> if (fec->xcv_type != SEVENWIRE)
> miiphy_restart_aneg(dev);
>  #endif
> -   fec_open(dev);
> +   fec_open(fec);
> return 0;
>  }
>
> @@ -595,9 +591,8 @@ static int fec_init(struct eth_device *dev, bd_t* bd)
>   * Halt the FEC engine
>   * @param[in] dev Our device to handle
>   */
> -static void fec_halt(struct eth_device *dev)
> +static void _fec_halt(struct fec_priv *fec)
>  {
> -   struct fec_priv *fec = (struct fec_priv *)dev->priv;
> int counter = 0x;
>
> /*
> @@ -637,7 +632,7 @@ static void fec_halt(struct eth_device *dev)
>   * @param[in] length Data count in bytes
>   * @return 0 on success
>   */
> -static int fec_send(struct eth_device *dev, void *packet, int length)
> +static int _fec_send(struct fec_priv *fec, void *packet, int length)
>  {
> unsigned int status;
> uint32_t size, end;
> @@ -649,8 +644,6 @@ static int fec_send(struct eth_device *dev, void *packet, 
> int length)
>  * This routine transmits one frame.  This routine only accepts
>  * 6-byte Ethernet addresses.
>  */
> -   struct fec_priv *fec = (struct fec_priv *)dev->priv;
> -
> /*
>  * Check for valid length of data.
>  */
> @@ -777,14 +770,14 @@ out:
> return ret;
>  }
>
> +
>  /**
>   * Pull one frame from the card
>   * @param[in] dev Our ethernet device to handle
>   * @return Length of packet read
>   */
> -static int fec_recv(struct eth_device *dev)
> +static int _fec_recv(struct fec_priv *fec, uchar *mac)
>  {
> -   struct fec_priv *fec = (struct fec_priv *)dev->priv;
> struct fec_bd *rbd = >rbd_base[fec->rbd_index];
> unsigned long ievent;
> int frame_length, len = 0;
> @@ -800,8 +793,8 @@ static int fec_recv(struct eth_device *dev)
> writel(ievent, >eth->ievent);
> debug("fec_recv: ievent 0x%lx\n", ievent);
> if (ievent & FEC_IEVENT_BABR) {
> -   fec_halt(dev);
> -   fec_init(dev, fec->bd);
> +   _fec_halt(fec);
> +   _fec_init(fec, mac);
> printf("some error: 0x%08lx\n", ievent);
> return 0;
> }
> @@ -813,10 +806,10 @@ static int fec_recv(struct eth_device *dev)
> if (ievent & FEC_IEVENT_GRA) {
> /* Graceful stop complete */
> if (readl(>eth->x_cntrl) & 0x0001) {
> -   fec_halt(dev);
> +   _fec_halt(fec);
> writel(~0x0001 & readl(>eth->x_cntrl),
> >eth->x_cntrl);
> -   

Re: [U-Boot] [PATCH v7 00/21] imx6: Add Engicam i.CoreM6 QDL support

2016-10-09 Thread Jagan Teki
Hi Stefano,

On Sat, Oct 8, 2016 at 6:00 PM, Jagan Teki  wrote:
> From: Jagan Teki 
>
> This series supports Engicam i.CoreM6 QDL modules on top of u-boot-imx/master
> and test on the respective starter kits as well.
>
> Tested both MMC and NAND boot.
>
> Changes for v7:
> - Add patch to CONFIG_DEFAULT_FDT_FILE to defconfigs
> - Rebase on u-boot-imx/master
>
> Changes for v6:
> - Rebase to u-boot-imx/master
> - Move few SPL configs to defconfigs
>
> Changes for v5:
> - Add NAND support
>
> Changes for v4:
> - Add 'net: Kconfig: Add FEC_MXC entry' patch
> - Updated ENV configs along with comments
> - Restructured configs for more readability
> - Add CONFIG_ENV_OVERWRITE
> - Rename icorem6qdl_defconfig with icorem6qdl_mmc_defconfig
>
> Changes for v3:
> - Remove "v2 01/17 imx: iomux-v3: Fix build error with snvs base" 
> patch
> - Remove 'default n' on Kconfig DEFAULT_FDT_FILE patch
> - Add minimal devicetree support for Engicam i.CoreM6 QDL
> - Add is_mx6dl()
> - Add is_mx6solo()
> - Use is_mx6dq()
> - Add last commit sha1 and header in pull devicetree files from Linux
>
> Changes for v2:
> - Make static to local iomux structure in board file
> - Corrected rowaddr in mx6_ddr3_cfg
> - Used imx_ddr_size
> - Add FEC support and tested the same
> - Add DM_GPIO, DM_MMC support
> - Add pinctrl support
> - Add devicetree support
>
> Jagan Teki (21):
>   serial: Kconfig: Add MXC_UART entry
>   thermal: Kconfig: Add IMX_THERMAL entry
>   config: Move CONFIG_DEFAULT_FDT_FILE to defconfigs
>   arm: imx: Add Engicam i.CoreM6 QDL Starter Kit initial support
>   net: Kconfig: Add FEC_MXC entry
>   imx6: icorem6: Add ENET support
>   imx: s/docs\/README.imximage/doc\/README.imximage/g
>   arm: dts: Add devicetree for i.MX6DL
>   arm: dts: Add devicetree for i.MX6DQL
>   arm: dts: imx6dl: Add pinctrl defines
>   dt-bindings: clock: imx6qdl: Add clock defines
>   arm: imx6q: Add devicetree support for Engicam i.CoreM6 DualLite/Solo
>   imx6q: icorem6: Enable pinctrl driver
>   engicam: icorem6: Add DM_GPIO, DM_MMC support
>   arm: dts: Add devicetree for i.MX6Q
>   arm: dts: imx6q: Add pinctrl defines
>   arm: imx6q: Add devicetree support for Engicam i.CoreM6 Quad/Dual
>   mtd: nand: Kconfig: Add NAND_MXS entry
>   imx6: icorem6: Add NAND support
>   imx6: icorem6: Enable MTD device support
>   imx6: icorem6: Add default mtd nand partition table

All set now, please do apply.

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


Re: [U-Boot] [PATCH 1/2] armv8: fsl-lsch2: adjust sata parameter

2016-10-09 Thread york sun
On 08/08/2016 12:18 AM, yuantian.t...@nxp.com wrote:
> From: Tang Yuantian 
>
> The default values for Port Phy2Cfg register and
> Port Phy3Cfg register are better, no need to overwrite them.
>
> Signed-off-by: Tang Yuantian 
> ---

Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


[U-Boot] [PATCH 10/11] video: Remove legacy VESA and coreboot framebuffer drivers

2016-10-09 Thread Bin Meng
Now that all x86 boards have been converted to DM video, drop the
legacy drivers.

Signed-off-by: Bin Meng 
---

 drivers/video/coreboot_fb.c | 108 
 drivers/video/vesa_fb.c |  63 --
 2 files changed, 171 deletions(-)
 delete mode 100644 drivers/video/coreboot_fb.c
 delete mode 100644 drivers/video/vesa_fb.c

diff --git a/drivers/video/coreboot_fb.c b/drivers/video/coreboot_fb.c
deleted file mode 100644
index feb5463..000
--- a/drivers/video/coreboot_fb.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * coreboot Framebuffer driver.
- *
- * Copyright (C) 2011 The Chromium OS authors
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-#include 
-#include 
-#include "videomodes.h"
-
-/*
- * The Graphic Device
- */
-GraphicDevice ctfb;
-
-static void save_vesa_mode(void)
-{
-   struct vesa_mode_info *vesa = _info.vesa;
-   struct cb_framebuffer *fb = lib_sysinfo.framebuffer;
-
-   vesa->x_resolution = fb->x_resolution;
-   vesa->y_resolution = fb->y_resolution;
-   vesa->bits_per_pixel = fb->bits_per_pixel;
-   vesa->bytes_per_scanline = fb->bytes_per_line;
-   vesa->phys_base_ptr = fb->physical_address;
-   vesa->red_mask_size = fb->red_mask_size;
-   vesa->red_mask_pos = fb->red_mask_pos;
-   vesa->green_mask_size = fb->green_mask_size;
-   vesa->green_mask_pos = fb->green_mask_pos;
-   vesa->blue_mask_size = fb->blue_mask_size;
-   vesa->blue_mask_pos = fb->blue_mask_pos;
-   vesa->reserved_mask_size = fb->reserved_mask_size;
-   vesa->reserved_mask_pos = fb->reserved_mask_pos;
-}
-
-static int parse_coreboot_table_fb(GraphicDevice *gdev)
-{
-   struct cb_framebuffer *fb = lib_sysinfo.framebuffer;
-
-   /* If there is no framebuffer structure, bail out and keep
-* running on the serial console.
-*/
-   if (!fb)
-   return 0;
-
-   gdev->winSizeX = fb->x_resolution;
-   gdev->winSizeY = fb->y_resolution;
-
-   gdev->plnSizeX = fb->x_resolution;
-   gdev->plnSizeY = fb->y_resolution;
-
-   gdev->gdfBytesPP = fb->bits_per_pixel / 8;
-
-   switch (fb->bits_per_pixel) {
-   case 24:
-   gdev->gdfIndex = GDF_32BIT_X888RGB;
-   break;
-   case 16:
-   gdev->gdfIndex = GDF_16BIT_565RGB;
-   break;
-   default:
-   gdev->gdfIndex = GDF__8BIT_INDEX;
-   break;
-   }
-
-   gdev->isaBase = CONFIG_SYS_ISA_IO_BASE_ADDRESS;
-   gdev->pciBase = (unsigned int)fb->physical_address;
-
-   gdev->frameAdrs = (unsigned int)fb->physical_address;
-   gdev->memSize = fb->bytes_per_line * fb->y_resolution;
-
-   gdev->vprBase = (unsigned int)fb->physical_address;
-   gdev->cprBase = (unsigned int)fb->physical_address;
-
-   return 1;
-}
-
-void *video_hw_init(void)
-{
-   GraphicDevice *gdev = 
-   int bits_per_pixel;
-
-   printf("Video: ");
-
-   if (!parse_coreboot_table_fb(gdev)) {
-   printf("No video mode configured in coreboot!\n");
-   return NULL;
-   }
-
-   bits_per_pixel = gdev->gdfBytesPP * 8;
-
-   /* fill in Graphic device struct */
-   sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY,
-bits_per_pixel);
-   printf("%s\n", gdev->modeIdent);
-
-   memset((void *)gdev->pciBase, 0,
-   gdev->winSizeX * gdev->winSizeY * gdev->gdfBytesPP);
-
-   /* Initialize vesa_mode_info structure */
-   save_vesa_mode();
-
-   return (void *)gdev;
-}
diff --git a/drivers/video/vesa_fb.c b/drivers/video/vesa_fb.c
deleted file mode 100644
index 021c1d6..000
--- a/drivers/video/vesa_fb.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * VESA frame buffer driver
- *
- * Copyright (C) 2014 Google, Inc
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-#include 
-#include 
-
-/*
- * The Graphic Device
- */
-GraphicDevice ctfb;
-
-void *video_hw_init(void)
-{
-   GraphicDevice *gdev = 
-   struct udevice *dev;
-   int bits_per_pixel;
-   int ret;
-
-   printf("Video: ");
-   if (!ll_boot_init()) {
-   /*
-* If we are running from EFI or coreboot, this driver can't
-* work.
-*/
-   printf("Not available (previous bootloader prevents it)\n");
-   return NULL;
-   }
-   if (vbe_get_video_info(gdev)) {
-   ret = dm_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, 0, );
-   if (ret) {
-   printf("no card detected\n");
-   return NULL;
-   }
-   bootstage_start(BOOTSTAGE_ID_ACCUM_LCD, "vesa display");
-   ret = dm_pci_run_vga_bios(dev, NULL, PCI_ROM_USE_NATIVE |
- PCI_ROM_ALLOW_FALLBACK);
-   

[U-Boot] [PATCH 11/11] x86: Clean up unused macros in the configuration headers

2016-10-09 Thread Bin Meng
Legacy video driver macros are not needed. Clean them up.

Signed-off-by: Bin Meng 

---

 include/configs/cougarcanyon2.h  |  4 
 include/configs/efi-x86.h|  2 --
 include/configs/galileo.h|  4 
 include/configs/x86-chromebook.h | 12 +++-
 include/configs/x86-common.h |  7 ---
 5 files changed, 3 insertions(+), 26 deletions(-)

diff --git a/include/configs/cougarcanyon2.h b/include/configs/cougarcanyon2.h
index 88845dc..d20ad96 100644
--- a/include/configs/cougarcanyon2.h
+++ b/include/configs/cougarcanyon2.h
@@ -27,8 +27,4 @@
 #define CONFIG_ENV_SECT_SIZE   0x1000
 #define CONFIG_ENV_OFFSET  0x5ff000
 
-/* Video is not supported for now */
-#undef CONFIG_VIDEO
-#undef CONFIG_CFB_CONSOLE
-
 #endif /* __CONFIG_H */
diff --git a/include/configs/efi-x86.h b/include/configs/efi-x86.h
index 95e46c5..5626061 100644
--- a/include/configs/efi-x86.h
+++ b/include/configs/efi-x86.h
@@ -15,8 +15,6 @@
 
 #undef CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_ENV_IS_NOWHERE
-#undef CONFIG_VIDEO
-#undef CONFIG_CFB_CONSOLE
 #undef CONFIG_SCSI_AHCI
 #undef CONFIG_SCSI
 #undef CONFIG_INTEL_ICH6_GPIO
diff --git a/include/configs/galileo.h b/include/configs/galileo.h
index 40f7fba..034142c 100644
--- a/include/configs/galileo.h
+++ b/include/configs/galileo.h
@@ -31,10 +31,6 @@
 #undef CONFIG_SCSI_AHCI
 #undef CONFIG_SCSI
 
-/* Video is not supported in Quark SoC */
-#undef CONFIG_VIDEO
-#undef CONFIG_CFB_CONSOLE
-
 /* SD/MMC support */
 #define CONFIG_MMC
 #define CONFIG_SDHCI
diff --git a/include/configs/x86-chromebook.h b/include/configs/x86-chromebook.h
index 7fba716..4bcebfc 100644
--- a/include/configs/x86-chromebook.h
+++ b/include/configs/x86-chromebook.h
@@ -53,14 +53,8 @@
 
 #define CONFIG_SYS_WHITE_ON_BLACK
 
-#ifdef CONFIG_DM_VIDEO
-#define VIDEO_DEV "vidconsole"
-#else
-#define VIDEO_DEV "vga"
-#endif
-
-#define CONFIG_STD_DEVICES_SETTINGS "stdin=usbkbd,i8042-kbd,serial\0" \
-   "stdout=" VIDEO_DEV ",serial\0" \
-   "stderr=" VIDEO_DEV ",serial\0"
+#define CONFIG_STD_DEVICES_SETTINGS"stdin=usbkbd,i8042-kbd,serial\0" \
+   "stdout=vidconsole,serial\0" \
+   "stderr=vidconsole,serial\0"
 
 #endif
diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h
index 96c53b8..3926541 100644
--- a/include/configs/x86-common.h
+++ b/include/configs/x86-common.h
@@ -131,13 +131,6 @@
 /*---
  * Video Configuration
  */
-#ifndef CONFIG_DM_VIDEO
-#define CONFIG_VIDEO
-#define CONFIG_VIDEO_SW_CURSOR
-#define VIDEO_FB_16BPP_WORD_SWAP
-#define CONFIG_VGA_AS_SINGLE_DEVICE
-#define CONFIG_CFB_CONSOLE
-#endif
 #define CONFIG_CONSOLE_SCROLL_LINES 5
 
 /*---
-- 
2.9.2

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


[U-Boot] [PATCH 09/11] x86: coreboot: Convert to use DM coreboot video driver

2016-10-09 Thread Bin Meng
This converts coreboot to use DM framebuffer driver.

Signed-off-by: Bin Meng 
---

 arch/x86/cpu/coreboot/Kconfig   | 4 
 arch/x86/dts/bayleybay.dts  | 1 +
 arch/x86/dts/broadwell_som-6896.dts | 1 +
 arch/x86/dts/chromebook_link.dts| 1 +
 arch/x86/dts/chromebook_samus.dts   | 1 +
 arch/x86/dts/chromebox_panther.dts  | 1 +
 arch/x86/dts/coreboot_fb.dtsi   | 5 +
 arch/x86/dts/minnowmax.dts  | 1 +
 configs/coreboot-x86_defconfig  | 2 ++
 doc/README.x86  | 4 
 drivers/video/Makefile  | 2 +-
 include/configs/som-6896.h  | 6 +++---
 12 files changed, 21 insertions(+), 8 deletions(-)
 create mode 100644 arch/x86/dts/coreboot_fb.dtsi

diff --git a/arch/x86/cpu/coreboot/Kconfig b/arch/x86/cpu/coreboot/Kconfig
index e0e3c64..4b3601f 100644
--- a/arch/x86/cpu/coreboot/Kconfig
+++ b/arch/x86/cpu/coreboot/Kconfig
@@ -8,8 +8,4 @@ config CBMEM_CONSOLE
bool
default y
 
-config VIDEO_COREBOOT
-   bool
-   default y
-
 endif
diff --git a/arch/x86/dts/bayleybay.dts b/arch/x86/dts/bayleybay.dts
index c8907ce..18b310d 100644
--- a/arch/x86/dts/bayleybay.dts
+++ b/arch/x86/dts/bayleybay.dts
@@ -14,6 +14,7 @@
 /include/ "serial.dtsi"
 /include/ "rtc.dtsi"
 /include/ "tsc_timer.dtsi"
+/include/ "coreboot_fb.dtsi"
 
 / {
model = "Intel Bayley Bay";
diff --git a/arch/x86/dts/broadwell_som-6896.dts 
b/arch/x86/dts/broadwell_som-6896.dts
index 4bb0a34..3966199 100644
--- a/arch/x86/dts/broadwell_som-6896.dts
+++ b/arch/x86/dts/broadwell_som-6896.dts
@@ -4,6 +4,7 @@
 /include/ "serial.dtsi"
 /include/ "rtc.dtsi"
 /include/ "tsc_timer.dtsi"
+/include/ "coreboot_fb.dtsi"
 
 / {
model = "Advantech SOM-6896";
diff --git a/arch/x86/dts/chromebook_link.dts b/arch/x86/dts/chromebook_link.dts
index fb1b31d..b932340 100644
--- a/arch/x86/dts/chromebook_link.dts
+++ b/arch/x86/dts/chromebook_link.dts
@@ -7,6 +7,7 @@
 /include/ "serial.dtsi"
 /include/ "rtc.dtsi"
 /include/ "tsc_timer.dtsi"
+/include/ "coreboot_fb.dtsi"
 
 / {
model = "Google Link";
diff --git a/arch/x86/dts/chromebook_samus.dts 
b/arch/x86/dts/chromebook_samus.dts
index 5dd3e57..52a9ea6 100644
--- a/arch/x86/dts/chromebook_samus.dts
+++ b/arch/x86/dts/chromebook_samus.dts
@@ -7,6 +7,7 @@
 /include/ "serial.dtsi"
 /include/ "rtc.dtsi"
 /include/ "tsc_timer.dtsi"
+/include/ "coreboot_fb.dtsi"
 
 / {
model = "Google Samus";
diff --git a/arch/x86/dts/chromebox_panther.dts 
b/arch/x86/dts/chromebox_panther.dts
index 480b366..b25c919 100644
--- a/arch/x86/dts/chromebox_panther.dts
+++ b/arch/x86/dts/chromebox_panther.dts
@@ -4,6 +4,7 @@
 /include/ "serial.dtsi"
 /include/ "rtc.dtsi"
 /include/ "tsc_timer.dtsi"
+/include/ "coreboot_fb.dtsi"
 
 / {
model = "Google Panther";
diff --git a/arch/x86/dts/coreboot_fb.dtsi b/arch/x86/dts/coreboot_fb.dtsi
new file mode 100644
index 000..7d72f18
--- /dev/null
+++ b/arch/x86/dts/coreboot_fb.dtsi
@@ -0,0 +1,5 @@
+/ {
+   coreboot-fb {
+   compatible = "coreboot-fb";
+   };
+};
diff --git a/arch/x86/dts/minnowmax.dts b/arch/x86/dts/minnowmax.dts
index 1a8a8cc..d51318b 100644
--- a/arch/x86/dts/minnowmax.dts
+++ b/arch/x86/dts/minnowmax.dts
@@ -13,6 +13,7 @@
 /include/ "serial.dtsi"
 /include/ "rtc.dtsi"
 /include/ "tsc_timer.dtsi"
+/include/ "coreboot_fb.dtsi"
 
 / {
model = "Intel Minnowboard Max";
diff --git a/configs/coreboot-x86_defconfig b/configs/coreboot-x86_defconfig
index 378d75f..b33c5c4 100644
--- a/configs/coreboot-x86_defconfig
+++ b/configs/coreboot-x86_defconfig
@@ -40,5 +40,7 @@ CONFIG_TPM_TIS_LPC=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_COREBOOT=y
 CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_TPM=y
diff --git a/doc/README.x86 b/doc/README.x86
index c34f455..6799559 100644
--- a/doc/README.x86
+++ b/doc/README.x86
@@ -381,6 +381,10 @@ To enable video you must enable these options in coreboot:
- Set framebuffer graphics resolution (1280x1024 32k-color (1:5:5))
- Keep VESA framebuffer
 
+And include coreboot_fb.dtsi in your board's device tree source file, like:
+
+   /include/ "coreboot_fb.dtsi"
+
 At present it seems that for Minnowboard Max, coreboot does not pass through
 the video information correctly (it always says the resolution is 0x0). This
 works correctly for link though.
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 8a99d24..4a42417 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -37,7 +37,7 @@ obj-$(CONFIG_S6E63D6) += s6e63d6.o
 obj-$(CONFIG_LD9040) += ld9040.o
 obj-$(CONFIG_SED156X) += sed156x.o
 obj-$(CONFIG_VIDEO_BCM2835) += bcm2835.o
-obj-$(CONFIG_VIDEO_COREBOOT) += coreboot_fb.o
+obj-$(CONFIG_VIDEO_COREBOOT) += coreboot.o
 obj-$(CONFIG_VIDEO_CT69000) += ct69000.o videomodes.o
 obj-$(CONFIG_VIDEO_DA8XX) += da8xx-fb.o videomodes.o
 obj-$(CONFIG_VIDEO_IMX25LCDC) += imx25lcdc.o videomodes.o
diff --git a/include/configs/som-6896.h 

[U-Boot] [PATCH 07/11] dm: video: Add driver for coreboot framebuffer device

2016-10-09 Thread Bin Meng
This adds a DM driver for coreboot framebuffer device.

Signed-off-by: Bin Meng 
---

 drivers/video/Kconfig|  9 ++
 drivers/video/coreboot.c | 79 
 2 files changed, 88 insertions(+)
 create mode 100644 drivers/video/coreboot.c

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index fd26690..554a03f 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -101,6 +101,15 @@ config VIDCONSOLE_AS_LCD
  to update the environment, the breakage may be confusing for users.
  This option will be removed around the end of 2016.
 
+config VIDEO_COREBOOT
+   bool "Enable coreboot framebuffer driver support"
+   depends on X86 && SYS_COREBOOT
+   help
+ Turn on this option to enable a framebuffer driver when U-Boot is
+ loaded by coreboot where graphics device is configured by coreboot
+ already. This can in principle be used with any platform that
+ coreboot supports.
+
 config VIDEO_VESA
bool "Enable VESA video driver support"
default n
diff --git a/drivers/video/coreboot.c b/drivers/video/coreboot.c
new file mode 100644
index 000..3a94aa1
--- /dev/null
+++ b/drivers/video/coreboot.c
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2016, Bin Meng 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static int save_vesa_mode(struct cb_framebuffer *fb,
+ struct vesa_mode_info *vesa)
+{
+   /*
+* If there is no framebuffer structure, bail out and keep
+* running on the serial console.
+*/
+   if (!fb)
+   return -ENXIO;
+
+   vesa->x_resolution = fb->x_resolution;
+   vesa->y_resolution = fb->y_resolution;
+   vesa->bits_per_pixel = fb->bits_per_pixel;
+   vesa->bytes_per_scanline = fb->bytes_per_line;
+   vesa->phys_base_ptr = fb->physical_address;
+   vesa->red_mask_size = fb->red_mask_size;
+   vesa->red_mask_pos = fb->red_mask_pos;
+   vesa->green_mask_size = fb->green_mask_size;
+   vesa->green_mask_pos = fb->green_mask_pos;
+   vesa->blue_mask_size = fb->blue_mask_size;
+   vesa->blue_mask_pos = fb->blue_mask_pos;
+   vesa->reserved_mask_size = fb->reserved_mask_size;
+   vesa->reserved_mask_pos = fb->reserved_mask_pos;
+
+   return 0;
+}
+
+static int coreboot_video_probe(struct udevice *dev)
+{
+   struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+   struct video_priv *uc_priv = dev_get_uclass_priv(dev);
+   struct cb_framebuffer *fb = lib_sysinfo.framebuffer;
+   struct vesa_mode_info *vesa = _info.vesa;
+   int ret;
+
+   printf("Video: ");
+
+   /* Initialize vesa_mode_info structure */
+   ret = save_vesa_mode(fb, vesa);
+   if (ret)
+   goto err;
+
+   ret = vbe_setup_video_priv(vesa, uc_priv, plat);
+   if (ret)
+   goto err;
+
+   printf("%dx%dx%d\n", uc_priv->xsize, uc_priv->ysize,
+  vesa->bits_per_pixel);
+
+   return 0;
+
+err:
+   printf("No video mode configured in coreboot!\n");
+   return ret;
+}
+
+static const struct udevice_id coreboot_video_ids[] = {
+   { .compatible = "coreboot-fb" },
+   { }
+};
+
+U_BOOT_DRIVER(coreboot_video) = {
+   .name   = "coreboot_video",
+   .id = UCLASS_VIDEO,
+   .of_match = coreboot_video_ids,
+   .probe  = coreboot_video_probe,
+};
-- 
2.9.2

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


[U-Boot] [PATCH 08/11] dm: video: Don't do anything in alloc_fb() when plat->size is zero

2016-10-09 Thread Bin Meng
With DM VESA driver on x86 boards, plat->base/size/align are all
zeroes and starting address passed to alloc_fb() happens to be 1MB
aligned, so this routine does not trigger any issue. On QEMU with
U-Boot as coreboot payload, the starting address is within 1MB
range (eg: 0x7fb), thus causes failure in video_post_bind().

Actually if plat->size is zero, it makes no sense to do anything
in this routine. Add such check there.

Signed-off-by: Bin Meng 
---

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

diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index b6dd0f5..11ca793 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -54,6 +54,9 @@ static ulong alloc_fb(struct udevice *dev, ulong *addrp)
struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
ulong base, align, size;
 
+   if (!plat->size)
+   return 0;
+
align = plat->align ? plat->align : 1 << 20;
base = *addrp - plat->size;
base &= ~(align - 1);
-- 
2.9.2

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


[U-Boot] [PATCH 03/11] dm: video: Output verbose information in vbe_setup_video()

2016-10-09 Thread Bin Meng
With DM conversion, information like "Video: 1024x768x16" is not
shown anymore. Now add these verbose output back.

Signed-off-by: Bin Meng 
---

 drivers/pci/pci_rom.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c
index 21ed17c..5746c3d 100644
--- a/drivers/pci/pci_rom.c
+++ b/drivers/pci/pci_rom.c
@@ -382,9 +382,13 @@ int vbe_setup_video(struct udevice *dev, int 
(*int15_handler)(void))
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
int ret;
 
+   printf("Video: ");
+
/* If we are running from EFI or coreboot, this can't work */
-   if (!ll_boot_init())
+   if (!ll_boot_init()) {
+   printf("Not available (previous bootloader prevents it)\n");
return -EPERM;
+   }
bootstage_start(BOOTSTAGE_ID_ACCUM_LCD, "vesa display");
ret = dm_pci_run_vga_bios(dev, int15_handler, PCI_ROM_USE_NATIVE |
PCI_ROM_ALLOW_FALLBACK);
@@ -400,6 +404,9 @@ int vbe_setup_video(struct udevice *dev, int 
(*int15_handler)(void))
return ret;
}
 
+   printf("%dx%dx%d\n", uc_priv->xsize, uc_priv->ysize,
+  mode_info.vesa.bits_per_pixel);
+
return 0;
 }
 #endif
-- 
2.9.2

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


[U-Boot] [PATCH 05/11] x86: doc: Correct qfw command example

2016-10-09 Thread Bin Meng
The kernel load address for zboot should be 0x100.

Signed-off-by: Bin Meng 
---

 doc/README.x86 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/README.x86 b/doc/README.x86
index 437dc29..c34f455 100644
--- a/doc/README.x86
+++ b/doc/README.x86
@@ -449,7 +449,7 @@ loading kernel to address 0100 size 5d9d30 initrd 
0400 size 1b1ab50
 Here the kernel (bzImage) is loaded to 0100 and initrd is to 0400. 
Then,
 'zboot' can be used to boot the kernel:
 
-=> zboot 0200 - 0400 1b1ab50
+=> zboot 0100 - 0400 1b1ab50
 
 CPU Microcode
 -
-- 
2.9.2

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


[U-Boot] [PATCH 04/11] x86: Convert to use DM VESA video driver

2016-10-09 Thread Bin Meng
At present only chromebook boards are converted to DM video. Other
x86 boards are still using the legacy cfb_console driver. This
switches to use DM version drivers.

Signed-off-by: Bin Meng 
---

 configs/bayleybay_defconfig | 1 +
 configs/chromebox_panther_defconfig | 1 +
 configs/conga-qeval20-qa3-e3845-internal-uart_defconfig | 1 +
 configs/conga-qeval20-qa3-e3845_defconfig   | 1 +
 configs/crownbay_defconfig  | 1 +
 configs/dfi-bt700-q7x-151_defconfig | 1 +
 configs/minnowmax_defconfig | 1 +
 configs/qemu-x86_defconfig  | 1 +
 configs/qemu-x86_efi_payload32_defconfig| 1 +
 configs/qemu-x86_efi_payload64_defconfig| 1 +
 configs/som-db5800-som-6867_defconfig   | 1 +
 configs/theadorable-x86-dfi-bt700_defconfig | 1 +
 drivers/video/Makefile  | 2 +-
 include/configs/bayleybay.h | 6 +++---
 include/configs/crownbay.h  | 4 ++--
 include/configs/minnowmax.h | 6 +++---
 include/configs/qemu-x86.h  | 4 ++--
 include/configs/som-db5800-som-6867.h   | 6 +++---
 18 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/configs/bayleybay_defconfig b/configs/bayleybay_defconfig
index 64e3d31..f8f5f5c 100644
--- a/configs/bayleybay_defconfig
+++ b/configs/bayleybay_defconfig
@@ -53,6 +53,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
diff --git a/configs/chromebox_panther_defconfig 
b/configs/chromebox_panther_defconfig
index 2557d35..6df4d4c 100644
--- a/configs/chromebox_panther_defconfig
+++ b/configs/chromebox_panther_defconfig
@@ -49,6 +49,7 @@ CONFIG_TPM_TIS_LPC=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
diff --git a/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig 
b/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig
index f0da176..6bee9c6 100644
--- a/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig
+++ b/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig
@@ -61,6 +61,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_114=y
diff --git a/configs/conga-qeval20-qa3-e3845_defconfig 
b/configs/conga-qeval20-qa3-e3845_defconfig
index 63c2cbd..76ff904 100644
--- a/configs/conga-qeval20-qa3-e3845_defconfig
+++ b/configs/conga-qeval20-qa3-e3845_defconfig
@@ -60,6 +60,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_114=y
diff --git a/configs/crownbay_defconfig b/configs/crownbay_defconfig
index d0cd9db..b37fce7 100644
--- a/configs/crownbay_defconfig
+++ b/configs/crownbay_defconfig
@@ -47,6 +47,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_USE_PRIVATE_LIBGCC=y
diff --git a/configs/dfi-bt700-q7x-151_defconfig 
b/configs/dfi-bt700-q7x-151_defconfig
index 245d0c7..3931896 100644
--- a/configs/dfi-bt700-q7x-151_defconfig
+++ b/configs/dfi-bt700-q7x-151_defconfig
@@ -58,6 +58,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_114=y
diff --git a/configs/minnowmax_defconfig b/configs/minnowmax_defconfig
index 3d3a30d..1446ab6 100644
--- a/configs/minnowmax_defconfig
+++ b/configs/minnowmax_defconfig
@@ -57,6 +57,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
diff --git a/configs/qemu-x86_defconfig b/configs/qemu-x86_defconfig
index 769adf6..4cf0866 100644
--- a/configs/qemu-x86_defconfig
+++ b/configs/qemu-x86_defconfig
@@ -44,6 +44,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_111=y
diff --git a/configs/qemu-x86_efi_payload32_defconfig 
b/configs/qemu-x86_efi_payload32_defconfig
index 75e7203..fd6afb8 100644
--- a/configs/qemu-x86_efi_payload32_defconfig
+++ b/configs/qemu-x86_efi_payload32_defconfig
@@ -41,6 +41,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 

[U-Boot] [PATCH 00/11] x86: dm: video: Convert to use DM video drivers on all x86 boards

2016-10-09 Thread Bin Meng
This adds two new DM video drivers, one for VESA compatible device,
the other one for coreboot framebuffer device. All x86 boards have
been converted to use the new drivers.

Tested on Intel Crown Bay using an external graphics card, on QEMU
using the on-board VGA with DM VESA driver.
Tested on QEMU using the on-board VGA with DM coreboot framebuffer
driver, U-Boot as coreboot payload.

This series is available at u-boot-x86/video-working.


Bin Meng (11):
  x86: doc: Document coreboot framebuffer driver issue on QEMU
  dm: video: Add driver for VESA compatible device
  dm: video: Output verbose information in vbe_setup_video()
  x86: Convert to use DM VESA video driver
  x86: doc: Correct qfw command example
  vbe: Make vbe_setup_video_priv() public
  dm: video: Add driver for coreboot framebuffer device
  dm: video: Don't do anything in alloc_fb() when plat->size is zero
  x86: coreboot: Convert to use DM coreboot video driver
  video: Remove legacy VESA and coreboot framebuffer drivers
  x86: Clean up unused macros in the configuration headers

 arch/x86/cpu/coreboot/Kconfig  |   4 -
 arch/x86/dts/bayleybay.dts |   1 +
 arch/x86/dts/broadwell_som-6896.dts|   1 +
 arch/x86/dts/chromebook_link.dts   |   1 +
 arch/x86/dts/chromebook_samus.dts  |   1 +
 arch/x86/dts/chromebox_panther.dts |   1 +
 arch/x86/dts/coreboot_fb.dtsi  |   5 +
 arch/x86/dts/minnowmax.dts |   1 +
 configs/bayleybay_defconfig|   1 +
 configs/chromebox_panther_defconfig|   1 +
 ...conga-qeval20-qa3-e3845-internal-uart_defconfig |   1 +
 configs/conga-qeval20-qa3-e3845_defconfig  |   1 +
 configs/coreboot-x86_defconfig |   2 +
 configs/crownbay_defconfig |   1 +
 configs/dfi-bt700-q7x-151_defconfig|   1 +
 configs/minnowmax_defconfig|   1 +
 configs/qemu-x86_defconfig |   1 +
 configs/qemu-x86_efi_payload32_defconfig   |   1 +
 configs/qemu-x86_efi_payload64_defconfig   |   1 +
 configs/som-db5800-som-6867_defconfig  |   1 +
 configs/theadorable-x86-dfi-bt700_defconfig|   1 +
 doc/README.x86 |   9 +-
 drivers/pci/pci_rom.c  |  15 ++-
 drivers/video/Kconfig  |   9 ++
 drivers/video/Makefile |   4 +-
 drivers/video/coreboot.c   |  79 +++
 drivers/video/coreboot_fb.c| 108 -
 drivers/video/vesa.c   |  34 +++
 drivers/video/vesa_fb.c|  63 
 drivers/video/video-uclass.c   |   3 +
 include/configs/bayleybay.h|   6 +-
 include/configs/cougarcanyon2.h|   4 -
 include/configs/crownbay.h |   4 +-
 include/configs/efi-x86.h  |   2 -
 include/configs/galileo.h  |   4 -
 include/configs/minnowmax.h|   6 +-
 include/configs/qemu-x86.h |   4 +-
 include/configs/som-6896.h |   6 +-
 include/configs/som-db5800-som-6867.h  |   6 +-
 include/configs/x86-chromebook.h   |  12 +--
 include/configs/x86-common.h   |   7 --
 include/vbe.h  |   4 +
 42 files changed, 194 insertions(+), 224 deletions(-)
 create mode 100644 arch/x86/dts/coreboot_fb.dtsi
 create mode 100644 drivers/video/coreboot.c
 delete mode 100644 drivers/video/coreboot_fb.c
 create mode 100644 drivers/video/vesa.c
 delete mode 100644 drivers/video/vesa_fb.c

-- 
2.9.2

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


[U-Boot] [PATCH 06/11] vbe: Make vbe_setup_video_priv() public

2016-10-09 Thread Bin Meng
vbe_setup_video_priv() might be useful to other drivers.

Signed-off-by: Bin Meng 
---

 drivers/pci/pci_rom.c | 6 +++---
 include/vbe.h | 4 
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c
index 5746c3d..cd083f7 100644
--- a/drivers/pci/pci_rom.c
+++ b/drivers/pci/pci_rom.c
@@ -351,9 +351,9 @@ err:
 }
 
 #ifdef CONFIG_DM_VIDEO
-static int vbe_setup_video_priv(struct vesa_mode_info *vesa,
-   struct video_priv *uc_priv,
-   struct video_uc_platdata *plat)
+int vbe_setup_video_priv(struct vesa_mode_info *vesa,
+struct video_priv *uc_priv,
+struct video_uc_platdata *plat)
 {
if (!vesa->x_resolution)
return -ENXIO;
diff --git a/include/vbe.h b/include/vbe.h
index a743892..16bb096 100644
--- a/include/vbe.h
+++ b/include/vbe.h
@@ -107,6 +107,10 @@ extern struct vbe_mode_info mode_info;
 struct graphic_device;
 int vbe_get_video_info(struct graphic_device *gdev);
 struct video_priv;
+struct video_uc_platdata;
+int vbe_setup_video_priv(struct vesa_mode_info *vesa,
+struct video_priv *uc_priv,
+struct video_uc_platdata *plat);
 int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void));
 
 #endif
-- 
2.9.2

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


[U-Boot] [PATCH 01/11] x86: doc: Document coreboot framebuffer driver issue on QEMU

2016-10-09 Thread Bin Meng
For some unknown reason, coreboot framebuffer driver never works on
QEMU since day 1. It seems the driver only works on real hardware.
Document this issue.

Signed-off-by: Bin Meng 
---

 doc/README.x86 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/doc/README.x86 b/doc/README.x86
index ba5bb99..437dc29 100644
--- a/doc/README.x86
+++ b/doc/README.x86
@@ -385,6 +385,9 @@ At present it seems that for Minnowboard Max, coreboot does 
not pass through
 the video information correctly (it always says the resolution is 0x0). This
 works correctly for link though.
 
+Note: coreboot framebuffer driver does not work on QEMU. The reason is unknown
+at this point. Patches are welcome if you figure out anything wrong.
+
 Test with QEMU for bare mode
 
 QEMU is a fancy emulator that can enable us to test U-Boot without access to
-- 
2.9.2

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


[U-Boot] [PATCH 02/11] dm: video: Add driver for VESA compatible device

2016-10-09 Thread Bin Meng
This adds a DM driver for VESA compatible device.

Signed-off-by: Bin Meng 
---

 drivers/video/vesa.c | 34 ++
 1 file changed, 34 insertions(+)
 create mode 100644 drivers/video/vesa.c

diff --git a/drivers/video/vesa.c b/drivers/video/vesa.c
new file mode 100644
index 000..ddf8df8
--- /dev/null
+++ b/drivers/video/vesa.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2016, Bin Meng 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+static int vesa_video_probe(struct udevice *dev)
+{
+   return vbe_setup_video(dev, NULL);
+}
+
+static const struct udevice_id vesa_video_ids[] = {
+   { .compatible = "vesa-fb" },
+   { }
+};
+
+U_BOOT_DRIVER(vesa_video) = {
+   .name   = "vesa_video",
+   .id = UCLASS_VIDEO,
+   .of_match = vesa_video_ids,
+   .probe  = vesa_video_probe,
+};
+
+static struct pci_device_id vesa_video_supported[] = {
+   { PCI_DEVICE_CLASS(PCI_CLASS_DISPLAY_VGA << 8, ~0) },
+   { },
+};
+
+U_BOOT_PCI_DEVICE(vesa_video, vesa_video_supported);
-- 
2.9.2

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


[U-Boot] Please pull u-boot-marvell/master

2016-10-09 Thread Stefan Roese
Hi Tom,

please pull the DS109 board support. Its an updated version - the
original patches have been sent to the list quite some time ago.

Thanks,
Stefan

The following changes since commit f5fd45ff64e28a73499548358e3d1ceda0de7daf:

  Merge branch 'master' of git://www.denx.de/git/u-boot-imx (2016-10-08 
09:33:37 -0400)

are available in the git repository at:

  git://www.denx.de/git/u-boot-marvell.git 

for you to fetch changes up to 1c653201d7de10b486266317200bfaa8bdb57700:

  arm: kirkwood: fix Synology board tag (2016-10-09 10:55:32 +0200)


Walter Schweizer (5):
  arm: kirkwood: add support for Synology DS109 board
  arm: kirkwood: ds109 board is maintained
  arm: kirkwood: fix kirkwood initial setup
  arm: kirkwood: fix output enable settings
  arm: kirkwood: fix Synology board tag

 arch/arm/mach-kirkwood/Kconfig|   4 +
 board/Synology/ds109/Kconfig  |  12 +++
 board/Synology/ds109/MAINTAINERS  |   6 ++
 board/Synology/ds109/Makefile |   9 ++
 board/Synology/ds109/ds109.c  | 176 ++
 board/Synology/ds109/ds109.h  |  44 ++
 board/Synology/ds109/kwbimage.cfg | 152 
 board/Synology/ds109/openocd.cfg  | 115 +
 configs/ds109_defconfig   |  16 
 include/configs/ds109.h   | 103 ++
 10 files changed, 637 insertions(+)
 create mode 100644 board/Synology/ds109/Kconfig
 create mode 100644 board/Synology/ds109/MAINTAINERS
 create mode 100644 board/Synology/ds109/Makefile
 create mode 100644 board/Synology/ds109/ds109.c
 create mode 100644 board/Synology/ds109/ds109.h
 create mode 100644 board/Synology/ds109/kwbimage.cfg
 create mode 100644 board/Synology/ds109/openocd.cfg
 create mode 100644 configs/ds109_defconfig
 create mode 100644 include/configs/ds109.h
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/5] arm: kirkwood: add support for Synology DS109 board

2016-10-09 Thread Stefan Roese

On 06.10.2016 23:29, Walter Schweizer wrote:

Synology DS109 is based on MV88F6281. The code
is based on Dreamplug code with modificatons
from Synologys open source repository.

Signed-off-by: Walter Schweizer 


All 5 patches applied to u-boot-marvell/master.

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


Re: [U-Boot] [PATCH v2] ARMv7: LS102xA: Move two macros from header files to Kconfig

2016-10-09 Thread york sun
On 09/21/2016 03:31 AM, macro.wav...@gmail.com wrote:
> From: Hongbo Zhang 
>
> Following commits 217f92b and 1544698, these two config CPU_V7_HAS_NONSEC
> and CPU_V7_HAS_VIRT are moved to Kconfig, for correctly select ARMV7_PSCI.
>
> Signed-off-by: Hongbo Zhang 
> ---


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH] armv8/fsl-layerscape: print SoC revsion number

2016-10-09 Thread york sun
On 09/13/2016 01:25 AM, Wenbin song wrote:
> The exact SoC revsion number can be recognized from U-Boot log.
>
> Signed-off-by: Wenbin Song 
> Signed-off-by: Mingkai Hu 
> ---


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH v2 1/3] armv8: LS2080A: Add device tree support for nand boot

2016-10-09 Thread york sun
On 10/07/2016 01:37 AM, Sriram Dash wrote:
> Add device tree support for LS2080ARDB nand boot.
>
> Signed-off-by: Sriram Dash 
> ---
>  configs/ls2080ardb_nand_defconfig | 2 ++
>  1 file changed, 2 insertions(+)
>


This set is applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH v4 0/2] ARM: add support for Bananapi BPI-R1

2016-10-09 Thread Jagan Teki
On Fri, Oct 7, 2016 at 10:13 AM, Stephen Arnold
 wrote:
> From: Steve Arnold 
>
> * changes from lamobo-r1 required include:
>   - unset ahci power pin
>   - usbvbus gpio pin change
>   - mmc cd gpio pin change
>   - enable uart2, set default LED trigger
>   - CONFIG_GMAC_TX_DELAY change
>
> Changes for v2:
>   - incorprated feedback for config options (remove 3, add 1)
> Changes for v3/v4:
>   - re-submit (no change to patch payload) with cover
>
> Steve Arnold (2):
>   ARM: sun7i: config: add config for Sinovoip/Bananapi BPI-R1
>   ARM: sun7i: dts: add support for Sinovoip/Bananapi BPI-R1

Some how I lost the previous discussion about this thread, but please
combine these two patches into one otherwise patch one get bisect-able
issue.

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


Re: [U-Boot] [PATCH v2] spi: fsl_qspi: Preserve endianness of QSPI MCR

2016-10-09 Thread Jagan Teki
On Sat, Oct 8, 2016 at 10:51 PM, york sun  wrote:
> On 10/06/2016 02:38 PM, York Sun wrote:
>> The endianness can be changed by RCW + PBI sequence. It may have
>> other than power on reset value.
>>
>> Signed-off-by: York Sun 
>> CC: Yuan Yao 
>> CC: Peng Fan 
>> CC: Alison Wang 
>> ---
>> Change log
>>  v2: Fix variable name in spi_setup_slave
>>
>
>
> Applied to fsl-qoriq master, awaiting upstream.

Some how my reviewed-by tag on previous version missed here :)

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


Re: [U-Boot] [PATCH v2 1/8] arm: Fix Kconfig for proper display menu

2016-10-09 Thread york sun
On 10/04/2016 02:32 PM, york sun wrote:
> Some config options should not have prompt. They are selected by choosing
> target.
>
> Signed-off-by: York Sun 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2: None
>

This set is applied to fsl-qoriq master, awaiting upstream.

York

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


[U-Boot] Please pull fsl-qoriq master

2016-10-09 Thread york sun
Tom,

The following changes since commit 53fec162061811a73c7dab3207f8fdb2343ae289:

   Prepare v2016.11-rc1 (2016-10-03 09:28:13 -0400)

are available in the git repository at:

   git://git.denx.de/u-boot-fsl-qoriq.git

for you to fetch changes up to 76379dfb7e7e5092f32c79897bb58c19979e576b:

   board: ls1012afrdm: overwrite CONFIG_EXTRA_ENV_SETTINGS (2016-10-07 
11:34:24 -0700)


Hongbo Zhang (1):
   ARMv7: LS102xA: Move two macros from header files to Kconfig

Hou Zhiqiang (1):
   armv8/fsl-lsch2: Implement workaround for PIN MUX erratum A010539

Pratiyush Srivastava (2):
   armv8: ls1012a: Updating CONFIG_EXTRA_ENV_SETTINGS
   board: ls1012afrdm: overwrite CONFIG_EXTRA_ENV_SETTINGS

Sriram Dash (6):
   armv8: ls1043: Enable CONFIG_DM_USB in defconfigs
   armv8: ls1043: Add USB node in dts for ls1043
   armv8: fsl: Enable USB only when SYSCLK is 100 MHz
   armv8: LS2080A: Add device tree support for nand boot
   armv8: ls2080: Enable CONFIG_DM_USB in defconfigs
   armv8: ls2080a: Add USB node in dts for ls2080a

Sumit Garg (2):
   fsl_sec_mon: Update driver for Security Monitor
   fsl_sfp : Modify macros as per changes in SFP v3.4

Tang Yuantian (2):
   armv8: fsl-lsch2: adjust sata parameter
   armv8: fsl-lsch2: enable snoopable sata read and write

Wenbin Song (1):
   armv8/fsl-layerscape: print SoC revsion number

Xiaoliang Yang (1):
   armv7: LS1021a: enable i-cache in start.S

York Sun (10):
   armv8: fsl-layerscape: Fix "cpu status" command
   arm: Fix Kconfig for proper display menu
   arm: Move FSL_LSCH2 FSL_LSCH3 to Kconfig
   arm: Move MAX_CPUS to Kconfig
   arm: Move SYS_FSL_IFC_BANK_COUNT to Kconfig
   arm: Move FSL_HAS_DP_DDR and NUM_DDR_CONTROLLERS to Kconfig
   arm: Move SYS_FSL_SRDS_* and SYS_HAS_SERDES to Kconfig
   armv8: fsl-layerscape: Move DDR config options to Kconfig
   armv7: ls1021a: Move DDR config options to Kconfig
   spi: fsl_qspi: Preserve endianness of QSPI MCR

  arch/arm/Kconfig   |   8 +
  arch/arm/cpu/armv7/Makefile|   2 +-
  arch/arm/cpu/armv7/ls102xa/Kconfig |  87 +++-
  arch/arm/cpu/armv7/ls102xa/soc.c   |   4 +
  arch/arm/cpu/armv8/fsl-layerscape/Kconfig  | 129 ++-
  arch/arm/cpu/armv8/fsl-layerscape/cpu.c|  24 +++
  arch/arm/cpu/armv8/fsl-layerscape/fdt.c|  20 ++
  arch/arm/cpu/armv8/fsl-layerscape/mp.c |  16 +-
  arch/arm/cpu/armv8/fsl-layerscape/soc.c|  21 +-
  arch/arm/dts/fsl-ls1043a.dtsi  |  21 ++
  arch/arm/dts/fsl-ls2080a.dtsi  |  14 ++
  arch/arm/include/asm/arch-fsl-layerscape/config.h  |  29 ---
  .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |   4 +
  arch/arm/include/asm/arch-fsl-layerscape/mp.h  |   1 +
  arch/arm/include/asm/arch-fsl-layerscape/soc.h |   3 +-
  arch/arm/include/asm/arch-ls102xa/config.h |  13 --
  board/freescale/common/fsl_validate.c  |  52 ++---
  board/freescale/ls1021aqds/README  |   6 +
  board/freescale/ls1021atwr/README  |   6 +
  configs/ls1021aqds_ddr4_nor_defconfig  |   2 +-
  configs/ls1021aqds_ddr4_nor_lpuart_defconfig   |   3 +-
  configs/ls1021aqds_nand_defconfig  |   1 +
  configs/ls1021aqds_nor_SECURE_BOOT_defconfig   |   1 +
  configs/ls1021aqds_nor_defconfig   |   1 +
  configs/ls1021aqds_nor_lpuart_defconfig|   1 +
  configs/ls1021aqds_qspi_defconfig  |   1 +
  configs/ls1021aqds_sdcard_ifc_defconfig|   1 +
  configs/ls1021aqds_sdcard_qspi_defconfig   |   1 +
  configs/ls1043aqds_defconfig   |   3 +-
  configs/ls1043aqds_lpuart_defconfig|   4 +-
  configs/ls1043aqds_nand_defconfig  |   4 +-
  configs/ls1043aqds_nor_ddr3_defconfig  |   2 +
  configs/ls1043aqds_qspi_defconfig  |   4 +-
  configs/ls1043aqds_sdcard_ifc_defconfig|   4 +-
  configs/ls1043aqds_sdcard_qspi_defconfig   |   4 +-
  configs/ls1043ardb_SECURE_BOOT_defconfig   |   4 +-
  configs/ls1043ardb_defconfig   |   3 +-
  configs/ls1043ardb_nand_defconfig  |   4 +-
  configs/ls1043ardb_sdcard_defconfig|   4 +-
  configs/ls2080aqds_SECURE_BOOT_defconfig   |   1 +
  configs/ls2080aqds_defconfig   |   1 +
  configs/ls2080aqds_nand_defconfig  |   1 +
  configs/ls2080aqds_qspi_defconfig  |   1 +
  configs/ls2080ardb_SECURE_BOOT_defconfig   |   1 +
  configs/ls2080ardb_defconfig   |   1 +
  configs/ls2080ardb_nand_defconfig  |   4 +
  drivers/misc/fsl_sec_mon.c   

Re: [U-Boot] cros_ec: Honor the google,remote-bus dt property

2016-10-09 Thread Tom Rini
On Tue, Sep 27, 2016 at 03:42:07PM -0700, Moritz Fischer wrote:

> Boards where ECs that use a I2C port != 0 specify this in the
> devicetree file via the google,remote-bus property.
> Previously this was ignored and hardcoded to port 0.
> 
> Signed-off-by: Moritz Fischer 
> Cc: Simon Glass 
> Cc: Heiko Schocher 
> Cc: u-boot@lists.denx.de
> Acked-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] cmd: Make CMD_USB_MASS_STORAGE visible only with USB_GADGET and default y

2016-10-09 Thread Tom Rini
On Sat, Oct 08, 2016 at 01:06:26PM -0400, Tom Rini wrote:
> On Mon, Sep 19, 2016 at 12:40:12PM -0400, Tom Rini wrote:
> 
> > In order for CMD_USB_MASS_STORAGE to be useful we must have USB_GADGET
> > enabled, so only show this option when USB_GADGET is set.  In addition,
> > expand the help text so it's clearer what this does and given the
> > overall utility of this command, make it enabled by default.
> > 
> > Signed-off-by: Tom Rini 
> 
> Applied to u-boot/master, thanks!

No, no it's not.  This needs a bit more work as it exposes some
backend options that need to be migrated first, and it also needs to
depend on USB_GADGET_DOWNLOAD being set as we need to have the IDs set
and can't (well, shouldn't) force values there.  So this is really a
changes requested.

-- 
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] armv8: fsl: Enable USB only when SYSCLK is 100 MHz

2016-10-09 Thread york sun
On 10/03/2016 03:55 AM, Sriram Dash wrote:
> SYSCLK is used as a reference clock for USB. When the USB controller
> is used, SYSCLK must meet the additional requirement of 100 MHz.
>
> Signed-off-by: Sriram Dash 
> ---


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH 1/2] armv8: ls1043: Enable CONFIG_DM_USB in defconfigs

2016-10-09 Thread york sun
On 09/29/2016 10:37 PM, Sriram Dash wrote:
> Enables driver model flag CONFIG_DM_USB for LS1043A
> platform defconfigs.
>
> Signed-off-by: Sriram Dash 
> ---


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] dra7xx: config: cleanup: moved to kconfig for CONFIG_SPL_ENV_SUPPORT

2016-10-09 Thread Tom Rini
On Mon, Sep 26, 2016 at 06:20:33PM +0530, B, Ravi wrote:

> removing CONFIG_SPL_ENV_SUPPORT defined in header files
> due to moved to kconfig option for CONFIG_SPL_ENV_SUPPORT
> 
> Signed-off-by: Ravi Babu 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 2/2] armv8: ls1043: Add USB node in dts for ls1043

2016-10-09 Thread york sun
On 09/29/2016 10:37 PM, Sriram Dash wrote:
> Add the USB node for LS1043 in dts.
>
> Signed-off-by: Sriram Dash 
> ---


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH v2] fsl_sfp : Modify macros as per changes in SFP v3.4

2016-10-09 Thread york sun
On 09/06/2016 11:47 PM, Sumit Garg wrote:
> SFP v3.4 supports 8 keys in SRK table which leads to corresponding
> changes in OSPR key revocation field. So modify OSPR_KEY_REVOC_XXX
> macros accordingly.
>
> Signed-off-by: Sumit Garg 
> ---
>
> Changes in v2:
> Corrected commit message. Also removed whitspace changes in this patch.
>


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH 2/2] armv8: fsl-lsch2: enable snoopable sata read and write

2016-10-09 Thread york sun
On 08/08/2016 12:18 AM, yuantian.t...@nxp.com wrote:
> From: Tang Yuantian 
>
> By default the SATA IP on the ls1043a/ls1046a SoCs does not generating
> coherent/snoopable transactions.  This patch enable it in the SCFG_SNPCNFGCR
> register along with sata axicc register.
> In addition, the dma-coherent property must be set on the SATA controller
> nodes.
>
> Signed-off-by: Tang Yuantian 
> ---


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


[U-Boot] [PATCH] common: env: add kconfig entry for env storage

2016-10-09 Thread Peng Fan
Add Kconfig entry for ENV storage

Signed-off-by: Peng Fan 
Cc: Simon Glass 
Cc: Heiko Schocher 
Cc: Tom Rini 
Cc: Masahiro Yamada 
Cc: Stefan Roese 
Cc: Siva Durga Prasad Paladugu 
Cc: Francois Retief 
---
 common/Kconfig | 73 ++
 1 file changed, 73 insertions(+)

diff --git a/common/Kconfig b/common/Kconfig
index c69c141..a630924 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -158,6 +158,79 @@ config SPI_BOOT
 
 endmenu
 
+menu "ENV storage media"
+
+config ENV_IS_IN_DATAFLASH
+   bool "env stored in dataflash"
+   help
+ env stored in dataflash
+
+config ENV_IS_IN_EEPROM
+   bool "env stored in eeprom"
+   help
+ env stored in eeprom
+
+config ENV_IS_EMBEDDED
+   bool "env is embedded"
+   help
+ env is embedded
+
+config ENV_IS_IN_FLASH
+   bool "env stored in flash"
+   help
+ env stored in flash
+
+config ENV_IS_IN_MMC
+   bool "env stored in sd/mmc card"
+   help
+ env stored in sd/mmc card
+
+config ENV_IS_IN_NAND
+   bool "env stored in nand flash"
+   help
+ env stored in nand flash
+
+config ENV_IS_IN_NVRAM
+   bool "env stored in nvram"
+   help
+ env stored in nvram
+
+config ENV_IS_IN_ONENAND
+   bool "env stored in onenand"
+   help
+ env stored in onenand
+
+config ENV_IS_IN_SATA
+   bool "env stored in sata"
+   help
+ env stored in sata
+
+config ENV_IS_IN_SPI_FLASH
+   bool "env stored in spi flash"
+   help
+ env stored in spi flash
+
+config ENV_IS_IN_FAT
+   bool "env stored in a fat file"
+   help
+ env stored in a fat file
+
+config ENV_IS_IN_UBI
+   bool "env stored in a ubi file"
+   help
+ env stored in a ubi file
+
+config ENV_IS_IN_REMOTE
+   bool "env stored in remote"
+   help
+ env stored in remote
+
+config ENV_IS_NOWHERE
+   bool "env is nowhere"
+   help
+ env is nowhere
+endmenu
+
 config BOOTDELAY
int "delay in seconds before automatically booting"
default 2
-- 
2.6.2

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


Re: [U-Boot] arm: Add return value argument to longjmp

2016-10-09 Thread Tom Rini
On Tue, Sep 27, 2016 at 09:30:32AM +0200, Alexander Graf wrote:

> The normal longjmp command allows for a caller to pass the return value
> of the setjmp() invocation. This patch adds that semantic to the arm
> implementation of it and adjusts the efi_loader call respectively.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH V3 4/8] imx-common: inctroude USE_IMXIMG_PLUGIN Kconfig

2016-10-09 Thread Peng Fan
On Sun, Oct 09, 2016 at 07:45:41AM +0200, Eric Nelson wrote:
>Hi Peng,
>
>Note the typo in the subject header.

Thanks.

>
>On 10/08/2016 08:58 AM, Peng Fan wrote:
>> Introduce USE_IMXIMG_PLUGIN Kconfig
>> 
>> Signed-off-by: Peng Fan 
>> Cc: Stefano Babic 
>> Reviewed-by: Tom Rini 
>> ---
>> 
>> V3:
>>  None
>> 
>> V2:
>>  New
>> 
>>  arch/arm/imx-common/Kconfig | 7 +++
>>  1 file changed, 7 insertions(+)
>> 
>> diff --git a/arch/arm/imx-common/Kconfig b/arch/arm/imx-common/Kconfig
>> index 1b7da5a..85eac57 100644
>> --- a/arch/arm/imx-common/Kconfig
>> +++ b/arch/arm/imx-common/Kconfig
>> @@ -17,3 +17,10 @@ config IMX_BOOTAUX
>>  depends on ARCH_MX7 || ARCH_MX6
>>  help
>>bootaux [addr] to boot auxiliary core.
>> +
>> +config USE_IMXIMG_PLUGIN
>> +bool "Using imximage plugin code"
>
>s/Using/Use/

Will fix this in V4.

>
>> +depends on ARCH_MX7 || ARCH_MX6
>> +help
>> +  i.MX6/7 supports DCD and Plugin. Enable this configuration
>> +  to use Plugin, otherwise DCD will be used.
>> 
>
>MX5x also supports plugins, right?

Yeah. I do not have the hardware to test, so not add ARCH_MX5.
If later, someone can test ARCH_MX5, then he/she could add the support.

>
>Also, the alternative isn't really DCD is it? Most (all) of the boards
>using SPL now are using the essentially empty config file
>in arch/arm/imx-common/spl_sd.cfg.

The help msg is just to tell use plugin or DCD. spl_sd.cfg surely
can have DCD DATA lines or not :)

Regards,
Peng.
>
>
>___
>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] dra7x: dfu: qspi: increase the qspi spl partition to 256K

2016-10-09 Thread Tom Rini
On Mon, Sep 26, 2016 at 06:21:13PM +0530, B, Ravi wrote:

> The SPL size for dra7x platform increased beyond 64K,
> increasing the size to 256K to cater for future enhancement.
> 
> Signed-off-by: Ravi Babu 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate()

2016-10-09 Thread Tom Rini
On Mon, Sep 26, 2016 at 08:45:26PM +0900, Masahiro Yamada wrote:

> The KeyStone platform has its own clk_get_rate() but its prototype
> is different from that of the common-clk (clk-uclass) framework.
> 
> Prefix the KeyStone specific implementation with ks_ in order to
> avoid name-space conflict.
> 
> Signed-off-by: Masahiro Yamada 
> Reviewed-by: Simon Glass 
> Acked-by: Lokesh Vutla 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/5] kbuild: move no_new_adhoc_configs_check to "all" target command

2016-10-09 Thread Tom Rini
On Mon, Sep 26, 2016 at 01:04:59PM +0900, Masahiro Yamada wrote:

> I am going to move the build rule of u-boot.cfg.  Before that,
> no_new_adhoc_configs_check must be tweaked to not depend on it.
> 
> The ad-hoc option check can be done at the end of build, along
> with other checks.
> 
> Signed-off-by: Masahiro Yamada 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/2] board: ti: dra7xx: complex definitions should be protected with parentheses

2016-10-09 Thread Tom Rini
On Tue, Sep 27, 2016 at 01:01:42PM +0530, Mugunthan V N wrote:

> As a standard practice complex definitions should be protected
> with parentheses, as it might fail when used in a complex if
> statements.
> 
> Signed-off-by: Mugunthan V N 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] [PATCH V3 1/8] tools: imximage: add plugin support

2016-10-09 Thread Peng Fan
Add plugin support for imximage.

Define CONFIG_USE_IMXIMG_PLUGIN in defconfig to enable using plugin.

Signed-off-by: Peng Fan 
Cc: Stefano Babic 
Cc: Eric Nelson 
Cc: Ye Li 
Reviewed-by: Tom Rini 
---

V3:
 Fix compile error.

V2:
 Drop the CONFIG_USE_PLUGIN, make plugin always support in imximage.

 tools/imximage.c | 282 +++
 tools/imximage.h |   7 +-
 2 files changed, 229 insertions(+), 60 deletions(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index 092d550..7fa601e 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -27,6 +27,7 @@ static table_entry_t imximage_cmds[] = {
{CMD_CHECK_BITS_CLR,"CHECK_BITS_CLR",   "Reg Check bits clr", },
{CMD_CSF,   "CSF",   "Command Sequence File", },
{CMD_IMAGE_VERSION, "IMAGE_VERSION","image version",  },
+   {CMD_PLUGIN,"PLUGIN",   "file plugin_addr",  },
{-1,"", "",   },
 };
 
@@ -80,6 +81,9 @@ static uint32_t imximage_ivt_offset = UNDEFINED;
 static uint32_t imximage_csf_size = UNDEFINED;
 /* Initial Load Region Size */
 static uint32_t imximage_init_loadsize;
+static uint32_t imximage_iram_free_start;
+static uint32_t imximage_plugin_size;
+static uint32_t plugin_image;
 
 static set_dcd_val_t set_dcd_val;
 static set_dcd_param_t set_dcd_param;
@@ -118,7 +122,11 @@ static uint32_t detect_imximage_version(struct imx_header 
*imx_hdr)
 
/* Try to detect V2 */
if ((fhdr_v2->header.tag == IVT_HEADER_TAG) &&
-   (hdr_v2->dcd_table.header.tag == DCD_HEADER_TAG))
+   (hdr_v2->data.dcd_table.header.tag == DCD_HEADER_TAG))
+   return IMXIMAGE_V2;
+
+   if ((fhdr_v2->header.tag == IVT_HEADER_TAG) &&
+   hdr_v2->boot_data.plugin)
return IMXIMAGE_V2;
 
return IMXIMAGE_VER_INVALID;
@@ -165,7 +173,7 @@ static struct dcd_v2_cmd *gd_last_cmd;
 static void set_dcd_param_v2(struct imx_header *imxhdr, uint32_t dcd_len,
int32_t cmd)
 {
-   dcd_v2_t *dcd_v2 = >header.hdr_v2.dcd_table;
+   dcd_v2_t *dcd_v2 = >header.hdr_v2.data.dcd_table;
struct dcd_v2_cmd *d = gd_last_cmd;
struct dcd_v2_cmd *d2;
int len;
@@ -261,21 +269,23 @@ static void set_dcd_rst_v1(struct imx_header *imxhdr, 
uint32_t dcd_len,
 static void set_dcd_rst_v2(struct imx_header *imxhdr, uint32_t dcd_len,
char *name, int lineno)
 {
-   dcd_v2_t *dcd_v2 = >header.hdr_v2.dcd_table;
-   struct dcd_v2_cmd *d = gd_last_cmd;
-   int len;
-
-   if (!d)
-   d = _v2->dcd_cmd;
-   len = be16_to_cpu(d->write_dcd_command.length);
-   if (len > 4)
-   d = (struct dcd_v2_cmd *)(((char *)d) + len);
-
-   len = (char *)d - (char *)_v2->header;
-
-   dcd_v2->header.tag = DCD_HEADER_TAG;
-   dcd_v2->header.length = cpu_to_be16(len);
-   dcd_v2->header.version = DCD_VERSION;
+   if (!imxhdr->header.hdr_v2.boot_data.plugin) {
+   dcd_v2_t *dcd_v2 = >header.hdr_v2.data.dcd_table;
+   struct dcd_v2_cmd *d = gd_last_cmd;
+   int len;
+
+   if (!d)
+   d = _v2->dcd_cmd;
+   len = be16_to_cpu(d->write_dcd_command.length);
+   if (len > 4)
+   d = (struct dcd_v2_cmd *)(((char *)d) + len);
+
+   len = (char *)d - (char *)_v2->header;
+
+   dcd_v2->header.tag = DCD_HEADER_TAG;
+   dcd_v2->header.length = cpu_to_be16(len);
+   dcd_v2->header.version = DCD_VERSION;
+   }
 }
 
 static void set_imx_hdr_v1(struct imx_header *imxhdr, uint32_t dcd_len,
@@ -317,24 +327,93 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, 
uint32_t dcd_len,
fhdr_v2->header.length = cpu_to_be16(sizeof(flash_header_v2_t));
fhdr_v2->header.version = IVT_VERSION; /* 0x40 */
 
-   fhdr_v2->entry = entry_point;
-   fhdr_v2->reserved1 = fhdr_v2->reserved2 = 0;
-   hdr_base = entry_point - imximage_init_loadsize +
-   flash_offset;
-   fhdr_v2->self = hdr_base;
-   if (dcd_len > 0)
-   fhdr_v2->dcd_ptr = hdr_base
-   + offsetof(imx_header_v2_t, dcd_table);
-   else
+   if (!hdr_v2->boot_data.plugin) {
+   fhdr_v2->entry = entry_point;
+   fhdr_v2->reserved1 = 0;
+   fhdr_v2->reserved1 = 0;
+   hdr_base = entry_point - imximage_init_loadsize +
+   flash_offset;
+   fhdr_v2->self = hdr_base;
+   if (dcd_len > 0)
+   fhdr_v2->dcd_ptr = hdr_base +
+   offsetof(imx_header_v2_t, data);
+   else
+   fhdr_v2->dcd_ptr = 0;
+   

Re: [U-Boot] [U-Boot, 3/3] Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure"

2016-10-09 Thread Tom Rini
On Mon, Sep 26, 2016 at 08:45:27PM +0900, Masahiro Yamada wrote:

> This reverts commit 82f5279b0cd99a9163d34cfe926d0316d9dc0d37.
> 
> The build failure of k2*evm boards was fixed in a different way by
> the previous commit.  It is nasty to patch generic drivers around
> with #ifdef CONFIG_CLK just for the KeyStone's matter.
> 
> Signed-off-by: Masahiro Yamada 
> Reviewed-by: Simon Glass 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH V3 1/8] tools: imximage: add plugin support

2016-10-09 Thread Peng Fan
Hi Eric,
On Sun, Oct 09, 2016 at 07:42:34AM +0200, Eric Nelson wrote:
>Hi Peng,
>
>On 10/09/2016 04:20 AM, Peng Fan wrote:
>> On Sat, Oct 08, 2016 at 05:26:18PM +0200, Eric Nelson wrote:
>>> On 10/08/2016 08:58 AM, Peng Fan wrote:
>
>
>
>>>
>>>From what I can tell, there's no reason that you can't have multiple
>>> plugins, and the use of these variables isn't really needed.
>> 
>> I try to follow, are you talking about chained plugin images?
>> Now we only support two IVT headers when using plugin.
>> The first IVT header is for the plugin image, the second ivt header is for
>> uboot image.
>> 
>
>I understand, though the API seems to allow it (chained plugins)
>and I have a suspicion that the code would be cleaner without
>the union.
>
>That said, I don't have a use case in mind.
>
>>>
 +static uint32_t imximage_iram_free_start;
 +static uint32_t imximage_plugin_size;
 +static uint32_t plugin_image;
  
  static set_dcd_val_t set_dcd_val;
  static set_dcd_param_t set_dcd_param;
 @@ -118,7 +122,11 @@ static uint32_t detect_imximage_version(struct 
 imx_header *imx_hdr)
  
/* Try to detect V2 */
if ((fhdr_v2->header.tag == IVT_HEADER_TAG) &&
 -  (hdr_v2->dcd_table.header.tag == DCD_HEADER_TAG))
 +  (hdr_v2->data.dcd_table.header.tag == DCD_HEADER_TAG))
 +  return IMXIMAGE_V2;
 +
 +  if ((fhdr_v2->header.tag == IVT_HEADER_TAG) &&
 +  hdr_v2->boot_data.plugin)
return IMXIMAGE_V2;
  
return IMXIMAGE_VER_INVALID;
 @@ -165,7 +173,7 @@ static struct dcd_v2_cmd *gd_last_cmd;
  static void set_dcd_param_v2(struct imx_header *imxhdr, uint32_t dcd_len,
int32_t cmd)
  {
>>>
>>> I also don't understand why the choice to make the union
>>> with either a DCD table or a plugin.
>> 
>> Confirmed with ROM team. DCD and plugin are exclusive,
>> 
>> You can not have both at the same time.
>>
>
>That's too bad, since porting from DCD-style to SPL can be
>useful (as Fabio has seen trying to keep some boards up-to-date).

I saw the patches.
If using plugin, there is no need to use DCD.

all the things in DCD can be done in plugin code.

>
>If we get SPL-as-plugin working, then this would form a
>dividing line where you need to get rid of the DCD altogether.
>
>What about the CSF test? Your patches say that CSF and plugins
>are also not supported.

CSF is supported  and code in nxp community. But that piece code is not included
in the nxp released uboot.

https://community.nxp.com/docs/DOC-332725

>
>>>
>>> We should be able to have both, and this doesn't make
>>> the code any easier.
>>>
 -  dcd_v2_t *dcd_v2 = >header.hdr_v2.dcd_table;
 +  dcd_v2_t *dcd_v2 = >header.hdr_v2.data.dcd_table;
struct dcd_v2_cmd *d = gd_last_cmd;
struct dcd_v2_cmd *d2;
int len;
 @@ -261,21 +269,23 @@ static void set_dcd_rst_v1(struct imx_header 
 *imxhdr, uint32_t dcd_len,
  static void set_dcd_rst_v2(struct imx_header *imxhdr, uint32_t dcd_len,
char *name, int lineno)
  {
 -  dcd_v2_t *dcd_v2 = >header.hdr_v2.dcd_table;
 -  struct dcd_v2_cmd *d = gd_last_cmd;
 -  int len;
 -
 -  if (!d)
 -  d = _v2->dcd_cmd;
 -  len = be16_to_cpu(d->write_dcd_command.length);
 -  if (len > 4)
 -  d = (struct dcd_v2_cmd *)(((char *)d) + len);
 -
 -  len = (char *)d - (char *)_v2->header;
 -
 -  dcd_v2->header.tag = DCD_HEADER_TAG;
 -  dcd_v2->header.length = cpu_to_be16(len);
 -  dcd_v2->header.version = DCD_VERSION;
 +  if (!imxhdr->header.hdr_v2.boot_data.plugin) {
 +  dcd_v2_t *dcd_v2 = >header.hdr_v2.data.dcd_table;
 +  struct dcd_v2_cmd *d = gd_last_cmd;
 +  int len;
 +
 +  if (!d)
 +  d = _v2->dcd_cmd;
 +  len = be16_to_cpu(d->write_dcd_command.length);
 +  if (len > 4)
 +  d = (struct dcd_v2_cmd *)(((char *)d) + len);
 +
 +  len = (char *)d - (char *)_v2->header;
 +
 +  dcd_v2->header.tag = DCD_HEADER_TAG;
 +  dcd_v2->header.length = cpu_to_be16(len);
 +  dcd_v2->header.version = DCD_VERSION;
 +  }
  }
  
  static void set_imx_hdr_v1(struct imx_header *imxhdr, uint32_t dcd_len,
 @@ -317,24 +327,93 @@ static void set_imx_hdr_v2(struct imx_header 
 *imxhdr, uint32_t dcd_len,
fhdr_v2->header.length = cpu_to_be16(sizeof(flash_header_v2_t));
fhdr_v2->header.version = IVT_VERSION; /* 0x40 */
  
>>>
>>> It seems that the reason for a lot of this special-purpose code is to add
>>> support for the entry address.
>>>
>>> If mkimage is invoked with an entrypoint from the command-line:
>>>
>>> ~/$ ./tools/mkimage -n my.cfg -T imximage -e 0xentrypoint u-boot.img
>>> u-boot.imx
>>>
>>> This entry point is normally placed into the 

Re: [U-Boot] [U-Boot, 1/3] ARM: keystone: remove declaration of unused functions

2016-10-09 Thread Tom Rini
On Mon, Sep 26, 2016 at 08:45:25PM +0900, Masahiro Yamada wrote:

> These two functions are neither defined nor referenced.
> 
> Signed-off-by: Masahiro Yamada 
> Acked-by: Lokesh Vutla 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] env: tool: add command line option to input lockfile path

2016-10-09 Thread Tom Rini
On Mon, Sep 26, 2016 at 06:24:08PM +0530, B, Ravi wrote:

> The default lockname is set to /var/lock. This limits the
> usage of this application where OS uses different lockfile
> location parameter.
> For example, In case of android, the default lock
> path location is /data.
> Hence by providing the command line option to input lockfile
> path will be useful to reuse the tool across multiple
> operating system.
> 
> usage: ./fw_printenv -l 
> 
> Signed-off-by: Ravi Babu 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 1/1]: filesystems : add "file exists" cmd

2016-10-09 Thread Sergey Kubushyn

On Sat, 8 Oct 2016, Sergey Kubushyn wrote:


On Sat, 8 Oct 2016, Tom Rini wrote:


 On Wed, Oct 05, 2016 at 12:38:01PM -0700, Sergey Kubushyn wrote:

>  This adds "file exists" commands to generic FS as well as to FAT, EXT4,
>  and UBIFS. Also adds "file size" command to UBIFS.
> 
>  The return value for "file exists" commands is REVERSED i.e. they

>  return 1 if file exists and 0 otherwise. This is a deliberate decision
>  because those commands are supposed to be used almost exclusively in
>  scripts and TRUE value is _not_ zero while FALSE is zero.
> 
>  As of now the only way to check for a file existence is to attempt a

>  read on that file (aka load.) That works but it makes an unnecessary
>  read, overwrites memory at destination address if file not a zero
>  length one, and outputs unnecessary messages to the console in any
>  case.
> 
>  Checking file existence in scripts is a valuable feature that allows

>  the higher level software (e.g. Linux) to interact with U-Boot by
>  creating some semaphore files and rebooting. We do use it quite
>  extensively for system setup at manufacturing time and for other
>  purposes (e.g. our Android "recovery" is implemented this way.)
> 
>  Signed-off-by: Sergey Kubushyn 


 Can you please do this in at least two patches?  file size to ubi should
 be its own patch.  Also:


Sure, will do later today.


>  +int do_ext4_file_exists(cmd_tbl_t *cmdtp, int flag, int argc,
>  + char *const argv[])
>  +{
>  + int ret;
>  +
>  + ret = do_file_exists(cmdtp, flag, argc, argv, FS_TYPE_EXT);
>  + +   if (ret == 0) return 1;
>  + if (ret == 1) return 0;
>  + return ret;
>  +}

 I can only assume this hasn't been compile tested in a while, and you
 should simplify the code into a single if/else and a comment on what we
 want/mean.  Thanks!


The problem is do_file_exists() can return not just 0 if file exists or
1 if it doesn't but also a negative value for "I don't know" i.e. when
e.g. FS mount failed.

I don't know if those return codes are somehow processed further up (too
much time to dig everything to the bare metal) so I decided to return
that value as-is if it happened. Sure it could be done like e.g.

return (ret == 0);

even without any if-elses and it is probably the proper way to do it but
I fell victim of perfectionism :))

Will re-do it with the above construction and split in 2 parts. Will also
send it with git send-email so it won't end up garbled.


OK, please disregard this patch altogether. I somehow missed "test -e"
command that has been implemented something like 2 years ago and that
command makes this entire patch unnecessary.

I will rewrite my scripts with "test -e" before submitting new boards.

---
**
*  KSI@homeKOI8 Net  < >  The impossible we do immediately.  *
*  Las Vegas   NV, USA   < >  Miracles require 24-hour notice.   *
**
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, 1/5] check-config: fix wrong comment about how to build whitelist

2016-10-09 Thread Tom Rini
On Mon, Sep 26, 2016 at 01:04:58PM +0900, Masahiro Yamada wrote:

> The command suggested in this comment block is wrong; it would not
> rip off CONFIG options that had already been converted to Kconfig.
> 
> Instead, we should use the scripts/build-whitelist.sh tool.
> 
> Signed-off-by: Masahiro Yamada 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v1] spl: saveenv: adding saveenv support in SPL

2016-10-09 Thread Tom Rini
On Wed, Sep 28, 2016 at 02:46:18PM +0530, B, Ravi wrote:

> By default saveenv option is not supported for SPL. This patch
> enable the support for save environment variable for SPL build.
> 
> Enable save environment support in SPL after setenv. By default
> the saveenv option is not provided in SPL, but some boards need
> this support in 'Falcon' boot, where SPL need to boot from
> different images based on environment variable set by OS. For
> example OS may set "reboot_image" environment variable to
> "recovery" inorder to boot recovery image by SPL. The SPL read
> "reboot_image" and act accordingly and change the reboot_image
> to default mode using setenv and save the environemnt.
> 
> Signed-off-by: Ravi Babu 
> Reviewed-by: Simon Glass 
> 
> 
> change in v1:
>   - dropped SUPPORT, use CONFIG_SPL_SAVEENV
>   - updates the comments in mmc_private.h

Applied to u-boot/master, thanks!

-- 
Tom


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