Re: [U-Boot] [PATCH 02/13] dm: core: Add a new api to get indexed device address

2015-10-30 Thread Mugunthan V N
On Thursday 29 October 2015 10:47 PM, Simon Glass wrote:
> Hi Mugunthan,
> 
> On 27 October 2015 at 05:12, Mugunthan V N  wrote:
>> Add new api to get device address based on index.
>>
>> Signed-off-by: Mugunthan V N 
>> ---
>>  drivers/core/device.c | 20 
>>  include/dm/device.h   |  9 +
>>  2 files changed, 29 insertions(+)
>>
>> diff --git a/drivers/core/device.c b/drivers/core/device.c
>> index a3dc2ca..7557e5c 100644
>> --- a/drivers/core/device.c
>> +++ b/drivers/core/device.c
>> @@ -620,6 +620,26 @@ fdt_addr_t dev_get_addr(struct udevice *dev)
>>  #endif
>>  }
>>
>> +fdt_addr_t dev_get_addr_index(struct udevice *dev, int index)
>> +{
>> +#if CONFIG_IS_ENABLED(OF_CONTROL)
>> +   fdt_addr_t addr;
>> +
> 
> I think you are missing the 'if (CONFIG_IS_ENABLED(OF_TRANSLATE)) {'
> logic from dev_get_addr(). Also that function should call your new
> function I think to avoid duplicated code.

Agreed, will fix in v2.

> 
>> +   addr = fdtdec_get_addr_size_auto_parent(gd->fdt_blob,
>> +   dev->parent->of_offset,
>> +   dev->of_offset, "reg",
>> +   index, NULL);
>> +   if (CONFIG_IS_ENABLED(SIMPLE_BUS) && addr != FDT_ADDR_T_NONE) {
>> +   if (device_get_uclass_id(dev->parent) == UCLASS_SIMPLE_BUS)
>> +   addr = simple_bus_translate(dev->parent, addr);
>> +   }
>> +
>> +   return addr;
>> +#else
>> +   return FDT_ADDR_T_NONE;
>> +#endif
>> +}
>> +
>>  bool device_has_children(struct udevice *dev)
>>  {
>> return !list_empty(&dev->child_head);
>> diff --git a/include/dm/device.h b/include/dm/device.h
>> index 8519612..e6506b4 100644
>> --- a/include/dm/device.h
>> +++ b/include/dm/device.h
>> @@ -441,6 +441,15 @@ int device_find_next_child(struct udevice **devp);
>>  fdt_addr_t dev_get_addr(struct udevice *dev);
>>
>>  /**
>> + * dev_get_addr() - Get the reg property of a device
>> + *
>> + * @dev: Pointer to a device
>> + *
>> + * @return addr
> 
> Please update the comment here with the new parameter and what it does.

Will fix in v2.

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


[U-Boot] [PATCH] cfi_flash: give default CONFIG_SYS_MAX_FLASH_SECT in flash.h

2015-10-30 Thread Thomas Chou
Give default CONFIG_SYS_MAX_FLASH_SECT in flash.h, so that
the header can be included regardless of the present of flash.
The value 512 is the most used.

Signed-off-by: Thomas Chou 
---
 include/flash.h | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/flash.h b/include/flash.h
index 5754cf9..dc0645e 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -8,7 +8,10 @@
 #ifndef _FLASH_H_
 #define _FLASH_H_
 
-#ifndef CONFIG_SYS_NO_FLASH
+#ifndef CONFIG_SYS_MAX_FLASH_SECT
+#define CONFIG_SYS_MAX_FLASH_SECT  512
+#endif
+
 /*---
  * FLASH Info: contains chip specific data, per FLASH bank
  */
@@ -500,6 +503,4 @@ extern flash_info_t *flash_get_info(ulong base);
 #define FLASH_ERASE_TIMEOUT12  /* timeout for erasing in ms
*/
 #define FLASH_WRITE_TIMEOUT500 /* timeout for writes  in ms
*/
 
-#endif /* !CONFIG_SYS_NO_FLASH */
-
 #endif /* _FLASH_H_ */
-- 
2.5.0

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


Re: [U-Boot] [GIT] Pull request: u-boot-dfu

2015-10-30 Thread Marek Vasut
On Friday, October 30, 2015 at 11:40:07 AM, Lukasz Majewski wrote:
> The following changes since commit
> 517173d9652957e99598a34b5752dae21a5fea53:
> 
>   ohci: Add missing cache-flush for hcca area (2015-10-21 00:25:53
>   +0200)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-dfu.git
> 
> for you to fetch changes up to a468bc844eb191b82e3f5af2f277854eb6557394:
> 
>   ARM: dra7xx_evm: Add DFU support for qspi flash (2015-10-30 10:50:12
>   +0100)
> 
> 
> Vignesh R (2):
>   dfu: dfu_sf: Pass duplicate devstr to parse_dev
>   ARM: dra7xx_evm: Add DFU support for qspi flash
> 
>  drivers/dfu/dfu_sf.c |  4 +++-
>  include/configs/dra7xx_evm.h | 16 +++-
>  2 files changed, 18 insertions(+), 2 deletions(-)

Applied, thanks!

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


Re: [U-Boot] [PATCH v2 8/8] x86: Move timer_init() call a bit earlier

2015-10-30 Thread Simon Glass
Applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 7/8] x86: queensbay: Really disable IGD

2015-10-30 Thread Simon Glass
Applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 6/8] x86: Move CONFIG_8259_PIC and CONFIG_8254_TIMER to Kconfig

2015-10-30 Thread Simon Glass
Applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 5/8] x86: Rename pcat_ to i8254 and i8259 accordingly

2015-10-30 Thread Simon Glass
Applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 4/8] x86: Initialize i8254 timer counter 1

2015-10-30 Thread Simon Glass
Applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/8] x86: Fix cosmetic issues in the i8254 and i8259 codes

2015-10-30 Thread Simon Glass
Applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/8] x86: Rename CONFIG_SYS_NUM_IRQS to SYS_NUM_IRQS

2015-10-30 Thread Simon Glass
Applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/8] x86: Remove dead codes wrapped by PARANOID_IRQ_TRIGGERS

2015-10-30 Thread Simon Glass
Applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] x86: Select the ns16550 debug UART for minnowmax, chromebook_link

2015-10-30 Thread Tom Rini
On Fri, Oct 30, 2015 at 03:46:17PM -0600, Simon Glass wrote:

> At present the debug UART is not selected which causes a build error.
> Correct this.
> 
> Signed-off-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] [PATCH] x86: Select the ns16550 debug UART for minnowmax, chromebook_link

2015-10-30 Thread Simon Glass
At present the debug UART is not selected which causes a build error.
Correct this.

Signed-off-by: Simon Glass 
---

 configs/chromebook_link_defconfig | 1 +
 configs/minnowmax_defconfig   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/configs/chromebook_link_defconfig 
b/configs/chromebook_link_defconfig
index 78a9470..0b75781 100644
--- a/configs/chromebook_link_defconfig
+++ b/configs/chromebook_link_defconfig
@@ -23,6 +23,7 @@ CONFIG_SPI_FLASH=y
 CONFIG_DM_PCI=y
 CONFIG_DM_RTC=y
 CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_NS16550=y
 CONFIG_DEBUG_UART_BASE=0x3f8
 CONFIG_DEBUG_UART_CLOCK=1843200
 CONFIG_DEBUG_UART_BOARD_INIT=y
diff --git a/configs/minnowmax_defconfig b/configs/minnowmax_defconfig
index 8f99f0e..0f500e6 100644
--- a/configs/minnowmax_defconfig
+++ b/configs/minnowmax_defconfig
@@ -23,6 +23,7 @@ CONFIG_DM_ETH=y
 CONFIG_DM_PCI=y
 CONFIG_DM_RTC=y
 CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_NS16550=y
 CONFIG_DEBUG_UART_BASE=0x3f8
 CONFIG_DEBUG_UART_CLOCK=1843200
 CONFIG_USB=y
-- 
2.6.0.rc2.230.g3dd15c0

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


[U-Boot] dm-spi: Convert to driver model

2015-10-30 Thread Jagan Teki
Hi All,

I'm trying to port or helping anyone from below driver authors to
convert these drivers to driver model [1]

And I couldn't find any dts for the boards which uses these spi
drivers if anyone knows if there is a dts which already exist in the
code or in Linux please let me know.

armada100_spi.c

atmel_spi.c

bfin_spi6xx.c

bfin_spi.c

cf_qspi.c

cf_spi.c

davinci_spi.c

ep93xx_spi.c

fsl_espi.c

kirkwood_spi.c

lpc32xx_ssp.c

mpc52xx_spi.c

mpc8xxx_spi.c

mxc_spi.c

mxs_spi.c

omap3_spi.c

sh_qspi.c

sh_spi.c

soft_spi_legacy.c

ti_qspi.c

[1] doc/driver-model/spi-howto.txt

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


Re: [U-Boot] [PATCH 1/7] kirkwood: standardise the configuration

2015-10-30 Thread Luka Perkov
Hi Quentin,

On Wed, Oct 28, 2015 at 12:47:15AM +, Quentin Armitage wrote:
> The Marvell plugs are very similar systems, and so it makes sense
> for their u-boots to have the same commands/configuration.
> 
> Add EXT4 and MII to Dreamplug, DATE to Guruplug and Sheevaplug.
> Add CONFIG_SYS_ALT_MEMTEST to Sheevaplug.
> There are still command differences around NAND, SPI/NOR.
> 
> Also default to building u-boot.kwb for Sheevaplug and Guruplug.
> 
> Signed-off-by: Quentin Armitage 
> ---
> 
>  include/configs/dreamplug.h  |7 +--
>  include/configs/guruplug.h   |   11 +++
>  include/configs/sheevaplug.h |   13 +
>  3 files changed, 29 insertions(+), 2 deletions(-)

Thank you for the cleanup work. If you plan to do some more please go
ahead! All patches applied and pushed into marvell/master. 

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


Re: [U-Boot] [PATCH v4 00/21] sf: Tunning spi-flash layer

2015-10-30 Thread Jagan Teki
On 31 October 2015 at 02:00, Marek Vasut  wrote:
> On Friday, October 30, 2015 at 09:02:15 PM, Jagan Teki wrote:
>> Hi Simon,
>>
>> On 30 October 2015 at 04:55, Simon Glass  wrote:
>> > Hi Jagan,
>> >
>> > On 28 October 2015 at 13:08, Jagan Teki  wrote:
>> >> Hi Simon,
>> >>
>> >> On 29 October 2015 at 00:17, Simon Glass  wrote:
>> >> > Hi Jagan,
>> >> >
>> >> > On 19 October 2015 at 03:28, Jagan Teki  wrote:
>> >> >> Hi Simon,
>> >> >>
>> >> >> On 19 October 2015 at 01:57, Simon Glass  wrote:
>> >> >>> Hi Jagan,
>> >> >>>
>> >> >>> On 12 October 2015 at 09:00, Jagan Teki  wrote:
>> >>  Previous version link:
>> >>  http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/233262
>> >> 
>> >>  spi-flash layer need to tune a lot for better code handling and
>> >>  to sync with Linux spi-nor. So below areas got updated in this
>> >>  series. - BAR handling
>> >>  - spi_flash_cmd_wait_ready updates.
>> >>  - Separate core spi-flash handling and spi-flash interface
>> >> 
>> >>    (interface between spi drivers vs spi-flash layer)
>> >> 
>> >>  Currently I'm working on spi-nor framework for u-boot which
>> >>  is slighly same as Linux spi-nor core with addition of
>> >>  u-boot driver model to it.
>> >> 
>> >>  This series will be starting point to add spi-nor functionalities.
>> >> 
>> >>  TODO:
>> >>  - MTD core addition to spi-flash layer.
>> >>  - spi-nor core addition.
>> >> 
>> >>  Code sizes:
>> >>  After:
>> >> 
>> >>  dm:
>> >> textdata bss dec hex filename
>> >> 
>> >>   354820   12016  221112  587948   8f8ac u-boot
>> >> 
>> >>  non-dm
>> >> 
>> >> textdata bss dec hex filename
>> >> 
>> >>   354317   11876  221124  587317   8f635 u-boot
>> >> 
>> >>  Before:
>> >>  dm
>> >> 
>> >> textdata bss dec hex filename
>> >> 
>> >>   354878   12016  221096  587990   8f8d6 u-boot
>> >> 
>> >>  non-dm
>> >> 
>> >> textdata bss dec hex filename
>> >> 
>> >>   354447   11876  221124  587447   8f6b7 u-boot
>> >> >>>
>> >> >>> I don't think you should be adding new features to the
>> >> >>> non-driver-model SPI flash code. We are supposed to be migrating
>> >> >>> everything to driver model, so it would be better to move your
>> >> >>> boards over, and then work to deprecate and remove the old code.
>> >> >>> Adding new features to it sends the wrong message.
>> >> >>
>> >> >> spi-flash core code doesn't require to add driver model, and cmd_sf
>> >> >> to spi-flash code is already supporting driver model.
>> >> >>
>> >> >> OK, let me explain in-detail.
>> >> >>
>> >> >> Code in sf_probe.c supports both dm and non dm-spi-flash and flash
>> >> >> initialization code using
>> >> >> spi_flash_validate_params. sf.c acts as interface between spi drivers
>> >> >> vs spi-flash code.
>> >> >> So the spi-flash initialization code(part of sf_probe) and code in
>> >> >> sf_ops are commonly categorized as spi-flash core code and this will
>> >> >> not require driver model, so-that the dm drivers will simply use this
>> >> >> common code for spi-flash core functionality.
>> >> >>
>> >> >> This patch series will separate all the necessary existing code into
>> >> >> core and spi-flash vs spi drivers interface code. So at ends
>> >> >> - sf_probe is simply the copy of sf.c and dm and non-dm spi-flash
>> >> >> code so this will acts a spi-flash vs spi drivers interface. (which
>> >> >> has dm and non-dm as same as before)
>> >> >> - sf_ops is core spi-flash functionality.
>> >> >>
>> >> >> On top of this I'm adding actual spi-nor core code, where sf_ops.c
>> >> >> will become spi-nor.c and sf_probe.c will become spi-nor-flash.c.
>> >> >> - spi-nor.c: Core SPI NOR
>> >> >> - spi-nor-flash: spi drivers vs spi-nor interface (which has dm and
>> >> >> non-dm as same as before)
>> >> >>
>> >> >> The reason for adding this spi-nor is to move flash code from
>> >> >> spi-drivers, example fsl_qspi and at the end this fsl_qspi will move
>> >> >> from spi drivers to spi-nor that will be in driver model.
>> >> >>
>> >> >> I'm simply adding new core functionality with adding new drivers as
>> >> >> dm-driven, I don't think this will not effect/change the driver model
>> >> >> growth.
>> >> >>
>> >> >>  View of spi-nor framework:
>> >> >> -
>> >> >>
>> >> >> cmd_sf
>> >> >>
>> >> >> -
>> >> >>
>> >> >> spi_flash
>> >> >>
>> >> >> -
>> >> >>
>> >> >> MTD Core
>> >> >>
>> >> >> -
>> >> >>
>> >> >> sf-uclass
>> >> >>
>> >> >> ---

Re: [U-Boot] [PATCH v4 00/21] sf: Tunning spi-flash layer

