Re: [U-Boot] U-boot and UBI problem with vexpress board.

2015-03-29 Thread Heiko Schocher

Hello Marcin,

Am 27.03.2015 16:53, schrieb mar.krzeminski:

Hi Stefan,

I've changed malloc pool size to 2MiB and nothing changed.
I've also disabled UBIFS support and that does not make any changes.
Still after qemu restart u-boot can not attach to ubi device.


Hmm.. hard to say, can you enable debug (not only in UBI) and
maybe try current mainline U-Boot?

The line UBI error: vtbl_check: bad CRC at record 0: 0x88cdfb6, not 0x
... it seems, you have some problems reading your flash ... can
you try a to write into your flash, reread the content and
compare it?

Thanks!

bye,
Heiko


Regards,
Marcin

W dniu 27.03.2015 o 16:01, Stefan Roese pisze:

Hi Marcin,

On 27.03.2015 13:59, Marcin Krzemiński wrote:

I want to test some UBI fs behavior in U-Boot using qemu and vexpress_ca9x4
board ( U-Boot 2015.1)
To tst UBI I added lines to vexpress_ca9x4.h:

#define CONFIG_MTD_DEVICE   /* needed for mtdparts commands */
#define CONFIG_MTD_PARTITIONS   /* needed for UBI */
#define CONFIG_FLASH_CFI_MTD
#define MTDIDS_DEFAULT  nor0=flash0-0
#define MTDPARTS_DEFAULT mtdparts=flash0-0:1m(empty),10m(ubi),-(rest)
#define CONFIG_LZO  /* needed for UBI */
#define CONFIG_RBTREE   /* needed for UBI */
#define CONFIG_CMD_MTDPARTS
#define CONFIG_CMD_UBI
#define CONFIG_CMD_UBIFS
#define CONFIG_FIT

also I've changed malloc pool size to 512kB in vexpress_common.h:
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 512 * 1024)


Without looking deeper into your mail, I would recommend to increase the malloc 
size to at least 2MiB and test again.

Thanks,
Stefan




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


--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: Early failure when the first descriptor read fails, one way or another

2015-03-29 Thread Marek Vasut
On Saturday, March 28, 2015 at 06:31:42 PM, Paul Kocialkowski wrote:
 Le samedi 28 mars 2015 à 18:26 +0100, Marek Vasut a écrit :
  On Saturday, March 28, 2015 at 06:23:58 PM, Paul Kocialkowski wrote:
   When using an USB1 device on a controller that only supports USB2 (e.g.
   EHCI), reading the first descriptor will fail (read 0 byte), so we can
   abort the process at this point instead of failing later and wasting
   time.
   
   Signed-off-by: Paul Kocialkowski cont...@paulk.fr
   ---
   
common/usb.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
   
   diff --git a/common/usb.c b/common/usb.c
   index 32e15cd..d1b3316 100644
   --- a/common/usb.c
   +++ b/common/usb.c
   @@ -950,7 +950,7 @@ int usb_new_device(struct usb_device *dev)
   
  */

#ifndef CONFIG_USB_XHCI

 err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc, 64);
   
   - if (err  0) {
   + if (err  sizeof(struct usb_device_descriptor)) {
   
 debug(usb_new_device: usb_get_descriptor() failed\n);
 return 1;
 
 }
   
   @@ -990,6 +990,9 @@ int usb_new_device(struct usb_device *dev)
   
 case 64:
 dev-maxpacketsize = PACKET_SIZE_64;
 break;
   
   + default:
   + debug(usb_new_device: invalid max packet size\n);
  
  Hi,
  
  since this is an error, this should probably be a printf(). Also,
  to make the error message useful, it should state the invalid value
  due to which it failed.
 
 Well, it is not unexpected behaviour in my use case (but I reckon it may
 be generally speaking).

Why is this not unexpected in your case please ?

 Plugging an USB1 device on a controller that
 doesn't support USB1 should normally fail, this is not some kind of
 run-time error.

Yes.

 When this happens in Linux, it just fails (silently) and tries ohci
 instead. I'm afraid there is no such mechanism in U-Boot, so the best we
 can do is to treat the device as unsupported.

There's no such mechanism indeed. It'd be nice if someone implemented
this handover though.

 If you're not convinced by this, I can still make a v2 with printf, I
 just don't think it's a necessity.

Let me just understand what you're seeing a bit better first please .

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


Re: [U-Boot] [PATCHv2 15/20] arm: socfpga: spl: adjust SPL_MALLOC_SIZE to 256

2015-03-29 Thread Marek Vasut
On Friday, March 27, 2015 at 09:10:35 PM, Dinh Nguyen wrote:
 Hi Marek,

Hi Dinh,

 On 03/04/2015 07:16 AM, Marek Vasut wrote:
  On Monday, March 02, 2015 at 05:28:03 PM, dingu...@opensource.altera.com 
wrote:
  From: Dinh Nguyen dingu...@opensource.altera.com
  
  Signed-off-by: Dinh Nguyen dingu...@opensource.altera.com
  
  Why did you do this change please ?
 
 Sorry that it's taken me a while to get back to you on this, but this is
 why I had to adjust the SPL_MALLOC_SIZE to 256:

No worries, I'm also quite busy myself :)

 #define CONFIG_SYS_INIT_RAM_SIZE(0x1 - 0x100)
 #define CONFIG_SYS_INIT_SP_ADDR \
 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE -  \
 GENERATED_GBL_DATA_SIZE)
 
 Because of the above define I only have 0x100 left for SPL_MALLOC_SIZE.
 
 I think I should rework this patch to be like this:
 
 --- a/include/configs/socfpga_common.h
 +++ b/include/configs/socfpga_common.h
 @@ -41,7 +41,7 @@
  #define CONFIG_SYS_MEMTEST_END PHYS_SDRAM_1_SIZE
 
  #define CONFIG_SYS_INIT_RAM_ADDR   0x
 -#define CONFIG_SYS_INIT_RAM_SIZE   (0x1 - 0x100)
 +#define CONFIG_SYS_INIT_RAM_SIZE   (0x1 -
 CONFIG_SYS_SPL_MALLOC_SIZE)

Certainly, that makes more sense ;-) You can also take for example 
include/configs/novena.h for a reference. It contains the defines
which should be enabled for SPL with working mallocator, while it
still runs from OCRAM.

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 0/4] sunxi: various musb host related fixes

2015-03-29 Thread Ian Campbell
On Fri, 2015-03-27 at 22:06 +0100, Hans de Goede wrote:
 Hi All,
 
 Here is a bunch of sunxi musb fixes, note I plan to send a pull-req for
 the first patch for inclusion in v2015.04 as soon as it is acked, the other 3
 depend on the axp vbus-det / vbus-ctrl - gpio changes currently in next,
 and since they fix only a few corner cases I plan to add them to next, and
 merge them the next cycle.

All 4 patches:
Acked-by: Ian Campbell i...@hellion.org.uk


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


[U-Boot] [PATCH 7/7] sunxi: A20-OLinuXino-Lime2 USB0 VBUS detect and enable pins

2015-03-29 Thread Paul Kocialkowski
This allows enabling MUSB (on the OTG port).

Signed-off-by: Paul Kocialkowski cont...@paulk.fr
---
 configs/A20-OLinuXino-Lime2_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/A20-OLinuXino-Lime2_defconfig 
b/configs/A20-OLinuXino-Lime2_defconfig
index 1f4fa12..4fcff92 100644
--- a/configs/A20-OLinuXino-Lime2_defconfig
+++ b/configs/A20-OLinuXino-Lime2_defconfig
@@ -2,6 +2,8 @@ CONFIG_SPL=y
 
CONFIG_SYS_EXTRA_OPTIONS=AXP209_POWER,SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3),USB_EHCI
 CONFIG_FDTFILE=sun7i-a20-olinuxino-lime2.dtb
 CONFIG_MMC0_CD_PIN=PH1
+CONFIG_USB0_VBUS_PIN=PC17
+CONFIG_USB0_VBUS_DET=PH5
 CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN7I=y
-- 
1.9.1

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


[U-Boot] [PATCH 5/7] sunxi: A20-OLinuXino-Lime2 mmc0 card-detect pin

2015-03-29 Thread Paul Kocialkowski
Signed-off-by: Paul Kocialkowski cont...@paulk.fr
---
 configs/A20-OLinuXino-Lime2_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/A20-OLinuXino-Lime2_defconfig 
b/configs/A20-OLinuXino-Lime2_defconfig
index 8c76360..1f4fa12 100644
--- a/configs/A20-OLinuXino-Lime2_defconfig
+++ b/configs/A20-OLinuXino-Lime2_defconfig
@@ -1,6 +1,7 @@
 CONFIG_SPL=y
 
CONFIG_SYS_EXTRA_OPTIONS=AXP209_POWER,SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3),USB_EHCI
 CONFIG_FDTFILE=sun7i-a20-olinuxino-lime2.dtb
+CONFIG_MMC0_CD_PIN=PH1
 CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN7I=y
-- 
1.9.1

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


[U-Boot] [PATCH 6/7] sunxi: Cubieboard2 mmc0 card-detect pin

2015-03-29 Thread Paul Kocialkowski
Signed-off-by: Paul Kocialkowski cont...@paulk.fr
---
 configs/Cubieboard2_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/Cubieboard2_defconfig b/configs/Cubieboard2_defconfig
index 05b11a0..d866ad1 100644
--- a/configs/Cubieboard2_defconfig
+++ b/configs/Cubieboard2_defconfig
@@ -1,6 +1,7 @@
 CONFIG_SPL=y
 
CONFIG_SYS_EXTRA_OPTIONS=AXP209_POWER,SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPB(8),USB_EHCI
 CONFIG_FDTFILE=sun7i-a20-cubieboard2.dtb
+CONFIG_MMC0_CD_PIN=PH1
 CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN7I=y
-- 
1.9.1

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


[U-Boot] [PATCH 1/7] sunxi: TZX-Q8-713B7 mmc0 card-detect pin

2015-03-29 Thread Paul Kocialkowski
Signed-off-by: Paul Kocialkowski cont...@paulk.fr
---
 configs/TZX-Q8-713B7_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/TZX-Q8-713B7_defconfig b/configs/TZX-Q8-713B7_defconfig
index 4ff4542..0953554 100644
--- a/configs/TZX-Q8-713B7_defconfig
+++ b/configs/TZX-Q8-713B7_defconfig
@@ -1,6 +1,7 @@
 CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS=CONS_INDEX=2,AXP209_POWER
 CONFIG_FDTFILE=sun5i-a13-tzx-q8-713b7.dtb
+CONFIG_MMC0_CD_PIN=PG0
 CONFIG_USB_MUSB_SUNXI=y
 CONFIG_USB0_VBUS_PIN=PG12
 CONFIG_USB0_VBUS_DET=PG1
-- 
1.9.1

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


[U-Boot] [PATCH 4/7] sunxi: Yones Toptech BD1078 mmc0 and mmc1 card-detect pins

2015-03-29 Thread Paul Kocialkowski
Signed-off-by: Paul Kocialkowski cont...@paulk.fr
---
 configs/Yones_Toptech_BD1078_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/Yones_Toptech_BD1078_defconfig 
b/configs/Yones_Toptech_BD1078_defconfig
index 99cc0a7..00ede67 100644
--- a/configs/Yones_Toptech_BD1078_defconfig
+++ b/configs/Yones_Toptech_BD1078_defconfig
@@ -8,6 +8,8 @@ CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS=AXP209_POWER
 CONFIG_FDTFILE=sun7i-a20-yones-toptech-bd1078.dtb
 CONFIG_MMC_SUNXI_SLOT_EXTRA=1
+CONFIG_MMC0_CD_PIN=PH1
+CONFIG_MMC1_CD_PIN=PH2
 CONFIG_MMC1_PINS=PH
 CONFIG_USB_MUSB_SUNXI=y
 CONFIG_USB0_VBUS_PIN=PB9
-- 
1.9.1

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


[U-Boot] [PATCH] Document the format of the console environment variable

2015-03-29 Thread Karsten Merker
config_distro_bootcmd.h defines a common boot environment for
multiple platforms.  Document the format of the console
environment variable to allow the use of generic boot scripts
on all supported platforms.

Signed-off-by: Karsten Merker mer...@debian.org
---
 doc/README.distro |9 +
 1 file changed, 9 insertions(+)

diff --git a/doc/README.distro b/doc/README.distro
index 0308a4c..3f7ee85 100644
--- a/doc/README.distro
+++ b/doc/README.distro
@@ -201,6 +201,15 @@ variables be set. Default values for these variables are 
often hard-coded into
 CONFIG_EXTRA_ENV_SETTINGS in the board's U-Boot configuration file, so that
 the user doesn't have to configure them.
 
+console:
+
+  Mandatory. The default console device to be passed to the Linux kernel.
+
+  The console device is specified in accordance with the guidelines
+  described in Documentation/serial-console.txt in the Linux kernel sources.
+  If the device is a serial port, the console variable must specify the
+  console baudrate in addition to the console device, e.g. ttyS0,115200.
+
 fdt_addr:
 
   Mandatory for any system that provides the DTB in HW (e.g. ROM) and wishes
-- 
1.7.10.4

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


Re: [U-Boot] NAND Flash with Internal Hardware ECC

2015-03-29 Thread Josh Wu

Hi, Dave

On 3/27/2015 8:41 PM, Rajiv Dave wrote:

Hi Josh,

That worked! Many thanks.


You are welcome  ;-)



The next issue is that the Kernel now needs to be re-built, we are using
2.6.xx, do you have any ideas on what to change in the Kernel to make it
work with the HW ECC NAND?
If you are using the github/linux-2.6.39-at91 branch, you need change 
the arch/arm/mach-at91/board-sam9263ek.c to set .ecc_mode as NAND_ECC_NONE.


Best Regards,
Josh Wu



Regards

Rajiv Dave

Disign Consultants
t: +44 (0) 207 544 8486
w: www.disignconsultants.com

This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure. If you are not the intended recipient,
please telephone or email the sender and delete this message and any
attachment from your system. If you are not the intended recipient you must
not copy this message or attachment or disclose the contents to any other
person.




From: Josh Wu josh...@atmel.com
Date: Fri, 27 Mar 2015 10:52:29 +0800
To: Rajiv Dave raj...@disignconsultants.com, u-boot@lists.denx.de
Subject: Re: [U-Boot] NAND Flash with Internal Hardware ECC

Hello, Dave

On 3/26/2015 4:45 PM, Rajiv Dave wrote:

Hi,

We are using an Atmel AT91SAM9263 processor which supports 1 Bit ECC flash
devices that have Block 0 Valid with no ECC. These devices are now obsolete.

We have fitted a board with a MT29F2G08ABAEWP-E-E, which has an internal
Hardware ECC engine. Would you know how provide support for this device
within U-Boot?

As your flash have internal ecc, you should disable the AT91SAM9263 ecc.

it means you need to set the nand-ecc.mode to NAME_ECC_NONE
in the U-Boot if you already enabled internal Hardware ECC.


Best Regards,
Josh Wu

The following output is generated by a board fitted with the NAND Flash with
Internal Hardware ECC

RomBOOT

U-Boot 1.3.4 (Sep 19 2013 - 15:10:38)

DRAM:  64 MB
NAND:  256 MiB
No Valid Environment Area Found
In:serial
Out:   serial
Err:   serial
Net:   macb0
macb0: Starting autonegotiation...
macb0: Autonegotiation timed out (status=0x7849)
macb0: link down (status: 0x7849)
Hit any key to stop autoboot:  3  2  1  0

NAND read: device 0 offset 0x20, size 0x17e16c
   1565036 bytes read: ERROR
## Booting kernel from Legacy Image at 2220 ...
 Image Name:   Linux-2.6.30
 Image Type:   ARM Linux Kernel Image (uncompressed)
 Data Size:1564972 Bytes =  1.5 MB
 Load Address: 20008000
 Entry Point:  20008000
 Verifying Checksum ... Bad Data CRC
ERROR: can't get kernel image!
U-Boot

Regards

Rajiv Dave

Disign Consultants
t: +44 (0) 207 544 8486
w: www.disignconsultants.com

This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure. If you are not the intended recipient,
please telephone or email the sender and delete this message and any
attachment from your system. If you are not the intended recipient you must
not copy this message or attachment or disclose the contents to any other
person.


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




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


Re: [U-Boot] [PATCH v2] sunxi: Avoid any assumption between musb gadget and host but fallback to host

2015-03-29 Thread Paul Kocialkowski
Le dimanche 29 mars 2015 à 13:18 +0200, Hans de Goede a écrit :
 Hi,
 
 On 28-03-15 18:26, Paul Kocialkowski wrote:
  musb might be used in gadget mode on sunxi, so we don't want to assume 
  anything
  related to host mode, especially USB keyboard support. Thus, there is no 
  reason
  to keep USB_KEYBOARD always enabled and in Kconfig: it is much better fit to
  enable it in the common sunxi config header, when needed (some devices also 
  have
  no USB support at all).
 
  In case gadget mode is not explicitly enabled, this will fallback to host 
  mode.
 
  Signed-off-by: Paul Kocialkowski cont...@paulk.fr
 
 Nack, I'm not going to take any patch which removes config USB_KEYBOARD,
 having USB_KEYBOARD always enabled on devices with usb host capability
 causes a significant penalty in boot time, and some people may want to turn
 it off because of that.

Fair enough, I'll give up on this then. For my use case, I can always
disable USB keyboard when enabling MUSB gadget.

 Regards,
 
 Hans
 
 
 
  ---
board/sunxi/Kconfig| 7 ---
configs/MSI_Primo73_defconfig  | 1 -
configs/MSI_Primo81_defconfig  | 1 -
include/configs/sunxi-common.h | 5 -
4 files changed, 4 insertions(+), 10 deletions(-)
 
  diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
  index 57e7529..75e3fb3 100644
  --- a/board/sunxi/Kconfig
  +++ b/board/sunxi/Kconfig
  @@ -452,13 +452,6 @@ config USB_MUSB_SUNXI
  one usb host controller enabled at a time, so enabling this on boards
  which also use the ehci host controller will result in build errors.
 
  -config USB_KEYBOARD
  -   boolean Enable USB keyboard support
  -   default y
  -   ---help---
  -   Say Y here to add support for using a USB keyboard (typically used
  -   in combination with a graphical console).
  -
