[U-Boot] i.MX286 U-Boot fails with code HTLLCL0x8050100b

2016-02-11 Thread Stuart Longland
Hi all,

I'm trying to build a previously known working branch of U-Boot that I
built some time back which forks from revision
e89d623f099c44b0b166ccf46bce2e6a0b99c984.

I previously built this before, the binaries and source for which are
here: http://bne.vrt.com.au/technologicsys/

There you'll find the notes on exactly how I built it too.

Since I did development there, I've done a number of system updates on
my workstation, and so I suspect one of them has broken something, as
when I try to build that U-Boot branch and `dd` the resulting
`u-boot.sd` (according to the documentation in doc/README.mxs), I now
get the following error code displayed:

HTLLCL0x8050100b

The documentation I found here http://www.denx-cs.de/?q=blogm28mxssb
seemed to suggest the following meaning:


.--- Valid SB
|.-- SB tag
||.- u-boot-spl.bin loaded
|||. IVT loaded
.--- SPL executed
|.-- U-Boot binary loaded
HTLLCL0x8050100b
  ''
CRC Error

I'm guessing "IVT" here means interrupt vector table, and that the lack
of a second 'L' suggests it was loading of this interrupt vector table
that failed due to a CRC error.

I've tried building u-boot with a number of different toolchains:
- binutils-2.25.1, gcc-4.7.3, glibc, EABI, built using Gentoo crossdev
- arm-none-eabi toolchain, self-built using sources from
https://launchpad.net/gcc-arm-embedded
- Linaro arm EABI toolchain from
http://releases.linaro.org/14.11/components/toolchain/binaries/arm-linux-gnueabi/

None of these seem to generate a successfully booting binary, which is
perplexing to say the least.  Is there somewhere else I should be
looking for the cause of the above issue?

Regards,
-- 
 _ ___ Stuart Longland - Systems Engineer
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Moving custom board imx6q from u-boot-imx 2014.04 to 2015.04 lead to freeze

2016-02-11 Thread Roberto Fichera
On 02/10/2016 07:59 PM, Fabio Estevam wrote:
> On Wed, Feb 10, 2016 at 9:47 AM, Roberto Fichera  wrote:
>> Hi All,
>>
>> After upgrading my u-boot-imx v2014.04 to v2015.04 I was not able to boot 
>> anymore my custom iMX6Q
> Why don't you try 2016.01 instead?
>

It has the same problem, below standard boot without apply any changes:

U-Boot 2016.01-v2016.01+gfa85e82 (Feb 11 2016 - 10:05:36 +0100)

CPU:   Freescale i.MX6Q rev1.5 at 792 MHz
Reset cause: POR
Board: Janas iMX6Q (ID:e315c0641d0f31d4)
I2C:   Error, wrong i2c adapter 0 max 0 possible
Error, wrong i2c adapter 0 max 0 possible
ready
DRAM:  2 GiB
<...freeze...>

Apply similar patch for v2015.04

diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
index 92d3732..f87acb6 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -108,7 +108,7 @@ here:
  * now relocate vectors
  */
 
-blrelocate_vectors
+/* blrelocate_vectors */
 
 /* Set up final (full) environment */

still need to  fix some voltages and ldo bypass but at least boot

U-Boot 2016.01-v2016.01+gfa85e82 (Feb 11 2016 - 10:38:05 +0100)

CPU:   Freescale i.MX6Q rev1.5 at 792 MHz
Reset cause: POR
Board: Janas iMX6Q (ID:e315c0641d0f31d4)
I2C:   ready
DRAM:  2 GiB
PMIC:  PFUZE100 ID=0x10
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Card did not respond to voltage select!
*** Warning - MMC init failed, using default environment

PCI:   pcie phy link never came up
In:serial
Out:   serial
Err:   serial
switch to partitions #0, OK
mmc1(part 0) is current device
Net:   FEC [PRIME]
Error: FEC address not set.

Hit any key to stop autoboot:  0
=>

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


Re: [U-Boot] [PATCH V3] Makefile: remove BUILD_TAG from KBUILD_CFLAGS

2016-02-11 Thread Masahiro Yamada
2016-02-11 7:16 GMT+09:00 Stephen Warren :
> From: Stephen Warren 
>
> If BUILD_TAG is part of KBUILD_CFLAGS, then any time the value changes,
> all files get rebuilt. In a continuous integration environment, the value
> will change every build. This wastes time, assuming that incremental
> builds would otherwise occur.
>
> To solve this, remove BUILD_TAG from KBUILD_CFLAGS and add it to CFLAGS
> for just the one file that uses it. This does have the disadvantage that
> if any other files want to use the flag, we'll need to duplicate this
> custom CFLAGS setup logic. However, it seems unlikely we'll need this.
>
> An alternative would be to add BUILD_TAG to the "local version" and remove
> the special case code from display_options.c. However, that would affect
> the format of the U-Boot signon message, which may negatively affect
> people looking for specific data there. The approach of using
> file-specific CFLAGS was suggested by Masahiro Yamada.
>
> Signed-off-by: Stephen Warren 
> ---
> v3: Undo accidental removal of bch.o.
> v2: Set CFLAGS on display_options.c rather than modifying
> scripts/setlocalversion to add BUILD_TAG to the local version.


Reviewed-by: Masahiro Yamada 


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


Re: [U-Boot] [PATCH][v2] armv8/ls2080ardb: Enable VID support

2016-02-11 Thread Harninder Rai
> 
> Did you test this patch to confirm the voltage change? I don't see you calling
> adjust_vdd().
Yes I did test couple of voltage levels using vdd_override from the u-boot 
prompt. Voltage was getting changed correctly and I measured through multi meter
But I think I understand your point. I will sent v3 of the patch including 
adjust_vdd(0) call
> 
> York

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


Re: [U-Boot] Using old Config Style

2016-02-11 Thread Hannes Schmelzer



On 11.02.2016 09:55, Mario Albrecht wrote:

Hallo Hannes,

how can I define commands in defconfig file which should be used or not used?

Regards Mario

-Ursprüngliche Nachricht-
Von: Hannes Schmelzer [mailto:han...@schmelzer.or.at]
Gesendet: Mittwoch, 10. Februar 2016 19:01
An: Mario Albrecht
Betreff: Re: [U-Boot] Using old Config Style


On 2016-02-10 17:02, Mario Albrecht wrote:

Hi,

i have a small question about using old board specific config files.
I have a config file for a board which contains all needed commands
defined by #define CONFIG_CMD_ and #undef CONFIG_CMD_.
In new u-boot Version a autoconf.h file is generated which conflicts
the defines in the board.h file. How can I disable autoconf.h
generation or get the right commands in this file.

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



hi Mario,

the much better approach would be converting your board to Kconfig.
you can create some xxxboard_defconfig in configs/ were all your needed 
commands are checked.

regards,
Hannes

hi mario,

have a look for example in configs/tseries_mmc_defconfig.

Basically some commands are defined through Kconfig as 'default on' 
other with 'default off'.


# CONFIG_CMD_FPGA is not set
CONFIG_CMD_GPIO=y

in this example the CMD_FPGA is default on and set through my defconfig 
to OFF.
At the other hand CMD_GPIO is per default off and set through defconfig 
to ON.


To generate some xxx_defconfig file you may config your u-boot simply 
with "make menuconfig" and afterwards "make savedefconfig".
This will generate a "defconfig" File in your build-output folder, from 
there you can merge this with your xxx_defconfig file.


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


[U-Boot] [PATCH] drivers/crypto/fsl: correct error checking in run_descriptor

2016-02-11 Thread Aneesh Bansal
When CAAM runs a descriptor and an error occurs, a non-zero
value is set in Output Status Register.
The if condition should check the status for a non-zero value.

Signed-off-by: Aneesh Bansal 
---
 drivers/crypto/fsl/jr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/fsl/jr.c b/drivers/crypto/fsl/jr.c
index b553e3c..f4069b5 100644
--- a/drivers/crypto/fsl/jr.c
+++ b/drivers/crypto/fsl/jr.c
@@ -353,7 +353,7 @@ int run_descriptor_jr(uint32_t *desc)
}
}
 