2015-10-30 Thread Marek Vasut
On Friday, October 30, 2015 at 09:02:15 PM, Jagan Teki wrote:
> Hi Simon,
> 
> On 30 October 2015 at 04:55, Simon Glass  wrote:
> > Hi Jagan,
> > 
> > On 28 October 2015 at 13:08, Jagan Teki  wrote:
> >> Hi Simon,
> >> 
> >> On 29 October 2015 at 00:17, Simon Glass  wrote:
> >> > Hi Jagan,
> >> > 
> >> > On 19 October 2015 at 03:28, Jagan Teki  wrote:
> >> >> Hi Simon,
> >> >> 
> >> >> On 19 October 2015 at 01:57, Simon Glass  wrote:
> >> >>> Hi Jagan,
> >> >>> 
> >> >>> On 12 October 2015 at 09:00, Jagan Teki  wrote:
> >>  Previous version link:
> >>  http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/233262
> >>  
> >>  spi-flash layer need to tune a lot for better code handling and
> >>  to sync with Linux spi-nor. So below areas got updated in this
> >>  series. - BAR handling
> >>  - spi_flash_cmd_wait_ready updates.
> >>  - Separate core spi-flash handling and spi-flash interface
> >>  
> >>    (interface between spi drivers vs spi-flash layer)
> >>  
> >>  Currently I'm working on spi-nor framework for u-boot which
> >>  is slighly same as Linux spi-nor core with addition of
> >>  u-boot driver model to it.
> >>  
> >>  This series will be starting point to add spi-nor functionalities.
> >>  
> >>  TODO:
> >>  - MTD core addition to spi-flash layer.
> >>  - spi-nor core addition.
> >>  
> >>  Code sizes:
> >>  After:
> >>  
> >>  dm:
> >> textdata bss dec hex filename
> >>   
> >>   354820   12016  221112  587948   8f8ac u-boot
> >>  
> >>  non-dm
> >>  
> >> textdata bss dec hex filename
> >>   
> >>   354317   11876  221124  587317   8f635 u-boot
> >>  
> >>  Before:
> >>  dm
> >>  
> >> textdata bss dec hex filename
> >>   
> >>   354878   12016  221096  587990   8f8d6 u-boot
> >>  
> >>  non-dm
> >>  
> >> textdata bss dec hex filename
> >>   
> >>   354447   11876  221124  587447   8f6b7 u-boot
> >> >>> 
> >> >>> I don't think you should be adding new features to the
> >> >>> non-driver-model SPI flash code. We are supposed to be migrating
> >> >>> everything to driver model, so it would be better to move your
> >> >>> boards over, and then work to deprecate and remove the old code.
> >> >>> Adding new features to it sends the wrong message.
> >> >> 
> >> >> spi-flash core code doesn't require to add driver model, and cmd_sf
> >> >> to spi-flash code is already supporting driver model.
> >> >> 
> >> >> OK, let me explain in-detail.
> >> >> 
> >> >> Code in sf_probe.c supports both dm and non dm-spi-flash and flash
> >> >> initialization code using
> >> >> spi_flash_validate_params. sf.c acts as interface between spi drivers
> >> >> vs spi-flash code.
> >> >> So the spi-flash initialization code(part of sf_probe) and code in
> >> >> sf_ops are commonly categorized as spi-flash core code and this will
> >> >> not require driver model, so-that the dm drivers will simply use this
> >> >> common code for spi-flash core functionality.
> >> >> 
> >> >> This patch series will separate all the necessary existing code into
> >> >> core and spi-flash vs spi drivers interface code. So at ends
> >> >> - sf_probe is simply the copy of sf.c and dm and non-dm spi-flash
> >> >> code so this will acts a spi-flash vs spi drivers interface. (which
> >> >> has dm and non-dm as same as before)
> >> >> - sf_ops is core spi-flash functionality.
> >> >> 
> >> >> On top of this I'm adding actual spi-nor core code, where sf_ops.c
> >> >> will become spi-nor.c and sf_probe.c will become spi-nor-flash.c.
> >> >> - spi-nor.c: Core SPI NOR
> >> >> - spi-nor-flash: spi drivers vs spi-nor interface (which has dm and
> >> >> non-dm as same as before)
> >> >> 
> >> >> The reason for adding this spi-nor is to move flash code from
> >> >> spi-drivers, example fsl_qspi and at the end this fsl_qspi will move
> >> >> from spi drivers to spi-nor that will be in driver model.
> >> >> 
> >> >> I'm simply adding new core functionality with adding new drivers as
> >> >> dm-driven, I don't think this will not effect/change the driver model
> >> >> growth.
> >> >> 
> >> >>  View of spi-nor framework:
> >> >> -
> >> >> 
> >> >> cmd_sf
> >> >> 
> >> >> -
> >> >> 
> >> >> spi_flash
> >> >> 
> >> >> -
> >> >> 
> >> >> MTD Core
> >> >> 
> >> >> -
> >> >> 
> >> >> sf-uclass
> >> >> 
> >> >> -
> >> >> 
> >> >> SPI-NOR
> >> >> 
> >> >> ---

Re: [U-Boot] [PATCH v2 15/28] input: Add a function to add a keycode to the existing set

2015-10-30 Thread Simon Glass
On 22 October 2015 at 22:12, Bin Meng  wrote:
> Hi Simon,
>
> On Mon, Oct 19, 2015 at 11:17 AM, Simon Glass  wrote:
>> Most keyboards can be scanned to produce a list of the keycodes which are
>> depressed. With the i8042 keyboard this scanning is done internally and
>> only the processed results are returned.
>>
>> In this case, when a key is pressed, a 'make' code is sent. When the key
>> is released an 'unmake' code is sent. This means that the driver needs to
>
> nits: 'unmake' -> 'break'

Fixed.

Applied to u-boot-dm.

>
>> keep track of which keys are pressed. It also means that any protocol error
>> can lead to stuck keys.
>>
>> In order to support this type of keyboard, add a function when can be used
>> to provide a single keycode and either add it to the list of what is pressed
>> or remove it from the list. Then the normal input_send_keycodes() function
>> can be used to actually do the decoding work.
>>
>> Add debugging to display the ASCII characters written to the input queue
>> also.
>>
>> Signed-off-by: Simon Glass 
>> ---
>
> Reviewed-by: Bin Meng 
>
>>
>> Changes in v2: None
>>
>>  drivers/input/input.c | 46 ++
>>  include/input.h   | 20 
>>  2 files changed, 62 insertions(+), 4 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 16/28] input: Allow repeat filtering to be disabled

2015-10-30 Thread Simon Glass
Applied to u-boot-dm.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 14/28] input: Add a few more keyboard keycodes

2015-10-30 Thread Simon Glass
Applied to u-boot-dm.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 17/28] input: Allow repeat filtering to be disabled

2015-10-30 Thread Simon Glass
Applied to u-boot-dm.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 13/28] input: Correct keycode for Ctrl-Y

2015-10-30 Thread Simon Glass
Applied to u-boot-dm.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 09/28] video: Drop unused console functions

2015-10-30 Thread Simon Glass
Applied to u-boot-dm.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 12/28] i8042: Adjust keyboard init to assume success

2015-10-30 Thread Simon Glass
Applied to u-boot-dm.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 11/28] i8042: Adjust kbd_reset() to collect all failures

2015-10-30 Thread Simon Glass
Applied to u-boot-dm.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 10/28] i8042: Use functions to handle register access

2015-10-30 Thread Simon Glass
Applied to u-boot-dm.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 06/28] dm: stdio: Plumb in the new keyboard uclass

2015-10-30 Thread Simon Glass
Applied to u-boot-dm.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 08/28] dm: cros_ec: Convert cros_ec keyboard driver to driver model

2015-10-30 Thread Simon Glass
Applied to u-boot-dm.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 07/28] dm: tegra: Convert keyboard driver to driver model

2015-10-30 Thread Simon Glass
Applied to u-boot-dm.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 05/28] cros_ec: Use udevice instead of cros_ec_dev for keyboard functions

2015-10-30 Thread Simon Glass
Applied to u-boot-dm.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 04/28] input: Add the keycode translation tables separately

2015-10-30 Thread Simon Glass
Applied to u-boot-dm.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 03/28] input: Return -ENOSPC when there is not space

2015-10-30 Thread Simon Glass
On 18 October 2015 at 21:17, Simon Glass  wrote:
> Return a useful error instead of -1 when something goes wrong.
>
> Signed-off-by: Simon Glass 
> Reviewed-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  drivers/input/input.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH v2 02/28] input: Add a device pointer to the input config

2015-10-30 Thread Simon Glass
On 18 October 2015 at 21:17, Simon Glass  wrote:
> The read_keys() method in input is passed a struct input_config. Add a
> device pointer there so that we can find out the device that is referred
> to with driver model.
>
> Once all drivers are converted we can update the input structure to use
> driver model instead.
>
> Signed-off-by: Simon Glass 
> Reviewed-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  include/input.h | 1 +
>  1 file changed, 1 insertion(+)
>

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


Re: [U-Boot] [PATCH v2 01/28] dm: input: Create a keyboard uclass

2015-10-30 Thread Simon Glass
Applied to u-boot-dm.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] dm: usb: Add support for USB keyboards with driver model

2015-10-30 Thread Simon Glass
On 29 October 2015 at 13:09, Simon Glass  wrote:
> Hi Hans,
>
> On 19 October 2015 at 02:34, Hans de Goede  wrote:
>>
>> Hi,
>>
>>
>> On 19-10-15 01:17, Simon Glass wrote:
>>>
>>> Hi Hans,
>>>
>>> On 12 September 2015 at 09:15, Hans de Goede  wrote:

 Hi,

 On 08-09-15 19:15, Simon Glass wrote:
>
>
> Switch USB keyboards over to use driver model instead of scanning with the
> horrible usb_get_dev_index() function. This involves creating a new uclass
> for keyboards, although so far there is no API.
>
> Signed-off-by: Simon Glass 



 In general I like this patch, so ack for the principle, but the
 implementation has issues.

 You're now allowing the registration of multiple usb keyb stdio
 input devices, but you are still relying on usb_kbd_deregister()
 to remove them from the stdio devices list, and when multiple
 or used that one will only remove the first one.

 This can be fixed by switching to stdio_register_dev, and
 store the returned struct stdio_dev pointer for the new dev,
 and add a dm remove callback which deregisters that specific
 stdio_dev that will also remove the ugliness of looking up
 the device by its name to unregister it.

 The name which in itself is another, harder to fix issue,
 when using iomux, and the stdin string contains usbkbd we
 really want to get all usbkbd-s to work, but iomux will
 only take the first one.

 This can be fixed in 2 ways:

 1) in the usbkbd driver by registering a shared stdio_dev
 for all usbkbd's and deregistering that only when the
 last usbkbd is removed (in the case of dm), this will
 require a global list of usbkbd devices, and stdio
 callbacks to walk over this list, I believe that this
 is likely the best approach

 2) Fix this in iomux, and make it look for multiple
 devs with the same name and mux them all.

 This seems cleaner at a conceptual level, but likely
 somewhat hard to implement.

>>>
>>> I've had another look at this and here are my comments so far:
>>>
>>> 1. The existing driver does not support multiple keyboards. It
>>> implements this limitation in multiple ways which would be a real pain
>>> to fix while keeping the old code. I think it makes much more sense to
>>> remove this limitation when we have either a) moved all uses of USB
>>> keyboard to driver model, or perhaps b) moved stdio to driver model.
>>> For now the driver model approach provides the same functionality as
>>> before so I think it is fine.
>>
>>
>> I think that supporting multiple keyboards the way I've outlined
>> above as "1)" should not be that hard. But I do not plan to make time
>> for this anytime soon, and as such I can hardly ask you to do this.
>>
>> So I reluctantly agree to keep this as is (I was hoping the move
>> to dm would fix this).
>>
>>> 2. The point about out-of-order devices in the 'usb tree'
>>> displaywell if you disable unbinding that is what you get. I'm
>>> sure we could fix it by sorting the devices before displaying them,
>>> but it does not seem that important to me. It is more likely that the
>>> unbind support will be enabled in U-Boot proper, and perhaps disabled
>>> in SPL, which doesn't have commands anyway.
>>
>>
>> I'm fine with "usb tree" showing things the wrong way on builds where
>> unbinding is disabled. But if I remember the patch-set this thread is
>> about correctly, it completely removed unbinding from the usb code.
>>
>> If you do a new version where unbinding is only skipped when compiled
>> out then that is fine with me.
>
> OK, for now I'm going to apply just this patch from the series, to
> unblock the input uclass.
>
> I'll then redo this series to allow the unbinding as, indeed, that is
> what I want to happen too.

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


Re: [U-Boot] [PATCH v4 00/21] sf: Tunning spi-flash layer

2015-10-30 Thread Jagan Teki
Hi Simon,