config GMAC_TX_DELAY
  int GMAC Transmit Clock Delay Chain
  default 0
  diff --git a/configs/MSI_Primo73_defconfig b/configs/MSI_Primo73_defconfig
  index 5227b6f..f621237 100644
  --- a/configs/MSI_Primo73_defconfig
  +++ b/configs/MSI_Primo73_defconfig
  @@ -14,7 +14,6 @@ CONFIG_VIDEO_LCD_DCLK_PHASE=0
CONFIG_VIDEO_LCD_POWER=PH8
CONFIG_VIDEO_LCD_BL_EN=PH7
CONFIG_VIDEO_LCD_BL_PWM=PB2
  -CONFIG_USB_KEYBOARD=n
CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
CONFIG_MACH_SUN7I=y
  diff --git a/configs/MSI_Primo81_defconfig b/configs/MSI_Primo81_defconfig
  index b6aa876..4e1d167 100644
  --- a/configs/MSI_Primo81_defconfig
  +++ b/configs/MSI_Primo81_defconfig
  @@ -20,7 +20,6 @@ CONFIG_VIDEO_LCD_SPI_MOSI=PH11
CONFIG_VIDEO_LCD_SPI_MISO=PH12
CONFIG_VIDEO_LCD_BL_EN=PA25
CONFIG_VIDEO_LCD_BL_PWM=PH13
  -CONFIG_USB_KEYBOARD=n
CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
CONFIG_MACH_SUN6I=y
  diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
  index b9bb971..61a45e1 100644
  --- a/include/configs/sunxi-common.h
  +++ b/include/configs/sunxi-common.h
  @@ -298,13 +298,16 @@ extern int soft_i2c_gpio_scl;
#endif
 
#ifdef CONFIG_USB_MUSB_SUNXI
  +#ifndef CONFIG_MUSB_GADGET
#define CONFIG_MUSB_HOST
  +#endif
#define CONFIG_MUSB_PIO_ONLY
#endif
 
  -#if defined CONFIG_USB_EHCI || defined CONFIG_USB_MUSB_SUNXI
  +#if defined CONFIG_USB_EHCI || defined CONFIG_MUSB_HOST
#define CONFIG_CMD_USB
#define CONFIG_USB_STORAGE
  +#define CONFIG_USB_KEYBOARD
#endif
 
#ifdef CONFIG_USB_KEYBOARD
 



signature.asc
Description: This is a digitally signed message part
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Please pull u-boot-sunxi master (v2)

2015-03-29 Thread Hans de Goede

Hi Tom,

This pull-req superceeds my previous pull-req from about 10 minutes ago,
as I found that one board was missing a MAINTAINERS entry, so I've included
a fix for that in this new pull-req.

Please pull u-boot-sunxi/master into master for another round of bugfixes
for v2015.04:

The following changes since commit 5db752353b6a19c50db4a30692efb7e845fb8a6e:

  powerpc: ppc4xx: convert AMCC boards to generic board (2015-03-28 12:09:46 
-0400)

are available in the git repository at:

  http://git.denx.de/u-boot-sunxi.git master

for you to fetch changes up to 662e2acb46250881ec26bc8366fc9eb1856cb7c2:

  sunxi: UTOO_P66: Add missing MAINTAINERS entry (2015-03-29 14:56:48 +0200)


Hans de Goede (2):
  sunxi: musb: Fix some lo speed devices not working with musb host
  sunxi: UTOO_P66: Add missing MAINTAINERS entry

Iain Paton (3):
  sunxi: sun4i: improve cpu clock selection method
  sunxi: use CONFIG_SYS_CLK_FREQ to set cpu clock
  sunxi: a10-LIME set the cpu clock at boot to 912MHz

 Kconfig|  2 +-
 arch/arm/cpu/armv7/sunxi/clock_sun4i.c | 35 ++
 arch/arm/cpu/armv7/sunxi/psci.S|  2 +-
 arch/arm/cpu/armv7/sunxi/usbc.c|  7 +++
 arch/arm/include/asm/arch-sunxi/usbc.h |  1 +
 board/sunxi/Kconfig|  4 
 board/sunxi/MAINTAINERS|  1 +
 board/sunxi/board.c|  2 +-
 configs/A10-OLinuXino-Lime_defconfig   |  1 +
 drivers/usb/musb-new/musb_uboot.c  | 14 ++
 include/configs/sun4i.h|  1 -
 include/configs/sun5i.h|  1 -
 include/configs/sun6i.h|  1 -
 include/configs/sun7i.h|  4 +---
 include/configs/sun8i.h|  1 -
 15 files changed, 51 insertions(+), 26 deletions(-)

Regards,

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


Re: [U-Boot] [PATCH v3 08/17] dm: regulator: add regulator command

2015-03-29 Thread Simon Glass
Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This command is based on driver model regulator api.
 User interface features:
 - list   - list UCLASS regulator devices
 - regulator dev [id] - show or [set] operating regulator device
 - regulator [info]   - print constraints info
 - regulator [status] - print operating status
 - regulator [value] [-f] - print/[set] voltage value [uV] (force)
 - regulator [current]- print/[set] current value [uA]
 - regulator [mode_id]- print/[set] operating mode id
 - regulator [enable] - enable the regulator output
 - regulator [disable]- disable the regulator output

 The 'force' option can be used for setting the value which exceeds the limits,
 which are found in device-tree and are keept in regulators info structure.

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com

 ---
 Changes v3:
 - new file
 - Kconfig entry
 ---
  common/Kconfig |  22 +++
  common/Makefile|   1 +
  common/cmd_regulator.c | 385 
 +
  3 files changed, 408 insertions(+)
  create mode 100644 common/cmd_regulator.c

 diff --git a/common/Kconfig b/common/Kconfig
 index 1125e6d..48f360f 100644
 --- a/common/Kconfig
 +++ b/common/Kconfig
 @@ -348,5 +348,27 @@ config DM_PMIC_CMD
   - pmic read address  - read byte of register at address
   - pmic write address - write byte to register at address
   The only one change for this command is 'dev' subcommand.
 +
 +config DM_REGULATOR_CMD

CMD_DM_REGULATOR

 +   bool Enable Driver Model REGULATOR command
 +   depends on DM_REGULATOR
 +   help
 + This command is based on driver model regulator api.
 + User interface features:
 + - list   - list UCLASS regulator devices

Do you need 'UCLASS in there? What does it mean?

 + - regulator dev [id] - show or [set] operating regulator device
 + - regulator [info]   - print constraints info
 + - regulator [status] - print operating status
 + - regulator [value] [-f] - print/[set] voltage value [uV] (force)
 + - regulator [current]- print/[set] current value [uA]
 + - regulator [mode_id]- print/[set] operating mode id
 + - regulator [enable] - enable the regulator output
 + - regulator [disable]- disable the regulator output