-   if (!op.status) {
+   if (op.status) {
debug("Error %x\n", op.status);
ret = op.status;
}
-- 
1.8.1.4

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


[U-Boot] [PATCH 1/2] arm: socfpga: av_socdk: Add support for QSPI boot

2016-02-11 Thread Marek Vasut
Add missing DT nodes to allow booting from QSPI NOR.

Signed-off-by: Marek Vasut 
Cc: Dinh Nguyen 
Cc: Chin Liang See 
Cc: Denis Bakhvalov 
---
 arch/arm/dts/socfpga_arria5_socdk.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/dts/socfpga_arria5_socdk.dts 
b/arch/arm/dts/socfpga_arria5_socdk.dts
index 5933a40..9ac48a1 100644
--- a/arch/arm/dts/socfpga_arria5_socdk.dts
+++ b/arch/arm/dts/socfpga_arria5_socdk.dts
@@ -82,8 +82,10 @@
 
  {
status = "okay";
+   u-boot,dm-pre-reloc;
 
flash0: n25q00@0 {
+   u-boot,dm-pre-reloc;
#address-cells = <1>;
#size-cells = <1>;
compatible = "n25q00";
-- 
2.1.4

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


[U-Boot] [PATCH 2/2] arm: socfpga: cv_socdk: Add support for QSPI boot

2016-02-11 Thread Marek Vasut
Add missing DT nodes to allow booting from QSPI NOR.

Signed-off-by: Marek Vasut 
Cc: Dinh Nguyen 
Cc: Chin Liang See 
Cc: Denis Bakhvalov 
---
 arch/arm/dts/socfpga_cyclone5_socdk.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/dts/socfpga_cyclone5_socdk.dts 
b/arch/arm/dts/socfpga_cyclone5_socdk.dts
index a202709..da13435 100644
--- a/arch/arm/dts/socfpga_cyclone5_socdk.dts
+++ b/arch/arm/dts/socfpga_cyclone5_socdk.dts
@@ -84,8 +84,10 @@
 
  {
status = "okay";
+   u-boot,dm-pre-reloc;
 
flash0: n25q00@0 {
+   u-boot,dm-pre-reloc;
#address-cells = <1>;
#size-cells = <1>;
compatible = "n25q00";
-- 
2.1.4

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


Re: [U-Boot] Problem with mounting a jffs2 partition on flash.

2016-02-11 Thread Marek Vasut
On 02/11/2016 03:02 PM, Bakhvalov, Denis (Nokia - PL/Wroclaw) wrote:
> $ quartus_hps -c 1 -o PV -a 0x0 u-boot-with-spl.sfp.bin
> // here ".bin" because current programmer requires so. I think it shouldn't 
> be a problem.

This looks fine. You should be able to avoid renaming the file to have a
.bin suffix, the quartus_hps should take any file. I only tested it
with quartus 15.1 though, so it is possible there was a change since
13.1 which is what you use.

> From manual:
> "HPS Flash Programmer
> The utility accepts a Binary File with a required ".bin" extension.
> The HPS flash programmer command-line syntax is:
> quartus_hps  "
> 
> Info: Version 13.1.0 Build 162 10/23/2013 SJ Full Version
> 
> After that I power off/on the unit and nothing happened.
> I also compared md5 while copying - everything should be ok.
> 
> I tried it 2 times with no success:
> Looks like unit is no booting.
> No output in the console is visible.

There is output, but it takes a while for the USB-to-UART chip to kick
in after restart, so you don't see it. I will send you two more patches,
so apply them and it should get you up and running. The QSPI NOR boot
was not enabled on AV/CV SoCDK.

You can also grab the latest stuff here:
http://git.denx.de/?p=u-boot/u-boot-socfpga.git;a=summary

> If I change the images back (that is currently in official release) - at 
> least bootloader pass and u-boot is also launching.
> 
> Does it mean that there is something wrong with SPL configuration?
> Or maybe I need some patches from altera in order to make them working?
> Because I can see some traces of applied patches in the svn history.
> 
> Best regards,
> Denis Bakhvalov
> 

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


Re: [U-Boot] [PATCH 1/2] arm: socfpga: av_socdk: Add support for QSPI boot

2016-02-11 Thread Jagan Teki
On 11 February 2016 at 20:26, Marek Vasut  wrote:
> Add missing DT nodes to allow booting from QSPI NOR.
>
> Signed-off-by: Marek Vasut 
> Cc: Dinh Nguyen 
> Cc: Chin Liang See 
> Cc: Denis Bakhvalov 
> ---

Reviewed-by: Jagan Teki 

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


Re: [U-Boot] [PATCH 3/4] spi: omap3: Convert to DM

2016-02-11 Thread Jagan Teki
On 11 February 2016 at 02:30, Christophe Ricard
 wrote:
> Hi Jagan,
>
> My understanding is that some work are ongoing around spl in order to
> support correctly DM for all spi/i2c bus drivers.
> As a consequence patch 4 got differed.
>
> Hopefully Simon or Tom can comment.
>
> Are you ok in applying patch 1 and 2 only ? or should i send a new serie
> with only patch 1 and 2 ?

3/4 looks not good to me with so many ifdef, may we can do something
clear similar to kirkwood_spi does.

>
> On 10/02/2016 20:16, Jagan Teki wrote:
>>
>> On 8 February 2016 at 23:26, Jagan Teki  wrote:
>>>
>>> On 8 February 2016 at 23:10, Tom Rini  wrote:

 On Sat, Feb 06, 2016 at 11:27:21PM +0100, Christophe Ricard wrote:
>
> Hi Simon, Tom,
>
> I assume the approach you are taking is also valuable for the i2c:
> omap24xx patch serie:
> http://lists.denx.de/pipermail/u-boot/2016-January/241676.html
>
> What are your recommendation about the pending patches ?
> Should i send back only the one not taking care of the DM conversion
> and send another serie later ?
>
> I have seen some work ongoing on this topic on the u-boot-fdt tree
> on the spl-working branch.
> Is there a more accurate place to follow this work ?

 For i2c, aside from needing to defer removing the non-DM code for a
 while yet, there were some review comments to address in a v2 or answer
 as intentional.  For SPI, it's all looking good and I'm assuming Jagan
 will have a SPI PR soon.  Thanks!
>>>
>>> Yes, by this week-end.
>>
>> Any idea 4/4 got differed in patchwork [1], do we have next version
>> patches for these?
>>
>> [1] https://patchwork.ozlabs.org/patch/569241/
>>
> On 26/01/2016 02:55, Peng Fan wrote:
>>
>> Hi Simon,
>>
>> On Mon, Jan 25, 2016 at 06:11:24PM -0700, Simon Glass wrote:
>>>
>>> +Hans
>>>
>>> Hi Tom,
>>>
>>> On 21 January 2016 at 05:24, Tom Rini  wrote:

 On Wed, Jan 20, 2016 at 07:46:15PM -0700, Simon Glass wrote:
>
> +Mugunthan, Tom
>
> On 17 January 2016 at 03:56, Christophe Ricard
>  wrote:
>>
>> Convert omap3_spi driver to DM and keep compatibility with
>> previous
>> mode.
>>
>> Signed-off-by: Christophe Ricard 
>> ---
>>
>>   drivers/spi/Kconfig |   6 +
>>   drivers/spi/omap3_spi.c | 439
>> ++--
>>   drivers/spi/omap3_spi.h |  14 +-
>>   3 files changed, 402 insertions(+), 57 deletions(-)
>
> This is a pretty painful conversion, with lots of #ifdefs. I think
> it
> would be possible to use a common pointer type and reduce this.
>
> But perhaps it does not matter - how long must we be in the state
> of
> supporting legacy SPI? Can we convert all TI boards to driver
> model?

 We _really_ need some way to support more than one board per binary
 before we can move everything to DM only.

 I think we can kind of do this today if we stick to using platform
 data
 for everything that's board-specific rather than SoC-defined.  What
 we
 talked about at ELCE was auto-generating the pdata from the device
 tree,
 I think.
>>>
>>> We discussed this on IRC but since that doesn't exist as far as the
>>> mailing list is concerned...
>>>
>>> The current plan is:
>>>
>>> - Adjust build system to optionally build a u-boot.img in FIT format
>>> that includes the U-Boot binary and >1 device tree files
>>> - Adjust SPL to load this
>>> - Add a way for SPL to determine which device tree to select (by
>>> calling a board-specific function)
>>> - Have SPL pass this selected device tree to U-Boot when it starts
>>
>> Can dtb be sperated from the final u-boot.img, if using SPL?
>> I mean let SPL load the u-boot.img and the dtb to correct DRAM
>> address.
>> And the dtb is shared with linux kernel.
>>
>> Regards,
>> Peng.
>>>
>>> Thus we should be able to support more than one board with a single
>>> U-Boot image. Of course this is not a perfect solution (e.g. it is
>>> inefficient since the DTs are likely to be largely the same) but it
>>> should be a good first step.
>>>
>>> I'm going to try this out with sunxi initially and plan to get some
>>> patches out by the end of the week.
>
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot



-- 
Jagan.
___
U-Boot mailing list

Re: [U-Boot] [PATCH 2/2] arm: socfpga: cv_socdk: Add support for QSPI boot

2016-02-11 Thread Jagan Teki
On 11 February 2016 at 20:26, Marek Vasut  wrote:
> Add missing DT nodes to allow booting from QSPI NOR.
>
> Signed-off-by: Marek Vasut 
> Cc: Dinh Nguyen 
> Cc: Chin Liang See 
> Cc: Denis Bakhvalov 
> ---

Reviewed-by: Jagan Teki 

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


[U-Boot] [PATCH 2/2] dm: Use uclass_first_device_err() where it is useful

2016-02-11 Thread Simon Glass
Use this new function in places where it simplifies the code.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-rockchip/rk3288/sdram_rk3288.c |  2 +-
 arch/nios2/cpu/cpu.c |  4 +---
 arch/x86/cpu/interrupts.c|  2 +-
 arch/x86/cpu/ivybridge/cpu.c | 14 +-
 arch/x86/cpu/ivybridge/gma.c |  6 +++---
 arch/x86/cpu/ivybridge/sata.c|  4 +---
 arch/x86/cpu/ivybridge/sdram.c   |  4 +---
 arch/x86/lib/mpspec.c|  2 +-
 cmd/bmp.c| 12 
 cmd/tpm.c|  4 ++--
 drivers/gpio/rk_gpio.c   |  4 +---
 drivers/misc/altera_sysid.c  |  4 +---
 drivers/pci/pci-uclass.c |  4 +---
 drivers/power/regulator/regulator-uclass.c   |  2 +-
 drivers/timer/timer-uclass.c |  4 +---
 drivers/video/vidconsole-uclass.c|  6 ++
 lib/tpm.c|  6 +++---
 17 files changed, 30 insertions(+), 54 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c 
b/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c
index e9e2211..2e21282 100644
--- a/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c
+++ b/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c
@@ -756,7 +756,7 @@ static int veyron_init(struct dram_info *priv)
struct udevice *pmic;
int ret;
 
-   ret = uclass_first_device(UCLASS_PMIC, );
+   ret = uclass_first_device_err(UCLASS_PMIC, );
if (ret)
return ret;
 
diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c
index be7f99c..4f0f8fc 100644
--- a/arch/nios2/cpu/cpu.c
+++ b/arch/nios2/cpu/cpu.c
@@ -63,11 +63,9 @@ int arch_cpu_init_dm(void)
struct udevice *dev;
int ret;
 
-   ret = uclass_first_device(UCLASS_CPU, );
+   ret = uclass_first_device_err(UCLASS_CPU, );
if (ret)
return ret;
-   if (!dev)
-   return -ENODEV;
 
gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
 #ifndef CONFIG_ROM_STUBS
diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c
index c40200b..10dc4d4 100644
--- a/arch/x86/cpu/interrupts.c
+++ b/arch/x86/cpu/interrupts.c
@@ -249,7 +249,7 @@ int interrupt_init(void)
int ret;
 
/* Try to set up the interrupt router, but don't require one */
-   ret = uclass_first_device(UCLASS_IRQ, );
+   ret = uclass_first_device_err(UCLASS_IRQ, );
if (ret && ret != -ENODEV)
return ret;
 
diff --git a/arch/x86/cpu/ivybridge/cpu.c b/arch/x86/cpu/ivybridge/cpu.c
index 948833c..5d839a7 100644
--- a/arch/x86/cpu/ivybridge/cpu.c
+++ b/arch/x86/cpu/ivybridge/cpu.c
@@ -104,9 +104,9 @@ int arch_cpu_init_dm(void)
/* TODO(s...@chromium.org): Get rid of gd->hose */
gd->hose = hose;
 
-   ret = uclass_first_device(UCLASS_LPC, );
-   if (!dev)
-   return -ENODEV;
+   ret = uclass_first_device_err(UCLASS_LPC, );
+   if (ret)
+   return ret;
 
/*
 * We should do as little as possible before the serial console is
@@ -210,11 +210,9 @@ int print_cpuinfo(void)
/* Early chipset init required before RAM init can work */
uclass_first_device(UCLASS_NORTHBRIDGE, );
 
-   ret = uclass_first_device(UCLASS_LPC, );
+   ret = uclass_first_device_err(UCLASS_LPC, );
if (ret)
return ret;
-   if (!dev)
-   return -ENODEV;
 
/* Cause the SATA device to do its early init */
uclass_first_device(UCLASS_DISK, );
@@ -236,11 +234,9 @@ int print_cpuinfo(void)
post_code(POST_EARLY_INIT);
 
/* Enable SPD ROMs and DDR-III DRAM */
-   ret = uclass_first_device(UCLASS_I2C, );
+   ret = uclass_first_device_err(UCLASS_I2C, );
if (ret)
return ret;
-   if (!dev)
-   return -ENODEV;
 
/* Prepare USB controller early in S3 resume */
if (boot_mode == PEI_BOOT_RESUME)
diff --git a/arch/x86/cpu/ivybridge/gma.c b/arch/x86/cpu/ivybridge/gma.c
index 3b6291e..91a57f9 100644
--- a/arch/x86/cpu/ivybridge/gma.c
+++ b/arch/x86/cpu/ivybridge/gma.c
@@ -812,9 +812,9 @@ int gma_func0_init(struct udevice *dev)
writew(0x0010, RCB_REG(DISPBDF));
setbits_le32(RCB_REG(FD2), PCH_ENABLE_DBDF);
 
-   ret = uclass_first_device(UCLASS_NORTHBRIDGE, );
-   if (!nbridge)
-   return -ENODEV;
+   ret = uclass_first_device_err(UCLASS_NORTHBRIDGE, );
+   if (ret)
+   return ret;
rev = bridge_silicon_revision(nbridge);
sandybridge_setup_graphics(nbridge, dev);
 
diff --git a/arch/x86/cpu/ivybridge/sata.c b/arch/x86/cpu/ivybridge/sata.c
index a59d9ed..da6455b 100644
--- a/arch/x86/cpu/ivybridge/sata.c
+++ b/arch/x86/cpu/ivybridge/sata.c
@@ -229,11 +229,9 @@ static int bd82x6x_sata_probe(struct udevice *dev)

Re: [U-Boot] [PATCH 1/2] dm: video: Add a temporary work-around for old stdout var

2016-02-11 Thread Simon Glass
Hi Stephen,

On 8 February 2016 at 14:09, Stephen Warren  wrote:
> On 02/06/2016 02:31 PM, Simon Glass wrote:
>>
>> Boards with a saved environment may use 'lcd' in their stdout environment
>> variable, expecting that this will enable output to the LCD. When the
>> board
>> moves to use driver model for video, this will no-longer work. Add a
>> work-around to fix this. A warning messages is printed, and we will remove
>> the work-around at the end of 2016.
>
>
> I tested u-boot-dm/tegra-working which I assume is the same as these
> patches, so the series,
>
> Tested-by: Stephen Warren 
>
> But...
>
>> diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
>
>
>> +config VIDCONSOLE_AS_LCD
>> +   bool "Use 'vidconsole' when 'lcd' is seen in stdout"
>> +   depends on DM_VIDEO
>> +   help
>> + This is a work-around for boards which have 'lcd' in their
>> stdout
>> + environment variable, but have moved to use driver model for
>> video.
>> + In this case the console will no-longer work. While it is
>> possible
>> + to update the environment, the breakage may be confusing for
>> users.
>> + This option will be removed around the end of 2016.
>
>
> Removing this option at the end of 2016 is simply going to cause the exact
> same problem then. Is there any harm in simply not deprecating this feature?
> I suppose at least there's a warning that people should convert over, so
> perhaps they will and so the chances of people getting bitten by this well
> be less by then.

Also we do need people to keep up with things to some extent.
Otherwise we end up with cruft that confuses people. There is a
prominent run-time message that people will see in the meantime.

What's the status of this series now? I'd like to see if it can be applied.

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


[U-Boot] [PATCH 2/3] spi: omap3: Make local functions as static

2016-02-11 Thread Jagan Teki
Attach static on local defined functions.

Cc: Tom Rini 
Cc: Simon Glass 
Cc: Christophe Ricard 
Signed-off-by: Jagan Teki 
---
 drivers/spi/omap3_spi.c | 19 ++-
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c
index 12fa290..8b0f665 100644
--- a/drivers/spi/omap3_spi.c
+++ b/drivers/spi/omap3_spi.c
@@ -105,13 +105,6 @@ static inline struct omap3_spi_slave *to_omap3_spi(struct 
spi_slave *slave)
return container_of(slave, struct omap3_spi_slave, slave);
 }
 
-int omap3_spi_txrx(struct spi_slave *slave, unsigned int len, const void *txp,
-   void *rxp, unsigned long flags);
-int omap3_spi_write(struct spi_slave *slave, unsigned int len, const void *txp,
-   unsigned long flags);
-int omap3_spi_read(struct spi_slave *slave, unsigned int len, void *rxp,
-  unsigned long flags);
-
 static void spi_reset(struct omap3_spi_slave *ds)
 {
unsigned int tmp;
@@ -312,8 +305,8 @@ void spi_release_bus(struct spi_slave *slave)
spi_reset(ds);
 }
 
-int omap3_spi_write(struct spi_slave *slave, unsigned int len, const void *txp,
-   unsigned long flags)
+static int omap3_spi_write(struct spi_slave *slave, unsigned int len,
+  const void *txp, unsigned long flags)
 {
struct omap3_spi_slave *ds = to_omap3_spi(slave);
int i;
@@ -366,8 +359,8 @@ int omap3_spi_write(struct spi_slave *slave, unsigned int 
len, const void *txp,
return 0;
 }
 
-int omap3_spi_read(struct spi_slave *slave, unsigned int len, void *rxp,
-  unsigned long flags)
+static int omap3_spi_read(struct spi_slave *slave, unsigned int len,
+ void *rxp, unsigned long flags)
 {
struct omap3_spi_slave *ds = to_omap3_spi(slave);
int i;
@@ -420,8 +413,8 @@ int omap3_spi_read(struct spi_slave *slave, unsigned int 
len, void *rxp,
 }
 
 /*McSPI Transmit Receive Mode*/
-int omap3_spi_txrx(struct spi_slave *slave, unsigned int len,
-  const void *txp, void *rxp, unsigned long flags)
+static int omap3_spi_txrx(struct spi_slave *slave, unsigned int len,
+ const void *txp, void *rxp, unsigned long flags)
 {
struct omap3_spi_slave *ds = to_omap3_spi(slave);
ulong start;
-- 
1.9.1

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


[U-Boot] [PATCH 3/3] spi: omap3: Convert to driver model

2016-02-11 Thread Jagan Teki
After this conversion the driver will able to support
both dm and non-dm and code is more extensible like we
can remove the non-dm part simply without touching anycode
if all the boards which are using this driver become dm driven.

Cc: Tom Rini 
Cc: Simon Glass 
Cc: Christophe Ricard 
Signed-off-by: Jagan Teki 
---
 drivers/spi/omap3_spi.c | 678 +---
 1 file changed, 407 insertions(+), 271 deletions(-)

diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c
index 8b0f665..5770848 100644
--- a/drivers/spi/omap3_spi.c
+++ b/drivers/spi/omap3_spi.c
@@ -1,4 +1,6 @@
 /*
+ * Copyright (C) 2016 Jagan Teki 
+ *
  * Copyright (C) 2010 Dirk Behme 
  *
  * Driver for McSPI controller on OMAP3. Based on davinci_spi.c
@@ -15,6 +17,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -93,312 +96,122 @@ struct mcspi {
/* channel3: 0x68 - 0x78, bus 0 */
 };
 
-struct omap3_spi_slave {
-   struct spi_slave slave;
+struct omap3_spi_priv {
struct mcspi *regs;
+   unsigned int cs;
unsigned int freq;
unsigned int mode;
+   unsigned int wordlen;
 };
 
-static inline struct omap3_spi_slave *to_omap3_spi(struct spi_slave *slave)
-{
-   return container_of(slave, struct omap3_spi_slave, slave);
-}
-
-static void spi_reset(struct omap3_spi_slave *ds)
-{
-   unsigned int tmp;
-
-   writel(OMAP3_MCSPI_SYSCONFIG_SOFTRESET, >regs->sysconfig);
-   do {
-   tmp = readl(>regs->sysstatus);
-   } while (!(tmp & OMAP3_MCSPI_SYSSTATUS_RESETDONE));
-
-   writel(OMAP3_MCSPI_SYSCONFIG_AUTOIDLE |
-OMAP3_MCSPI_SYSCONFIG_ENAWAKEUP |
-OMAP3_MCSPI_SYSCONFIG_SMARTIDLE,
->regs->sysconfig);
-
-   writel(OMAP3_MCSPI_WAKEUPENABLE_WKEN, >regs->wakeupenable);
-}
-
-static void omap3_spi_write_chconf(struct omap3_spi_slave *ds, int val)
+static void omap3_spi_write_chconf(struct omap3_spi_priv *priv, int val)
 {
-   writel(val, >regs->channel[ds->slave.cs].chconf);
+   writel(val, >regs->channel[priv->cs].chconf);
/* Flash post writes to make immediate effect */
-   readl(>regs->channel[ds->slave.cs].chconf);
+   readl(>regs->channel[priv->cs].chconf);
 }
 
-static void omap3_spi_set_enable(struct omap3_spi_slave *ds, int enable)
+static void omap3_spi_set_enable(struct omap3_spi_priv *priv, int enable)
 {
-   writel(enable, >regs->channel[ds->slave.cs].chctrl);
+   writel(enable, >regs->channel[priv->cs].chctrl);
/* Flash post writes to make immediate effect */
-   readl(>regs->channel[ds->slave.cs].chctrl);
-}
-
-void spi_init()
-{
-   /* do nothing */
-}
-
-struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
- unsigned int max_hz, unsigned int mode)
-{
-   struct omap3_spi_slave  *ds;
-   struct mcspi *regs;
-
-   /*
-* OMAP3 McSPI (MultiChannel SPI) has 4 busses (modules)
-* with different number of chip selects (CS, channels):
-* McSPI1 has 4 CS (bus 0, cs 0 - 3)
-* McSPI2 has 2 CS (bus 1, cs 0 - 1)
-* McSPI3 has 2 CS (bus 2, cs 0 - 1)
-* McSPI4 has 1 CS (bus 3, cs 0)
-*/
-
-   switch (bus) {
-   case 0:
-   regs = (struct mcspi *)OMAP3_MCSPI1_BASE;
-   break;
-#ifdef OMAP3_MCSPI2_BASE
-   case 1:
-   regs = (struct mcspi *)OMAP3_MCSPI2_BASE;
-   break;
-#endif
-#ifdef OMAP3_MCSPI3_BASE
-   case 2:
-   regs = (struct mcspi *)OMAP3_MCSPI3_BASE;
-   break;
-#endif
-#ifdef OMAP3_MCSPI4_BASE
-   case 3:
-   regs = (struct mcspi *)OMAP3_MCSPI4_BASE;
-   break;
-#endif
-   default:
-   printf("SPI error: unsupported bus %i. \
-   Supported busses 0 - 3\n", bus);
-   return NULL;
-   }
-
-   if (((bus == 0) && (cs > 3)) ||
-   ((bus == 1) && (cs > 1)) ||
-   ((bus == 2) && (cs > 1)) ||
-   ((bus == 3) && (cs > 0))) {
-   printf("SPI error: unsupported chip select %i \
-   on bus %i\n", cs, bus);
-   return NULL;
-   }
-
-   if (max_hz > OMAP3_MCSPI_MAX_FREQ) {
-   printf("SPI error: unsupported frequency %i Hz. \
-   Max frequency is 48 Mhz\n", max_hz);
-   return NULL;
-   }
-
-   if (mode > SPI_MODE_3) {
-   printf("SPI error: unsupported SPI mode %i\n", mode);
-   return NULL;
-   }
-
-   ds = spi_alloc_slave(struct omap3_spi_slave, bus, cs);
-   if (!ds) {
-   printf("SPI error: malloc of SPI structure 

[U-Boot] [PATCH 1/3] spi: omap3: Move headers code inside the driver

2016-02-11 Thread Jagan Teki
Header file have macro's and register definition and
some unneeded function proto types which becomes tunned
further in future patches and entire driver code resides
in one file for more readability.

Cc: Tom Rini 
Cc: Simon Glass 
Cc: Christophe Ricard 
Signed-off-by: Jagan Teki 
---
 drivers/spi/omap3_spi.c |  94 -
 drivers/spi/omap3_spi.h | 109 
 2 files changed, 92 insertions(+), 111 deletions(-)
 delete mode 100644 drivers/spi/omap3_spi.h

diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c
index 95cdfa3..12fa290 100644
--- a/drivers/spi/omap3_spi.c
+++ b/drivers/spi/omap3_spi.c
@@ -18,9 +18,99 @@
 #include 
 #include 
 #include 
-#include "omap3_spi.h"
 
-#define SPI_WAIT_TIMEOUT 10
+#if defined(CONFIG_AM33XX) || defined(CONFIG_AM43XX)
+#define OMAP3_MCSPI1_BASE  0x48030100
+#define OMAP3_MCSPI2_BASE  0x481A0100
+#else
+#define OMAP3_MCSPI1_BASE  0x48098000
+#define OMAP3_MCSPI2_BASE  0x4809A000
+#define OMAP3_MCSPI3_BASE  0x480B8000
+#define OMAP3_MCSPI4_BASE  0x480BA000
+#endif
+
+/* per-register bitmasks */
+#define OMAP3_MCSPI_SYSCONFIG_SMARTIDLE (2 << 3)
+#define OMAP3_MCSPI_SYSCONFIG_ENAWAKEUP BIT(2)
+#define OMAP3_MCSPI_SYSCONFIG_AUTOIDLE BIT(0)
+#define OMAP3_MCSPI_SYSCONFIG_SOFTRESET BIT(1)
+
+#define OMAP3_MCSPI_SYSSTATUS_RESETDONE BIT(0)
+
+#define OMAP3_MCSPI_MODULCTRL_SINGLE   BIT(0)
+#define OMAP3_MCSPI_MODULCTRL_MS   BIT(2)
+#define OMAP3_MCSPI_MODULCTRL_STESTBIT(3)
+
+#define OMAP3_MCSPI_CHCONF_PHA BIT(0)
+#define OMAP3_MCSPI_CHCONF_POL BIT(1)
+#define OMAP3_MCSPI_CHCONF_CLKD_MASK   GENMASK(5, 2)
+#define OMAP3_MCSPI_CHCONF_EPOLBIT(6)
+#define OMAP3_MCSPI_CHCONF_WL_MASK GENMASK(11, 7)
+#define OMAP3_MCSPI_CHCONF_TRM_RX_ONLY BIT(12)
+#define OMAP3_MCSPI_CHCONF_TRM_TX_ONLY BIT(13)
+#define OMAP3_MCSPI_CHCONF_TRM_MASKGENMASK(13, 12)
+#define OMAP3_MCSPI_CHCONF_DMAWBIT(14)
+#define OMAP3_MCSPI_CHCONF_DMARBIT(15)
+#define OMAP3_MCSPI_CHCONF_DPE0BIT(16)
+#define OMAP3_MCSPI_CHCONF_DPE1BIT(17)
+#define OMAP3_MCSPI_CHCONF_IS  BIT(18)
+#define OMAP3_MCSPI_CHCONF_TURBO   BIT(19)
+#define OMAP3_MCSPI_CHCONF_FORCE   BIT(20)
+
+#define OMAP3_MCSPI_CHSTAT_RXS BIT(0)
+#define OMAP3_MCSPI_CHSTAT_TXS BIT(1)
+#define OMAP3_MCSPI_CHSTAT_EOT BIT(2)
+
+#define OMAP3_MCSPI_CHCTRL_EN  BIT(0)
+#define OMAP3_MCSPI_CHCTRL_DIS (0 << 0)
+
+#define OMAP3_MCSPI_WAKEUPENABLE_WKEN  BIT(0)
+
+#define OMAP3_MCSPI_MAX_FREQ   4800
+#define SPI_WAIT_TIMEOUT   10
+
+/* OMAP3 McSPI registers */
+struct mcspi_channel {
+   unsigned int chconf;/* 0x2C, 0x40, 0x54, 0x68 */
+   unsigned int chstat;/* 0x30, 0x44, 0x58, 0x6C */
+   unsigned int chctrl;/* 0x34, 0x48, 0x5C, 0x70 */
+   unsigned int tx;/* 0x38, 0x4C, 0x60, 0x74 */
+   unsigned int rx;/* 0x3C, 0x50, 0x64, 0x78 */
+};
+
+struct mcspi {
+   unsigned char res1[0x10];
+   unsigned int sysconfig; /* 0x10 */
+   unsigned int sysstatus; /* 0x14 */
+   unsigned int irqstatus; /* 0x18 */
+   unsigned int irqenable; /* 0x1C */
+   unsigned int wakeupenable;  /* 0x20 */
+   unsigned int syst;  /* 0x24 */
+   unsigned int modulctrl; /* 0x28 */
+   struct mcspi_channel channel[4]; /* channel0: 0x2C - 0x3C, bus 0 & 1 & 
2 & 3 */
+   /* channel1: 0x40 - 0x50, bus 0 & 1 */
+   /* channel2: 0x54 - 0x64, bus 0 & 1 */
+   /* channel3: 0x68 - 0x78, bus 0 */
+};
+
+struct omap3_spi_slave {
+   struct spi_slave slave;
+   struct mcspi *regs;
+   unsigned int freq;
+   unsigned int mode;
+};
+
+static inline struct omap3_spi_slave *to_omap3_spi(struct spi_slave *slave)
+{
+   return container_of(slave, struct omap3_spi_slave, slave);
+}
+
+int omap3_spi_txrx(struct spi_slave *slave, unsigned int len, const void *txp,
+   void *rxp, unsigned long flags);
+int omap3_spi_write(struct spi_slave *slave, unsigned int len, const void *txp,
+   unsigned long flags);
+int omap3_spi_read(struct spi_slave *slave, unsigned int len, void *rxp,
+  unsigned long flags);
 
 static void spi_reset(struct omap3_spi_slave *ds)
 {
diff --git a/drivers/spi/omap3_spi.h b/drivers/spi/omap3_spi.h
deleted file mode 100644
index 6a07c6d..000
--- a/drivers/spi/omap3_spi.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Register definitions for the OMAP3 McSPI Controller
- *
- * Copyright (C) 2010 Dirk Behme 
- *
- * Parts taken from 

Re: [U-Boot] [PATCH][v2] armv8/ls2080ardb: Enable VID support

2016-02-11 Thread york sun
On 02/08/2016 05:33 AM, Rai Harninder wrote:
> This patch enable VID support for ls2080ardb platform.
> It uses the common VID driver
> 
> Signed-off-by: Rai Harninder 
> ---
> Changes in v2
> - Use CONFIG_FSL_LSCH3 instead of CONFIG_LAYERSCAPE
>   since the latter is defined for other platforms
>   as well
> - Modify patch description
> 
>  .../include/asm/arch-fsl-layerscape/immap_lsch3.h  |4 
>  board/freescale/common/vid.c   |   15 ++-
>  board/freescale/ls2080ardb/ls2080ardb.c|5 +
>  include/configs/ls2080ardb.h   |   16 
>  4 files changed, 39 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h 
> b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h
> index 91f3ce8..4fd58ee 100644
> --- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h
> +++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h
> @@ -146,6 +146,10 @@ struct ccsr_gur {
>   u8  res_008[0x20-0x8];
>   u32 gpporcr1;   /* General-purpose POR configuration */
>   u32 gpporcr2;   /* General-purpose POR configuration 2 */
> +#define FSL_CHASSIS3_DCFG_FUSESR_VID_SHIFT   25
> +#define FSL_CHASSIS3_DCFG_FUSESR_VID_MASK0x1F
> +#define FSL_CHASSIS3_DCFG_FUSESR_ALTVID_SHIFT20
> +#define FSL_CHASSIS3_DCFG_FUSESR_ALTVID_MASK 0x1F
>   u32 dcfg_fusesr;/* Fuse status register */
>   u32 gpporcr3;
>   u32 gpporcr4;
> diff --git a/board/freescale/common/vid.c b/board/freescale/common/vid.c
> index 1bd65a8..b037643 100644
> --- a/board/freescale/common/vid.c
> +++ b/board/freescale/common/vid.c
> @@ -10,6 +10,8 @@
>  #include 
>  #ifdef CONFIG_LS1043A
>  #include 
> +#elif defined(CONFIG_FSL_LSCH3)
> +#include 
>  #else
>  #include 
>  #endif
> @@ -285,7 +287,7 @@ static int set_voltage(int i2caddress, int vdd)
>  int adjust_vdd(ulong vdd_override)
>  {
>   int re_enable = disable_interrupts();
> -#ifdef CONFIG_LS1043A
> +#if defined(CONFIG_LS1043A) || defined(CONFIG_FSL_LSCH3)
>   struct ccsr_gur *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
>  #else
>   ccsr_gur_t __iomem *gur =
> @@ -362,7 +364,11 @@ int adjust_vdd(ulong vdd_override)
>   }
>  
>   /* get the voltage ID from fuse status register */
> +#ifdef CONFIG_FSL_LSCH3
> + fusesr = in_le32(>dcfg_fusesr);
> +#else
>   fusesr = in_be32(>dcfg_fusesr);
> +#endif
>   /*
>* VID is used according to the table below
>*---
> @@ -387,6 +393,13 @@ int adjust_vdd(ulong vdd_override)
>   vid = (fusesr >> FSL_CHASSIS2_DCFG_FUSESR_VID_SHIFT) &
>   FSL_CHASSIS2_DCFG_FUSESR_VID_MASK;
>   }
> +#elif defined(CONFIG_FSL_LSCH3)
> + vid = (fusesr >> FSL_CHASSIS3_DCFG_FUSESR_ALTVID_SHIFT) &
> + FSL_CHASSIS3_DCFG_FUSESR_ALTVID_MASK;
> + if ((vid == 0) || (vid == FSL_CHASSIS3_DCFG_FUSESR_ALTVID_MASK)) {
> + vid = (fusesr >> FSL_CHASSIS3_DCFG_FUSESR_VID_SHIFT) &
> + FSL_CHASSIS3_DCFG_FUSESR_VID_MASK;
> + }
>  #else
>   vid = (fusesr >> FSL_CORENET_DCFG_FUSESR_ALTVID_SHIFT) &
>   FSL_CORENET_DCFG_FUSESR_ALTVID_MASK;
> diff --git a/board/freescale/ls2080ardb/ls2080ardb.c 
> b/board/freescale/ls2080ardb/ls2080ardb.c
> index c63b639..9515b25 100644
> --- a/board/freescale/ls2080ardb/ls2080ardb.c
> +++ b/board/freescale/ls2080ardb/ls2080ardb.c
> @@ -122,6 +122,11 @@ int select_i2c_ch_pca9547(u8 ch)
>   return 0;
>  }
>  
> +int i2c_multiplexer_select_vid_channel(u8 channel)
> +{
> + return select_i2c_ch_pca9547(channel);
> +}
> +
>  int config_board_mux(int ctrl_type)
>  {
>   u8 reg5;
> diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h
> index 116dbcd..9a95f31 100644
> --- a/include/configs/ls2080ardb.h
> +++ b/include/configs/ls2080ardb.h
> @@ -14,6 +14,22 @@
>  
>  #define CONFIG_DISPLAY_BOARDINFO
>  
> +#define I2C_MUX_CH_VOL_MONITOR   0xa
> +#define I2C_VOL_MONITOR_ADDR 0x38
> +#define CONFIG_VOL_MONITOR_IR36021_READ
> +#define CONFIG_VOL_MONITOR_IR36021_SET
> +
> +#define CONFIG_VID_FLS_ENV   "ls2080ardb_vdd_mv"
> +#ifndef CONFIG_SPL_BUILD
> +#define CONFIG_VID
> +#endif
> +/* step the IR regulator in 5mV increments */
> +#define IR_VDD_STEP_DOWN 5
> +#define IR_VDD_STEP_UP   5
> +/* The lowest and highest voltage allowed for LS2080ARDB */
> +#define VDD_MV_MIN   819
> +#define VDD_MV_MAX   1212
> +
>  #ifndef __ASSEMBLY__
>  unsigned long get_board_sys_clk(void);
>  #endif
> 

Rai,

Did you test this patch to confirm the voltage change? I don't see you calling
adjust_vdd().

York

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


Re: [U-Boot] [PATCH] arm: socfpga: Enable ethernet PHY configuration to RGMII again

2016-02-11 Thread Simon Glass
Hi,

On 11 February 2016 at 08:54, Stefan Roese  wrote:
> On 11.02.2016 16:49, Marek Vasut wrote:
>>
>> On 02/11/2016 04:45 PM, Stefan Roese wrote:
>>>
>>> With commit c32a6fd0 [net: Don't call board/cpu_eth_init() with driver
>>> model], cpu_eth_init() is not called on SoCFPGA any more. Since this
>>> function configures the internal PHY interface to RGMII (via the physel_X
>>> bits), its still needed. So lets rename this function and call it in
>>> arch_early_init_r().
>>>
>>> Tested on socfpga_sr1500.
>>>
>>> Signed-off-by: Stefan Roese 
>>> Cc: Simon Glass 
>>> Cc: Dinh Nguyen 
>>> Cc: Marek Vasut 
>>> ---
>>>   arch/arm/mach-socfpga/misc.c | 6 +-
>>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
>>> index 9b43b92..2b1cd4a 100644
>>> --- a/arch/arm/mach-socfpga/misc.c
>>> +++ b/arch/arm/mach-socfpga/misc.c
>>> @@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int
>>> of_reset_id)
>>> socfpga_per_reset(reset, 0);
>>>   }
>>
>>
>> I just sent and applied very similar patch, can you try
>> u-boot-socfpga/master and see if it works for you?
>
>
> Done and works just fine. So please feel free to upstream your patch
> version.

Can this be done in the driver? You have a device tree representation
I think. If you are using the compat list in fdtdec.c then it suggests
that you need a driver.

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


[U-Boot] [PATCH 1/2] dm: core: Add uclass_first_device_err() to return a valid device

2016-02-11 Thread Simon Glass
A common pattern is to call uclass_first_device() and then check if it
actually returns a device. Add a new function which does this, returning
an error if there are no devices in that uclass.

Signed-off-by: Simon Glass 
---

 drivers/core/uclass.c | 13 +
 include/dm/uclass.h   | 15 +--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index 12095e7..1141ce1 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -401,6 +401,19 @@ int uclass_first_device(enum uclass_id id, struct udevice 
**devp)
return uclass_get_device_tail(dev, ret, devp);
 }
 
+int uclass_first_device_err(enum uclass_id id, struct udevice **devp)
+{
+   int ret;
+
+   ret = uclass_first_device(id, devp);
+   if (ret)
+   return ret;
+   else if (!*devp)
+   return -ENODEV;
+
+   return 0;
+}
+
 int uclass_next_device(struct udevice **devp)
 {
struct udevice *dev = *devp;
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index bfbd27a..fd368b6 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -200,18 +200,29 @@ int uclass_get_device_by_phandle(enum uclass_id id, 
struct udevice *parent,
  *
  * @id: Uclass ID to look up
  * @devp: Returns pointer to the first device in that uclass, or NULL if none
- * @return 0 if OK (found or not found), -1 on error
+ * @return 0 if OK (found or not found), other -ve on error
  */
 int uclass_first_device(enum uclass_id id, struct udevice **devp);
 
 /**
+ * uclass_first_device_err() - Get the first device in a uclass
+ *
+ * The device returned is probed if necessary, and ready for use
+ *
+ * @id: Uclass ID to look up
+ * @devp: Returns pointer to the first device in that uclass, or NULL if none
+ * @return 0 if found, -ENODEV if not found, other -ve on error
+ */
+int uclass_first_device_err(enum uclass_id id, struct udevice **devp);
+
+/**
  * uclass_next_device() - Get the next device in a uclass
  *
  * The device returned is probed if necessary, and ready for use
  *
  * @devp: On entry, pointer to device to lookup. On exit, returns pointer
  * to the next device in the same uclass, or NULL if none
- * @return 0 if OK (found or not found), -1 on error
+ * @return 0 if OK (found or not found), other -ve on error
  */
 int uclass_next_device(struct udevice **devp);
 
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] trouble with patman

2016-02-11 Thread Hannes Schmelzer

hi,

i created some commit which i want to post into the mailing list usind 
patman.py.


I get following error, where i've no idea about the root cause ...

~/work/u-boot $ tools/patman/patman.py -n
Cleaned 1 patches
Traceback (most recent call last):
  File "tools/patman/patman.py", line 158, in 
options.add_maintainers)
  File "/home/schmelzerh/work/u-boot/tools/patman/series.py", line 222, 
in MakeCcFile

raise_on_error=raise_on_error)
  File "/home/schmelzerh/work/u-boot/tools/patman/gitutil.py", line 
321, in BuildEmailList

raw += LookupEmail(item, alias, raise_on_error=raise_on_error)
  File "/home/schmelzerh/work/u-boot/tools/patman/gitutil.py", line 
495, in LookupEmail

raise ValueError, msg
ValueError: Alias 'gpio' not found


any suggestions ?

many thanks and best regards,
Hannes

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


Re: [U-Boot] Problem with mounting a jffs2 partition on flash.

2016-02-11 Thread Bakhvalov, Denis (Nokia - PL/Wroclaw)
Hi Marek,

> Please just use mainline everything. If you use Arria V SoCDK, you can
> just grab 2016.01 , compile it and write u-boot-with-spl-dtb.sfp to
> offset 0x0 of the QSPI and it should just magically work.

I haven't found the file with the name u-boot-with-spl-dtb.sfp.

denis@DendiMachine:~/WorkSpace/u-boot$ ls -l
total 8544
drwxrwxr-x   2 denis denis4096 lut 10 22:46 api
drwxrwxr-x  17 denis denis4096 lut 10 22:46 arch
drwxrwxr-x 201 denis denis4096 lut 10 22:46 board
drwxrwxr-x   2 denis denis4096 sty 11 23:15 build
drwxrwxr-x   2 denis denis   12288 lut 11 10:50 cmd
drwxrwxr-x   4 denis denis   20480 lut 11 10:50 common
-rw-rw-r--   1 denis denis2260 sty 11 22:32 config.mk
drwxrwxr-x   2 denis denis   61440 lut 10 22:46 configs
drwxrwxr-x   2 denis denis4096 lut 11 10:45 disk
drwxrwxr-x   8 denis denis4096 lut 10 22:46 doc
drwxrwxr-x  46 denis denis4096 lut 11 10:45 drivers
drwxrwxr-x   2 denis denis4096 lut 11 10:46 dts
drwxrwxr-x   4 denis denis4096 sty 11 22:32 examples
drwxrwxr-x  12 denis denis4096 lut 11 10:45 fs
drwxrwxr-x  28 denis denis   12288 lut 11 10:45 include
-rw-rw-r--   1 denis denis1863 sty 11 22:32 Kbuild
-rw-rw-r--   1 denis denis7669 lut 10 22:46 Kconfig
drwxrwxr-x  11 denis denis4096 lut 11 10:50 lib
drwxrwxr-x   2 denis denis4096 lut 10 22:46 Licenses
-rw-rw-r--   1 denis denis   10765 lut 10 22:46 MAINTAINERS
-rwxrwxr-x   1 denis denis   23247 sty 11 22:32 MAKEALL
-rw-rw-r--   1 denis denis   53021 lut 10 22:46 Makefile
drwxrwxr-x   2 denis denis4096 lut 11 10:46 net
drwxrwxr-x   6 denis denis4096 sty 11 22:32 post
-rw-rw-r--   1 denis denis  235198 lut 10 22:46 README
drwxrwxr-x   4 denis denis4096 lut 10 22:46 scripts
-rw-rw-r--   1 denis denis  17 sty 11 22:32 snapshot.commit
drwxrwxr-x  11 denis denis4096 lut 11 10:50 spl
-rw-rw-r--   1 denis denis   75047 lut 11 10:46 System.map
drwxrwxr-x  10 denis denis4096 lut 11 10:46 test
drwxrwxr-x  15 denis denis4096 lut 11 10:50 tools
-rwxrwxr-x   1 denis denis 3492298 lut 11 10:50 u-boot
-rw-rw-r--   1 denis denis  431333 lut 11 10:50 u-boot.bin
-rw-rw-r--   1 denis denis   26288 lut 11 10:46 u-boot.cfg
-rw-rw-r--   1 denis denis   16301 lut 11 10:46 u-boot.dtb
-rw-rw-r--   1 denis denis  431333 lut 11 10:50 u-boot-dtb.bin
-rw-rw-r--   1 denis denis  431397 lut 11 10:46 u-boot-dtb.img
-rw-rw-r--   1 denis denis  431397 lut 11 10:50 u-boot.img
-rw-rw-r--   1 denis denis1286 lut 11 10:46 u-boot.lds
-rw-rw-r--   1 denis denis  561107 lut 11 10:50 u-boot.map
-rw-rw-r--   1 denis denis  415032 lut 11 10:50 u-boot-nodtb.bin
-rw-rw-r--   1 denis denis 1245202 lut 11 10:46 u-boot.srec
-rw-rw-r--   1 denis denis  693541 lut 11 10:50 u-boot-with-spl.sfp

denis@DendiMachine:~/WorkSpace/u-boot$ ls ./spl/ -l
total 1292
drwxrwxr-x 3 denis denis   4096 lut 11 10:46 arch
drwxrwxr-x 3 denis denis   4096 lut 11 10:46 board
drwxrwxr-x 2 denis denis   4096 lut 11 10:46 cmd
drwxrwxr-x 4 denis denis   4096 lut 11 10:46 common
drwxrwxr-x 9 denis denis   4096 lut 11 10:46 drivers
drwxrwxr-x 2 denis denis   4096 lut 11 10:46 dts
drwxrwxr-x 2 denis denis   4096 lut 11 10:46 fs
drwxrwxr-x 2 denis denis   4096 lut 11 10:45 include
drwxrwxr-x 3 denis denis   4096 lut 11 10:50 lib
-rwxrwxr-x 1 denis denis 932073 lut 11 10:50 u-boot-spl
-rw-rw-r-- 1 denis denis  53943 lut 11 10:50 u-boot-spl.bin
-rw-rw-r-- 1 denis denis  26129 lut 11 10:46 u-boot-spl.cfg
-rw-rw-r-- 1 denis denis903 lut 11 10:46 u-boot-spl.dtb
-rw-rw-r-- 1 denis denis  53943 lut 11 10:50 u-boot-spl-dtb.bin
-rw-rw-r-- 1 denis denis   1192 lut 11 10:46 u-boot-spl.lds
-rw-rw-r-- 1 denis denis 137422 lut 11 10:50 u-boot-spl.map
-rwxrwxr-x 1 denis denis  52880 lut 11 10:50 u-boot-spl-nodtb.bin
-rw-rw-r-- 1 denis denis160 lut 11 10:50 u-boot-spl-pad.bin
-rw-rw-r-- 1 denis denis  65536 lut 11 10:50 u-boot-spl.sfp

There is only target "u-boot-with-spl.sfp".
I'm a little bit confused which file is the proper one.
Can I use u-boot-with-spl.sfp from the root folder?

>>> I was more interested in the procedure you used. I usually install mainline
>>> U-Boot onto a board which boots from QSPI this way:
>> 
>>> $ quartus_hps -c 1 -o PV -a 0x0 u-boot-with-spl-dtb.sfp
>> 
>> Yes, exactly. But we have separated SPL and U-Boot images and put them 
>> separately (with two commands).

> Please don't :-)

Ok. Can you please briefly explain why?

Best regards,
Denis Bakhvalov
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Problem with mounting a jffs2 partition on flash.

2016-02-11 Thread Marek Vasut
On 02/11/2016 11:01 AM, Bakhvalov, Denis (Nokia - PL/Wroclaw) wrote:
> Hi Marek,

Hi Denis,

>> Please just use mainline everything. If you use Arria V SoCDK, you can
>> just grab 2016.01 , compile it and write u-boot-with-spl-dtb.sfp to
>> offset 0x0 of the QSPI and it should just magically work.
> 
> I haven't found the file with the name u-boot-with-spl-dtb.sfp.

How did you compile the U-Boot ? Make sure to clean up your sources
before the build. Try this method:

$ make socfpga_arria5_defconfig
$ make -j9

This will produce the file, I just tested it.

You can try make u-boot-with-spl-dtb.sfp in case you're desperate.

> denis@DendiMachine:~/WorkSpace/u-boot$ ls -l
> total 8544
> drwxrwxr-x   2 denis denis4096 lut 10 22:46 api
> drwxrwxr-x  17 denis denis4096 lut 10 22:46 arch
> drwxrwxr-x 201 denis denis4096 lut 10 22:46 board
> drwxrwxr-x   2 denis denis4096 sty 11 23:15 build
> drwxrwxr-x   2 denis denis   12288 lut 11 10:50 cmd
> drwxrwxr-x   4 denis denis   20480 lut 11 10:50 common
> -rw-rw-r--   1 denis denis2260 sty 11 22:32 config.mk
> drwxrwxr-x   2 denis denis   61440 lut 10 22:46 configs
> drwxrwxr-x   2 denis denis4096 lut 11 10:45 disk
> drwxrwxr-x   8 denis denis4096 lut 10 22:46 doc
> drwxrwxr-x  46 denis denis4096 lut 11 10:45 drivers
> drwxrwxr-x   2 denis denis4096 lut 11 10:46 dts
> drwxrwxr-x   4 denis denis4096 sty 11 22:32 examples
> drwxrwxr-x  12 denis denis4096 lut 11 10:45 fs
> drwxrwxr-x  28 denis denis   12288 lut 11 10:45 include
> -rw-rw-r--   1 denis denis1863 sty 11 22:32 Kbuild
> -rw-rw-r--   1 denis denis7669 lut 10 22:46 Kconfig
> drwxrwxr-x  11 denis denis4096 lut 11 10:50 lib
> drwxrwxr-x   2 denis denis4096 lut 10 22:46 Licenses
> -rw-rw-r--   1 denis denis   10765 lut 10 22:46 MAINTAINERS
> -rwxrwxr-x   1 denis denis   23247 sty 11 22:32 MAKEALL
> -rw-rw-r--   1 denis denis   53021 lut 10 22:46 Makefile
> drwxrwxr-x   2 denis denis4096 lut 11 10:46 net
> drwxrwxr-x   6 denis denis4096 sty 11 22:32 post
> -rw-rw-r--   1 denis denis  235198 lut 10 22:46 README
> drwxrwxr-x   4 denis denis4096 lut 10 22:46 scripts
> -rw-rw-r--   1 denis denis  17 sty 11 22:32 snapshot.commit
> drwxrwxr-x  11 denis denis4096 lut 11 10:50 spl
> -rw-rw-r--   1 denis denis   75047 lut 11 10:46 System.map
> drwxrwxr-x  10 denis denis4096 lut 11 10:46 test
> drwxrwxr-x  15 denis denis4096 lut 11 10:50 tools
> -rwxrwxr-x   1 denis denis 3492298 lut 11 10:50 u-boot
> -rw-rw-r--   1 denis denis  431333 lut 11 10:50 u-boot.bin
> -rw-rw-r--   1 denis denis   26288 lut 11 10:46 u-boot.cfg
> -rw-rw-r--   1 denis denis   16301 lut 11 10:46 u-boot.dtb
> -rw-rw-r--   1 denis denis  431333 lut 11 10:50 u-boot-dtb.bin
> -rw-rw-r--   1 denis denis  431397 lut 11 10:46 u-boot-dtb.img
> -rw-rw-r--   1 denis denis  431397 lut 11 10:50 u-boot.img
> -rw-rw-r--   1 denis denis1286 lut 11 10:46 u-boot.lds
> -rw-rw-r--   1 denis denis  561107 lut 11 10:50 u-boot.map
> -rw-rw-r--   1 denis denis  415032 lut 11 10:50 u-boot-nodtb.bin
> -rw-rw-r--   1 denis denis 1245202 lut 11 10:46 u-boot.srec
> -rw-rw-r--   1 denis denis  693541 lut 11 10:50 u-boot-with-spl.sfp
> 
> denis@DendiMachine:~/WorkSpace/u-boot$ ls ./spl/ -l
> total 1292
> drwxrwxr-x 3 denis denis   4096 lut 11 10:46 arch
> drwxrwxr-x 3 denis denis   4096 lut 11 10:46 board
> drwxrwxr-x 2 denis denis   4096 lut 11 10:46 cmd
> drwxrwxr-x 4 denis denis   4096 lut 11 10:46 common
> drwxrwxr-x 9 denis denis   4096 lut 11 10:46 drivers
> drwxrwxr-x 2 denis denis   4096 lut 11 10:46 dts
> drwxrwxr-x 2 denis denis   4096 lut 11 10:46 fs
> drwxrwxr-x 2 denis denis   4096 lut 11 10:45 include
> drwxrwxr-x 3 denis denis   4096 lut 11 10:50 lib
> -rwxrwxr-x 1 denis denis 932073 lut 11 10:50 u-boot-spl
> -rw-rw-r-- 1 denis denis  53943 lut 11 10:50 u-boot-spl.bin
> -rw-rw-r-- 1 denis denis  26129 lut 11 10:46 u-boot-spl.cfg
> -rw-rw-r-- 1 denis denis903 lut 11 10:46 u-boot-spl.dtb
> -rw-rw-r-- 1 denis denis  53943 lut 11 10:50 u-boot-spl-dtb.bin
> -rw-rw-r-- 1 denis denis   1192 lut 11 10:46 u-boot-spl.lds
> -rw-rw-r-- 1 denis denis 137422 lut 11 10:50 u-boot-spl.map
> -rwxrwxr-x 1 denis denis  52880 lut 11 10:50 u-boot-spl-nodtb.bin
> -rw-rw-r-- 1 denis denis160 lut 11 10:50 u-boot-spl-pad.bin
> -rw-rw-r-- 1 denis denis  65536 lut 11 10:50 u-boot-spl.sfp
> 
> There is only target "u-boot-with-spl.sfp".
> I'm a little bit confused which file is the proper one.
> Can I use u-boot-with-spl.sfp from the root folder?

You cannot, since it doesn't contain the DT blob, which describes the
arria5 socdk hardware. The board won't boot without it.

 I was more interested in the procedure you used. I usually install mainline
 U-Boot onto a board which boots from QSPI this way:
>>>
 $ quartus_hps -c 1 -o PV -a 0x0 u-boot-with-spl-dtb.sfp
>>>
>>> Yes, exactly. But we have separated SPL and U-Boot images and put them 
>>> separately (with two commands).
> 
>> 

Re: [U-Boot] Problem with mounting a jffs2 partition on flash.

2016-02-11 Thread Bakhvalov, Denis (Nokia - PL/Wroclaw)
Hi Marek,

Here are my build steps:

denis@DendiMachine:~/WorkSpace/u-boot$ make clean
  CLEAN   dts/../arch/arm/dts
  CLEAN   dts
  CLEAN   examples/standalone
  CLEAN   tools
  CLEAN   tools/lib tools/common
  CLEAN   spl/arch spl/board spl/cmd spl/common spl/drivers spl/dts spl/fs 
spl/lib spl/u-boot-spl spl/u-boot-spl.bin spl/u-boot-spl.cfg spl/u-boot-spl.dtb 
spl/u-boot-spl-dtb.bin spl/u-boot-spl.lds spl/u-boot-spl.map 
spl/u-boot-spl-nodtb.bin spl/u-boot-spl-pad.bin spl/u-boot-spl.sfp
  CLEAN   u-boot u-boot.bin u-boot.cfg u-boot.dtb u-boot-dtb.bin u-boot-dtb.img 
u-boot.img u-boot.lds u-boot.map u-boot-nodtb.bin u-boot.srec System.map
denis@DendiMachine:~/WorkSpace/u-boot$ make distclean
  CLEAN   scripts/basic
  CLEAN   scripts/kconfig
  CLEAN   include/config include/generated spl
  CLEAN   .config .config.old include/autoconf.mk include/autoconf.mk.dep 
include/config.h
denis@DendiMachine:~/WorkSpace/u-boot$ make clean
denis@DendiMachine:~/WorkSpace/u-boot$ make distclean
denis@DendiMachine:~/WorkSpace/u-boot$ git pull
Already up-to-date.
denis@DendiMachine:~/WorkSpace/u-boot$ git describe
v2016.03-rc1-138-gcc8d698
denis@DendiMachine:~/WorkSpace/u-boot$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git checkout -- ..." to discard changes in working directory)

modified:   include/configs/socfpga_arria5_socdk.h// here I only 
changed SDRAM configuration

no changes added to commit (use "git add" and/or "git commit -a")
denis@DendiMachine:~/WorkSpace/u-boot$ make socfpga_arria5_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
denis@DendiMachine:~/WorkSpace/u-boot$ make -j9

But after compilation I don't have such file.

I have installed:
- linaro toolchain
- u-boot-tools
- device-tree-compiler

All env variables should be ok, because in other way it won't compile.

make u-boot-with-spl-dtb.sfp doesn't work for me because there is no such 
target in Makefile.
What I'm doing wrong?
I will try to clone sources and build it from the scratch.

Best regards,
Denis Bakhvalov
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Problem with mounting a jffs2 partition on flash.

2016-02-11 Thread Marek Vasut
On 02/11/2016 01:45 PM, Bakhvalov, Denis (Nokia - PL/Wroclaw) wrote:
> Hi Marek,
> 
> Here are my build steps:
> 
> denis@DendiMachine:~/WorkSpace/u-boot$ make clean
>   CLEAN   dts/../arch/arm/dts
>   CLEAN   dts
>   CLEAN   examples/standalone
>   CLEAN   tools
>   CLEAN   tools/lib tools/common
>   CLEAN   spl/arch spl/board spl/cmd spl/common spl/drivers spl/dts spl/fs 
> spl/lib spl/u-boot-spl spl/u-boot-spl.bin spl/u-boot-spl.cfg 
> spl/u-boot-spl.dtb spl/u-boot-spl-dtb.bin spl/u-boot-spl.lds 
> spl/u-boot-spl.map spl/u-boot-spl-nodtb.bin spl/u-boot-spl-pad.bin 
> spl/u-boot-spl.sfp
>   CLEAN   u-boot u-boot.bin u-boot.cfg u-boot.dtb u-boot-dtb.bin 
> u-boot-dtb.img u-boot.img u-boot.lds u-boot.map u-boot-nodtb.bin u-boot.srec 
> System.map
> denis@DendiMachine:~/WorkSpace/u-boot$ make distclean
>   CLEAN   scripts/basic
>   CLEAN   scripts/kconfig
>   CLEAN   include/config include/generated spl
>   CLEAN   .config .config.old include/autoconf.mk include/autoconf.mk.dep 
> include/config.h
> denis@DendiMachine:~/WorkSpace/u-boot$ make clean
> denis@DendiMachine:~/WorkSpace/u-boot$ make distclean
> denis@DendiMachine:~/WorkSpace/u-boot$ git pull
> Already up-to-date.
> denis@DendiMachine:~/WorkSpace/u-boot$ git describe
> v2016.03-rc1-138-gcc8d698

I see , so you're not building 2016.01 , but 2016.03-rc .

> denis@DendiMachine:~/WorkSpace/u-boot$ git status
> On branch master
> Your branch is up-to-date with 'origin/master'.
> 
> Changes not staged for commit:
>   (use "git add ..." to update what will be committed)
>   (use "git checkout -- ..." to discard changes in working directory)
> 
>   modified:   include/configs/socfpga_arria5_socdk.h// here I only 
> changed SDRAM configuration
> 
> no changes added to commit (use "git add" and/or "git commit -a")
> denis@DendiMachine:~/WorkSpace/u-boot$ make socfpga_arria5_defconfig
>   HOSTCC  scripts/basic/fixdep
>   HOSTCC  scripts/kconfig/conf.o
>   SHIPPED scripts/kconfig/zconf.tab.c
>   SHIPPED scripts/kconfig/zconf.lex.c
>   SHIPPED scripts/kconfig/zconf.hash.c
>   HOSTCC  scripts/kconfig/zconf.tab.o
>   HOSTLD  scripts/kconfig/conf
> #
> # configuration written to .config
> #
> denis@DendiMachine:~/WorkSpace/u-boot$ make -j9
> 
> But after compilation I don't have such file.
> 
> I have installed:
> - linaro toolchain
> - u-boot-tools
> - device-tree-compiler

OK, there has been a patch applied after 2016.01 which renames the
artifacts. I expected it to cause confusion, but I didn't expect it
to happen so soon. And the patch is even broken, sigh.

Do this after make -j9 as a workaround for the breakage:

$ make u-boot-with-spl.sfp

And then use the "u-boot-with-spl.sfp" file and place it into the QSPI
NOR. I will send a fix for the broken patch.

> All env variables should be ok, because in other way it won't compile.
> 
> make u-boot-with-spl-dtb.sfp doesn't work for me because there is no such 
> target in Makefile.
> What I'm doing wrong?
> I will try to clone sources and build it from the scratch.
> 
> Best regards,
> Denis Bakhvalov
> 

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


[U-Boot] GSoC projects for Minnowboard MAX

2016-02-11 Thread Simon Glass
Hi,

Minnowboard is looking for GSoC projects this year.

http://wiki.minnowboard.org/GSoC2016

There are a few things listed in README.x86 to be done. Any ideas?

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


[U-Boot] [PATCH] arm: socfpga: Add missing CONFIG_BUILD_TARGET

2016-02-11 Thread Marek Vasut
Add the missing CONFIG_BUILD_TARGET to get u-boot-with-spl.sfp built
automatically upon running make in the source tree.

Signed-off-by: Marek Vasut 
Cc: Dinh Nguyen 
Cc: Chin Liang See 
Cc: Denis Bakhvalov 
---
 include/configs/socfpga_common.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 8de0ab9..0501bd1 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -30,6 +30,9 @@
 
 #define CONFIG_TIMESTAMP   /* Print image info with timestamp */
 
+/* add target to build it automatically upon "make" */
+#define CONFIG_BUILD_TARGET"u-boot-with-spl.sfp"
+
 /*
  * Memory configurations
  */
-- 
2.1.4

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


Re: [U-Boot] [PATCH v2] imx: imx7 Support for Manufacturing Protection

2016-02-11 Thread Otavio Salvador
On Wed, Feb 10, 2016 at 9:54 AM, Ulises Cardenas  wrote:
> i.MX7 has an a protection feature for Manufacturing process.
> This feature uses assymetric encryption to sign and verify
> authenticated software handled between parties. This command
> is enables the use of such feature.

s/is enables/enables/

> The private key is unique and generated once per device.
> And it is stored in secure memory and only accessible by CAAM.
> Therefore, the public key generation and signature functions
> are the only functions available for the user.
>
> Command usage:
> mfgprot 0 - prints out the public key for the device.
> mfgprot 1 - signs and prints out a sample data.
>
> This is only a working example for the signature function, and
> is intended to be used as a canvas for user-specific cases.
>
> Signed-off-by: Ulises Cardenas 

Why this is just an example? Couldn't we better integrate so user
could pass addresses for checking?

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arm: at91: Add support for DENX MA5D4 SoM and EVK

2016-02-11 Thread Marek Vasut
Add support for DENX MA5D4 SoM and MA5D4EVK board, based on the
Atmel SAMA5D4 SoC. The SoM contains the SoC, eMMC, SPI NOR, SPI
CAN controllers and DRAM, the baseboard contains UART connectors,
ethernet port, microSD slot, LCD header, 2x CAN connector and a
lot of expansion headers.

Signed-off-by: Marek Vasut 
Cc: Andreas Bießmann 
Reviewed-by: Heiko Schocher 
---
V2: Remove the BDI commands, that was just a development remnant
---
 arch/arm/mach-at91/Kconfig  |   6 +
 board/denx/ma5d4evk/Kconfig |  12 ++
 board/denx/ma5d4evk/MAINTAINERS |   6 +
 board/denx/ma5d4evk/Makefile|   7 +
 board/denx/ma5d4evk/ma5d4evk.c  | 412 
 configs/ma5d4evk_defconfig  |  11 ++
 include/configs/ma5d4evk.h  | 255 +
 7 files changed, 709 insertions(+)
 create mode 100644 board/denx/ma5d4evk/Kconfig
 create mode 100644 board/denx/ma5d4evk/MAINTAINERS
 create mode 100644 board/denx/ma5d4evk/Makefile
 create mode 100644 board/denx/ma5d4evk/ma5d4evk.c
 create mode 100644 configs/ma5d4evk_defconfig
 create mode 100644 include/configs/ma5d4evk.h

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 9426302b..88ccf23 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -96,6 +96,11 @@ config TARGET_SAMA5D4EK
select CPU_V7
select SUPPORT_SPL
 
+config TARGET_MA5D4EVK
+   bool "DENX MA5D4EVK Evaluation Kit"
+   select CPU_V7
+   select SUPPORT_SPL
+
 config TARGET_MEESC
bool "Support meesc"
select CPU_ARM926EJS
@@ -135,6 +140,7 @@ source "board/atmel/sama5d4_xplained/Kconfig"
 source "board/atmel/sama5d4ek/Kconfig"
 source "board/bluewater/snapper9260/Kconfig"
 source "board/calao/usb_a9263/Kconfig"
+source "board/denx/ma5d4evk/Kconfig"
 source "board/egnite/ethernut5/Kconfig"
 source "board/esd/meesc/Kconfig"
 source "board/mini-box/picosam9g45/Kconfig"
diff --git a/board/denx/ma5d4evk/Kconfig b/board/denx/ma5d4evk/Kconfig
new file mode 100644
index 000..b4ef106
--- /dev/null
+++ b/board/denx/ma5d4evk/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_MA5D4EVK
+
+config SYS_BOARD
+   default "ma5d4evk"
+
+config SYS_VENDOR
+   default "denx"
+
+config SYS_CONFIG_NAME
+   default "ma5d4evk"
+
+endif
diff --git a/board/denx/ma5d4evk/MAINTAINERS b/board/denx/ma5d4evk/MAINTAINERS
new file mode 100644
index 000..bb25a9c
--- /dev/null
+++ b/board/denx/ma5d4evk/MAINTAINERS
@@ -0,0 +1,6 @@
+DENX MA5D4EVK BOARD
+M: Marek Vasut 
+S: Maintained
+F: board/denx/ma5d4evk/
+F: include/configs/ma5d4evk.h
+F: configs/ma5d4evk_defconfig
diff --git a/board/denx/ma5d4evk/Makefile b/board/denx/ma5d4evk/Makefile
new file mode 100644
index 000..b12b5dc
--- /dev/null
+++ b/board/denx/ma5d4evk/Makefile
@@ -0,0 +1,7 @@
+#
+# Copyright (C) 2015 Marek Vasut 
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y += ma5d4evk.o
diff --git a/board/denx/ma5d4evk/ma5d4evk.c b/board/denx/ma5d4evk/ma5d4evk.c
new file mode 100644
index 000..ec0fa28
--- /dev/null
+++ b/board/denx/ma5d4evk/ma5d4evk.c
@@ -0,0 +1,412 @@
+/*
+ * Copyright (C) 2015 Marek Vasut 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifdef CONFIG_ATMEL_SPI
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+   return bus == 0 && cs == 0;
+}
+
+void spi_cs_activate(struct spi_slave *slave)
+{
+   at91_set_pio_output(AT91_PIO_PORTC, 3, 0);
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+   at91_set_pio_output(AT91_PIO_PORTC, 3, 1);
+}
+
+static void ma5d4evk_spi0_hw_init(void)
+{
+   at91_set_a_periph(AT91_PIO_PORTC, 0, 0);/* SPI0_MISO */
+   at91_set_a_periph(AT91_PIO_PORTC, 1, 0);/* SPI0_MOSI */
+   at91_set_a_periph(AT91_PIO_PORTC, 2, 0);/* SPI0_SPCK */
+
+   at91_set_pio_output(AT91_PIO_PORTC, 3, 1);  /* SPI0_CS0 */
+
+   /* Enable clock */
+   at91_periph_clk_enable(ATMEL_ID_SPI0);
+}
+#endif /* CONFIG_ATMEL_SPI */
+
+#ifdef CONFIG_CMD_USB
+static void ma5d4evk_usb_hw_init(void)
+{
+   at91_set_pio_output(AT91_PIO_PORTE, 11, 0);
+   at91_set_pio_output(AT91_PIO_PORTE, 14, 0);
+}
+#endif
+
+#ifdef CONFIG_LCD
+vidinfo_t panel_info = {
+   .vl_col = 800,
+   .vl_row = 480,
+   .vl_clk = 3350,
+   .vl_bpix= LCD_BPP,
+   .vl_tft = 1,
+   .vl_hsync_len   = 10,
+   .vl_left_margin = 89,
+   .vl_right_margin= 164,
+   .vl_vsync_len   = 10,
+   .vl_upper_margin= 23,
+   .vl_lower_margin= 10,

Re: [U-Boot] Problem with mounting a jffs2 partition on flash.

2016-02-11 Thread Bakhvalov, Denis (Nokia - PL/Wroclaw)
$ quartus_hps -c 1 -o PV -a 0x0 u-boot-with-spl.sfp.bin
// here ".bin" because current programmer requires so. I think it shouldn't be 
a problem.

>From manual:
"HPS Flash Programmer
The utility accepts a Binary File with a required ".bin" extension.
The HPS flash programmer command-line syntax is:
quartus_hps  "

Info: Version 13.1.0 Build 162 10/23/2013 SJ Full Version

After that I power off/on the unit and nothing happened.
I also compared md5 while copying - everything should be ok.

I tried it 2 times with no success:
Looks like unit is no booting.
No output in the console is visible.

If I change the images back (that is currently in official release) - at least 
bootloader pass and u-boot is also launching.

Does it mean that there is something wrong with SPL configuration?
Or maybe I need some patches from altera in order to make them working?
Because I can see some traces of applied patches in the svn history.

Best regards,
Denis Bakhvalov
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: socfpga: Add missing CONFIG_BUILD_TARGET

2016-02-11 Thread Bakhvalov, Denis (Nokia - PL/Wroclaw)
$ quartus_hps -c 1 -o PV -a 0x0 u-boot-with-spl.sfp.bin
// here ".bin" because current programmer requires so. I think it shouldn't be 
a problem.

>From manual:
"HPS Flash Programmer
The utility accepts a Binary File with a required ".bin" extension.
The HPS flash programmer command-line syntax is:
quartus_hps  "

Info: Version 13.1.0 Build 162 10/23/2013 SJ Full Version

After that I power off/on the unit and nothing happened.
I also compared md5 while copying - everything should be ok.

I tried it 2 times with no success:
Looks like unit is no booting.
No output in the console is visible.

If I change the images back (that is currently in official release) - at least 
bootloader pass and u-boot is also launching.

Does it mean that there is something wrong with SPL configuration?
Or maybe I need some patches from altera in order to make them working?
Because I can see some traces of applied patches in the svn history.

Best regards,
Denis Bakhvalov

MBB Radio Platforms, RFSW

-Original Message-
From: EXT Marek Vasut [mailto:ma...@denx.de] 
Sent: Thursday, February 11, 2016 14:02
To: u-boot@lists.denx.de
Cc: Marek Vasut ; Dinh Nguyen ; 
Chin Liang See ; Bakhvalov, Denis (Nokia - PL/Wroclaw) 

Subject: [PATCH] arm: socfpga: Add missing CONFIG_BUILD_TARGET

Add the missing CONFIG_BUILD_TARGET to get u-boot-with-spl.sfp built
automatically upon running make in the source tree.

Signed-off-by: Marek Vasut 
Cc: Dinh Nguyen 
Cc: Chin Liang See 
Cc: Denis Bakhvalov 
---
 include/configs/socfpga_common.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 8de0ab9..0501bd1 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -30,6 +30,9 @@
 
 #define CONFIG_TIMESTAMP   /* Print image info with timestamp */
 
+/* add target to build it automatically upon "make" */
+#define CONFIG_BUILD_TARGET"u-boot-with-spl.sfp"
+
 /*
  * Memory configurations
  */
-- 
2.1.4

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


Re: [U-Boot] [PATCH] arm: socfpga: Add missing CONFIG_BUILD_TARGET

2016-02-11 Thread Bakhvalov, Denis (Nokia - PL/Wroclaw)
Sorry.
My bad.

Best regards,
Denis Bakhvalov
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] am43xx: qspi: Fix config to select SPI mode

2016-02-11 Thread Jagan Teki
On 11 February 2016 at 03:42, Tom Rini  wrote:
> On Wed, Feb 10, 2016 at 11:06:09AM +0530, Vignesh R wrote:
>
>> CONFIG_SF_DEFAULT_MODE is used to select default SPI mode when using
>> sf commands. Therefore fix am43xx to use CONFIG_SF_DEFAULT_MODE instead
>> of CONFIG_DEFAULT_SPI_MODE.
>>
>> Signed-off-by: Vignesh R 
>
> Reviewed-by: Tom Rini 

Reviewed-by: Jagan Teki 

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


Re: [U-Boot] [PATCH] arm: at91: Add support for DENX MA5D4 SoM and EVK

2016-02-11 Thread Marek Vasut
On 02/11/2016 06:52 AM, Heiko Schocher wrote:
> Hello Marek,

Hi!

> added Andreas to cc as he is the at91 custodian.
> 
> Am 10.02.2016 um 22:41 schrieb Marek Vasut:
>> Add support for DENX MA5D4 SoM and MA5D4EVK board, based on the
>> Atmel SAMA5D4 SoC. The SoM contains the SoC, eMMC, SPI NOR, SPI
>> CAN controllers and DRAM, the baseboard contains UART connectors,
>> ethernet port, microSD slot, LCD header, 2x CAN connector and a
>> lot of expansion headers.
>>
>> Signed-off-by: Marek Vasut 
>> Cc: Andreas Bießmann 

Andreas should be in Cc , see ^ , could it be that the ML is doing
something funny again ?

>> ---
>>   arch/arm/mach-at91/Kconfig  |   6 +
>>   board/denx/ma5d4evk/Kconfig |  12 ++
>>   board/denx/ma5d4evk/MAINTAINERS |   6 +
>>   board/denx/ma5d4evk/Makefile|   7 +
>>   board/denx/ma5d4evk/ma5d4evk.c  | 417
>> 
>>   configs/ma5d4evk_defconfig  |  11 ++
>>   include/configs/ma5d4evk.h  | 255 
>>   7 files changed, 714 insertions(+)
>>   create mode 100644 board/denx/ma5d4evk/Kconfig
>>   create mode 100644 board/denx/ma5d4evk/MAINTAINERS
>>   create mode 100644 board/denx/ma5d4evk/Makefile
>>   create mode 100644 board/denx/ma5d4evk/ma5d4evk.c
>>   create mode 100644 configs/ma5d4evk_defconfig
>>   create mode 100644 include/configs/ma5d4evk.h
> 
> just some nitpick ;-)
> 
> [...]
>> diff --git a/board/denx/ma5d4evk/ma5d4evk.c
>> b/board/denx/ma5d4evk/ma5d4evk.c
>> new file mode 100644
>> index 000..d1a550e
>> --- /dev/null
>> +++ b/board/denx/ma5d4evk/ma5d4evk.c
>> @@ -0,0 +1,417 @@
>> +/*
>> + * Copyright (C) 2015 Marek Vasut 
>> + *
>> + * SPDX-License-Identifier:GPL-2.0+
>> + */
>> +
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +DECLARE_GLOBAL_DATA_PTR;
>> +
>> +/*
>> + * re h ; load 0x20 ma5d4evk/u-boot-spl.bin BIN ; go 0x20
>> + * h ; load 0x26f0 ma5d4evk/u-boot.bin BIN ; go 0x26f0
>> + */
> 
> ;-) Maybe a comment that this are the magic commands in the BDI
> for starting the generated images would be helpful.

Guh, nice catch, removed.

> And plan is to switch to CONFIG_DM for all boards (I know, I did not
> started with this job for "my" boards ...)... do you have plans/time
> for switching (or may you use it already and i just overseen it)?

I'd like to start with MX6 when I have time, but that's not gonna happen
soon I'm afraid. I'm hoping someone from Atmel will take up
the job for Atmel-based boards ;-)

> Beside of this:
> Reviewed-by: Heiko Schocher 
> 
> bye,
> Heiko

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


Re: [U-Boot] [PATCH] arm: socfpga: Add missing CONFIG_BUILD_TARGET

2016-02-11 Thread Marek Vasut
On 02/11/2016 02:54 PM, Bakhvalov, Denis (Nokia - PL/Wroclaw) wrote:
> $ quartus_hps -c 1 -o PV -a 0x0 u-boot-with-spl.sfp.bin
> // here ".bin" because current programmer requires so. I think it shouldn't 
> be a problem.

Please, avoid top-posting.

Also, please keep one discussion in one thread, don't post random stuff
in unrelated threads. Please repost this in the original thread, so we
can continue.

> From manual:
> "HPS Flash Programmer
> The utility accepts a Binary File with a required ".bin" extension.
> The HPS flash programmer command-line syntax is:
> quartus_hps  "
> 
> Info: Version 13.1.0 Build 162 10/23/2013 SJ Full Version
> 
> After that I power off/on the unit and nothing happened.
> I also compared md5 while copying - everything should be ok.
> 
> I tried it 2 times with no success:
> Looks like unit is no booting.
> No output in the console is visible.
> 
> If I change the images back (that is currently in official release) - at 
> least bootloader pass and u-boot is also launching.
> 
> Does it mean that there is something wrong with SPL configuration?
> Or maybe I need some patches from altera in order to make them working?
> Because I can see some traces of applied patches in the svn history.
> 
> Best regards,
> Denis Bakhvalov
> 
> MBB Radio Platforms, RFSW
> 
> -Original Message-
> From: EXT Marek Vasut [mailto:ma...@denx.de] 
> Sent: Thursday, February 11, 2016 14:02
> To: u-boot@lists.denx.de
> Cc: Marek Vasut ; Dinh Nguyen 
> ; Chin Liang See ; 
> Bakhvalov, Denis (Nokia - PL/Wroclaw) 
> Subject: [PATCH] arm: socfpga: Add missing CONFIG_BUILD_TARGET
> 
> Add the missing CONFIG_BUILD_TARGET to get u-boot-with-spl.sfp built
> automatically upon running make in the source tree.
> 
> Signed-off-by: Marek Vasut 
> Cc: Dinh Nguyen 
> Cc: Chin Liang See 
> Cc: Denis Bakhvalov 
> ---
>  include/configs/socfpga_common.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/include/configs/socfpga_common.h 
> b/include/configs/socfpga_common.h
> index 8de0ab9..0501bd1 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -30,6 +30,9 @@
>  
>  #define CONFIG_TIMESTAMP /* Print image info with timestamp */
>  
> +/* add target to build it automatically upon "make" */
> +#define CONFIG_BUILD_TARGET  "u-boot-with-spl.sfp"
> +
>  /*
>   * Memory configurations
>   */
> 

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


[U-Boot] [PATCH] arm: socfpga: Fix ethernet reset handling

2016-02-11 Thread Marek Vasut
The following patch caused cpu_eth_init() to not be called anymore
for DM-capable boards:

commit c32a6fd07b1839e4a45729587ebc8e1c55601a4d
Date:   Sun Jan 17 14:51:56 2016 -0700
net: Don't call board/cpu_eth_init() with driver model

This breaks ethernet on SoCFPGA, since we use that function to un-reset
the ethernet blocks. Invoke the ethernet reset function from arch_misc_init()
instead to fix the breakage.

Signed-off-by: Marek Vasut 
Cc: Dinh Nguyen 
Cc: Chin Liang See 
Cc: Denis Bakhvalov 
---
 arch/arm/mach-socfpga/misc.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
index 9b43b92..ce3ff0a 100644
--- a/arch/arm/mach-socfpga/misc.c
+++ b/arch/arm/mach-socfpga/misc.c
@@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int 
of_reset_id)
socfpga_per_reset(reset, 0);
 }
 
-int cpu_eth_init(bd_t *bis)
+static int socfpga_eth_reset(void)
 {
const void *fdt = gd->fdt_blob;
struct fdtdec_phandle_args args;
@@ -137,6 +137,11 @@ int cpu_eth_init(bd_t *bis)
 
return 0;
 }
+#else
+static int socfpga_eth_reset(void)
+{
+   return 0
+};
 #endif
 
 struct {
@@ -232,7 +237,7 @@ int arch_misc_init(void)
setenv("bootmode", bsel_str[bsel].mode);
if (fpga_id >= 0)
setenv("fpgatype", socfpga_fpga_model[fpga_id].var);
-   return 0;
+   return socfpga_eth_reset();
 }
 #endif
 
-- 
2.1.4

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


[U-Boot] [PATCH] arm: socfpga: Remove bashisms from qts filter

2016-02-11 Thread Marek Vasut
Weed out bashisms from the script. The echo -e does not work in dash,
which is the default /bin/sh in debian .

Signed-off-by: Marek Vasut 
Cc: Dinh Nguyen 
Cc: Chin Liang See 
Cc: Dalon Westergreen 
---
 arch/arm/mach-socfpga/qts-filter.sh | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-socfpga/qts-filter.sh 
b/arch/arm/mach-socfpga/qts-filter.sh
index 1adfbf7..050d6ba 100755
--- a/arch/arm/mach-socfpga/qts-filter.sh
+++ b/arch/arm/mach-socfpga/qts-filter.sh
@@ -187,13 +187,13 @@ usage() {
echo "$0 [soc_type] [input_qts_dir] [input_bsp_dir] [output_dir]"
echo "Process QTS-generated headers into U-Boot compatible ones."
echo ""
-   echo -e "  soc_type\t-\tType of SoC, either 'cyclone5' or 'arria5'."
-   echo -e "  input_qts_dir\t-\tDirectory with compiled Quartus project"
-   echo -e "\t\t\t\tand containing the Quartus project file (QPF)."
-   echo -e "  input_bsp_dir\t-\tDirectory with generated bsp containing"
-   echo -e "\t\t\t\tthe settings.bsp file."
-   echo -e "  output_dir\t-\tDirectory to store the U-Boot compatible"
-   echo -e "\t\t\t\theaders."
+   echo "  soc_type  - Type of SoC, either 'cyclone5' or 'arria5'."
+   echo "  input_qts_dir - Directory with compiled Quartus project"
+   echo "  and containing the Quartus project file (QPF)."
+   echo "  input_bsp_dir - Directory with generated bsp containing"
+   echo "  the settings.bsp file."
+   echo "  output_dir- Directory to store the U-Boot compatible"
+   echo "  headers."
echo ""
 }
 
-- 
2.1.4

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


Re: [U-Boot] Moving custom board imx6q from u-boot-imx 2014.04 to 2015.04 lead to freeze

2016-02-11 Thread Fabio Estevam
On Thu, Feb 11, 2016 at 5:50 AM, Roberto Fichera  wrote:

> Ok! Will do! However I've found that with this patch below it boots pretty 
> fine! Do you know why?
>
> diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
> index 92d3732..f87acb6 100644
> --- a/arch/arm/lib/crt0.S
> +++ b/arch/arm/lib/crt0.S
> @@ -108,7 +108,7 @@ here:
>   * now relocate vectors
>   */
>
> -blrelocate_vectors
> +/* blrelocate_vectors */
>
>  /* Set up final (full) environment */
>

I am not sure why removing this line fixes the boot for you.

This line has been added by commit:

commit db544b9662622826b8482c126c116ec366fcd58c
Author: Albert ARIBAUD 
Date:   Thu Nov 13 17:59:15 2014 +0100

imx: fix exception vectors relocation in imx27

Adding Albert on Cc in case he has any ideas as to why this would
impact mx6 to boot.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ARM: tegra: enable USB device mode port on Dalmore

2016-02-11 Thread Stephen Warren
From: Stephen Warren 

This allows U-Boot to expose UMS and DFU protocols on this port in device
mode, or to act as a USB host on the port, using an "OTG" (micro-B to
female A host) cable.

Signed-off-by: Stephen Warren 
---
 arch/arm/dts/tegra114-dalmore.dts | 9 -
 include/configs/dalmore.h | 2 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/tegra114-dalmore.dts 
b/arch/arm/dts/tegra114-dalmore.dts
index 51ff266d760a..49195c35964a 100644
--- a/arch/arm/dts/tegra114-dalmore.dts
+++ b/arch/arm/dts/tegra114-dalmore.dts
@@ -18,7 +18,8 @@
i2c4 = "/i2c@7000c700";
sdhci0 = "/sdhci@78000600";
sdhci1 = "/sdhci@78000400";
-   usb0 = "/usb@7d008000";
+   usb0 = "/usb@7d00";
+   usb1 = "/usb@7d008000";
};
 
memory {
@@ -67,6 +68,12 @@
status = "okay";
};
 
+   usb@7d00 {
+   status = "okay";
+   dr_mode = "otg";
+   nvidia,vbus-gpio = < TEGRA_GPIO(N, 4) GPIO_ACTIVE_HIGH>;
+   };
+
usb@7d008000 {
nvidia,vbus-gpio = < TEGRA_GPIO(K, 6) GPIO_ACTIVE_HIGH>;
status = "okay";
diff --git a/include/configs/dalmore.h b/include/configs/dalmore.h
index fdfda6b90348..917573da4368 100644
--- a/include/configs/dalmore.h
+++ b/include/configs/dalmore.h
@@ -48,6 +48,7 @@
 /* USB Host support */
 #define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_TEGRA
+#define CONFIG_USB_MAX_CONTROLLER_COUNT2
 #define CONFIG_USB_STORAGE
 #define CONFIG_CMD_USB
 
@@ -58,6 +59,7 @@
 /* General networking support */
 #define CONFIG_CMD_DHCP
 
+#include "tegra-common-usb-gadget.h"
 #include "tegra-common-post.h"
 
 #endif /* __CONFIG_H */
-- 
2.7.0

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


Re: [U-Boot] GSoC projects for Minnowboard MAX

2016-02-11 Thread Hans de Goede

Hi,

On 11-02-16 13:16, Simon Glass wrote:

Hi,

Minnowboard is looking for GSoC projects this year.

http://wiki.minnowboard.org/GSoC2016

There are a few things listed in README.x86 to be done. Any ideas?


Maybe speed up USB port scan ? This really needs to be parallelized
by using some for of cooperative multi-tasking.

For starters just parallelizing the scanning of separate controllers
in drivers/usb/host/usb-uclass.c: usb_init() by splitting
usb_scan_bus() into a  usb_scan_bus_start() and usb_scan_bus_get_status()
with the latter being called repeatedly until all busses are done
would already help. Then do something similar for scanning all
ports of a hub in "parallel", etc.

Regards,

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


Re: [U-Boot] [PATCH] arm: socfpga: Enable ethernet PHY configuration to RGMII again

2016-02-11 Thread Marek Vasut
On 02/11/2016 04:45 PM, Stefan Roese wrote:
> With commit c32a6fd0 [net: Don't call board/cpu_eth_init() with driver
> model], cpu_eth_init() is not called on SoCFPGA any more. Since this
> function configures the internal PHY interface to RGMII (via the physel_X
> bits), its still needed. So lets rename this function and call it in
> arch_early_init_r().
> 
> Tested on socfpga_sr1500.
> 
> Signed-off-by: Stefan Roese 
> Cc: Simon Glass 
> Cc: Dinh Nguyen 
> Cc: Marek Vasut 
> ---
>  arch/arm/mach-socfpga/misc.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
> index 9b43b92..2b1cd4a 100644
> --- a/arch/arm/mach-socfpga/misc.c
> +++ b/arch/arm/mach-socfpga/misc.c
> @@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int 
> of_reset_id)
>   socfpga_per_reset(reset, 0);
>  }

I just sent and applied very similar patch, can you try
u-boot-socfpga/master and see if it works for you?

Thanks!

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


Re: [U-Boot] [PATCH] arm: socfpga: Fix ethernet reset handling

2016-02-11 Thread Stefan Roese

On 11.02.2016 16:41, Marek Vasut wrote:

The following patch caused cpu_eth_init() to not be called anymore
for DM-capable boards:

commit c32a6fd07b1839e4a45729587ebc8e1c55601a4d
Date:   Sun Jan 17 14:51:56 2016 -0700
 net: Don't call board/cpu_eth_init() with driver model

This breaks ethernet on SoCFPGA, since we use that function to un-reset
the ethernet blocks. Invoke the ethernet reset function from arch_misc_init()
instead to fix the breakage.

Signed-off-by: Marek Vasut 
Cc: Dinh Nguyen 
Cc: Chin Liang See 
Cc: Denis Bakhvalov 


Works for me as well. So:

Tested-by: Stefan Roese 

Thanks,
Stefan

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


Re: [U-Boot] [PATCH] arm: socfpga: Enable ethernet PHY configuration to RGMII again

2016-02-11 Thread Stefan Roese

On 11.02.2016 16:49, Marek Vasut wrote:

On 02/11/2016 04:45 PM, Stefan Roese wrote:

With commit c32a6fd0 [net: Don't call board/cpu_eth_init() with driver
model], cpu_eth_init() is not called on SoCFPGA any more. Since this
function configures the internal PHY interface to RGMII (via the physel_X
bits), its still needed. So lets rename this function and call it in
arch_early_init_r().

Tested on socfpga_sr1500.

Signed-off-by: Stefan Roese 
Cc: Simon Glass 
Cc: Dinh Nguyen 
Cc: Marek Vasut 
---
  arch/arm/mach-socfpga/misc.c | 6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
index 9b43b92..2b1cd4a 100644
--- a/arch/arm/mach-socfpga/misc.c
+++ b/arch/arm/mach-socfpga/misc.c
@@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int 
of_reset_id)
socfpga_per_reset(reset, 0);
  }


I just sent and applied very similar patch, can you try
u-boot-socfpga/master and see if it works for you?


Done and works just fine. So please feel free to upstream your patch
version.

Thanks,
Stefan

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


Re: [U-Boot] Problem with mounting a jffs2 partition on flash.

2016-02-11 Thread Bakhvalov, Denis (Nokia - PL/Wroclaw)
> There is output, but it takes a while for the USB-to-UART chip to kick
> in after restart, so you don't see it. I will send you two more patches,
> so apply them and it should get you up and running. The QSPI NOR boot
> was not enabled on AV/CV SoCDK.

> You can also grab the latest stuff here:
> http://git.denx.de/?p=u-boot/u-boot-socfpga.git;a=summary

I made those changes, but still no progress.

Currently I'm building u-boot from 
git://git.denx.de/u-boot.git
Should I use
git://git.denx.de/u-boot-socfpga.git
?

Best regards,
Denis Bakhvalov
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arm: socfpga: Enable ethernet PHY configuration to RGMII again

2016-02-11 Thread Stefan Roese
With commit c32a6fd0 [net: Don't call board/cpu_eth_init() with driver
model], cpu_eth_init() is not called on SoCFPGA any more. Since this
function configures the internal PHY interface to RGMII (via the physel_X
bits), its still needed. So lets rename this function and call it in
arch_early_init_r().

Tested on socfpga_sr1500.

Signed-off-by: Stefan Roese 
Cc: Simon Glass 
Cc: Dinh Nguyen 
Cc: Marek Vasut 
---
 arch/arm/mach-socfpga/misc.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
index 9b43b92..2b1cd4a 100644
--- a/arch/arm/mach-socfpga/misc.c
+++ b/arch/arm/mach-socfpga/misc.c
@@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int 
of_reset_id)
socfpga_per_reset(reset, 0);
 }
 
-int cpu_eth_init(bd_t *bis)
+static int dwmac_eth_init(void)
 {
const void *fdt = gd->fdt_blob;
struct fdtdec_phandle_args args;
@@ -363,6 +363,10 @@ int arch_early_init_r(void)
socfpga_per_reset(SOCFPGA_RESET(NAND), 0);
 #endif
 
+#ifdef CONFIG_ETH_DESIGNWARE
+   dwmac_eth_init();
+#endif
+
return 0;
 }
 
-- 
2.7.1

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


Re: [U-Boot] Problem with mounting a jffs2 partition on flash.

2016-02-11 Thread Marek Vasut
On 02/11/2016 04:29 PM, Bakhvalov, Denis (Nokia - PL/Wroclaw) wrote:
>> There is output, but it takes a while for the USB-to-UART chip to kick
>> in after restart, so you don't see it. I will send you two more patches,
>> so apply them and it should get you up and running. The QSPI NOR boot
>> was not enabled on AV/CV SoCDK.
> 
>> You can also grab the latest stuff here:
>> http://git.denx.de/?p=u-boot/u-boot-socfpga.git;a=summary
> 
> I made those changes, but still no progress.
> 
> Currently I'm building u-boot from 
> git://git.denx.de/u-boot.git
> Should I use
> git://git.denx.de/u-boot-socfpga.git
> ?

The fixes are pushed there, so yes, give it a try.

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


Re: [U-Boot] [PULL] u-boot-usb/master

2016-02-11 Thread Simon Glass
+Stephen, Ted

Hi,

On 25 January 2016 at 15:21, Marek Vasut  wrote:
> The following changes since commit 12f229ea8f6c8e20f8fd07906eafc853c4c354a9:
>
>   Merge git://git.denx.de/u-boot-fdt (2016-01-22 17:01:22 -0500)
>
> are available in the git repository at:
>
>   git://git.denx.de/u-boot-usb.git master
>
> for you to fetch changes up to bdbcbe752e93357226cba12a6ce00bbe54cb5db8:
>
>   usb: kbd: Prevent out of bound access (2016-01-25 22:00:46 +0100)
>
> 
> Marek Vasut (1):
>   usb: kbd: Prevent out of bound access
>
> Masahiro Yamada (1):
>   usb: add clock support for generic EHCI
>
> Stefan Brüns (7):
>   usb: dwc2: Fix out-of-bounds access, fix chunk size
>   usb: dwc2: Simplify wait_for_chhltd(), remove ignore_ack
>   usb: dwc2: split transfer core from outer loop
>   usb: dwc2: add helper function for setting SPLIT HC registers
>   usb: dwc2: Implement SPLIT transaction support
>   usb: dwc2: Add SPLIT INTERRUPT transaction support
>   usb: dwc2: Do not mix data toggle for IN and OUT endpoints, check bounds
>
> Stephen Warren (1):
>   ARM: rpi: enable USB keyboard
>
> Ted Chen (1):
>   usb: eth: add Realtek RTL8152B/RTL8153 DRIVER

This brings in a driver that does not support driver model. There was
one more to convert and then we would be able to move everything to
driver model for USB Ethernet. This makes the job harder.

Stephen or Ted, are you able to send a patch to convert it?

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


Re: [U-Boot] [PATCH v2 16/26] dm: tegra: net: Convert tegra boards to driver model for Ethernet

2016-02-11 Thread Simon Glass
Hi Stephen,

On 11 February 2016 at 16:21, Stephen Warren  wrote:
> On 12/13/2015 08:46 PM, Simon Glass wrote:
>>
>> Applied to u-boot-dm/next.
>
>
> I've found another strange problem, at least triggered/exposed by this
> patch:
>
> On at least either Dalmore or Jetson TK1, using USB Ethernet (hence with
> RTL8169 support disabled in include/configs/jetson-tk1.h[1]), I find that if
> I execute the following commands at or after this patch, then the system
> reboots during DHCP operation:
>
> save mmc 1:1 $loadaddr /dfu_dummy.bin 0x3c0
> usb start
> setenv autoload no
> dhcp
>
> yields:
>
> 
> Tegra124 (Jetson TK1) # dhcp
> Waiting for Ethernet connection... done.
> BOOTP broadcast 1
> DHCP client bound to address 10.20.204.50 (1 ms)
> data abort
> pc : []  lr : []
> reloc pc : [<801291d4>]lr : [<80113fd0>]
> sp : fda4e720  ip : 450088df fp : fda60048
> r10: fffa4fe3  r9 : fda53ee0 r8 : 
> r7 :   r6 :  r5 :   r4 : fda60048
> r3 : 0383  r2 :  r1 :   r0 : e10f354b
> Flags: NzCv  IRQs off  FIQs off  Mode SVC_32
> Resetting CPU ...
>
> resetting ...
> 
>
> However, if I execute those commands at the commit before this patch, then
> everything is OK.
>
> The "save" command is definitely required to trigger this issue. The
> partition being saved to is a 1024MiB ext4 filesystem that's almost empty.
> If I omit the save, or save to a 1024MiB FAT filesystem instead, there's no
> error. This leads me to suspect some kind of memory corruption rather than a
> direct problem with this patch. Due to ext4 interaction, also CCing Łukasz
> in case he has any quick ideas.
>
> I'll go track down the PC where the error occurs and try and add some debug
> spew etc. to see what's up. Any other ideas appreciated though.
>
> (This is the problem with writing test systems; they show up bugs!)
>
>
>
> [1] i.e. I have this change made locally so that no PCIe Ethernet device
> exists, which causes the USB Ethernet to be used by default:
>
> diff --git a/include/configs/jetson-tk1.h b/include/configs/jetson-tk1.h
> index 23b2e436167c..af26b055b70b 100644
> --- a/include/configs/jetson-tk1.h
> +++ b/include/configs/jetson-tk1.h
> @@ -62,7 +62,6 @@
>  #define CONFIG_CMD_PCI
>
>  /* PCI networking support */
> -#define CONFIG_RTL8169
>
>  /* General networking support */
>  #define CONFIG_CMD_DHCP
>

I have seen some odd things on Seaboard which is a bit more forgiving
with RAM at 0 (although not Jetson-TK1, right?). It can sometimes mask
an issue where a driver has not auto-allocated space, but the driver
is using it anyway (i.e. using a NULL pointer as its private data).

I can't see anything wrong from inspection. The per-child data (struct
usb_device) appears to be cache-aligned as expected.

Which USB Ethernet driver are you using?

It would be great to fix this.

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


Re: [U-Boot] [PATCH] arm: socfpga: Enable ethernet PHY configuration to RGMII again

2016-02-11 Thread Simon Glass
Hi Marek,

On 11 February 2016 at 13:58, Marek Vasut  wrote:
> On 02/11/2016 09:28 PM, Simon Glass wrote:
>> Hi,
>>
>> On 11 February 2016 at 08:54, Stefan Roese  wrote:
>>> On 11.02.2016 16:49, Marek Vasut wrote:

 On 02/11/2016 04:45 PM, Stefan Roese wrote:
>
> With commit c32a6fd0 [net: Don't call board/cpu_eth_init() with driver
> model], cpu_eth_init() is not called on SoCFPGA any more. Since this
> function configures the internal PHY interface to RGMII (via the physel_X
> bits), its still needed. So lets rename this function and call it in
> arch_early_init_r().
>
> Tested on socfpga_sr1500.
>
> Signed-off-by: Stefan Roese 
> Cc: Simon Glass 
> Cc: Dinh Nguyen 
> Cc: Marek Vasut 
> ---
>   arch/arm/mach-socfpga/misc.c | 6 +-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
> index 9b43b92..2b1cd4a 100644
> --- a/arch/arm/mach-socfpga/misc.c
> +++ b/arch/arm/mach-socfpga/misc.c
> @@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int
> of_reset_id)
> socfpga_per_reset(reset, 0);
>   }


 I just sent and applied very similar patch, can you try
 u-boot-socfpga/master and see if it works for you?
>>>
>>>
>>> Done and works just fine. So please feel free to upstream your patch
>>> version.
>>
>> Can this be done in the driver? You have a device tree representation
>> I think. If you are using the compat list in fdtdec.c then it suggests
>> that you need a driver.
>
> Does u-boot DM already have the ability to handle resets of various IP
> blocks on the chip ? I don't think so, so for now I'll opt for fixing
> this breakage.
>

OK I see what you mean. We might need to rename the current
UCLASS_RESET to make room for this.

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


Re: [U-Boot] [PULL] u-boot-usb/master

2016-02-11 Thread Stephen Warren

On 02/11/2016 04:59 PM, Simon Glass wrote:

+Stephen, Ted

Hi,

On 25 January 2016 at 15:21, Marek Vasut  wrote:

The following changes since commit 12f229ea8f6c8e20f8fd07906eafc853c4c354a9:

   Merge git://git.denx.de/u-boot-fdt (2016-01-22 17:01:22 -0500)

are available in the git repository at:

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

for you to fetch changes up to bdbcbe752e93357226cba12a6ce00bbe54cb5db8:

   usb: kbd: Prevent out of bound access (2016-01-25 22:00:46 +0100)


Marek Vasut (1):
   usb: kbd: Prevent out of bound access

Masahiro Yamada (1):
   usb: add clock support for generic EHCI

Stefan Brüns (7):
   usb: dwc2: Fix out-of-bounds access, fix chunk size
   usb: dwc2: Simplify wait_for_chhltd(), remove ignore_ack
   usb: dwc2: split transfer core from outer loop
   usb: dwc2: add helper function for setting SPLIT HC registers
   usb: dwc2: Implement SPLIT transaction support
   usb: dwc2: Add SPLIT INTERRUPT transaction support
   usb: dwc2: Do not mix data toggle for IN and OUT endpoints, check bounds

Stephen Warren (1):
   ARM: rpi: enable USB keyboard

Ted Chen (1):
   usb: eth: add Realtek RTL8152B/RTL8153 DRIVER


This brings in a driver that does not support driver model. There was
one more to convert and then we would be able to move everything to
driver model for USB Ethernet. This makes the job harder.

Stephen or Ted, are you able to send a patch to convert it?


I thought the patch wasn't going to be accepted until it was converted. 
Perhaps it was applied too early?


Anyway, I am not likely to be able to use the driver in the near future 
due to lack of HW to test it on, so Ted is the best candidate to port it 
over.

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


Re: [U-Boot] [PATCH v2 16/26] dm: tegra: net: Convert tegra boards to driver model for Ethernet

2016-02-11 Thread Stephen Warren

On 02/11/2016 05:10 PM, Simon Glass wrote:

Hi Stephen,

On 11 February 2016 at 16:21, Stephen Warren  wrote:

On 12/13/2015 08:46 PM, Simon Glass wrote:


Applied to u-boot-dm/next.



I've found another strange problem, at least triggered/exposed by this
patch:

On at least either Dalmore or Jetson TK1, using USB Ethernet (hence with
RTL8169 support disabled in include/configs/jetson-tk1.h[1]), I find that if
I execute the following commands at or after this patch, then the system
reboots during DHCP operation:

save mmc 1:1 $loadaddr /dfu_dummy.bin 0x3c0
usb start
setenv autoload no
dhcp

yields:


Tegra124 (Jetson TK1) # dhcp
Waiting for Ethernet connection... done.
BOOTP broadcast 1
DHCP client bound to address 10.20.204.50 (1 ms)
data abort
pc : []  lr : []
reloc pc : [<801291d4>]lr : [<80113fd0>]
sp : fda4e720  ip : 450088df fp : fda60048
r10: fffa4fe3  r9 : fda53ee0 r8 : 
r7 :   r6 :  r5 :   r4 : fda60048
r3 : 0383  r2 :  r1 :   r0 : e10f354b
Flags: NzCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...


However, if I execute those commands at the commit before this patch, then
everything is OK.

The "save" command is definitely required to trigger this issue. The
partition being saved to is a 1024MiB ext4 filesystem that's almost empty.
If I omit the save, or save to a 1024MiB FAT filesystem instead, there's no
error. This leads me to suspect some kind of memory corruption rather than a
direct problem with this patch. Due to ext4 interaction, also CCing Łukasz
in case he has any quick ideas.

I'll go track down the PC where the error occurs and try and add some debug
spew etc. to see what's up. Any other ideas appreciated though.

(This is the problem with writing test systems; they show up bugs!)



[1] i.e. I have this change made locally so that no PCIe Ethernet device
exists, which causes the USB Ethernet to be used by default:

diff --git a/include/configs/jetson-tk1.h b/include/configs/jetson-tk1.h
index 23b2e436167c..af26b055b70b 100644
--- a/include/configs/jetson-tk1.h
+++ b/include/configs/jetson-tk1.h
@@ -62,7 +62,6 @@
  #define CONFIG_CMD_PCI

  /* PCI networking support */
-#define CONFIG_RTL8169

  /* General networking support */
  #define CONFIG_CMD_DHCP



I have seen some odd things on Seaboard which is a bit more forgiving
with RAM at 0 (although not Jetson-TK1, right?). It can sometimes mask
an issue where a driver has not auto-allocated space, but the driver
is using it anyway (i.e. using a NULL pointer as its private data).

I can't see anything wrong from inspection. The per-child data (struct
usb_device) appears to be cache-aligned as expected.

Which USB Ethernet driver are you using?


asix.

It looks like something inside the dhcp command is trashing something in 
the hush shell "pipe" state...


BTW, can sandbox support USB Ethernet and MMC (or perhaps any block 
device that I can "save" on)? I'd be curious if the problem could repro 
there, what with its better debugging tools. However, if the issue is 
fluky malloc heap layout due to command history, I guess we'd have to be 
pretty lucky...

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


[U-Boot] [PATCH 3/4] stm32x7: add support for stm32x7 serial driver

2016-02-11 Thread Vikas Manocha
This patch adds support for stm32f7 family usart peripheral.

Signed-off-by: Vikas Manocha 
---
 drivers/serial/Makefile   |  1 +
 drivers/serial/serial_stm32x7.c   | 83 +++
 drivers/serial/serial_stm32x7.h   | 37 ++
 include/dm/platform_data/serial_stm32x7.h | 17 +++
 4 files changed, 138 insertions(+)
 create mode 100644 drivers/serial/serial_stm32x7.c
 create mode 100644 drivers/serial/serial_stm32x7.h
 create mode 100644 include/dm/platform_data/serial_stm32x7.h

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index c63999a..05bdf56 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_ARC_SERIAL) += serial_arc.o
 obj-$(CONFIG_UNIPHIER_SERIAL) += serial_uniphier.o
 obj-$(CONFIG_STM32_SERIAL) += serial_stm32.o
 obj-$(CONFIG_PIC32_SERIAL) += serial_pic32.o
+obj-$(CONFIG_STM32X7_SERIAL) += serial_stm32x7.o
 
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_USB_TTY) += usbtty.o
diff --git a/drivers/serial/serial_stm32x7.c b/drivers/serial/serial_stm32x7.c
new file mode 100644
index 000..cfbfab7
--- /dev/null
+++ b/drivers/serial/serial_stm32x7.c
@@ -0,0 +1,83 @@
+/*
+ * (C) Copyright 2016
+ * Vikas Manocha, 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "serial_stm32x7.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static int stm32_serial_setbrg(struct udevice *dev, int baudrate)
+{
+   struct stm32x7_serial_platdata *plat = dev->platdata;
+   struct stm32_usart *const usart = plat->base;
+   writel(plat->clock/baudrate, >brr);
+
+   return 0;
+}
+
+static int stm32_serial_getc(struct udevice *dev)
+{
+   struct stm32x7_serial_platdata *plat = dev->platdata;
+   struct stm32_usart *const usart = plat->base;
+
+   if ((readl(>sr) & USART_SR_FLAG_RXNE) == 0)
+   return -EAGAIN;
+
+   return readl(>rd_dr);
+}
+
+static int stm32_serial_putc(struct udevice *dev, const char c)
+{
+   struct stm32x7_serial_platdata *plat = dev->platdata;
+   struct stm32_usart *const usart = plat->base;
+
+   if ((readl(>sr) & USART_SR_FLAG_TXE) == 0)
+   return -EAGAIN;
+
+   writel(c, >tx_dr);
+
+   return 0;
+}
+
+static int stm32_serial_pending(struct udevice *dev, bool input)
+{
+   struct stm32x7_serial_platdata *plat = dev->platdata;
+   struct stm32_usart *const usart = plat->base;
+
+   if (input)
+   return readl(>sr) & USART_SR_FLAG_RXNE ? 1 : 0;
+   else
+   return readl(>sr) & USART_SR_FLAG_TXE ? 0 : 1;
+}
+
+static int stm32_serial_probe(struct udevice *dev)
+{
+   struct stm32x7_serial_platdata *plat = dev->platdata;
+   struct stm32_usart *const usart = plat->base;
+   setbits_le32(>cr1, USART_CR1_RE | USART_CR1_TE | USART_CR1_UE);
+
+   return 0;
+}
+
+static const struct dm_serial_ops stm32_serial_ops = {
+   .putc = stm32_serial_putc,
+   .pending = stm32_serial_pending,
+   .getc = stm32_serial_getc,
+   .setbrg = stm32_serial_setbrg,
+};
+
+U_BOOT_DRIVER(serial_stm32) = {
+   .name = "serial_stm32x7",
+   .id = UCLASS_SERIAL,
+   .ops = _serial_ops,
+   .probe = stm32_serial_probe,
+   .flags = DM_FLAG_PRE_RELOC,
+};
diff --git a/drivers/serial/serial_stm32x7.h b/drivers/serial/serial_stm32x7.h
new file mode 100644
index 000..6190d67
--- /dev/null
+++ b/drivers/serial/serial_stm32x7.h
@@ -0,0 +1,37 @@
+/*
+ * (C) Copyright 2016
+ * Vikas Manocha, 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _SERIAL_STM32_X7_
+#define _SERIAL_STM32_X7_
+
+struct stm32_usart {
+   u32 cr1;
+   u32 cr2;
+   u32 cr3;
+   u32 brr;
+   u32 gtpr;
+   u32 rtor;
+   u32 rqr;
+   u32 sr;
+   u32 icr;
+   u32 rd_dr;
+   u32 tx_dr;
+};
+
+
+#define USART_CR1_RE   (1 << 2)
+#define USART_CR1_TE   (1 << 3)
+#define USART_CR1_UE   (1 << 0)
+
+#define USART_SR_FLAG_RXNE (1 << 5)
+#define USART_SR_FLAG_TXE  (1 << 7)
+
+#define USART_BRR_F_MASK   0xFF
+#define USART_BRR_M_SHIFT  4
+#define USART_BRR_M_MASK   0xFFF0
+
+#endif
diff --git a/include/dm/platform_data/serial_stm32x7.h 
b/include/dm/platform_data/serial_stm32x7.h
new file mode 100644
index 000..328a8a3
--- /dev/null
+++ b/include/dm/platform_data/serial_stm32x7.h
@@ -0,0 +1,17 @@
+/*
+ * (C) Copyright 2016
+ * Vikas Manocha, 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __SERIAL_STM32x7_H
+#define __SERIAL_STM32x7_H
+
+/* Information about a serial port */
+struct stm32x7_serial_platdata {
+   struct stm32_usart *base;  /* address of registers in physical memory */
+   unsigned int clock;
+};
+
+#endif /* __SERIAL_STM32x7_H */
-- 
1.9.1


[U-Boot] [PATCH 2/4] gpio: stm32_gpio: move base addresses to the soc file

2016-02-11 Thread Vikas Manocha
Base addresses for GPIOs could be different for different socs, this
patch moves the base addresses from driver to the soc specific location.

Signed-off-by: Vikas Manocha 
---
 arch/arm/include/asm/arch-stm32f1/stm32.h |  8 
 arch/arm/include/asm/arch-stm32f4/stm32.h | 10 ++
 drivers/gpio/stm32_gpio.c | 18 --
 3 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/arch/arm/include/asm/arch-stm32f1/stm32.h 
b/arch/arm/include/asm/arch-stm32f1/stm32.h
index 4094a75..1af73c5 100644
--- a/arch/arm/include/asm/arch-stm32f1/stm32.h
+++ b/arch/arm/include/asm/arch-stm32f1/stm32.h
@@ -24,6 +24,14 @@
 
 #define STM32_BUS_MASK 0x
 
+#define STM32_GPIOA_BASE   (STM32_APB2PERIPH_BASE + 0x0800)
+#define STM32_GPIOB_BASE   (STM32_APB2PERIPH_BASE + 0x0C00)
+#define STM32_GPIOC_BASE   (STM32_APB2PERIPH_BASE + 0x1000)
+#define STM32_GPIOD_BASE   (STM32_APB2PERIPH_BASE + 0x1400)
+#define STM32_GPIOE_BASE   (STM32_APB2PERIPH_BASE + 0x1800)
+#define STM32_GPIOF_BASE   (STM32_APB2PERIPH_BASE + 0x1C00)
+#define STM32_GPIOG_BASE   (STM32_APB2PERIPH_BASE + 0x2000)
+
 /*
  * Register maps
  */
diff --git a/arch/arm/include/asm/arch-stm32f4/stm32.h 
b/arch/arm/include/asm/arch-stm32f4/stm32.h
index 6b64d03..7d6331b 100644
--- a/arch/arm/include/asm/arch-stm32f4/stm32.h
+++ b/arch/arm/include/asm/arch-stm32f4/stm32.h
@@ -23,6 +23,16 @@
 
 #define STM32_BUS_MASK 0x
 
+#define STM32_GPIOA_BASE   (STM32_AHB1PERIPH_BASE + 0x)
+#define STM32_GPIOB_BASE   (STM32_AHB1PERIPH_BASE + 0x0400)
+#define STM32_GPIOC_BASE   (STM32_AHB1PERIPH_BASE + 0x0800)
+#define STM32_GPIOD_BASE   (STM32_AHB1PERIPH_BASE + 0x0C00)
+#define STM32_GPIOE_BASE   (STM32_AHB1PERIPH_BASE + 0x1000)
+#define STM32_GPIOF_BASE   (STM32_AHB1PERIPH_BASE + 0x1400)
+#define STM32_GPIOG_BASE   (STM32_AHB1PERIPH_BASE + 0x1800)
+#define STM32_GPIOH_BASE   (STM32_AHB1PERIPH_BASE + 0x1C00)
+#define STM32_GPIOI_BASE   (STM32_AHB1PERIPH_BASE + 0x2000)
+
 /*
  * Register maps
  */
diff --git a/drivers/gpio/stm32_gpio.c b/drivers/gpio/stm32_gpio.c
index 9f9ff48..739de01 100644
--- a/drivers/gpio/stm32_gpio.c
+++ b/drivers/gpio/stm32_gpio.c
@@ -20,16 +20,6 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CONFIG_STM32F4)
-#define STM32_GPIOA_BASE   (STM32_AHB1PERIPH_BASE + 0x)
-#define STM32_GPIOB_BASE   (STM32_AHB1PERIPH_BASE + 0x0400)
-#define STM32_GPIOC_BASE   (STM32_AHB1PERIPH_BASE + 0x0800)
-#define STM32_GPIOD_BASE   (STM32_AHB1PERIPH_BASE + 0x0C00)
-#define STM32_GPIOE_BASE   (STM32_AHB1PERIPH_BASE + 0x1000)
-#define STM32_GPIOF_BASE   (STM32_AHB1PERIPH_BASE + 0x1400)
-#define STM32_GPIOG_BASE   (STM32_AHB1PERIPH_BASE + 0x1800)
-#define STM32_GPIOH_BASE   (STM32_AHB1PERIPH_BASE + 0x1C00)
-#define STM32_GPIOI_BASE   (STM32_AHB1PERIPH_BASE + 0x2000)
-
 static const unsigned long io_base[] = {
STM32_GPIOA_BASE, STM32_GPIOB_BASE, STM32_GPIOC_BASE,
STM32_GPIOD_BASE, STM32_GPIOE_BASE, STM32_GPIOF_BASE,
@@ -85,14 +75,6 @@ out:
return rv;
 }
 #elif defined(CONFIG_STM32F1)
-#define STM32_GPIOA_BASE   (STM32_APB2PERIPH_BASE + 0x0800)
-#define STM32_GPIOB_BASE   (STM32_APB2PERIPH_BASE + 0x0C00)
-#define STM32_GPIOC_BASE   (STM32_APB2PERIPH_BASE + 0x1000)
-#define STM32_GPIOD_BASE   (STM32_APB2PERIPH_BASE + 0x1400)
-#define STM32_GPIOE_BASE   (STM32_APB2PERIPH_BASE + 0x1800)
-#define STM32_GPIOF_BASE   (STM32_APB2PERIPH_BASE + 0x1C00)
-#define STM32_GPIOG_BASE   (STM32_APB2PERIPH_BASE + 0x2000)
-
 static const unsigned long io_base[] = {
STM32_GPIOA_BASE, STM32_GPIOB_BASE, STM32_GPIOC_BASE,
STM32_GPIOD_BASE, STM32_GPIOE_BASE, STM32_GPIOF_BASE,
-- 
1.9.1

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


[U-Boot] [PATCH 4/4] stm32: add support for stm32f7 & stm32f746 discovery board

2016-02-11 Thread Vikas Manocha
This patch adds support for stm32f7 family & stm32f746 board.

Signed-off-by: Vikas Manocha 
---
 arch/arm/include/asm/arch-stm32f7/gpio.h | 113 +++
 arch/arm/include/asm/arch-stm32f7/gpt.h  |  53 +++
 arch/arm/include/asm/arch-stm32f7/rcc.h  |  64 +
 arch/arm/include/asm/arch-stm32f7/stm32.h|  63 +
 arch/arm/include/asm/arch-stm32f7/stm32_defs.h   |  15 +++
 arch/arm/include/asm/arch-stm32f7/stm32_periph.h |  38 
 arch/arm/mach-stm32/Kconfig  |   4 +
 arch/arm/mach-stm32/Makefile |   1 +
 arch/arm/mach-stm32/stm32f7/Kconfig  |   8 ++
 arch/arm/mach-stm32/stm32f7/Makefile |   8 ++
 arch/arm/mach-stm32/stm32f7/clock.c  |  56 +++
 arch/arm/mach-stm32/stm32f7/timer.c  | 112 ++
 board/st/stm32f746-disco/Kconfig |  19 
 board/st/stm32f746-disco/MAINTAINERS |   6 ++
 board/st/stm32f746-disco/Makefile|   8 ++
 board/st/stm32f746-disco/stm32f746-disco.c   |  99 
 configs/stm32f746-disco_defconfig|   9 ++
 drivers/gpio/stm32_gpio.c|   6 +-
 include/configs/stm32f746-disco.h|  89 ++
 19 files changed, 768 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-stm32f7/gpio.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/gpt.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/rcc.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/stm32.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/stm32_defs.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/stm32_periph.h
 create mode 100644 arch/arm/mach-stm32/stm32f7/Kconfig
 create mode 100644 arch/arm/mach-stm32/stm32f7/Makefile
 create mode 100644 arch/arm/mach-stm32/stm32f7/clock.c
 create mode 100644 arch/arm/mach-stm32/stm32f7/timer.c
 create mode 100644 board/st/stm32f746-disco/Kconfig
 create mode 100644 board/st/stm32f746-disco/MAINTAINERS
 create mode 100644 board/st/stm32f746-disco/Makefile
 create mode 100644 board/st/stm32f746-disco/stm32f746-disco.c
 create mode 100644 configs/stm32f746-disco_defconfig
 create mode 100644 include/configs/stm32f746-disco.h

diff --git a/arch/arm/include/asm/arch-stm32f7/gpio.h 
b/arch/arm/include/asm/arch-stm32f7/gpio.h
new file mode 100644
index 000..2942cd9
--- /dev/null
+++ b/arch/arm/include/asm/arch-stm32f7/gpio.h
@@ -0,0 +1,113 @@
+/*
+ * (C) Copyright 2016
+ * Vikas Manocha, 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _STM32_GPIO_H_
+#define _STM32_GPIO_H_
+
+enum stm32_gpio_port {
+   STM32_GPIO_PORT_A = 0,
+   STM32_GPIO_PORT_B,
+   STM32_GPIO_PORT_C,
+   STM32_GPIO_PORT_D,
+   STM32_GPIO_PORT_E,
+   STM32_GPIO_PORT_F,
+   STM32_GPIO_PORT_G,
+   STM32_GPIO_PORT_H,
+   STM32_GPIO_PORT_I
+};
+
+enum stm32_gpio_pin {
+   STM32_GPIO_PIN_0 = 0,
+   STM32_GPIO_PIN_1,
+   STM32_GPIO_PIN_2,
+   STM32_GPIO_PIN_3,
+   STM32_GPIO_PIN_4,
+   STM32_GPIO_PIN_5,
+   STM32_GPIO_PIN_6,
+   STM32_GPIO_PIN_7,
+   STM32_GPIO_PIN_8,
+   STM32_GPIO_PIN_9,
+   STM32_GPIO_PIN_10,
+   STM32_GPIO_PIN_11,
+   STM32_GPIO_PIN_12,
+   STM32_GPIO_PIN_13,
+   STM32_GPIO_PIN_14,
+   STM32_GPIO_PIN_15
+};
+
+enum stm32_gpio_mode {
+   STM32_GPIO_MODE_IN = 0,
+   STM32_GPIO_MODE_OUT,
+   STM32_GPIO_MODE_AF,
+   STM32_GPIO_MODE_AN
+};
+
+enum stm32_gpio_otype {
+   STM32_GPIO_OTYPE_PP = 0,
+   STM32_GPIO_OTYPE_OD
+};
+
+enum stm32_gpio_speed {
+   STM32_GPIO_SPEED_2M = 0,
+   STM32_GPIO_SPEED_25M,
+   STM32_GPIO_SPEED_50M,
+   STM32_GPIO_SPEED_100M
+};
+
+enum stm32_gpio_pupd {
+   STM32_GPIO_PUPD_NO = 0,
+   STM32_GPIO_PUPD_UP,
+   STM32_GPIO_PUPD_DOWN
+};
+
+enum stm32_gpio_af {
+   STM32_GPIO_AF0 = 0,
+   STM32_GPIO_AF1,
+   STM32_GPIO_AF2,
+   STM32_GPIO_AF3,
+   STM32_GPIO_AF4,
+   STM32_GPIO_AF5,
+   STM32_GPIO_AF6,
+   STM32_GPIO_AF7,
+   STM32_GPIO_AF8,
+   STM32_GPIO_AF9,
+   STM32_GPIO_AF10,
+   STM32_GPIO_AF11,
+   STM32_GPIO_AF12,
+   STM32_GPIO_AF13,
+   STM32_GPIO_AF14,
+   STM32_GPIO_AF15
+};
+
+struct stm32_gpio_dsc {
+   enum stm32_gpio_portport;
+   enum stm32_gpio_pin pin;
+};
+
+struct stm32_gpio_ctl {
+   enum stm32_gpio_modemode;
+   enum stm32_gpio_otype   otype;
+   enum stm32_gpio_speed   speed;
+   enum stm32_gpio_pupdpupd;
+   enum stm32_gpio_af  af;
+};
+
+static inline unsigned stm32_gpio_to_port(unsigned gpio)
+{
+   return gpio / 16;
+}
+
+static inline unsigned stm32_gpio_to_pin(unsigned gpio)
+{
+   return gpio % 16;
+}
+
+int stm32_gpio_config(const struct stm32_gpio_dsc *gpio_dsc,
+   

[U-Boot] [PATCH 0/4] stm32: add stm32f7 family support

2016-02-11 Thread Vikas Manocha
This patchset:
- adds support for stm32f7 family.
- adds support for stm32f746 disco board.
- moves base addresses & clock config from stm32 gpio
  driver to soc area to be usable by stm32f7.

Vikas Manocha (4):
  gpio: stm32_gpio: move clock config from driver to board
  gpio: stm32_gpio: move base addresses to the soc file
  stm32x7: add support for stm32x7 serial driver
  stm32: add support for stm32f7 & stm32f746 discovery board

 arch/arm/include/asm/arch-stm32f1/stm32.h  |   8 ++
 arch/arm/include/asm/arch-stm32f4/stm32.h  |  10 ++
 arch/arm/include/asm/arch-stm32f4/stm32_periph.h   |  11 ++
 arch/arm/include/asm/arch-stm32f7/gpio.h   | 113 +
 arch/arm/include/asm/arch-stm32f7/gpt.h|  53 ++
 arch/arm/include/asm/arch-stm32f7/rcc.h|  64 
 arch/arm/include/asm/arch-stm32f7/stm32.h  |  63 
 arch/arm/include/asm/arch-stm32f7/stm32_defs.h |  15 +++
 .../{arch-stm32f4 => arch-stm32f7}/stm32_periph.h  |  11 ++
 arch/arm/mach-stm32/Kconfig|   4 +
 arch/arm/mach-stm32/Makefile   |   1 +
 arch/arm/mach-stm32/stm32f4/clock.c|  48 +
 arch/arm/mach-stm32/stm32f7/Kconfig|   8 ++
 arch/arm/mach-stm32/stm32f7/Makefile   |   8 ++
 arch/arm/mach-stm32/stm32f7/clock.c|  56 ++
 arch/arm/mach-stm32/stm32f7/timer.c| 112 
 board/st/stm32f429-discovery/stm32f429-discovery.c |   8 ++
 board/st/stm32f746-disco/Kconfig   |  19 
 board/st/stm32f746-disco/MAINTAINERS   |   6 ++
 board/st/stm32f746-disco/Makefile  |   8 ++
 board/st/stm32f746-disco/stm32f746-disco.c |  99 ++
 configs/stm32f746-disco_defconfig  |   9 ++
 drivers/gpio/stm32_gpio.c  |  29 +-
 drivers/serial/Makefile|   1 +
 drivers/serial/serial_stm32x7.c|  83 +++
 drivers/serial/serial_stm32x7.h|  37 +++
 include/configs/stm32f746-disco.h  |  89 
 include/dm/platform_data/serial_stm32x7.h  |  17 
 28 files changed, 964 insertions(+), 26 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-stm32f7/gpio.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/gpt.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/rcc.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/stm32.h
 create mode 100644 arch/arm/include/asm/arch-stm32f7/stm32_defs.h
 copy arch/arm/include/asm/{arch-stm32f4 => arch-stm32f7}/stm32_periph.h (71%)
 create mode 100644 arch/arm/mach-stm32/stm32f7/Kconfig
 create mode 100644 arch/arm/mach-stm32/stm32f7/Makefile
 create mode 100644 arch/arm/mach-stm32/stm32f7/clock.c
 create mode 100644 arch/arm/mach-stm32/stm32f7/timer.c
 create mode 100644 board/st/stm32f746-disco/Kconfig
 create mode 100644 board/st/stm32f746-disco/MAINTAINERS
 create mode 100644 board/st/stm32f746-disco/Makefile
 create mode 100644 board/st/stm32f746-disco/stm32f746-disco.c
 create mode 100644 configs/stm32f746-disco_defconfig
 create mode 100644 drivers/serial/serial_stm32x7.c
 create mode 100644 drivers/serial/serial_stm32x7.h
 create mode 100644 include/configs/stm32f746-disco.h
 create mode 100644 include/dm/platform_data/serial_stm32x7.h

-- 
1.9.1

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


[U-Boot] [PATCH 1/4] gpio: stm32_gpio: move clock config from driver to board

2016-02-11 Thread Vikas Manocha
This patch removes the gpio clock enable from gpio driver & move it in the
board code, making it possible to use the gpio driver with other socs.

Signed-off-by: Vikas Manocha 
---
 arch/arm/include/asm/arch-stm32f4/stm32_periph.h   | 11 +
 arch/arm/mach-stm32/stm32f4/clock.c| 48 ++
 board/st/stm32f429-discovery/stm32f429-discovery.c |  8 
 drivers/gpio/stm32_gpio.c  |  5 ---
 4 files changed, 67 insertions(+), 5 deletions(-)

diff --git a/arch/arm/include/asm/arch-stm32f4/stm32_periph.h 
b/arch/arm/include/asm/arch-stm32f4/stm32_periph.h
index a1af25c..38adc4e 100644
--- a/arch/arm/include/asm/arch-stm32f4/stm32_periph.h
+++ b/arch/arm/include/asm/arch-stm32f4/stm32_periph.h
@@ -22,6 +22,17 @@ enum periph_id {
 enum periph_clock {
USART1_CLOCK_CFG = 0,
USART2_CLOCK_CFG,
+   GPIO_A_CLOCK_CFG,
+   GPIO_B_CLOCK_CFG,
+   GPIO_C_CLOCK_CFG,
+   GPIO_D_CLOCK_CFG,
+   GPIO_E_CLOCK_CFG,
+   GPIO_F_CLOCK_CFG,
+   GPIO_G_CLOCK_CFG,
+   GPIO_H_CLOCK_CFG,
+   GPIO_I_CLOCK_CFG,
+   GPIO_J_CLOCK_CFG,
+   GPIO_K_CLOCK_CFG,
 };
 
 #endif /* __ASM_ARM_ARCH_PERIPH_H */
diff --git a/arch/arm/mach-stm32/stm32f4/clock.c 
b/arch/arm/mach-stm32/stm32f4/clock.c
index 576d3e6..631f36a 100644
--- a/arch/arm/mach-stm32/stm32f4/clock.c
+++ b/arch/arm/mach-stm32/stm32f4/clock.c
@@ -71,6 +71,21 @@
 #define FLASH_ACR_ICEN (1 << 9)
 #define FLASH_ACR_DCEN (1 << 10)
 
+/*
+ * RCC GPIO specific definitions
+ */
+#define RCC_ENR_GPIO_A_EN  (1 << 0)
+#define RCC_ENR_GPIO_B_EN  (1 << 1)
+#define RCC_ENR_GPIO_C_EN  (1 << 2)
+#define RCC_ENR_GPIO_D_EN  (1 << 3)
+#define RCC_ENR_GPIO_E_EN  (1 << 4)
+#define RCC_ENR_GPIO_F_EN  (1 << 5)
+#define RCC_ENR_GPIO_G_EN  (1 << 6)
+#define RCC_ENR_GPIO_H_EN  (1 << 7)
+#define RCC_ENR_GPIO_I_EN  (1 << 8)
+#define RCC_ENR_GPIO_J_EN  (1 << 9)
+#define RCC_ENR_GPIO_K_EN  (1 << 10)
+
 struct pll_psc {
u8  pll_m;
u16 pll_n;
@@ -237,6 +252,39 @@ void clock_setup(int peripheral)
case USART1_CLOCK_CFG:
setbits_le32(_RCC->apb2enr, RCC_ENR_USART1EN);
break;
+   case GPIO_A_CLOCK_CFG:
+   setbits_le32(_RCC->ahb1enr, RCC_ENR_GPIO_A_EN);
+   break;
+   case GPIO_B_CLOCK_CFG:
+   setbits_le32(_RCC->ahb1enr, RCC_ENR_GPIO_B_EN);
+   break;
+   case GPIO_C_CLOCK_CFG:
+   setbits_le32(_RCC->ahb1enr, RCC_ENR_GPIO_C_EN);
+   break;
+   case GPIO_D_CLOCK_CFG:
+   setbits_le32(_RCC->ahb1enr, RCC_ENR_GPIO_D_EN);
+   break;
+   case GPIO_E_CLOCK_CFG:
+   setbits_le32(_RCC->ahb1enr, RCC_ENR_GPIO_E_EN);
+   break;
+   case GPIO_F_CLOCK_CFG:
+   setbits_le32(_RCC->ahb1enr, RCC_ENR_GPIO_F_EN);
+   break;
+   case GPIO_G_CLOCK_CFG:
+   setbits_le32(_RCC->ahb1enr, RCC_ENR_GPIO_G_EN);
+   break;
+   case GPIO_H_CLOCK_CFG:
+   setbits_le32(_RCC->ahb1enr, RCC_ENR_GPIO_H_EN);
+   break;
+   case GPIO_I_CLOCK_CFG:
+   setbits_le32(_RCC->ahb1enr, RCC_ENR_GPIO_I_EN);
+   break;
+   case GPIO_J_CLOCK_CFG:
+   setbits_le32(_RCC->ahb1enr, RCC_ENR_GPIO_J_EN);
+   break;
+   case GPIO_K_CLOCK_CFG:
+   setbits_le32(_RCC->ahb1enr, RCC_ENR_GPIO_K_EN);
+   break;
default:
break;
}
diff --git a/board/st/stm32f429-discovery/stm32f429-discovery.c 
b/board/st/stm32f429-discovery/stm32f429-discovery.c
index fb8475f..d16d73f 100644
--- a/board/st/stm32f429-discovery/stm32f429-discovery.c
+++ b/board/st/stm32f429-discovery/stm32f429-discovery.c
@@ -50,6 +50,7 @@ int uart_setup_gpio(void)
int i;
int rv = 0;
 
+   clock_setup(GPIO_A_CLOCK_CFG);
for (i = 0; i < ARRAY_SIZE(usart_gpio); i++) {
rv = stm32_gpio_config(_gpio[i], _ctl_usart);
if (rv)
@@ -115,6 +116,13 @@ static int fmc_setup_gpio(void)
int rv = 0;
int i;
 
+   clock_setup(GPIO_B_CLOCK_CFG);
+   clock_setup(GPIO_C_CLOCK_CFG);
+   clock_setup(GPIO_D_CLOCK_CFG);
+   clock_setup(GPIO_E_CLOCK_CFG);
+   clock_setup(GPIO_F_CLOCK_CFG);
+   clock_setup(GPIO_G_CLOCK_CFG);
+
for (i = 0; i < ARRAY_SIZE(ext_ram_fmc_gpio); i++) {
rv = stm32_gpio_config(_ram_fmc_gpio[i],
_ctl_fmc);
diff --git a/drivers/gpio/stm32_gpio.c b/drivers/gpio/stm32_gpio.c
index 75a84e1..9f9ff48 100644
--- a/drivers/gpio/stm32_gpio.c
+++ b/drivers/gpio/stm32_gpio.c
@@ -70,8 +70,6 @@ int stm32_gpio_config(const struct stm32_gpio_dsc *dsc,
 
gpio_regs = (struct stm32_gpio_regs *)io_base[dsc->port];
 
-   setbits_le32(_RCC->ahb1enr, 1 << dsc->port);
-
i = (dsc->pin & 

[U-Boot] [PATCH v3] imx: imx7 Support for Manufacturing Protection

2016-02-11 Thread Ulises Cardenas
i.MX7 has an a protection feature for Manufacturing process.
This feature uses assymetric encryption to sign and verify
authenticated software handled between parties. This command
enables the use of such feature.

The private key is unique and generated once per device.
And it is stored in secure memory and only accessible by CAAM.
Therefore, the public key generation and signature functions
are the only functions available for the user.

Command usage:

Print the public key for the device.
- mfgprot pubk

Generates Signature over given data.
- mfgprot sign 

Signed-off-by: Raul Ulises Cardenas 
---

Changes for v2:
- removed genenerate_mppubk and generate_mpsign
due to redundancy

Changes for v3:
- typo correction description
- extended mfgprot command from an MPSing function example to a fully
functional command, providing the ability of signing given data

 arch/arm/imx-common/Makefile  |   1 +
 arch/arm/imx-common/cmd_mfgprot.c | 102 
 drivers/crypto/fsl/Makefile   |   4 +
 drivers/crypto/fsl/fsl_mfgprot.c  | 236 ++
 include/fsl_sec.h |  45 +++-
 5 files changed, 387 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/imx-common/cmd_mfgprot.c
 create mode 100644 drivers/crypto/fsl/fsl_mfgprot.c

diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index e7190c3..8563150 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -22,6 +22,7 @@ ifeq ($(SOC),$(filter $(SOC),mx7))
 obj-y  += cpu.o
 obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
 obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
+obj-$(CONFIG_CMD_MFGPROT) += cmd_mfgprot.o
 endif
 ifeq ($(SOC),$(filter $(SOC),mx6 mx7))
 obj-y  += cache.o init.o
diff --git a/arch/arm/imx-common/cmd_mfgprot.c 
b/arch/arm/imx-common/cmd_mfgprot.c
new file mode 100644
index 000..3a6e7cb
--- /dev/null
+++ b/arch/arm/imx-common/cmd_mfgprot.c
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2016 NXP Semiconductors.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * Command for manufacturing protection
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/**
+ * do_mfgprot() - Handle the "mfgprogt" command-line command
+ * @cmdtp:  Command data struct pointer
+ * @flag:   Command flag
+ * @argc:   Command-line argument count
+ * @argv:   Array of command-line arguments
+ *
+ * Returns zero on success, CMD_RET_USAGE in case of misuse and negative
+ * on error.
+ */
+static int do_mfgprot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+{
+   uint32_t m_addr, dgst_addr, c_addr, d_addr;
+   u8 *m_ptr, *dgst_ptr, *c_ptr, *d_ptr;
+   int m_size;
+   int ret;
+   char *pubk, *sign, *sel;
+
+   pubk = "pubk";
+   sign = "sign";
+   sel = argv[1];
+
+   ret = 0;
+
+   /* Enable HAB clock */
+   u32 jr_size = 4;
+   u32 out_jr_size = sec_in32(CONFIG_SYS_FSL_JR0_ADDR + 0x102c);
+   if (out_jr_size != jr_size) {
+   hab_caam_clock_enable(1);
+   sec_init();
+   }
+
+   if (strcmp(sel, pubk) == 0) {
+   ret = gen_mppubk();
+   } else if (strcmp(sel, sign) == 0) {
+   if (argc != 7)
+   return CMD_RET_USAGE;
+
+   m_addr = simple_strtoul(argv[2], NULL, 16);
+   m_size = simple_strtoul(argv[3], NULL, 10);
+   dgst_addr = simple_strtoul(argv[4], NULL, 16);
+   c_addr = simple_strtoul(argv[5], NULL, 16);
+   d_addr = simple_strtoul(argv[6], NULL, 16);
+
+
+   m_ptr = map_physmem(m_addr, m_size, MAP_NOCACHE);
+   dgst_ptr = map_physmem(dgst_addr, HAB_MES_RESP_DGST_BYTES,
+   MAP_NOCACHE);
+   c_ptr = map_physmem(c_addr, HAB_ENG_MFG_PRVK_BYTES,
+   MAP_NOCACHE);
+   d_ptr = map_physmem(d_addr, HAB_ENG_MFG_PRVK_BYTES,
+   MAP_NOCACHE);
+
+   memset(dgst_ptr, 0, HAB_MES_RESP_DGST_BYTES);
+   memset(c_ptr, 0, HAB_ENG_MFG_PRVK_BYTES);
+   memset(d_ptr, 0, HAB_ENG_MFG_PRVK_BYTES);
+
+   ret = sign_mppubk(m_ptr, m_size, dgst_ptr, c_ptr, d_ptr);
+   } else {
+   return CMD_RET_USAGE;
+   }
+
+   unmap_sysmem(m_ptr);
+   unmap_sysmem(dgst_ptr);
+   unmap_sysmem(c_ptr);
+   unmap_sysmem(d_ptr);
+
+   return ret;
+}
+
+/***/
+static char mfgprot_help_text[] =
+   "Usage:\n"
+"Print the public key for Manufacturing Protection\n"
+"\tmfgprot pubk\n"
+"Generates a Manufacturing Protection signature\n"
+"\tmfgprot sign ";
+
+U_BOOT_CMD(
+   mfgprot, 7, 1, do_mfgprot,
+   "Manufacturing Protection\n",
+   mfgprot_help_text
+);
diff --git 

Re: [U-Boot] [PATCH 2/2] video: tegra: Enable the 'lcd' env variable work-around

2016-02-11 Thread Anatolij Gustschin
On Sat,  6 Feb 2016 14:31:38 -0700
Simon Glass s...@chromium.org wrote:

> Enable this option on all tegra boards.
> 
> Signed-off-by: Simon Glass 
> ---
> 
>  arch/arm/mach-tegra/Kconfig | 1 +
>  1 file changed, 1 insertion(+)

applied to u-boot-video/master, thanks!

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


[U-Boot] Pull request: u-boot-video/master

2016-02-11 Thread Anatolij Gustschin
Hi Tom,

The following changes since commit 94985cc9d3d7ed991ca8b2627d5894df5ea68f49:

  Merge branch 'master' of git://git.denx.de/u-boot-usb (2016-02-04 06:56:23 
-0500)

are available in the git repository at:


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

for you to fetch changes up to 6c88b51305d69b9728c56f27f363530a7f3d7e83:

  video: tegra: Enable the 'lcd' env variable work-around (2016-02-11 21:39:38 
+0100)


Simon Glass (2):
  dm: video: Add a temporary work-around for old stdout var
  video: tegra: Enable the 'lcd' env variable work-around

Stephen Warren (1):
  video: bcm2835: use bus_to_phys() on FB address

 arch/arm/mach-tegra/Kconfig |1 +
 common/console.c|8 
 drivers/video/Kconfig   |   10 ++
 drivers/video/bcm2835.c |4 +++-
 4 files changed, 22 insertions(+), 1 deletion(-)

Please pull. Thanks!

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


Re: [U-Boot] [PATCH] arm: socfpga: Enable ethernet PHY configuration to RGMII again

2016-02-11 Thread Marek Vasut
On 02/11/2016 09:28 PM, Simon Glass wrote:
> Hi,
> 
> On 11 February 2016 at 08:54, Stefan Roese  wrote:
>> On 11.02.2016 16:49, Marek Vasut wrote:
>>>
>>> On 02/11/2016 04:45 PM, Stefan Roese wrote:

 With commit c32a6fd0 [net: Don't call board/cpu_eth_init() with driver
 model], cpu_eth_init() is not called on SoCFPGA any more. Since this
 function configures the internal PHY interface to RGMII (via the physel_X
 bits), its still needed. So lets rename this function and call it in
 arch_early_init_r().

 Tested on socfpga_sr1500.

 Signed-off-by: Stefan Roese 
 Cc: Simon Glass 
 Cc: Dinh Nguyen 
 Cc: Marek Vasut 
 ---
   arch/arm/mach-socfpga/misc.c | 6 +-
   1 file changed, 5 insertions(+), 1 deletion(-)

 diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
 index 9b43b92..2b1cd4a 100644
 --- a/arch/arm/mach-socfpga/misc.c
 +++ b/arch/arm/mach-socfpga/misc.c
 @@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int
 of_reset_id)
 socfpga_per_reset(reset, 0);
   }
>>>
>>>
>>> I just sent and applied very similar patch, can you try
>>> u-boot-socfpga/master and see if it works for you?
>>
>>
>> Done and works just fine. So please feel free to upstream your patch
>> version.
> 
> Can this be done in the driver? You have a device tree representation
> I think. If you are using the compat list in fdtdec.c then it suggests
> that you need a driver.

Does u-boot DM already have the ability to handle resets of various IP
blocks on the chip ? I don't think so, so for now I'll opt for fixing
this breakage.

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


Re: [U-Boot] [PATCH v2 16/26] dm: tegra: net: Convert tegra boards to driver model for Ethernet

2016-02-11 Thread Stephen Warren

On 12/13/2015 08:46 PM, Simon Glass wrote:

Applied to u-boot-dm/next.


I've found another strange problem, at least triggered/exposed by this 
patch:


On at least either Dalmore or Jetson TK1, using USB Ethernet (hence with 
RTL8169 support disabled in include/configs/jetson-tk1.h[1]), I find 
that if I execute the following commands at or after this patch, then 
the system reboots during DHCP operation:


save mmc 1:1 $loadaddr /dfu_dummy.bin 0x3c0
usb start
setenv autoload no
dhcp

yields:


Tegra124 (Jetson TK1) # dhcp
Waiting for Ethernet connection... done.
BOOTP broadcast 1
DHCP client bound to address 10.20.204.50 (1 ms)
data abort
pc : []lr : []
reloc pc : [<801291d4>]  lr : [<80113fd0>]
sp : fda4e720  ip : 450088df fp : fda60048
r10: fffa4fe3  r9 : fda53ee0 r8 : 
r7 :   r6 :  r5 :   r4 : fda60048
r3 : 0383  r2 :  r1 :   r0 : e10f354b
Flags: NzCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...


However, if I execute those commands at the commit before this patch, 
then everything is OK.


The "save" command is definitely required to trigger this issue. The 
partition being saved to is a 1024MiB ext4 filesystem that's almost 
empty. If I omit the save, or save to a 1024MiB FAT filesystem instead, 
there's no error. This leads me to suspect some kind of memory 
corruption rather than a direct problem with this patch. Due to ext4 
interaction, also CCing Łukasz in case he has any quick ideas.


I'll go track down the PC where the error occurs and try and add some 
debug spew etc. to see what's up. Any other ideas appreciated though.


(This is the problem with writing test systems; they show up bugs!)



[1] i.e. I have this change made locally so that no PCIe Ethernet device 
exists, which causes the USB Ethernet to be used by default:


diff --git a/include/configs/jetson-tk1.h b/include/configs/jetson-tk1.h
index 23b2e436167c..af26b055b70b 100644
--- a/include/configs/jetson-tk1.h
+++ b/include/configs/jetson-tk1.h
@@ -62,7 +62,6 @@
 #define CONFIG_CMD_PCI

 /* PCI networking support */
-#define CONFIG_RTL8169

 /* General networking support */
 #define CONFIG_CMD_DHCP

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


Re: [U-Boot] [PATCH 1/2] dm: video: Add a temporary work-around for old stdout var

2016-02-11 Thread Anatolij Gustschin
Hi Simon,

On Sat,  6 Feb 2016 14:31:37 -0700
Simon Glass s...@chromium.org wrote:

> Boards with a saved environment may use 'lcd' in their stdout environment
> variable, expecting that this will enable output to the LCD. When the board
> moves to use driver model for video, this will no-longer work. Add a
> work-around to fix this. A warning messages is printed, and we will remove
> the work-around at the end of 2016.
> 
> Signed-off-by: Simon Glass 
> ---
> 
>  common/console.c  |  8 
>  drivers/video/Kconfig | 10 ++
>  2 files changed, 18 insertions(+)

applied to u-boot-video/master, thanks!

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


[U-Boot] [PATCH] OMAP3SOM BOARD: Auto detect Logic PD Models

2016-02-11 Thread Adam Ford
Logic PD makes four different system on modules.  This patch will auto
detect the board type and identify the corresponding device tree image.

Signed-off-by: Adam Ford 
---

 board/logicpd/omap3som/omap3logic.c | 20 
 include/configs/omap3_logic.h   |  2 +-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/board/logicpd/omap3som/omap3logic.c 
b/board/logicpd/omap3som/omap3logic.c
index b5c44f9..86f4196 100644
--- a/board/logicpd/omap3som/omap3logic.c
+++ b/board/logicpd/omap3som/omap3logic.c
@@ -228,6 +228,26 @@ int board_init(void)
return 0;
 }
 
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
+{
+   switch (gd->bd->bi_arch_number) {
+   case MACH_TYPE_DM3730_TORPEDO:
+   setenv("fdtimage", "logicpd-torpedo-37xx-devkit.dtb");
+   break;
+   case MACH_TYPE_DM3730_SOM_LV:
+   setenv("fdtimage", "logicpd-som-lv-37xx-devkit.dtb");
+   break;
+   case MACH_TYPE_OMAP3_TORPEDO:
+   setenv("fdtimage", "logicpd-torpedo-35xx-devkit.dtb");
+   break;
+   case MACH_TYPE_OMAP3530_LV_SOM:
+   setenv("fdtimage", "logicpd-som-lv-35xx-devkit.dtb");
+   break;
+   }
+}
+#endif
+
 #if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
 int board_mmc_init(bd_t *bis)
 {
diff --git a/include/configs/omap3_logic.h b/include/configs/omap3_logic.h
index fba2a12..0fc9d1c 100644
--- a/include/configs/omap3_logic.h
+++ b/include/configs/omap3_logic.h
@@ -40,7 +40,7 @@
 
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
-
+#define CONFIG_BOARD_LATE_INIT
 #define CONFIG_MISC_INIT_R /* misc_init_r dumps the die id */
 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS
-- 
1.9.1

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


Re: [U-Boot] [PATCH 19/26] mkimage: Support adding device tree files to a FIT

2016-02-11 Thread Tom Rini
On Thu, Jan 28, 2016 at 09:39:39AM -0700, Simon Glass wrote:

> To make the auto-FIT feature useful we need to be able to provide a list of
> device tree files on the command line for mkimage to add into the FIT. Add
> support for this feature.
[snip]
> +.BI "\-b
> +Specifies that the following arguments are device tree binary files (.dtb).
> +
> +.TP
>  .BI "\-c [" "comment" "]"
>  Specifies a comment to be added when signing. This is typically a useful
>  message which describes how the image was signed or some other useful
> @@ -125,6 +129,10 @@ This can be used to sign images with additional keys 
> after initial image
>  creation.
>  
>  .TP
> +.BI "\-i
> +Specifies that the following arguments are image files.
> +
> +.TP
>  .BI "\-k [" "key_directory" "]"
>  Specifies the directory containing keys to use for signing. This directory
>  should contain a private key file .key for use with signing and a
> @@ -191,6 +199,15 @@ is required.
>  .br
>  .B -c """Kernel 4.4 image for production devices""" -d vmlinuz kernel.itb
>  .fi
> +.P
> +Create a FIT image containing a kernel and some device tree files, using
> +automatic mode. No .its file is required.
> +.nf
> +.B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e0 -e 0 
> +.br
> +.B -c """Kernel 4.4 image for production devices""" -d vmlinuz 
> +.B -b rk3288-firefly.dts rk3288-jerry.dts -i kernel.itb
> +.fi

OK, I'm confused in a few ways here.  First, we don't need quotes around
the space separated list of dts files?  Second, we need dts not dtb?
Third, I think this would be a better example if (as I suspect we need
really) it was a full path to the output rather than assuming that we've
copied the files to $PWD.  Fourth, -i is inputs or outputs?  The help
reads like inputs and is where I assume we would say vmlinuz here and
not use -d and then end with our output of kernel.itb.  Thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] arm: socfpga: Fix ethernet reset handling

2016-02-11 Thread Dinh Nguyen


On 02/11/2016 09:53 AM, Stefan Roese wrote:
> On 11.02.2016 16:41, Marek Vasut wrote:
>> The following patch caused cpu_eth_init() to not be called anymore
>> for DM-capable boards:
>>
>> commit c32a6fd07b1839e4a45729587ebc8e1c55601a4d
>> Date:   Sun Jan 17 14:51:56 2016 -0700
>>  net: Don't call board/cpu_eth_init() with driver model
>>
>> This breaks ethernet on SoCFPGA, since we use that function to un-reset
>> the ethernet blocks. Invoke the ethernet reset function from
>> arch_misc_init()
>> instead to fix the breakage.
>>
>> Signed-off-by: Marek Vasut 
>> Cc: Dinh Nguyen 
>> Cc: Chin Liang See 
>> Cc: Denis Bakhvalov 
> 
> Works for me as well. So:
> 
> Tested-by: Stefan Roese 
> 

For me as well.

Tested-by: Dinh Nguyen 

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


Re: [U-Boot] [PATCH 3/4] spi: omap3: Convert to DM

2016-02-11 Thread Jagan Teki
On 11 February 2016 at 20:31, Jagan Teki  wrote:
> On 11 February 2016 at 02:30, Christophe Ricard
>  wrote:
>> Hi Jagan,
>>
>> My understanding is that some work are ongoing around spl in order to
>> support correctly DM for all spi/i2c bus drivers.
>> As a consequence patch 4 got differed.
>>
>> Hopefully Simon or Tom can comment.
>>
>> Are you ok in applying patch 1 and 2 only ? or should i send a new serie
>> with only patch 1 and 2 ?
>
> 3/4 looks not good to me with so many ifdef, may we can do something
> clear similar to kirkwood_spi does.

I did some dm conversion on these long back which looks similar like
kirkwood_spi, will post them as well so-that we can discuss.

>
>>
>> On 10/02/2016 20:16, Jagan Teki wrote:
>>>
>>> On 8 February 2016 at 23:26, Jagan Teki  wrote:

 On 8 February 2016 at 23:10, Tom Rini  wrote:
>
> On Sat, Feb 06, 2016 at 11:27:21PM +0100, Christophe Ricard wrote:
>>
>> Hi Simon, Tom,
>>
>> I assume the approach you are taking is also valuable for the i2c:
>> omap24xx patch serie:
>> http://lists.denx.de/pipermail/u-boot/2016-January/241676.html
>>
>> What are your recommendation about the pending patches ?
>> Should i send back only the one not taking care of the DM conversion
>> and send another serie later ?
>>
>> I have seen some work ongoing on this topic on the u-boot-fdt tree
>> on the spl-working branch.
>> Is there a more accurate place to follow this work ?
>
> For i2c, aside from needing to defer removing the non-DM code for a
> while yet, there were some review comments to address in a v2 or answer
> as intentional.  For SPI, it's all looking good and I'm assuming Jagan
> will have a SPI PR soon.  Thanks!

 Yes, by this week-end.
>>>
>>> Any idea 4/4 got differed in patchwork [1], do we have next version
>>> patches for these?
>>>
>>> [1] https://patchwork.ozlabs.org/patch/569241/
>>>
>> On 26/01/2016 02:55, Peng Fan wrote:
>>>
>>> Hi Simon,
>>>
>>> On Mon, Jan 25, 2016 at 06:11:24PM -0700, Simon Glass wrote:

 +Hans

 Hi Tom,

 On 21 January 2016 at 05:24, Tom Rini  wrote:
>
> On Wed, Jan 20, 2016 at 07:46:15PM -0700, Simon Glass wrote:
>>
>> +Mugunthan, Tom
>>
>> On 17 January 2016 at 03:56, Christophe Ricard
>>  wrote:
>>>
>>> Convert omap3_spi driver to DM and keep compatibility with
>>> previous
>>> mode.
>>>
>>> Signed-off-by: Christophe Ricard 
>>> ---
>>>
>>>   drivers/spi/Kconfig |   6 +
>>>   drivers/spi/omap3_spi.c | 439
>>> ++--
>>>   drivers/spi/omap3_spi.h |  14 +-
>>>   3 files changed, 402 insertions(+), 57 deletions(-)
>>
>> This is a pretty painful conversion, with lots of #ifdefs. I think
>> it
>> would be possible to use a common pointer type and reduce this.
>>
>> But perhaps it does not matter - how long must we be in the state
>> of
>> supporting legacy SPI? Can we convert all TI boards to driver
>> model?
>
> We _really_ need some way to support more than one board per binary
> before we can move everything to DM only.
>
> I think we can kind of do this today if we stick to using platform
> data
> for everything that's board-specific rather than SoC-defined.  What
> we
> talked about at ELCE was auto-generating the pdata from the device
> tree,
> I think.

 We discussed this on IRC but since that doesn't exist as far as the
 mailing list is concerned...

 The current plan is:

 - Adjust build system to optionally build a u-boot.img in FIT format
 that includes the U-Boot binary and >1 device tree files
 - Adjust SPL to load this
 - Add a way for SPL to determine which device tree to select (by
 calling a board-specific function)
 - Have SPL pass this selected device tree to U-Boot when it starts
>>>
>>> Can dtb be sperated from the final u-boot.img, if using SPL?
>>> I mean let SPL load the u-boot.img and the dtb to correct DRAM
>>> address.
>>> And the dtb is shared with linux kernel.
>>>
>>> Regards,
>>> Peng.

 Thus we should be able to support more than one board with a single
 U-Boot image. Of course this is not a perfect solution (e.g. it is
 inefficient since the DTs are likely to be largely the same) but it
 should be a good first step.

 I'm going to try this 

Re: [U-Boot] Falcon mode for TI DM355

2016-02-11 Thread Tom Rini
On Thu, Feb 11, 2016 at 11:53:06AM -, Andy Pont wrote:

> Hello TI experts,
> 
> I appreciate that all of the TI DM355 support long since (August 2015)
> landed in the great board scrap yard in the sky or wherever it is git
> chooses to hide it!
> 
> I may have an upcoming project to reduce boot time on a pre-existing custom
> platform using the DM355 and wondered if anyone had implemented SPL and
> Falcon mode for it that didn't make it into mainline or whether this is
> actually possible at all for this device?

So, git commit 6761946f is what removed the board in question.  Now,
looking in mainline today (and also looking at 6761946f) I see that we
had and have support for CONFIG_TARGET_OMAPL138_LCDK and that uses SPL
which is a prerequisite for falcon mode.  So there's nothing too low
level that would need to be done for the DM355, just the board specific
portions.

-- 
Tom


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


Re: [U-Boot] Falcon mode for TI DM355

2016-02-11 Thread Andy Pont
Hi Tom,

> So, git commit 6761946f is what removed the board in question.  Now,
> looking in mainline today (and also looking at 6761946f) I see that we
> had and have support for CONFIG_TARGET_OMAPL138_LCDK and that uses SPL
> which is a prerequisite for falcon mode.  So there's nothing too low
> level that would need to be done for the DM355, just the board specific
> portions.

The current implementation for the target hardware is based on 2013.07.  Can
we make it work with that or should we look to move to something more
recent?  Not wanting to make too many changes unnecessarily.

Andy.

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


Re: [U-Boot] [PATCH] arm: socfpga: Remove bashisms from qts filter

2016-02-11 Thread Tom Rini
On Thu, Feb 11, 2016 at 04:40:59PM +0100, Marek Vasut wrote:

> Weed out bashisms from the script. The echo -e does not work in dash,
> which is the default /bin/sh in debian .
> 
> Signed-off-by: Marek Vasut 
> Cc: Dinh Nguyen 
> Cc: Chin Liang See 
> Cc: Dalon Westergreen 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] Falcon mode for TI DM355

2016-02-11 Thread Tom Rini
On Thu, Feb 11, 2016 at 05:02:16PM -, Andy Pont wrote:
> Hi Tom,
> 
> > So, git commit 6761946f is what removed the board in question.  Now,
> > looking in mainline today (and also looking at 6761946f) I see that we
> > had and have support for CONFIG_TARGET_OMAPL138_LCDK and that uses SPL
> > which is a prerequisite for falcon mode.  So there's nothing too low
> > level that would need to be done for the DM355, just the board specific
> > portions.
> 
> The current implementation for the target hardware is based on 2013.07.  Can
> we make it work with that or should we look to move to something more
> recent?  Not wanting to make too many changes unnecessarily.

Well, I don't see OMAPL138_LCDK support in mainline v2013.07 so this is
going to fall into the kind of judgement calls you'll have to make and
investigate further.

-- 
Tom


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


[U-Boot] Falcon mode for TI DM355

2016-02-11 Thread Andy Pont
Hello TI experts,

I appreciate that all of the TI DM355 support long since (August 2015)
landed in the great board scrap yard in the sky or wherever it is git
chooses to hide it!

I may have an upcoming project to reduce boot time on a pre-existing custom
platform using the DM355 and wondered if anyone had implemented SPL and
Falcon mode for it that didn't make it into mainline or whether this is
actually possible at all for this device?

Thanks,

Andy.

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


Re: [U-Boot] [Patch V3 2/3] fm: fdt: Move fman ucode fixup to Fman driver code

2016-02-11 Thread york sun
On 02/08/2016 11:25 AM, Scott Wood wrote:
> On Mon, 2016-02-08 at 19:22 +, york sun wrote:
>> On 02/08/2016 11:18 AM, Scott Wood wrote:
>>> On Mon, 2016-02-08 at 19:03 +, york sun wrote:
 On 02/01/2016 09:06 AM, york sun wrote:
> On 01/25/2016 09:40 PM, Qianyu Gong wrote:
>>
>>> -Original Message-
>>> From: Scott Wood [mailto:o...@buserror.net]
>>> Sent: Tuesday, January 26, 2016 1:17 AM
>>> To: Qianyu Gong ; u-boot@lists.denx.de
>>> Cc: b07...@freescale.com; Shaohui Xie 
>>> Subject: Re: [U-Boot] [Patch V3 2/3] fm: fdt: Move fman ucode
>>> fixup to
>>> Fman
>>> driver code
>>>
>>> On Mon, 2016-01-25 at 19:37 +0800, Gong Qianyu wrote:
 Both Freescale Layerscape and powerpc/mpc85xx platforms are
 using
 fdt_fixup_fman_firmware() to insert Fman ucode blob into the
 device
 tree. So move the function to driver code.

 Signed-off-by: Gong Qianyu 
 ---
 V3:
  - Remove file changes about "qe.h".
(Should be put in the first patch of this patchset)
 V2:
  - New patch.

  arch/powerpc/cpu/mpc85xx/fdt.c | 125
 ++
 -
  drivers/net/fm/Makefile|   1 +
  drivers/net/fm/fdt.c   | 129
 +
  include/fsl_fman.h |   1 +
  4 files changed, 136 insertions(+), 120 deletions(-)
>>>
>>> Again, pass -M -C to git format-patch.
>>>
>>> -Scott
>>
>> I don't understand but I've already used "git format-patch -M -C -
>> -stat
>> ...".
>>
>
> Scott means using -M and -C, git should detect the moving instead of
> adding and
> deleting the same code. Try to add --find-copies-harder to see if it
> generates a
> smaller patch.
>

 Qianyu,

 Since you are on holiday, I tried it for you. Adjusting "-M -C" doesn't
 work.
 Even you are moving the function from one file to another, "git format
 -patch"
 cannot detect the moving because both files exist before and after this
 change,
 and the change set is not significant enough to be detected.
>>>
>>> It looks like the patch is creating drivers/net/fm/fdt.c...
>>>

Actually you were right. This patch creates a new file. There are also other
small changes here and there. Maybe that's the reason git doesn't detect the 
move.

Anyway, let me know if you have further comment. I am testing these patches.

York

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


[U-Boot] [PATCH] test/py: put "Starting U-Boot" into separate log section

2016-02-11 Thread Stephen Warren
From: Stephen Warren 

The initial boot of U-Boot happens within the context of the first test
that needs to access the U-Boot console when there is no existing
connection. This keeps all activity nestled within test execution, which
fits well into the pytest model. However, this mingles the U-Boot startup
logs with the execution of some test(s), which hides find the boundary
between the two.

To solve this, wrap the "Starting U-Boot" logic into a separate log
section. If the user wishes, they can simply collapse this log section
when viewing the HTML log, to concentrate purely on the test's own
interaction.

Signed-off-by: Stephen Warren 
---
 test/py/u_boot_console_base.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py
index 58575704adf5..bc2bd767e40e 100644
--- a/test/py/u_boot_console_base.py
+++ b/test/py/u_boot_console_base.py
@@ -293,8 +293,8 @@ class ConsoleBase(object):
 if self.p:
 return
 try:
+self.log.start_section('Starting U-Boot')
 self.at_prompt = False
-self.log.action('Starting U-Boot')
 self.p = self.get_spawn()
 # Real targets can take a long time to scroll large amounts of
 # text if LCD is enabled. This value may need tweaking in the
@@ -329,6 +329,8 @@ class ConsoleBase(object):
 self.log.error(str(ex))
 self.cleanup_spawn()
 raise
+finally:
+self.log.end_section('Starting U-Boot')
 
 def cleanup_spawn(self):
 """Shut down all interaction with the U-Boot instance.
-- 
2.7.0

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