On 30 October 2015 at 04:55, Simon Glass  wrote:
> Hi Jagan,
>
> On 28 October 2015 at 13:08, Jagan Teki  wrote:
>>
>> Hi Simon,
>>
>> On 29 October 2015 at 00:17, Simon Glass  wrote:
>> > Hi Jagan,
>> >
>> > On 19 October 2015 at 03:28, Jagan Teki  wrote:
>> >> Hi Simon,
>> >>
>> >> On 19 October 2015 at 01:57, Simon Glass  wrote:
>> >>> Hi Jagan,
>> >>>
>> >>> On 12 October 2015 at 09:00, Jagan Teki  wrote:
>>  Previous version link:
>>  http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/233262
>> 
>>  spi-flash layer need to tune a lot for better code handling and
>>  to sync with Linux spi-nor. So below areas got updated in this series.
>>  - BAR handling
>>  - spi_flash_cmd_wait_ready updates.
>>  - Separate core spi-flash handling and spi-flash interface
>>    (interface between spi drivers vs spi-flash layer)
>> 
>>  Currently I'm working on spi-nor framework for u-boot which
>>  is slighly same as Linux spi-nor core with addition of
>>  u-boot driver model to it.
>> 
>>  This series will be starting point to add spi-nor functionalities.
>> 
>>  TODO:
>>  - MTD core addition to spi-flash layer.
>>  - spi-nor core addition.
>> 
>>  Code sizes:
>>  After:
>>  dm:
>> textdata bss dec hex filename
>>   354820   12016  221112  587948   8f8ac u-boot
>>  non-dm
>> textdata bss dec hex filename
>>   354317   11876  221124  587317   8f635 u-boot
>> 
>>  Before:
>>  dm
>> textdata bss dec hex filename
>>   354878   12016  221096  587990   8f8d6 u-boot
>>  non-dm
>> textdata bss dec hex filename
>>   354447   11876  221124  587447   8f6b7 u-boot
>> >>>
>> >>> I don't think you should be adding new features to the
>> >>> non-driver-model SPI flash code. We are supposed to be migrating
>> >>> everything to driver model, so it would be better to move your boards
>> >>> over, and then work to deprecate and remove the old code. Adding new
>> >>> features to it sends the wrong message.
>> >>
>> >> spi-flash core code doesn't require to add driver model, and cmd_sf to
>> >> spi-flash code is already supporting driver model.
>> >>
>> >> OK, let me explain in-detail.
>> >>
>> >> Code in sf_probe.c supports both dm and non dm-spi-flash and flash
>> >> initialization code using
>> >> spi_flash_validate_params. sf.c acts as interface between spi drivers
>> >> vs spi-flash code.
>> >> So the spi-flash initialization code(part of sf_probe) and code in
>> >> sf_ops are commonly categorized as spi-flash core code and this will
>> >> not require driver model, so-that the dm drivers will simply use this
>> >> common code for spi-flash core functionality.
>> >>
>> >> This patch series will separate all the necessary existing code into
>> >> core and spi-flash vs spi drivers interface code. So at ends
>> >> - sf_probe is simply the copy of sf.c and dm and non-dm spi-flash code
>> >> so this will acts a spi-flash vs spi drivers interface. (which has dm
>> >> and non-dm as same as before)
>> >> - sf_ops is core spi-flash functionality.
>> >>
>> >> On top of this I'm adding actual spi-nor core code, where sf_ops.c
>> >> will become spi-nor.c and sf_probe.c will become spi-nor-flash.c.
>> >> - spi-nor.c: Core SPI NOR
>> >> - spi-nor-flash: spi drivers vs spi-nor interface (which has dm and
>> >> non-dm as same as before)
>> >>
>> >> The reason for adding this spi-nor is to move flash code from
>> >> spi-drivers, example fsl_qspi and at the end this fsl_qspi will move
>> >> from spi drivers to spi-nor that will be in driver model.
>> >>
>> >> I'm simply adding new core functionality with adding new drivers as
>> >> dm-driven, I don't think this will not effect/change the driver model
>> >> growth.
>> >>
>> >>  View of spi-nor framework:
>> >>
>> >> -
>> >> cmd_sf
>> >> -
>> >> spi_flash
>> >> -
>> >> MTD Core
>> >> -
>> >> sf-uclass
>> >> -
>> >> SPI-NOR
>> >> -
>> >> spi-nor-flash   drivers/mtd/spi/*
>> >> -
>> >> spi-uclass
>> >> -
>> >> drivers/spi/*
>> >> -
>> >>
>> >> drivers/mtd/spi/spi-nor.c: spi-nor core (not require to add dm)
>> >> drivers/mtd/spi/spi-flash-nor.c: spi-nor to spi drivers interface 
>> >> (dm-driven)
>> >> drivers/mtd/spi/fsl-qua

Re: [U-Boot] [PATCH] README.scrapyard: Populate recent ppc4xx removals

2015-10-30 Thread Tom Rini
On Fri, Oct 30, 2015 at 07:54:11AM -0400, Tom Rini wrote:

> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Please pull u-boot-fsl-qoriq master

2015-10-30 Thread Tom Rini
On Fri, Oct 30, 2015 at 09:26:50AM -0700, York Sun wrote:

> Tom,
> 
> The following changes since commit 677f970bc62a661690b3431543d5a5d5e682ba70:
> 
>   common/board_f.c: modify the macro to use get_clocks() more common 
> (2015-10-24
> 13:50:38 -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-fsl-qoriq.git master
> 
> for you to fetch changes up to 7ee52af455c2cec7b674d2159806f7e95da8e6a5:
> 
>   ls102xa: Adjust some macros for SD boot on LS1021A QDS board (2015-10-30
> 09:19:48 -0700)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v4 16/16] spi: Add SPI NOR protection mechanism

2015-10-30 Thread Jagan Teki
Hi Fabio,

On 30 October 2015 at 22:21, Fabio Estevam  wrote:
> Hi Jagan,
>
> On Fri, Oct 30, 2015 at 2:28 PM, Jagan Teki  wrote:
>
>>> +static int do_spi_protect(int argc, char * const argv[])
>>> +{
>>> +   int ret = 0;
>>> +   loff_t start, len;
>>> +   bool prot = false;
>>> +
>>> +   if (argc != 4)
>>> +   return -1;
>>> +
>>> +   if (!str2off(argv[2], &start)) {
>>> +   puts("start sector is not a valid number\n");
>>> +   return 1;
>>> +   }
>>> +
>>> +   if (!str2off(argv[3], &len)) {
>>> +   puts("len is not a valid number\n");
>>> +   return 1;
>>> +   }
>>> +
>>> +   if (strcmp(argv[1], "lock") == 0)
>>> +   prot = true;
>>> +   else if (strcmp(argv[1], "unlock") == 0)
>>> +   prot = false;
>>> +   else
>>
>> Don't we have is_locked command from user? may be we can all this one as 
>> well.
>
> Sorry, I did not understand the suggestion here.
>
> Looks like you are happy with patches 1 to 15 of this series.
>
> Could you please apply patches 1 to 15 and then I rework only this last one?

I will pick the entire series once, since 15/16 and 16/16 are same feature set.

My questions with 16/16 is

1. We need to check the idcode as well because if we compile other
flash vendor with micron, non
micron flash got initialized with these lock ops' and also assign
stm_* calls if the idcode is micro.

> +#if defined(CONFIG_SPI_FLASH_STMICRO)
> +   flash->lock = spi_flash_cmd_lock_ops;
> +   flash->unlock = spi_flash_cmd_unlock_ops;
> +   flash->is_locked = spi_flash_cmd_is_locked_ops;
> +#endif

2. Do the 1 for dm as well, probably in probe.

3. What about adding  'sf protect is_locked' since we have code already?

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


Re: [U-Boot] [PATCH][v2] mpc85xx/u-boot*.lds: remove _GLOBAL_OFFSET_TABLE_ definition

2015-10-30 Thread York Sun


On 10/24/2015 10:02 PM, Prabhakar Kushwaha wrote:
> From: Zhenhua Luo 
> 
> In binutils-2.25, the _GLOBAL_OFFSET_TABLE_ symbols defined by PROVIDE in
> u-boot.lds overrides the linker built-in symbols
> (https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;
> h=b893397a4b1316610f49819344817715e4305de9),
> so the linker is treating _GLOBAL_OFFSET_TABLE_ as a definition into the
> .reloc section.
> 
> To align with the change of binutils-2.25, the _GLOBAL_OFFSET_TABLE_ symbol
> should not be defined in sections, and the symbols in linker generated .got
> section should be used(https://sourceware.org/ml/binutils/2008-09/
> msg00122.html)
> 
> Fixed the following build errors with binutils-2.25:
> | powerpc-poky-linux-gnuspe-ld.bfd: _GLOBAL_OFFSET_TABLE_ not defined in
> linker created .got
> 
> Signed-off-by: Zhenhua Luo 
> Signed-off-by: Prabhakar Kushwaha 
> ---
> Changes for v2: Updated Subject
> 

Prabhakar/Zhenghua,

Have you addressed Tom's comment (on rev 1 patch)? Quote, "What happens when we
use older binutils?  I'd like some run-time testing too please".

York

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


Re: [U-Boot] [PATCH 2/2] mpc85xx: Add support for the Varisys Cyrus board

2015-10-30 Thread York Sun


On 10/21/2015 04:59 PM, Andy Fleming wrote:
> This board runs a P5020 or P5040 chip, and utilizes
> an EEPROM with similar formatting to the Freescale P5020DS.
> 
> Large amounts of this code were developed by
> Adrian Cox 
> 
> Signed-off-by: Andy Fleming 
> ---
>  arch/powerpc/cpu/mpc85xx/Kconfig |   4 +
>  board/varisys/common/Makefile|  23 ++
>  board/varisys/common/eeprom.h|   6 +
>  board/varisys/common/sys_eeprom.c| 605 
> +++
>  board/varisys/cyrus/Kconfig  |  13 +
>  board/varisys/cyrus/Makefile |   8 +
>  board/varisys/cyrus/README   |  21 ++
>  board/varisys/cyrus/cyrus.c  | 116 +++
>  board/varisys/cyrus/cyrus.h  |  11 +
>  board/varisys/cyrus/ddr.c| 188 +++
>  board/varisys/cyrus/eth.c| 100 ++
>  board/varisys/cyrus/law.c|  27 ++
>  board/varisys/cyrus/pbi.cfg  |  35 ++
>  board/varisys/cyrus/pci.c|  23 ++
>  board/varisys/cyrus/rcw_p5020_v2.cfg |  11 +
>  board/varisys/cyrus/rcw_p5040.cfg|  11 +
>  board/varisys/cyrus/tlb.c| 106 ++
>  configs/Cyrus_P5020_defconfig|   9 +
>  configs/Cyrus_P5040_defconfig|   9 +
>  include/configs/cyrus.h  | 590 ++
>  20 files changed, 1916 insertions(+)
>  create mode 100644 board/varisys/common/Makefile
>  create mode 100644 board/varisys/common/eeprom.h
>  create mode 100644 board/varisys/common/sys_eeprom.c
>  create mode 100644 board/varisys/cyrus/Kconfig
>  create mode 100644 board/varisys/cyrus/Makefile
>  create mode 100644 board/varisys/cyrus/README
>  create mode 100644 board/varisys/cyrus/cyrus.c
>  create mode 100644 board/varisys/cyrus/cyrus.h
>  create mode 100644 board/varisys/cyrus/ddr.c
>  create mode 100644 board/varisys/cyrus/eth.c
>  create mode 100644 board/varisys/cyrus/law.c
>  create mode 100644 board/varisys/cyrus/pbi.cfg
>  create mode 100644 board/varisys/cyrus/pci.c
>  create mode 100644 board/varisys/cyrus/rcw_p5020_v2.cfg
>  create mode 100644 board/varisys/cyrus/rcw_p5040.cfg
>  create mode 100644 board/varisys/cyrus/tlb.c
>  create mode 100644 configs/Cyrus_P5020_defconfig
>  create mode 100644 configs/Cyrus_P5040_defconfig
>  create mode 100644 include/configs/cyrus.h
> 

Andy,

I presume you have examined the difference between
board/varisys/common/sys_eeprom.c and the original file
board/freescale/common/sys_eeprom.c. Is it possible to reuse the existing file?
This is a 600+ lines copy-n-paste.

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


Re: [U-Boot] [PATCH v3] colibri_vf: Add board_usb_phy_mode function

2015-10-30 Thread Marek Vasut
On Friday, October 30, 2015 at 05:26:25 PM, Stefan Agner wrote:
> On 2015-10-30 09:24, Marek Vasut wrote:
> > On Friday, October 30, 2015 at 05:12:54 PM, Stefan Agner wrote:
> >> Hi All,
> > 
> > Hi!
> > 
> >> On 2015-10-30 05:26, Sanchayan Maity wrote:
> >> > +
> >> > +int board_usb_phy_mode(int port)
> >> > +{
> >> > +switch (port) {
> >> > +case 0:
> >> > +return gpio_get_value(USB_CDET_GPIO);
> >> > +break;
> >> > +case 1:
> >> > +return USB_INIT_HOST;
> >> > +break;
> >> > +default:
> >> > +return USB_INIT_HOST;
> >> > +break;
> >> 
> >> One thing I would like to note in this whole discussion is that the old
> >> setup is kind of the "default" role of each dual-role controller: The
> >> boot ROM uses USB1 as client, the tower board uses this configuration
> >> too... So maybe we could/should keep that default role at least in here?
> > 
> > Well we cannot, since this is a custom board, right ?
> 
> Ah sorry, the switch statement is enumerating the port numbers, hence
> this default refers to ports > 2. Somehow read that the wrong way
> around.

Well, if it is not obvious to you, comment in the code is a good idea.
Sanchayan, please add one.

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


Re: [U-Boot] [PATCH v4 16/16] spi: Add SPI NOR protection mechanism

2015-10-30 Thread Fabio Estevam
Hi Jagan,

On Fri, Oct 30, 2015 at 2:28 PM, Jagan Teki  wrote:

>> +static int do_spi_protect(int argc, char * const argv[])
>> +{
>> +   int ret = 0;
>> +   loff_t start, len;
>> +   bool prot = false;
>> +
>> +   if (argc != 4)
>> +   return -1;
>> +
>> +   if (!str2off(argv[2], &start)) {
>> +   puts("start sector is not a valid number\n");
>> +   return 1;
>> +   }
>> +
>> +   if (!str2off(argv[3], &len)) {
>> +   puts("len is not a valid number\n");
>> +   return 1;
>> +   }
>> +
>> +   if (strcmp(argv[1], "lock") == 0)
>> +   prot = true;
>> +   else if (strcmp(argv[1], "unlock") == 0)
>> +   prot = false;
>> +   else
>
> Don't we have is_locked command from user? may be we can all this one as well.

Sorry, I did not understand the suggestion here.

Looks like you are happy with patches 1 to 15 of this series.

Could you please apply patches 1 to 15 and then I rework only this last one?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: dwc3: Fix warnings on 64-bit builds

2015-10-30 Thread Marek Vasut
On Friday, October 30, 2015 at 04:24:06 PM, Michal Simek wrote:
> Change aritmentics to use 64bit types to be compatible with 64bit
> builds.
> 
> Signed-off-by: Michal Simek 
> ---
> 
>  drivers/usb/dwc3/core.c   |  7 ---
>  drivers/usb/dwc3/ep0.c| 10 +-
>  drivers/usb/dwc3/gadget.c | 10 +-
>  drivers/usb/dwc3/io.h |  4 ++--
>  4 files changed, 16 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index ab3c94e51275..0ae3de5c27b9 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -281,7 +281,7 @@ static int dwc3_setup_scratch_buffers(struct dwc3 *dwc)
>   return 0;
> 
>  err1:
> - dma_unmap_single((void *)dwc->scratch_addr, dwc->nr_scratch *
> + dma_unmap_single((void *)(uintptr_t)dwc->scratch_addr, dwc->nr_scratch *

Is this double type-cast necessary ?

>DWC3_SCRATCHBUF_SIZE, DMA_BIDIRECTIONAL);
> 
>  err0:

[...]

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


Re: [U-Boot] [PATCH 2/3][v3] Data types defined for 64 bit physical address

2015-10-30 Thread York Sun


On 09/17/2015 03:46 AM, Aneesh Bansal wrote:
> Data types and I/O functions have been defined for
> 64 bit physical addresses in arm.
> 
> Signed-off-by: Aneesh Bansal 
> ---
> Changes in v3:
> Corrected the definition of virt_to_phys() and definition of phys_addr_t.


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


[U-Boot] Please pull u-boot-fsl-qoriq master

2015-10-30 Thread York Sun
Tom,

The following changes since commit 677f970bc62a661690b3431543d5a5d5e682ba70:

  common/board_f.c: modify the macro to use get_clocks() more common (2015-10-24
13:50:38 -0400)

are available in the git repository at:

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

for you to fetch changes up to 7ee52af455c2cec7b674d2159806f7e95da8e6a5:

  ls102xa: Adjust some macros for SD boot on LS1021A QDS board (2015-10-30
09:19:48 -0700)


Alison Wang (5):
  armv8/fsl-lsch3: fdt: Check the pointer returned from call to a function
may be NULL
  arm: ls1021a: Add QSPI or IFC support in SD boot
  ls102xa: fdt: Disable IFC in SD boot for QSPI
  arm: ls102xa: Set fdt_high and initrd_high to the value of 0x
  ls102xa: Adjust some macros for SD boot on LS1021A QDS board

Aneesh Bansal (4):
  Pointers in ESBC header made 32 bit
  Data types defined for 64 bit physical address
  crypto/fsl: SEC driver cleanup for 64 bit and endianness
  SECURE_BOOT: Correct reading of ITS bit

Gong Qianyu (3):
  common/board_f.c: change the macro name and remove it for PPC platforms
  armv8/ls1043ardb: Add nand boot support
  armv8/ls1043ardb: Add sd boot support

Hou Zhiqiang (4):
  net/fm: Fix the endian issue to support both endianness platforms
  net/fm: Add support for 64-bit platforms
  net/fm: Make the return value logic consistent with convention
  armv8/ls1043a: Enable secondary cores

Joakim Tjernlund (1):
  drivers/ddr/fsl_ddr: Make SR_IE configurable

Mingkai Hu (4):
  armv7/ls1021a: move ns_access to common file
  armv8/fsl_lsch3: Change arch to fsl-layerscape
  armv8/fsl_lsch2: Add fsl_lsch2 SoC
  armv8/ls1043ardb: Add LS1043ARDB board support

Prabhakar Kushwaha (2):
  driver: net: ldpaa_eth: Set MAC address during interface open
  armv8: ls2085a: Add support of random MAC address

Scott Wood (2):
  arm/fsl-ls: Add CONFIG_OF_STDOUT_VIA_ALIAS
  fdt_support: Don't panic if stdout alias is missing

Shaohui Xie (6):
  armv8: ls2085ardb: enable CONFIG_PHY_AQUANTIA
  net: fm: bug fix when CONFIG_PHYLIB not defined
  net: Move some header files to include/
  net/fm: Add QSGMII PCS init
  net/fm: fix MDIO controller base on FMAN2
  armv8/ls1043a: Add Fman support

Yangbo Lu (1):
  armv8/ls1043ardb: esdhc: Add esdhc support for ls1043ardb

Yao Yuan (1):
  configs: ls1021atwr: Enable ID EEPROM for SD boot

Zhao Qiang (1):
  QE: modify the address of qe ucode

horia.gea...@freescale.com (1):
  arm: ls102xa: enable snooping for CAAM transactions

tang yuantian (2):
  arm: ls1021a: Add sata support on qds and twr board
  arm: ls1021atwr: optimize the deep sleep latency

 Makefile   |4 +
 arch/arm/Kconfig   |9 +
 arch/arm/cpu/armv7/ls102xa/Makefile|1 +
 arch/arm/cpu/armv7/ls102xa/cpu.c   |3 +
 arch/arm/cpu/armv7/ls102xa/fdt.c   |2 +-
 arch/arm/cpu/armv7/ls102xa/ls102xa_sata.c  |   42 ++
 arch/arm/cpu/armv8/Makefile|2 +-
 arch/arm/cpu/armv8/fsl-layerscape/Makefile |   30 ++
 arch/arm/cpu/armv8/fsl-layerscape/README.lsch2 |   10 +
 .../README => fsl-layerscape/README.lsch3} |2 +-
 .../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/cpu.c  |  273 +++---
 .../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/cpu.h  |2 +-
 .../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/fdt.c  |   25 +-
 .../cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c|  117 +
 .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c |  180 +++
 .../fsl_lsch3_serdes.c |8 +-
 .../speed.c => fsl-layerscape/fsl_lsch3_speed.c}   |   12 +-
 .../armv8/{fsl-lsch3 => fsl-layerscape}/lowlevel.S |   14 +-
 arch/arm/cpu/armv8/fsl-layerscape/ls1043a_serdes.c |   86 +++
 .../{fsl-lsch3 => fsl-layerscape}/ls2085a_serdes.c |3 +-
 .../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/mp.c   |   30 +-
 .../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/soc.c  |   42 +-
 arch/arm/cpu/armv8/fsl-layerscape/spl.c|   79 +++
 arch/arm/cpu/armv8/fsl-lsch3/Makefile  |   13 -
 arch/arm/cpu/armv8/fsl-lsch3/speed.h   |7 -
 .../clock.h|8 +-
 arch/arm/include/asm/arch-fsl-layerscape/config.h  |  143 +
 arch/arm/include/asm/arch-fsl-layerscape/cpu.h |  229 
 .../{arch-fsl-lsch3 => arch-fsl-layerscape}/fdt.h  |4 +
 .../include/asm/arch-fsl-layerscape/fsl_serdes.h   |  157 ++
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  555 
 .../immap_lsch3.h  |  119 -
 .../arm/include/asm/arch-fsl-layerscape/imx-regs.h |   55 ++
 .../ls2085a_stream_id.h|0
 arch/arm/include/asm/arch-fsl-layerscape/

Re: [U-Boot] [PATCH v3] colibri_vf: Add board_usb_phy_mode function

2015-10-30 Thread Marek Vasut
On Friday, October 30, 2015 at 05:12:54 PM, Stefan Agner wrote:
> Hi All,

Hi!

> On 2015-10-30 05:26, Sanchayan Maity wrote:
> > +
> > +int board_usb_phy_mode(int port)
> > +{
> > +   switch (port) {
> > +   case 0:
> > +   return gpio_get_value(USB_CDET_GPIO);
> > +   break;
> > +   case 1:
> > +   return USB_INIT_HOST;
> > +   break;
> > +   default:
> > +   return USB_INIT_HOST;
> > +   break;
> 
> One thing I would like to note in this whole discussion is that the old
> setup is kind of the "default" role of each dual-role controller: The
> boot ROM uses USB1 as client, the tower board uses this configuration
> too... So maybe we could/should keep that default role at least in here?

Well we cannot, since this is a custom board, right ?

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


Re: [U-Boot] [PATCH v4 15/16] spi: sf_ops: Add SPI protection mechanism from the kernel

2015-10-30 Thread Jagan Teki
On 26 October 2015 at 21:41, Fabio Estevam  wrote:
> Add the SPI NOR protection mechanism from the kernel.
>
> This code is based on the work from Brian Norris 
>
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/drivers/mtd/spi-nor/spi-nor.c?id=62593cf40b23b523b9fc9334ca61ba6c595ebb09
>
> Signed-off-by: Fabio Estevam 
> Reviewed-by: Tom Rini 
> Reviewed-by: Heiko Schocher 
> ---

Reviewed-by: Jagan Teki 

> Changes since v3:
> - None
>
>  drivers/mtd/spi/sf_ops.c | 170 
> +++
>  include/spi_flash.h  |   4 ++
>  2 files changed, 174 insertions(+)
>
> diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
> index 900ec1f..928f9c1 100644
> --- a/drivers/mtd/spi/sf_ops.c
> +++ b/drivers/mtd/spi/sf_ops.c
> @@ -15,6 +15,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include "sf_internal.h"
>
> @@ -573,3 +574,172 @@ int sst_write_bp(struct spi_flash *flash, u32 offset, 
> size_t len,
> return ret;
>  }
>  #endif
> +
> +#ifdef CONFIG_SPI_FLASH_STMICRO
> +static void stm_get_locked_range(struct spi_flash *flash, u8 sr, loff_t *ofs,
> +u32 *len)
> +{
> +   u8 mask = SR_BP2 | SR_BP1 | SR_BP0;
> +   int shift = ffs(mask) - 1;
> +   int pow;
> +
> +   if (!(sr & mask)) {
> +   /* No protection */
> +   *ofs = 0;
> +   *len = 0;
> +   } else {
> +   pow = ((sr & mask) ^ mask) >> shift;
> +   *len = flash->size >> pow;
> +   *ofs = flash->size - *len;
> +   }
> +}
> +
> +/*
> + * Return 1 if the entire region is locked, 0 otherwise
> + */
> +static int stm_is_locked_sr(struct spi_flash *flash, loff_t ofs, u32 len,
> +   u8 sr)
> +{
> +   loff_t lock_offs;
> +   u32 lock_len;
> +
> +   stm_get_locked_range(flash, sr, &lock_offs, &lock_len);
> +
> +   return (ofs + len <= lock_offs + lock_len) && (ofs >= lock_offs);
> +}
> +
> +/*
> + * Check if a region of the flash is (completely) locked. See stm_lock() for
> + * more info.
> + *
> + * Returns 1 if entire region is locked, 0 if any portion is unlocked, and
> + * negative on errors.
> + */
> +int stm_is_locked(struct spi_flash *flash, loff_t ofs, u32 len)
> +{
> +   int status;
> +   u8 sr;
> +
> +   status = spi_flash_cmd_read_status(flash, &sr);
> +   if (status < 0)
> +   return status;
> +
> +   return stm_is_locked_sr(flash, ofs, len, sr);
> +}
> +
> +/*
> + * Lock a region of the flash. Compatible with ST Micro and similar flash.
> + * Supports only the block protection bits BP{0,1,2} in the status register
> + * (SR). Does not support these features found in newer SR bitfields:
> + *   - TB: top/bottom protect - only handle TB=0 (top protect)
> + *   - SEC: sector/block protect - only handle SEC=0 (block protect)
> + *   - CMP: complement protect - only support CMP=0 (range is not 
> complemented)
> + *
> + * Sample table portion for 8MB flash (Winbond w25q64fw):
> + *
> + *   SEC  |  TB   |  BP2  |  BP1  |  BP0  |  Prot Length  | Protected Portion
> + *  
> --
> + *X   |   X   |   0   |   0   |   0   |  NONE | NONE
> + *0   |   0   |   0   |   0   |   1   |  128 KB   | Upper 1/64
> + *0   |   0   |   0   |   1   |   0   |  256 KB   | Upper 1/32
> + *0   |   0   |   0   |   1   |   1   |  512 KB   | Upper 1/16
> + *0   |   0   |   1   |   0   |   0   |  1 MB | Upper 1/8
> + *0   |   0   |   1   |   0   |   1   |  2 MB | Upper 1/4
> + *0   |   0   |   1   |   1   |   0   |  4 MB | Upper 1/2
> + *X   |   X   |   1   |   1   |   1   |  8 MB | ALL
> + *
> + * Returns negative on errors, 0 on success.
> + */
> +int stm_lock(struct spi_flash *flash, u32 ofs, u32 len)
> +{
> +   u8 status_old, status_new;
> +   u8 mask = SR_BP2 | SR_BP1 | SR_BP0;
> +   u8 shift = ffs(mask) - 1, pow, val;
> +
> +   spi_flash_cmd_read_status(flash, &status_old);
> +
> +   /* SPI NOR always locks to the end */
> +   if (ofs + len != flash->size) {
> +   /* Does combined region extend to end? */
> +   if (!stm_is_locked_sr(flash, ofs + len, flash->size - ofs - 
> len,
> + status_old))
> +   return -EINVAL;
> +   len = flash->size - ofs;
> +   }
> +
> +   /*
> +* Need smallest pow such that:
> +*
> +*   1 / (2^pow) <= (len / size)
> +*
> +* so (assuming power-of-2 size) we do:
> +*
> +*   pow = ceil(log2(size / len)) = log2(size) - floor(log2(len))
> +*/
> +   pow = ilog2(flash->size) - ilog2(len);
> +   val = mask - (pow << shift);
> +   if (val & ~mask)
> +   return -EINVAL;
> +
> +   /* Don't "lock" with no region! */
> +   

Re: [U-Boot] [PATCH] fsl_ddr: Make SR_IE configurable.

2015-10-30 Thread York Sun


On 10/14/2015 07:32 AM, Joakim Tjernlund wrote:
> SR_IE(Self-refresh interrupt enable) is needed for
> Hardware Based Self-Refresh. Make it configurable and let
> board code handle the rest.
> 
> Signed-off-by: Joakim Tjernlund 
> ---

Removed "." from subject.
Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH] ls102xa: Adjust some macros for SD boot on LS1021A QDS board

2015-10-30 Thread York Sun


On 10/30/2015 07:45 AM, Alison Wang wrote:
> As more features are added for SD boot on LS1021A QDS board,
> the size of U-Boot is larger. CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS
> needs to be adjusted to a suitable value.
> 
> Starting address of the malloc pool used in SPL needs to be
> adjusted too, or it will occupy the address u-boot loads.
> 
> Signed-off-by: Alison Wang 
> ---


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH v4 16/16] spi: Add SPI NOR protection mechanism

2015-10-30 Thread Jagan Teki
Hi Fabio,

On 26 October 2015 at 21:41, Fabio Estevam  wrote:
> Many SPI flashes have protection bits (BP2, BP1 and BP0) in the
> status register that can protect selected regions of the SPI NOR.
>
> Take these bits into account when performing erase operations,
> making sure that the protected areas are skipped.
>
> Tested on a mx6qsabresd:
>
> => sf probe
> SF: Detected M25P32 with page size 256 Bytes, erase size 64 KiB, total 4 MiB
> => sf protect lock  0x3f 0x1
> => sf erase 0x3f 0x1
> offset 0x3f is protected and cannot be erased
> SF: 65536 bytes @ 0x3f Erased: ERROR
> => sf protect unlock  0x3f 0x1
> => sf erase 0x3f 0x1
> SF: 65536 bytes @ 0x3f Erased: OK
>
> Signed-off-by: Fabio Estevam 
> Reviewed-by: Tom Rini 
> Reviewed-by: Heiko Schocher 
> ---
> Changes since v3:
> - None
>
>  common/cmd_sf.c   | 35 +++
>  drivers/mtd/spi/sf-uclass.c   |  8 
>  drivers/mtd/spi/sf_internal.h |  8 
>  drivers/mtd/spi/sf_ops.c  | 25 +
>  drivers/mtd/spi/sf_probe.c| 31 +++
>  include/spi_flash.h   | 41 +
>  6 files changed, 148 insertions(+)
>
> diff --git a/common/cmd_sf.c b/common/cmd_sf.c
> index ac7f5df..42862d9 100644
> --- a/common/cmd_sf.c
> +++ b/common/cmd_sf.c
> @@ -348,6 +348,37 @@ static int do_spi_flash_erase(int argc, char * const 
> argv[])
> return ret == 0 ? 0 : 1;
>  }
>
> +static int do_spi_protect(int argc, char * const argv[])
> +{
> +   int ret = 0;
> +   loff_t start, len;
> +   bool prot = false;
> +
> +   if (argc != 4)
> +   return -1;
> +
> +   if (!str2off(argv[2], &start)) {
> +   puts("start sector is not a valid number\n");
> +   return 1;
> +   }
> +
> +   if (!str2off(argv[3], &len)) {
> +   puts("len is not a valid number\n");
> +   return 1;
> +   }
> +
> +   if (strcmp(argv[1], "lock") == 0)
> +   prot = true;
> +   else if (strcmp(argv[1], "unlock") == 0)
> +   prot = false;
> +   else

Don't we have is_locked command from user? may be we can all this one as well.

> +   return -1;  /* Unknown parameter */
> +
> +   ret = spi_flash_protect(flash, start, len, prot);
> +
> +   return ret == 0 ? 0 : 1;
> +}
> +
>  #ifdef CONFIG_CMD_SF_TEST
>  enum {
> STAGE_ERASE,
> @@ -540,6 +571,8 @@ static int do_spi_flash(cmd_tbl_t *cmdtp, int flag, int 
> argc,
> ret = do_spi_flash_read_write(argc, argv);
> else if (strcmp(cmd, "erase") == 0)
> ret = do_spi_flash_erase(argc, argv);
> +   else if (strcmp(cmd, "protect") == 0)
> +   ret = do_spi_protect(argc, argv);
>  #ifdef CONFIG_CMD_SF_TEST
> else if (!strcmp(cmd, "test"))
> ret = do_spi_flash_test(argc, argv);
> @@ -579,5 +612,7 @@ U_BOOT_CMD(
> "sf update addr offset|partition len- erase and write `len' bytes 
> from memory\n"
> " at `addr' to flash at 
> `offset'\n"
> " or to start of mtd 
> `partition'\n"
> +   "sf protect lock/unlock sector len  - protect/unprotect 'len' 
> bytes starting\n"
> +   " at address 'sector'\n"
> SF_TEST_HELP
>  );
> diff --git a/drivers/mtd/spi/sf-uclass.c b/drivers/mtd/spi/sf-uclass.c
> index 350e21a..7663885 100644
> --- a/drivers/mtd/spi/sf-uclass.c
> +++ b/drivers/mtd/spi/sf-uclass.c
> @@ -27,6 +27,14 @@ int spi_flash_erase_dm(struct udevice *dev, u32 offset, 
> size_t len)
> return sf_get_ops(dev)->erase(dev, offset, len);
>  }
>
> +int spi_flash_protect_dm(struct udevice *dev, u32 offset, size_t len, bool 
> prot)
> +{
> +   if (prot)
> +   return sf_get_ops(dev)->lock(dev, offset, len);
> +   else
> +   return sf_get_ops(dev)->unlock(dev, offset, len);
> +}
> +
>  /*
>   * TODO(s...@chromium.org): This is an old-style function. We should remove
>   * it when all SPI flash drivers use dm
> diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
> index 9c95d56..33be598 100644
> --- a/drivers/mtd/spi/sf_internal.h
> +++ b/drivers/mtd/spi/sf_internal.h
> @@ -168,6 +168,10 @@ int spi_flash_cmd_read_status(struct spi_flash *flash, 
> u8 *rs);
>  /* Program the status register */
>  int spi_flash_cmd_write_status(struct spi_flash *flash, u8 ws);
>
> +int stm_is_locked(struct spi_flash *nor, loff_t ofs, u32 len);
> +int stm_lock(struct spi_flash *nor, u32 ofs, u32 len);
> +int stm_unlock(struct spi_flash *nor, u32 ofs, u32 len);
> +
>  /* Read the config register */
>  int spi_flash_cmd_read_config(struct spi_flash *flash, u8 *rc);
>
> @@ -222,6 +226,10 @@ int spi_flash_read_common(struct spi_flash *flash, const 
> u8 *cmd,
>  int spi_f

Re: [U-Boot] [PATCH] configs: ls1021atwr: Enable ID EEPROM for SD boot

2015-10-30 Thread York Sun


On 09/23/2015 12:48 AM, Yuan Yao wrote:
> I2C1 can work on ls102xa rev2.0 SD boot, so add
> ID EEPROM for SD boot.
> 
> Signed-off-by: Yuan Yao 
> ---


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH v3] colibri_vf: Add board_usb_phy_mode function

2015-10-30 Thread Stefan Agner
On 2015-10-30 09:24, Marek Vasut wrote:
> On Friday, October 30, 2015 at 05:12:54 PM, Stefan Agner wrote:
>> Hi All,
> 
> Hi!
> 
>> On 2015-10-30 05:26, Sanchayan Maity wrote:
>> > +
>> > +int board_usb_phy_mode(int port)
>> > +{
>> > +  switch (port) {
>> > +  case 0:
>> > +  return gpio_get_value(USB_CDET_GPIO);
>> > +  break;
>> > +  case 1:
>> > +  return USB_INIT_HOST;
>> > +  break;
>> > +  default:
>> > +  return USB_INIT_HOST;
>> > +  break;
>>
>> One thing I would like to note in this whole discussion is that the old
>> setup is kind of the "default" role of each dual-role controller: The
>> boot ROM uses USB1 as client, the tower board uses this configuration
>> too... So maybe we could/should keep that default role at least in here?
> 
> Well we cannot, since this is a custom board, right ?

Ah sorry, the switch statement is enumerating the port numbers, hence
this default refers to ports > 2. Somehow read that the wrong way
around.

Sorry for the noise.

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


Re: [U-Boot] [PATCH] arm: ls1021atwr: optimize the deep sleep latency

2015-10-30 Thread York Sun


On 09/24/2015 12:52 AM, Tang Yuantian wrote:
> It will take more than 1s when wake up from deep sleep. Most of the
> time is spent on outputing information. This patch reduced the deep
> sleep latency by:
> 1. avoid outputing system informaton
> 2. remove flush cache after DDR restore
> 3. skip reloading second stage uboot binary when SD boot
> 
> Signed-off-by: Tang Yuantian 
> ---


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH] SECURE_BOOT: Correct reading of ITS bit

2015-10-30 Thread York Sun


On 10/12/2015 09:35 AM, Aneesh Bansal wrote:
> The ITS bit was being read incorrectly beacause of operator
> precedence. The same ahs been corrected.
> 
> Signed-off-by: Lawish Deshmukh 
> Signed-off-by: Aneesh Bansal 
> ---


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


[U-Boot] Ethernet i210 (e1000 driver) on tegra K1

2015-10-30 Thread Ivan Mercier

Hi,

I'm using a ethernet controller intel i210 
(http://www.commell.com.tw/product/Surveillance/MPX-210.htm) on my 
nvidia tegra k1 jetson.


I not an expert with pci, but the only way to make it working in u-boot 
(upstream) is with the workaround below.


E1000 is very common, so finding a critical bug in this driver seems 
weird...

Do you think there is a bug in e1000.c or in tegra pci layer?


diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index 2ba03ed..206884d 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -5186,7 +5186,7 @@ static int _e1000_transmit(struct e1000_hw *hw, 
void *txpacket, int length)

 txp = tx_base + tx_tail;
 tx_tail = (tx_tail + 1) % 8;

-txp->buffer_addr = cpu_to_le64(virt_to_bus(hw->pdev, nv_packet));
+txp->buffer_addr = cpu_to_le64((unsigned long) nv_packet);
 txp->lower.data = cpu_to_le32(hw->txd_cmd | length);
 txp->upper.data = 0;



thank you

--
Best regards / Bien cordialement

Ivan Mercier

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


Re: [U-Boot] [PATCH] arm: ls102xa: Set fdt_high and initrd_high to the value of 0xffffffff

2015-10-30 Thread York Sun


On 10/25/2015 11:08 PM, Alison Wang wrote:
> As 3G/1G user/kernel memory split is used on LS1021A, the Linux kernel
> fails to access the device tree blob on boot. The reason is that u-boot
> relocates the device tree blob into high memory when booting the kernel
> and the kernel is unable to access the blob.
> 
> To avoid this issue, fdt_high is set to the value of 0x. The
> device tree blob will not get relocated and is still in low memory to
> make it accessible to the kernel.
> 
> For the same reason, initrd_high is set to the value of 0x too.
> 
> Signed-off-by: Alison Wang 
> ---


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH v3] arm: ls1021a: Add sata support on qds and twr board

2015-10-30 Thread York Sun


On 10/16/2015 01:06 AM, Tang Yuantian wrote:
> Freescale ARM-based Layerscape LS102xA contain a SATA controller
> which comply with the serial ATA 3.0 specification and the
> AHCI 1.3 specification.
> This patch adds SATA feature on ls1021aqds and ls1021atwr boards.
> 
> Signed-off-by: Tang Yuantian 
> ---
> v3:
>   - refactor the framework
>   - replace hard coding with MICRO
> v2:
>   - rebase to latest git tree
>   - use micro SATA_ECC_REG_ADDR instead of hard coding 


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [Patch V8 00/17] add LS1043A platform support

2015-10-30 Thread York Sun


On 10/26/2015 04:47 AM, Gong Qianyu wrote:
> Hi all,
> 
> Here are the changes for V8 patchset. Please help to review them.
> 
>  - Update the patch based on the latest U-Boot code.
>  - Remove "net/fm/eth: Use mb() to be compatible for both ARM"
> 
> [Patch V8 01/17] common/board_f.c: change the macro name and remove
> [Patch V8 02/17] armv7/ls1021a: move ns_access to common file
> [Patch V8 03/17] net/fm: Fix the endian issue to support both
> [Patch V8 04/17] net/fm: Add support for 64-bit platforms
> [Patch V8 05/17] net/fm: Make the return value logic consistent with
> [Patch V8 06/17] net: fm: bug fix when CONFIG_PHYLIB not defined
> [Patch V8 07/17] net: Move some header files to include/
> [Patch V8 08/17] net/fm: Add QSGMII PCS init
> [Patch V8 09/17] net/fm: fix MDIO controller base on FMAN2
> [Patch V8 10/17] armv8/fsl_lsch3: Change arch to fsl-layerscape
> [Patch V8 11/17] armv8/fsl_lsch2: Add fsl_lsch2 SoC
> [Patch V8 12/17] armv8/ls1043ardb: Add LS1043ARDB board support
> [Patch V8 13/17] armv8/ls1043ardb: Add nand boot support
> [Patch V8 14/17] armv8/ls1043a: Add Fman support
> [Patch V8 15/17] armv8/ls1043ardb: esdhc: Add esdhc support for
> [Patch V8 16/17] armv8/ls1043ardb: Add sd boot support
> [Patch V8 17/17] armv8/ls1043a: Enable secondary cores
> 


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

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


Re: [U-Boot] [PATCH 2/2][v3] armv8: ls2085a: Add support of random MAC address

2015-10-30 Thread York Sun


On 10/07/2015 04:00 AM, Prabhakar Kushwaha wrote:
> Add support of setting RANDOM MAC address if env variable not available.
> 
> Signed-off-by: Prabhakar Kushwaha 
> ---
> Changs for v2: Incorporated Bin Meng's comments
>  - Moved defines to defconfig
>  - updated subject
> Changes for v3: Incorporated Bin Meng's comments
>  - Removed CONFIG_LIB_RAND
>  - used make savedefconfig to generate defconfigs
> 


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH 1/2][v3] driver: net: ldpaa_eth: Set MAC address during interface open

2015-10-30 Thread York Sun


On 10/07/2015 03:59 AM, Prabhakar Kushwaha wrote:
> Currently ldpaa ethernet driver rely on DPL file to statically configure
> mac address for the DPNIs. It is not a correct approach.
> 
> Add support setting MAC address from env variable or Random MAC address.
> 
> Signed-off-by: Prabhakar Kushwaha 
> ---
> Changs for v2: Sending as it is
> Changs for v3: Sending as it is
> 


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH v2] arm: ls102xa: enable snooping for CAAM transactions

2015-10-30 Thread York Sun


On 10/15/2015 04:21 AM, Horia Geantă wrote:
> Enable snooping for CAAM read & write transactions by
> programming the SCFG snoop configuration register:
> SCFG_SNPCNFGCR[SECRDSNP]
> SCFG_SNPCNFGCR[SECWRSNP]
> 
> Signed-off-by: Horia Geantă 
> Reviewed-by: Zhengxiong Jin 
> ---
> 
> v2 - moved initialization in arch_cpu_init (instead of board_early_init_f),
> as suggested by York.


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH] ls102xa: fdt: Disable IFC in SD boot for QSPI

2015-10-30 Thread York Sun


On 10/27/2015 07:40 PM, Alison Wang wrote:
> As QSPI/DSPI and IFC are pin multiplexed, IFC is disabled
> in SD boot for QSPI. This patch will add fdt support for
> this rule.
> 
> Signed-off-by: Alison Wang 
> ---


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH] armv8: ls2085ardb: enable CONFIG_PHY_AQUANTIA

2015-10-30 Thread York Sun


On 09/24/2015 03:20 AM, shh@gmail.com wrote:
> From: Shaohui Xie 
> 
> To support on board Aquantia's PHY AQR405.
> 
> Signed-off-by: Shaohui Xie 
> ---


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH 3/3][v5] crypto/fsl: SEC driver cleanup for 64 bit and endianness

2015-10-30 Thread York Sun


On 10/29/2015 10:28 AM, Aneesh Bansal wrote:
> The SEC driver code has been cleaned up to work for 64 bit
> physical addresses and systems where endianess of SEC block
> is different from the Core.
> Changes:
> 1. Descriptor created on Core is modified as per SEC block
>endianness before the job is submitted.
> 2. The read/write of physical addresses to Job Rings will
>be depend on endianness of SEC block as 32 bit low and
>high part of the 64 bit address will vary.
> 3. The 32 bit low and high part of the 64 bit address in
>descriptor will vary depending on endianness of SEC.
> 
> Signed-off-by: Aneesh Bansal 
> ---
> Changes in v5:
> Removed compile time warnings


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH 1/3][v3] Pointers in ESBC header made 32 bit

2015-10-30 Thread York Sun


On 09/17/2015 03:46 AM, Aneesh Bansal wrote:
> For the Chain of Trust, the esbc_validate command supports
> 32 bit fields for location of the image. In the header structure
> definition, these were declared as pointers which made them
> 64 bit on a 64 bit core.
> 
> Signed-off-by: Aneesh Bansal 
> ---
> Changes in v3:
> Patch Rebased and removed compile time warnings


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH v3] colibri_vf: Add board_usb_phy_mode function

2015-10-30 Thread Stefan Agner
Hi All,

On 2015-10-30 05:26, Sanchayan Maity wrote:
> +
> +int board_usb_phy_mode(int port)
> +{
> + switch (port) {
> + case 0:
> + return gpio_get_value(USB_CDET_GPIO);
> + break;
> + case 1:
> + return USB_INIT_HOST;
> + break;
> + default:
> + return USB_INIT_HOST;
> + break;

One thing I would like to note in this whole discussion is that the old
setup is kind of the "default" role of each dual-role controller: The
boot ROM uses USB1 as client, the tower board uses this configuration
too... So maybe we could/should keep that default role at least in here?

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


Re: [U-Boot] [PATCH v2] arm: ls1021a: Add QSPI or IFC support in SD boot

2015-10-30 Thread York Sun


On 10/15/2015 02:54 AM, Alison Wang wrote:
> As QSPI and IFC are pin-multiplexed on LS1021A, only IFC is supported in
> SD boot now. For the customer's demand, QSPI needs to be supported in SD
> boot too.
> 
> This patch adds QSPI or IFC support in SD boot according to the
> corresponding defconfig. For detail, ls1021atwr_sdcard_ifc_defconfig is
> used to support IFC in SD boot and ls1021atwr_sdcard_qspi_defconfig is
> used to support QSPI in SD boot.
> 
> Signed-off-by: Alison Wang 
> ---
> Changes in v2:
> - Fix checkpatch warnings about line over 80 characters.
> 


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH] armv8/fsl-lsch3: fdt: Check the pointer returned from call to a function may be NULL

2015-10-30 Thread York Sun


On 08/31/2015 07:47 PM, Alison Wang wrote:
> Pointer 'reg' returned from call to function 'fdt_getprop' may be
> NULL, will be passed to function and may be dereferenced there by
> passing argument 1 to function 'of_read_number'. So check pointer
> 'reg' first.
> 
> Signed-off-by: Alison Wang 
> ---


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH 1/2] arm/fsl-ls: Add CONFIG_OF_STDOUT_VIA_ALIAS

2015-10-30 Thread York Sun


On 08/31/2015 07:05 PM, Scott Wood wrote:
> This will allow OF-based earlycon to be used once the appropriate
> aliases are added to the device tree and kernel support is fixed.
> 
> Signed-off-by: Scott Wood 
> ---

Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

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


Re: [U-Boot] [PATCH v2 2/2] fdt_support: Don't panic if stdout alias is missing

2015-10-30 Thread York Sun


On 09/01/2015 08:48 PM, Scott Wood wrote:
> Currently, using fdt_fixup_stdout() on a device tree that is missing
> the relevant alias results in this:
> 
> WARNING: could not set linux,stdout-path FDT_ERR_NOTFOUND.
> ERROR: /chosen node create failed
>  - must RESET the board to recover.
> 
> FDT creation failed! hanging...### ERROR ### Please RESET the board ###
> 
> There is no reason for this to be a fatal error rather than a warning,
> and removing this allows for a smooth transition on a platform where
> the device tree currently lacks the correct aliases but will have them
> in the future.
> 
> Signed-off-by: Scott Wood 
> Cc: Kumar Gala 
> Cc: Simon Glass 
> ---
> v2: Only continue booting if the problem was a missing alias, not
> the inability to write to the device tree.
> ---
>  common/fdt_support.c | 11 ---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH] QE: modify the address of qe ucode

2015-10-30 Thread York Sun


On 09/16/2015 01:20 AM, Zhao Qiang wrote:
> From: Zhao Qiang 
> 
> the address of uboot changed, so change qe ucode
> 
> Signed-off-by: Zhao Qiang 
> ---


Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.

York

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


[U-Boot] [PATCH] usb: dwc3: Fix warnings on 64-bit builds

2015-10-30 Thread Michal Simek
Change aritmentics to use 64bit types to be compatible with 64bit
builds.

Signed-off-by: Michal Simek 
---

 drivers/usb/dwc3/core.c   |  7 ---
 drivers/usb/dwc3/ep0.c| 10 +-
 drivers/usb/dwc3/gadget.c | 10 +-
 drivers/usb/dwc3/io.h |  4 ++--
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index ab3c94e51275..0ae3de5c27b9 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -281,7 +281,7 @@ static int dwc3_setup_scratch_buffers(struct dwc3 *dwc)
return 0;
 
 err1:
-   dma_unmap_single((void *)dwc->scratch_addr, dwc->nr_scratch *
+   dma_unmap_single((void *)(uintptr_t)dwc->scratch_addr, dwc->nr_scratch *
 DWC3_SCRATCHBUF_SIZE, DMA_BIDIRECTIONAL);
 
 err0:
@@ -296,7 +296,7 @@ static void dwc3_free_scratch_buffers(struct dwc3 *dwc)
if (!dwc->nr_scratch)
return;
 
-   dma_unmap_single((void *)dwc->scratch_addr, dwc->nr_scratch *
+   dma_unmap_single((void *)(uintptr_t)dwc->scratch_addr, dwc->nr_scratch *
 DWC3_SCRATCHBUF_SIZE, DMA_BIDIRECTIONAL);
kfree(dwc->scratchbuf);
 }
@@ -629,7 +629,8 @@ int dwc3_uboot_init(struct dwc3_device *dwc3_dev)
dwc = PTR_ALIGN(mem, DWC3_ALIGN_MASK + 1);
dwc->mem = mem;
 
-   dwc->regs   = (int *)(dwc3_dev->base + DWC3_GLOBALS_REGS_START);
+   dwc->regs = (void *)(uintptr_t)(dwc3_dev->base +
+   DWC3_GLOBALS_REGS_START);
 
/* default to highest possible threshold */
lpm_nyet_threshold = 0xff;
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index aba614fb4e98..12b133f93e17 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -81,8 +81,8 @@ static int dwc3_ep0_start_trans(struct dwc3 *dwc, u8 epnum, 
dma_addr_t buf_dma,
trb->ctrl |= (DWC3_TRB_CTRL_IOC
| DWC3_TRB_CTRL_LST);
 
-   dwc3_flush_cache((int)buf_dma, len);
-   dwc3_flush_cache((int)trb, sizeof(*trb));
+   dwc3_flush_cache((long)buf_dma, len);
+   dwc3_flush_cache((long)trb, sizeof(*trb));
 
if (chain)
return 0;
@@ -790,7 +790,7 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
if (!r)
return;
 
-   dwc3_flush_cache((int)trb, sizeof(*trb));
+   dwc3_flush_cache((long)trb, sizeof(*trb));
 
status = DWC3_TRB_SIZE_TRBSTS(trb->size);
if (status == DWC3_TRBSTS_SETUP_PENDING) {
@@ -821,7 +821,7 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
ur->actual += transferred;
 
trb++;
-   dwc3_flush_cache((int)trb, sizeof(*trb));
+   dwc3_flush_cache((long)trb, sizeof(*trb));
length = trb->size & DWC3_TRB_SIZE_MASK;
 
ep0->free_slot = 0;
@@ -831,7 +831,7 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
maxp);
transferred = min_t(u32, ur->length - transferred,
transfer_size - length);
-   dwc3_flush_cache((int)dwc->ep0_bounce, DWC3_EP0_BOUNCE_SIZE);
+   dwc3_flush_cache((long)dwc->ep0_bounce, DWC3_EP0_BOUNCE_SIZE);
memcpy(buf, dwc->ep0_bounce, transferred);
} else {
transferred = ur->length - length;
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index f3d649a5ee2f..8ff949d241f6 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -244,7 +244,7 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct 
dwc3_request *req,
 
list_del(&req->list);
req->trb = NULL;
-   dwc3_flush_cache((int)req->request.dma, req->request.length);
+   dwc3_flush_cache((long)req->request.dma, req->request.length);
 
if (req->request.status == -EINPROGRESS)
req->request.status = status;
@@ -771,8 +771,8 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
 
trb->ctrl |= DWC3_TRB_CTRL_HWO;
 
-   dwc3_flush_cache((int)dma, length);
-   dwc3_flush_cache((int)trb, sizeof(*trb));
+   dwc3_flush_cache((long)dma, length);
+   dwc3_flush_cache((long)trb, sizeof(*trb));
 }
 
 /*
@@ -1769,7 +1769,7 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, 
struct dwc3_ep *dep,
slot %= DWC3_TRB_NUM;
trb = &dep->trb_pool[slot];
 
-   dwc3_flush_cache((int)trb, sizeof(*trb));
+   dwc3_flush_cache((long)trb, sizeof(*trb));
__dwc3_cleanup_done_trbs(dwc, dep, req, trb, event, status);
dwc3_gadget_giveback(dep, req, status);
 
@@ -2670,7 +2670,7 @@ void dwc3_gadget_uboot_handle_interrupt(struct dwc3 *dwc)
 
for (i = 0; i < dwc->num_event_buffers; i++) {
evt = dwc->ev_buffs[i];
-   dwc3_flush_cache((int)evt->bu

[U-Boot] [PATCH] usb: udc: Fix warnings on 64-bit builds

2015-10-30 Thread Michal Simek
Cast u32 bit value to 64bit before recasting to 64bit pointer to avoid
pointer from integer cast size mismatch warnings.

Warning log:
+../drivers/usb/gadget/udc/udc-core.c: In function
‘usb_gadget_unmap_request’:
+../drivers/usb/gadget/udc/udc-core.c:68:19: warning: cast to pointer
from integer of different size [-Wint-to-pointer-cast]

Signed-off-by: Michal Simek 
---

 drivers/usb/gadget/udc/udc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/udc-core.c 
b/drivers/usb/gadget/udc/udc-core.c
index 875e998a82e3..326757b547fa 100644
--- a/drivers/usb/gadget/udc/udc-core.c
+++ b/drivers/usb/gadget/udc/udc-core.c
@@ -65,7 +65,7 @@ void usb_gadget_unmap_request(struct usb_gadget *gadget,
if (req->length == 0)
return;
 
-   dma_unmap_single((void *)req->dma, req->length,
+   dma_unmap_single((void *)(uintptr_t)req->dma, req->length,
 is_in ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
 }
 EXPORT_SYMBOL_GPL(usb_gadget_unmap_request);
-- 
2.5.0

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


[U-Boot] [PATCH] usb: lthor: Specify correct parameter for sizeof type

2015-10-30 Thread Michal Simek
This patch removes this warning:
  CC  drivers/usb/gadget/f_thor.o
drivers/usb/gadget/f_thor.c: In function ‘thor_tx_data’:
drivers/usb/gadget/f_thor.c:572:2: warning: format ‘%d’ expects argument
of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat=]
  debug("%s: dev->in_req->length:%d to_cpy:%d\n", __func__,
  ^

Signed-off-by: Michal Simek 
---

 drivers/usb/gadget/f_thor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c
index ff1481ba3723..9ed0ce3d3132 100644
--- a/drivers/usb/gadget/f_thor.c
+++ b/drivers/usb/gadget/f_thor.c
@@ -569,7 +569,7 @@ static void thor_tx_data(unsigned char *data, int len)
 
dev->in_req->length = len;
 
-   debug("%s: dev->in_req->length:%d to_cpy:%d\n", __func__,
+   debug("%s: dev->in_req->length:%d to_cpy:%zd\n", __func__,
  dev->in_req->length, sizeof(data));
 
status = usb_ep_queue(dev->in_ep, dev->in_req, 0);
-- 
2.5.0

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


Re: [U-Boot] [PATCH] Allow fw env tools to be available as library

2015-10-30 Thread Tom Rini
On Fri, Oct 30, 2015 at 02:57:04PM +0100, Stefano Babic wrote:

> Sometimes it can be useful to link the fw_ tools instead
> of having the fw_setenv/fw_printenv installed.
> Patch exports the tool as library and allowes to link it
> with own programs.
> 
> Signed-off-by: Stefano Babic 
> CC: Tom Rini 

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


[U-Boot] [PATCH] net: gem: Build warning fixes for 64-bit

2015-10-30 Thread Michal Simek
Cast pointers to unsigned long instead of a sized 32-bit type to avoid
pointer to integer cast size mismatch warnings.

Signed-off-by: Michal Simek 
---

 drivers/net/zynq_gem.c | 23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 045954a7b059..ee2c6b1f4579 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -347,13 +347,13 @@ static int zynq_gem_init(struct eth_device *dev, bd_t * 
bis)
for (i = 0; i < RX_BUF; i++) {
priv->rx_bd[i].status = 0xF000;
priv->rx_bd[i].addr =
-   ((u32)(priv->rxbuffers) +
+   ((unsigned long)(priv->rxbuffers) +
(i * PKTSIZE_ALIGN));
}
/* WRAP bit to last BD */
priv->rx_bd[--i].addr |= ZYNQ_GEM_RXBUF_WRAP_MASK;
/* Write RxBDs to IP */
-   writel((u32)priv->rx_bd, ®s->rxqbase);
+   writel((unsigned long)priv->rx_bd, ®s->rxqbase);
 
/* Setup for DMA Configuration register */
writel(ZYNQ_GEM_DMACR_INIT, ®s->dmacr);
@@ -378,8 +378,8 @@ static int zynq_gem_init(struct eth_device *dev, bd_t * bis)
flush_dcache_range((ulong)&dummy_rx_bd, (ulong)&dummy_rx_bd +
   sizeof(dummy_rx_bd));
 
-   writel((u32)dummy_tx_bd, ®s->transmit_q1_ptr);
-   writel((u32)dummy_rx_bd, ®s->receive_q1_ptr);
+   writel((unsigned long)dummy_tx_bd, ®s->transmit_q1_ptr);
+   writel((unsigned long)dummy_rx_bd, ®s->receive_q1_ptr);
 
priv->init++;
}
@@ -458,7 +458,7 @@ static inline int wait_for_bit(const char *func, u32 *reg, 
const u32 mask,
 
 static int zynq_gem_send(struct eth_device *dev, void *ptr, int len)
 {
-   u32 addr, size;
+   unsigned long addr, size;
struct zynq_gem_priv *priv = dev->priv;
struct zynq_gem_regs *regs = (struct zynq_gem_regs *)dev->iobase;
struct emac_bd *current_bd = &priv->tx_bd[1];
@@ -466,7 +466,7 @@ static int zynq_gem_send(struct eth_device *dev, void *ptr, 
int len)
/* Setup Tx BD */
memset(priv->tx_bd, 0, sizeof(struct emac_bd));
 
-   priv->tx_bd->addr = (u32)ptr;
+   priv->tx_bd->addr = (unsigned long)ptr;
priv->tx_bd->status = (len & ZYNQ_GEM_TXBUF_FRMLEN_MASK) |
   ZYNQ_GEM_TXBUF_LAST_MASK;
/* Dummy descriptor to mark it as the last in descriptor chain */
@@ -476,14 +476,14 @@ static int zynq_gem_send(struct eth_device *dev, void 
*ptr, int len)
 ZYNQ_GEM_TXBUF_USED_MASK;
 
/* setup BD */
-   writel((u32)priv->tx_bd, ®s->txqbase);
+   writel((unsigned long)priv->tx_bd, ®s->txqbase);
 
-   addr = (u32) ptr;
+   addr = (unsigned long)ptr;
addr &= ~(ARCH_DMA_MINALIGN - 1);
size = roundup(len, ARCH_DMA_MINALIGN);
flush_dcache_range(addr, addr + size);
 
-   addr = (u32)priv->rxbuffers;
+   addr = (unsigned long)priv->rxbuffers;
addr &= ~(ARCH_DMA_MINALIGN - 1);
size = roundup((RX_BUF * PKTSIZE_ALIGN), ARCH_DMA_MINALIGN);
flush_dcache_range(addr, addr + size);
@@ -519,7 +519,7 @@ static int zynq_gem_recv(struct eth_device *dev)
 
frame_len = current_bd->status & ZYNQ_GEM_RXBUF_LEN_MASK;
if (frame_len) {
-   u32 addr = current_bd->addr & ZYNQ_GEM_RXBUF_ADD_MASK;
+   unsigned long addr = current_bd->addr & ZYNQ_GEM_RXBUF_ADD_MASK;
addr &= ~(ARCH_DMA_MINALIGN - 1);
 
net_process_received_packet((u8 *)addr, frame_len);
@@ -601,7 +601,8 @@ int zynq_gem_initialize(bd_t *bis, phys_addr_t base_addr,
 
/* Initialize the bd spaces for tx and rx bd's */
priv->tx_bd = (struct emac_bd *)bd_space;
-   priv->rx_bd = (struct emac_bd *)((u32)bd_space + BD_SEPRN_SPACE);
+   priv->rx_bd = (struct emac_bd *)((unsigned long)bd_space +
+BD_SEPRN_SPACE);
 
priv->phyaddr = phy_addr;
priv->emio = emio;
-- 
2.5.0

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


[U-Boot] [PATCH v2 3/3] dm: sf: Add support for all targets which requires MANUAL_RELOC

2015-10-30 Thread Michal Simek
It is follow up patch based on
"dm: Add support for all targets which requires MANUAL_RELOC"
(sha1: 484fdf5ba058b07be5ca82763aa2b72063540ef3)
to update function pointers for DM.

Using post_bind is not ideal but it is one on current option what can be
used. Variable reloc_done has to be used do not call relocation after
every bind. Maybe new core functions should be introduced for this case.

Signed-off-by: Michal Simek 
---

Changes in v2:
- Add checking for MANUAL_RELOC code only

 drivers/mtd/spi/sf-uclass.c | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/drivers/mtd/spi/sf-uclass.c b/drivers/mtd/spi/sf-uclass.c
index 350e21aa7d65..72e0f6b3fb1e 100644
--- a/drivers/mtd/spi/sf-uclass.c
+++ b/drivers/mtd/spi/sf-uclass.c
@@ -11,6 +11,8 @@
 #include 
 #include "sf_internal.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int spi_flash_read_dm(struct udevice *dev, u32 offset, size_t len, void *buf)
 {
return sf_get_ops(dev)->read(dev, offset, len, buf);
@@ -72,8 +74,29 @@ int spi_flash_remove(struct udevice *dev)
return device_remove(dev);
 }
 
+static int spi_flash_post_bind(struct udevice *dev)
+{
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
+   struct dm_spi_flash_ops *ops = sf_get_ops(dev);
+   static int reloc_done;
+
+   if (!reloc_done) {
+   if (ops->read)
+   ops->read += gd->reloc_off;
+   if (ops->write)
+   ops->write += gd->reloc_off;
+   if (ops->erase)
+   ops->erase += gd->reloc_off;
+
+   reloc_done++;
+   }
+#endif
+   return 0;
+}
+
 UCLASS_DRIVER(spi_flash) = {
.id = UCLASS_SPI_FLASH,
.name   = "spi_flash",
+   .post_bind  = spi_flash_post_bind,
.per_device_auto_alloc_size = sizeof(struct spi_flash),
 };
-- 
2.5.0

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


[U-Boot] [PATCH v2 2/3] dm: core: Add missing entries for manual relocation

2015-10-30 Thread Michal Simek
Patches:
"dm: core: Add a post_bind method for parents"
(sha1: 0118ce79577f9b0881f99a6e4f8a79cd5014cb87)
"dm: core: Add a uclass pre_probe() method for devices"
(sha1: 02c07b3741f1b825934b1a6eb8f23530532dc426)
"dm: core: Allow the uclass to set up a device's child after binding"
(sha1: 081f2fcbd9a95ba10677065359791f8fea3f8c58)
"dm: core: Allow uclass to set up a device's child before it is probed"
(sha1: 83c7e434c9dd3ca81f8b763e23c1881b973bcf2f)

Adds new entries to struct driver and struct uclass_driver without
extending code for manual relocation. This patch fixes it for all
architectures which requires MANUAL_RELOC.

Signed-off-by: Michal Simek 
Acked-by: Simon Glass 
---

Changes in v2: None

 drivers/core/root.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index bdb394a9ae21..e7b1f249682e 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -59,6 +59,8 @@ void fix_drivers(void)
entry->unbind += gd->reloc_off;
if (entry->ofdata_to_platdata)
entry->ofdata_to_platdata += gd->reloc_off;
+   if (entry->child_post_bind)
+   entry->child_post_bind += gd->reloc_off;
if (entry->child_pre_probe)
entry->child_pre_probe += gd->reloc_off;
if (entry->child_post_remove)
@@ -81,10 +83,16 @@ void fix_uclass(void)
entry->post_bind += gd->reloc_off;
if (entry->pre_unbind)
entry->pre_unbind += gd->reloc_off;
+   if (entry->pre_probe)
+   entry->pre_probe += gd->reloc_off;
if (entry->post_probe)
entry->post_probe += gd->reloc_off;
if (entry->pre_remove)
entry->pre_remove += gd->reloc_off;
+   if (entry->child_post_bind)
+   entry->child_post_bind += gd->reloc_off;
+   if (entry->child_pre_probe)
+   entry->child_pre_probe += gd->reloc_off;
if (entry->init)
entry->init += gd->reloc_off;
if (entry->destroy)
-- 
2.5.0

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


[U-Boot] [PATCH v2 1/3] dm: spi: Add support for all targets which requires MANUAL_RELOC

2015-10-30 Thread Michal Simek
It is follow up patch based on
"dm: Add support for all targets which requires MANUAL_RELOC"
(sha1: 484fdf5ba058b07be5ca82763aa2b72063540ef3)
to update function pointers for DM.

Signed-off-by: Michal Simek 
Acked-by: Simon Glass 
---

Changes in v2: None

 drivers/spi/spi-uclass.c | 20 
 1 file changed, 20 insertions(+)

diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c
index d666272e39ce..27409fb088ea 100644
--- a/drivers/spi/spi-uclass.c
+++ b/drivers/spi/spi-uclass.c
@@ -118,6 +118,26 @@ static int spi_post_probe(struct udevice *bus)
spi->max_hz = fdtdec_get_int(gd->fdt_blob, bus->of_offset,
 "spi-max-frequency", 0);
 
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
+   struct dm_spi_ops *ops = spi_get_ops(bus);
+
+
+   if (ops->claim_bus)
+   ops->claim_bus += gd->reloc_off;
+   if (ops->release_bus)
+   ops->release_bus += gd->reloc_off;
+   if (ops->set_wordlen)
+   ops->set_wordlen += gd->reloc_off;
+   if (ops->xfer)
+   ops->xfer += gd->reloc_off;
+   if (ops->set_speed)
+   ops->set_speed += gd->reloc_off;
+   if (ops->set_mode)
+   ops->set_mode += gd->reloc_off;
+   if (ops->cs_info)
+   ops->cs_info += gd->reloc_off;
+#endif
+
return 0;
 }
 
-- 
2.5.0

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


Re: [U-Boot] [PATCH v4 07/16] sh: bitops: Use the generic bitops headers

2015-10-30 Thread Fabio Estevam
On Fri, Oct 30, 2015 at 4:18 AM, Jagan Teki  wrote:
> On 26 October 2015 at 21:41, Fabio Estevam  
> wrote:
>> The generic bitops headers are required when calling logarithimic
>> functions, such as ilog2().
>>
>> Signed-off-by: Fabio Estevam 
>> Reviewed-by: Tom Rini 
>> Reviewed-by: Heiko Schocher 
>> ---
>
> Reviewed-by: Jagan Teki 
>
>> Changes since v3:
>> - None
>>
>>  arch/microblaze/include/asm/bitops.h | 4 
>>  arch/sh/include/asm/bitops.h | 5 +
>
> This patch need to break for two for sh and microblaze, anyway I shall
> do that while applying.

Ops, my mistake. Thanks for taking care of this.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] zynq-common: Define CONFIG_SYS_I2C_ZYNQ based on board config

2015-10-30 Thread Michal Simek
From: Siva Durga Prasad Paladugu 

Enable CONFIG_SYS_I2C_ZYNQ only if it has either I2C0 or I2C1
enabled in a board config.This fixes the issue of i2c error
during board init if board specific doesnt have either I2C0
or I2C1.

Signed-off-by: Siva Durga Prasad Paladugu 
Signed-off-by: Michal Simek 
---

 include/configs/zynq-common.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index ca5ef0430234..2d98cd27a986 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -179,7 +179,10 @@
 # define CONFIG_CMD_FS_GENERIC
 #endif
 
+#if defined(CONFIG_ZYNQ_I2C0) || defined(CONFIG_ZYNQ_I2C1)
 #define CONFIG_SYS_I2C_ZYNQ
+#endif
+
 /* I2C */
 #if defined(CONFIG_SYS_I2C_ZYNQ)
 # define CONFIG_CMD_I2C
-- 
2.5.0

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


[U-Boot] [PATCH 2/2] ARM: zynqmp: Add DTS for ep108 board

2015-10-30 Thread Michal Simek
Add DTS for ep108 board.

Signed-off-by: Michal Simek 
---

 arch/arm/dts/Makefile  |   2 +
 arch/arm/dts/zynqmp-ep108-clk.dtsi | 119 +++
 arch/arm/dts/zynqmp-ep108.dts  | 174 ++
 arch/arm/dts/zynqmp.dtsi   | 668 +
 4 files changed, 963 insertions(+)
 create mode 100644 arch/arm/dts/zynqmp-ep108-clk.dtsi
 create mode 100644 arch/arm/dts/zynqmp-ep108.dts
 create mode 100644 arch/arm/dts/zynqmp.dtsi

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index ddc6a057d567..910648ca2dba 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -65,6 +65,8 @@ dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \
zynq-zc770-xm011.dtb \
zynq-zc770-xm012.dtb \
zynq-zc770-xm013.dtb
+dtb-$(CONFIG_ARCH_ZYNQMP) += \
+   zynqmp-ep108.dtb
 dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-evm.dtb
 dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb am437x-sk-evm.dtb
 
diff --git a/arch/arm/dts/zynqmp-ep108-clk.dtsi 
b/arch/arm/dts/zynqmp-ep108-clk.dtsi
new file mode 100644
index ..f86452655391
--- /dev/null
+++ b/arch/arm/dts/zynqmp-ep108-clk.dtsi
@@ -0,0 +1,119 @@
+/*
+ * clock specification for Xilinx ZynqMP ep108 development board
+ *
+ * (C) Copyright 2015, Xilinx, Inc.
+ *
+ * Michal Simek 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+&amba {
+   misc_clk: misc_clk {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <2500>;
+   };
+
+   i2c_clk: i2c_clk {
+   compatible = "fixed-clock";
+   #clock-cells = <0x0>;
+   clock-frequency = <1>;
+   };
+
+   sata_clk: sata_clk {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <7500>;
+   };
+
+   dp_aclk: clock0 {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <5000>;
+   clock-accuracy = <100>;
+   };
+
+   dp_aud_clk: clock1 {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <22579200>;
+   clock-accuracy = <100>;
+   };
+};
+
+&can0 {
+   clocks = <&misc_clk &misc_clk>;
+};
+
+&gem0 {
+   clocks = <&misc_clk>, <&misc_clk>, <&misc_clk>;
+};
+
+&gpio {
+   clocks = <&misc_clk>;
+};
+
+&i2c0 {
+   clocks = <&i2c_clk>;
+};
+
+&i2c1 {
+   clocks = <&i2c_clk>;
+};
+
+&qspi {
+   clocks = <&misc_clk &misc_clk>;
+};
+
+&sata {
+   clocks = <&sata_clk>;
+};
+
+&sdhci0 {
+   clocks = <&misc_clk>, <&misc_clk>;
+};
+
+&sdhci1 {
+   clocks = <&misc_clk>, <&misc_clk>;
+};
+
+&spi0 {
+   clocks = <&misc_clk &misc_clk>;
+};
+
+&spi1 {
+   clocks = <&misc_clk &misc_clk>;
+};
+
+&uart0 {
+   clocks = <&misc_clk &misc_clk>;
+};
+
+&usb0 {
+   clocks = <&misc_clk>, <&misc_clk>;
+};
+
+&usb1 {
+   clocks = <&misc_clk>, <&misc_clk>;
+};
+
+&watchdog0 {
+   clocks= <&misc_clk>;
+};
+
+&xilinx_drm {
+   clocks = <&misc_clk>;
+};
+
+&xlnx_dp {
+   clocks = <&dp_aclk>, <&dp_aud_clk>;
+};
+
+&xlnx_dp_snd_codec0 {
+   clocks = <&dp_aud_clk>;
+};
+
+&xlnx_dpdma {
+   clocks = <&misc_clk>;
+};
diff --git a/arch/arm/dts/zynqmp-ep108.dts b/arch/arm/dts/zynqmp-ep108.dts
new file mode 100644
index ..4481bd07c9e8
--- /dev/null
+++ b/arch/arm/dts/zynqmp-ep108.dts
@@ -0,0 +1,174 @@
+/*
+ * dts file for Xilinx ZynqMP ep108 development board
+ *
+ * (C) Copyright 2014 - 2015, Xilinx, Inc.
+ *
+ * Michal Simek 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+
+/include/ "zynqmp.dtsi"
+/include/ "zynqmp-ep108-clk.dtsi"
+
+/ {
+   model = "ZynqMP EP108";
+
+   aliases {
+   serial0 = &uart0;
+   spi0 = &qspi;
+   spi1 = &spi0;
+   spi2 = &spi1;
+   };
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+
+   memory {
+   device_type = "memory";
+   reg = <0x0 0x0 0x4000>;
+   };
+};
+
+&can0 {
+   status = "okay";
+};
+
+&gem0 {
+   status = "okay";
+   phy-handle = <&phy0>;
+   phy-mode = "rgmii-id";
+   phy0: phy@0{
+   reg = <0>;
+   max-speed = <100>;
+   };
+};
+
+&gpio {
+   status = "okay";
+};
+
+&i2c0 {
+   status = "okay";
+   clock-frequency = <40>;
+   eeprom@54 {
+   compatible = "at,24c64";
+   reg = <0x54>;
+   };
+};
+
+&i2c1 {
+   status = "okay";
+   clock-frequency = <40>;
+   eeprom@55 {
+   compatible = "at,24c64";
+   reg = <0x55>;
+   };
+};
+
+&qspi {
+   status = "okay";
+   flash@0 {
+   compatible = "n25q512a11";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   reg = <0x0>;
+

[U-Boot] [PATCH] ls102xa: Adjust some macros for SD boot on LS1021A QDS board

2015-10-30 Thread Alison Wang
As more features are added for SD boot on LS1021A QDS board,
the size of U-Boot is larger. CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS
needs to be adjusted to a suitable value.

Starting address of the malloc pool used in SPL needs to be
adjusted too, or it will occupy the address u-boot loads.

Signed-off-by: Alison Wang 
---
 include/configs/ls1021aqds.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index d19b1e3..562e78f 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -69,7 +69,7 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SPL_DRIVERS_MISC_SUPPORT
 #define CONFIG_SPL_MMC_SUPPORT
 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR0xe8
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400
+#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x600
 
 #define CONFIG_SPL_TEXT_BASE   0x1000
 #define CONFIG_SPL_MAX_SIZE0x1a000
@@ -82,7 +82,7 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x10
 #define CONFIG_SPL_BSS_START_ADDR  0x8010
 #define CONFIG_SPL_BSS_MAX_SIZE0x8
-#define CONFIG_SYS_MONITOR_LEN 0x8
+#define CONFIG_SYS_MONITOR_LEN 0xc
 #endif
 
 #ifdef CONFIG_QSPI_BOOT
-- 
2.1.0.27.g96db324

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


[U-Boot] [PATCH] ARM: zynq: Remove zc70x target

2015-10-30 Thread Michal Simek
Remove zc70x target which was one setting for zc702 and zc706.
Currently zc702 and zc706 are separated.

Signed-off-by: Michal Simek 
---

 arch/arm/mach-zynq/Kconfig   | 10 +-
 board/xilinx/zynq/Makefile   | 10 --
 configs/zynq_zc70x_defconfig | 15 ---
 3 files changed, 1 insertion(+), 34 deletions(-)
 delete mode 100644 configs/zynq_zc70x_defconfig

diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
index 7a1aec45e79a..afe6cc3eddb5 100644
--- a/arch/arm/mach-zynq/Kconfig
+++ b/arch/arm/mach-zynq/Kconfig
@@ -21,13 +21,6 @@ config TARGET_ZYNQ_MICROZED
 config TARGET_ZYNQ_PICOZED
bool "Zynq PicoZed"
 
-config TARGET_ZYNQ_ZC70X
-   bool "Zynq ZC702/ZC706 Board (deprecated)"
-   select ZYNQ_CUSTOM_INIT
-   help
- This option is deprecated.  Use TARGET_ZYNQ_ZC702
- or TARGET_ZYNQ_706.
-
 config TARGET_ZYNQ_ZC702
bool "Zynq ZC702 Board"
 
@@ -57,8 +50,7 @@ config SYS_CONFIG_NAME
default "zynq_zed" if TARGET_ZYNQ_ZED
default "zynq_microzed" if TARGET_ZYNQ_MICROZED
default "zynq_picozed" if TARGET_ZYNQ_PICOZED
-   default "zynq_zc70x" if TARGET_ZYNQ_ZC702 || TARGET_ZYNQ_ZC706 \
-   || TARGET_ZYNQ_ZC70X
+   default "zynq_zc70x" if TARGET_ZYNQ_ZC702 || TARGET_ZYNQ_ZC706
default "zynq_zc770" if TARGET_ZYNQ_ZC770
default "zynq_zybo" if TARGET_ZYNQ_ZYBO
 
diff --git a/board/xilinx/zynq/Makefile b/board/xilinx/zynq/Makefile
index fd5d6fe950c7..88047ec1de43 100644
--- a/board/xilinx/zynq/Makefile
+++ b/board/xilinx/zynq/Makefile
@@ -36,13 +36,3 @@ CFLAGS_REMOVE_ps7_init_gpl.o := -Wstrict-prototypes
 
 # To include xil_io.h
 CFLAGS_ps7_init_gpl.o := -I$(srctree)/$(src)
-
-# Warn if CONFIG_TARGET_ZYNQ_ZC70X is enabled
-ifeq ($(CONFIG_TARGET_ZYNQ_ZC70X),y)
-ifeq ($(CONFIG_SPL_BUILD),y)
-$(warning CONFIG_TARGET_ZYNQ_ZC70X is deprecated.)
-$(warning Enable CONFIG_TARGET_ZYNQ_ZC702 or CONFIG_TARGET_ZYNQ_706 instead.)
-$(warning "make zynq_zc70x_defconfig" is also deprecated.)
-$(warning Use "make zynq_zc702_defconfig" or "make zynq_zc706_defconfig".)
-endif
-endif
diff --git a/configs/zynq_zc70x_defconfig b/configs/zynq_zc70x_defconfig
deleted file mode 100644
index 5d702b2f1d85..
--- a/configs/zynq_zc70x_defconfig
+++ /dev/null
@@ -1,15 +0,0 @@
-CONFIG_ARM=y
-CONFIG_ARCH_ZYNQ=y
-CONFIG_TARGET_ZYNQ_ZC70X=y
-CONFIG_DEFAULT_DEVICE_TREE="zynq-zc702"
-CONFIG_SPL=y
-CONFIG_FIT=y
-CONFIG_FIT_VERBOSE=y
-CONFIG_FIT_SIGNATURE=y
-# CONFIG_CMD_IMLS is not set
-# CONFIG_CMD_FLASH is not set
-# CONFIG_CMD_SETEXPR is not set
-CONFIG_OF_SEPARATE=y
-CONFIG_NET_RANDOM_ETHADDR=y
-CONFIG_SPI_FLASH=y
-CONFIG_ZYNQ_QSPI=y
-- 
2.5.0

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


Re: [U-Boot] [PATCH v3 01/10] imx: cpu: move common chip revision id's

2015-10-30 Thread Stefano Babic
On 12/10/2015 20:48, Adrian Alonso wrote:
> Move common chip revision id's to main cpu header file
> mx25 generic include cpu header for chip revision
> 
> Signed-off-by: Adrian Alonso 
> ---

Whole series applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH 1/1] imx: mx6sabresd: add i.MX6DQP Sabresd support

2015-10-30 Thread Stefano Babic
On 15/10/2015 12:05, Peng Fan wrote:
> Add i.MX6DQP-Sabresd board support:
> 1. set fdt_file according to board_rev which is set at runtime.
> 2. Add mx6dqp_ddr_ioregs and calibration value for this board.
> 
> Signed-off-by: Peng Fan 
> Cc: Stefano Babic 
> Cc: Fabio Estevam 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH 1/1] imx: mx6sabresd discard PHYS_SDRAM_SIZE

2015-10-30 Thread Stefano Babic
On 15/10/2015 12:05, Peng Fan wrote:
> This macro is not needed, since gd->ram_size is assigned value using
> function imx_ddr_size().
> 
> Signed-off-by: Peng Fan 
> Cc: Stefano Babic 
> Cc: Fabio Estevam 
> ---
>  include/configs/mx6sabresd.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/include/configs/mx6sabresd.h b/include/configs/mx6sabresd.h
> index e9e3b27..bfc4f61 100644
> --- a/include/configs/mx6sabresd.h
> +++ b/include/configs/mx6sabresd.h
> @@ -19,7 +19,6 @@
>  #define CONFIG_MXC_UART_BASE UART1_BASE
>  #define CONFIG_CONSOLE_DEV   "ttymxc0"
>  #define CONFIG_MMCROOT   "/dev/mmcblk1p2"
> -#define PHYS_SDRAM_SIZE  (1u * 1024 * 1024 * 1024)
>  
>  #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
>  
> 

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH] imx35, flea3: add FIT image support

2015-10-30 Thread Stefano Babic
On 09/10/2015 06:24, Heiko Schocher wrote:
> add FIT image support for the flea3 board.
> 
> Signed-off-by: Heiko Schocher 
> ---
> 
>  include/configs/flea3.h | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/configs/flea3.h b/include/configs/flea3.h
> index f646fee..a096071 100644
> --- a/include/configs/flea3.h
> +++ b/include/configs/flea3.h
> @@ -251,4 +251,8 @@
>   "else echo U-Boot not downloaded..exiting;fi\0" \
>   "bootcmd=run net_nfs\0"
>  
> +/* Enable FIT images support */
> +#define CONFIG_CMD_FDT
> +#define CONFIG_FIT
> +
>  #endif   /* __CONFIG_H */
> 

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH] ts4800: add CONFIG_OF_LIBFDT

2015-10-30 Thread Stefano Babic
On 06/10/2015 23:33, Damien Riegel wrote:
> Linux only boots IMX.51-based boards with device tree, so this board
> would benefit from supporting it.
> 
> Signed-off-by: Damien Riegel 
> Cc: Stefano Babic 
> ---
>  include/configs/ts4800.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/configs/ts4800.h b/include/configs/ts4800.h
> index 21f1555..1624a1b 100644
> --- a/include/configs/ts4800.h
> +++ b/include/configs/ts4800.h
> @@ -24,6 +24,8 @@
>  
>  #define CONFIG_HW_WATCHDOG
>  
> +#define CONFIG_OF_LIBFDT
> +
>  #define CONFIG_MACH_TYPE MACH_TYPE_TS48XX
>  
>  /* text base address used when linking */
> 

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

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


[U-Boot] [PATCH] Allow fw env tools to be available as library

2015-10-30 Thread Stefano Babic
Sometimes it can be useful to link the fw_ tools instead
of having the fw_setenv/fw_printenv installed.
Patch exports the tool as library and allowes to link it
with own programs.

Signed-off-by: Stefano Babic 
CC: Tom Rini 
---
 tools/env/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/env/Makefile b/tools/env/Makefile
index 40164f7..38ad118 100644
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -23,10 +23,12 @@ endif
 always := fw_printenv
 hostprogs-y := fw_printenv
 
-fw_printenv-objs := fw_env.o fw_env_main.o \
+lib-y += fw_env.o \
crc32.o ctype.o linux_string.o \
env_attr.o env_flags.o aes.o
 
+fw_printenv-objs := fw_env_main.o $(lib-y)
+
 quiet_cmd_crosstools_strip = STRIP   $^
   cmd_crosstools_strip = $(STRIP) $^; touch $@
 
-- 
1.9.1

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


[U-Boot] [PATCH v3 2/3] cfi_flash: convert to driver model

2015-10-30 Thread Thomas Chou
Convert cfi flash to driver model.

Signed-off-by: Thomas Chou 
---
v2
  add dts binding.
  add more help to Kconfig.
  move struct platdata to top of file as Simon suggested.
v3
  change to MTD uclass.

 doc/device-tree-bindings/mtd/mtd-physmap.txt | 88 
 drivers/mtd/Kconfig  | 11 
 drivers/mtd/cfi_flash.c  | 69 ++
 drivers/mtd/cfi_mtd.c|  2 +-
 include/mtd/cfi_flash.h  |  3 +
 5 files changed, 172 insertions(+), 1 deletion(-)
 create mode 100644 doc/device-tree-bindings/mtd/mtd-physmap.txt

diff --git a/doc/device-tree-bindings/mtd/mtd-physmap.txt 
b/doc/device-tree-bindings/mtd/mtd-physmap.txt
new file mode 100644
index 000..4b8c489
--- /dev/null
+++ b/doc/device-tree-bindings/mtd/mtd-physmap.txt
@@ -0,0 +1,88 @@
+CFI or JEDEC memory-mapped NOR flash, MTD-RAM (NVRAM...)
+
+Flash chips (Memory Technology Devices) are often used for solid state
+file systems on embedded devices.
+
+ - compatible : should contain the specific model of mtd chip(s)
+   used, if known, followed by either "cfi-flash", "jedec-flash",
+   "mtd-ram" or "mtd-rom".
+ - reg : Address range(s) of the mtd chip(s)
+   It's possible to (optionally) define multiple "reg" tuples so that
+   non-identical chips can be described in one node.
+ - bank-width : Width (in bytes) of the bank.  Equal to the
+   device width times the number of interleaved chips.
+ - device-width : (optional) Width of a single mtd chip.  If
+   omitted, assumed to be equal to 'bank-width'.
+ - #address-cells, #size-cells : Must be present if the device has
+   sub-nodes representing partitions (see below).  In this case
+   both #address-cells and #size-cells must be equal to 1.
+ - no-unaligned-direct-access: boolean to disable the default direct
+   mapping of the flash.
+   On some platforms (e.g. MPC5200) a direct 1:1 mapping may cause
+   problems with JFFS2 usage, as the local bus (LPB) doesn't support
+   unaligned accesses as implemented in the JFFS2 code via memcpy().
+   By defining "no-unaligned-direct-access", the flash will not be
+   exposed directly to the MTD users (e.g. JFFS2) any more.
+ - linux,mtd-name: allow to specify the mtd name for retro capability with
+   physmap-flash drivers as boot loader pass the mtd partition via the old
+   device name physmap-flash.
+ - use-advanced-sector-protection: boolean to enable support for the
+   advanced sector protection (Spansion: PPB - Persistent Protection
+   Bits) locking.
+
+For JEDEC compatible devices, the following additional properties
+are defined:
+
+ - vendor-id : Contains the flash chip's vendor id (1 byte).
+ - device-id : Contains the flash chip's device id (1 byte).
+
+For ROM compatible devices (and ROM fallback from cfi-flash), the following
+additional (optional) property is defined:
+
+ - erase-size : The chip's physical erase block size in bytes.
+
+The device tree may optionally contain sub-nodes describing partitions of the
+address space. See partition.txt for more detail.
+
+Example:
+
+   flash@ff00 {
+   compatible = "amd,am29lv128ml", "cfi-flash";
+   reg = ;
+   bank-width = <4>;
+   device-width = <1>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   fs@0 {
+   label = "fs";
+   reg = <0 f8>;
+   };
+   firmware@f8 {
+   label ="firmware";
+   reg = ;
+   read-only;
+   };
+   };
+
+Here an example with multiple "reg" tuples:
+
+   flash@f000,0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "intel,pc48f4400p0vb", "cfi-flash";
+   reg = <0 0x 0x0200
+  0 0x0200 0x0200>;
+   bank-width = <2>;
+   partition@0 {
+   label = "test-part1";
+   reg = <0 0x0400>;
+   };
+   };
+
+An example using SRAM:
+
+   sram@2,0 {
+   compatible = "samsung,k6f1616u6a", "mtd-ram";
+   reg = <2 0 0x0020>;
+   bank-width = <2>;
+   };
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index 23dff48..367c4fe 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -8,6 +8,17 @@ config MTD
  flash, RAM and similar chips, often used for solid state file
  systems on embedded devices.
 