I don't think the sub-commands should be in [].

 +
 + The 'force' option can be used for setting the value which exceeds
 + the limit which are found in device-tree and are keept in regulators
 + info structure.
 +
  endmenu
 +
  endmenu
 diff --git a/common/Makefile b/common/Makefile
 index d908851..d63fe12 100644
 --- a/common/Makefile
 +++ b/common/Makefile
 @@ -211,6 +211,7 @@ obj-$(CONFIG_CMD_GPT) += cmd_gpt.o

  # Power
  obj-$(CONFIG_DM_PMIC_CMD) += cmd_pmic.o
 +obj-$(CONFIG_DM_REGULATOR_CMD) += cmd_regulator.o
  endif

  ifdef CONFIG_SPL_BUILD
 diff --git a/common/cmd_regulator.c b/common/cmd_regulator.c
 new file mode 100644
 index 000..d388b14
 --- /dev/null
 +++ b/common/cmd_regulator.c
 @@ -0,0 +1,385 @@
 +/*
 + * Copyright (C) 2014-2015 Samsung Electronics
 + * Przemyslaw Marczak p.marc...@samsung.com
 + *
 + * SPDX-License-Identifier:GPL-2.0+
 + */
 +#include common.h
 +#include linux/types.h
 +#include linux/ctype.h
 +#include fdtdec.h
 +#include dm.h
 +#include power/pmic.h
 +#include power/regulator.h
 +#include dm/device-internal.h
 +#include dm/uclass-internal.h
 +#include dm/root.h
 +#include dm/lists.h
 +#include i2c.h
 +#include compiler.h
 +#include errno.h
 +
 +#define LIMIT_SEQ  3
 +#define LIMIT_DEVNAME  20
 +#define LIMIT_OFNAME   20
 +#define LIMIT_INFO 12
 +
 +static struct udevice *reg_curr;
 +
 +static int failed(const char *getset, const char *thing,
 + const char *for_dev, int ret)
 +{
 +   printf(Can't %s %s %s.\nError: %d (%s)\n, getset, thing, for_dev,
 +   ret, errno_str(ret));
 +   return CMD_RET_FAILURE;
 +}
 +
 +static int do_dev(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 +{
 +   struct dm_regulator_info *info;
 +   int seq, ret = CMD_RET_FAILURE;
 +
 +   switch (argc) {
 +   case 2:
 +   seq = simple_strtoul(argv[1], NULL, 0);
 +   uclass_get_device_by_seq(UCLASS_REGULATOR, seq, reg_curr);

This can return an error.

 +   case 1:
 +   ret = regulator_info(reg_curr, info);
 +   if (ret)
 +   return failed(get, the, device, ret);
 +
 +   printf(dev: %d @ %s\n, reg_curr-seq, info-name);
 +   }
 +
 +   return CMD_RET_SUCCESS;
 +}
 +
 +static int get_curr_dev_and_info(struct udevice **devp,
 +struct dm_regulator_info **infop)
 +{
 +   int ret = -ENODEV;
 +
 +   *devp 

Re: [U-Boot] [PATCH v3 07/17] dm: pmic: add pmic command

2015-03-29 Thread Simon Glass
Hi Prazemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This is new command for the pmic devices based on driver model pmic api.
 Command features are unchanged:
 - list  - list UCLASS pmic devices
 - pmic dev [id]  - show or [set] operating pmic device (NEW)
 - pmic dump  - dump registers
 - pmic read address  - read byte of register at address
 - pmic write address - write byte to register at address

 The only one change for this command is 'dev' subcommand.

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com

 Changes v3:
 - new file
 - add Kconfig
 ---
  common/Kconfig|  14 
  common/Makefile   |   3 +
  common/cmd_pmic.c | 210 
 ++
  3 files changed, 227 insertions(+)
  create mode 100644 common/cmd_pmic.c

 diff --git a/common/Kconfig b/common/Kconfig
 index e662774..1125e6d 100644
 --- a/common/Kconfig
 +++ b/common/Kconfig
 @@ -335,4 +335,18 @@ config CMD_SETGETDCR

  endmenu

 +menu Power commands
 +config DM_PMIC_CMD

CMD_DM_PMIC

since this fits better with the other ones

 +   bool Enable Driver Model PMIC command
 +   depends on DM_PMIC
 +   help
 + This is new command for the pmic devices based on driver model pmic 
 api.
 + Command features are unchanged:
 + - list   - list UCLASS pmic devices
 + - pmic dev [id]  - show or [set] operating pmic device (NEW)
 + - pmic dump  - dump registers
 + - pmic read address  - read byte of register at address
 + - pmic write address - write byte to register at address
 + The only one change for this command is 'dev' subcommand.
 +endmenu
  endmenu
 diff --git a/common/Makefile b/common/Makefile
 index 7216a13..d908851 100644
 --- a/common/Makefile
 +++ b/common/Makefile
 @@ -208,6 +208,9 @@ obj-$(CONFIG_UPDATE_TFTP) += update.o
  obj-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
  obj-$(CONFIG_CMD_DFU) += cmd_dfu.o
  obj-$(CONFIG_CMD_GPT) += cmd_gpt.o
 +
 +# Power
 +obj-$(CONFIG_DM_PMIC_CMD) += cmd_pmic.o
  endif

  ifdef CONFIG_SPL_BUILD
 diff --git a/common/cmd_pmic.c b/common/cmd_pmic.c
 new file mode 100644
 index 000..978a94a
 --- /dev/null
 +++ b/common/cmd_pmic.c
 @@ -0,0 +1,210 @@
 +/*
 + * Copyright (C) 2014-2015 Samsung Electronics
 + * Przemyslaw Marczak p.marc...@samsung.com
 + *
 + * SPDX-License-Identifier:GPL-2.0+
 + */
 +#include common.h
 +#include linux/types.h
 +#include linux/ctype.h
 +#include fdtdec.h
 +#include dm.h
 +#include power/pmic.h
 +#include power/regulator.h
 +#include dm/device-internal.h
 +#include dm/uclass-internal.h
 +#include dm/root.h
 +#include dm/lists.h
 +#include i2c.h
 +#include compiler.h
 +#include errno.h
 +
 +#define LIMIT_SEQ  3
 +#define LIMIT_DEVNAME  20
 +
 +static struct udevice *pmic_curr;
 +
 +static int failed(const char *getset, const char *thing,
 + const char *for_dev, int ret)
 +{
 +   printf(Can't %s %s %s.\nError: %d (%s)\n, getset, thing, for_dev,
 +   ret, errno_str(ret));
 +   return CMD_RET_FAILURE;
 +}
 +
 +static int do_dev(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 +{
 +   int seq, ret = -ENODEV;
 +
 +   switch (argc) {
 +   case 2:
 +   seq = simple_strtoul(argv[1], NULL, 0);
 +   ret = uclass_get_device_by_seq(UCLASS_PMIC, seq, pmic_curr);
 +   case 1:
 +   if (!pmic_curr)
 +   return failed(get, the, device, ret);
 +
 +   printf(dev: %d @ %s\n, pmic_curr-seq, pmic_curr-name);
 +   }
 +
 +   return CMD_RET_SUCCESS;
 +}
 +
 +static int do_list(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 +{
 +   struct udevice *dev;
 +   const char *parent_uc;
 +   int ret;
 +
 +   printf(|%*s | %-*.*s| %-*.*s| %s @ %s\n,
 +  LIMIT_SEQ, Seq,
 +  LIMIT_DEVNAME, LIMIT_DEVNAME, Name,
 +  LIMIT_DEVNAME, LIMIT_DEVNAME, Parent name,
 +  Parent uclass, seq);
 +
 +   for (ret = uclass_first_device(UCLASS_PMIC, dev); dev;
 +ret = uclass_next_device(dev)) {

Note this will probe everything.

Perhaps we need uclass_find_first_device() and
uclass_find_next_device() which don't probe before returning each
device?


 +   if (!dev)
 +   continue;
 +
 +   /* Parent uclass name*/
 +   parent_uc = dev-parent-uclass-uc_drv-name;

What do you think about a new function at some point, so you can call
dev_uclass_name(dev_get_parent(dev))? We want to avoid digging around
in the driver model data structures outside drivers/core.

 +
 +   printf(|%*d | %-*.*s| %-*.*s| %s @ %d\n,
 +  LIMIT_SEQ, dev-seq,
 +  LIMIT_DEVNAME, LIMIT_DEVNAME, dev-name,
 +  LIMIT_DEVNAME, LIMIT_DEVNAME, dev-parent-name,
 +  

Re: [U-Boot] [PATCH v3 10/17] dm: pmic: add max77686 pmic driver

2015-03-29 Thread Simon Glass
Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This is the implementation of driver model uclass pmic driver.
 The max77686 pmic driver implements read/write operations and driver
 bind method - to bind other pmic uclass devices as a parent pmic device.
 This driver provides pmic_platdata for also for child regulator.

 This driver will try to bind the regulator device with regulator driver.
 This should succeed if regulator driver is compiled.

 If no regulator driver found, then the pmic can still provide read/write
 operations, and can be used with pmic framework function calls.

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com

Acked-by: Simon Glass s...@chromium.org

One nit below.

 ---
 Changes V2:
 - add implementation of pmic read/write
 - max77686: add new operations
 - max77686: header: change PMIC_NUM_OF_REGS to MAX77686_NUM_OF_REGS

 Changes V3:
 - pmic/max77686.c: call pmic_child_node_scan() to bind regulator device
 - remove use of pmic platdata
 - remove unused endian conversions
 - Kconfig: add max77686 pmic entry
 ---
  drivers/power/Kconfig  |  7 
  drivers/power/pmic/Makefile|  1 +
  drivers/power/pmic/max77686.c  | 76 
 ++
  drivers/power/pmic/pmic_max77686.c |  2 +-
  include/power/max77686_pmic.h  |  2 +-
  5 files changed, 86 insertions(+), 2 deletions(-)
  create mode 100644 drivers/power/pmic/max77686.c

 diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
 index 1e73c7a..c4d4c72 100644
 --- a/drivers/power/Kconfig
 +++ b/drivers/power/Kconfig
 @@ -66,6 +66,13 @@ config DM_PMIC
 So the call will looks like below:
 'pmic_write(regulator-parent, addr, value, len);'

 +config DM_PMIC_MAX77686
 +   bool Enable Driver Model for PMIC MAX77686
 +   depends on DM_PMIC
 +   ---help---
 +   This config enables implementation of driver-model pmic uclass 
 features
 +   for PMIC MAX77686. The driver implements read/write operations/

nit: '.' at end?

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


Re: [U-Boot] [PATCH v3 11/17] dm: regulator: add max77686 regulator driver

2015-03-29 Thread Simon Glass
Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This commit adds support to max77686 regulator driver
 based on a uclass regulator driver-model api, which
 provides implementation of all uclass regulator api
 function calls.

 New file: drivers/power/regulator/max77686.c
 New config: CONFIG_DM_REGULATOR_MAX77686

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com

Acked-by: Simon Glass s...@chromium.org

See nit below.

 ---
 Changes V2:
 - change debug() to error()
 - code cleanup
 - fix data types
 - ldo/buck state implementation
 - adjust to new uclass api

 Changes V3:
 - regulator/max77686.c:
   -- adjust to api changes
   -- add separeted drivers for buck and ldo
   -- bind regulators by its compatibles
 - Kconfig: add regulator max77686 entry
 ---
  Makefile   |   1 +
  drivers/power/Kconfig  |   8 +
  drivers/power/Makefile |   1 -
  drivers/power/regulator/Makefile   |   8 +
  drivers/power/regulator/max77686.c | 876 
 +
  include/power/max77686_pmic.h  |  24 +-
  6 files changed, 914 insertions(+), 4 deletions(-)
  create mode 100644 drivers/power/regulator/Makefile
  create mode 100644 drivers/power/regulator/max77686.c

 diff --git a/Makefile b/Makefile
 index 1b3ebe7..9ecf3bb 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -632,6 +632,7 @@ libs-y += drivers/power/ \
 drivers/power/fuel_gauge/ \
 drivers/power/mfd/ \
 drivers/power/pmic/ \
 +   drivers/power/regulator/ \
 drivers/power/battery/
  libs-y += drivers/spi/
  libs-$(CONFIG_FMAN_ENET) += drivers/net/fm/
 diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
 index c4d4c72..97abbf0 100644
 --- a/drivers/power/Kconfig
 +++ b/drivers/power/Kconfig
 @@ -112,6 +112,14 @@ config DM_REGULATOR
 Say y here to enable support for the axp221 / axp223 pmic found on 
 most
 sun6i (A31) / sun8i (A23) boards.

 +config DM_REGULATOR_MAX77686
 +   bool Enable Driver Model for REGULATOR MAX77686
 +   depends on DM_REGULATOR  DM_PMIC_MAX77686
 +   ---help---
 +   This config enables implementation of driver-model regulator uclass
 +   features for REGULATOR MAX77686. The driver implements get/set api 
 for:
 +   value, enable and mode.

This should probably go in drivers/power/regulator/Kconfig.

 +
  config AXP221_DCDC1_VOLT
 int axp221 dcdc1 voltage
 depends on AXP221_POWER
 diff --git a/drivers/power/Makefile b/drivers/power/Makefile
 index a6b7012..f206bdd 100644
 --- a/drivers/power/Makefile
 +++ b/drivers/power/Makefile
 @@ -15,7 +15,6 @@ obj-$(CONFIG_TPS6586X_POWER)  += tps6586x.o
  obj-$(CONFIG_TWL4030_POWER)+= twl4030.o
  obj-$(CONFIG_TWL6030_POWER)+= twl6030.o
  obj-$(CONFIG_PALMAS_POWER) += palmas.o
 -
  obj-$(CONFIG_POWER) += power_core.o
  obj-$(CONFIG_DIALOG_POWER) += power_dialog.o
  obj-$(CONFIG_POWER_FSL) += power_fsl.o
 diff --git a/drivers/power/regulator/Makefile 
 b/drivers/power/regulator/Makefile
 new file mode 100644
 index 000..9d282e3
 --- /dev/null
 +++ b/drivers/power/regulator/Makefile
 @@ -0,0 +1,8 @@
 +#
 +# Copyright (C) 2014 Samsung Electronics
 +# Przemyslaw Marczak p.marc...@samsung.com
 +#
 +# SPDX-License-Identifier: GPL-2.0+
 +#
 +
 +obj-$(CONFIG_DM_REGULATOR_MAX77686) += max77686.o
 diff --git a/drivers/power/regulator/max77686.c 
 b/drivers/power/regulator/max77686.c
 new file mode 100644
 index 000..496c70a
 --- /dev/null
 +++ b/drivers/power/regulator/max77686.c
 @@ -0,0 +1,876 @@
 +/*
 + *  Copyright (C) 2012-2015 Samsung Electronics
 + *
 + *  Rajeshwari Shinde rajeshwar...@samsung.com
 + *  Przemyslaw Marczak p.marc...@samsung.com
 + *
 + * SPDX-License-Identifier:GPL-2.0+
 + */
 +
 +#include common.h
 +#include fdtdec.h
 +#include i2c.h
 +#include dm.h
 +#include power/pmic.h
 +#include power/regulator.h
 +#include power/max77686_pmic.h
 +#include errno.h
 +#include dm.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +#define MODE(_id, _val, _name) { \
 +   .id = _id, \
 +   .register_value = _val, \
 +   .name = _name, \
 +}
 +
 +/* LDO: 1,3,4,5,9,17,18,19,20,21,22,23,24,26,26,27 */
 +static struct dm_regulator_mode max77686_ldo_mode_standby1[] = {
 +   MODE(OPMODE_OFF, MAX77686_LDO_MODE_OFF, OFF),
 +   MODE(OPMODE_LPM, MAX77686_LDO_MODE_LPM, LPM),
 +   MODE(OPMODE_STANDBY_LPM, MAX77686_LDO_MODE_STANDBY_LPM, ON/LPM),
 +   MODE(OPMODE_ON, MAX77686_LDO_MODE_ON, ON),
 +};
 +
 +/* LDO: 2,6,7,8,10,11,12,14,15,16 */
 +static struct dm_regulator_mode max77686_ldo_mode_standby2[] = {
 +   MODE(OPMODE_OFF, MAX77686_LDO_MODE_OFF, OFF),
 +   MODE(OPMODE_STANDBY, MAX77686_LDO_MODE_STANDBY, ON/OFF),
 +   MODE(OPMODE_STANDBY_LPM, MAX77686_LDO_MODE_STANDBY_LPM, ON/LPM),
 +   MODE(OPMODE_ON, MAX77686_LDO_MODE_ON, ON),
 +};
 +
 +/* Buck: 1 */
 +static struct dm_regulator_mode max77686_buck_mode_standby[] = {
 +   MODE(OPMODE_OFF, 

Re: [U-Boot] [PATCH v3 09/17] pmic: max77686 set the same compatible as in the kernel

2015-03-29 Thread Simon Glass
On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This commit also updates the proper dts files.

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 ---
  arch/arm/dts/exynos4412-odroid.dts   | 2 +-
  arch/arm/dts/exynos4412-trats2.dts   | 2 +-
  arch/arm/dts/exynos5250-smdk5250.dts | 2 +-
  arch/arm/dts/exynos5250-snow.dts | 2 +-
  lib/fdtdec.c | 2 +-
  5 files changed, 5 insertions(+), 5 deletions(-)


Acked-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/2] sunxi: Serial number support, obtained from SID bits

2015-03-29 Thread Hans de Goede

Hi,

On 28-03-15 18:35, Paul Kocialkowski wrote:

Signed-off-by: Paul Kocialkowski cont...@paulk.fr


Thanks, I'm currently busy merging some more patches, once that
is done this patch should show up in u-boot-sunxi/next, and
it will be included in u-boot/master once the merge window
for v2015.07 opens.

Regards,

Hans


---
  board/sunxi/board.c | 33 ++---
  1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 01b654e..79516bf 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -372,20 +372,31 @@ int g_dnl_board_usb_cable_connected(void)
  #ifdef CONFIG_MISC_INIT_R
  int misc_init_r(void)
  {
+   char serial_string[17] = { 0 };
unsigned int sid[4];
+   uint8_t mac_addr[6];
+   int ret;
+
+   ret = sunxi_get_sid(sid);
+   if (ret == 0  sid[0] != 0  sid[3] != 0) {
+   if (!getenv(ethaddr)) {
+   /* Non OUI / registered MAC address */
+   mac_addr[0] = 0x02;
+   mac_addr[1] = (sid[0]   0)  0xff;
+   mac_addr[2] = (sid[3]  24)  0xff;
+   mac_addr[3] = (sid[3]  16)  0xff;
+   mac_addr[4] = (sid[3]   8)  0xff;
+   mac_addr[5] = (sid[3]   0)  0xff;
+
+   eth_setenv_enetaddr(ethaddr, mac_addr);
+   }

-   if (!getenv(ethaddr)  sunxi_get_sid(sid) == 0 
-   sid[0] != 0  sid[3] != 0) {
-   uint8_t mac_addr[6];
-
-   mac_addr[0] = 0x02; /* Non OUI / registered MAC address */
-   mac_addr[1] = (sid[0]   0)  0xff;
-   mac_addr[2] = (sid[3]  24)  0xff;
-   mac_addr[3] = (sid[3]  16)  0xff;
-   mac_addr[4] = (sid[3]   8)  0xff;
-   mac_addr[5] = (sid[3]   0)  0xff;
+   if (!getenv(serial#)) {
+   snprintf(serial_string, sizeof(serial_string),
+   %08x%08x, sid[0], sid[3]);

-   eth_setenv_enetaddr(ethaddr, mac_addr);
+   setenv(serial#, serial_string);
+   }
}

  #if defined(CONFIG_MUSB_HOST) || defined(CONFIG_MUSB_GADGET)


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


Re: [U-Boot] [PATCH 17/20] tegra: nyan-big: Add additional clock and kernel init

2015-03-29 Thread Simon Glass
Hi Stephen,

On 25 February 2015 at 16:23, Stephen Warren swar...@wwwdotorg.org wrote:
 On 02/17/2015 03:29 PM, Simon Glass wrote:

 We need to turn on all audio-related clocks for the kernel to boot.
 Otherwise it will hang when trying to enable audio.


 This certainly isn't true for the upstream kernel; is this some bug in the
 ChromeOS kernel? If so, we should explicitly call this out in the commit
 description.

OK I'll adjust the commit message. At some point perhaps this problem
will go away. Chrome OS is running kernel v3.10 on this device.


 Also for Linux set up the ODMDATA and graphics driver video protection.


 Why doesn't ODMDATA come from the BCT? The way this is suppose to work is
 that the boot ROM copies the BCT into IRAM, and U-Boot (or indeed any
 bootloader) copies the ODMDATA field from the BCT in IRAM into the PMC
 scratch20 register. This logic is already all in place in U-Boot, and indeed
 any NVIDIA-authored bootloader AFAIK.

OK, so perhaps I can just drop this code. It might just be a hack in Coreboot.


 Is this U-Boot port intended to run as a Coreboot payload rather than
 natively, and Coreboot is somehow corrupting the copy of the BCT in IRAM? If
 so, we should explicitly call this out in the commit description.

No, there really isn't any point in running U-Boot as a Coreboot
payload, since U-Boot can do all the init itself. This series is for
running U-Boot stand-alone on Nyan-big.


 I would personally want to (be able to) make my SPI flash r/w and replace
 Coreboot with U-Boot. Perhaps we need different board names for those two
 use-cases; something like nyan-big for the Coreboot payload, and
 nyan-big-native for the version you'd write directly into SPI?

See above... if we can get the display stuff merged then I could do
this also. But without a display it's missing a big piece.

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


Re: [U-Boot] [PATCH v3 03/17] dm: core: lists.c: add new function lists_bind_fdt_by_prop()

2015-03-29 Thread Simon Glass
Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This change adds new function: lists_bind_fdt_by_prop(), which can be used
 for bind the devices by custom property name for the compatible string.

 The function lists_bind_fdt() works the same as previous.

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 ---
  drivers/core/lists.c | 28 +++-
  include/dm/lists.h   | 18 ++
  2 files changed, 37 insertions(+), 9 deletions(-)

I think we should do this another way - see my cover letter response.

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


Re: [U-Boot] [PATCH v3 02/17] fdt_ro.c: add new function: fdt_node_check_prop_compatible()

2015-03-29 Thread Simon Glass
Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This commit:
 - moves fdt_node_check_compatible() code to fdt_node_check_prop_compatible()
 - adds call to fdt_node_check_prop_compatible() in fdt_node_check_compatible()
   with 'compatible' as the name of compatible property.

 The function: fdt_node_check_compatible() - works the same as previous.
 The function fdt_node_check_prop_compatible() - allows for checking compatible
 string in given property name.

 If some fdt node uses different name for compatible property, than 
 'compatible',
 then the function fdt_node_check_prop_compatible() can be used with the custom
 compatible property name as an argument.

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com

I doubt this would be accepted by libfdt upstream. I don't think we
need it - see my cover letter response.

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


Re: [U-Boot] [PATCH v3 05/17] dm: pmic: add implementation of driver model pmic uclass

2015-03-29 Thread Simon Glass
Hi Prazemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This is an introduction to driver-model multi uclass PMIC support.
 It starts with UCLASS_PMIC - a common PMIC devices uclass type
 to provide device read/write operations only.

Your Kconfig docs are a model to others! It describes the function
very nicely without a lot of words.

Please excuse the nits, they are intended to help it read better.


 Beside two basic operations the pmic platform data is introduced,
 which provides basic informations about the pmic device I/O interface
 and is shared with all childs (and should also for childs new uclass
 types in the future).

 Usually PMIC devices provides various functionalities with single
 or multiple I/O interfaces.
 Using this new framework and new uclass types introduced in the future,
 it can be handle like this:

 _ root device
 |
 |_ BUS 0 device (e.g. I2C0)- UCLASS_I2C/SPI/...
 | |_ PMIC device 1 (read/write ops)- UCLASS_PMIC
 |   |_ REGULATOR device (ldo/buck/... ops) - UCLASS_REGULATOR
 |   |_ CHARGER device (charger ops)- UCLASS_CHARGER (in the future)
 |   |_ MUIC device (microUSB con ops)  - UCLASS_MUIC(in the future)
 |   |_ ...
 |
 |_ BUS 1 device (e.g. I2C1)- UCLASS_I2C/SPI/...
   |_ PMIC device 2 (read/write ops)- UCLASS_PMIC
 |_ RTC device (rtc ops)- UCLASS_MUIC (in the future)

 For each PMIC device interface, new UCLASS_PMIC device is bind with proper
 pmic driver, and it's child devices provides some specified operations.

 All new definitions can be found in file:
 - 'include/power/pmic.h'

 Uclass file:
 - pmic-uclass.c - provides a common code for UCLASS_PMIC device drivers

 The old pmic framework is still kept and is independent.

 Changes:
 - new uclass-id: UCLASS_PMIC
 - new config: CONFIG_DM_PMIC

 New pmic api is documented in: doc/driver-model/pmic-framework.txt

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 ---
 Changes V2:
 - pmic uclass: adjust uclass code to the mainline changes
 - pmic uclass: remove pmic_i2c and pmic_spi
 - pmic uclass: modify pmic_platdata
 - pmic uclass: add pmic_if_* functions
 - pmic uclass: remove pmic_init_dm()
 - pmic uclass: cleanup
 - pmic.h: define pmic ops structure (read/write operations)
 - pmic.h: add comments to functions

 Changes V3:
 - pmic-uclass.c and pmic.h:
   -- remove  pmic_if_* functions
   -- add new function pmic_child_node_scan()
 - add Kconfig entry
 ---
  drivers/power/Kconfig   |  68 ++
  drivers/power/Makefile  |   1 +
  drivers/power/pmic-uclass.c | 130 +++
  include/dm/uclass-id.h  |   3 +
  include/power/pmic.h| 210 
 
  5 files changed, 412 insertions(+)
  create mode 100644 drivers/power/pmic-uclass.c

 diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
 index f8f0239..3513b46 100644
 --- a/drivers/power/Kconfig
 +++ b/drivers/power/Kconfig
 @@ -1,3 +1,71 @@
 +config DM_PMIC
 +   bool Enable Driver Model for PMIC drivers (UCLASS_PMIC)
 +   depends on DM
 +   ---help---
 +   This config enables the driver-model multi uclass PMIC support.
 +   Its basic uclass type is: UCLASS_PMIC, which is designed to provide
 +   a common I/O interface for pmic child devices of various uclass types.

Should be consistent - and use PMIC instead pmic.

 +
 +   Usually PMIC IC's provides more than one functionality, which means

s/functionality/function/

 +   that we should implement new uclass operations for each one. Usually
 +   PMIC's provide those various functionalities by one or more 
 interfaces.

functions

 +   And this could looks like this:
 +
 +   root device
 +   |_ BUS 0 device (e.g. I2C0) - UCLASS_I2C/SPI/...
 +   | |_ PMIC device (READ/WRITE ops)   - UCLASS_PMIC
 +   |   |  (pmic sub-devices)
 +   |   |_ REGULATOR device (ldo/buck/... ops)  - UCLASS_REGULATOR
 +   |   |_ CHARGER device (charger ops) - UCLASS_CHARGER (future)
 +   |   |_ MUIC device (microUSB connector ops) - UCLASS_MUIC(future)
 +   |   |_ ...
 +   |
 +   |_ BUS 1 device (e.g. I2C1) - UCLASS_I2C/SPI/...
 +  |_ PMIC device (READ/WRITE ops)  - UCLASS_PMIC
 +|  (pmic sub-devices)
 +|_ RTC device (rtc ops)- UCLASS_MUIC (future)

Would this be UCLASS_RTC?

 +
 +   From the I/O interface point of view, there can be found two PMIC 
 types:
 +   - single I/O interface - then UCLASS_PMIC device should be a parent of
 + all pmic sub-devices, where each is usually different uclass type, 
 but
 + need to access the same interface
 +
 +   - multiple I/O interfaces - for each interface the UCLASS_PMIC device
 + should be a parent of only those devices (different uclass types),
 + which needs to 

Re: [U-Boot] [PATCH v3 06/17] dm: regulator: add implementation of driver model regulator uclass

2015-03-29 Thread Simon Glass
Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This is the implementation of driver model regulator uclass api.
 To use it, the CONFIG_DM_PMIC is required with driver implementation,
 since it provides pmic devices basic I/O API.

 To get the regulator device:
 - regulator_get() - get the regulator device

 The regulator framework is based on a 'struct dm_regulator_ops'.
 It provides a common function calls, for it's basic features:
 - regulator_info()- get the regulator info structure
 - regulator_mode()- get the regulator mode info structure
 - regulator_get/set_value()   - get/set the regulator output voltage
 - regulator_get/set_current() - get/set the regulator output current
 - regulator_get/set_enable()  - get/set the regulator output enable state
 - regulator_get/set_mode()- get/set the regulator output operation mode

 An optional and useful regulator framework features are two descriptors:
 - struct dm_regulator_info- describes the regulator name and output value 
 limits

 - struct dm_regulator_mode - (array) describes the regulators operation modes

 The regulator framework features are described in file:
 - include/power/regulator.h

 Main files:
 - drivers/power/regulator-uclass.c - provides regulator common functions api
 - include/power/regulator.h - define all structures required by the regulator

 Changes:
 - new uclass-id: UCLASS_PMIC_REGULATOR
 - new config: CONFIG_DM_REGULATOR

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 ---
 Changes V2:
 - new operations for regulator uclass:
 -- get/set output state - for output on/off setting
 --- add enum: REGULATOR_OFF, REGULATOR_ON

 - regulator uclass code rework and cleanup:
 -- change name of:
 --- enum 'regulator_desc_type' to 'regulator_type'
 --- add type DVS
 --- struct 'regulator_desc' to 'regulator_value_desc'

 -- regulator ops function calls:
 --- remove 'ldo/buck' from naming
 --- add new argument 'type' for define regulator type

 -- regulator.h - update comments

 Changes V3:
 - regulator-uclass.c and regulator.h:
   -- api cleanup
   -- new function regulator_ofdata_to_platdata()
   -- update of comments
   -- add Kconfig
 ---
  drivers/power/Kconfig|  33 -
  drivers/power/Makefile   |   1 +
  drivers/power/regulator-uclass.c | 219 +
  include/dm/uclass-id.h   |   1 +
  include/power/regulator.h| 259 
 +++
  5 files changed, 512 insertions(+), 1 deletion(-)
  create mode 100644 drivers/power/regulator-uclass.c
  create mode 100644 include/power/regulator.h

 diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
 index 3513b46..1e73c7a 100644
 --- a/drivers/power/Kconfig
 +++ b/drivers/power/Kconfig
 @@ -66,7 +66,38 @@ config DM_PMIC
 So the call will looks like below:
 'pmic_write(regulator-parent, addr, value, len);'

 -config AXP221_POWER
 +config DM_REGULATOR

Can you move this to drivers/power/regulator?

 +   bool Enable Driver Model for REGULATOR drivers (UCLASS_REGULATOR)
 +   depends on DM
 +   ---help---
 +   This config enables the driver-model regulator uclass support, which
 +   provides implementation of driver model regulator uclass api.
 +
 +   Regulator uclass API calls:
 +   To get the regulator device:
 +   - regulator_get() - get the regulator device
 +
 +   The regulator framework is based on a 'struct dm_regulator_ops'.
 +   It provides a common function calls, for it's basic features:
 +   - regulator_info()- get the regulator info structure
 +   - regulator_mode()- get the regulator mode info structure
 +   - regulator_get/set_value()   - operate on output voltage value
 +   - regulator_get/set_current() - operate on output current value
 +   - regulator_get/set_enable()  - operate on output enable state
 +   - regulator_get/set_mode()- operate on output operation mode
 +
 +   An optional and useful regulator framework features are two 
 descriptors:
 +   - struct dm_regulator_info - describes the regulator name and output 
 limits
 +   - struct dm_regulator_mode - describes the regulators operation mode
 +
 +   The regulator framework features are described in file:
 +   - include/power/regulator.h
 +
 +   Main files:
 +   - drivers/power/regulator-uclass.c - provides regulator common 
 functions api
 +   - include/power/regulator.h - define all structures required by the 
 regulato
 +
 +   config AXP221_POWER

I don't think this should be indented.

 boolean axp221 / axp223 pmic support
 depends on MACH_SUN6I || MACH_SUN8I
 default y
 diff --git a/drivers/power/Makefile b/drivers/power/Makefile
 index 5c9a189..a6b7012 100644
 --- a/drivers/power/Makefile
 +++ b/drivers/power/Makefile
 @@ -22,3 +22,4 @@ 

Re: [U-Boot] [PATCH v3 04/17] lib: Kconfig: add entry for errno_str() function

2015-03-29 Thread Simon Glass
On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 ---
  lib/Kconfig | 8 
  1 file changed, 8 insertions(+)

Acked-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Please pull u-boot-sunxi master (v2)

2015-03-29 Thread Tom Rini
On Sun, Mar 29, 2015 at 02:59:39PM +0200, Hans de Goede wrote:

 Hi Tom,
 
 This pull-req superceeds my previous pull-req from about 10 minutes ago,
 as I found that one board was missing a MAINTAINERS entry, so I've included
 a fix for that in this new pull-req.
 
 Please pull u-boot-sunxi/master into master for another round of bugfixes
 for v2015.04:
 
 The following changes since commit 5db752353b6a19c50db4a30692efb7e845fb8a6e:
 
   powerpc: ppc4xx: convert AMCC boards to generic board (2015-03-28 12:09:46 
 -0400)
 
 are available in the git repository at:
 
   http://git.denx.de/u-boot-sunxi.git master
 
 for you to fetch changes up to 662e2acb46250881ec26bc8366fc9eb1856cb7c2:
 
   sunxi: UTOO_P66: Add missing MAINTAINERS entry (2015-03-29 14:56:48 +0200)
 

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 v2 1/3] sunxi: sun4i: improve cpu clock selection method

2015-03-29 Thread Hans de Goede

Hi,

On 28-03-15 11:25, Iain Paton wrote:

clock_set_pll1 would pick the next highest available cpu clock speed if
a value not in the pre defined table was selected. this potentially
results in overclocking the soc.

reverse the selection method so that we select the next lowest speed
and add the missing 912Mhz setting that's requested by sun7i which also
uses the sun4i clock code.

Signed-off-by: Iain Paton ipat...@gmail.com


Thanks for the new set.

I've found one small issue with the second patch:
sunxi: use CONFIG_SYS_CLK_FREQ to set cpu clock

sun7i.h contained the following:

#define CONFIG_SYS_CLK_FREQ 2400
#define CONFIG_TIMER_CLK_FREQ   CONFIG_SYS_CLK_FREQ

Which is a conflicting usage of CONFIG_SYS_CLK_FREQ compared to the new
usage introduced by your patch. I've fixed this by changing the above
to:

#define CONFIG_TIMER_CLK_FREQ   2400

And run some compile and runtime tests.

Everything builds and works fine with this change added, so I've pushed
these 3 commits + one other fix to: u-boot-sunxi/master

And I will send out a pull-req shortly to get these fixes included into
the upcoming u-boot v2015.04 release.

Regards,

Hans



---
  arch/arm/cpu/armv7/sunxi/clock_sun4i.c | 35 ++
  1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c 
b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
index 49f4032..c3e04af 100644
--- a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
+++ b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
@@ -100,22 +100,23 @@ static struct {
unsigned int freq;
  } pll1_para[] = {
/* This array must be ordered by frequency. */
-   { PLL1_CFG(16, 0, 0, 0), 38400 },
-   { PLL1_CFG(16, 1, 0, 0), 76800 },
-   { PLL1_CFG(20, 1, 0, 0), 96000 },
-   { PLL1_CFG(21, 1, 0, 0), 100800},
-   { PLL1_CFG(22, 1, 0, 0), 105600},
-   { PLL1_CFG(23, 1, 0, 0), 110400},
-   { PLL1_CFG(24, 1, 0, 0), 115200},
-   { PLL1_CFG(25, 1, 0, 0), 12},
-   { PLL1_CFG(26, 1, 0, 0), 124800},
-   { PLL1_CFG(27, 1, 0, 0), 129600},
-   { PLL1_CFG(28, 1, 0, 0), 134400},
-   { PLL1_CFG(29, 1, 0, 0), 139200},
-   { PLL1_CFG(30, 1, 0, 0), 144000},
{ PLL1_CFG(31, 1, 0, 0), 148800},
-   /* Final catchall entry */
-   { PLL1_CFG(31, 1, 0, 0), ~0},
+   { PLL1_CFG(30, 1, 0, 0), 144000},
+   { PLL1_CFG(29, 1, 0, 0), 139200},
+   { PLL1_CFG(28, 1, 0, 0), 134400},
+   { PLL1_CFG(27, 1, 0, 0), 129600},
+   { PLL1_CFG(26, 1, 0, 0), 124800},
+   { PLL1_CFG(25, 1, 0, 0), 12},
+   { PLL1_CFG(24, 1, 0, 0), 115200},
+   { PLL1_CFG(23, 1, 0, 0), 110400},
+   { PLL1_CFG(22, 1, 0, 0), 105600},
+   { PLL1_CFG(21, 1, 0, 0), 100800},
+   { PLL1_CFG(20, 1, 0, 0), 96000 },
+   { PLL1_CFG(19, 1, 0, 0), 91200 },
+   { PLL1_CFG(16, 1, 0, 0), 76800 },
+   /* Final catchall entry 384MHz*/
+   { PLL1_CFG(16, 0, 0, 0), 0 },
+
  };

  void clock_set_pll1(unsigned int hz)
@@ -126,10 +127,12 @@ void clock_set_pll1(unsigned int hz)
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;

/* Find target frequency */
-   while (pll1_para[i].freq  hz)
+   while (pll1_para[i].freq  hz)
i++;

hz = pll1_para[i].freq;
+   if (! hz)
+   hz = 38400;

/* Calculate system clock divisors */
axi = DIV_ROUND_UP(hz, 43200);  /* Max 450MHz */


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


[U-Boot] Please pull u-boot-sunxi master

2015-03-29 Thread Hans de Goede

Hi Tom,

Please pull u-boot-sunxi/master into master for another round of bugfixes
for v2015.04:

The following changes since commit 5db752353b6a19c50db4a30692efb7e845fb8a6e:

  powerpc: ppc4xx: convert AMCC boards to generic board (2015-03-28 12:09:46 
-0400)

are available in the git repository at:

  http://git.denx.de/u-boot-sunxi.git master

for you to fetch changes up to 961e77712bbf14a6797bc0d725aed956cd06bce1:

  sunxi: a10-LIME set the cpu clock at boot to 912MHz (2015-03-29 13:37:39 
+0200)


Hans de Goede (1):
  sunxi: musb: Fix some lo speed devices not working with musb host

Iain Paton (3):
  sunxi: sun4i: improve cpu clock selection method
  sunxi: use CONFIG_SYS_CLK_FREQ to set cpu clock
  sunxi: a10-LIME set the cpu clock at boot to 912MHz

 Kconfig|  2 +-
 arch/arm/cpu/armv7/sunxi/clock_sun4i.c | 35 ++
 arch/arm/cpu/armv7/sunxi/psci.S|  2 +-
 arch/arm/cpu/armv7/sunxi/usbc.c|  7 +++
 arch/arm/include/asm/arch-sunxi/usbc.h |  1 +
 board/sunxi/Kconfig|  4 
 board/sunxi/board.c|  2 +-
 configs/A10-OLinuXino-Lime_defconfig   |  1 +
 drivers/usb/musb-new/musb_uboot.c  | 14 ++
 include/configs/sun4i.h|  1 -
 include/configs/sun5i.h|  1 -
 include/configs/sun6i.h|  1 -
 include/configs/sun7i.h|  4 +---
 include/configs/sun8i.h|  1 -
 14 files changed, 50 insertions(+), 26 deletions(-)

Regards,

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


Re: [U-Boot] [PATCH v4 2/2] sunxi: Pass serial number through ATAG

2015-03-29 Thread Hans de Goede

Hi,

On 28-03-15 18:35, Paul Kocialkowski wrote:

Signed-off-by: Paul Kocialkowski cont...@paulk.fr


Thanks, I've added this to my personal git repo, sunxi-wip
branch. I'll move it over to u-boot-sunxi/next once it
is clear that the kernel patch to show the devicetree
serial-number string /proc/cpuinfo is going to be accepted.

Regards,

Hans




---
  board/sunxi/board.c| 20 
  include/configs/sunxi-common.h |  1 +
  2 files changed, 21 insertions(+)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 79516bf..d1b3c5e 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -369,6 +369,26 @@ int g_dnl_board_usb_cable_connected(void)
  }
  #endif

+#ifdef CONFIG_SERIAL_TAG
+void get_board_serial(struct tag_serialnr *serialnr)
+{
+   char *serial_string;
+   unsigned long long serial;
+
+   serial_string = getenv(serial#);
+
+   if (serial_string) {
+   serial = simple_strtoull(serial_string, NULL, 16);
+
+   serialnr-high = (unsigned int) (serial  32);
+   serialnr-low = (unsigned int) (serial  0x);
+   } else {
+   serialnr-high = 0;
+   serialnr-low = 0;
+   }
+}
+#endif
+
  #ifdef CONFIG_MISC_INIT_R
  int misc_init_r(void)
  {
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 1f7a1cb..b9bb971 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -98,6 +98,7 @@
  #define CONFIG_SETUP_MEMORY_TAGS
  #define CONFIG_CMDLINE_TAG
  #define CONFIG_INITRD_TAG
+#define CONFIG_SERIAL_TAG

  /* mmc config */
  #if !defined(CONFIG_UART0_PORT_F)


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


Re: [U-Boot] [PATCH 07/20] dm: tegra: cros_ec: Enable Chrome OS EC on Nyan-big

2015-03-29 Thread Simon Glass
Hi Stephen,

On 25 February 2015 at 16:15, Stephen Warren swar...@wwwdotorg.org wrote:
 On 02/17/2015 03:29 PM, Simon Glass wrote:

 Enable the EC and keyboard, using the SPI bus.

 The EC driver requires a particular format and a deactivation delay. Also
 U-Boot does not support interrupts.

 For now, adjust the device tree to comply. At some point we should tidy
 this up to support interrupts and make tegra and exynos use the same
 setup.


 diff --git a/arch/arm/dts/tegra124-nyan-big.dts
 b/arch/arm/dts/tegra124-nyan-big.dts


 spi@7000d400 {
 status = okay;
 +   spi-deactivate-delay = 200;
 +   spi-max-frequency = 300;

 cros_ec: cros-ec@0 {
 -   compatible = google,cros-ec-spi;
 -   spi-max-frequency = 300;
 +   compatible = google,cros-ec;


 I recall some discussion that implied both the SPI bus/controller node and
 the SPI device node both needed an spi-max-frequency property. Can you
 double-check this change conforms with the DT binding, and whatever Linux
 has in its DT files?

It looks like it needs to be in the slave so I'll add it back there. I
don't see it in the bus in the Linux version of the SPI bus node, so
presumably it uses a default speed, perhaps higher than 3MHz. Probably
best to have it in both places.

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


Re: [U-Boot] [PATCH 04/20] tegra: Provide more accurate microsecond time

2015-03-29 Thread Simon Glass
Hi Stephen,

On 25 February 2015 at 16:10, Stephen Warren swar...@wwwdotorg.org wrote:
 On 02/17/2015 03:29 PM, Simon Glass wrote:

 Add an implementation of the timer functions for tegra, so that timing
 is more accurate. Tegra has a 1 microsecond timer for this purpose.


 I'm a bit confused about this:

 include/configs/tegra-common.h:32:#define CONFIG_SYS_TIMER_COUNTER
 NV_PA_TMRUS_BASE

 lib/time.c:

 #ifdef CONFIG_SYS_TIMER_COUNTER
 unsigned long notrace timer_read_counter(void)
 {
 #ifdef CONFIG_SYS_TIMER_COUNTS_DOWN
 return ~readl(CONFIG_SYS_TIMER_COUNTER);
 #else
 return readl(CONFIG_SYS_TIMER_COUNTER);
 #endif
 }

 Doesn't that provide the same set of features, without requiring
 Tegra-specific code?

Yes you are right. I couldn't find out where this was being done and
was seeing strange behaviour with udelay(). I'm not very keen on the
lldiv() in lib/time.c when it is a no-op. But I suppose all it can do
is slow things down a bit.

Anyway, we can drop this patch.

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


Re: [U-Boot] [PATCH v3 00/17] Power(full) framework based on Driver Model

2015-03-29 Thread Simon Glass
Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 Hello,
 Here is the third RFC version of the new PMIC framework.Big thanks to
 Simon Glass, your comments were really helpful, and I think, that this
 version is much more better to discuss, than the previous. The changes
 made in this version are described below each commit. Sorry that I didn't
 reply to each patch, I agreed with most and just started the work.

This is looking really good. Here are a few overall comments.

1. There is one oddity that I'd like to address before merging.

I don't think the fdt_node_check_prop_compatible() is a good idea, nor
necessary. I don't think we should consider the regulator-compatible
property to be a compatible string. It has values like LDO8, LDO9 and
these don't look like compatible strings, which are normally unique
and point to a driver. Here they point to a particular device.

A similar problem is faced in pinctrl and if you look at
gpio_exynos_bind() you will see that it works through the sub-nodes,
creating devices as needed.

I don't think using udevice_id is right here either.

Here is my suggestion:

a. Create a new structure like this:

struct pmic_child_info {
   const char *prefix;   // LDO or BUCK
   const char *driver_name;   // max77686_ldo or max77686_buck
};

b. Pass a list of these to pmic_child_node_scan(). In your case there
will be three entries, one for LDO, one for BUCK, plus a NULL
termination entry,

c. It can work through the subnodes looking for the given prefixes. It
then calls device_bind_driver() on each. Then it changes the returned
device's of_data to hold the correct value (obtained with strtol() on
the part of the name that follows the prefix - e.g. 17 for LDO17).
This will be easier if you rebase on u-boot-dm/usb-working, where the
data is just a long, not a device tree pointer.

d. Now you have the same effect as before, but you can drop the tables
like max77686_ldo_ids[] and avoid misappropriating driver model's
device lookup.

2. Should we put the regulator stuff in drivers/regulator, as with Linux?

3. Can you please bring in the regulator and pmic device tree binding
files, plus max77686?

4. We really do need tests! I suspect that you could create a sandbox
I2C pmic that has a few registers and regulators. See
i2c_eeprom_emul.c for a basic example. Then you can write some tests
that find the pmi,c find the regulator, read and write a few
registers, and read and write a few regulators. That would be enough
test coverage to get us started. I know this is different from
previous U-Boot policy, but tests are a big win during development and
also for years to come (as people can change the framework and have
some confidence that they did not break anything).

It can be a follow-on patch separate from your series but I'm really
not keen on bringing in a major new driver model framework with no
tests. If you are struggling for time, let me know and I can try to
help by writing a sandbox I2C PMIC for example.

Regards,
Simon


 Best regards

 Przemyslaw Marczak (17):
   exynos5: fix build break by adding CONFIG_POWER
   fdt_ro.c: add new function: fdt_node_check_prop_compatible()
   dm: core: lists.c: add new function lists_bind_fdt_by_prop()
   lib: Kconfig: add entry for errno_str() function
   dm: pmic: add implementation of driver model pmic uclass
   dm: regulator: add implementation of driver model regulator uclass
   dm: pmic: add pmic command
   dm: regulator: add regulator command
   pmic: max77686 set the same compatible as in the kernel
   dm: pmic: add max77686 pmic driver
   dm: regulator: add max77686 regulator driver
   dm: regulator: add fixed voltage regulator driver
   doc: driver-model: pmic and regulator uclass documentation
   dm: board:samsung: power_init_board: add requirement of CONFIG_DM_PMIC
   odroid: board: add support to dm pmic api
   odroid: dts: add 'voltage-regulators' description to max77686 node
   odroid: config: enable dm pmic, dm regulator and max77686 driver

  Makefile |   1 +
  arch/arm/dts/exynos4412-odroid.dts   | 249 +-
  arch/arm/dts/exynos4412-trats2.dts   |   2 +-
  arch/arm/dts/exynos5250-smdk5250.dts |   2 +-
  arch/arm/dts/exynos5250-snow.dts |   2 +-
  board/samsung/common/board.c |   4 +-
  board/samsung/common/misc.c  |   1 +
  board/samsung/odroid/odroid.c| 113 -
  common/Kconfig   |  36 ++
  common/Makefile  |   4 +
  common/cmd_pmic.c| 210 +
  common/cmd_regulator.c   | 385 +++
  configs/odroid_defconfig |   8 +-
  doc/driver-model/pmic-framework.txt  | 350 ++
  drivers/core/lists.c |  28 +-
  drivers/power/Kconfig| 124 -
  drivers/power/Makefile   |   3 +-
  drivers/power/pmic-uclass.c  | 130 ++
  drivers/power/pmic/Makefile  |   1 +
  

Re: [U-Boot] [PATCH] arm: imx: Switch Wandboard to use config_distro_bootcmd.h.

2015-03-29 Thread Tom Rini
On Sat, Mar 28, 2015 at 02:15:38PM +0100, Karsten Merker wrote:
 On Fri, Mar 27, 2015 at 06:24:43PM -0700, Vagrant Cascadian wrote:
 
  This allows for more flexible and standardized boot across multiple
  platforms. Remove most redundant legacy boot environment.
  
  Cc: Otavio Salvador ota...@ossystems.com.br
  Signed-off-by: Vagrant Cascadian vagr...@debian.org
  ---
  
   include/configs/wandboard.h | 139 
  ++--
   1 file changed, 17 insertions(+), 122 deletions(-)
  
  diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
 [...]
   #define CONFIG_EXTRA_ENV_SETTINGS \
  -   script=boot.scr\0 \
  -   image=zImage\0 \
  console=ttymxc0\0 \
 
 Hello,
 
 regarding the boot environment standardization there is still the
 open topic of standardizing the console variable format for
 serial consoles - most platforms include the console baudrate in
 the console variable (e.g. console=ttyS0,115200) while some
 others, in particular the i.MX6 platforms, do not. This means
 that distributions like Debian currently need to add special-case
 handling for i.MX6-based platforms in their boot scripts which
 goes against the idea of having one generic boot script for all
 platforms that use config_distro_bootcmd.h.
 
 It would be nice if the i.MX6 platforms could - while adopting
 config_distro_bootcmd.h and thereby changing their default
 environment to a large extend - also change their console
 variable from console=ttymxc0 to console=ttymxc0,115200.

Yes please.  And Karsten can you do a patch that updates the README to
note that as an expectation?  Thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 01/17] exynos5: fix build break by adding CONFIG_POWER

2015-03-29 Thread Simon Glass
On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 Move the configs listed below from exynos5-dt-common.h to exynos5-common.h:
 - CONFIG_POWER
 - CONFIG_POWER_I2C
 fixes build break for Arndale and Smdk5250 boards.

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 ---
  include/configs/exynos5-common.h | 4 
  1 file changed, 4 insertions(+)

Acked-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 12/17] dm: regulator: add fixed voltage regulator driver

2015-03-29 Thread Simon Glass
Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This driver implements regulator uclass features for fixed value regulators.
 For getting the basic regulator device-tree node constraints, this driver 
 calls
 function 'regulator_ofdata_to_platdata()'. The typical fixed regulator node
 provides few additional properties:
 - gpio
 - gpio-open-drain
 - enable-active-high
 - startup-delay-us
 All above are checked and keept in structure of type 'fixed_regulator_priv',
 which is private for each fixed-regulator device (dev-priv).

 The driver implements only three of regulator uclass features:
 - get_value
 - get_enable
 - set_enable

 The regulator calls and command line features can be used for fixed-regulator,
 and the proper error will be returned for prohibited.

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com

 Changes v3:
 - new file
 - Kconfig add fixed-regulator entry
 ---
  drivers/power/Kconfig|   8 +++
  drivers/power/regulator/Makefile |   1 +
  drivers/power/regulator/fixed.c  | 124 
 +++
  3 files changed, 133 insertions(+)
  create mode 100644 drivers/power/regulator/fixed.c

 diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
 index 97abbf0..da1e866 100644
 --- a/drivers/power/Kconfig
 +++ b/drivers/power/Kconfig
 @@ -120,6 +120,14 @@ config DM_REGULATOR_MAX77686
 features for REGULATOR MAX77686. The driver implements get/set api 
 for:
 value, enable and mode.

 +config DM_REGULATOR_FIXED
 +   bool Enable Driver Model for REGULATOR Fixed value
 +   depends on DM_REGULATOR
 +   ---help---
 +   This config enables implementation of driver-model regulator uclass
 +   features for fixed value regulators. The driver implements get/set api
 +   for enable and get only for voltage value.
 +

Should be in drivers/regulator/Kconfig I think

  config AXP221_DCDC1_VOLT
 int axp221 dcdc1 voltage
 depends on AXP221_POWER
 diff --git a/drivers/power/regulator/Makefile 
 b/drivers/power/regulator/Makefile
 index 9d282e3..0a6a6d9 100644
 --- a/drivers/power/regulator/Makefile
 +++ b/drivers/power/regulator/Makefile
 @@ -5,4 +5,5 @@
  # SPDX-License-Identifier: GPL-2.0+
  #

 +obj-$(CONFIG_DM_REGULATOR_FIXED) += fixed.o
  obj-$(CONFIG_DM_REGULATOR_MAX77686) += max77686.o
 diff --git a/drivers/power/regulator/fixed.c b/drivers/power/regulator/fixed.c
 new file mode 100644
 index 000..45e9f84
 --- /dev/null
 +++ b/drivers/power/regulator/fixed.c
 @@ -0,0 +1,124 @@
 +/*
 + *  Copyright (C) 2015 Samsung Electronics
 + *
 + *  Przemyslaw Marczak p.marc...@samsung.com
 + *
 + * SPDX-License-Identifier:GPL-2.0+
 + */
 +
 +#include common.h
 +#include fdtdec.h
 +#include i2c.h
 +#include dm.h
 +#include asm/gpio.h
 +#include power/pmic.h
 +#include power/regulator.h
 +#include errno.h
 +#include dm.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +struct fixed_regulator_priv {
 +   struct gpio_desc gpio;
 +   bool gpio_open_drain;
 +   bool enable_active_high;
 +   unsigned startup_delay_us;

Docs for these?

 +};
 +
 +static int fixed_regulator_ofdata_to_platdata(struct udevice *dev)
 +{
 +   struct dm_regulator_info *info = dev-uclass_priv;
 +   struct fixed_regulator_priv *priv = dev-priv;
 +   int ret, offset = dev-of_offset;
 +
 +   /* Get the basic regulator constraints */
 +   ret = regulator_ofdata_to_platdata(dev);
 +   if (ret) {
 +   error(Can't get regulator constraints for %s, dev-name);
 +   return ret;
 +   }
 +
 +   /* Get fixed regulator gpio desc */
 +   ret = gpio_request_by_name_nodev(gd-fdt_blob, offset, gpio, 0,
 +priv-gpio, GPIOD_IS_OUT);

Should not use the nodev version - you have a device.

 +   if (ret) {
 +   error(Fixed regulator gpio - not found! Error: %d, ret);
 +   return ret;
 +   }
 +
 +   /* Get fixed regulator addidional constraints */
 +   priv-gpio_open_drain = fdtdec_get_bool(gd-fdt_blob, offset,
 +   gpio-open-drain);
 +   priv-enable_active_high = fdtdec_get_bool(gd-fdt_blob, offset,
 +  enable-active-high);
 +   priv-startup_delay_us = fdtdec_get_int(gd-fdt_blob, offset,
 +   startup-delay-us, 0);
 +
 +   /* Set type to fixed - used by regulator command */
 +   info-type = REGULATOR_TYPE_FIXED;
 +
 +   debug(%s:%d\n, __func__, __LINE__);
 +   debug( name:%s, boot_on:%d, active_hi: %d start_delay:%u\n,
 +   info-name, info-boot_on, priv-enable_active_high,
 +   priv-startup_delay_us);
 +
 +   return 0;
 +}
 +
 +static int fixed_regulator_get_value(struct udevice *dev)
 +{
 +   struct dm_regulator_info *info;
 +   int ret;
 +
 +   ret = regulator_info(dev, info);
 +  

Re: [U-Boot] [PATCH v3 13/17] doc: driver-model: pmic and regulator uclass documentation

2015-03-29 Thread Simon Glass
Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 ---
 Changes v2, V3:
 - update documentation with the framework api changes
 - remove doc file name 'dm' prefix
 ---
  doc/driver-model/pmic-framework.txt | 350 
 
  1 file changed, 350 insertions(+)
  create mode 100644 doc/driver-model/pmic-framework.txt

 diff --git a/doc/driver-model/pmic-framework.txt 
 b/doc/driver-model/pmic-framework.txt
 new file mode 100644
 index 000..72651dc
 --- /dev/null
 +++ b/doc/driver-model/pmic-framework.txt
 @@ -0,0 +1,350 @@
 +#
 +# (C) Copyright 2014-2015 Samsung Electronics
 +# Przemyslaw Marczak p.marc...@samsung.com
 +#
 +# SPDX-License-Identifier:  GPL-2.0+
 +#
 +
 +PMIC framework based on Driver Model
 +
 +TOC:
 +1. Introduction
 +2. How does it work
 +3. Pmic driver api
 +4. Pmic driver
 +5. Pmic command
 +6. Regulator driver api
 +7. Regulator driver
 +8. Regulator command
 +
 +1. Introduction
 +===
 +This is an introduction to driver-model multi uclass PMIC devices support.
 +At present it is based on two uclass types:
 +
 +- UCLASS_PMIC  - basic uclass type for PMIC I/O, which provides common
 + read/write interface.
 +- UCLASS_REGULATOR - additional uclass type for specific PMIC features, which
 + are various voltage regulators.
 +
 +New files:
 +UCLASS_PMIC:
 +- drivers/power/pmic-uclass.c
 +- include/power/pmic.h
 +UCLASS_REGULATOR:
 +- drivers/power/regulator-uclass.c
 +- include/power/regulator.h
 +
 +Commands:
 +- lib/cmd_pmic.c
 +- lib/cmd_regulator.c
 +
 +2. How doees it work
 +
 +The Power Management Integrated Circuits (PMIC) are used in embedded systems
 +to provide stable, precise and specific voltage power source with 
 over-voltage
 +and thermal protection circuits.
 +
 +The single PMIC can provide various functionalities with single or multiple
 +interfaces, like in the example below.
 +
 +-- SoC
 + |
 + |__
 + | BUS 0 |   Multi interface PMIC IC|-- LDO out 1
 + | e.g.I2C0  |  |-- LDO out N
 + |---| PMIC device 0 (READ/WRITE ops)   |
 + | or SPI0   ||_ REGULATOR device (ldo/... ops) |-- BUCK out 1
 + |   ||_ CHARGER device (charger ops)   |-- BUCK out M
 + |   ||_ MUIC device (microUSB con ops) |
 + | BUS 1 ||_ ...|--- BATTERY
 + | e.g.I2C1  |  |
 + |---| PMIC device 1 (READ/WRITE ops)   |--- USB in 1
 + . or SPI1   ||_ RTC device (rtc ops)   |--- USB in 2
 + .   |__|--- USB out
 + .
 +
 +Since U-Boot provides driver model features for I2C and SPI bus drivers,
 +the PMIC devices should also support this. With the new basic uclass types
 +for PMIC I/O and regulator features, PMIC drivers can simply provide common
 +features, with multiple interface and instance support.
 +
 +Basic design assumptions:
 +
 +- Common I/O api - UCLASS_PMIC
 +The main assumption is to use UCLASS_PMIC device to provide I/O interface,

an I/O interface

 +for devices other uclass types. It is no matter what is the type of device
 +physical I/O interface.

devices of other uclass types. It doesn't matter what type of physical
I/O interface is used.


Usually PMIC devices are using SPI or I2C interface,

s/are using/use/

 +but use of any other interface (e.g. when PMIC is not directly connected
 +to the SoC) - is now possible. Drivers can use the same read/write api.
 +
 +- Common regulator api - UCLASS_REGULATOR
 +For setting the attributes of verious types of regulators with common api,

various

with a common

 +this uclass can be implemented. This allows to drive the each regulator 
 output

allows driving each regulator's output

 +value, on/off state and custom defined operation modes. It also provides the

custom-defined

or perhaps just 'particular'

 +user interface for all operations.
 +For the very simple implementation, the regulator drivers are not required,

For simple implementations, regulator drivers are not required, so the
code can use pmic read/write directly.

 +so the code could base on pmic read/write only.
 +
 +When board device-tree file includes pmic subnode and the U_Boot compatible
 +driver exists, then the pmic device bind should looks like this:
 +
 +|_ root - will bind the device for I2C/SPI bus node
 +  |_ i2c/spi - should bind a device for pmic node
 +|_ pmic (parent) - should bind child devices for its features
 +  |_ regulator (child)
 +  |_ charger   (child)
 +  |_ other (child)
 +
 +Usually PMIC design provides:
 + - single I/O interface (single UCLASS_PMIC driver)
 +   Then UCLASS_PMIC device should be a parent of all pmic devices, where 

Re: [U-Boot] [PATCH 1/7] sunxi: TZX-Q8-713B7 mmc0 card-detect pin

2015-03-29 Thread Hans de Goede

Hi,

On 29-03-15 11:19, Paul Kocialkowski wrote:

Signed-off-by: Paul Kocialkowski cont...@paulk.fr


Thanks, I've merged the entire set in u-boot-sunxi/next, and
it will be included in u-boot/master once the merge window
for v2015.07 opens.

Regards,

Hans



---
  configs/TZX-Q8-713B7_defconfig | 1 +
  1 file changed, 1 insertion(+)

diff --git a/configs/TZX-Q8-713B7_defconfig b/configs/TZX-Q8-713B7_defconfig
index 4ff4542..0953554 100644
--- a/configs/TZX-Q8-713B7_defconfig
+++ b/configs/TZX-Q8-713B7_defconfig
@@ -1,6 +1,7 @@
  CONFIG_SPL=y
  CONFIG_SYS_EXTRA_OPTIONS=CONS_INDEX=2,AXP209_POWER
  CONFIG_FDTFILE=sun5i-a13-tzx-q8-713b7.dtb
+CONFIG_MMC0_CD_PIN=PG0
  CONFIG_USB_MUSB_SUNXI=y
  CONFIG_USB0_VBUS_PIN=PG12
  CONFIG_USB0_VBUS_DET=PG1


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


Re: [U-Boot] [PATCH v3 15/17] odroid: board: add support to dm pmic api

2015-03-29 Thread Simon Glass
 Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This commit change the old pmic framework calls with the new ones.

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 ---
 Changes v2:
 - remove board_init_i2c() call
 - update regulator calls
 - update headers
 - samsung/misc.c: include required header

 Changes v3:
 - adjust regulator calls to new api
 ---
  board/samsung/common/misc.c   |   1 +
  board/samsung/odroid/odroid.c | 113 
 +-
  2 files changed, 91 insertions(+), 23 deletions(-)

 diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
 index 1a77c82..f0d69d4 100644
 --- a/board/samsung/common/misc.c
 +++ b/board/samsung/common/misc.c
 @@ -16,6 +16,7 @@
  #include asm/arch/cpu.h
  #include asm/gpio.h
  #include linux/input.h
 +#include dm.h
  #include power/pmic.h
  #include mmc.h

 diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c
 index ae41c29..aa3b0ff 100644
 --- a/board/samsung/odroid/odroid.c
 +++ b/board/samsung/odroid/odroid.c
 @@ -12,7 +12,9 @@
  #include asm/arch/gpio.h
  #include asm/gpio.h
  #include asm/arch/cpu.h
 +#include dm.h
  #include power/pmic.h
 +#include power/regulator.h
  #include power/max77686_pmic.h
  #include errno.h
  #include mmc.h
 @@ -405,15 +407,62 @@ static void board_gpio_init(void)

  static int pmic_init_max77686(void)
  {
 -   struct pmic *p = pmic_get(MAX77686_PMIC);
 +   struct udevice *dev;
 +   int ret;

 -   if (pmic_probe(p))
 -   return -ENODEV;
 +   ret = regulator_get(VDDQ_EMMC_1.8V, dev);
 +   if (ret) {
 +   error(Regulator get error: %d, ret);
 +   return ret;
 +   }
 +
 +   ret = regulator_set_value(dev, 180);
 +   if (ret) {
 +   error(Regulator %s value setting error: %d, dev-name, ret);
 +   return ret;
 +   }
 +
 +   ret = regulator_set_enable(dev, true);
 +   if (ret) {
 +   error(Regulator %s enable error: %d, dev-name, ret);
 +   return ret;
 +   }

How about adding a function that finds a regulator, sets its voltage
and enables it? Then you can avoid duplicating the same code 3 times.

 +
 +   ret = regulator_get(TFLASH_2.8V, dev);
 +   if (ret) {
 +   error(Regulator get error: %d, ret);
 +   return ret;
 +   }
 +
 +   ret = regulator_set_value(dev, 280);
 +   if (ret) {
 +   error(Regulator %s value setting error: %d, dev-name, ret);
 +   return ret;
 +   }
 +
 +   ret = regulator_set_enable(dev, true);
 +   if (ret) {
 +   error(Regulator %s enable error: %d, dev-name, ret);
 +   return ret;
 +   }
 +
 +   ret = regulator_get(VDDQ_EMMC_2.8V, dev);
 +   if (ret) {
 +   error(Regulator get error: %d, ret);
 +   return ret;
 +   }

 -   /* Set LDO Voltage */
 -   max77686_set_ldo_voltage(p, 20, 180);   /* LDO20 eMMC */
 -   max77686_set_ldo_voltage(p, 21, 280);   /* LDO21 SD */
 -   max77686_set_ldo_voltage(p, 22, 280);   /* LDO22 eMMC */
 +   ret = regulator_set_value(dev, 280);
 +   if (ret) {
 +   error(Regulator %s value setting error: %d, dev-name, ret);
 +   return ret;
 +   }
 +
 +   ret = regulator_set_enable(dev, true);
 +   if (ret) {
 +   error(Regulator %s enable error: %d, dev-name, ret);
 +   return ret;
 +   }

 return 0;
  }
 @@ -434,7 +483,6 @@ int exynos_init(void)

  int exynos_power_init(void)
  {
 -   pmic_init(0);
 pmic_init_max77686();

 return 0;
 @@ -443,19 +491,20 @@ int exynos_power_init(void)
  #ifdef CONFIG_USB_GADGET
  static int s5pc210_phy_control(int on)
  {
 -   struct pmic *p_pmic;
 -
 -   p_pmic = pmic_get(MAX77686_PMIC);
 -   if (!p_pmic)
 -   return -ENODEV;
 +   struct udevice *dev;
 +   int ret;

 -   if (pmic_probe(p_pmic))
 -   return -1;
 +   ret = regulator_get(VDD_UOTG_3.0V, dev);
 +   if (ret) {
 +   error(Regulator get error: %d, ret);
 +   return ret;
 +   }

 if (on)
 -   return max77686_set_ldo_mode(p_pmic, 12, OPMODE_ON);
 +   return regulator_set_mode(dev, OPMODE_ON);
 else
 -   return max77686_set_ldo_mode(p_pmic, 12, OPMODE_LPM);
 +   return regulator_set_mode(dev, OPMODE_LPM);
 +
  }

  struct s3c_plat_otg_data s5pc210_otg_data = {
 @@ -472,7 +521,8 @@ struct s3c_plat_otg_data s5pc210_otg_data = {
  int board_usb_init(int index, enum usb_init_type init)
  {
  #ifdef CONFIG_CMD_USB
 -   struct pmic *p_pmic;
 +   struct udevice *dev;
 +   int ret;

 /* Set Ref freq 0 = 24MHz, 1 = 26MHz*/
 /* Odroid Us have it at 24MHz, Odroid Xs at 26MHz */
 @@ -490,14 

Re: [U-Boot] [PATCH 1/2] tegra: seaboard: Remove unused CONFIG_UART_DISABLE_GPIO

2015-03-29 Thread Simon Glass
Hi Tom,

On 9 March 2015 at 20:49, Stephen Warren swar...@wwwdotorg.org wrote:
 On 03/09/2015 07:12 PM, Simon Glass wrote:
 This CONFIG is not used, so drop it.

 The series,
 Tested-by: Stephen Warren swar...@wwwdotorg.org
 Acked-by: Stephen Warren swar...@wwwdotorg.org

Can you please apply this fix?

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


Re: [U-Boot] [PATCH 2/2] tegra: seaboard: Correct the gpio_request() call

2015-03-29 Thread Simon Glass
Hi Tom,

On 9 March 2015 at 19:16, Simon Glass s...@chromium.org wrote:
 Let's try this:

 Reported-by: Stephen Warren swar...@nvidia.com


 On 9 March 2015 at 19:12, Simon Glass s...@chromium.org wrote:
 Requesting a GPIO without a name is not supposed anymore. This causes the
 request to fail. Add a name so that the serial console works on seaboard.

 Signed-off-by: Simon Glass s...@chromium.org

Can you please apply this fix?

 ---

  board/nvidia/seaboard/seaboard.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/board/nvidia/seaboard/seaboard.c 
 b/board/nvidia/seaboard/seaboard.c
 index 25480e4..2d07001 100644
 --- a/board/nvidia/seaboard/seaboard.c
 +++ b/board/nvidia/seaboard/seaboard.c
 @@ -20,7 +20,7 @@
  void gpio_early_init_uart(void)
  {
 /* Enable UART via GPIO_PI3 (port 8, bit 3) so serial console works 
 */
 -   gpio_request(GPIO_PI3, NULL);
 +   gpio_request(GPIO_PI3, uart_en);
 gpio_direction_output(GPIO_PI3, 0);
  }
  #endif
 --
 2.2.0.rc0.207.ga3a616c


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


Re: [U-Boot] [PATCH 06/20] tegra: spi: Drop the claim_bus() method to correct delays

2015-03-29 Thread Simon Glass
Hi Stephen,

On 25 February 2015 at 16:14, Stephen Warren swar...@wwwdotorg.org wrote:
 On 02/17/2015 03:29 PM, Simon Glass wrote:

 At present the driver does not properly honour the requested SPI CS
 deactivation delay since the SPI bus is changed in the claim_bus() method.

 Everything the claim_bus() method does can be done when the device is
 probed
 (setting the speed and mode) and at the start of a new transfer (where the
 fifo_status is already cleared). So drop this method.

 Also, until the delay is complete, we should not touch the bus, so make
 sure
 that spi_cs_activate() is called before other things are done in the
 xfer()
 method.


 diff --git a/drivers/spi/tegra114_spi.c b/drivers/spi/tegra114_spi.c


 -   setbits_le32(regs-command1, SPI_CMD1_M_S | SPI_CMD1_CS_SW_HW |
 -(priv-mode  SPI_CMD1_MODE_SHIFT));

 ...

 +   setbits_le32(priv-regs-command1, SPI_CMD1_M_S |
 SPI_CMD1_CS_SW_HW |
 +(priv-mode  SPI_CMD1_MODE_SHIFT) |
 SPI_CMD1_CS_SW_VAL);


 Is that addition of SPI_CMD1_CS_SW_VAL there relative to the old code
 intended?

Yes. To me it seems that we should set CS high when probing. Otherwise
the bus may sit low (enabled) until we do our first activate().

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


Re: [U-Boot] [PATCH v3 16/17] odroid: dts: add 'voltage-regulators' description to max77686 node

2015-03-29 Thread Simon Glass
On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 Adding regulators subnode to fdt max77686 node, allows properly init
 regulators by the max77686 regulator driver. This enables the complete
 functionality of the regulator command.

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 ---
 Changes V2:
 - odroid: dts: remove pmic alias

 Changes V3:
 - none
 ---
  arch/arm/dts/exynos4412-odroid.dts | 247 
 +
  1 file changed, 247 insertions(+)

Acked-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 14/17] dm: board:samsung: power_init_board: add requirement of CONFIG_DM_PMIC

2015-03-29 Thread Simon Glass
On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 In the power_init_board function call, regulator driver init is called,
 so before compile, make sure that any power framework is defined.

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 ---
  board/samsung/common/board.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Simon Glass s...@chromium.org



 diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
 index 2e17da8..c4cbb63 100644
 --- a/board/samsung/common/board.c
 +++ b/board/samsung/common/board.c
 @@ -21,9 +21,9 @@
  #include asm/arch/pinmux.h
  #include asm/arch/power.h
  #include asm/arch/system.h
 -#include power/pmic.h
  #include asm/arch/sromc.h
  #include lcd.h
 +#include i2c.h
  #include samsung/misc.h

  DECLARE_GLOBAL_DATA_PTR;
 @@ -168,7 +168,7 @@ int board_early_init_f(void)
  }
  #endif

 -#if defined(CONFIG_POWER)
 +#if defined(CONFIG_POWER) || defined(CONFIG_DM_PMIC)
  int power_init_board(void)
  {
 set_ps_hold_ctrl();
 --
 1.9.1

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


Re: [U-Boot] [PATCH v3 17/17] odroid: config: enable dm pmic, dm regulator and max77686 driver

2015-03-29 Thread Simon Glass
On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This change enables the configs required to init and setup max77686
 regulator driver, using the new driver model pmic and regulator API.

 This commits enables:
 - CONFIG_ERRNO_STR
 - CONFIG_DM_PMIC
 - CONFIG_DM_PMIC_CMD
 - CONFIG_DM_PMIC_MAX77686
 - CONFIG_DM_REGULATOR
 - CONFIG_DM_REGULATOR_CMD
 - CONFIG_DM_REGULATOR_MAX77686

 And removes the unused:
 - CONFIG_DM_I2C_COMPAT
 - CONFIG_POWER
 - CONFIG_POWER_I2C
 - CONFIG_POWER_MAX77686

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com

Acked-by: Simon Glass s...@chromium.org

(but pelase rename the commands so that they are CONFIG_CMD_DM_PCI and
CONFIG_CMD_DM_REGULATOR)

 ---
 Changes V2:
 - config: enable dm i2c; cleanup
 - remove CONFIG_DM_I2C_COMPAT
 - enable regulator command

 Changes V3:
 - move options to defconfig
 ---
  configs/odroid_defconfig | 8 +++-
  include/configs/odroid.h | 5 -
  2 files changed, 7 insertions(+), 6 deletions(-)

 diff --git a/configs/odroid_defconfig b/configs/odroid_defconfig
 index d32b5b5..1e29abe 100644
 --- a/configs/odroid_defconfig
 +++ b/configs/odroid_defconfig
 @@ -4,5 +4,11 @@ CONFIG_TARGET_ODROID=y
  CONFIG_OF_CONTROL=y
  CONFIG_DEFAULT_DEVICE_TREE=exynos4412-odroid
  CONFIG_DM_I2C=y
 -CONFIG_DM_I2C_COMPAT=y
  # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 +CONFIG_ERRNO_STR=y
 +CONFIG_DM_PMIC=y
 +CONFIG_DM_PMIC_CMD=y
 +CONFIG_DM_PMIC_MAX77686=y
 +CONFIG_DM_REGULATOR=y
 +CONFIG_DM_REGULATOR_CMD=y
 +CONFIG_DM_REGULATOR_MAX77686=y
 diff --git a/include/configs/odroid.h b/include/configs/odroid.h
 index 5ee0abe..3874baa 100644
 --- a/include/configs/odroid.h
 +++ b/include/configs/odroid.h
 @@ -182,11 +182,6 @@
  #define CONFIG_SYS_I2C_S3C24X0_SPEED   10
  #define CONFIG_SYS_I2C_S3C24X0_SLAVE   0

 -/* POWER */
 -#define CONFIG_POWER
 -#define CONFIG_POWER_I2C
 -#define CONFIG_POWER_MAX77686
 -
  /* GPT */
  #define CONFIG_RANDOM_UUID

 --
 1.9.1

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


Re: [U-Boot] [PATCH 6/6] arc: re-generate defconfigs

2015-03-29 Thread Masahiro Yamada
Hi Alexey,

2015-03-17 21:13 GMT+09:00 Alexey Brodkin alexey.brod...@synopsys.com:
 Before that moment our defconfigs were manually modified with addition
 of new options. That means once anybody wants to addd another option and

I just noticed a typo.  s/addd/add/

You need not to submit v2 for such a minor error.
Please fix it when you apply this patch, if you remember.



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


Re: [U-Boot] [PATCH v2] sunxi: Avoid any assumption between musb gadget and host but fallback to host

2015-03-29 Thread Hans de Goede

Hi,

On 28-03-15 18:26, Paul Kocialkowski wrote:

musb might be used in gadget mode on sunxi, so we don't want to assume anything
related to host mode, especially USB keyboard support. Thus, there is no reason
to keep USB_KEYBOARD always enabled and in Kconfig: it is much better fit to
enable it in the common sunxi config header, when needed (some devices also have
no USB support at all).

In case gadget mode is not explicitly enabled, this will fallback to host mode.

Signed-off-by: Paul Kocialkowski cont...@paulk.fr


Nack, I'm not going to take any patch which removes config USB_KEYBOARD,
having USB_KEYBOARD always enabled on devices with usb host capability
causes a significant penalty in boot time, and some people may want to turn
it off because of that.

Regards,

Hans




---
  board/sunxi/Kconfig| 7 ---
  configs/MSI_Primo73_defconfig  | 1 -
  configs/MSI_Primo81_defconfig  | 1 -
  include/configs/sunxi-common.h | 5 -
  4 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 57e7529..75e3fb3 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -452,13 +452,6 @@ config USB_MUSB_SUNXI
one usb host controller enabled at a time, so enabling this on boards
which also use the ehci host controller will result in build errors.

-config USB_KEYBOARD
-   boolean Enable USB keyboard support
-   default y
-   ---help---
-   Say Y here to add support for using a USB keyboard (typically used
-   in combination with a graphical console).
-
  config GMAC_TX_DELAY
int GMAC Transmit Clock Delay Chain
default 0
diff --git a/configs/MSI_Primo73_defconfig b/configs/MSI_Primo73_defconfig
index 5227b6f..f621237 100644
--- a/configs/MSI_Primo73_defconfig
+++ b/configs/MSI_Primo73_defconfig
@@ -14,7 +14,6 @@ CONFIG_VIDEO_LCD_DCLK_PHASE=0
  CONFIG_VIDEO_LCD_POWER=PH8
  CONFIG_VIDEO_LCD_BL_EN=PH7
  CONFIG_VIDEO_LCD_BL_PWM=PB2
-CONFIG_USB_KEYBOARD=n
  CONFIG_ARM=y
  CONFIG_ARCH_SUNXI=y
  CONFIG_MACH_SUN7I=y
diff --git a/configs/MSI_Primo81_defconfig b/configs/MSI_Primo81_defconfig
index b6aa876..4e1d167 100644
--- a/configs/MSI_Primo81_defconfig
+++ b/configs/MSI_Primo81_defconfig
@@ -20,7 +20,6 @@ CONFIG_VIDEO_LCD_SPI_MOSI=PH11
  CONFIG_VIDEO_LCD_SPI_MISO=PH12
  CONFIG_VIDEO_LCD_BL_EN=PA25
  CONFIG_VIDEO_LCD_BL_PWM=PH13
-CONFIG_USB_KEYBOARD=n
  CONFIG_ARM=y
  CONFIG_ARCH_SUNXI=y
  CONFIG_MACH_SUN6I=y
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index b9bb971..61a45e1 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -298,13 +298,16 @@ extern int soft_i2c_gpio_scl;
  #endif

  #ifdef CONFIG_USB_MUSB_SUNXI
+#ifndef CONFIG_MUSB_GADGET
  #define CONFIG_MUSB_HOST
+#endif
  #define CONFIG_MUSB_PIO_ONLY
  #endif

-#if defined CONFIG_USB_EHCI || defined CONFIG_USB_MUSB_SUNXI
+#if defined CONFIG_USB_EHCI || defined CONFIG_MUSB_HOST
  #define CONFIG_CMD_USB
  #define CONFIG_USB_STORAGE
+#define CONFIG_USB_KEYBOARD
  #endif

  #ifdef CONFIG_USB_KEYBOARD


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


[U-Boot] [PATCH v2 2/3] usb: Check usb_new_device for failure

2015-03-29 Thread Paul Kocialkowski
Signed-off-by: Paul Kocialkowski cont...@paulk.fr
---
 common/usb.c | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/common/usb.c b/common/usb.c
index ea5b406..67e2350 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -95,18 +95,24 @@ int usb_init(void)
start_index = dev_index;
printf(scanning bus %d for devices... , i);
dev = usb_alloc_new_device(ctrl);
+   if (!dev)
+   break;
+
/*
 * device 0 is always present
 * (root hub, so let it analyze)
 */
-   if (dev)
-   usb_new_device(dev);
+   ret = usb_new_device(dev);
+   if (ret)
+   usb_free_device();
 
-   if (start_index == dev_index)
+   if (start_index == dev_index) {
puts(No USB Device found\n);
-   else
+   continue;
+   } else {
printf(%d USB Device(s) found\n,
dev_index - start_index);
+   }
 
usb_started = 1;
}
-- 
1.9.1

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


[U-Boot] [PATCH v2 3/3] usb: Early failure when the first descriptor read fails or is invalid

2015-03-29 Thread Paul Kocialkowski
This may happen when using an USB1 device on a controller that only supports
USB2 (e.g. EHCI). Reading the first descriptor will fail (read 0 byte), so we
can abort the process at this point instead of failing later and wasting time.

Signed-off-by: Paul Kocialkowski cont...@paulk.fr
---
 common/usb.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/common/usb.c b/common/usb.c
index 67e2350..fb00c95 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -956,8 +956,8 @@ int usb_new_device(struct usb_device *dev)
 */
 #ifndef CONFIG_USB_XHCI
err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc, 64);
-   if (err  0) {
-   debug(usb_new_device: usb_get_descriptor() failed\n);
+   if (err  sizeof(struct usb_device_descriptor)) {
+   printf(usb_new_device: usb_get_descriptor() failed\n);
return -1;
}
 
@@ -996,6 +996,9 @@ int usb_new_device(struct usb_device *dev)
case 64:
dev-maxpacketsize = PACKET_SIZE_64;
break;
+   default:
+   printf(usb_new_device: invalid max packet size\n);
+   return -1;
}
dev-devnum = addr;
 
-- 
1.9.1

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


[U-Boot] [PATCH v2 1/3] usb: usb_new_device return codes consistency

2015-03-29 Thread Paul Kocialkowski
Signed-off-by: Paul Kocialkowski cont...@paulk.fr
---
 common/usb.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/usb.c b/common/usb.c
index 32e15cd..ea5b406 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -915,7 +915,7 @@ int usb_new_device(struct usb_device *dev)
if (err  8) {
printf(\n  USB device not responding,  \
   giving up (status=%lX)\n, dev-status);
-   return 1;
+   return -1;
}
memcpy(dev-descriptor, tmpbuf, 8);
 #else
@@ -952,7 +952,7 @@ int usb_new_device(struct usb_device *dev)
err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc, 64);
if (err  0) {
debug(usb_new_device: usb_get_descriptor() failed\n);
-   return 1;
+   return -1;
}
 
dev-descriptor.bMaxPacketSize0 = desc-bMaxPacketSize0;
@@ -968,7 +968,7 @@ int usb_new_device(struct usb_device *dev)
err = hub_port_reset(dev-parent, dev-portnr - 1, portstatus);
if (err  0) {
printf(\n Couldn't reset port %i\n, dev-portnr);
-   return 1;
+   return -1;
}
} else {
usb_reset_root_port();
@@ -1014,7 +1014,7 @@ int usb_new_device(struct usb_device *dev)
else
printf(USB device descriptor short read  \
(expected %i, got %i)\n, tmp, err);
-   return 1;
+   return -1;
}
memcpy(dev-descriptor, tmpbuf, sizeof(dev-descriptor));
/* correct le values */
-- 
1.9.1

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


Re: [U-Boot] [PATCH] usb: Early failure when the first descriptor read fails, one way or another

2015-03-29 Thread Paul Kocialkowski
   @@ -990,6 +990,9 @@ int usb_new_device(struct usb_device *dev)
 case 64:
 dev-maxpacketsize = PACKET_SIZE_64;
 break;
   + default:
   + debug(usb_new_device: invalid max packet size\n);
  
  Hi,
  
  since this is an error, this should probably be a printf(). Also,
  to make the error message useful, it should state the invalid value
  due to which it failed.
 
 Well, it is not unexpected behaviour in my use case (but I reckon it may
 be generally speaking). Plugging an USB1 device on a controller that
 doesn't support USB1 should normally fail, this is not some kind of
 run-time error.
 
 When this happens in Linux, it just fails (silently) and tries ohci
 instead. I'm afraid there is no such mechanism in U-Boot, so the best we
 can do is to treat the device as unsupported.
 
 If you're not convinced by this, I can still make a v2 with printf, I
 just don't think it's a necessity.

Nervermind this, I have sent out a v2 addressing you concern.

  Thanks!
  
   + return 1;
 }
 dev-devnum = addr;

-- 
Paul Kocialkowski, Replicant developer

Replicant is a fully free Android distribution running on several
devices, a free software mobile operating system putting the emphasis on
freedom and privacy/security.

Website: http://www.replicant.us/
Blog: http://blog.replicant.us/
Wiki/tracker/forums: http://redmine.replicant.us/


signature.asc
Description: This is a digitally signed message part
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, v3, 5/7] malloc_f: enable SYS_MALLOC_F by default if DM is on

2015-03-29 Thread Tom Rini
On Thu, Mar 19, 2015 at 07:42:55PM +0900, Masahiro Yamada wrote:

 This option has a bool type, not hex.
 Fix it and enable it if CONFIG_DM is on because Driver Model always
 requires malloc memory.  Devices are scanned twice, before/after
 relocation.  CONFIG_SYS_MALLOC_F should be enabled to use malloc
 memory before relocation.  As it is board-independent, handle it
 globally.
 
 Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
 Acked-by: Stephen Warren swar...@wwwdotorg.org
 Reviewed-by: Simon Glass s...@chromium.org
 Acked-by: Robert Baldyga r.bald...@samsung.com

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] allow LED initialization without STATUS_LED_BOOT

2015-03-29 Thread Bernhard Nortmann
For current U-Boot to initialize status LEDs via status_led_init(), it 
is required to have both CONFIG_STATUS_LED and STATUS_LED_BOOT defined. 
This may be a particular concern with GPIO LEDs, where __led_init() is 
required to correctly set up the GPIO (gpio_request and 
gpio_direction_output). Without STATUS_LED_BOOT the initialization isn't 
called, which could leave the user with a non-functional led command - 
due to the fact that the LED routines in gpio_led.c use gpio_set_value() 
just fine, but the GPIO never got set up properly in the first place.


I think having CONFIG_STATUS_LED is sufficient to justify a 
corresponding call to status_led_init(), even with no STATUS_LED_BOOT 
defined. To do so, common/board_r.c needs some way to call that routine 
either directly (which probably requires exposing it via status_led.h) 
or indirectly. For the latter, I've attached a patch that (ab)uses an 
invalid LED id in status_led_set() to enforce the init.


Regards, B. Nortmann


---
 common/board_r.c  | 10 +++---
 drivers/misc/status_led.c |  7 ---
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 0335f6b..c67f459 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -547,11 +547,15 @@ static int initr_kgdb(void)
 }
 #endif

-#if defined(CONFIG_STATUS_LED)  defined(STATUS_LED_BOOT)
+#ifdef CONFIG_STATUS_LED
 static int initr_status_led(void)
 {
+#ifdef STATUS_LED_BOOT
 status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING);
-
+#else
+/* use invalid LED id to enforce status_led_init() */
+status_led_set(-1, 0);
+#endif
 return 0;
 }
 #endif
@@ -838,7 +842,7 @@ init_fnc_t init_sequence_r[] = {
 || defined(CONFIG_M68K)
 timer_init,/* initialize timer */
 #endif
-#if defined(CONFIG_STATUS_LED)  defined(STATUS_LED_BOOT)
+#ifdef CONFIG_STATUS_LED
 initr_status_led,
 #endif
 /* PPC has a udelay(20) here dating from 2002. Why? */
diff --git a/drivers/misc/status_led.c b/drivers/misc/status_led.c
index ed9adb2..4751c8d 100644
--- a/drivers/misc/status_led.c
+++ b/drivers/misc/status_led.c
@@ -94,12 +94,13 @@ void status_led_set (int led, int state)
 {
 led_dev_t *ld;

-if (led  0 || led = MAX_LED_DEV)
-return;
-
+/* reordered, allows using invalid led ID to enforce init */
 if (!status_led_init_done)
 status_led_init ();

+if (led  0 || led = MAX_LED_DEV)
+return;
+
 ld = led_dev[led];

 ld-state = state;
--
2.0.5

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


[U-Boot] Generic stubs for GPIO LEDs

2015-03-29 Thread Bernhard Nortmann
For boards that support LEDs driven via GPIO (CONFIG_GPIO_LED), it may 
be useful to have some generic stubs (wrapper functions) for the 
colored LEDs. This allows definitions like:


#define GREEN_LED_GPIO  248 /* = PH24 */

#define STATUS_LED_BIT  GREEN_LED_GPIO
#define STATUS_LED_STATESTATUS_LED_OFF
#define STATUS_LED_PERIOD   (CONFIG_SYS_HZ / 2)

#define STATUS_LED_GREENGREEN_LED_GPIO

To keep this optional, it's probably best to introduce an additional 
configuration setting. I've chosen CONFIG_GPIO_LED_STUBS for that. 
Placing the code in drivers/misc/gpio_led.c also ensures that it 
automatically depends on CONFIG_GPIO_LED too.


Regards, B. Nortmann

---
 drivers/misc/gpio_led.c | 39 +++
 1 file changed, 39 insertions(+)

diff --git a/drivers/misc/gpio_led.c b/drivers/misc/gpio_led.c
index 3e95727..8f3bd9b 100644
--- a/drivers/misc/gpio_led.c
+++ b/drivers/misc/gpio_led.c
@@ -51,3 +51,42 @@ void __led_toggle(led_id_t mask)
 {
 gpio_set_value(mask, !gpio_get_value(mask));
 }
+
+#ifdef CONFIG_GPIO_LED_STUBS
+
+/* 'generic' override of colored LED stubs, to use GPIO functions 
instead */

+
+#ifdef STATUS_LED_RED
+void red_led_on(void) {
+__led_set(STATUS_LED_RED, STATUS_LED_ON);
+}
+void red_led_off(void) {
+__led_set(STATUS_LED_RED, STATUS_LED_OFF);
+}
+#endif
+#ifdef STATUS_LED_GREEN
+void green_led_on(void) {
+__led_set(STATUS_LED_GREEN, STATUS_LED_ON);
+}
+void green_led_off(void) {
+__led_set(STATUS_LED_GREEN, STATUS_LED_OFF);
+}
+#endif
+#ifdef STATUS_LED_YELLOW
+void yellow_led_on(void) {
+__led_set(STATUS_LED_YELLOW, STATUS_LED_ON);
+}
+void yellow_led_off(void) {
+__led_set(STATUS_LED_YELLOW, STATUS_LED_OFF);
+}
+#endif
+#ifdef STATUS_LED_BLUE
+void blue_led_on(void) {
+__led_set(STATUS_LED_BLUE, STATUS_LED_ON);
+}
+void blue_led_off(void) {
+__led_set(STATUS_LED_BLUE, STATUS_LED_OFF);
+}
+#endif
+
+#endif /* CONFIG_GPIO_LED_STUBS */
--
2.0.5

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


[U-Boot] [PATCH 3/7] sunxi: Ainol AW1 mmc0 card-detect pin

2015-03-29 Thread Paul Kocialkowski
Signed-off-by: Paul Kocialkowski cont...@paulk.fr
---
 configs/Ainol_AW1_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/Ainol_AW1_defconfig b/configs/Ainol_AW1_defconfig
index 5cb8fc1..e5c2e21 100644
--- a/configs/Ainol_AW1_defconfig
+++ b/configs/Ainol_AW1_defconfig
@@ -6,6 +6,7 @@
 CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS=AXP209_POWER
 CONFIG_FDTFILE=sun7i-a20-ainol-aw1.dtb
+CONFIG_MMC0_CD_PIN=PH1
 CONFIG_USB_MUSB_SUNXI=y
 CONFIG_USB0_VBUS_PIN=PB9
 CONFIG_USB0_VBUS_DET=AXP0-VBUS-DETECT
-- 
1.9.1

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


[U-Boot] [PATCH 2/7] sunxi: Ampe A76 mmc0 card-detect pin

2015-03-29 Thread Paul Kocialkowski
Signed-off-by: Paul Kocialkowski cont...@paulk.fr
---
 configs/Ampe_A76_defconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/Ampe_A76_defconfig b/configs/Ampe_A76_defconfig
index af8aefa..af7638d 100644
--- a/configs/Ampe_A76_defconfig
+++ b/configs/Ampe_A76_defconfig
@@ -1,9 +1,10 @@
 CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS=CONS_INDEX=2,AXP209_POWER
 CONFIG_FDTFILE=sun5i-a13-ampe-a76.dtb
+CONFIG_MMC0_CD_PIN=PG0
 CONFIG_USB_MUSB_SUNXI=y
 CONFIG_USB0_VBUS_PIN=PG12
-CONFIG_USB0_VBUS_DET=PG01
+CONFIG_USB0_VBUS_DET=PG1
 
CONFIG_VIDEO_LCD_MODE=x:800,y:480,depth:18,pclk_khz:33000,le:45,ri:82,up:22,lo:22,hs:1,vs:1,sync:3,vmode:0
 CONFIG_VIDEO_LCD_POWER=AXP0-0
 CONFIG_VIDEO_LCD_BL_EN=AXP0-1
-- 
1.9.1

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


Re: [U-Boot] [PATCH 2/6] ARM: at91: sama5: move the common part of configurations to at91-sama5_common.h

2015-03-29 Thread Andreas Bießmann
Hi Josh,

sorry for beeing late. I'd like to apply this one but it does not
cleanly. Could you please rebase on current master?

Andreas

On 19.11.14 12:03, Josh Wu wrote:
 Create a new configuration file: at91-sama5_common.h. Which include the
 configurations that reused by all SAMA5 chips.
 
 In the command header, we add the CMD_SETEXPR.
 
 NOTE: NOR flash definition should be put before including the common header.
 
 Signed-off-by: Josh Wu josh...@atmel.com
 ---
  include/configs/at91-sama5_common.h | 87 
 +
  include/configs/sama5d3_xplained.h  | 77 ++--
  include/configs/sama5d3xek.h| 83 +++
  include/configs/sama5d4_xplained.h  | 74 ++-
  include/configs/sama5d4ek.h | 75 ++--
  5 files changed, 103 insertions(+), 293 deletions(-)
  create mode 100644 include/configs/at91-sama5_common.h
 
 diff --git a/include/configs/at91-sama5_common.h 
 b/include/configs/at91-sama5_common.h
 new file mode 100644
 index 000..4fab41d
 --- /dev/null
 +++ b/include/configs/at91-sama5_common.h
 @@ -0,0 +1,87 @@
 +/*
 + * Common part of configuration settings for the SAMA5 board.
 + *
 + * Copyright (C) 2014 Atmel Corporation
 + * Josh Wu josh...@atmel.com
 + *
 + * SPDX-License-Identifier:  GPL-2.0+
 + */
 +
 +#ifndef __CONFIG_AT91_SAMA5_H
 +#define __CONFIG_AT91_SAMA5_H
 +
 +#include asm/hardware.h
 +
 +#define CONFIG_SYS_TEXT_BASE 0x26f0
 +
 +/* ARM asynchronous clock */
 +#define CONFIG_SYS_AT91_SLOW_CLOCK  32768
 +#define CONFIG_SYS_AT91_MAIN_CLOCK  1200 /* from 12 MHz crystal */
 +
 +#define CONFIG_ARCH_CPU_INIT
 +
 +#ifndef CONFIG_SPL_BUILD
 +#define CONFIG_SKIP_LOWLEVEL_INIT
 +#endif
 +
 +#define CONFIG_BOARD_EARLY_INIT_F
 +#define CONFIG_DISPLAY_CPUINFO
 +
 +#define CONFIG_CMD_BOOTZ
 +#define CONFIG_OF_LIBFDT /* Device Tree support */
 +
 +#define CONFIG_SYS_GENERIC_BOARD
 +
 +/* general purpose I/O */
 +#define CONFIG_AT91_GPIO
 +
 +#define CONFIG_BOOTDELAY 3
 +
 +/*
 + * BOOTP options
 + */
 +#define CONFIG_BOOTP_BOOTFILESIZE
 +#define CONFIG_BOOTP_BOOTPATH
 +#define CONFIG_BOOTP_GATEWAY
 +#define CONFIG_BOOTP_HOSTNAME
 +
 +/*
 + * Command line configuration.
 + */
 +#include config_cmd_default.h
 +#undef CONFIG_CMD_FPGA
 +#undef CONFIG_CMD_IMI
 +#undef CONFIG_CMD_LOADS
 +#define CONFIG_CMD_PING
 +#define CONFIG_CMD_DHCP
 +#define CONFIG_CMD_SETEXPR
 +
 +#ifdef CONFIG_SYS_USE_MMC
 +#define CONFIG_BOOTARGS  
 \
 + console=ttyS0,115200 earlyprintk  \
 + root=/dev/mmcblk0p2 rw rootwait
 +#else
 +#define CONFIG_BOOTARGS  
 \
 + console=ttyS0,115200 earlyprintk  \
 + mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,  \
 + 256K(env),256k(evn_redundent),256k(spare),\
 + 512k(dtb),6M(kernel)ro,-(rootfs)  \
 + rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs
 +#endif
 +
 +#define CONFIG_BAUDRATE  115200
 +
 +#define CONFIG_SYS_PROMPTU-Boot 
 +#define CONFIG_SYS_CBSIZE256
 +#define CONFIG_SYS_MAXARGS   16
 +#define CONFIG_SYS_PBSIZE(CONFIG_SYS_CBSIZE + \
 + sizeof(CONFIG_SYS_PROMPT) + 16)
 +#define CONFIG_SYS_LONGHELP
 +#define CONFIG_CMDLINE_EDITING
 +#define CONFIG_AUTO_COMPLETE
 +#define CONFIG_SYS_HUSH_PARSER
 +
 +/* Size of malloc() pool */
 +#define CONFIG_SYS_MALLOC_LEN(4 * 1024 * 1024)
 +
 +#endif
 \ No newline at end of file
 diff --git a/include/configs/sama5d3_xplained.h 
 b/include/configs/sama5d3_xplained.h
 index d24d600..75c3be6 100644
 --- a/include/configs/sama5d3_xplained.h
 +++ b/include/configs/sama5d3_xplained.h
 @@ -10,30 +10,10 @@
  #ifndef __CONFIG_H
  #define __CONFIG_H
  
 -#include asm/hardware.h
 -
 -#define CONFIG_SYS_TEXT_BASE 0x26f0
 -
 -/* ARM asynchronous clock */
 -#define CONFIG_SYS_AT91_SLOW_CLOCK  32768
 -#define CONFIG_SYS_AT91_MAIN_CLOCK  1200 /* from 12 MHz crystal */
 -
 -#define CONFIG_ARCH_CPU_INIT
 -
 -#ifndef CONFIG_SPL_BUILD
 -#define CONFIG_SKIP_LOWLEVEL_INIT
 -#endif
 -
 -#define CONFIG_BOARD_EARLY_INIT_F
 -#define CONFIG_DISPLAY_CPUINFO
 -
 -#define CONFIG_CMD_BOOTZ
 -#define CONFIG_OF_LIBFDT /* Device Tree support */
 -
 -#define CONFIG_SYS_GENERIC_BOARD
 +/* No NOR flash, this definition should put before common header */
 +#define CONFIG_SYS_NO_FLASH
  
 -/* general purpose I/O */
 -#define CONFIG_AT91_GPIO
 +#include at91-sama5_common.h
  
  /* serial console */
  #define CONFIG_ATMEL_USART
 @@ -51,29 +31,6 @@
   */
  #define ATMEL_PMC_UHPAT91SAM926x_PMC_UHP
  
 -#define CONFIG_BOOTDELAY 3
 -
 -/*
 - * BOOTP 

Re: [U-Boot] U-boot and UBI problem with vexpress board.

2015-03-29 Thread mar.krzeminski

Hi,

It seem that I have found the root cause of the problem.
This board in qemu is set in this way, that device width is set to 2 and 
interface to 4.
That is why CFI driver in u-boot calculates wrongly sector size ( 
because size ratio variable was wrong ),

so in the end every odd sector (counting from 0 ) was not available.
I've changed vexpress board code in qemu and for now it is working.
I do not have real vexpress board to check if the root cause is u-boot 
or qemu,
but i think CFI driver i popular so propapbly there is something wrong 
in qemu site.


Regards,
Marcin


W dniu 27.03.2015 o 16:53, mar.krzeminski pisze:

Hi Stefan,

I've changed malloc pool size to 2MiB and nothing changed.
I've also disabled UBIFS support and that does not make any changes.
Still after qemu restart u-boot can not attach to ubi device.

Regards,
Marcin

W dniu 27.03.2015 o 16:01, Stefan Roese pisze:

Hi Marcin,

On 27.03.2015 13:59, Marcin Krzemiński wrote:
I want to test some UBI fs behavior in U-Boot using qemu and 
vexpress_ca9x4

board ( U-Boot 2015.1)
To tst UBI I added lines to vexpress_ca9x4.h:

#define CONFIG_MTD_DEVICE   /* needed for mtdparts commands */
#define CONFIG_MTD_PARTITIONS   /* needed for UBI */
#define CONFIG_FLASH_CFI_MTD
#define MTDIDS_DEFAULT  nor0=flash0-0
#define MTDPARTS_DEFAULT mtdparts=flash0-0:1m(empty),10m(ubi),-(rest)
#define CONFIG_LZO  /* needed for UBI */
#define CONFIG_RBTREE   /* needed for UBI */
#define CONFIG_CMD_MTDPARTS
#define CONFIG_CMD_UBI
#define CONFIG_CMD_UBIFS
#define CONFIG_FIT

also I've changed malloc pool size to 512kB in vexpress_common.h:
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 512 * 1024)


Without looking deeper into your mail, I would recommend to increase 
the malloc size to at least 2MiB and test again.


Thanks,
Stefan






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


Re: [U-Boot] [PATCH 2/2] spi: cf_spi: Staticize local functions

2015-03-29 Thread Jagan Teki
On 20 February 2015 at 21:49, Axel Lin axel@ingics.com wrote:
 Make local functions static and remove unneeded forward declarations.

 Signed-off-by: Axel Lin axel@ingics.com
 ---
  drivers/spi/cf_spi.c | 20 +++-
  1 file changed, 7 insertions(+), 13 deletions(-)

 diff --git a/drivers/spi/cf_spi.c b/drivers/spi/cf_spi.c
 index 7453538..6ce1101 100644
 --- a/drivers/spi/cf_spi.c
 +++ b/drivers/spi/cf_spi.c
 @@ -20,13 +20,6 @@ struct cf_spi_slave {
 int charbit;
  };

 -int cfspi_xfer(struct spi_slave *slave, uint bitlen, const void *dout,
 -  void *din, ulong flags);
 -struct spi_slave *cfspi_setup_slave(struct cf_spi_slave *cfslave, uint mode);
 -void cfspi_init(void);
 -void cfspi_tx(u32 ctrl, u16 data);
 -u16 cfspi_rx(void);
 -
  extern void cfspi_port_conf(void);
  extern int cfspi_claim_bus(uint bus, uint cs);
  extern void cfspi_release_bus(uint bus, uint cs);
 @@ -51,7 +44,7 @@ static inline struct cf_spi_slave *to_cf_spi_slave(struct 
 spi_slave *slave)
 return container_of(slave, struct cf_spi_slave, slave);
  }

 -void cfspi_init(void)
 +static void cfspi_init(void)
  {
 volatile dspi_t *dspi = (dspi_t *) MMAP_DSPI;

 @@ -89,7 +82,7 @@ void cfspi_init(void)
  #endif
  }

 -void cfspi_tx(u32 ctrl, u16 data)
 +static void cfspi_tx(u32 ctrl, u16 data)
  {
 volatile dspi_t *dspi = (dspi_t *) MMAP_DSPI;

 @@ -98,7 +91,7 @@ void cfspi_tx(u32 ctrl, u16 data)
 dspi-tfr = (ctrl | data);
  }

 -u16 cfspi_rx(void)
 +static u16 cfspi_rx(void)
  {
 volatile dspi_t *dspi = (dspi_t *) MMAP_DSPI;

 @@ -107,8 +100,8 @@ u16 cfspi_rx(void)
 return (dspi-rfr  0x);
  }

 -int cfspi_xfer(struct spi_slave *slave, uint bitlen, const void *dout,
 -  void *din, ulong flags)
 +static int cfspi_xfer(struct spi_slave *slave, uint bitlen, const void *dout,
 + void *din, ulong flags)
  {
 struct cf_spi_slave *cfslave = to_cf_spi_slave(slave);
 u16 *spi_rd16 = NULL, *spi_wr16 = NULL;
 @@ -181,7 +174,8 @@ int cfspi_xfer(struct spi_slave *slave, uint bitlen, 
 const void *dout,
 return 0;
  }

 -struct spi_slave *cfspi_setup_slave(struct cf_spi_slave *cfslave, uint mode)
 +static struct spi_slave *cfspi_setup_slave(struct cf_spi_slave *cfslave,
 +  uint mode)
  {
 /*
  * bit definition for mode:
 --
 1.9.1




Applied to u-boot-spi/master

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


Re: [U-Boot] [PATCH] spi: designware_spi: revisit FIFO size detection again

2015-03-29 Thread Jagan Teki
On 28 February 2015 at 00:49, Pavel Machek pa...@denx.de wrote:
 On Thu 2015-02-26 10:45:22, Axel Lin wrote:
 By specification the FIFO size would be in a range 2-256 bytes. From TX Level
 prospective it means we can set threshold in the range 0-(FIFO size - 1) 
 bytes.
 Hence there are currently two issues:
   a) FIFO size 2 bytes is actually skipped since TX Level is 1 bit and could 
 be
  either 0 or 1 byte;
   b) FIFO size is incorrectly decreased by 1 which already done by meaning of
  TX Level register.

 Fixes: 501943696ea4 (spi: designware_spi: Fix detecting FIFO depth)
 Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com
 Signed-off-by: Axel Lin axel@ingics.com

 Acked-by: Pavel Machek pa...@denx.de

 ---
 This fix is from linux-spi tree:
 http://git.kernel.org/cgit/linux/kernel/git/broonie/spi.git/commit/?h=for-linusid=9d239d353c319f9ff884c287ce47feb7cdf60ddc

  drivers/spi/designware_spi.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c
 index 2624844..8f5c0fc 100644
 --- a/drivers/spi/designware_spi.c
 +++ b/drivers/spi/designware_spi.c
 @@ -164,13 +164,13 @@ static void spi_hw_init(struct dw_spi_priv *priv)
   if (!priv-fifo_len) {
   u32 fifo;

 - for (fifo = 2; fifo = 256; fifo++) {
 + for (fifo = 1; fifo  256; fifo++) {
   dw_writew(priv, DW_SPI_TXFLTR, fifo);
   if (fifo != dw_readw(priv, DW_SPI_TXFLTR))
   break;
   }

 - priv-fifo_len = (fifo == 2) ? 0 : fifo - 1;
 + priv-fifo_len = (fifo == 1) ? 0 : fifo;
   dw_writew(priv, DW_SPI_TXFLTR, 0);
   }
   debug(%s: fifo_len=%d\n, __func__, priv-fifo_len);

 --
 (english) http://www.livejournal.com/~pavelmachek
 (cesky, pictures) 
 http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Applied to u-boot-spi/master

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


Re: [U-Boot] [PATCH 1/2] spi: cf_spi: Use to_cf_spi_slave to resolve cfslave from slave

2015-03-29 Thread Jagan Teki
On 20 February 2015 at 21:47, Axel Lin axel@ingics.com wrote:
 Don't assume slave is always the first member of struct cf_spi_slave.
 Use container_of instead of casting first structure member.

 Signed-off-by: Axel Lin axel@ingics.com
 ---
  drivers/spi/cf_spi.c | 11 +--
  1 file changed, 9 insertions(+), 2 deletions(-)

 diff --git a/drivers/spi/cf_spi.c b/drivers/spi/cf_spi.c
 index 879a809..7453538 100644
 --- a/drivers/spi/cf_spi.c
 +++ b/drivers/spi/cf_spi.c
 @@ -46,6 +46,11 @@ DECLARE_GLOBAL_DATA_PTR;
  #define SPI_MODE_MOD   0x0020
  #define SPI_DBLRATE0x0010

 +static inline struct cf_spi_slave *to_cf_spi_slave(struct spi_slave *slave)
 +{
 +   return container_of(slave, struct cf_spi_slave, slave);
 +}
 +
  void cfspi_init(void)
  {
 volatile dspi_t *dspi = (dspi_t *) MMAP_DSPI;
 @@ -105,7 +110,7 @@ u16 cfspi_rx(void)
  int cfspi_xfer(struct spi_slave *slave, uint bitlen, const void *dout,
void *din, ulong flags)
  {
 -   struct cf_spi_slave *cfslave = (struct cf_spi_slave *)slave;
 +   struct cf_spi_slave *cfslave = to_cf_spi_slave(slave);
 u16 *spi_rd16 = NULL, *spi_wr16 = NULL;
 u8 *spi_rd = NULL, *spi_wr = NULL;
 static u32 ctrl = 0;
 @@ -326,7 +331,9 @@ struct spi_slave *spi_setup_slave(unsigned int bus, 
 unsigned int cs,

  void spi_free_slave(struct spi_slave *slave)
  {
 -   free(slave);
 +   struct cf_spi_slave *cfslave = to_cf_spi_slave(slave);
 +
 +   free(cfslave);
  }

  int spi_claim_bus(struct spi_slave *slave)
 --
 1.9.1




Applied to u-boot-spi/master

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


[U-Boot] [PATCH] m68k: add architecture-specific u-boot.lds

2015-03-29 Thread Angelo Dureghello
Add architecture-specific u-boot.lds and remove all board-specific
u-boot.lds.

All the .text customization that was board-specific have been
moved inside the related include/configs, inside a
LDS_BOARD_TEXT define.

Signed-off-by: Angelo Dureghello ang...@sysam.it
---
 arch/m68k/cpu/u-boot.lds | 91 
 board/BuS/eb_cpu5282/u-boot.lds  | 82 
 board/astro/mcf5373l/u-boot.lds  | 86 --
 board/cobra5272/u-boot.lds   | 85 -
 board/freescale/m5208evbe/u-boot.lds | 86 --
 board/freescale/m52277evb/u-boot.lds | 85 -
 board/freescale/m5235evb/u-boot.lds  | 85 -
 board/freescale/m5249evb/u-boot.lds  | 85 -
 board/freescale/m5253demo/u-boot.lds | 86 --
 board/freescale/m5253evbe/u-boot.lds | 85 -
 board/freescale/m5272c3/u-boot.lds   | 85 -
 board/freescale/m5275evb/u-boot.lds  | 85 -
 board/freescale/m5282evb/u-boot.lds  | 85 -
 board/freescale/m53017evb/u-boot.lds | 86 --
 board/freescale/m5329evb/u-boot.lds  | 86 --
 board/freescale/m5373evb/u-boot.lds  | 86 --
 board/freescale/m54418twr/u-boot.lds | 83 
 board/freescale/m54451evb/u-boot.lds | 83 
 board/freescale/m54455evb/u-boot.lds | 83 
 board/freescale/m547xevb/u-boot.lds  | 83 
 board/freescale/m548xevb/u-boot.lds  | 83 
 board/sysam/amcore/u-boot.lds| 87 --
 include/configs/M5208EVBE.h  |  4 ++
 include/configs/M52277EVB.h  |  4 ++
 include/configs/M5235EVB.h   |  5 ++
 include/configs/M5249EVB.h   |  5 ++
 include/configs/M5253DEMO.h  |  4 ++
 include/configs/M5253EVBE.h  |  5 ++
 include/configs/M5272C3.h|  4 ++
 include/configs/M5275EVB.h   |  4 ++
 include/configs/M5282EVB.h   |  4 ++
 include/configs/M53017EVB.h  |  4 ++
 include/configs/M5329EVB.h   |  4 ++
 include/configs/M5373EVB.h   |  4 ++
 include/configs/amcore.h |  4 ++
 include/configs/astro_mcf5373l.h |  4 ++
 include/configs/cobra5272.h  |  3 ++
 37 files changed, 153 insertions(+), 1780 deletions(-)
 create mode 100644 arch/m68k/cpu/u-boot.lds
 delete mode 100644 board/BuS/eb_cpu5282/u-boot.lds
 delete mode 100644 board/astro/mcf5373l/u-boot.lds
 delete mode 100644 board/cobra5272/u-boot.lds
 delete mode 100644 board/freescale/m5208evbe/u-boot.lds
 delete mode 100644 board/freescale/m52277evb/u-boot.lds
 delete mode 100644 board/freescale/m5235evb/u-boot.lds
 delete mode 100644 board/freescale/m5249evb/u-boot.lds
 delete mode 100644 board/freescale/m5253demo/u-boot.lds
 delete mode 100644 board/freescale/m5253evbe/u-boot.lds
 delete mode 100644 board/freescale/m5272c3/u-boot.lds
 delete mode 100644 board/freescale/m5275evb/u-boot.lds
 delete mode 100644 board/freescale/m5282evb/u-boot.lds
 delete mode 100644 board/freescale/m53017evb/u-boot.lds
 delete mode 100644 board/freescale/m5329evb/u-boot.lds
 delete mode 100644 board/freescale/m5373evb/u-boot.lds
 delete mode 100644 board/freescale/m54418twr/u-boot.lds
 delete mode 100644 board/freescale/m54451evb/u-boot.lds
 delete mode 100644 board/freescale/m54455evb/u-boot.lds
 delete mode 100644 board/freescale/m547xevb/u-boot.lds
 delete mode 100644 board/freescale/m548xevb/u-boot.lds
 delete mode 100644 board/sysam/amcore/u-boot.lds

diff --git a/arch/m68k/cpu/u-boot.lds b/arch/m68k/cpu/u-boot.lds
new file mode 100644
index 000..d8dc715
--- /dev/null
+++ b/arch/m68k/cpu/u-boot.lds
@@ -0,0 +1,91 @@
+/*
+ * (C) Copyright 2000
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ * (C) Copyright 2015
+ * Angelo Dureghello, Sysam Firmware, ang...@sysam.it
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include config.h
+
+OUTPUT_ARCH(m68k)
+
+#ifndef LDS_BOARD_TEXT
+#define LDS_BOARD_TEXT
+#endif
+
+SECTIONS
+{
+   .text :
+   {
+   CPUDIR/start.o (.text*)
+   LDS_BOARD_TEXT
+
+   *(.text*)
+   }
+   _etext = .;
+   PROVIDE (etext = .);
+   .rodata :
+   {
+   *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
+   }
+
+   /* Read-write section, merged into data segment: */
+   . = (. + 0x00FF)  0xFF00;
+   _erotext = .;
+   PROVIDE (erotext = .);
+
+   .reloc :
+   {
+   __got_start = .;
+   KEEP(*(.got))
+   __got_end = .;
+   

Re: [U-Boot] [PATCH 1/2] spl_atmel.c: Switch s_init to board_init_f

2015-03-29 Thread Andreas Bießmann
Hi Tom,

rebased and tried to apply, but unfortuantely this breaks SPL for at91
armv7 boards:

05: spl_atmel.c: Switch s_init to board_init_f
   arm:  +   sama5d3xek_mmc sama5d3xek_nandflash sama5d3xek_spiflash
sama5d4_xplained_mmc sama5d4ek_nandflash
+arch/arm/cpu/armv7/built-in.o: In function `lowlevel_init':
+build/../arch/arm/cpu/armv7/lowlevel_init.S:57: undefined reference to
`s_init'
+make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2

I have to provide an empty s_init() to compile cleanly. Are you fine
with just adopting your patch or would you like to repost?

Andreas

On 11.02.15 01:07, Tom Rini wrote:
 To facilitate changing lowlevel_init to become s_init, move the current
 contents of s_init into board_init_f and add the rest of what
 board_init_f does here.
 
 Cc: Bo Shen voice.s...@atmel.com
 Cc: Andreas Bießmann andreas.de...@googlemail.com
 Tested-by: Matt Porter mpor...@konsulko.com on sama5d3_xplained
 Signed-off-by: Tom Rini tr...@ti.com
 ---
  arch/arm/cpu/at91-common/spl_atmel.c |7 ++-
  1 file changed, 6 insertions(+), 1 deletion(-)
 
 diff --git a/arch/arm/cpu/at91-common/spl_atmel.c 
 b/arch/arm/cpu/at91-common/spl_atmel.c
 index 7297530..d815050 100644
 --- a/arch/arm/cpu/at91-common/spl_atmel.c
 +++ b/arch/arm/cpu/at91-common/spl_atmel.c
 @@ -58,7 +58,7 @@ static void switch_to_main_crystal_osc(void)
   writel(tmp, pmc-mor);
  }
  
 -void s_init(void)
 +void board_init_f(ulong dummy)
  {
   switch_to_main_crystal_osc();
  
 @@ -77,4 +77,9 @@ void s_init(void)
   preloader_console_init();
  
   mem_init();
 +
 + /* Clear the BSS. */
 + memset(__bss_start, 0, __bss_end - __bss_start);
 +
 + board_init_r(NULL, 0);
  }
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot