Re: [U-Boot] [PATCH] ARM: SPL: FIT: fix DTC warnings on FIT generation

2017-10-22 Thread Lokesh Vutla


On Tuesday 17 October 2017 02:43 AM, Tom Rini wrote:
> On Tue, Oct 17, 2017 at 02:29:14AM +0530, Jagan Teki wrote:
>> On Mon, Oct 9, 2017 at 10:15 AM, Simon Glass  wrote:
>>> Hi Andre,
>>>
>>> On 4 October 2017 at 17:24, Andre Przywara  wrote:
 Newer versions of the device tree compiler (rightfully) complain about
 mismatches between attributed node names (name@) and a missing
 reg property in that node.
 Adjust the FIT build script for 64-bit Allwinner boards to remove the
 bogus addresses from the node names and avoid the warnings.

 Signed-off-by: Andre Przywara 
 ---
  board/sunxi/mksunxi_fit_atf.sh | 16 
  1 file changed, 8 insertions(+), 8 deletions(-)
>>>
>>> It looks like we have this problem all over the place. The
>>> documentation in doc/uImage now seems to have this problem too.
>>>
>>> I wonder if instead we should add reg / #address-cells / #size-cells 
>>> properties?
>>
>> If the update on dts, might be an another-overhead to maintain u-boot
>> dts wrt Linux dts sync.
> 
> Anything that DTC is warning about in a dts that we get from the kernel,
> should be fixed in the kernel.  The kernel dtc is what we're using, and
> is/will/can also complain about it.

Kernel suppress these warning by default[1] and enables these warnings
with W= compiler option. May be this should be included in u-boot as well?

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/Makefile.lib#n272

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


Re: [U-Boot] [PATCH v3 1/2] thermal: ti-bandgap: Add support for temperature sensor

2017-10-22 Thread Faiz Abbas
Hi Tom,

On Monday 23 October 2017 08:30 AM, Tom Rini wrote:
> On Mon, Oct 23, 2017 at 08:07:09AM +0530, Lokesh Vutla wrote:
>> On Wednesday 18 October 2017 05:11 PM, Faiz Abbas wrote:
>>> The dra7xx series of SOCs contain a temperature sensor and an
>>> associated analog-to-digital converter (ADC) which produces
>>> an output which is proportional to the SOC temperature.
>>> Add support for this temperature sensor.
>>>
>>> Signed-off-by: Faiz Abbas 
>>> Reviewed-by: Simon Glass 
>>> ---
>>> v3:
>>> Added Reviewed-by comment
>>>
>>> v2:
>>>  1. Removed extra elements from ti_bandgap
>>>  2. Changed base address to ulong
>>>  3. Changed to udev to dev to maintain consistency
>>>  4. minor format changes
>>>
>>>  common/spl/Kconfig |   8 +
>>>  configs/dra7xx_evm_defconfig   |   3 +
>>>  .../thermal/ti_soc_thermal.txt |  35 
>>>  drivers/Makefile   |   2 +-
>>>  drivers/thermal/Kconfig|   6 +
>>>  drivers/thermal/Makefile   |   1 +
>>>  drivers/thermal/ti-bandgap.c   | 197 
>>> +
>>>  7 files changed, 251 insertions(+), 1 deletion(-)
>>>  create mode 100644 doc/device-tree-bindings/thermal/ti_soc_thermal.txt
>>>  create mode 100644 drivers/thermal/ti-bandgap.c
>>>
>>> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
>>> index 0bd8370..0bf3ee3 100644
>>> --- a/common/spl/Kconfig
>>> +++ b/common/spl/Kconfig
>>> @@ -604,6 +604,14 @@ config SPL_SPI_SUPPORT
>>>   enable SPI drivers that are needed for other purposes also, such
>>>   as a SPI PMIC.
>>>  
>>> +config SPL_THERMAL
>>> +   bool "Driver support for thermal devices"
>>> +   help
>>> + Enable support for temperature-sensing devices. Some SoCs have on-chip
>>> + temperature sensors to permit warnings, speed throttling or even
>>> + automatic power-off when the temperature gets too high or low. Other
>>> + devices may be discrete but connected on a suitable bus.
>>> +
>>>  config SPL_USB_HOST_SUPPORT
>>> bool "Support USB host drivers"
>>> help
>>> diff --git a/configs/dra7xx_evm_defconfig b/configs/dra7xx_evm_defconfig
>>> index 468c288..447fb89 100644
>>> --- a/configs/dra7xx_evm_defconfig
>>> +++ b/configs/dra7xx_evm_defconfig
>>> @@ -90,3 +90,6 @@ CONFIG_USB_GADGET=y
>>>  CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
>>>  CONFIG_USB_GADGET_VENDOR_NUM=0x0451
>>>  CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
>>> +CONFIG_SPL_THERMAL=y
>>> +CONFIG_DM_THERMAL=y
>>> +CONFIG_TI_DRA7_THERMAL=y
>>
>> Tom,
>>  Do you want these options to be implied so that it will take effect for
>> HS board as well. Or enable it in defconfig as is?
> 
> How important is it that this be enabled?  Is this 100% within the SoC?
> Thanks!
> 

There is an upcoming errata which requires temperature support to
workaround. This errata will apply to the HS boards as well. Will send a
new patch with imply added to TARGET_DRA7XX_EVM for these configs.

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


[U-Boot] [GIT PULL] Please pull u-boot-mmc master

2017-10-22 Thread Jaehoon Chung
Dear Tom,

Could you pull these patches to u-boot/master?
To develop the supporting HS200 mode, each host driver also needs to implement 
something.
First step is the applying JJ's patches.

If there is a problem, let me know, plz.

The following changes since commit 0def58f7fd26a237bb08cfbd58ec53372b1ad06b:

  Merge git://git.denx.de/u-boot-x86 (2017-10-19 11:19:38 -0400)

are available in the git repository at:

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

for you to fetch changes up to f58da60cfdbe896d62a0ec61cd41a52cfc82c526:

  mmc: replace the printf() instead of error() (2017-10-23 13:48:39 +0900)


Jaehoon Chung (1):
  mmc: replace the printf() instead of error()

Jean-Jacques Hiblot (17):
  mmc: dm: get the IO-line and main voltage regulators from the dts
  mmc: split mmc_startup()
  mmc: move the MMC startup for version above v4.0 in a separate function
  mmc: make ext_csd part of struct mmc
  mmc: add a function to read and test the ext csd (mmc >= 4)
  mmc: introduce mmc modes
  mmc: Add a function to dump the mmc capabilities
  mmc: use mmc modes to select the correct bus speed
  cmd: mmc: display the mode name and current bus speed in the mmc info
  mmc: refactor SD startup to make it easier to support new modes
  mmc: refactor MMC startup to make it easier to support new modes
  mmc: Add a new callback function to perform the 74 clocks cycle sequence
  mmc: Add support for UHS modes
  mmc: disable UHS modes if Vcc cannot be switched on and off
  mmc: Change mode when switching to a boot partition
  mmc: use the right voltage level for MMC DDR and HS200 modes
  mmc: add a library function to send tuning command

Kishon Vijay Abraham I (9):
  mmc: make mmc_set_ios() return status
  mmc: Enable signal voltage to be selected from mmc core
  mmc: add power cyle support in mmc core
  mmc: add a new mmc parameter to disable mmc clock
  mmc: disable the mmc clock during power off
  mmc: Add a execute_tuning() callback to the mmc operations.
  mmc: add HS200 support in MMC core
  mmc: Retry some MMC cmds on failure
  dm: mmc: Add a library function to parse generic dt binding

Suniel Mahesh (2):
  drivers: mmc: Change buffer type in ALLOC_CACHE_ALIGN_BUFFER macro
  drivers: mmc: Avoid memory leak in case of failure

 cmd/mmc.c   |3 +-
 drivers/mmc/Kconfig |   23 +
 drivers/mmc/exynos_dw_mmc.c |3 +
 drivers/mmc/fsl_esdhc.c |2 +-
 drivers/mmc/mmc-uclass.c|   87 +++
 drivers/mmc/mmc.c   | 1517 ---
 include/mmc.h   |  176 -
 7 files changed, 1423 insertions(+), 388 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] mmc: replace the printf() instead of error()

2017-10-22 Thread Jaehoon Chung
On 10/23/2017 01:46 PM, Jaehoon Chung wrote:
> Replace the printf() instead of error().
> It is occurred the compiler error with "undefined reference to 'error'".
> 
> Fixes: e0079fecd75b ("mmc: refacstor SD startup to make it easier to support 
> new modes")
> 
> Signed-off-by: Jaehoon Chung 

Applied to u-boot-mmc.

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/mmc.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 55a53c2200..a5a521eec3 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -828,7 +828,7 @@ static int mmc_get_capabilities(struct mmc *mmc)
>   return 0;
>  
>   if (!ext_csd) {
> - error("No ext_csd found!\n"); /* this should enver happen */
> + printf("No ext_csd found!\n"); /* this should enver happen */
>   return -ENOTSUPP;
>   }
>  
> @@ -1433,7 +1433,7 @@ static inline int bus_width(uint cap)
>   return 4;
>   if (cap == MMC_MODE_1BIT)
>   return 1;
> - error("invalid bus witdh capability 0x%x\n", cap);
> + printf("invalid bus witdh capability 0x%x\n", cap);
>   return 0;
>  }
>  
> @@ -1638,7 +1638,7 @@ error:
>   }
>   }
>  
> - error("unable to select a mode\n");
> + printf("unable to select a mode\n");
>   return -ENOTSUPP;
>  }
>  
> @@ -1844,7 +1844,7 @@ error:
>   }
>   }
>  
> - error("unable to select a mode\n");
> + printf("unable to select a mode\n");
>  
>   return -ENOTSUPP;
>  }
> 

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


[U-Boot] [PATCH] mmc: replace the printf() instead of error()

2017-10-22 Thread Jaehoon Chung
Replace the printf() instead of error().
It is occurred the compiler error with "undefined reference to 'error'".

Fixes: e0079fecd75b ("mmc: refacstor SD startup to make it easier to support 
new modes")

Signed-off-by: Jaehoon Chung 
---
 drivers/mmc/mmc.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 55a53c2200..a5a521eec3 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -828,7 +828,7 @@ static int mmc_get_capabilities(struct mmc *mmc)
return 0;
 
if (!ext_csd) {
-   error("No ext_csd found!\n"); /* this should enver happen */
+   printf("No ext_csd found!\n"); /* this should enver happen */
return -ENOTSUPP;
}
 
@@ -1433,7 +1433,7 @@ static inline int bus_width(uint cap)
return 4;
if (cap == MMC_MODE_1BIT)
return 1;
-   error("invalid bus witdh capability 0x%x\n", cap);
+   printf("invalid bus witdh capability 0x%x\n", cap);
return 0;
 }
 
@@ -1638,7 +1638,7 @@ error:
}
}
 
-   error("unable to select a mode\n");
+   printf("unable to select a mode\n");
return -ENOTSUPP;
 }
 
@@ -1844,7 +1844,7 @@ error:
}
}
 
-   error("unable to select a mode\n");
+   printf("unable to select a mode\n");
 
return -ENOTSUPP;
 }
-- 
2.14.2

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


Re: [U-Boot] [PATCH v3 1/2] thermal: ti-bandgap: Add support for temperature sensor

2017-10-22 Thread Tom Rini
On Mon, Oct 23, 2017 at 08:07:09AM +0530, Lokesh Vutla wrote:
> On Wednesday 18 October 2017 05:11 PM, Faiz Abbas wrote:
> > The dra7xx series of SOCs contain a temperature sensor and an
> > associated analog-to-digital converter (ADC) which produces
> > an output which is proportional to the SOC temperature.
> > Add support for this temperature sensor.
> > 
> > Signed-off-by: Faiz Abbas 
> > Reviewed-by: Simon Glass 
> > ---
> > v3:
> > Added Reviewed-by comment
> > 
> > v2:
> >  1. Removed extra elements from ti_bandgap
> >  2. Changed base address to ulong
> >  3. Changed to udev to dev to maintain consistency
> >  4. minor format changes
> > 
> >  common/spl/Kconfig |   8 +
> >  configs/dra7xx_evm_defconfig   |   3 +
> >  .../thermal/ti_soc_thermal.txt |  35 
> >  drivers/Makefile   |   2 +-
> >  drivers/thermal/Kconfig|   6 +
> >  drivers/thermal/Makefile   |   1 +
> >  drivers/thermal/ti-bandgap.c   | 197 
> > +
> >  7 files changed, 251 insertions(+), 1 deletion(-)
> >  create mode 100644 doc/device-tree-bindings/thermal/ti_soc_thermal.txt
> >  create mode 100644 drivers/thermal/ti-bandgap.c
> > 
> > diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> > index 0bd8370..0bf3ee3 100644
> > --- a/common/spl/Kconfig
> > +++ b/common/spl/Kconfig
> > @@ -604,6 +604,14 @@ config SPL_SPI_SUPPORT
> >   enable SPI drivers that are needed for other purposes also, such
> >   as a SPI PMIC.
> >  
> > +config SPL_THERMAL
> > +   bool "Driver support for thermal devices"
> > +   help
> > + Enable support for temperature-sensing devices. Some SoCs have on-chip
> > + temperature sensors to permit warnings, speed throttling or even
> > + automatic power-off when the temperature gets too high or low. Other
> > + devices may be discrete but connected on a suitable bus.
> > +
> >  config SPL_USB_HOST_SUPPORT
> > bool "Support USB host drivers"
> > help
> > diff --git a/configs/dra7xx_evm_defconfig b/configs/dra7xx_evm_defconfig
> > index 468c288..447fb89 100644
> > --- a/configs/dra7xx_evm_defconfig
> > +++ b/configs/dra7xx_evm_defconfig
> > @@ -90,3 +90,6 @@ CONFIG_USB_GADGET=y
> >  CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
> >  CONFIG_USB_GADGET_VENDOR_NUM=0x0451
> >  CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
> > +CONFIG_SPL_THERMAL=y
> > +CONFIG_DM_THERMAL=y
> > +CONFIG_TI_DRA7_THERMAL=y
> 
> Tom,
>   Do you want these options to be implied so that it will take effect for
> HS board as well. Or enable it in defconfig as is?

How important is it that this be enabled?  Is this 100% within the SoC?
Thanks!

-- 
Tom


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


Re: [U-Boot] Build failure in u-boot-mmc/master: undefined reference to error

2017-10-22 Thread Jaehoon Chung
Dear Stephen,

On 10/21/2017 12:47 AM, Stephen Warren wrote:
> With the latest content of u-boot-mmc/master, 41dc35a149b3 "drivers: mmc: 
> Avoid memory leak in case of failure", all Tegra boards (perhaps others too; 
> my system only tests Tegra) fail to build with the following error:

I had found the same error at build testing, I will fix it on today.
Thanks for noticing it.

Best Regards,
Jaehoon Chung

> 
>> drivers/built-in.o: In function `mmc_select_mode_and_width':
>> /var/lib/jenkins/workspace/u-boot-denx_uboot_mmc-master-build/src/u-boot/drivers/mmc/mmc.c:1847:
>>  undefined reference to `error'
>> drivers/built-in.o: In function `bus_width':
>> /var/lib/jenkins/workspace/u-boot-denx_uboot_mmc-master-build/src/u-boot/drivers/mmc/mmc.c:1436:
>>  undefined reference to `error'
>> /var/lib/jenkins/workspace/u-boot-denx_uboot_mmc-master-build/src/u-boot/drivers/mmc/mmc.c:1436:
>>  undefined reference to `error'
>> /var/lib/jenkins/workspace/u-boot-denx_uboot_mmc-master-build/src/u-boot/drivers/mmc/mmc.c:1436:
>>  undefined reference to `error'
>> drivers/built-in.o: In function `mmc_get_capabilities':
>> /var/lib/jenkins/workspace/u-boot-denx_uboot_mmc-master-build/src/u-boot/drivers/mmc/mmc.c:831:
>>  undefined reference to `error'
>> arm-none-eabi-ld.bfd: BFD (2.24-2ubuntu2+4) 2.24 assertion fail 
>> ../../binutils-2.24/bfd/elf32-arm.c:7696
>> arm-none-eabi-ld.bfd: error: required section '.rel.plt' not found in the 
>> linker script
>> arm-none-eabi-ld.bfd: final link failed: Invalid operation
> 
> 
> 

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


Re: [U-Boot] [PATCH v3 1/2] thermal: ti-bandgap: Add support for temperature sensor

2017-10-22 Thread Lokesh Vutla
On Wednesday 18 October 2017 05:11 PM, Faiz Abbas wrote:
> The dra7xx series of SOCs contain a temperature sensor and an
> associated analog-to-digital converter (ADC) which produces
> an output which is proportional to the SOC temperature.
> Add support for this temperature sensor.
> 
> Signed-off-by: Faiz Abbas 
> Reviewed-by: Simon Glass 
> ---
> v3:
> Added Reviewed-by comment
> 
> v2:
>  1. Removed extra elements from ti_bandgap
>  2. Changed base address to ulong
>  3. Changed to udev to dev to maintain consistency
>  4. minor format changes
> 
>  common/spl/Kconfig |   8 +
>  configs/dra7xx_evm_defconfig   |   3 +
>  .../thermal/ti_soc_thermal.txt |  35 
>  drivers/Makefile   |   2 +-
>  drivers/thermal/Kconfig|   6 +
>  drivers/thermal/Makefile   |   1 +
>  drivers/thermal/ti-bandgap.c   | 197 
> +
>  7 files changed, 251 insertions(+), 1 deletion(-)
>  create mode 100644 doc/device-tree-bindings/thermal/ti_soc_thermal.txt
>  create mode 100644 drivers/thermal/ti-bandgap.c
> 
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index 0bd8370..0bf3ee3 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -604,6 +604,14 @@ config SPL_SPI_SUPPORT
> enable SPI drivers that are needed for other purposes also, such
> as a SPI PMIC.
>  
> +config SPL_THERMAL
> + bool "Driver support for thermal devices"
> + help
> +   Enable support for temperature-sensing devices. Some SoCs have on-chip
> +   temperature sensors to permit warnings, speed throttling or even
> +   automatic power-off when the temperature gets too high or low. Other
> +   devices may be discrete but connected on a suitable bus.
> +
>  config SPL_USB_HOST_SUPPORT
>   bool "Support USB host drivers"
>   help
> diff --git a/configs/dra7xx_evm_defconfig b/configs/dra7xx_evm_defconfig
> index 468c288..447fb89 100644
> --- a/configs/dra7xx_evm_defconfig
> +++ b/configs/dra7xx_evm_defconfig
> @@ -90,3 +90,6 @@ CONFIG_USB_GADGET=y
>  CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
>  CONFIG_USB_GADGET_VENDOR_NUM=0x0451
>  CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
> +CONFIG_SPL_THERMAL=y
> +CONFIG_DM_THERMAL=y
> +CONFIG_TI_DRA7_THERMAL=y

Tom,
Do you want these options to be implied so that it will take effect for
HS board as well. Or enable it in defconfig as is?

Thanks and regards,
Lokesh

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


Re: [U-Boot] [PATCH 3/3] Powerpc: pcie: Make pcie link state judgement more specific

2017-10-22 Thread Xiaowei Bao

-Original Message-
From: Joakim Tjernlund [mailto:joakim.tjernl...@infinera.com] 
Sent: Friday, October 20, 2017 9:13 PM
To: w...@denx.de; Mingkai Hu ; 
tony.obr...@alliedtelesis.co.nz; u-boot@lists.denx.de; Z.q. Hou 
; York Sun ; Xiaowei Bao 
; hamish.mar...@alliedtelesis.co.nz; M.h. Lian 

Subject: Re: [U-Boot] [PATCH 3/3] Powerpc: pcie: Make pcie link state judgement 
more specific

On Fri, 2017-10-20 at 18:16 +0800, Bao Xiaowei wrote:
> CAUTION: This email originated from outside of the organization. Do not click 
> links or open attachments unless you recognize the sender and know the 
> content is safe.
> 
> 
> For some special reset times for longer pcie devices, the pcie device 
> may on polling compliance state, the RC considers the pcie device is 
> link up, but the pcie device is not link up, only the L0 state is link 
> up state.
> 
> Signed-off-by: Bao Xiaowei 
> ---
>  arch/powerpc/include/asm/fsl_pci.h |  2 ++
>  drivers/pci/fsl_pci_init.c | 10 ++
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/fsl_pci.h 
> b/arch/powerpc/include/asm/fsl_pci.h
> index 70a5461..323b182 100644
> --- a/arch/powerpc/include/asm/fsl_pci.h
> +++ b/arch/powerpc/include/asm/fsl_pci.h
> @@ -25,6 +25,8 @@
>  #define PCI_LTSSM  0x404   /* PCIe Link Training, Status State Machine */
>  #define PCI_LTSSM_L0   0x16/* L0 state */
>  #define PCI_LTSSM_L0_PEX_REV3  0x11/* L0 state for pex rev3*/
> +#define LTSSM_PCIE_DETECT_QUIET0x00/* Detect state */
> +#define LTSSM_PCIE_DETECT_ACTIVE   0x01/* Detect state */
> 
>  int fsl_setup_hose(struct pci_controller *hose, unsigned long addr);  
> int fsl_is_pci_agent(struct pci_controller *hose); diff --git 
> a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c index 
> be57e53..9b5f386 100644
> --- a/drivers/pci/fsl_pci_init.c
> +++ b/drivers/pci/fsl_pci_init.c
> @@ -335,15 +335,17 @@ static int fsl_pci_link_up(struct pci_controller *hose,
> pci_ltssm_l0 = PCI_LTSSM_L0;
> 
> ltssm = fsl_get_ltssm(hose, pci_info);
> -
> -   if (ltssm == pci_ltssm_l0) {
> +   if (ltssm == LTSSM_PCIE_DETECT_QUIET ||
> +   ltssm == LTSSM_PCIE_DETECT_ACTIVE) {
> +   enabled = 0;
> +   } else if (ltssm == pci_ltssm_l0) {
> enabled = 1;
> } else {
> -   for (i = 0; i < 100 && ltssm < pci_ltssm_l0; i++) {
> +   for (i = 0; i < 100 && ltssm != pci_ltssm_l0; i++) {
> ltssm = fsl_get_ltssm(hose, pci_info);
> udelay(1000);
Do you really need this long loop here ? It causes a long delay in case the 
PCIe device is in permanent polling state. Our device is in polling state until 
clocks is configured and that will be done from user space in Linux

Yes, if the pcie device is in permanent polling state, it will take probably 
100ms delay, but this case is occur very few special devices, if we want to use 
the pcie device in uboot, we have to wait the device link up state is ok, so 
need some time to wait the pcie device ready. if the pcie slot have no device, 
the function will return at once, will not bring delay.
> }
> -   enabled = ltssm >= pci_ltssm_l0;
> +   enabled = (ltssm == pci_ltssm_l0) ? 1 : 0;
> }
> 
> return enabled;
> --
> 2.7.4
> 
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 3/5] arm: layerscape: Remove CONFIG_USB_MAX_CONTROLLER_COUNT

2017-10-22 Thread Ran Wang
Because COMFIG_DM_USB has been enabled and will not use it anymore.

Signed-off-by: Ran Wang 
Reviewed-by: Bin Meng 
---
Change in v4:
Typo correction.

Change in v3:
New patch file.

 include/configs/ls1012afrdm.h | 5 -
 include/configs/ls1012aqds.h  | 3 ---
 include/configs/ls1012ardb.h  | 4 
 include/configs/ls1021aiot.h  | 3 ---
 include/configs/ls1021aqds.h  | 3 ---
 include/configs/ls1021atwr.h  | 3 ---
 include/configs/ls1043aqds.h  | 3 ---
 include/configs/ls1043ardb.h  | 5 -
 include/configs/ls1046aqds.h  | 3 ---
 include/configs/ls1046ardb.h  | 5 -
 include/configs/ls2080aqds.h  | 5 -
 include/configs/ls2080ardb.h  | 5 -
 12 files changed, 47 deletions(-)

diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h
index 2e9c619bd5..efb4c00cd9 100644
--- a/include/configs/ls1012afrdm.h
+++ b/include/configs/ls1012afrdm.h
@@ -31,11 +31,6 @@
"kernel_load=0x9600\0"  \
"kernel_size=0x280\0"
 
-/*
-* USB
-*/
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-
 #define CONFIG_CMD_MEMINFO
 #define CONFIG_CMD_MEMTEST
 #define CONFIG_SYS_MEMTEST_START   0x8000
diff --git a/include/configs/ls1012aqds.h b/include/configs/ls1012aqds.h
index 70bf72c431..ffb512db45 100644
--- a/include/configs/ls1012aqds.h
+++ b/include/configs/ls1012aqds.h
@@ -118,9 +118,6 @@
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
 #endif
 
-/*XHCI Support - enabled by default*/
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-
 /*  MMC  */
 #ifdef CONFIG_MMC
 #define CONFIG_FSL_ESDHC
diff --git a/include/configs/ls1012ardb.h b/include/configs/ls1012ardb.h
index 110fcc6323..0caa474636 100644
--- a/include/configs/ls1012ardb.h
+++ b/include/configs/ls1012ardb.h
@@ -19,10 +19,6 @@
 #define CONFIG_SYS_MEMTEST_START   0x8000
 #define CONFIG_SYS_MEMTEST_END 0x9fff
 
-/*
-* USB
-*/
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
 
 /*
  * I2C IO expander
diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h
index dac4a81e2a..c8eb234670 100644
--- a/include/configs/ls1021aiot.h
+++ b/include/configs/ls1021aiot.h
@@ -19,9 +19,6 @@
 #define CONFIG_SYS_INIT_RAM_ADDR   OCRAM_BASE_ADDR
 #define CONFIG_SYS_INIT_RAM_SIZE   OCRAM_SIZE
 
-/* XHCI Support - enabled by default */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT1
-
 #define CONFIG_SYS_CLK_FREQ1
 #define CONFIG_DDR_CLK_FREQ1
 
diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index 8346e3658f..6669f2f960 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -404,9 +404,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
 #endif
 
-/*XHCI Support - enabled by default*/
-#define CONFIG_USB_MAX_CONTROLLER_COUNT1
-
 /*
  * Video
  */
diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index 8ccc81642d..0f20e5e2cc 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -44,9 +44,6 @@
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
 #endif
 
-/* XHCI Support - enabled by default */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT1
-
 #define CONFIG_SYS_CLK_FREQ1
 #define CONFIG_DDR_CLK_FREQ1
 
diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
index 641ffc1400..8cc2abb2b6 100644
--- a/include/configs/ls1043aqds.h
+++ b/include/configs/ls1043aqds.h
@@ -370,9 +370,6 @@ unsigned long get_board_ddr_clk(void);
 #endif
 #endif
 
-/* USB */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT3
-
 /*
  * Miscellaneous configurable options
  */
diff --git a/include/configs/ls1043ardb.h b/include/configs/ls1043ardb.h
index 0e02be445a..762ecf1f4c 100644
--- a/include/configs/ls1043ardb.h
+++ b/include/configs/ls1043ardb.h
@@ -279,11 +279,6 @@
 #endif
 #endif
 
-/* USB */
-#ifndef SPL_NO_USB
-#define CONFIG_USB_MAX_CONTROLLER_COUNT3
-#endif
-
 /* SATA */
 #ifndef SPL_NO_SATA
 #define CONFIG_LIBATA
diff --git a/include/configs/ls1046aqds.h b/include/configs/ls1046aqds.h
index 2f2602f098..3ce66ce6f1 100644
--- a/include/configs/ls1046aqds.h
+++ b/include/configs/ls1046aqds.h
@@ -136,9 +136,6 @@ unsigned long get_board_ddr_clk(void);
 #define CFG_LPUART_EN  0x2
 #endif
 
-/* USB */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 3
-
 /* SATA */
 #define CONFIG_LIBATA
 #define CONFIG_SCSI_AHCI
diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h
index 40ce8ff462..bb27dd058a 100644
--- a/include/configs/ls1046ardb.h
+++ b/include/configs/ls1046ardb.h
@@ -209,11 +209,6 @@
 #endif
 #endif
 
-/* USB */
-#ifndef SPL_NO_USB
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 3
-#endif
-
 /* SATA */
 #ifndef SPL_NO_SATA
 #define CONFIG_LIBATA
diff --git a/include/configs/ls2080aqds.h b/include/configs/ls2080aqds.h
index 

[U-Boot] [PATCH v4 5/5] ls1088aqds: Enable USB command on QDS for qspi-boot

2017-10-22 Thread Ran Wang
Signed-off-by: Amrita Kumari 
Signed-off-by: Ashish Kumar 
Signed-off-by: Ran Wang 
Reviewed-by: Bin Meng 
---
Change in v4:
Typo correction.

Change in v3:
- none

Change in v2:
Remove macro CONFIG_HAS_FSL_XHCI_USB and CONFIG_USB_XHCI_FSL
and CONFIG_USB_MAX_CONTROLLER_COUNT from ls1088aqds.h since
Kconfig option has covered.

Change in v1:
Rebased to
ba39608 ARM: DRA72x: Add support for detection of DRA71x SR 2.1

 configs/ls1088aqds_qspi_defconfig | 8 
 1 file changed, 8 insertions(+)

diff --git a/configs/ls1088aqds_qspi_defconfig 
b/configs/ls1088aqds_qspi_defconfig
index 4b0d604fa0..a24a6011c9 100644
--- a/configs/ls1088aqds_qspi_defconfig
+++ b/configs/ls1088aqds_qspi_defconfig
@@ -31,3 +31,11 @@ CONFIG_FSL_DSPI=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_FSL_LS_PPA=y
+CONFIG_USB=y
+CONFIG_USB_GADGET=y
+CONFIG_CMD_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_STORAGE=y
-- 
2.14.1

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


[U-Boot] [PATCH v4 4/5] ls1088ardb: Enable USB command RDB qspi-boot

2017-10-22 Thread Ran Wang
Signed-off-by: Ashish Kumar 
Signed-off-by: Amrita Kumari 
Signed-off-by: Ran Wang 
Reviewed-by: Bin Meng 
---
Change in v4:
Typo correction.

Change in v3:
1.Move HAS_FSL_XHCI_USB and USB_XHCI_FSL define to other patch file.

Change in v2:
1.Adjust USB nodes position in dts to keep them sorted in
  unit-address.
2.Move macro CONFIG_HAS_FSL_XHCI_USB and CONFIG_USB_XHCI_FSL
  to Kconfig option.
3.Remove CONFIG_USB_MAX_CONTROLLER_COUNT.

Change in v1:
Rebased to 
ba39608 ARM: DRA72x: Add support for detection of DRA71x SR 2.1

 arch/arm/dts/fsl-ls1088a.dtsi | 14 ++
 configs/ls1088ardb_qspi_defconfig |  8 
 include/linux/usb/xhci-fsl.h  |  2 +-
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/fsl-ls1088a.dtsi b/arch/arm/dts/fsl-ls1088a.dtsi
index d943a9efa3..64b4fcf12b 100644
--- a/arch/arm/dts/fsl-ls1088a.dtsi
+++ b/arch/arm/dts/fsl-ls1088a.dtsi
@@ -76,6 +76,20 @@
num-cs = <4>;
};
 
+   usb0: usb3@310 {
+   compatible = "fsl,layerscape-dwc3";
+   reg = <0x0 0x310 0x0 0x1>;
+   interrupts = <0 80 0x4>; /* Level high type */
+   dr_mode = "host";
+   };
+
+   usb1: usb3@311 {
+   compatible = "fsl,layerscape-dwc3";
+   reg = <0x0 0x311 0x0 0x1>;
+   interrupts = <0 81 0x4>; /* Level high type */
+   dr_mode = "host";
+   };
+
pcie@340 {
compatible = "fsl,ls-pcie", "snps,dw-pcie";
reg = <0x00 0x0340 0x0 0x8   /* dbi registers */
diff --git a/configs/ls1088ardb_qspi_defconfig 
b/configs/ls1088ardb_qspi_defconfig
index 2d5a134261..3034f506e2 100644
--- a/configs/ls1088ardb_qspi_defconfig
+++ b/configs/ls1088ardb_qspi_defconfig
@@ -31,3 +31,11 @@ CONFIG_FSL_DSPI=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_FSL_LS_PPA=y
+CONFIG_USB=y
+CONFIG_USB_GADGET=y
+CONFIG_CMD_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_STORAGE=y
diff --git a/include/linux/usb/xhci-fsl.h b/include/linux/usb/xhci-fsl.h
index bd54089722..a916afb885 100644
--- a/include/linux/usb/xhci-fsl.h
+++ b/include/linux/usb/xhci-fsl.h
@@ -58,7 +58,7 @@ struct fsl_xhci {
 #define CONFIG_SYS_FSL_XHCI_USB1_ADDR CONFIG_SYS_XHCI_USB1_ADDR
 #define CONFIG_SYS_FSL_XHCI_USB2_ADDR 0
 #define CONFIG_SYS_FSL_XHCI_USB3_ADDR 0
-#elif defined(CONFIG_ARCH_LS2080A)
+#elif defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A)
 #define CONFIG_SYS_FSL_XHCI_USB1_ADDR CONFIG_SYS_XHCI_USB1_ADDR
 #define CONFIG_SYS_FSL_XHCI_USB2_ADDR CONFIG_SYS_XHCI_USB2_ADDR
 #define CONFIG_SYS_FSL_XHCI_USB3_ADDR 0
-- 
2.14.1

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


[U-Boot] [PATCH v4 2/5] usb: host: Move CONFIG_XHCI_FSL to Kconfig

2017-10-22 Thread Ran Wang
use Kconfig to select xhci accordingly.

Signed-off-by: Ran Wang 
Reviewed-by: Bin Meng 
---
Change in v4:
Typo correction.

Change in v3:
New patch file.

 drivers/usb/host/Kconfig  | 6 ++
 include/configs/ls1012afrdm.h | 1 -
 include/configs/ls1012aqds.h  | 1 -
 include/configs/ls1012ardb.h  | 1 -
 include/configs/ls1021aiot.h  | 1 -
 include/configs/ls1021aqds.h  | 1 -
 include/configs/ls1021atwr.h  | 1 -
 include/configs/ls1043aqds.h  | 1 -
 include/configs/ls1043ardb.h  | 1 -
 include/configs/ls1046aqds.h  | 1 -
 include/configs/ls1046ardb.h  | 1 -
 include/configs/ls2080aqds.h  | 1 -
 include/configs/ls2080ardb.h  | 1 -
 scripts/config_whitelist.txt  | 1 -
 14 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index f797a2568c..5da846728a 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -71,6 +71,12 @@ config USB_XHCI_DRA7XX_INDEX
  Select the DRA7XX xHCI USB index.
  Current supported values: 0, 1.
 
+config USB_XHCI_FSL
+   bool "Support for NXP Layerscape on-chip xHCI USB controller"
+   default y if ARCH_LS1021A || FSL_LSCH3 || FSL_LSCH2
+   depends on !SPL_NO_USB
+   help
+ Enables support for the on-chip xHCI controller on NXP Layerscape 
SoCs.
 endif # USB_XHCI_HCD
 
 config USB_EHCI_HCD
diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h
index 2e5af9cc4e..2e9c619bd5 100644
--- a/include/configs/ls1012afrdm.h
+++ b/include/configs/ls1012afrdm.h
@@ -34,7 +34,6 @@
 /*
 * USB
 */
-#define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
 
 #define CONFIG_CMD_MEMINFO
diff --git a/include/configs/ls1012aqds.h b/include/configs/ls1012aqds.h
index e0949d0b53..70bf72c431 100644
--- a/include/configs/ls1012aqds.h
+++ b/include/configs/ls1012aqds.h
@@ -119,7 +119,6 @@
 #endif
 
 /*XHCI Support - enabled by default*/
-#define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
 
 /*  MMC  */
diff --git a/include/configs/ls1012ardb.h b/include/configs/ls1012ardb.h
index 66ff004384..110fcc6323 100644
--- a/include/configs/ls1012ardb.h
+++ b/include/configs/ls1012ardb.h
@@ -22,7 +22,6 @@
 /*
 * USB
 */
-#define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
 
 /*
diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h
index 2cbea87d95..dac4a81e2a 100644
--- a/include/configs/ls1021aiot.h
+++ b/include/configs/ls1021aiot.h
@@ -20,7 +20,6 @@
 #define CONFIG_SYS_INIT_RAM_SIZE   OCRAM_SIZE
 
 /* XHCI Support - enabled by default */
-#define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT1
 
 #define CONFIG_SYS_CLK_FREQ1
diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index 0046ded536..8346e3658f 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -405,7 +405,6 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 /*XHCI Support - enabled by default*/
-#define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT1
 
 /*
diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index 0172c9015d..8ccc81642d 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -45,7 +45,6 @@
 #endif
 
 /* XHCI Support - enabled by default */
-#define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT1
 
 #define CONFIG_SYS_CLK_FREQ1
diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
index 607c289d17..641ffc1400 100644
--- a/include/configs/ls1043aqds.h
+++ b/include/configs/ls1043aqds.h
@@ -371,7 +371,6 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 /* USB */
-#define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT3
 
 /*
diff --git a/include/configs/ls1043ardb.h b/include/configs/ls1043ardb.h
index 866817d579..0e02be445a 100644
--- a/include/configs/ls1043ardb.h
+++ b/include/configs/ls1043ardb.h
@@ -281,7 +281,6 @@
 
 /* USB */
 #ifndef SPL_NO_USB
-#define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT3
 #endif
 
diff --git a/include/configs/ls1046aqds.h b/include/configs/ls1046aqds.h
index d47616f2e7..2f2602f098 100644
--- a/include/configs/ls1046aqds.h
+++ b/include/configs/ls1046aqds.h
@@ -137,7 +137,6 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 /* USB */
-#define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 3
 
 /* SATA */
diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h
index 32b08d8229..40ce8ff462 100644
--- a/include/configs/ls1046ardb.h
+++ b/include/configs/ls1046ardb.h
@@ -211,7 +211,6 @@
 
 /* USB */
 #ifndef SPL_NO_USB
-#define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 3
 #endif
 
diff --git a/include/configs/ls2080aqds.h 

[U-Boot] [PATCH v4 1/5] arm64: layerscape: Move CONFIG_HAS_FSL_XHCI_USB to Kconfig

2017-10-22 Thread Ran Wang
Use Kconfig to select QE-HDLC and USB pin-mux.

Signed-off-by: Ran Wang 
Reviewed-by: Bin Meng 
---
Change in v4:
Typo correction.

Change in v3:
New patch file.

 arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 7 +++
 include/configs/ls1012afrdm.h | 4 
 include/configs/ls1012aqds.h  | 4 
 include/configs/ls1012ardb.h  | 4 
 include/configs/ls1021aiot.h  | 4 
 include/configs/ls1021aqds.h  | 4 
 include/configs/ls1021atwr.h  | 4 
 include/configs/ls1043aqds.h  | 3 ---
 include/configs/ls1043ardb.h  | 3 ---
 include/configs/ls1046aqds.h  | 3 ---
 include/configs/ls1046ardb.h  | 3 ---
 include/configs/ls2080aqds.h  | 1 -
 include/configs/ls2080ardb.h  | 1 -
 scripts/config_whitelist.txt  | 1 -
 14 files changed, 7 insertions(+), 39 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig 
b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
index 3518d8601d..84e689b6e1 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
+++ b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
@@ -489,3 +489,10 @@ config SYS_MC_RSV_MEM_ALIGN
 
 config SPL_LDSCRIPT
default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARCH_LS1043A || 
ARCH_LS1046A || ARCH_LS2080A
+
+config HAS_FSL_XHCI_USB
+   bool
+   default y if ARCH_LS1043A || ARCH_LS1046A
+   help
+ For some SoC(such as LS1043A and LS1046A), USB and QE-HDLC multiplex 
use
+ pins, select it when the pins are assigned to USB.
diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h
index 6b1ba578e9..2e5af9cc4e 100644
--- a/include/configs/ls1012afrdm.h
+++ b/include/configs/ls1012afrdm.h
@@ -34,12 +34,8 @@
 /*
 * USB
 */
-#define CONFIG_HAS_FSL_XHCI_USB
-
-#ifdef CONFIG_HAS_FSL_XHCI_USB
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
 
 #define CONFIG_CMD_MEMINFO
 #define CONFIG_CMD_MEMTEST
diff --git a/include/configs/ls1012aqds.h b/include/configs/ls1012aqds.h
index b3121d2c21..e0949d0b53 100644
--- a/include/configs/ls1012aqds.h
+++ b/include/configs/ls1012aqds.h
@@ -119,12 +119,8 @@
 #endif
 
 /*XHCI Support - enabled by default*/
-#define CONFIG_HAS_FSL_XHCI_USB
-
-#ifdef CONFIG_HAS_FSL_XHCI_USB
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
 
 /*  MMC  */
 #ifdef CONFIG_MMC
diff --git a/include/configs/ls1012ardb.h b/include/configs/ls1012ardb.h
index e9edcd2bc9..66ff004384 100644
--- a/include/configs/ls1012ardb.h
+++ b/include/configs/ls1012ardb.h
@@ -22,12 +22,8 @@
 /*
 * USB
 */
-#define CONFIG_HAS_FSL_XHCI_USB
-
-#ifdef CONFIG_HAS_FSL_XHCI_USB
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
 
 /*
  * I2C IO expander
diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h
index 3fe7b8f44c..2cbea87d95 100644
--- a/include/configs/ls1021aiot.h
+++ b/include/configs/ls1021aiot.h
@@ -20,12 +20,8 @@
 #define CONFIG_SYS_INIT_RAM_SIZE   OCRAM_SIZE
 
 /* XHCI Support - enabled by default */
-#define CONFIG_HAS_FSL_XHCI_USB
-
-#ifdef CONFIG_HAS_FSL_XHCI_USB
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT1
-#endif
 
 #define CONFIG_SYS_CLK_FREQ1
 #define CONFIG_DDR_CLK_FREQ1
diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index f3d3aa2271..0046ded536 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -405,12 +405,8 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 /*XHCI Support - enabled by default*/
-#define CONFIG_HAS_FSL_XHCI_USB
-
-#ifdef CONFIG_HAS_FSL_XHCI_USB
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT1
-#endif
 
 /*
  * Video
diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index 852ff57fb6..0172c9015d 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -45,12 +45,8 @@
 #endif
 
 /* XHCI Support - enabled by default */
-#define CONFIG_HAS_FSL_XHCI_USB
-
-#ifdef CONFIG_HAS_FSL_XHCI_USB
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT1
-#endif
 
 #define CONFIG_SYS_CLK_FREQ1
 #define CONFIG_DDR_CLK_FREQ1
diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
index 5aadd92efd..607c289d17 100644
--- a/include/configs/ls1043aqds.h
+++ b/include/configs/ls1043aqds.h
@@ -371,11 +371,8 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 /* USB */
-#define CONFIG_HAS_FSL_XHCI_USB
-#ifdef CONFIG_HAS_FSL_XHCI_USB
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT3
-#endif
 
 /*
  * Miscellaneous configurable options
diff --git a/include/configs/ls1043ardb.h b/include/configs/ls1043ardb.h
index 

Re: [U-Boot] [PATCH 6/9] spi: ich: Lock down controller settings if required

2017-10-22 Thread Bin Meng
Hi Simon,

On Sun, Oct 22, 2017 at 10:36 PM, Simon Glass  wrote:
> On 19 October 2017 at 03:20, Bin Meng  wrote:
>> Some Intel FSP (like Braswell) does SPI lock-down during the call
>> to fsp_notify(INIT_PHASE_BOOT). But before SPI lock-down is done,
>> it's bootloader's responsibility to configure the SPI controller's
>> opcode registers properly otherwise SPI controller driver doesn't
>> know how to communicate with the SPI flash device.
>>
>> Rather than passively doing the opcode configuration, let's add a
>> simple DTS property "intel,spi-lock-down" and let the driver call
>> the opcode configuration function if required by such FSP.
>>
>> Signed-off-by: Bin Meng 
>> ---
>>
>>  drivers/spi/ich.c | 22 ++
>>  drivers/spi/ich.h |  1 +
>>  2 files changed, 23 insertions(+)
>
> Does this go in a binding file somewhere?
>

Looks there is no binding file for Intel SPI controller driver. We
will need create one.

> Reviewed-by: Simon Glass 

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


[U-Boot] [PATCH] image-sig: use designated initializers for algorithm

2017-10-22 Thread Masahiro Yamada
Designated initializers are more readable because we do not
have to check the order in the struct definitions.

Signed-off-by: Masahiro Yamada 
---

 common/image-sig.c | 44 ++--
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/common/image-sig.c b/common/image-sig.c
index 455f2b9..bf824fe 100644
--- a/common/image-sig.c
+++ b/common/image-sig.c
@@ -32,42 +32,42 @@ void *image_get_host_blob(void)
 
 struct checksum_algo checksum_algos[] = {
{
-   "sha1",
-   SHA1_SUM_LEN,
-   SHA1_DER_LEN,
-   sha1_der_prefix,
+   .name = "sha1",
+   .checksum_len = SHA1_SUM_LEN,
+   .der_len = SHA1_DER_LEN,
+   .der_prefix = sha1_der_prefix,
 #if IMAGE_ENABLE_SIGN
-   EVP_sha1,
+   .calculate_sign = EVP_sha1,
 #endif
-   hash_calculate,
+   .calculate = hash_calculate,
},
{
-   "sha256",
-   SHA256_SUM_LEN,
-   SHA256_DER_LEN,
-   sha256_der_prefix,
+   .name = "sha256",
+   .checksum_len = SHA256_SUM_LEN,
+   .der_len = SHA256_DER_LEN,
+   .der_prefix = sha256_der_prefix,
 #if IMAGE_ENABLE_SIGN
-   EVP_sha256,
+   .calculate_sign = EVP_sha256,
 #endif
-   hash_calculate,
+   .calculate = hash_calculate,
}
 
 };
 
 struct crypto_algo crypto_algos[] = {
{
-   "rsa2048",
-   RSA2048_BYTES,
-   rsa_sign,
-   rsa_add_verify_data,
-   rsa_verify,
+   .name = "rsa2048",
+   .key_len = RSA2048_BYTES,
+   .sign = rsa_sign,
+   .add_verify_data = rsa_add_verify_data,
+   .verify = rsa_verify,
},
{
-   "rsa4096",
-   RSA4096_BYTES,
-   rsa_sign,
-   rsa_add_verify_data,
-   rsa_verify,
+   .name = "rsa4096",
+   .key_len = RSA4096_BYTES,
+   .sign = rsa_sign,
+   .add_verify_data = rsa_add_verify_data,
+   .verify = rsa_verify,
}
 
 };
-- 
2.7.4

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


[U-Boot] sunxi: broken sun4i_emacs, all boards?

2017-10-22 Thread Artturi Alm
Hi,

this has been 'blocking' my attempts to revive the A10-boards i have
since early june, or so.

now i found this commit abc3e4df59f54cf3dda42a35a75d617fe861f5fe, which
left the drivers/net/Makefile untouched, essentially breaking sunxi_emac.

the diff below didn't fix it however, i can see how it does arp who-has,
and the remote replying, but u-boot does act as if nothing is received back?

-Artturi


U-Boot SPL 2017.11-rc2-2-g24b253e-dirty (Oct 22 2017 - 22:07:19)
DRAM: 1024 MiB
CPU: 100800Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC1


U-Boot 2017.11-rc2-2-g24b253e-dirty (Oct 22 2017 - 22:07:19 +0300) 
Allwinner Technology

CPU:   Allwinner A10 (SUN4I)
Model: Cubietech Cubieboard
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:serial
Out:   serial
Err:   serial
SCSI:  SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net:   eth0: ethernet@01c0b000
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
   scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
=> env set ipaddr 192.168.2.10
=> ping 192.168.2.2
resetting device
ENET Speed is 100 Mbps - FULL duplex connection
Using ethernet@01c0b000 device

ARP Retry count exceeded; starting again
ping failed; host 192.168.2.2 is not alive
=>





diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index d67927c..2e35563 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -219,6 +219,7 @@ config SUN7I_GMAC
 config SUN4I_EMAC
bool "Allwinner Sun4i Ethernet MAC support"
depends on DM_ETH
+select PHYLIB
help
  This driver supports the Allwinner based SUN4I Ethernet MAC.
 
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 94a4fd8..ac5443c 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -21,7 +21,7 @@ obj-$(CONFIG_DNET) += dnet.o
 obj-$(CONFIG_E1000) += e1000.o
 obj-$(CONFIG_E1000_SPI) += e1000_spi.o
 obj-$(CONFIG_EEPRO100) += eepro100.o
-obj-$(CONFIG_SUNXI_EMAC) += sunxi_emac.o
+obj-$(CONFIG_SUN4I_EMAC) += sunxi_emac.o
 obj-$(CONFIG_SUN8I_EMAC) += sun8i_emac.o
 obj-$(CONFIG_ENC28J60) += enc28j60.o
 obj-$(CONFIG_EP93XX) += ep93xx_eth.o
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 9175117..b12f7e1 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -291,7 +291,7 @@ extern int soft_i2c_gpio_scl;
 #endif /* CONFIG_VIDEO */
 
 /* Ethernet support */
-#ifdef CONFIG_SUNXI_EMAC
+#ifdef CONFIG_SUN4I_EMAC
 #define CONFIG_PHY_ADDR1
 #define CONFIG_MII /* MII PHY management   */
 #endif
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 3037d61..82b927c 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -2272,7 +2272,6 @@ CONFIG_STV0991_HZ
 CONFIG_STV0991_HZ_CLOCK
 CONFIG_ST_SMI
 CONFIG_SUNXI_AHCI
-CONFIG_SUNXI_EMAC
 CONFIG_SUNXI_GPIO
 CONFIG_SUNXI_MAX_FB_SIZE
 CONFIG_SUNXI_USB_PHYS
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [GIT PULL] u-boot-uniphier/master

2017-10-22 Thread Masahiro Yamada
Hi Tom,


This was late for -rc2 for some reason, but it includes
what I intended to include in it.
Some fixes, remove unused CONFIG, DT sync, etc.
Please pull.



The following changes since commit 23d51bef94aacd0ad4dcbdb31e66acd82def13eb:

  uniphier_ld4_sld8: Re-add SMC911X_BASE address (2017-10-21 10:26:34 -0400)

are available in the git repository at:

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

for you to fetch changes up to 624c0954c7be03d92a20170ffc551ca7e9853e16:

  ARM: uniphier: use pr_*() more where appropriate (2017-10-23 01:09:22 +0900)


Masahiro Yamada (8):
  ARM: uniphier: enable DWC3 xHCI driver really
  ARM: uniphier: remove CONFIG_UNIPHIER_ETH
  ARM: uniphier: split u-boot,dm-pre-reloc out to uniphier-v7-u-boot.dtsi
  ARM: dts: uniphier: sync DT with Linux 4.14-rc5
  ARM: uniphier: increase CONFIG_SYS_BOOTM_LEN to 32MB
  ARM: uniphier: remove verify=n from environments
  doc: uniphier: add simple guide to Verified Boot
  ARM: uniphier: use pr_*() more where appropriate

 arch/arm/dts/uniphier-ld11.dtsi   |  13 ++
 arch/arm/dts/uniphier-ld20.dtsi   |  30 +++
 arch/arm/dts/uniphier-ld4-ref.dts |   9 +-
 arch/arm/dts/uniphier-ld4.dtsi|   3 -
 arch/arm/dts/uniphier-ld6b-ref.dts|   9 +-
 arch/arm/dts/uniphier-pinctrl.dtsi|  15 ++
 arch/arm/dts/uniphier-pro4-ace.dts|   9 -
 arch/arm/dts/uniphier-pro4-ref.dts|   9 -
 arch/arm/dts/uniphier-pro4-sanji.dts  |  21 ---
 arch/arm/dts/uniphier-pro4.dtsi   |   4 -
 arch/arm/dts/uniphier-pro5-4kbox.dts  |   9 -
 arch/arm/dts/uniphier-pro5.dtsi   |   4 -
 arch/arm/dts/uniphier-pxs2-gentil.dts |  21 ---
 arch/arm/dts/uniphier-pxs2-vodka.dts  |  21 ---
 arch/arm/dts/uniphier-pxs2.dtsi   |   4 -
 arch/arm/dts/uniphier-pxs3-ref.dts|   4 +
 arch/arm/dts/uniphier-sld8-ref.dts|   9 +-
 arch/arm/dts/uniphier-sld8.dtsi   |   3 -
 arch/arm/dts/uniphier-v7-u-boot.dtsi  |  61 ++
 arch/arm/mach-uniphier/Kconfig|   2 +
 arch/arm/mach-uniphier/clk/clk-ld4.c  |   6 -
 arch/arm/mach-uniphier/clk/clk-pro4.c |   6 -
 arch/arm/mach-uniphier/clk/clk-pxs2.c |   6 -
 arch/arm/mach-uniphier/dram/ddrphy-training.c |  18 +-
 configs/uniphier_v7_defconfig |   2 +
 doc/README.uniphier   | 227 ++-
 include/configs/uniphier.h|   2 +-
 27 files changed, 370 insertions(+), 157 deletions(-)
 create mode 100644 arch/arm/dts/uniphier-v7-u-boot.dtsi


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


Re: [U-Boot] [PATCH] doc: uniphier: add simple guide to Verified Boot

2017-10-22 Thread Masahiro Yamada
2017-10-22 15:15 GMT+09:00 Masahiro Yamada :
> Add a simple documentation about how to use the Verified Boot on
> UniPhier boards.
>
> Signed-off-by: Masahiro Yamada 
> ---


Applied to u-boot-uniphier/master.

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


Re: [U-Boot] [PATCH] ARM: uniphier: remove verify=n from environments

2017-10-22 Thread Masahiro Yamada
2017-10-21 19:51 GMT+09:00 Masahiro Yamada :
> If the environment "verify" is set to n, the image verification
> is entirely skipped.  Remove it as a preparation for verified boot.
>
> Signed-off-by: Masahiro Yamada 
> ---


Applied to u-boot-uniphier/master.


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


Re: [U-Boot] [PATCH] ARM: uniphier: increase CONFIG_SYS_BOOTM_LEN to 32MB

2017-10-22 Thread Masahiro Yamada
2017-10-19 19:17 GMT+09:00 Masahiro Yamada :
> The default value of CONFIG_SYS_BOOTM_LEN, 0x80, causes error
> when uncompressing Image.gz out of fit.
>
>Uncompressing Kernel Image ... Error: inflate() returned -5
> Image too large: increase CONFIG_SYS_BOOTM_LEN
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  include/configs/uniphier.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
> index 1d3bf98..abee461 100644
> --- a/include/configs/uniphier.h
> +++ b/include/configs/uniphier.h
> @@ -105,6 +105,7 @@
>
>  #define CONFIG_LOADADDR0x8400
>  #define CONFIG_SYS_LOAD_ADDR   CONFIG_LOADADDR
> +#define CONFIG_SYS_BOOTM_LEN   (32 << 20)
>
>  #define CONFIG_CMDLINE_EDITING /* add command line history */
>

Applied to u-boot-uniphier/master.



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


Re: [U-Boot] [PATCH 1/4] ARM: uniphier: enable DWC3 xHCI driver really

2017-10-22 Thread Masahiro Yamada
2017-10-17 21:19 GMT+09:00 Masahiro Yamada :
> I thought commit d37d31849c6a ("ARM: uniphier: enable DWC3 xHCI
> driver") enabled CONFIG_USB_DWC3_UNIPHIER, but CONFIG_USB_XHCI_DWC3
> was missing in uniphier_v7_defconfig.  Re-add.
>
> Signed-off-by: Masahiro Yamada 
> ---

Applied to u-boot-uniphier/master.



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


Re: [U-Boot] [PATCH 5/5] lib: libfdt: wrap scripts/dtc/libfdt/* where possible

2017-10-22 Thread Masahiro Yamada
2017-10-22 23:35 GMT+09:00 Simon Glass :
> Hi Masahiro,
>
> On 17 October 2017 at 15:30, Masahiro Yamada
>  wrote:
>> lib/libfdt/ and scripts/dtc/libfdt have the same copies for the
>> followings 6 files:
>>   fdt.c fdt_addresses.c fdt_empty_tree.c fdt_overlay.c fdt_strerr.c
>>   fdt_sw.c
>>
>> Make them a wrapper of scripts/dtc/libfdt/*.  This is exactly what
>> Linux does to sync libfdt.  In order to make is possible, import
>>  and  from Linux 4.14-rc5.
>>
>> Unfortunately, U-Boot locally modified the following 3 files:
>>   fdt_ro.c fdt_wip.c fdt_rw.c
>>
>> The fdt_region.c is U-Boot own file.
>>
>> I did not touch them in order to avoid unpredictable impact.
>>
>> Signed-off-by: Masahiro Yamada 
>> ---
>>
>>  include/libfdt_env.h|   6 -
>>  include/linux/libfdt.h  |  17 +
>>  include/linux/libfdt_env.h  |  22 ++
>>  lib/libfdt/Makefile |  17 +-
>>  lib/libfdt/fdt.c| 212 +--
>>  lib/libfdt/fdt_addresses.c  |  57 +--
>>  lib/libfdt/fdt_empty_tree.c |  39 +-
>>  lib/libfdt/fdt_overlay.c| 863 
>> +---
>>  lib/libfdt/fdt_strerror.c   |  63 +---
>>  lib/libfdt/fdt_sw.c | 256 +
>>  10 files changed, 63 insertions(+), 1489 deletions(-)
>>  create mode 100644 include/linux/libfdt.h
>>  create mode 100644 include/linux/libfdt_env.h
>>
>
> I am not hugely keen on this. At present I can compare upstream with
> U-Boot directly. Why do I need to worry about scripts/? Why are the
> files even duplicated in there?


There are two copies.  Is it ok to keep both?


As I explained in the following patch
http://patchwork.ozlabs.org/patch/826742/
scripts/dtc reflects the directory structure of the upstream DTC.

So, I believe syncing scripts/lib/libfdt is consistent
and requires least effort to import outcomes from upstream DTC/kernel.

I am opposed to edit file locally.
This is make the sync work difficult.
We can split U-Boot specific functions out to lib/libfdt/fdt-local.c
(the file name is not important, it could be anything)


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


Re: [U-Boot] [PATCH 1/5] libfdt: change fdt.h to a wrapper of scripts/dtc/libfdt/*

2017-10-22 Thread Masahiro Yamada
Hi Simon,

2017-10-22 23:35 GMT+09:00 Simon Glass :
> Hi Masahiro,
>
> On 17 October 2017 at 15:30, Masahiro Yamada
>  wrote:
>> Fortunately, U-Boot did not modify fdt.h locally.
>>
>> Change it to a wrapper of scripts/dtc/libfdt/fdt.h, which will be
>> periodically synced with the upstream DTC (or kernel).
>>
>> Signed-off-by: Masahiro Yamada 
>> ---
>>
>>  include/fdt.h|  2 +-
>>  lib/libfdt/fdt.h | 67 
>> 
>>  2 files changed, 1 insertion(+), 68 deletions(-)
>>  delete mode 100644 lib/libfdt/fdt.h
>
> There was a recent change to make this use the file in lib/libfdt.
> That makes it easier to sync with upstream dtc.
>
> Can you please explain in a little more detail the motivation for this patch?
>

lib/libfdt was the central sync point of libfdt,
but the situation changed by the switch to the bundled DTC approach.

Now we have two copies in lib/libfdt and scripts/dtc/libfdt.

See Linux.
scripts/dtc is periodically synced with DTC, including scripts/dtc/libfdt.
lib/fdt* are wrappers to scripts/dtc/libfdt/fdt*
I think this is very successful.

So, I am trying to leave only scripts/dtc/libfdt
and turn others into wrappers of them.



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


Re: [U-Boot] [PATCH] tools: image: fix node name of signature node in FIT

2017-10-22 Thread Masahiro Yamada
Hi Simon,

2017-10-22 23:36 GMT+09:00 Simon Glass :
> On 19 October 2017 at 12:16, Masahiro Yamada
>  wrote:
>> Both "conf_name" and "sig_name" point to the name of config node.
>> The latter should be the name of the signature node.
>>
>> Signed-off-by: Masahiro Yamada 
>> ---
>>
>>  tools/image-host.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Simon Glass 
>
> There is no test which checks this?


The "sig_name" is only used as an argument to printf()
in this function.
So, test/py cannot detect this.




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


Re: [U-Boot] [PATCH 7/9] x86: braswell: cherryhill: Update dts for SPI lock down

2017-10-22 Thread Simon Glass
On 19 October 2017 at 03:20, Bin Meng  wrote:
> Intel Braswell FSP requires SPI controller settings to be locked down,
> let's do this in the chrryhill.dts and remove previous Kconfig option.
>
> Signed-off-by: Bin Meng 
> ---
>
>  arch/x86/cpu/braswell/Kconfig | 4 
>  arch/x86/dts/cherryhill.dts   | 1 +
>  2 files changed, 1 insertion(+), 4 deletions(-)

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


Re: [U-Boot] [PATCH 1/1] efi_loader: disable saving of EFI variables

2017-10-22 Thread Simon Glass
On 20 October 2017 at 00:15, Heinrich Schuchardt  wrote:
> The current implementation of saving of EFI variables has
> unwanted side effects:
>
> - Writing to flash on every boot may harm the memory.
> - All variables are saved. Not only the EFI ones.
> - Variables are saved even if there is not change.
>
> So let us disable saving for now until we have a complete
> solution.
>
> This will also mean every boot is "first boot", ie. falling back
> to fallback.efi to populate BootOrder/Boot variables, and
> never using bootmgr.
>
> Fixes: ad644e7c1823 efi_loader: efi variable support
> Signed-off-by: Heinrich Schuchardt 
> ---
>  lib/efi_loader/efi_boottime.c | 13 +++--
>  1 file changed, 11 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH v3 08/18] efi_selftest: reformat code

2017-10-22 Thread Simon Glass
On 18 October 2017 at 00:02, Heinrich Schuchardt  wrote:
> Remove superfluous spaces.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v3
> new patch split off
> ---
>  lib/efi_selftest/efi_selftest.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH 4/9] x86: Fix ACPI resume dependency to MRC cache

2017-10-22 Thread Simon Glass
On 19 October 2017 at 03:20, Bin Meng  wrote:
> In an S3 resume path, MRC cache is mandatory. Enforce the dependency
> in the Kconfig.
>
> Signed-off-by: Bin Meng 
> ---
>
>  arch/x86/Kconfig | 1 +
>  1 file changed, 1 insertion(+)

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


Re: [U-Boot] [PATCH 9/9] x86: acpi: Put sleepstates.asl to the common place

2017-10-22 Thread Simon Glass
On 19 October 2017 at 03:21, Bin Meng  wrote:
> The supported sleep states are generic on Intel processors. Move the
> ASL definition to the common place.
>
> Signed-off-by: Bin Meng 
> ---
>
>  arch/x86/include/asm/{arch-baytrail => }/acpi/sleepstates.asl |  0
>  arch/x86/include/asm/arch-baytrail/acpi/platform.asl  |  2 +-
>  arch/x86/include/asm/arch-quark/acpi/platform.asl |  2 +-
>  arch/x86/include/asm/arch-quark/acpi/sleepstates.asl  | 10 --
>  4 files changed, 2 insertions(+), 12 deletions(-)
>  rename arch/x86/include/asm/{arch-baytrail => }/acpi/sleepstates.asl (100%)
>  delete mode 100644 arch/x86/include/asm/arch-quark/acpi/sleepstates.asl

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


Re: [U-Boot] [PATCH v2 5/5] cmd: gpt: solve issue for swap

2017-10-22 Thread Simon Glass
On 16 October 2017 at 18:17, Patrick Delaunay  wrote:
> don't use prettyprint_part_size() in create_gpt_partitions_list()
> that avoid to align offset and size to 1 MiB and increase precision for
> start and size
> This patch avoid the risk to change partition size
> and lost data during swap
>
> Signed-off-by: Patrick Delaunay 
> ---
>
> Changes in v2: None
>
>  cmd/gpt.c | 12 ++--
>  test/py/tests/test_gpt.py | 12 ++--
>  2 files changed, 12 insertions(+), 12 deletions(-)

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


Re: [U-Boot] [PATCH] ARM: SPL: FIT: fix DTC warnings on FIT generation

2017-10-22 Thread Simon Glass
Hi Andre,

On 16 October 2017 at 23:30, André Przywara  wrote:
> Hi,
>
> sorry Simon for dropping the ball earlier. I will try to answer both
> Jagan's and your concern below.
>
> On 16/10/17 21:59, Jagan Teki wrote:
>> On Mon, Oct 9, 2017 at 10:15 AM, Simon Glass  wrote:
>>> Hi Andre,
>>>
>>> On 4 October 2017 at 17:24, Andre Przywara  wrote:
 Newer versions of the device tree compiler (rightfully) complain about
 mismatches between attributed node names (name@) and a missing
 reg property in that node.
 Adjust the FIT build script for 64-bit Allwinner boards to remove the
 bogus addresses from the node names and avoid the warnings.

 Signed-off-by: Andre Przywara 
 ---
  board/sunxi/mksunxi_fit_atf.sh | 16 
  1 file changed, 8 insertions(+), 8 deletions(-)
>>>
>>> It looks like we have this problem all over the place. The
>>> documentation in doc/uImage now seems to have this problem too.
>>>
>>> I wonder if instead we should add reg / #address-cells / #size-cells 
>>> properties?
>>
>> If the update on dts, might be an another-overhead to maintain u-boot
>> dts wrt Linux dts sync.
>
> This is not the kernel .dts, but the FIT image description (using the
> DTS format), which is purely private to U-Boot. I erroneously used
> addresses (fdt@1) to enumerate different FDTs.
> I don't think this is right, since those FDTs don't have anything which
> would resemble an address. Instead the SPL just chooses one of them, and
> the script generates as many as we give it (from defconfig).
>
> So I don't see much sense in introducing a "reg" property. Multiple
> instances of an UART are alive at the same time, so an address property
> makes sense. But we just need *one* FDT and some unique name used to
> match configuration entries to the appropriate image. Actually those
> identifiers could be totally random as well, or we actually use
> something derived from the filename.
> But for simplicity I'd just go with the underscore notation, unless
> someone convinces me otherwise.

OTOH this really just a feature of the DT format. Adding a 'reg'
property can be justified on that basis. Or perhaps we should have an
option for dtc to support 'degenerate' .dts files?

The underscore is normally used for phandles.

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


Re: [U-Boot] [PATCH 6/9] spi: ich: Lock down controller settings if required

2017-10-22 Thread Simon Glass
On 19 October 2017 at 03:20, Bin Meng  wrote:
> Some Intel FSP (like Braswell) does SPI lock-down during the call
> to fsp_notify(INIT_PHASE_BOOT). But before SPI lock-down is done,
> it's bootloader's responsibility to configure the SPI controller's
> opcode registers properly otherwise SPI controller driver doesn't
> know how to communicate with the SPI flash device.
>
> Rather than passively doing the opcode configuration, let's add a
> simple DTS property "intel,spi-lock-down" and let the driver call
> the opcode configuration function if required by such FSP.
>
> Signed-off-by: Bin Meng 
> ---
>
>  drivers/spi/ich.c | 22 ++
>  drivers/spi/ich.h |  1 +
>  2 files changed, 23 insertions(+)

Does this go in a binding file somewhere?

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


[U-Boot] How to enable USB Mass Storage

2017-10-22 Thread Frank Kunz
Hello,

I want to use the ums command to access the SD card of a A20-OlinuxIno-Lime 
board via usb-org cable. For that I start the CPU in FEL mode, download the  
u-boot-sunxi-with-spl.bin file by sunxi-fel tool. I do this FEL mode boot for 
preparation of an Einstein A20 board, which has only an internal MMC. I run on 
uboot serial console:

=> ums 0 mmc 0   
UMS: LUN 0, dev 0, hwpart 0, sector 0x0, count 0x1dc000
Controller uninitialized 
g_dnl_register: failed!, error: -6 
g_dnl_register failed


It seems that the drivers/usb/musb-new/sunxi.c is not initialized. The 
devicetree has a node that should match:

usb@01c13000 {
compatible = "allwinner,sun4i-a10-musb";
reg = <0x1c13000 0x400>;
clocks = <0x2 0x0>;
interrupts = <0x0 0x26 0x4>;
interrupt-names = "mc";
phys = <0x2b 0x0>;
phy-names = "usb";
extcon = <0x2b 0x0>;
allwinner,sram = <0x2c 0x1>;
status = "okay";
dr_mode = "otg";
};


My config is:

cat defconfig 
CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=384
CONFIG_MMC0_CD_PIN="PH1"
CONFIG_I2C1_ENABLE=y
CONFIG_SATAPWR="PC3"
CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime"
CONFIG_AHCI=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_SPL=y
CONFIG_SPL_I2C_SUPPORT=y
# CONFIG_FASTBOOT is not set
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_CMD_USB_MASS_STORAGE=y
# CONFIG_SPL_DOS_PARTITION is not set
# CONFIG_SPL_ISO_PARTITION is not set
# CONFIG_SPL_EFI_PARTITION is not set
CONFIG_ETH_DESIGNWARE=y
CONFIG_SUN7I_GMAC=y
CONFIG_AXP_ALDO3_VOLT=2800
CONFIG_AXP_ALDO4_VOLT=2800
CONFIG_SCSI=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_MUSB_GADGET=y
CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
CONFIG_USB_GADGET_DOWNLOAD=y
# CONFIG_USB_ETHER is not set

Is the ums working for Allwinner CPUs, or is there some further configuration 
needed that I have not figured out?

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


Re: [U-Boot] [PATCH v3 18/18] efi_loader: set parent handle in efi_load_image

2017-10-22 Thread Simon Glass
On 18 October 2017 at 00:02, Heinrich Schuchardt  wrote:
> The parent_handle of the loaded image must be set.
> Set the system table.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v3
> new patch
> ---
>  lib/efi_loader/efi_boottime.c | 2 ++
>  1 file changed, 2 insertions(+)

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


Re: [U-Boot] [PATCH v3 04/18] efi_loader: new function utf8_to_utf16

2017-10-22 Thread Simon Glass
On 18 October 2017 at 00:02, Heinrich Schuchardt  wrote:
> Provide a conversion function from utf8 to utf16.
>
> Add missing #include  in include/charset.h.
> Remove superfluous #include  in lib/charset.c.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v3
> no change
> v2
> new patch
> ---
>  include/charset.h | 15 +++
>  lib/charset.c | 57 
> ++-
>  2 files changed, 71 insertions(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH 1/1] Kconfig: add CONFIG_BROKEN

2017-10-22 Thread Simon Glass
On 19 October 2017 at 23:49, Heinrich Schuchardt  wrote:
> Provide a Kconfig option that we can use as dependency for
> features that are broken. This allows to easily disable them
> without removing the code.
>
> As no short text is supplied the option will not appear in
> menuconfig.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
>  Kconfig | 6 ++
>  1 file changed, 6 insertions(+)

Fair enough.

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


Re: [U-Boot] i.MX6: Prealloc pinctrl make U-Boot hang at relocation (data abort)

2017-10-22 Thread Simon Glass
Hi Jagan,

On 17 October 2017 at 00:53, Jagan Teki  wrote:
> + Tom
>
>
> On 17-Oct-2017 12:44 AM, "Jagan Teki"  wrote:
>
> Hi,
>
> I'm trying to use SPL_OF_CONTROL with u-boot,dm-spl So I've marked
> u-boot,dm-spl with pinctrl since MMC used the pinconfig.
>
> The issue observed here is SPL handover to U-Boot proper and before
> relocation U-Boot probed imx_thermal dm-driver through device_probe.
> But the same time device_probe unnecessary probing all u-boot,dm-spl
> marked nodes(which are strictly related for SPL) Since pinctrl marked
> as u-boot, dm-spl the same probed and this might be the show-stopper.
>
> Based on the data abort, the code hang at relocation code, relocate.S,
> eventually stop calling uclass_get_device( was called in
> arch/arm/mach-imx/cpu.c) during board_f or unmark u-boot,dm-spl make
> U-Boot boots.
>
> Below are relocation code hang point and Log dump, request for any inputs.
>
> Relocation code:
> --
>
> /* relative fix: increase location by offset */
> add r0, r0, r4
> 87800ac4:   e084add r0, r0, r4
> ldr r1, [r0]
> 87800ac8:   e5901000ldr r1, [r0]   /* HANG */
> add r1, r1, r4
> 87800acc:   e0811004add r1, r1, r4
> str r1, [r0]
> 87800ad0:   e5801000str r1, [r0]
>
> 87800ad4 :
>
> Log:
> -
> U-Boot SPL 2017.11-rc1-00165-g7340683-dirty (Oct 17 2017 - 04:00:01)
> Trying to boot from MMC1
>
> device_probe: Process pinctrl for soc
>
> device_probe: Process pinctrl for aips-bus@0200
> initialized IMX pinctrl driver
>
> device_probe: Process pinctrl for aips-bus@0210
>
> device_probe: Process pinctrl for usdhc@0219
>
> device_probe: Process pinctrl for usdhc1grp
>
> device_probe: Process pinctrl for gpio@0209c000
> Expected Linux image is not found. Trying to start U-boot
>
>
> U-Boot 2017.11-rc1-00165-g7340683-dirty (Oct 17 2017 - 04:00:01 +0530)
>
> U-Boot code: 8780 -> 8783FB38  BSS: -> 87857338
> CPU:   Freescale i.MX6UL rev1.1 528 MHz (running at 396 MHz)
> CPU:   Industrial temperature grade (-40C to 105C)
> device_probe: Process pinctrl for imx_thermal
>
> device_probe: Process pinctrl for soc
>
> device_probe: Process pinctrl for aips-bus@0200
> initialized IMX pinctrl driver
>  at 31C
> Reset cause: POR
> Model: Engicam Is.IoT MX6UL MMC Starterkit
> DRAM:  Monitor len: 00057338
> Ram size: 0800
> Ram top: 8800
> TLB table from 87ff to 87ff4000
> Reserving 348k for U-Boot at: 87f98000
> Reserving 16384k for malloc() at: 86f98000
> Reserving 80 Bytes for Board Info at: 86f97fb0
> Reserving 240 Bytes for Global Data at: 86f97ec0
> Reserving 24448 Bytes for FDT at: 86f91f40
>
> RAM Configuration:
> Bank #0: 8000
> DRAM:  128 MiB
> New Stack Pointer is: 86f91f20
> Relocation Offset is: 00798000
> Relocating to 87f98000, new gd at 86f97ec0, sp at 86f91f20
> data abort
> pc : [<87800ac8>]  lr : [<87f986ac>]
> sp : 86f91f20  ip : 001c fp : 0017
> r10: 8783fa98  r9 : 86f97ec0 r8 : 00913b18
> r7 : deadbeef  r6 : 0091de88 r5 : 87800320  r4 : 00798000
> r3 : 87848848  r2 : 87843820 r1 : 0017  r0 : 02878000
> Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> Resetting CPU ...
>
> resetting ...
>
> thanks!
> --
> Jagan Teki
> Free Software Engineer | www.openedev.com
> U-Boot, Linux | Upstream Maintainer
> Hyderabad, India.
>
>

I am no sure of the issue, but I suggest debugging it for a root cause.

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


Re: [U-Boot] [PATCH v3 16/18] test/py: fix typo in test_efi_loader.py

2017-10-22 Thread Simon Glass
On 18 October 2017 at 00:02, Heinrich Schuchardt  wrote:
> Make a comment line easier to read.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v3
> no change
> v2
> no change
> ---
>  test/py/tests/test_efi_loader.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH v2] power: extend prefix match to regulator-name property

2017-10-22 Thread Simon Glass
On 18 October 2017 at 11:39, Felix Brack  wrote:
> This patch extends pmic_bind_children prefix matching. In addition to
> the node name the property regulator-name is used while trying to match
> prefixes. This allows assigning different drivers to regulator nodes
> named regulator@1 and regulator@10 for example.
> I have discarded the idea of using other properties then regulator-name
> as I do not see any benefit in using property compatible or even
> regulator-compatible. Of course I am open to change this if there are
> good reasons to do so.
>
> Signed-off-by: Felix Brack 
> ---
>
> Changes in v2:
> - add documentation
> - add a regulator to the sandbox for testing
> - extend the test for the new sandbox regulator
>
>  arch/sandbox/dts/sandbox_pmic.dtsi   |  6 ++
>  doc/device-tree-bindings/regulator/regulator.txt | 16 ++--
>  drivers/power/pmic/pmic-uclass.c | 15 +--
>  include/power/sandbox_pmic.h |  5 -
>  test/dm/regulator.c  |  2 ++
>  5 files changed, 39 insertions(+), 5 deletions(-)

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


Re: [U-Boot] [PATCH v3 10/18] efi_selftest: deduplicate code

2017-10-22 Thread Simon Glass
On 18 October 2017 at 00:02, Heinrich Schuchardt  wrote:
> Move duplicate code to the new function efi_st_do_tests.
>
> Suggested-by: Alexander Graf 
> Signed-off-by: Heinrich Schuchardt 
> ---
> v3
> new patch
> ---
>  lib/efi_selftest/efi_selftest.c | 71 
> -
>  1 file changed, 42 insertions(+), 29 deletions(-)

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


Re: [U-Boot] [PATCH u-boot 1/3] net: phy: Add Amlogic Meson GXL Internal PHY support

2017-10-22 Thread Simon Glass
On 18 October 2017 at 10:02, Neil Armstrong  wrote:
> The Amlogic Meson GXL/GXM families embeds an internal RMII Ethernet PHY.
>
> The PHY acts as a generic PHY but needs a slight configuration right
> before it's configuration.
>
> Signed-off-by: Neil Armstrong 
> ---
>  drivers/net/phy/Kconfig |  3 +++
>  drivers/net/phy/Makefile|  1 +
>  drivers/net/phy/meson-gxl.c | 57 
> +
>  drivers/net/phy/phy.c   |  3 +++
>  include/phy.h   |  1 +
>  5 files changed, 65 insertions(+)
>  create mode 100644 drivers/net/phy/meson-gxl.c

We really should create a uclass for PHY drivers before adding any
more of these.

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


Re: [U-Boot] [PATCH] doc: verified-boot: fix crypto algorithm examples

2017-10-22 Thread Simon Glass
On 19 October 2017 at 12:37, Masahiro Yamada
 wrote:
> As you see in crypto_algos in common/image-sig.c, the algorithm
> should be either "rsa2048" or "rsa4096".  "rs2048" is a typo.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  doc/uImage.FIT/signature.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH] tools: image: fix node name of signature node in FIT

2017-10-22 Thread Simon Glass
On 19 October 2017 at 12:16, Masahiro Yamada
 wrote:
> Both "conf_name" and "sig_name" point to the name of config node.
> The latter should be the name of the signature node.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  tools/image-host.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass 

There is no test which checks this?
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 8/9] x86: fsp: graphics: Add some notes about the graphics info hob

2017-10-22 Thread Simon Glass
On 19 October 2017 at 03:20, Bin Meng  wrote:
> On some platforms (eg: Braswell), the FSP will not produce the
> graphics info HOB unless you plug some cables to the display
> interface (eg: HDMI) on the board. Add such notes in the FSP
> video driver.
>
> Signed-off-by: Bin Meng 
> ---
>
>  arch/x86/lib/fsp/fsp_graphics.c | 4 
>  1 file changed, 4 insertions(+)

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


Re: [U-Boot] [PATCH 3/9] env: x86: braswell: Set ENV_IS_IN_SPI_FLASH as default

2017-10-22 Thread Simon Glass
On 19 October 2017 at 03:20, Bin Meng  wrote:
> Imply does not work for a Kconfig choice. Update ENV_IS_IN_SPI_FLASH
> to be the default one for Intel Braswell.
>
> Signed-off-by: Bin Meng 
> ---
>
>  arch/x86/cpu/braswell/Kconfig | 1 -
>  env/Kconfig   | 1 +
>  2 files changed, 1 insertion(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH 2/9] x86: braswell: Fix unexpected crash during Linux kernel boot

2017-10-22 Thread Simon Glass
On 19 October 2017 at 03:20, Bin Meng  wrote:
> It was observed that when booting Linux kernel on Intel Cherry Hill
> board, unexpected crash happens quite randomly. Sometimes kernel
> just oops, while sometimes kernel throws MCE errors and hangs:
>
>   mce: [Hardware Error]: Machine check events logged
>   mce: [Hardware Error]: CPU 0: Machine Check: 0 Bank 4: c4010151
>   mce: [Hardware Error]: TSC 0 ADDR 130f3f2c0
>   mce: [Hardware Error]: PROCESSOR 0:406c3 TIME 1508160686 SOCKET 0 APIC 0 
> microcode 363
>
> This looks like a hardware error per mcelog. After debugging, it
> seems turning off turbo mode on the processor does not expose this
> behavior, although U-Boot runs OK with turbo mode on. Suspect it is
> related to an errata of Braswell processor.
>
> To fix this, remove the Braswell cpu driver which does the turbo
> mode configuration, and switch to use the generic cpu-x86 driver.
> Also there is a configuration option in the FSP that turns on the
> turbo mode and that has been turned off too.
>
> Signed-off-by: Bin Meng 
> ---
>
>  arch/x86/cpu/braswell/Makefile |   2 +-
>  arch/x86/cpu/braswell/cpu.c| 170 
> -
>  arch/x86/dts/cherryhill.dts|   9 +--
>  3 files changed, 5 insertions(+), 176 deletions(-)
>  delete mode 100644 arch/x86/cpu/braswell/cpu.c

Oh dear, what a sad patch.

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


Re: [U-Boot] [PATCH v3 14/18] efi_selftest: test reboot by watchdog

2017-10-22 Thread Simon Glass
On 18 October 2017 at 00:02, Heinrich Schuchardt  wrote:
> A test is added that verifies that the watchdog timer actually
> causes a reboot upon timeout. The test is only executed on
> request using
>
> setenv efi_selftest watchdog reboot
> bootefi selftest
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v3
> correct comments
> v2
> no change
> ---
>  lib/efi_selftest/efi_selftest_watchdog.c | 68 
> ++--
>  1 file changed, 57 insertions(+), 11 deletions(-)

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


Re: [U-Boot] [PATCH v3 13/18] efi_loader: use bootargs as load options

2017-10-22 Thread Simon Glass
On 18 October 2017 at 00:02, Heinrich Schuchardt  wrote:
> Use environment variable bootargs used as load options
> for bootefi payloads.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v3
> new patch split off
> ---
>  cmd/bootefi.c | 2 ++
>  1 file changed, 2 insertions(+)

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


Re: [U-Boot] [PATCH 2/2] i2c: stm32f7_i2c: fix usage of useless local variable

2017-10-22 Thread Simon Glass
On 11 October 2017 at 15:30,   wrote:
> From: Patrice Chotard 
>
> Remove useless local variable "s" and use directly
> function's parameter "output"
>
> Signed-off-by: Patrice Chotard 
> ---
>  drivers/i2c/stm32f7_i2c.c | 10 ++
>  1 file changed, 2 insertions(+), 8 deletions(-)

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


Re: [U-Boot] [PATCH 5/5] lib: libfdt: wrap scripts/dtc/libfdt/* where possible

2017-10-22 Thread Simon Glass
Hi Masahiro,

On 17 October 2017 at 15:30, Masahiro Yamada
 wrote:
> lib/libfdt/ and scripts/dtc/libfdt have the same copies for the
> followings 6 files:
>   fdt.c fdt_addresses.c fdt_empty_tree.c fdt_overlay.c fdt_strerr.c
>   fdt_sw.c
>
> Make them a wrapper of scripts/dtc/libfdt/*.  This is exactly what
> Linux does to sync libfdt.  In order to make is possible, import
>  and  from Linux 4.14-rc5.
>
> Unfortunately, U-Boot locally modified the following 3 files:
>   fdt_ro.c fdt_wip.c fdt_rw.c
>
> The fdt_region.c is U-Boot own file.
>
> I did not touch them in order to avoid unpredictable impact.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  include/libfdt_env.h|   6 -
>  include/linux/libfdt.h  |  17 +
>  include/linux/libfdt_env.h  |  22 ++
>  lib/libfdt/Makefile |  17 +-
>  lib/libfdt/fdt.c| 212 +--
>  lib/libfdt/fdt_addresses.c  |  57 +--
>  lib/libfdt/fdt_empty_tree.c |  39 +-
>  lib/libfdt/fdt_overlay.c| 863 
> +---
>  lib/libfdt/fdt_strerror.c   |  63 +---
>  lib/libfdt/fdt_sw.c | 256 +
>  10 files changed, 63 insertions(+), 1489 deletions(-)
>  create mode 100644 include/linux/libfdt.h
>  create mode 100644 include/linux/libfdt_env.h
>

I am not hugely keen on this. At present I can compare upstream with
U-Boot directly. Why do I need to worry about scripts/? Why are the
files even duplicated in there?

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


Re: [U-Boot] [PATCH v2 9/9] test/py: fix typo in test_efi_loader.py

2017-10-22 Thread Simon Glass
On 13 October 2017 at 19:33, Heinrich Schuchardt  wrote:
> Make a comment line easier to read.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v2
> no change
> ---
>  test/py/tests/test_efi_loader.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH v3 09/18] efi_selftest: efi_st_memcmp should return 0

2017-10-22 Thread Simon Glass
On 18 October 2017 at 00:02, Heinrich Schuchardt  wrote:
> If the compared memory areas match the return value should be 0.
> We should not use the unrelated constant EFI_ST_SUCCESS.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v3
> new patch split off
> ---
>  lib/efi_selftest/efi_selftest_util.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH v3 15/18] test/py: test reboot by EFI watchdog

2017-10-22 Thread Simon Glass
On 18 October 2017 at 00:02, Heinrich Schuchardt  wrote:
> Clear environment variable efi_selftest before executing the
> default tests.
>
> Provide a test verifying that the EFI watchdog
> reboots the system upon timeout.
>
> The test depends on CONFIG_CMD_EFI_SELFTEST=y.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v3
> no change
> v2
> choose test via environment variable
> ---
>  test/py/tests/test_efi_selftest.py | 14 +-
>  1 file changed, 13 insertions(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH v3 07/18] efi_selftest: provide a dummy device path

2017-10-22 Thread Simon Glass
On 18 October 2017 at 00:02, Heinrich Schuchardt  wrote:
> Currently we pass bootefi_device_path and bootefi_image_path as
> device and image path without initializing them. They may carry
> values from previous calls to bootefi.
>
> With the patch the variables are initialized valid dummy values.

*to* valid

>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v3
> new patch split off
> ---
>  cmd/bootefi.c | 6 ++
>  1 file changed, 6 insertions(+)

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


Re: [U-Boot] [PATCH v2 3/9] efi_selftest: provide test for watchdog timer

2017-10-22 Thread Simon Glass
On 13 October 2017 at 19:33, Heinrich Schuchardt  wrote:
> The test verifies that resetting the watchdog timer ensures
> that it is not called during the timeout period.
>
> Testing that the watchdog timer actually executes a reset
> would require a test outside the efi_selftest framework.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v2
> no change
> ---
>  lib/efi_selftest/Makefile|   5 +-
>  lib/efi_selftest/efi_selftest_watchdog.c | 185 
> +++
>  2 files changed, 189 insertions(+), 1 deletion(-)
>  create mode 100644 lib/efi_selftest/efi_selftest_watchdog.c

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


Re: [U-Boot] [PATCH v3 12/18] efi_selftest: correctly cleanup after selftest

2017-10-22 Thread Simon Glass
On 18 October 2017 at 00:02, Heinrich Schuchardt  wrote:
> After executing bootefi selftest
> * restore GD
> * unlink the load image handle
> * return 0 or 1 and not a truncated efi_status_t.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v3
> new patch split off
> ---
>  cmd/bootefi.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
Reviewed-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/5] disk: efi: correct the overlap check on GPT header and PTE

2017-10-22 Thread Simon Glass
On 16 October 2017 at 18:17, Patrick Delaunay  wrote:
> the partition starting at 0x4400 is refused with overlap error:
>   $> gpt write mmc 0 "name=test,start=0x4400,size=0"
>   Writing GPT: Partition overlap
>   error!
>
> even if the 0x4400 is the first available offset for LBA35 with default
> value:
> - MBR=LBA1
> - GPT header=LBA2
> - PTE= 32 LBAs (128 entry), 3 to 34
>
> And the command to have one partition for all the disk failed also :
>   $> gpt write mmc 0 "name=test,size=0"
>
> After the patch :
>
>   $> gpt write mmc 0 "name=test,size=0"
>   Writing GPT: success!
>   $> part list mmc 0
>
>   Partition Map for MMC device 0  --   Partition Type: EFI
>
>   Part  Start LBA   End LBA Name
> Attributes
> Type GUID
> Partition GUID
>   1 0x0022  0x01ce9fde  "test"
> attrs:  0x
> type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
> type:   data
> guid:   b4b84b8a-04e3-4000-0036-aff5c9c495b1
>
> And 0x22 = 34 LBA => offset = 0x4400 is accepted as expected
>
> Reviewed-by: Łukasz Majewski 
> Signed-off-by: Patrick Delaunay 
> ---
> gpt test are now OK
> ./test/py/test.py -k gpt --build
>
> test/py/tests/test_gpt.py ...
> => 7 passed, 228 deselected in 1.11 seconds
>
> Changes in v2: None
>
>  disk/part_efi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH v3 06/18] efi_loader: consistently use efi_status_t in bootefi

2017-10-22 Thread Simon Glass
On 18 October 2017 at 00:02, Heinrich Schuchardt  wrote:
> Where ulong or unsigned long are used to hold an EFI status
> code we should consistenly use efi_status_t.

nit: konsisstinley

>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v3
> new patch
> ---
>  cmd/bootefi.c | 18 +-
>  1 file changed, 9 insertions(+), 9 deletions(-)

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


Re: [U-Boot] [PATCH v3 05/18] efi_loader: guard against double inclusion of efi_loader.h

2017-10-22 Thread Simon Glass
On 18 October 2017 at 00:02, Heinrich Schuchardt  wrote:
> Use a define to detect double inclusion of efi_loader.h.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v3
> no change
> v2
> new patch
> ---
>  include/efi_loader.h | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH v3 17/18] efi_selftest: provide test for EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL

2017-10-22 Thread Simon Glass
On 18 October 2017 at 00:02, Heinrich Schuchardt  wrote:
> The following services are tested:
> OutputString, TestString, SetAttribute.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v3
> new patch
> ---
>  lib/efi_selftest/Makefile  |  5 ++-
>  lib/efi_selftest/efi_selftest_textoutput.c | 53 
> ++
>  2 files changed, 57 insertions(+), 1 deletion(-)
>  create mode 100644 lib/efi_selftest/efi_selftest_textoutput.c

Great! Tests!

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


Re: [U-Boot] [PATCH v2 4/4] pylibfdt: compile pylibfdt only when dtoc/binman is necessary

2017-10-22 Thread Simon Glass
Hi Masahiro,

On 17 October 2017 at 06:42, Masahiro Yamada
 wrote:
> Currently, pylibfdt is always compiled if swig is installed on your
> machine.  It is really annoying because most of targets (excepts
> x86, sunxi, rockchip) do not use dtoc or binman.
>
> "checkbinman" and "checkdtoc" are wrong.  It is odd that the final
> build stage checks if we have built necessary tools.  If your platform
> depends on dtoc/binman, you must be able to build pylibfdt.  If swig
> is not installed, it should fail immediately.
>
> I added PYLIBFDT, DTOC, BINMAN entries to Kconfig.  They should be
> property select:ed by platforms that need them.  Kbuild will descend
> into scripts/dtc/pylibfdt/ only when CONFIG_PYLIBFDT is enabled.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  Makefile | 17 ++---
>  arch/arm/Kconfig |  1 +
>  arch/x86/Kconfig |  1 +
>  dts/Kconfig  | 13 +
>  scripts/Makefile.spl | 15 ++-
>  scripts/dtc/Makefile |  2 +-
>  6 files changed, 20 insertions(+), 29 deletions(-)
>

I think this is a reasonable change.

Reviewed-by: Simon Glass 

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


Re: [U-Boot] [PATCH v2 5/9] efi_loader: guard against double inclusion of efi_loader.h

2017-10-22 Thread Simon Glass
On 13 October 2017 at 19:33, Heinrich Schuchardt  wrote:
> Use a define to detect double inclusion of efi_loader.h.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v2
> new patch
> ---
>  include/efi_loader.h | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH] efi_loader: Decouple EFI input/output from stdin/stdout

2017-10-22 Thread Simon Glass
Hi,

On 10 October 2017 at 10:12, Alexander Graf  wrote:
>
>
> On 10.10.17 02:27, Rob Clark wrote:
>> On Mon, Sep 11, 2017 at 10:04 AM, Rob Clark  wrote:
>>> In some cases, it is quite useful to have (for example) EFI on screen
>>> but u-boot on serial port.
>>>
>>> Signed-off-by: Rob Clark 
>>> ---
>>> Applies on top of my previous efi_loader patchset.
>>>
>>>  lib/efi_loader/efi_console.c | 104 
>>> +--
>>>  1 file changed, 80 insertions(+), 24 deletions(-)
>>>
>>> diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
>>> index 139f7ea55b..e2b1b88ecf 100644
>>> --- a/lib/efi_loader/efi_console.c
>>> +++ b/lib/efi_loader/efi_console.c
>>> @@ -47,6 +47,38 @@ static struct cout_mode efi_cout_modes[] = {
>>>
>>>  const efi_guid_t efi_guid_console_control = CONSOLE_CONTROL_GUID;
>>>
>>> +static struct stdio_dev *efiin, *efiout;
>>> +
>>> +static int efi_tstc(void)
>>> +{
>>> +   return efiin->tstc(efiin);
>>> +}
>>> +
>>> +static int efi_getc(void)
>>> +{
>>> +   return efiin->getc(efiin);
>>> +}
>>> +
>>> +static int efi_printf(const char *fmt, ...)
>>> +{
>>> +   va_list args;
>>> +   uint i;
>>> +   char printbuffer[CONFIG_SYS_PBSIZE];
>>> +
>>> +   va_start(args, fmt);
>>> +
>>> +   /*
>>> +* For this to work, printbuffer must be larger than
>>> +* anything we ever want to print.
>>> +*/
>>> +   i = vsnprintf(printbuffer, sizeof(printbuffer), fmt, args);
>>> +   va_end(args);
>>> +
>>> +   /* Print the string */
>>> +   efiout->puts(efiout, printbuffer);
>>> +   return i;
>>> +}
>>> +
>>>  #define cESC '\x1b'
>>>  #define ESC "\x1b"
>>>
>>> @@ -111,16 +143,16 @@ static int term_read_reply(int *n, int maxnum, char 
>>> end_char)
>>> char c;
>>> int i = 0;
>>>
>>> -   c = getc();
>>> +   c = efi_getc();
>>> if (c != cESC)
>>> return -1;
>>> -   c = getc();
>>> +   c = efi_getc();
>>> if (c != '[')
>>> return -1;
>>>
>>> n[0] = 0;
>>> while (1) {
>>> -   c = getc();
>>> +   c = efi_getc();
>>> if (c == ';') {
>>> i++;
>>> if (i >= maxnum)
>>> @@ -164,7 +196,7 @@ static efi_status_t EFIAPI efi_cout_output_string(
>>>
>>> *utf16_to_utf8((u8 *)buf, string, n16) = '\0';
>>>
>>> -   fputs(stdout, buf);
>>> +   efiout->puts(efiout, buf);
>>>
>>> for (p = buf; *p; p++) {
>>> switch (*p) {
>>> @@ -217,14 +249,14 @@ static int query_console_serial(int *rows, int *cols)
>>> u64 timeout;
>>>
>>> /* Empty input buffer */
>>> -   while (tstc())
>>> -   getc();
>>> +   while (efi_tstc())
>>> +   efi_getc();
>>>
>>> -   printf(ESC"[18t");
>>> +   efi_printf(ESC"[18t");
>>>
>>> /* Check if we have a terminal that understands */
>>> timeout = timer_get_us() + 100;
>>> -   while (!tstc())
>>> +   while (!efi_tstc())
>>> if (timer_get_us() > timeout)
>>> return -1;
>>>
>>> @@ -348,9 +380,9 @@ static efi_status_t EFIAPI efi_cout_set_attribute(
>>> EFI_ENTRY("%p, %lx", this, attribute);
>>>
>>> if (attribute)
>>> -   printf(ESC"[%u;%um", color[fg].fg, color[bg].bg);
>>> +   efi_printf(ESC"[%u;%um", color[fg].fg, color[bg].bg);
>>> else
>>> -   printf(ESC"[37;40m");
>>> +   efi_printf(ESC"[37;40m");
>>>
>>> /* Just ignore attributes (colors) for now */
>>> return EFI_EXIT(EFI_UNSUPPORTED);
>>> @@ -361,7 +393,7 @@ static efi_status_t EFIAPI efi_cout_clear_screen(
>>>  {
>>> EFI_ENTRY("%p", this);
>>>
>>> -   printf(ESC"[2J");
>>> +   efi_printf(ESC"[2J");
>>>
>>> return EFI_EXIT(EFI_SUCCESS);
>>>  }
>>> @@ -372,7 +404,7 @@ static efi_status_t EFIAPI efi_cout_set_cursor_position(
>>>  {
>>> EFI_ENTRY("%p, %ld, %ld", this, column, row);
>>>
>>> -   printf(ESC"[%d;%df", (int)row, (int)column);
>>> +   efi_printf(ESC"[%d;%df", (int)row, (int)column);
>>> efi_con_mode.cursor_column = column;
>>> efi_con_mode.cursor_row = row;
>>>
>>> @@ -385,7 +417,7 @@ static efi_status_t EFIAPI efi_cout_enable_cursor(
>>>  {
>>> EFI_ENTRY("%p, %d", this, enable);
>>>
>>> -   printf(ESC"[?25%c", enable ? 'h' : 'l');
>>> +   efi_printf(ESC"[?25%c", enable ? 'h' : 'l');
>>>
>>> return EFI_EXIT(EFI_SUCCESS);
>>>  }
>>> @@ -427,27 +459,27 @@ static efi_status_t read_key_stroke(struct 
>>> efi_key_data *key_data)
>>> /* We don't do interrupts, so check for timers cooperatively */
>>> efi_timer_check();
>>>
>>> -   if (!tstc()) {
>>> +   if (!efi_tstc()) {
>>> /* No key pressed */
>>> return EFI_NOT_READY;
>>>  

Re: [U-Boot] [PATCH 1/5] libfdt: change fdt.h to a wrapper of scripts/dtc/libfdt/*

2017-10-22 Thread Simon Glass
Hi Masahiro,

On 17 October 2017 at 15:30, Masahiro Yamada
 wrote:
> Fortunately, U-Boot did not modify fdt.h locally.
>
> Change it to a wrapper of scripts/dtc/libfdt/fdt.h, which will be
> periodically synced with the upstream DTC (or kernel).
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  include/fdt.h|  2 +-
>  lib/libfdt/fdt.h | 67 
> 
>  2 files changed, 1 insertion(+), 68 deletions(-)
>  delete mode 100644 lib/libfdt/fdt.h

There was a recent change to make this use the file in lib/libfdt.
That makes it easier to sync with upstream dtc.

Can you please explain in a little more detail the motivation for this patch?

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


Re: [U-Boot] [PATCH v2 2/2] ARM: dts: OMAP5+: Add support for bandgap sensor in SPL

2017-10-22 Thread Simon Glass
On 9 October 2017 at 14:17, Faiz Abbas  wrote:
> Mark bandgap node as uboot,dm-spl so that it can be accessed in spl
>
> Signed-off-by: Faiz Abbas 
> ---
>  arch/arm/dts/omap5-u-boot.dtsi | 4 
>  1 file changed, 4 insertions(+)

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


Re: [U-Boot] [PATCH] drivers: core: Add translation in live tree case

2017-10-22 Thread Simon Glass
Hi Mario,

On 13 October 2017 at 13:21, Mario Six  wrote:
> The function dev_read_addr calls ofnode_get_addr_index in the live tree
> case, which does not apply bus translations to the address read from the
> device tree. This results in illegal addresses on boards that rely on
> bus translations being applied.
>
> Fix this situation by applying bus translations in the live tree case as
> well.
>
> Signed-off-by: Mario Six 
> ---
>  drivers/core/ofnode.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
> index 9123e88425..d7d8f039b9 100644
> --- a/drivers/core/ofnode.c
> +++ b/drivers/core/ofnode.c
> @@ -215,13 +215,15 @@ fdt_addr_t ofnode_get_addr_index(ofnode node, int index)
> uint flags;
> u64 size;
> int na;
> +   __be32 addr;
>
> prop_val = of_get_address(ofnode_to_np(node), index, ,
>   );
> if (!prop_val)
> return FDT_ADDR_T_NONE;
> na = of_n_addr_cells(ofnode_to_np(node));
> -   return of_read_number(prop_val, na);
> +   addr = of_read_number(prop_val, na);
> +   return of_translate_address(ofnode_to_np(node), );

Should there not be an if (IS_ENABLED(CONFIG_OF_TRANSLATE)) here?

> } else {
> return fdt_get_base_address(gd->fdt_blob,
> ofnode_to_offset(node));
> --
> 2.11.0
>

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


Re: [U-Boot] [PATCH] rockchip: rk3399: init CPU clock when rkclk_init()

2017-10-22 Thread Simon Glass
On 12 October 2017 at 09:27, Kever Yang  wrote:
> Init the CPU and its buses to speed up the boot time.
> Move rkclk_init() to a place after rk3399_configure_cpu has defined
> at the same time, or else there will be a warning.
>
> Signed-off-by: Kever Yang 
> ---
>
>  drivers/clk/rockchip/clk_rk3399.c | 157 
> +++---
>  1 file changed, 79 insertions(+), 78 deletions(-)

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


Re: [U-Boot] [PATCH v2 8/9] test/py: test reboot by EFI watchdog

2017-10-22 Thread Simon Glass
On 13 October 2017 at 19:33, Heinrich Schuchardt  wrote:
> Clear environment variable efi_selftest before executing the
> default tests.
>
> Provide a test verifying that the EFI watchdog
> reboots the system upon timeout.
>
> The test depends on CONFIG_CMD_EFI_SELFTEST=y.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v2
> choose test via environment variable
> ---
>  test/py/tests/test_efi_selftest.py | 14 +-
>  1 file changed, 13 insertions(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH v2 1/2] thermal: ti-bandgap: Add support for temperature sensor

2017-10-22 Thread Simon Glass
On 9 October 2017 at 14:17, Faiz Abbas  wrote:
> The dra7xx series of SOCs contain a temperature sensor and an
> associated analog-to-digital converter (ADC) which produces
> an output which is proportional to the SOC temperature.
> Add support for this temperature sensor.
>
> Signed-off-by: Faiz Abbas 
> ---
> v2:
>  1. Removed extra elements from ti_bandgap
>  2. Changed base address to ulong
>  3. Changed to udev to dev to maintain consistency
>  4. minor format changes
>
>  common/spl/Kconfig |   8 +
>  configs/dra7xx_evm_defconfig   |   3 +
>  .../thermal/ti_soc_thermal.txt |  35 
>  drivers/Makefile   |   2 +-
>  drivers/thermal/Kconfig|   6 +
>  drivers/thermal/Makefile   |   1 +
>  drivers/thermal/ti-bandgap.c   | 197 
> +
>  7 files changed, 251 insertions(+), 1 deletion(-)
>  create mode 100644 doc/device-tree-bindings/thermal/ti_soc_thermal.txt
>  create mode 100644 drivers/thermal/ti-bandgap.c
>

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


Re: [U-Boot] [PATCH] usb: xhci: Add Renesas R-Car xHCI driver

2017-10-22 Thread Simon Glass
Hi Bin,

On 9 October 2017 at 09:16, Bin Meng  wrote:
> Hi Marek,
>
> On Mon, Oct 9, 2017 at 2:34 AM, Marek Vasut  wrote:
>> Add firmware V3, firmware loader and XHCI glue for the Renesas R-Car
>> Gen3 SoCs XHCI controller. Thus far only the R-Car Gen3 R8A7795 ES2.0+
>> and R8A7796 are supported.
>>
>> Signed-off-by: Marek Vasut 
>> Cc: Nobuhiro Iwamatsu 
>> ---
>>  Licenses/r8a779x_usb3.txt|  26 ++
>>  drivers/usb/host/Kconfig |   8 +
>>  drivers/usb/host/Makefile|   1 +
>>  drivers/usb/host/xhci-rcar-r8a779x_usb3_v3.h | 643 
>> +++
>>  drivers/usb/host/xhci-rcar.c | 161 +++
>>  5 files changed, 839 insertions(+)
>>  create mode 100644 Licenses/r8a779x_usb3.txt
>>  create mode 100644 drivers/usb/host/xhci-rcar-r8a779x_usb3_v3.h
>>  create mode 100644 drivers/usb/host/xhci-rcar.c
>>

>> +   0x000201bc, 0xcc74, 0x00011014, 0x00011076,
>> +   0x32dc, 0x79cf
>> +};
>> +
>
> +Simon,
>
> Can we use binman here to include the firmware image file directly
> into the u-boot image?

Yes I think so. We really need binman to add the DT offset into the
image. I'm going to take a look at that soon.

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


Re: [U-Boot] [PATCH] imx: serial: Wait for ongoing transmission to finish before serial reset

2017-10-22 Thread Simon Glass
Hi Lucasz,

On 9 October 2017 at 12:46, Łukasz Majewski  wrote:
> Hi Simon,
>
>> Hi Lukasz,
>>
>> On 3 October 2017 at 03:16, Lukasz Majewski  wrote:
>>>
>>> It may happen that the MXC serial IP block is performing some ongoing
>>> transmission (started at e.g. board_init()) when the "initr_serial" is
>>> called.
>>>
>>> As a result the serial port IP block is reset, so transmitted data is
>>> corrupted:
>>>
>>> I2C:   ready
>>> DRAM:  1 GiB
>>> jSS('HH��SL_SDHC: 04 rev 0x0
>>>
>>> This patch prevents from this situation, by waiting for transmission
>>> complete bit set (UART Status Register 2 (UARTx_USR2), bit TXDC):
>>>
>>> I2C:   ready
>>> DRAM:  1 GiB
>>> ID:unit type 0x4 rev 0x0
>>>
>>> Signed-off-by: Lukasz Majewski 
>>> ---
>>>
>>>   drivers/serial/serial_mxc.c | 7 +++
>>>   1 file changed, 7 insertions(+)
>>
>>
>> Is it possible to use driver model to do this in a generic way for all
>> serial drivers? The pending() method allows you to check if there are
>> any characters in the output FIFO.
>
>
> Please correct me if I'm wrong.
>
> Do you mean to define pre_init() callback in serial-uclass.c file, which
> would utilize ->pending callback if available?
>
> In that way we would have the generic facility for above check available on
> all platforms.

Yes that is what I am hoping.

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


[U-Boot] PLL cpux allwinner H3

2017-10-22 Thread Mark L .
Hi,

The formula for the PLL CPUX output is (24Mhz * N * K) / (M * P).
Is there a problem applying N = 32 && K = 2 instead of N = 16 and K = 4 (M and 
P being equal)?

I am asking if there is a pattern to respect or not at all.

Thanks

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


[U-Boot] [PATCH 8/9] efi_loader: rework efi_locate_handle

2017-10-22 Thread Heinrich Schuchardt
Check the parameters in efi_locate_handle.

Use list_for_each_entry instead of list_for_each.

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

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 818d54abd1..b6eebe3b14 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -896,6 +896,7 @@ static int efi_search(enum efi_locate_search_type 
search_type,
case ALL_HANDLES:
return 0;
case BY_REGISTER_NOTIFY:
+   /* RegisterProtocolNotify is not implemented yet */
return -1;
case BY_PROTOCOL:
for (i = 0; i < ARRAY_SIZE(efiobj->protocols); i++) {
@@ -927,16 +928,38 @@ static efi_status_t efi_locate_handle(
const efi_guid_t *protocol, void *search_key,
efi_uintn_t *buffer_size, efi_handle_t *buffer)
 {
-   struct list_head *lhandle;
+   struct efi_object *efiobj;
efi_uintn_t size = 0;
 
+   /* Check parameters */
+   switch (search_type) {
+   case ALL_HANDLES:
+   break;
+   case BY_REGISTER_NOTIFY:
+   if (!search_key)
+   return EFI_INVALID_PARAMETER;
+   /* RegisterProtocolNotify is not implemented yet */
+   return EFI_UNSUPPORTED;
+   case BY_PROTOCOL:
+   if (!protocol)
+   return EFI_INVALID_PARAMETER;
+   break;
+   default:
+   return EFI_INVALID_PARAMETER;
+   }
+
+   /*
+* efi_locate_handle_buffer uses this function for
+* the calculation of the necessary buffer size.
+* So do not require a buffer for buffersize == 0.
+*/
+   if (!buffer_size || (*buffer_size && !buffer))
+   return EFI_INVALID_PARAMETER;
+
/* Count how much space we need */
-   list_for_each(lhandle, _obj_list) {
-   struct efi_object *efiobj;
-   efiobj = list_entry(lhandle, struct efi_object, link);
-   if (!efi_search(search_type, protocol, search_key, efiobj)) {
+   list_for_each_entry(efiobj, _obj_list, link) {
+   if (!efi_search(search_type, protocol, search_key, efiobj))
size += sizeof(void*);
-   }
}
 
if (*buffer_size < size) {
@@ -949,12 +972,9 @@ static efi_status_t efi_locate_handle(
return EFI_NOT_FOUND;
 
/* Then fill the array */
-   list_for_each(lhandle, _obj_list) {
-   struct efi_object *efiobj;
-   efiobj = list_entry(lhandle, struct efi_object, link);
-   if (!efi_search(search_type, protocol, search_key, efiobj)) {
-   *(buffer++) = efiobj->handle;
-   }
+   list_for_each_entry(efiobj, _obj_list, link) {
+   if (!efi_search(search_type, protocol, search_key, efiobj))
+   *buffer++ = efiobj->handle;
}
 
return EFI_SUCCESS;
-- 
2.14.2

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


[U-Boot] [PATCH 7/9] efi_loader: consistently use efi_uintn_t in boot services

2017-10-22 Thread Heinrich Schuchardt
Consistenly use efi_uintn_t wherever the UEFI spec uses
UINTN in boot services interfaces.

Signed-off-by: Heinrich Schuchardt 
---
 include/efi_api.h   | 29 ++-
 include/efi_loader.h| 12 
 lib/efi_loader/efi_boottime.c   | 38 -
 lib/efi_loader/efi_memory.c | 20 ++---
 lib/efi_selftest/efi_selftest.c |  6 ++--
 lib/efi_selftest/efi_selftest_events.c  |  2 +-
 lib/efi_selftest/efi_selftest_manageprotocols.c |  4 +--
 lib/efi_selftest/efi_selftest_snp.c |  2 +-
 lib/efi_selftest/efi_selftest_tpl.c |  2 +-
 9 files changed, 59 insertions(+), 56 deletions(-)

diff --git a/include/efi_api.h b/include/efi_api.h
index 5ab78baeea..e0991b6eca 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -51,13 +51,15 @@ struct efi_boot_services {
efi_status_t (EFIAPI *raise_tpl)(efi_uintn_t new_tpl);
void (EFIAPI *restore_tpl)(efi_uintn_t old_tpl);
 
-   efi_status_t (EFIAPI *allocate_pages)(int, int, unsigned long,
+   efi_status_t (EFIAPI *allocate_pages)(int, int, efi_uintn_t,
  efi_physical_addr_t *);
-   efi_status_t (EFIAPI *free_pages)(efi_physical_addr_t, unsigned long);
-   efi_status_t (EFIAPI *get_memory_map)(unsigned long *memory_map_size,
-   struct efi_mem_desc *desc, unsigned long *key,
-   unsigned long *desc_size, u32 *desc_version);
-   efi_status_t (EFIAPI *allocate_pool)(int, unsigned long, void **);
+   efi_status_t (EFIAPI *free_pages)(efi_physical_addr_t, efi_uintn_t);
+   efi_status_t (EFIAPI *get_memory_map)(efi_uintn_t *memory_map_size,
+ struct efi_mem_desc *desc,
+ efi_uintn_t *key,
+ efi_uintn_t *desc_size,
+ u32 *desc_version);
+   efi_status_t (EFIAPI *allocate_pool)(int, efi_uintn_t, void **);
efi_status_t (EFIAPI *free_pool)(void *);
 
efi_status_t (EFIAPI *create_event)(uint32_t type,
@@ -69,8 +71,9 @@ struct efi_boot_services {
efi_status_t (EFIAPI *set_timer)(struct efi_event *event,
 enum efi_timer_delay type,
 uint64_t trigger_time);
-   efi_status_t (EFIAPI *wait_for_event)(unsigned long number_of_events,
-   struct efi_event **event, size_t *index);
+   efi_status_t (EFIAPI *wait_for_event)(efi_uintn_t number_of_events,
+ struct efi_event **event,
+ efi_uintn_t *index);
efi_status_t (EFIAPI *signal_event)(struct efi_event *event);
efi_status_t (EFIAPI *close_event)(struct efi_event *event);
efi_status_t (EFIAPI *check_event)(struct efi_event *event);
@@ -93,7 +96,7 @@ struct efi_boot_services {
efi_status_t (EFIAPI *locate_handle)(
enum efi_locate_search_type search_type,
const efi_guid_t *protocol, void *search_key,
-   unsigned long *buffer_size, efi_handle_t *buffer);
+   efi_uintn_t *buffer_size, efi_handle_t *buffer);
efi_status_t (EFIAPI *locate_device_path)(const efi_guid_t *protocol,
struct efi_device_path **device_path,
efi_handle_t *device);
@@ -140,14 +143,14 @@ struct efi_boot_services {
efi_status_t(EFIAPI *open_protocol_information)(efi_handle_t handle,
const efi_guid_t *protocol,
struct efi_open_protocol_info_entry **entry_buffer,
-   unsigned long *entry_count);
+   efi_uintn_t *entry_count);
efi_status_t (EFIAPI *protocols_per_handle)(efi_handle_t handle,
efi_guid_t ***protocol_buffer,
-   unsigned long *protocols_buffer_count);
+   efi_uintn_t *protocols_buffer_count);
efi_status_t (EFIAPI *locate_handle_buffer) (
enum efi_locate_search_type search_type,
const efi_guid_t *protocol, void *search_key,
-   unsigned long *no_handles, efi_handle_t **buffer);
+   efi_uintn_t *no_handles, efi_handle_t **buffer);
efi_status_t (EFIAPI *locate_protocol)(const efi_guid_t *protocol,
void *registration, void **protocol_interface);
efi_status_t (EFIAPI *install_multiple_protocol_interfaces)(
@@ -248,7 +251,7 @@ struct efi_system_table {
struct efi_simple_text_output_protocol *std_err;
struct efi_runtime_services *runtime;
struct efi_boot_services 

[U-Boot] [PATCH 5/9] efi_loader: remove unused typedef for INTN

2017-10-22 Thread Heinrich Schuchardt
INTN is not used in the coding.

Signed-off-by: Heinrich Schuchardt 
---
 include/efi_api.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/efi_api.h b/include/efi_api.h
index fcd7483ab2..8ea44b1a7a 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -29,7 +29,6 @@ enum efi_timer_delay {
 };
 
 #define UINTN size_t
-typedef long INTN;
 typedef uint16_t *efi_string_t;
 
 #define EVT_TIMER  0x8000
-- 
2.14.2

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


[U-Boot] [PATCH 9/9] efi_loader: rework efi_search_obj

2017-10-22 Thread Heinrich Schuchardt
EFI_HANDLEs are used both in boottime and in runtime services.
efi_search_obj is a function that can be used to validate
handles. So let's make it accessible via efi_loader.h.

We can simplify the coding using list_for_each_entry.

Signed-off-by: Heinrich Schuchardt 
---
 include/efi_loader.h  | 2 ++
 lib/efi_loader/efi_boottime.c | 9 +++--
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/include/efi_loader.h b/include/efi_loader.h
index e3d1c35930..2bcca3dfd8 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -192,6 +192,8 @@ void efi_restore_gd(void);
 void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map);
 /* Call this to set the current device name */
 void efi_set_bootdev(const char *dev, const char *devnr, const char *path);
+/* Call this to validate a handle and find the EFI object for it */
+struct efi_object *efi_search_obj(void *handle);
 /* Call this to create an event */
 efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
  void (EFIAPI *notify_function) (
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index b6eebe3b14..bdbed32656 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -684,14 +684,11 @@ static efi_status_t EFIAPI efi_check_event(struct 
efi_event *event)
  * @handle handle to find
  * @return EFI object
  */
-static struct efi_object *efi_search_obj(void *handle)
+struct efi_object *efi_search_obj(void *handle)
 {
-   struct list_head *lhandle;
-
-   list_for_each(lhandle, _obj_list) {
-   struct efi_object *efiobj;
+   struct efi_object *efiobj;
 
-   efiobj = list_entry(lhandle, struct efi_object, link);
+   list_for_each_entry(efiobj, _obj_list, link) {
if (efiobj->handle == handle)
return efiobj;
}
-- 
2.14.2

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


[U-Boot] [PATCH 0/9] efi_loader: clean up protocol services

2017-10-22 Thread Heinrich Schuchardt
This patch series supplies a test case for boottime protocol
services that are used to manage protocols on handles.

The other patches do not introduce any new functionality
but clean up the code.

This series should be merged after
"efi_loader: implement SetWatchdogTimer".

Next think I am preparing is the conversion of the protocols array
to a linked list.

Heinrich Schuchardt (9):
  efi_loader: capitalize EFI_LOCATE_SEARCH_TYPE values
  efi_selftest: test protocol management
  efi_loader: eliminate efi_install_protocol_interface_ext
  efi_loader: eliminate efi_uninstall_protocol_interface_ext
  efi_loader: remove unused typedef for INTN
  efi_loader: replace UINTN by efi_uintn_t
  efi_loader: consistently use efi_uintn_t in boot services
  efi_loader: rework efi_locate_handle
  efi_loader: rework efi_search_obj

 include/efi.h   |   6 +-
 include/efi_api.h   |  38 +--
 include/efi_loader.h|  18 +-
 include/efi_selftest.h  |   9 +
 lib/efi_loader/efi_boottime.c   | 203 ++---
 lib/efi_loader/efi_memory.c |  20 +-
 lib/efi_selftest/Makefile   |   3 +
 lib/efi_selftest/efi_selftest.c |   6 +-
 lib/efi_selftest/efi_selftest_events.c  |   2 +-
 lib/efi_selftest/efi_selftest_manageprotocols.c | 381 
 lib/efi_selftest/efi_selftest_snp.c |   2 +-
 lib/efi_selftest/efi_selftest_tpl.c |   4 +-
 12 files changed, 533 insertions(+), 159 deletions(-)
 create mode 100644 lib/efi_selftest/efi_selftest_manageprotocols.c

-- 
2.14.2

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


[U-Boot] [PATCH 6/9] efi_loader: replace UINTN by efi_uintn_t

2017-10-22 Thread Heinrich Schuchardt
UINTN is used in the UEFI specification for unsigned integers
matching the bitness of the CPU.

Types in U-Boot should be lower case. The patch replaces it
by efi_uintn_t.

Suggested-by: Simon Glass 
Suggested-by: Rob Clark 
Signed-off-by: Heinrich Schuchardt 
---
 include/efi_api.h   |  8 
 include/efi_loader.h|  4 ++--
 lib/efi_loader/efi_boottime.c   | 12 ++--
 lib/efi_selftest/efi_selftest_tpl.c |  2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/include/efi_api.h b/include/efi_api.h
index 8ea44b1a7a..5ab78baeea 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -28,7 +28,7 @@ enum efi_timer_delay {
EFI_TIMER_RELATIVE = 2
 };
 
-#define UINTN size_t
+#define efi_uintn_t size_t
 typedef uint16_t *efi_string_t;
 
 #define EVT_TIMER  0x8000
@@ -48,8 +48,8 @@ struct efi_event;
 /* EFI Boot Services table */
 struct efi_boot_services {
struct efi_table_hdr hdr;
-   efi_status_t (EFIAPI *raise_tpl)(UINTN new_tpl);
-   void (EFIAPI *restore_tpl)(UINTN old_tpl);
+   efi_status_t (EFIAPI *raise_tpl)(efi_uintn_t new_tpl);
+   void (EFIAPI *restore_tpl)(efi_uintn_t old_tpl);
 
efi_status_t (EFIAPI *allocate_pages)(int, int, unsigned long,
  efi_physical_addr_t *);
@@ -61,7 +61,7 @@ struct efi_boot_services {
efi_status_t (EFIAPI *free_pool)(void *);
 
efi_status_t (EFIAPI *create_event)(uint32_t type,
-   UINTN notify_tpl,
+   efi_uintn_t notify_tpl,
void (EFIAPI *notify_function) (
struct efi_event *event,
void *context),
diff --git a/include/efi_loader.h b/include/efi_loader.h
index e506eeec61..83b27d0449 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -144,7 +144,7 @@ struct efi_object {
  */
 struct efi_event {
uint32_t type;
-   UINTN notify_tpl;
+   efi_uintn_t notify_tpl;
void (EFIAPI *notify_function)(struct efi_event *event, void *context);
void *notify_context;
u64 trigger_next;
@@ -193,7 +193,7 @@ void efi_runtime_relocate(ulong offset, struct efi_mem_desc 
*map);
 /* Call this to set the current device name */
 void efi_set_bootdev(const char *dev, const char *devnr, const char *path);
 /* Call this to create an event */
-efi_status_t efi_create_event(uint32_t type, UINTN notify_tpl,
+efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
  void (EFIAPI *notify_function) (
struct efi_event *event,
void *context),
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 4f86ddccea..dd2347e04d 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -21,7 +21,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 /* Task priority level */
-static UINTN efi_tpl = TPL_APPLICATION;
+static efi_uintn_t efi_tpl = TPL_APPLICATION;
 
 /* This list contains all the EFI objects our payload has access to */
 LIST_HEAD(efi_obj_list);
@@ -165,9 +165,9 @@ void efi_signal_event(struct efi_event *event)
  * @new_tplnew value of the task priority level
  * @return old value of the task priority level
  */
-static unsigned long EFIAPI efi_raise_tpl(UINTN new_tpl)
+static unsigned long EFIAPI efi_raise_tpl(efi_uintn_t new_tpl)
 {
-   UINTN old_tpl = efi_tpl;
+   efi_uintn_t old_tpl = efi_tpl;
 
EFI_ENTRY("0x%zx", new_tpl);
 
@@ -190,7 +190,7 @@ static unsigned long EFIAPI efi_raise_tpl(UINTN new_tpl)
  *
  * @old_tplvalue of the task priority level to be restored
  */
-static void EFIAPI efi_restore_tpl(UINTN old_tpl)
+static void EFIAPI efi_restore_tpl(efi_uintn_t old_tpl)
 {
EFI_ENTRY("0x%zx", old_tpl);
 
@@ -359,7 +359,7 @@ static struct efi_event efi_events[16];
  * @event  created event
  * @return status code
  */
-efi_status_t efi_create_event(uint32_t type, UINTN notify_tpl,
+efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
  void (EFIAPI *notify_function) (
struct efi_event *event,
void *context),
@@ -409,7 +409,7 @@ efi_status_t efi_create_event(uint32_t type, UINTN 
notify_tpl,
  * @return status code
  */
 static efi_status_t EFIAPI efi_create_event_ext(
-   uint32_t type, UINTN notify_tpl,
+   uint32_t type, efi_uintn_t notify_tpl,
void (EFIAPI *notify_function) (
struct efi_event *event,
void *context),
diff --git a/lib/efi_selftest/efi_selftest_tpl.c 

[U-Boot] [PATCH 2/9] efi_selftest: test protocol management

2017-10-22 Thread Heinrich Schuchardt
This unit test checks the following protocol services:
InstallProtocolInterface, UninstallProtocolInterface,
InstallMultipleProtocolsInterfaces,
UninstallMultipleProtocolsInterfaces,
HandleProtocol, ProtocolsPerHandle,
LocateHandle, LocateHandleBuffer.

As UninstallProtocolInterface and UninstallMultipleProtocolsInterfaces
are not completely implemented a TODO message will shown for
their failure.

Signed-off-by: Heinrich Schuchardt 
---
 include/efi_selftest.h  |   9 +
 lib/efi_selftest/Makefile   |   3 +
 lib/efi_selftest/efi_selftest_manageprotocols.c | 381 
 3 files changed, 393 insertions(+)
 create mode 100644 lib/efi_selftest/efi_selftest_manageprotocols.c

diff --git a/include/efi_selftest.h b/include/efi_selftest.h
index 5cc8d4f600..be5ba4bfa9 100644
--- a/include/efi_selftest.h
+++ b/include/efi_selftest.h
@@ -27,6 +27,15 @@
(efi_st_printf("%s(%u):\nERROR: ", __FILE__, __LINE__), \
efi_st_printf(__VA_ARGS__)) \
 
+/*
+ * Prints a TODO message.
+ *
+ * @...format string followed by fields to print
+ */
+#define efi_st_todo(...) \
+   (efi_st_printf("%s(%u):\nTODO: ", __FILE__, __LINE__), \
+   efi_st_printf(__VA_ARGS__)) \
+
 /*
  * A test may be setup and executed at boottime,
  * it may be setup at boottime and executed at runtime,
diff --git a/lib/efi_selftest/Makefile b/lib/efi_selftest/Makefile
index 88b998bd4c..acd184db4b 100644
--- a/lib/efi_selftest/Makefile
+++ b/lib/efi_selftest/Makefile
@@ -15,6 +15,8 @@ CFLAGS_efi_selftest_events.o := $(CFLAGS_EFI)
 CFLAGS_REMOVE_efi_selftest_events.o := $(CFLAGS_NON_EFI)
 CFLAGS_efi_selftest_exitbootservices.o := $(CFLAGS_EFI)
 CFLAGS_REMOVE_efi_selftest_exitbootservices.o := $(CFLAGS_NON_EFI)
+CFLAGS_efi_selftest_manageprotocols.o := $(CFLAGS_EFI)
+CFLAGS_REMOVE_efi_selftest_manageprotocols.o := $(CFLAGS_NON_EFI)
 CFLAGS_efi_selftest_snp.o := $(CFLAGS_EFI)
 CFLAGS_REMOVE_efi_selftest_snp.o := $(CFLAGS_NON_EFI)
 CFLAGS_efi_selftest_textoutput.o := $(CFLAGS_EFI)
@@ -31,6 +33,7 @@ efi_selftest.o \
 efi_selftest_console.o \
 efi_selftest_events.o \
 efi_selftest_exitbootservices.o \
+efi_selftest_manageprotocols.o \
 efi_selftest_snp.o \
 efi_selftest_textoutput.o \
 efi_selftest_tpl.o \
diff --git a/lib/efi_selftest/efi_selftest_manageprotocols.c 
b/lib/efi_selftest/efi_selftest_manageprotocols.c
new file mode 100644
index 00..0a297f79ba
--- /dev/null
+++ b/lib/efi_selftest/efi_selftest_manageprotocols.c
@@ -0,0 +1,381 @@
+/*
+ * efi_selftest_manageprotocols
+ *
+ * Copyright (c) 2017 Heinrich Schuchardt 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * This unit test checks the following protocol services:
+ * InstallProtocolInterface, UninstallProtocolInterface,
+ * InstallMultipleProtocolsInterfaces, UninstallMultipleProtocolsInterfaces,
+ * HandleProtocol, ProtocolsPerHandle,
+ * LocateHandle, LocateHandleBuffer.
+ */
+
+#include 
+
+static struct efi_boot_services *boottime;
+
+static efi_handle_t handle1;
+static efi_handle_t handle2;
+
+struct interface {
+   void (EFIAPI * inc)(void);
+};
+
+static efi_guid_t guid1 =
+   EFI_GUID(0x2e7ca819, 0x21d3, 0x0a3a,
+0xf7, 0x91, 0x82, 0x1f, 0x7a, 0x83, 0x67, 0xaf);
+static unsigned int counter1;
+void EFIAPI inc1(void)
+{
+   ++counter1;
+}
+
+static struct interface interface1 = {
+   inc1,
+};
+
+static struct interface interface4 = {
+   inc1,
+};
+
+static efi_guid_t guid2 =
+   EFI_GUID(0xf909f2bb, 0x90a8, 0x0d77,
+0x94, 0x0c, 0x3e, 0xa8, 0xea, 0x38, 0xd6, 0x6f);
+static unsigned int counter2;
+void EFIAPI inc2(void)
+{
+   ++counter2;
+}
+
+static struct interface interface2 = {
+   inc2,
+};
+
+static efi_guid_t guid3 =
+   EFI_GUID(0x06d641a3, 0xf4e7, 0xe0c9,
+0xe7, 0x8d, 0x41, 0x2d, 0x72, 0xa6, 0xb1, 0x24);
+static unsigned int counter3;
+void EFIAPI inc3(void)
+{
+   ++counter3;
+}
+
+static struct interface interface3 = {
+   inc3,
+};
+
+/*
+ * Find a handle in an array.
+ *
+ * @handle:handle to find
+ * @count: number of entries in the array
+ * @buffer:array to search
+ */
+efi_status_t find_in_buffer(efi_handle_t handle, size_t count,
+   efi_handle_t *buffer)
+{
+   size_t i;
+
+   for (i = 0; i < count; ++i) {
+   if (buffer[i] == handle)
+   return EFI_SUCCESS;
+   }
+   return EFI_NOT_FOUND;
+}
+
+/*
+ * Setup unit test.
+ *
+ * Create two handles and install two out of three protocol interfaces on each
+ * of them:
+ *
+ * handle1
+ *   guid1 interface1
+ *   guid3 interface3
+ * handle2
+ *   guid1 interface4
+ *   guid2 interface2
+ *
+ * @handle:handle of the loaded image
+ * @systable:  system table
+ */
+static int setup(const efi_handle_t img_handle,
+const struct efi_system_table *systable)
+{
+   efi_status_t ret;
+   

[U-Boot] [PATCH 1/9] efi_loader: capitalize EFI_LOCATE_SEARCH_TYPE values

2017-10-22 Thread Heinrich Schuchardt
Constants should be capitalized.
So rename the values of enum efi_locate_search_type.

Signed-off-by: Heinrich Schuchardt 
---
 include/efi.h | 6 +++---
 lib/efi_loader/efi_boottime.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/efi.h b/include/efi.h
index dc8edc8743..2f0be9c86c 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -227,9 +227,9 @@ struct efi_time_cap {
 };
 
 enum efi_locate_search_type {
-   all_handles,
-   by_register_notify,
-   by_protocol
+   ALL_HANDLES,
+   BY_REGISTER_NOTIFY,
+   BY_PROTOCOL
 };
 
 struct efi_open_protocol_info_entry {
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index f70d8658ab..cdf895fb2d 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -934,11 +934,11 @@ static int efi_search(enum efi_locate_search_type 
search_type,
int i;
 
switch (search_type) {
-   case all_handles:
+   case ALL_HANDLES:
return 0;
-   case by_register_notify:
+   case BY_REGISTER_NOTIFY:
return -1;
-   case by_protocol:
+   case BY_PROTOCOL:
for (i = 0; i < ARRAY_SIZE(efiobj->protocols); i++) {
const efi_guid_t *guid = efiobj->protocols[i].guid;
if (guid && !guidcmp(guid, protocol))
-- 
2.14.2

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


[U-Boot] [PATCH 4/9] efi_loader: eliminate efi_uninstall_protocol_interface_ext

2017-10-22 Thread Heinrich Schuchardt
As we now have EFI_CALL there is no need for separate
functions efi_uninstall_protocol_interface_ext and
efi_uninstall_protocol_interface.

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

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index c078f056db..4f86ddccea 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -800,22 +800,25 @@ static efi_status_t EFIAPI 
efi_reinstall_protocol_interface(void *handle,
 /*
  * Uninstall protocol interface.
  *
- * This is the function for internal calls. For the API implementation of the
- * UninstallProtocolInterface service see function
- * efi_uninstall_protocol_interface_ext.
+ * This function implements the UninstallProtocolInterface service.
+ * See the Unified Extensible Firmware Interface (UEFI) specification
+ * for details.
  *
  * @handle handle from which the protocol shall be removed
  * @protocol   GUID of the protocol to be removed
  * @protocol_interface interface to be removed
  * @return status code
  */
-static efi_status_t EFIAPI efi_uninstall_protocol_interface(void *handle,
-   const efi_guid_t *protocol, void *protocol_interface)
+static efi_status_t EFIAPI efi_uninstall_protocol_interface(
+   void *handle, const efi_guid_t *protocol,
+   void *protocol_interface)
 {
struct list_head *lhandle;
int i;
efi_status_t r = EFI_NOT_FOUND;
 
+   EFI_ENTRY("%p, %pUl, %p", handle, protocol, protocol_interface);
+
if (!handle || !protocol) {
r = EFI_INVALID_PARAMETER;
goto out;
@@ -847,28 +850,7 @@ static efi_status_t EFIAPI 
efi_uninstall_protocol_interface(void *handle,
}
 
 out:
-   return r;
-}
-
-/*
- * Uninstall protocol interface.
- *
- * This function implements the UninstallProtocolInterface service.
- * See the Unified Extensible Firmware Interface (UEFI) specification
- * for details.
- *
- * @handle handle from which the protocol shall be removed
- * @protocol   GUID of the protocol to be removed
- * @protocol_interface interface to be removed
- * @return status code
- */
-static efi_status_t EFIAPI efi_uninstall_protocol_interface_ext(void *handle,
-   const efi_guid_t *protocol, void *protocol_interface)
-{
-   EFI_ENTRY("%p, %pUl, %p", handle, protocol, protocol_interface);
-
-   return EFI_EXIT(efi_uninstall_protocol_interface(handle, protocol,
-protocol_interface));
+   return EFI_EXIT(r);
 }
 
 /*
@@ -1784,8 +1766,8 @@ static efi_status_t EFIAPI 
efi_install_multiple_protocol_interfaces(
for (; i; --i) {
protocol = va_arg(argptr, efi_guid_t*);
protocol_interface = va_arg(argptr, void*);
-   efi_uninstall_protocol_interface(handle, protocol,
-protocol_interface);
+   EFI_CALL(efi_uninstall_protocol_interface(handle, protocol,
+ protocol_interface));
}
va_end(argptr);
 
@@ -1995,7 +1977,7 @@ static const struct efi_boot_services efi_boot_services = 
{
.check_event = efi_check_event,
.install_protocol_interface = efi_install_protocol_interface,
.reinstall_protocol_interface = efi_reinstall_protocol_interface,
-   .uninstall_protocol_interface = efi_uninstall_protocol_interface_ext,
+   .uninstall_protocol_interface = efi_uninstall_protocol_interface,
.handle_protocol = efi_handle_protocol,
.reserved = NULL,
.register_protocol_notify = efi_register_protocol_notify,
-- 
2.14.2

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


[U-Boot] [PATCH 3/9] efi_loader: eliminate efi_install_protocol_interface_ext

2017-10-22 Thread Heinrich Schuchardt
As we now have EFI_CALL there is no need for separate
functions efi_install_protocol_interface_ext and
efi_install_protocol_interface.

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

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index cdf895fb2d..c078f056db 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -702,9 +702,9 @@ static struct efi_object *efi_search_obj(void *handle)
 /*
  * Install protocol interface.
  *
- * This is the function for internal calls. For the API implementation of the
- * InstallProtocolInterface service see function
- * efi_install_protocol_interface_ext.
+ * This function implements the InstallProtocolInterface service.
+ * See the Unified Extensible Firmware Interface (UEFI) specification
+ * for details.
  *
  * @handle handle on which the protocol shall be installed
  * @protocol   GUID of the protocol to be installed
@@ -713,14 +713,17 @@ static struct efi_object *efi_search_obj(void *handle)
  * @protocol_interface interface of the protocol implementation
  * @return status code
  */
-static efi_status_t EFIAPI efi_install_protocol_interface(void **handle,
-   const efi_guid_t *protocol, int protocol_interface_type,
-   void *protocol_interface)
+static efi_status_t EFIAPI efi_install_protocol_interface(
+   void **handle, const efi_guid_t *protocol,
+   int protocol_interface_type, void *protocol_interface)
 {
struct list_head *lhandle;
int i;
efi_status_t r;
 
+   EFI_ENTRY("%p, %pUl, %d, %p", handle, protocol, protocol_interface_type,
+ protocol_interface);
+
if (!handle || !protocol ||
protocol_interface_type != EFI_NATIVE_INTERFACE) {
r = EFI_INVALID_PARAMETER;
@@ -768,33 +771,7 @@ static efi_status_t EFIAPI 
efi_install_protocol_interface(void **handle,
}
r = EFI_INVALID_PARAMETER;
 out:
-   return r;
-}
-
-/*
- * Install protocol interface.
- *
- * This function implements the InstallProtocolInterface service.
- * See the Unified Extensible Firmware Interface (UEFI) specification
- * for details.
- *
- * @handle handle on which the protocol shall be installed
- * @protocol   GUID of the protocol to be installed
- * @protocol_interface_typetype of the interface to be installed,
- * always EFI_NATIVE_INTERFACE
- * @protocol_interface interface of the protocol implementation
- * @return status code
- */
-static efi_status_t EFIAPI efi_install_protocol_interface_ext(void **handle,
-   const efi_guid_t *protocol, int protocol_interface_type,
-   void *protocol_interface)
-{
-   EFI_ENTRY("%p, %pUl, %d, %p", handle, protocol, protocol_interface_type,
- protocol_interface);
-
-   return EFI_EXIT(efi_install_protocol_interface(handle, protocol,
-  protocol_interface_type,
-  protocol_interface));
+   return EFI_EXIT(r);
 }
 
 /*
@@ -1790,9 +1767,10 @@ static efi_status_t EFIAPI 
efi_install_multiple_protocol_interfaces(
if (!protocol)
break;
protocol_interface = va_arg(argptr, void*);
-   r = efi_install_protocol_interface(handle, protocol,
-  EFI_NATIVE_INTERFACE,
-  protocol_interface);
+   r = EFI_CALL(efi_install_protocol_interface(
+   handle, protocol,
+   EFI_NATIVE_INTERFACE,
+   protocol_interface));
if (r != EFI_SUCCESS)
break;
i++;
@@ -2015,7 +1993,7 @@ static const struct efi_boot_services efi_boot_services = 
{
.signal_event = efi_signal_event_ext,
.close_event = efi_close_event,
.check_event = efi_check_event,
-   .install_protocol_interface = efi_install_protocol_interface_ext,
+   .install_protocol_interface = efi_install_protocol_interface,
.reinstall_protocol_interface = efi_reinstall_protocol_interface,
.uninstall_protocol_interface = efi_uninstall_protocol_interface_ext,
.handle_protocol = efi_handle_protocol,
-- 
2.14.2

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


Re: [U-Boot] [RFC] Attempt to Add SPL Support to imx6q_logic

2017-10-22 Thread Lukasz Majewski
Hi Adam,

> The Logic PD i.MX6 dev kit is capable of SPL.  This patch follows
> a similar method as the mx6sabresd
> 
> Following instructions I found which show to put the SPL and .img
> files on the SD card with dd.
> 
> sudo dd if=SPL of=/dev/xxx bs=1K seek=1; sync
> sudo dd if=u-boot.img of=/dev/xxx bs=1K seek=69

The second line requires the u-boot.img stored at 69KiB offset.

> 
> I would prefer to have the u-boot.img in a standard partition if
> possible similar to how the omap3_logic board is done.
> 
> Unfortunately with DEBUG enabled in SPL, I only see:
> 
> U-Boot SPL 2017.11-rc2-00019-g23d51be-dirty (Oct 21 2017 - 16:14:59)
> >>spl:board_init_r()
> spl_early_init()
> Trying to boot from MMC1

It seems like you have specified the u-boot.img eMMC offset in a wrong
way.

Please look for following option:
SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR

It should configure SPL to load u-boot.img from proper eMMC LBA offset.


> 
> I was hoping someone with an i.MX6 might have some insight.
> 
> Signed-off-by: Adam Ford 
> 
> diff --git a/arch/arm/mach-imx/mx6/Kconfig
> b/arch/arm/mach-imx/mx6/Kconfig index b82db3a..750be47 100644
> --- a/arch/arm/mach-imx/mx6/Kconfig
> +++ b/arch/arm/mach-imx/mx6/Kconfig
> @@ -189,6 +189,7 @@ config TARGET_MX6LOGICPD
>   select DM_PMIC
>   select DM_REGULATOR
>   select OF_CONTROL
> + select SUPPORT_SPL
>  
>  config TARGET_MX6QARM2
>   bool "mx6qarm2"
> diff --git a/board/logicpd/imx6/imx6logic.c
> b/board/logicpd/imx6/imx6logic.c index 1f3e378..4742ab8 100644
> --- a/board/logicpd/imx6/imx6logic.c
> +++ b/board/logicpd/imx6/imx6logic.c
> @@ -61,6 +61,7 @@ static iomux_v3_cfg_t const uart3_pads[] = {
>   MX6_PAD_EIM_EB3__UART3_RTS_B | MUX_PAD_CTRL(UART_PAD_CTRL),
>  };
>  
> +#ifndef CONFIG_SPL_BUILD
>  static void fixup_enet_clock(void)
>  {
>   struct iomuxc *iomuxc_regs = (struct iomuxc
> *)IOMUXC_BASE_ADDR; @@ -109,6 +110,7 @@ static void
> fixup_enet_clock(void) dm_gpio_set_value(, 1);
>   mdelay(50);
>  }
> +#endif
>  
>  static void setup_iomux_uart(void)
>  {
> @@ -159,7 +161,9 @@ int overwrite_console(void)
>  
>  int board_early_init_f(void)
>  {
> +#ifndef CONFIG_SPL_BUILD
>   fixup_enet_clock();
> +#endif
>   setup_iomux_uart();
>   setup_nand_pins();
>   return 0;
> @@ -183,3 +187,143 @@ int board_late_init(void)
>  
>   return 0;
>  }
> +
> +#ifdef CONFIG_SPL_BUILD
> +#include 
> +#include 
> +#include 
> +#include 
> +#include "asm/arch-mx6/mx6q-ddr.h"
> +#include "asm/arch-mx6/iomux.h"
> +#include "asm/arch-mx6/crm_regs.h"
> +
> +int spl_start_uboot(void)
> +{
> + return 1;
> +}
> +
> +static void ccgr_init(void)
> +{
> + struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg
> *)CCM_BASE_ADDR; +
> + writel(0x00C03F3F, >CCGR0);
> + writel(0x0030FC03, >CCGR1);
> + writel(0x0FFFC000, >CCGR2);
> + writel(0x3FF0, >CCGR3);
> + writel(0xF300, >CCGR4);
> + writel(0x0FF3, >CCGR5);
> + writel(0x0FFF, >CCGR6);
> +}
> +
> +static int mx6q_dcd_table[] = {
> +
> + MX6_IOM_GRP_DDR_TYPE, 0x000C,
> + MX6_IOM_GRP_DDRPKE, 0x,
> + MX6_IOM_DRAM_SDCLK_0, 0x0030,
> + MX6_IOM_DRAM_SDCLK_1, 0x0030,
> + MX6_IOM_DRAM_CAS, 0x0030,
> + MX6_IOM_DRAM_RAS, 0x0030,
> + MX6_IOM_GRP_ADDDS, 0x0030,
> + MX6_IOM_DRAM_RESET, 0x0030,
> + MX6_IOM_DRAM_SDBA2, 0x,
> + MX6_IOM_DRAM_SDODT0, 0x0030,
> + MX6_IOM_DRAM_SDODT1, 0x0030,
> + MX6_IOM_GRP_CTLDS, 0x0030,
> + MX6_IOM_DDRMODE_CTL, 0x0002,
> + MX6_IOM_DRAM_SDQS0, 0x0030,
> + MX6_IOM_DRAM_SDQS1, 0x0030,
> + MX6_IOM_DRAM_SDQS2, 0x0030,
> + MX6_IOM_DRAM_SDQS3, 0x0030,
> + MX6_IOM_GRP_DDRMODE, 0x0002,
> + MX6_IOM_GRP_B0DS, 0x0030,
> + MX6_IOM_GRP_B1DS, 0x0030,
> + MX6_IOM_GRP_B2DS, 0x0030,
> + MX6_IOM_GRP_B3DS, 0x0030,
> + MX6_IOM_DRAM_DQM0, 0x0030,
> + MX6_IOM_DRAM_DQM1, 0x0030,
> + MX6_IOM_DRAM_DQM2, 0x0030,
> + MX6_IOM_DRAM_DQM3, 0x0030,
> + MX6_MMDC_P0_MDSCR, 0x8000,
> + MX6_MMDC_P0_MPZQHWCTRL, 0xA1390003,
> + MX6_MMDC_P0_MPWLDECTRL0, 0x002D003A,
> + MX6_MMDC_P0_MPWLDECTRL1, 0x0038002B,
> + MX6_MMDC_P0_MPDGCTRL0, 0x03340338,
> + MX6_MMDC_P0_MPDGCTRL1, 0x0334032C,
> + MX6_MMDC_P0_MPRDDLCTL, 0x4036383C,
> + MX6_MMDC_P0_MPWRDLCTL, 0x2E384038,
> + MX6_MMDC_P0_MPRDDQBY0DL, 0x,
> + MX6_MMDC_P0_MPRDDQBY1DL, 0x,
> + MX6_MMDC_P0_MPRDDQBY2DL, 0x,
> + MX6_MMDC_P0_MPRDDQBY3DL, 0x,
> + MX6_MMDC_P0_MPMUR0, 0x0800,
> + MX6_MMDC_P0_MDPDC, 0x00020036,
> + MX6_MMDC_P0_MDOTC, 0x09444040,
> + MX6_MMDC_P0_MDCFG0, 0xB8BE7955,
> + MX6_MMDC_P0_MDCFG1, 0xFF328F64,
> + MX6_MMDC_P0_MDCFG2, 0x01FF00DB,
> + MX6_MMDC_P0_MDMISC, 0x00011740,
> + MX6_MMDC_P0_MDSCR, 0x8000,
> + MX6_MMDC_P0_MDRWD, 0x26D2,
> + 

[U-Boot] [PATCH V2] ARM: imx6: Enable UMS and DFU on DHCOM i.MX6 PDK

2017-10-22 Thread Marek Vasut
Enable UMS and DFU, so that the eMMC can be accessed via the
USB gadget port on the board.

Signed-off-by: Marek Vasut 
Cc: Stefano Babic 
---
V2: Replace G_DNL with USB_GADGET as suggested by Lukasz
---
 board/dhelectronics/dh_imx6/dh_imx6.c | 10 ++
 configs/dh_imx6_defconfig |  8 
 include/configs/dh_imx6.h | 12 
 3 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/board/dhelectronics/dh_imx6/dh_imx6.c 
b/board/dhelectronics/dh_imx6/dh_imx6.c
index c76da4d2af..b00d0e4b6d 100644
--- a/board/dhelectronics/dh_imx6/dh_imx6.c
+++ b/board/dhelectronics/dh_imx6/dh_imx6.c
@@ -252,17 +252,11 @@ static void setup_usb(void)
 }
 
 int board_usb_phy_mode(int port)
-{
-   return USB_INIT_HOST;
-}
-
-/* Use only Port 1 == DHCOM USB Host 1 */
-int board_ehci_hcd_init(int port)
 {
if (port == 1)
-   return 0;
+   return USB_INIT_HOST;
else
-   return -ENODEV;
+   return USB_INIT_DEVICE;
 }
 
 int board_ehci_power(int port, int on)
diff --git a/configs/dh_imx6_defconfig b/configs/dh_imx6_defconfig
index 5d9eda8c7d..175f9fa28c 100644
--- a/configs/dh_imx6_defconfig
+++ b/configs/dh_imx6_defconfig
@@ -19,6 +19,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_UNZIP=y
+CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -27,6 +28,7 @@ CONFIG_CMD_PART=y
 CONFIG_CMD_SATA=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -47,4 +49,10 @@ CONFIG_NETDEVICES=y
 CONFIG_FEC_MXC=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="dh"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_CI_UDC=y
+CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_OF_LIBFDT=y
diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h
index 0595f60e32..11a01d476f 100644
--- a/include/configs/dh_imx6.h
+++ b/include/configs/dh_imx6.h
@@ -115,6 +115,18 @@
 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS   0
 #define CONFIG_USB_MAX_CONTROLLER_COUNT2 /* Enabled USB controller 
number */
+
+/* USB Gadget (DFU, UMS) */
+#if defined(CONFIG_CMD_DFU) || defined(CONFIG_CMD_USB_MASS_STORAGE)
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+
+#define CONFIG_SYS_DFU_DATA_BUF_SIZE   (16 * 1024 * 1024)
+#define DFU_DEFAULT_POLL_TIMEOUT   300
+
+/* USB IDs */
+#define CONFIG_G_DNL_UMS_VENDOR_NUM0x0525
+#define CONFIG_G_DNL_UMS_PRODUCT_NUM   0xA4A5
+#endif
 #endif
 
 /* Watchdog */
-- 
2.14.1

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


[U-Boot] [PATCH] doc: uniphier: add simple guide to Verified Boot

2017-10-22 Thread Masahiro Yamada
Add a simple documentation about how to use the Verified Boot on
UniPhier boards.

Signed-off-by: Masahiro Yamada 
---

 doc/README.uniphier | 227 +++-
 1 file changed, 226 insertions(+), 1 deletion(-)

diff --git a/doc/README.uniphier b/doc/README.uniphier
index e4fd9a3..a58041a 100644
--- a/doc/README.uniphier
+++ b/doc/README.uniphier
@@ -107,6 +107,231 @@ Firmware.
 [ARM Trusted Firmware]: https://github.com/ARM-software/arm-trusted-firmware
 
 
+Verified Boot
+-
+
+U-Boot supports an image verification method called "Verified Boot".
+This is a brief tutorial to utilize this feature for the UniPhier platform.
+You will find details docs in the doc/uImage.FIT directory.
+
+Here, we take LD20 reference board for example, but it should work for any
+other boards including 32 bit SoCs.
+
+1. Generate key to sign with
+
+  $ mkdir keys
+  $ openssl genpkey -algorithm RSA -out keys/dev.key \
+-pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:65537
+  $ openssl req -batch -new -x509 -key keys/dev.key -out keys/dev.crt
+
+Two files "dev.key" and "dev.crt" will be created.  The base name is arbitrary,
+but need to match to the "key-name-hint" property described below.
+
+2. Describe FIT source
+
+You need to write an FIT (Flattened Image Tree) source file to describe the
+structure of the image container.
+
+The following is an example for a simple usecase:
+
+>8
+/dts-v1/;
+
+/ {
+   description = "Kernel, DTB and Ramdisk for UniPhier LD20 Reference 
Board";
+   #address-cells = <1>;
+
+   images {
+   kernel@0 {
+   description = "linux";
+   data = 
/incbin/("PATH/TO/YOUR/LINUX/DIR/arch/arm64/boot/Image.gz");
+   type = "kernel";
+   arch = "arm64";
+   os = "linux";
+   compression = "gzip";
+   load = <0x8208>;
+   entry = <0x8208>;
+   hash@0 {
+   algo = "sha256";
+   };
+   };
+
+   fdt@0 {
+   description = "fdt";
+   data = 
/incbin/("PATH/TO/YOUR/LINUX/DIR/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dtb");
+   type = "flat_dt";
+   arch = "arm64";
+   compression = "none";
+   hash@0 {
+   algo = "sha256";
+   };
+   };
+
+   ramdisk@0 {
+   description = "ramdisk";
+   data = /incbin/("PATH/TO/YOUR/ROOTFS/DIR/rootfs.cpio");
+   type = "ramdisk";
+   arch = "arm64";
+   os = "linux";
+   compression = "none";
+   hash@0 {
+   algo = "sha256";
+   };
+   };
+   };
+
+   configurations {
+   default = "config@0";
+
+   config@0 {
+   description = "Configuration0";
+   kernel = "kernel@0";
+   fdt = "fdt@0";
+   ramdisk = "ramdisk@0";
+   signature@0 {
+   algo = "sha256,rsa2048";
+   key-name-hint = "dev";
+   sign-images = "kernel", "fdt", "ramdisk";
+   };
+   };
+   };
+};
+>8
+
+You need to change the three '/incbin/' lines, depending on the location of
+your kernel image, device tree blob, and init ramdisk.  The "load" and "entry"
+properties also need to be adjusted if you want to change the physical 
placement
+of the kernel.
+
+The "key-name-hint" must specify the key name you have created in the step 1.
+
+The FIT file name is arbitrary.  Let's say you saved it into "fit.its".
+
+3. Compile U-Boot with FIT and signature enabled
+
+To use the Verified Boot, you need to enable the following two options:
+  CONFIG_FIT
+  CONFIG_FIT_SIGNATURE
+
+They are disabled by default for UniPhier defconfig files.  So, you need to
+tweak the configuration from "make menuconfig" or friends.
+
+  $ make uniphier_v8_defconfig
+  $ make menuconfig
+  [ enable CONFIG_FIT and CONFIG_FIT_SIGNATURE ]
+  $ make CROSS_COMPILE=aarch64-linux-gnu-
+
+4. Build the image tree blob
+
+After building U-Boot, you will see tools/mkimage.  With this tool, you can
+create an image tree blob as follows:
+
+  $ tools/mkimage -f fit.its -k keys -K dts/dt.dtb -r -F fitImage
+
+The -k option must specify the key directory you have created in step 1.
+
+A