+config CFI_FLASH
+   bool "Enable Driver Model for CFI Flash driver"
+   depends on MTD
+   help
+ The Common Flash Interface specification was developed by Intel,
+ AMD and other flash manufactures that provides a universal method
+ for probing the capabilities of flash devices. If you wish to
+ support any device that is 

[U-Boot] [PATCH v3 3/3] nios2: use cfi flash driver model

2015-10-30 Thread Thomas Chou
Use cfi flash driver model.

Signed-off-by: Thomas Chou 
---
 configs/nios2-generic_defconfig | 2 ++
 include/configs/nios2-generic.h | 3 +--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/configs/nios2-generic_defconfig b/configs/nios2-generic_defconfig
index e42a15e..0a6de6f 100644
--- a/configs/nios2-generic_defconfig
+++ b/configs/nios2-generic_defconfig
@@ -17,6 +17,8 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_ALTERA_PIO=y
 CONFIG_MISC=y
 CONFIG_ALTERA_SYSID=y
+CONFIG_MTD=y
+CONFIG_CFI_FLASH=y
 CONFIG_DM_ETH=y
 CONFIG_ALTERA_TSE=y
 CONFIG_ALTERA_JTAG_UART=y
diff --git a/include/configs/nios2-generic.h b/include/configs/nios2-generic.h
index 84faa4c..144534d 100644
--- a/include/configs/nios2-generic.h
+++ b/include/configs/nios2-generic.h
@@ -24,13 +24,12 @@
 /*
  * CFI Flash
  */
-#define CONFIG_SYS_FLASH_BASE  0xe000
 #define CONFIG_FLASH_CFI_DRIVER
 #define CONFIG_SYS_CFI_FLASH_STATUS_POLL /* fix amd flash issue */
 #define CONFIG_SYS_FLASH_CFI
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
 #define CONFIG_SYS_FLASH_PROTECTION
-#define CONFIG_SYS_MAX_FLASH_BANKS 1
+#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT  1
 #define CONFIG_SYS_MAX_FLASH_SECT  512
 
 /*
-- 
2.5.0

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


[U-Boot] [PATCH v3 1/3] dm: implement a MTD uclass

2015-10-30 Thread Thomas Chou
Implement a Memory Technology Device (MTD) uclass. It should
include most flash drivers in the future. Though no uclass ops
are defined yet, the MTD ops could be used.

The NAND flash driver is based on MTD. The CFI flash and SPI
flash support MTD, too. It should make sense to convert them
to MTD uclass.

Signed-off-by: Thomas Chou 
---
v3
  change to MTD uclass.

 drivers/mtd/Kconfig  | 12 
 drivers/mtd/Makefile |  1 +
 drivers/mtd/mtd-uclass.c | 20 
 include/dm/uclass-id.h   |  1 +
 include/linux/mtd/mtd.h  |  3 +++
 include/mtd.h| 23 +++
 6 files changed, 60 insertions(+)
 create mode 100644 drivers/mtd/mtd-uclass.c
 create mode 100644 include/mtd.h

diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index 59278d1..23dff48 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -1,3 +1,15 @@
+menu "MTD Support"
+
+config MTD
+   bool "Enable Driver Model for MTD drivers"
+   depends on DM
+   help
+ Enable driver model for Memory Technology Devices (MTD), such as
+ flash, RAM and similar chips, often used for solid state file
+ systems on embedded devices.
+
+endmenu
+
 source "drivers/mtd/nand/Kconfig"
 
 source "drivers/mtd/spi/Kconfig"
diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index a623f4c..c23c0c1 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -8,6 +8,7 @@
 ifneq (,$(findstring 
y,$(CONFIG_MTD_DEVICE)$(CONFIG_CMD_NAND)$(CONFIG_CMD_ONENAND)$(CONFIG_CMD_SF)))
 obj-y += mtdcore.o mtd_uboot.o
 endif
+obj-$(CONFIG_MTD) += mtd-uclass.o
 obj-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
 obj-$(CONFIG_MTD_CONCAT) += mtdconcat.o
 obj-$(CONFIG_HAS_DATAFLASH) += at45.o
diff --git a/drivers/mtd/mtd-uclass.c b/drivers/mtd/mtd-uclass.c
new file mode 100644
index 000..8bd3e6b
--- /dev/null
+++ b/drivers/mtd/mtd-uclass.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2015 Thomas Chou 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * Implement a MTD uclass which should include most flash drivers.
+ * The uclass private is pointed to mtd_info.
+ */
+
+UCLASS_DRIVER(mtd) = {
+   .id = UCLASS_MTD,
+   .name   = "mtd",
+};
diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h
index 886a44c..fcc9784 100644
--- a/include/dm/uclass-id.h
+++ b/include/dm/uclass-id.h
@@ -42,6 +42,7 @@ enum uclass_id {
UCLASS_MISC,/* Miscellaneous device */
UCLASS_MMC, /* SD / MMC card or chip */
UCLASS_MOD_EXP, /* RSA Mod Exp device */
+   UCLASS_MTD, /* Memory Technology Device (MTD) device */
UCLASS_PCH, /* x86 platform controller hub */
UCLASS_PCI, /* PCI bus */
UCLASS_PCI_GENERIC, /* Generic PCI bus device */
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index e3d3fc7..3dd13e8 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -18,6 +18,7 @@
 
 #include 
 #else
+#include 
 #include 
 #include 
 #include 
@@ -272,6 +273,8 @@ struct mtd_info {
struct module *owner;
 #ifndef __UBOOT__
struct device dev;
+#else
+   struct udevice *udev;
 #endif
int usecount;
 };
diff --git a/include/mtd.h b/include/mtd.h
new file mode 100644
index 000..3f8c293
--- /dev/null
+++ b/include/mtd.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2015 Thomas Chou 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _MTD_H_
+#define _MTD_H_
+
+#include 
+
+/*
+ * Get mtd_info structure of the dev, which is stored as uclass private.
+ *
+ * @dev: The MTD device
+ * @return: pointer to mtd_info, NULL on error
+ */
+static inline struct mtd_info *mtd_get_info(struct udevice *dev)
+{
+   return dev_get_uclass_priv(dev);
+}
+
+#endif /* _MTD_H_ */
-- 
2.5.0

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


Re: [U-Boot] [PATCH v2 00/14] dm: arm: zynq: Convert serial driver to driver model

2015-10-30 Thread Michal Simek
On 10/18/2015 03:41 AM, Simon Glass wrote:
> This series updates the Zynq serial driver to use driver model. Along the
> way several problems are fixed:
> 
> - Support for /chosen/stdout-path using an alias
> - Fix to fdtgrep which is currently breaking alias building
> - Avoid building u-boot-spl-dtb.bin when it is not requested
> - Deal with boards which have BSS in SDRAM
> 
> For zynq this series makes a few changes:
> - Use the new SPL init procedure, which just involves a few tweaks for zynq
> - Add debug UART support
> - Move to using a separate device tree instead of embedded
> 
> Only zybo has been tested. Testing on other zynq boards is welcome. They are
> all set up roughly the same so I expect only minor problems.
> 
> This serial includes Michal's zynqmp device tree patch.
> 
> Changes in v2:
> - Extend list of compatible strings with cadence compatible string.
> 
> Michal Simek (1):
>   ARM: zynqmp: Enable DM and OF binding
> 
> Simon Glass (13):
>   fdt: Add a function to look up a /chosen property
>   fdt: Correct handling of alias regions
>   fdtgrep: Simplify the alias generation code
>   dm: serial: Deal with stdout-path with an alias
>   dm: spl: Generate u-boot-spl-dtb.bin only when enabled
>   dm: spl: Support device tree when BSS is in a different section
>   arm: zynq: Use separate device tree instead of embedded
>   arm: zynq: Drop unnecessary code in SPL board_init_f()
>   arm: zynq: Support the debug UART
>   dm: arm: zynq: Enable device tree control in SPL
>   arm: zynq: dts: Add U-Boot device tree additions
>   arm: zynq: serial: Drop non-device-tree serial driver portions
>   arm: zynq: Move serial driver to driver model
> 
>  Kconfig|  10 +
>  arch/arm/Kconfig   |   7 +
>  arch/arm/dts/Makefile  |   2 +-
>  arch/arm/dts/zynq-7000.dtsi|   1 +
>  arch/arm/dts/zynq-microzed.dts |   5 +
>  arch/arm/dts/zynq-picozed.dts  |   5 +
>  arch/arm/dts/zynq-zc702.dts|   1 +
>  arch/arm/dts/zynq-zc706.dts|   1 +
>  arch/arm/dts/zynq-zc770-xm010.dts  |   1 +
>  arch/arm/dts/zynq-zc770-xm011.dts  |   1 +
>  arch/arm/dts/zynq-zc770-xm012.dts  |   1 +
>  arch/arm/dts/zynq-zc770-xm013.dts  |   1 +
>  arch/arm/dts/zynq-zed.dts  |   1 +
>  arch/arm/dts/zynq-zybo.dts |   1 +
>  arch/arm/dts/zynqmp-ep108.dts  | 164 
>  arch/arm/dts/zynqmp.dtsi   | 385 
> +
>  arch/arm/mach-zynq/spl.c   |  12 +-
>  arch/arm/mach-zynq/u-boot-spl.lds  |  10 +-
>  configs/xilinx_zynqmp_ep_defconfig |   3 +-
>  configs/zynq_microzed_defconfig|   2 +-
>  configs/zynq_picozed_defconfig |   2 +-
>  configs/zynq_zc702_defconfig   |   2 +-
>  configs/zynq_zc706_defconfig   |   2 +-
>  configs/zynq_zc70x_defconfig   |   2 +-
>  configs/zynq_zc770_xm010_defconfig |   2 +-
>  configs/zynq_zc770_xm011_defconfig |   2 +-
>  configs/zynq_zc770_xm012_defconfig |   2 +-
>  configs/zynq_zc770_xm013_defconfig |   2 +-
>  configs/zynq_zed_defconfig |   2 +-
>  configs/zynq_zybo_defconfig|   6 +-
>  drivers/serial/Kconfig |   7 +
>  drivers/serial/serial-uclass.c |  30 ++-
>  drivers/serial/serial_zynq.c   | 203 ++-
>  include/asm-generic/sections.h |   1 +
>  include/configs/xilinx_zynqmp.h|   4 +-
>  include/configs/xilinx_zynqmp_ep.h |   1 -
>  include/configs/zynq-common.h  |   6 +-
>  include/configs/zynq_microzed.h|   1 -
>  include/configs/zynq_picozed.h |   1 -
>  include/configs/zynq_zc70x.h   |   1 -
>  include/configs/zynq_zc770.h   |   6 -
>  include/configs/zynq_zed.h |   1 -
>  include/configs/zynq_zybo.h|   1 -
>  include/fdtdec.h   |  11 +-
>  lib/fdtdec.c   |  22 ++-
>  lib/libfdt/fdt_region.c|   2 +-
>  scripts/Makefile.spl   |   2 +
>  tools/fdtgrep.c|  32 +--
>  48 files changed, 796 insertions(+), 174 deletions(-)
>  create mode 100644 arch/arm/dts/zynqmp-ep108.dts
>  create mode 100644 arch/arm/dts/zynqmp.dtsi
> 

Applied all.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform




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


Re: [U-Boot] [PATCH v3] colibri_vf: Add board_usb_phy_mode function

2015-10-30 Thread Marek Vasut
On Friday, October 30, 2015 at 01:26:59 PM, Sanchayan Maity wrote:
> Add board_usb_phy_mode function for detecting whether a port is
> being used as host or client using a GPIO. On Colibri Vybrid we
> provide the GPIO 102 for this very same purpose.
> 
> Signed-off-by: Sanchayan Maity 
> ---
> Changes since v1:
> 
> Move the GPIO request call to the board_init function as all
> further calls to board_usb_phy_mode will actually result in the
> gpio_request failing.
> 
> Changes since v2:
> 
> Instead of returning 0 from board_usb_phy_mode return it as
> USB_INIT_HOST.
> ---
>  board/toradex/colibri_vf/colibri_vf.c | 23 ++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/board/toradex/colibri_vf/colibri_vf.c
> b/board/toradex/colibri_vf/colibri_vf.c index a6d1c5b..9878671 100644
> --- a/board/toradex/colibri_vf/colibri_vf.c
> +++ b/board/toradex/colibri_vf/colibri_vf.c
> @@ -21,6 +21,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
> 
>  DECLARE_GLOBAL_DATA_PTR;
> 
> @@ -34,6 +35,7 @@ DECLARE_GLOBAL_DATA_PTR;
>   PAD_CTL_DSE_50ohm | PAD_CTL_OBE_IBE_ENABLE)
> 
>  #define USB_PEN_GPIO   83
> +#define USB_CDET_GPIO102
> 
>  static struct ddrmc_cr_setting colibri_vf_cr_settings[] = {
>   /* levelling */
> @@ -92,6 +94,7 @@ static struct ddrmc_cr_setting colibri_vf_cr_settings[] =
> {
> 
>  static const iomux_v3_cfg_t usb_pads[] = {
>   VF610_PAD_PTD4__GPIO_83,
> + VF610_PAD_PTC29__GPIO_102,
>  };
> 
>  int dram_init(void)
> @@ -280,7 +283,6 @@ static void setup_iomux_gpio(void)
>   VF610_PAD_PTB23__GPIO_93,
>   VF610_PAD_PTB26__GPIO_96,
>   VF610_PAD_PTB28__GPIO_98,
> - VF610_PAD_PTC29__GPIO_102,
>   VF610_PAD_PTC30__GPIO_103,
>   VF610_PAD_PTA7__GPIO_134,
>   };
> @@ -509,6 +511,10 @@ int board_init(void)
> 
>   setbits_le32(&scsc->sosc_ctr, SCSC_SOSC_CTR_SOSC_EN);
> 
> +#ifdef CONFIG_USB_EHCI_VF
> + gpio_request(USB_CDET_GPIO, "usb-cdet-gpio");
> +#endif
> +
>   return 0;
>  }
> 
> @@ -554,4 +560,19 @@ int board_ehci_hcd_init(int port)
>   }
>   return 0;
>  }
> +
> +int board_usb_phy_mode(int port)
> +{
> + switch (port) {
> + case 0:
> + return gpio_get_value(USB_CDET_GPIO);

So what would happen to this code in case we re-number the USB_INIT_HOST
and USB_INIT_DEVICE or in case the GPIO API starts returning something
else but 0 or 1 here ?

> + break;
> + case 1:
> + return USB_INIT_HOST;
> + break;
> + default:
> + return USB_INIT_HOST;
> + break;
> + }
> +}
>  #endif
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3] colibri_vf: Add board_usb_phy_mode function

2015-10-30 Thread Sanchayan Maity
Add board_usb_phy_mode function for detecting whether a port is
being used as host or client using a GPIO. On Colibri Vybrid we
provide the GPIO 102 for this very same purpose.

Signed-off-by: Sanchayan Maity 
---
Changes since v1:

Move the GPIO request call to the board_init function as all
further calls to board_usb_phy_mode will actually result in the
gpio_request failing.

Changes since v2:

Instead of returning 0 from board_usb_phy_mode return it as
USB_INIT_HOST.
---
 board/toradex/colibri_vf/colibri_vf.c | 23 ++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/board/toradex/colibri_vf/colibri_vf.c 
b/board/toradex/colibri_vf/colibri_vf.c
index a6d1c5b..9878671 100644
--- a/board/toradex/colibri_vf/colibri_vf.c
+++ b/board/toradex/colibri_vf/colibri_vf.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -34,6 +35,7 @@ DECLARE_GLOBAL_DATA_PTR;
PAD_CTL_DSE_50ohm | PAD_CTL_OBE_IBE_ENABLE)
 
 #define USB_PEN_GPIO   83
+#define USB_CDET_GPIO  102
 
 static struct ddrmc_cr_setting colibri_vf_cr_settings[] = {
/* levelling */
@@ -92,6 +94,7 @@ static struct ddrmc_cr_setting colibri_vf_cr_settings[] = {
 
 static const iomux_v3_cfg_t usb_pads[] = {
VF610_PAD_PTD4__GPIO_83,
+   VF610_PAD_PTC29__GPIO_102,
 };
 
 int dram_init(void)
@@ -280,7 +283,6 @@ static void setup_iomux_gpio(void)
VF610_PAD_PTB23__GPIO_93,
VF610_PAD_PTB26__GPIO_96,
VF610_PAD_PTB28__GPIO_98,
-   VF610_PAD_PTC29__GPIO_102,
VF610_PAD_PTC30__GPIO_103,
VF610_PAD_PTA7__GPIO_134,
};
@@ -509,6 +511,10 @@ int board_init(void)
 
setbits_le32(&scsc->sosc_ctr, SCSC_SOSC_CTR_SOSC_EN);
 
+#ifdef CONFIG_USB_EHCI_VF
+   gpio_request(USB_CDET_GPIO, "usb-cdet-gpio");
+#endif
+
return 0;
 }
 
@@ -554,4 +560,19 @@ int board_ehci_hcd_init(int port)
}
return 0;
 }
+
+int board_usb_phy_mode(int port)
+{
+   switch (port) {
+   case 0:
+   return gpio_get_value(USB_CDET_GPIO);
+   break;
+   case 1:
+   return USB_INIT_HOST;
+   break;
+   default:
+   return USB_INIT_HOST;
+   break;
+   }
+}
 #endif
-- 
2.6.2

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


[U-Boot] [PATCH] README.scrapyard: Populate recent ppc4xx removals

2015-10-30 Thread Tom Rini
Signed-off-by: Tom Rini 
---
 doc/README.scrapyard |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/README.scrapyard b/doc/README.scrapyard
index cddaff6..728acdd 100644
--- a/doc/README.scrapyard
+++ b/doc/README.scrapyard
@@ -12,10 +12,10 @@ The list should be sorted in reverse chronological order.
 
 BoardArchCPUCommit  Removed Last known 
maintainer/contact
 
=
-ocotea   powerpc ppc4xx -   -   Stefan 
Roese 
-taishan  powerpc ppc4xx -   -   Stefan 
Roese 
-ebonypowerpc ppc4xx -   -   Stefan 
Roese 
-taihupowerpc ppc4xx -   -   John Otken 

+ocotea   powerpc ppc4xx 29155e732015-10-27  Stefan 
Roese 
+taishan  powerpc ppc4xx bb5553c62015-10-27  Stefan 
Roese 
+ebonypowerpc ppc4xx 9d9e2f5d2015-10-27  Stefan 
Roese 
+taihupowerpc ppc4xx 123b6cd72015-10-27  John Otken 

 lcd4_lwmon5  powerpc ppc4xx b6b5e3942015-10-02  Stefan 
Roese 
 da830evm arm arm926ejs  d7e8b2b92015-09-12  Nick 
Thompson 
 wireless_space   arm arm926ejs  b352182a2015-09-12  Albert 
ARIBAUD 
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH v4 10/16] openrisc: Use the generic bitops headers

2015-10-30 Thread Fabio Estevam
On Fri, Oct 30, 2015 at 4:23 AM, Jagan Teki  wrote:

>> diff --git a/arch/openrisc/include/asm/bitops.h 
>> b/arch/openrisc/include/asm/bitops.h
>> index 6d0b57c..28c4658 100644
>> --- a/arch/openrisc/include/asm/bitops.h
>> +++ b/arch/openrisc/include/asm/bitops.h
>> @@ -12,6 +12,10 @@
>>  #define PLATFORM_FFS
>>  #include 
>>
>
> So openrisc uses ffs.h from same arch include instead of asm-generic
> true? was it complied properly?

Yes, I just kept the original behaviour and added the missing bitops headers.

Yes, it does build correctly:

Building openrisc-generic board...
   text   databssdechexfilename
 205571   6200  21300 233071  38e6f./u-boot

- SUMMARY 
Boards compiled: 1

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


[U-Boot] [GIT] Pull request: u-boot-dfu

2015-10-30 Thread Lukasz Majewski
The following changes since commit
517173d9652957e99598a34b5752dae21a5fea53:

  ohci: Add missing cache-flush for hcca area (2015-10-21 00:25:53
  +0200)

are available in the git repository at:

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

for you to fetch changes up to a468bc844eb191b82e3f5af2f277854eb6557394:

  ARM: dra7xx_evm: Add DFU support for qspi flash (2015-10-30 10:50:12
  +0100)


Vignesh R (2):
  dfu: dfu_sf: Pass duplicate devstr to parse_dev
  ARM: dra7xx_evm: Add DFU support for qspi flash

 drivers/dfu/dfu_sf.c |  4 +++-
 include/configs/dra7xx_evm.h | 16 +++-
 2 files changed, 18 insertions(+), 2 deletions(-)


-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   >